@usine/server 0.4.1-next.264.gfdecd7e → 0.4.1-next.265.g59d6496
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.
- package/README.md +2 -0
- package/dist/http.d.ts.map +1 -1
- package/dist/http.js +2 -0
- package/dist/http.js.map +1 -1
- package/dist/up.d.ts.map +1 -1
- package/dist/up.js +3 -1
- package/dist/up.js.map +1 -1
- package/dist/web/assets/_agent-_6-dDU4o.js +1 -0
- package/dist/web/assets/_label-B2hIQTiP.js +1 -0
- package/dist/web/assets/_loop-DvEDblaI.js +1 -0
- package/dist/web/assets/_name-CGGRdFfK.js +1 -0
- package/dist/web/assets/_name-DXMuBR5m.js +1 -0
- package/dist/web/assets/_name-Jq31XnPR.js +1 -0
- package/dist/web/assets/_name-z-THY2_h.js +2 -0
- package/dist/web/assets/{_number-CpU9ru_u.js → _number-DPBp5g17.js} +1 -1
- package/dist/web/assets/_number-DdeVk37S.js +1 -0
- package/dist/web/assets/_number-Jq31XnPR.js +1 -0
- package/dist/web/assets/_run-CdbRrREt.js +5 -0
- package/dist/web/assets/_run-Jq31XnPR.js +1 -0
- package/dist/web/assets/_worker-Kb3E2cex.js +1 -0
- package/dist/web/assets/action-BbYQzHVY.js +1 -0
- package/dist/web/assets/agents-aKrqbR-m.js +1 -0
- package/dist/web/assets/agents-ySzr8fy8.js +1 -0
- package/dist/web/assets/code-block-CjNdHwJz.js +4 -0
- package/dist/web/assets/collapsible-iYmFtriP.js +1 -0
- package/dist/web/assets/drawer-jppXFu1P.js +1 -0
- package/dist/web/assets/dropdown-menu-CFZLqcex.js +1 -0
- package/dist/web/assets/edit-and-retry-DE8DjLVA.js +1 -0
- package/dist/web/assets/{error-alert-hABzwCSY.js → error-alert-BVIxPJFU.js} +1 -1
- package/dist/web/assets/{file-error-B5tv6DhJ.js → file-error-DhZlb2_Y.js} +1 -1
- package/dist/web/assets/heading-D62nMA3C.js +1 -0
- package/dist/web/assets/{history-PYEz5wbe.js → history-DkNNnV6Y.js} +1 -1
- package/dist/web/assets/identity-DlGZ_gKf.js +1 -0
- package/dist/web/assets/index-B3ZB08sw.css +2 -0
- package/dist/web/assets/index-BdDPka5v.js +10 -0
- package/dist/web/assets/{label-badge-JdNthOHh.js → label-badge-d6omX3Kx.js} +1 -1
- package/dist/web/assets/labels-B7V9VhjQ.js +1 -0
- package/dist/web/assets/list-CMj9dgxo.js +1 -0
- package/dist/web/assets/loops-w6ia_oEU.js +1 -0
- package/dist/web/assets/mark-B8EExm_5.js +1 -0
- package/dist/web/assets/model-0V8C6gKN.js +1 -0
- package/dist/web/assets/moves-B2I_hBZb.js +1 -0
- package/dist/web/assets/{not-found-D7GT8Sj7.js → not-found-hL2Tp5vW.js} +1 -1
- package/dist/web/assets/outcome-xmjRsDh1.js +5 -0
- package/dist/web/assets/{overview-C73v5kbv.js → overview-BixI1Gdc.js} +1 -1
- package/dist/web/assets/{page-C47YAWAl.js → page-BLxt7Xfg.js} +1 -1
- package/dist/web/assets/pull-request-marks-BIB-F5Bo.js +1 -0
- package/dist/web/assets/repositories-DhkeCOwR.js +1 -0
- package/dist/web/assets/route-D0B3Tsri.js +1 -0
- package/dist/web/assets/route-NFcp08tu.js +1 -0
- package/dist/web/assets/{routes-g6SHTgCO.js → routes-BHwcH9Lh.js} +17 -17
- package/dist/web/assets/routes-Jq31XnPR.js +1 -0
- package/dist/web/assets/run-again-DSDtftlB.js +1 -0
- package/dist/web/assets/{section-BZs0sQLB.js → section-BP8TxDno.js} +1 -1
- package/dist/web/assets/section-D4djNiAN.js +24 -0
- package/dist/web/assets/settings-0NNJ2XzL.js +1 -0
- package/dist/web/assets/{sortable.esm-Lp8AM6j2.js → sortable.esm-JyniDt4R.js} +1 -1
- package/dist/web/assets/strings-BeaABxX0.js +311 -0
- package/dist/web/assets/{strings-Bexnszes.js → strings-Bs2WdZYo.js} +1 -1
- package/dist/web/assets/tasks-Jq31XnPR.js +1 -0
- package/dist/web/assets/tasks-x2oa1Rt3.js +1 -0
- package/dist/web/assets/usage-C27cuo6g.js +1 -0
- package/dist/web/assets/useAnchoredPopupScrollLock-DEVFEHhP.js +1 -0
- package/dist/web/assets/usePositioner-BeAdUrxb.js +1 -0
- package/dist/web/assets/useScrollLock-77tiYKUD.js +1 -0
- package/dist/web/assets/workers-jjiTPmGP.js +1 -0
- package/dist/web/index.html +10 -19
- package/package.json +9 -9
- package/dist/web/assets/Match-BsHjCE-9.js +0 -1
- package/dist/web/assets/_agent-CK1JZbEZ.js +0 -1
- package/dist/web/assets/_label-CkDrdgxa.js +0 -1
- package/dist/web/assets/_loop-DLKJmqFq.js +0 -1
- package/dist/web/assets/_name--06G9LKw.js +0 -1
- package/dist/web/assets/_name-BzeOsU08.js +0 -1
- package/dist/web/assets/_name-CCrJHJTI.js +0 -1
- package/dist/web/assets/_name-LWtfT5Eq.js +0 -2
- package/dist/web/assets/_number-BzeOsU08.js +0 -1
- package/dist/web/assets/_number-n4iejSEq.js +0 -1
- package/dist/web/assets/_run-BzeOsU08.js +0 -1
- package/dist/web/assets/_run-CHrGLkXR.js +0 -5
- package/dist/web/assets/_worker-BvlkSKMd.js +0 -1
- package/dist/web/assets/action-DQzkdVHs.js +0 -1
- package/dist/web/assets/actions-CG0hkpe7.js +0 -1
- package/dist/web/assets/agents-CgWsAMoz.js +0 -1
- package/dist/web/assets/agents-D3eAK_60.js +0 -1
- package/dist/web/assets/code-block-Y9Y-8fHK.js +0 -4
- package/dist/web/assets/collapsible-BKcakxvM.js +0 -1
- package/dist/web/assets/drawer-ClcvABkO.js +0 -1
- package/dist/web/assets/dropdown-menu-BHKHYfLs.js +0 -1
- package/dist/web/assets/edit-and-retry-DZ5FH7N6.js +0 -1
- package/dist/web/assets/heading-zIOXe3qT.js +0 -1
- package/dist/web/assets/index-C_S4sA5L.css +0 -2
- package/dist/web/assets/index-Dki55xSv.js +0 -10
- package/dist/web/assets/labels-Dr9t-xYj.js +0 -1
- package/dist/web/assets/lazyRouteComponent-BnRF0Crs.js +0 -1
- package/dist/web/assets/list-NcxSR9Ja.js +0 -1
- package/dist/web/assets/loops-DI4kElkX.js +0 -1
- package/dist/web/assets/mark-uyeJ8aPC.js +0 -1
- package/dist/web/assets/model-87X7P9Uh.js +0 -1
- package/dist/web/assets/moves-DS1ecXd6.js +0 -1
- package/dist/web/assets/outcome-DvqnSso3.js +0 -5
- package/dist/web/assets/preload-helper-BLdHbfdN.js +0 -1
- package/dist/web/assets/pull-request-marks-B4f7z4xa.js +0 -1
- package/dist/web/assets/queries-BZMW2wiD.js +0 -1
- package/dist/web/assets/queries-oea_Y4on.js +0 -1
- package/dist/web/assets/repositories-CZBhubWh.js +0 -1
- package/dist/web/assets/route-BtU2HI1M.js +0 -1
- package/dist/web/assets/route-CD6OvH-7.js +0 -1
- package/dist/web/assets/route-status-DGpeFNCC.js +0 -1
- package/dist/web/assets/routes-BzeOsU08.js +0 -1
- package/dist/web/assets/run-again-DPa5c27z.js +0 -1
- package/dist/web/assets/section-eyIYzZrG.js +0 -24
- package/dist/web/assets/settings-DusVdmgP.js +0 -1
- package/dist/web/assets/skeleton-87E84B2f.js +0 -1
- package/dist/web/assets/strings-DXB6PB2g.js +0 -311
- package/dist/web/assets/tasks-BzeOsU08.js +0 -1
- package/dist/web/assets/tasks-ClShPUFW.js +0 -1
- package/dist/web/assets/usage-BMYuEDo9.js +0 -1
- package/dist/web/assets/use-open-run-B8nD_BT1.js +0 -1
- package/dist/web/assets/useAnchoredPopupScrollLock-NN99o6YU.js +0 -1
- package/dist/web/assets/useSelector-CRBsgquS.js +0 -1
- package/dist/web/assets/useSuspenseQuery-DbhQN-t-.js +0 -1
- package/dist/web/assets/visuallyHidden-BUGCJ1D9.js +0 -1
- package/dist/web/assets/workers-CDWbu1Tb.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{A as e,T as t,h as n}from"./overview-
|
|
1
|
+
import{A as e,T as t,h as n}from"./overview-BixI1Gdc.js";import{Ft as r,t as i}from"./strings-BeaABxX0.js";import{i as a}from"./model-0V8C6gKN.js";var o=e=>{let t=e.attempts.at(-1)?.outcome;return t?._tag===`Failed`&&t.failure._tag===`QuestionFailure`},s=({reason:e})=>e._tag===`LoopPaused`,c=({loop:s,reason:c},l)=>r(c,{AwaitingApproval:()=>`Waiting for approval`,SuppressedForOperator:({run:e})=>o(e)?`Question from the agent`:`Blocked by the agent`,CycleBudgetUsedUp:({ask:e})=>`Cycle budget used, ${e.limit} rounds`,RunFailed:({run:e})=>{let t=e.attempts.at(-1)?.outcome,r=t?._tag===`Failed`?`: ${n(t.failure)}`:``;return`Failed ${i(a(e),l)}${r}`},ClosedUnchanged:({run:e})=>`${e.state===`Succeeded`?`Succeeded`:`Canceled`} ${i(a(e),l)}, unchanged since`,LoopPaused:()=>`${s} paused`,WaitingForStop:({run:e,stop:n})=>t(e.id,n),QueuedForWorker:({ahead:t,creating:n})=>n===null?t===null?`Waiting for a free worker slot`:t===0?`Waiting for a free worker slot, next in queue`:`Waiting for a free worker slot, behind ${t} ${t===1?`run`:`runs`}`:e(n,l),AwaitingPoll:()=>`Waiting for the next poll`});export{c as n,s as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{E as e}from"./index-BdDPka5v.js";var t=e;export{t as errorComponent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e,r as t,s as n}from"./useRouter-Hur3RN7j.js";import{a as r,i,t as a}from"./page-BLxt7Xfg.js";import{S as o,d as s,j as c,t as l,w as u}from"./mark-B8EExm_5.js";import{n as d,r as f}from"./overview-BixI1Gdc.js";import{t as p}from"./link-C7GfYrMt.js";import{D as m,M as h,P as g,_,k as v}from"./button-4rhhIcK8.js";import{Ft as y,Yn as b,f as x,g as S,o as C,p as w,t as T}from"./strings-BeaABxX0.js";import{A as E,Ct as D,D as O,E as k,F as A,I as j,K as M,L as ee,N,O as P,T as te,_ as ne,b as re,g as ie,h as ae,m as oe,p as se,v as ce,x as le,xt as ue,y as de}from"./useScrollLock-77tiYKUD.js";import{a as fe,c as pe,i as me,l as he,n as ge,o as _e,r as ve,t as ye}from"./usePositioner-BeAdUrxb.js";import{t as F}from"./identity-DlGZ_gKf.js";import{jt as I,q as be,r as xe}from"./index-BdDPka5v.js";import{t as Se}from"./use-now-vNgLntlV.js";import{t as Ce}from"./heading-D62nMA3C.js";import{t as we}from"./pull-request-marks-BIB-F5Bo.js";import{n as L}from"./status-badge-CLPsMXtK.js";import{t as Te}from"./usage-C27cuo6g.js";import{a as Ee,i as R,n as De,o as z,r as B,t as Oe}from"./table-hbKjhjeL.js";import{t as ke}from"./fill-cell-CjksmixH.js";import{n as Ae}from"./section-BP8TxDno.js";import{c as je,d as Me,g as Ne,h as Pe,i as Fe,l as Ie,m as Le,p as Re,r as ze,s as Be,u as Ve}from"./model-0V8C6gKN.js";import{n as He,t as Ue}from"./strings-Bs2WdZYo.js";import{t as We}from"./project-not-found-CutZoVCI.js";import{i as Ge,r as Ke}from"./section-BwxXJ9H0.js";function V(e,t,n,r){return{left:e,top:t,right:n,bottom:r,x:e,y:t,width:n-e,height:r-t}}function qe(e){return{left:e.left,top:e.top,right:e.right,bottom:e.bottom,width:e.width,height:e.height}}function H(e){let t=[],n,r=1/0,i=1/0,a=-1/0,o=-1/0;for(let s of Array.from(e).sort((e,t)=>e.top-t.top)){if(r=Math.min(r,s.left),i=Math.min(i,s.top),a=Math.max(a,s.right),o=Math.max(o,s.bottom),!n||s.top-n.top>n.height/2)t.push(qe(s));else{let e=t[t.length-1];e.left=Math.min(e.left,s.left),e.right=Math.max(e.right,s.right),e.bottom=Math.max(e.bottom,s.bottom),e.width=e.right-e.left,e.height=e.bottom-e.top}n=s}return{lines:t,fallback:V(r,i,a,o)}}function U(e,t,n){return e.findIndex(e=>t>e.left-2&&t<e.right+2&&n>e.top-2&&n<e.bottom+2)}function W(e){return V(e.left,e.top,e.right,e.bottom)}function Je(e,t,n){let{lines:r}=H(e.getClientRects());if(r.length<2)return;let i=U(r,t,n);return{x:t,y:n,lineIndex:i===-1?void 0:i,element:e}}function Ye(e,t,n){let{lines:r,fallback:i}=H(e.getClientRects());if(r.length<2)return null;let a=n?.x,o=n?.y,s=t[0];if(n?.lineIndex!=null&&r[n.lineIndex])return W(r[n.lineIndex]);if(a!=null&&o!=null){let e=U(r,a,o);if(e!==-1)return W(r[e])}if(r.length===2&&r[0].left>r[1].right&&a!=null&&o!=null)return i;if(s===`t`||s===`b`){let e=r[0],t=r[r.length-1],n=s===`t`?e:t;return V(n.left,e.top,n.right,t.bottom)}let c=s===`l`,l=r[0].left,u=r[0].right,d=c?1/0:-1/0,f=r[0],p=r[0];for(let e of r){l=Math.min(l,e.left),u=Math.max(u,e.right);let t=c?e.left:e.right;c&&t<d||!c&&t>d?(d=t,f=e,p=e):t===d&&(p=e)}return V(l,f.top,u,p.bottom)}function Xe(e){return`contextElement`in e&&e.contextElement?e.contextElement:_(e)?e:void 0}function Ze(e,t){function n(t){G(e,t.currentTarget,t.clientX,t.clientY)}function r(e){t||n(e)}return{onFocus(){e.current=void 0},onMouseEnter:r,onMouseMove:r}}function G(e,t,n,r){let i=Je(t,n,r);return e.current=i,i}function Qe(e){return{name:`inline`,async fn(t){let n=t.elements.reference;if(typeof n?.getClientRects!=`function`)return{};let r=Xe(n),i=e.current,a=i?.element===n||i?.element===r?i:void 0,o=Ye(n,t.placement,a);if(!o||typeof t.platform.getElementRects!=`function`)return{};let s=await t.platform.getElementRects({reference:{contextElement:r,getBoundingClientRect(){return o}},floating:t.elements.floating,strategy:t.strategy});return t.rects.reference.x===s.reference.x&&t.rects.reference.y===s.reference.y&&t.rects.reference.width===s.reference.width&&t.rects.reference.height===s.reference.height?{}:{reset:{rects:s}}}}}var K=n(e(),1),q=K.createContext(void 0);function J(e){let t=K.useContext(q);if(t===void 0&&!e)throw Error(h(50));return t}var $e={...oe,instantType:e=>e.instantType,adaptiveOrigin:e=>e.adaptiveOrigin,closeDelay:e=>e.closeDelay},et=class extends ae{constructor(e,t,n){let r=new ce;super(tt(e,r,t,n),nt(r),$e)}setOpen=(e,t)=>{let{inlineRectCoordsRef:n}=this.context;le(this,e,t,{onBeforeDispatch(){let r=t.event;e&&t.reason===`trigger-hover`&&t.trigger&&`clientX`in r&&`clientY`in r&&n.current?.element!==t.trigger&&G(n,t.trigger,r.clientX,r.clientY)}})}};function tt(e,t,n,r=!1){return{...se(t,n,r),instantType:void 0,adaptiveOrigin:void 0,closeDelay:300,...e}}function nt(e){return{popupRef:K.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerElements:e,inlineRectCoordsRef:{current:void 0}}}var Y=t();function X(e){let{open:t,defaultOpen:n=!1,onOpenChange:r,onOpenChangeComplete:i,actionsRef:a,handle:c,triggerId:l,defaultTriggerId:u=null,children:d}=e,f=P((e,r)=>new et({open:n,openProp:t,activeTriggerId:u,triggerIdProp:l},e,r));f.useControlledProp(`openProp`,t),f.useControlledProp(`triggerIdProp`,l),f.useContextCallback(`onOpenChange`,r),f.useContextCallback(`onOpenChangeComplete`,i);let p=f.useState(`open`),m=f.useState(`activeTriggerId`),h=f.useState(`mounted`),g=f.useState(`payload`);te(f,{closeOnActiveTriggerUnmount:!0});let{forceUnmount:_}=k(p,f,()=>{f.context.inlineRectCoordsRef.current=void 0});v(()=>{p&&(m??f.set(`payload`,void 0))},[f,m,p]),K.useImperativeHandle(a,()=>({unmount:_,close:()=>f.setOpen(!1,o(s))}),[_,f]);let y=p||h||c!=null;return(0,Y.jsxs)(q.Provider,{value:f,children:[c&&(0,Y.jsx)(re,{handle:c,store:f}),y&&(0,Y.jsx)(rt,{store:f}),typeof d==`function`?d({payload:g}):d]})}function rt({store:e}){let t=e.useState(`floatingRootContext`),n=N(t);return O(e,{activeTriggerProps:n.reference,inactiveTriggerProps:n.trigger,popupProps:n.floating}),null}var it=ie(function(e){return J(!0)?(0,Y.jsx)(X,{...e}):(0,Y.jsx)(j,{children:(0,Y.jsx)(X,{...e})})}),at=K.createContext(void 0);function ot(){let e=K.useContext(at);if(e===void 0)throw Error(h(48));return e}var st=K.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return J().useState(`mounted`)||n?(0,Y.jsx)(at.Provider,{value:n,children:(0,Y.jsx)(be,{ref:t,...r})}):null}),ct=ne(function(e,t){let{render:n,className:r,delay:i,closeDelay:a,id:o,payload:s,handle:c,style:l,...d}=e,f=J(!0),p=he(c)??f;if(!p)throw Error(h(89));let m=u(o),_=p.useState(`isTriggerActive`,m),v=p.useState(`isOpenedByTrigger`,m),y=p.useState(`floatingRootContext`),b=p.context.inlineRectCoordsRef,x=K.useRef(null),S=i??600,C=a??300,{registerTrigger:w,isMountedByThisTrigger:T}=E(m,x,p,{payload:s,closeDelay:C}),O=fe(y,{mouseOnly:!0,move:!1,handleClose:me(),delay:()=>({open:S,close:C}),triggerElementRef:x,isActiveTrigger:_,isClosing:()=>p.select(`transitionStatus`)===`ending`}),k=pe(y,{delay:S}),A={open:v},j=p.useState(`triggerProps`,T),M=Ze(b,v);return g(`a`,e,{state:A,ref:[t,w,x],props:[O,k.reference,j,M,{id:m},d],stateAttributesMapping:D})}),lt=K.createContext(void 0);function ut(){let e=K.useContext(lt);if(e===void 0)throw Error(h(49));return e}var dt=K.forwardRef(function(e,t){let{render:n,className:r,anchor:i,positionMethod:a=`absolute`,side:o=`bottom`,align:s=`center`,sideOffset:c=0,alignOffset:l=0,collisionBoundary:u=`clipping-ancestors`,collisionPadding:d=5,arrowPadding:f=5,sticky:p=!1,disableAnchorTracking:m=!1,collisionAvoidance:h=M,style:g,..._}=e,y=J(),b=ot(),x=ee(),S=y.useState(`open`),C=y.useState(`mounted`),w=y.useState(`floatingRootContext`),T=y.useState(`instantType`),E=y.useState(`transitionStatus`),D=y.useState(`adaptiveOrigin`),O=y.context.inlineRectCoordsRef,k=ve({anchor:i,floatingRootContext:w,positionMethod:a,mounted:C,side:o,sideOffset:c,align:s,alignOffset:l,arrowPadding:f,collisionBoundary:u,collisionPadding:d,sticky:p,disableAnchorTracking:m,keepMounted:b,nodeId:x,collisionAvoidance:h,adaptiveOrigin:D,inline:Qe(O)}),j=k.update;v(()=>{S&&C&&j()},[S,C,j]);let N={open:S,side:k.side,align:k.align,anchorHidden:k.anchorHidden,instant:T},P=ye(e,N,{styles:k.positionerStyles,transitionStatus:E,props:_,refs:[t,y.useStateSetter(`positionerElement`)],hidden:!C,inert:!S});return(0,Y.jsx)(lt.Provider,{value:k,children:(0,Y.jsx)(A,{id:x,children:P})})}),ft=K.forwardRef(function(e,t){let{className:n,render:r,style:i,...a}=e,o=J(),{side:s,align:l}=ut(),u=o.useState(`open`),d=o.useState(`instantType`),f=o.useState(`transitionStatus`),p=o.useState(`popupProps`),m=o.useState(`floatingRootContext`),h=o.useState(`closeDelay`);return c({open:u,ref:o.context.popupRef,onComplete(){u&&o.context.onOpenChangeComplete?.(!0)}}),_e(m,{closeDelay:h}),g(`div`,e,{state:{open:u,side:s,align:l,instant:d,transitionStatus:f},ref:[t,o.context.popupRef,o.useStateSetter(`popupElement`)],props:[de,p,ge(f),a],stateAttributesMapping:ue})});function pt({...e}){return(0,Y.jsx)(it,{"data-slot":`hover-card`,...e})}function mt({...e}){return(0,Y.jsx)(ct,{"data-slot":`hover-card-trigger`,...e})}function ht({className:e,side:t=`bottom`,sideOffset:n=4,align:r=`center`,alignOffset:i=4,...a}){return(0,Y.jsx)(st,{"data-slot":`hover-card-portal`,children:(0,Y.jsx)(dt,{align:r,alignOffset:i,side:t,sideOffset:n,className:`isolate z-50`,children:(0,Y.jsx)(ft,{"data-slot":`hover-card-content`,className:m(`z-50 w-72 origin-(--transform-origin) rounded-lg bg-popover p-2.5 text-xs/relaxed text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...a})})})}var gt=`relative z-10 rounded-sm underline-offset-4 outline-none hover:underline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring/70 focus-visible:outline-solid`,_t=({usage:e,label:t,note:n,children:r})=>(0,Y.jsxs)(pt,{children:[(0,Y.jsx)(mt,{delay:200,"aria-label":t,render:(0,Y.jsx)(`button`,{type:`button`,className:gt}),children:r}),(0,Y.jsxs)(ht,{align:`end`,className:`w-[26rem] max-w-[calc(100vw-2rem)] p-3 font-sans text-xs shadow-raised`,children:[n!==null&&(0,Y.jsxs)(`p`,{className:`pb-2 text-muted-foreground`,children:[n,`.`]}),(0,Y.jsx)(Te,{pools:e.pools})]})]}),Z=`hidden @5xl:table-cell`,Q=`hidden @4xl:table-cell`,vt=`@md:w-max @md:max-w-(--side)`,yt=({reason:e})=>y(e,{AwaitingApproval:()=>`Waiting`,SuppressedForOperator:()=>`needs-you`,CycleBudgetUsedUp:()=>`needs-you`,RunFailed:()=>`Failed`,ClosedUnchanged:({run:e})=>e.state,LoopPaused:()=>`paused`,WaitingForStop:({run:e})=>e.state,QueuedForWorker:({run:e})=>e.state,AwaitingPoll:()=>`Pending`}),bt=({last:e,status:t},n)=>{let r=Fe(e),i=t=>({state:yt(t),words:`${e.loop!==t.loop&&!Ue(t)?`${t.loop} `:``}${He(t,n)}`,at:null});return y(t,{Running:({run:e})=>({state:`Running`,words:`Running ${e.loop}`,at:r}),AwaitingApproval:()=>({state:`Waiting`,words:`Waiting for approval`,at:r}),Queued:({run:e})=>({state:e.state,words:e.state,at:r}),Stalled:({stall:e})=>i(e),Idle:({stall:e})=>i(e),NeedsAttention:()=>({state:`needs-you`,words:`Needs attention`,at:r}),Done:()=>({state:`Done`,words:`Done`,at:r}),Ended:({run:e})=>({state:e.state,words:e.state,at:r})})},xt=({row:e,now:t})=>{let{state:n,words:r,at:i}=bt(e,t);return(0,Y.jsxs)(`span`,{className:m(`flex items-start gap-1.5 text-xs/5 font-medium`,vt),children:[n===`Done`?(0,Y.jsx)(l,{item:e.task,linked:!1,numbered:!1,className:`mt-0.75`}):(0,Y.jsx)(L,{state:n,className:`mt-1.75`}),(0,Y.jsxs)(`span`,{className:`min-w-0 wrap-break-word`,children:[r,i!==null&&(0,Y.jsxs)(Y.Fragment,{children:[` `,(0,Y.jsxs)(`span`,{className:`font-normal whitespace-nowrap text-muted-foreground`,children:[`·`,` `,(0,Y.jsx)(`time`,{dateTime:i,title:x(i),className:`font-mono tabular-nums`,children:T(i,t)})]})]})]})]})},St=()=>(0,Y.jsx)(`span`,{className:`absolute left-full text-muted-foreground`,children:`*`}),Ct=({usage:e})=>{if(e.cost===null)return null;let t=ze(e),n=S(e.cost.usd);return(0,Y.jsxs)(_t,{usage:e,label:`Estimated cost: ${t?`at least `:``}${n}. Show per pool`,note:t?Pe:null,children:[n,t&&(0,Y.jsx)(St,{})]})},wt=({task:e,now:t})=>{let{usage:n}=e;if(e.runs.every(({attempts:e})=>e.length===0))return null;let r=n.unmeasured>0;return(0,Y.jsxs)(`span`,{className:`relative`,title:r?Ne:`Total attempt time`,children:[C(je(n,t)),r&&(0,Y.jsx)(St,{})]})},Tt=`py-3 align-top whitespace-normal`,$=`py-3 text-right align-top font-mono text-xs/5 whitespace-nowrap tabular-nums`,Et=({task:e})=>{let t=Ie(e);return(0,Y.jsxs)(`span`,{className:m(`flex items-baseline gap-2`,vt),children:[(0,Y.jsx)(`span`,{className:`truncate`,title:t.map(({loop:e})=>e).join(` · `),children:t.map(({loop:e,state:t},n)=>(0,Y.jsxs)(K.Fragment,{children:[n>0&&(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:` · `}),(0,Y.jsx)(L,{state:t,className:`mr-1.5 align-middle`}),e,(0,Y.jsxs)(`span`,{className:`sr-only`,children:[` `,t]})]},e))}),(0,Y.jsx)(`span`,{className:`shrink-0 font-mono text-xs text-muted-foreground tabular-nums`,children:e.runs.length})]})},Dt=({row:e,repository:t,now:n})=>(0,Y.jsxs)(z,{className:Ke,children:[(0,Y.jsx)(ke,{className:`py-3 align-top`,children:(0,Y.jsx)(p,{"data-row-link":!0,to:`/projects/$owner/$name/tasks/$number`,params:{...f(t),number:Ve(e.task)},className:m(`block min-w-0`,Ge),children:(0,Y.jsx)(Ce,{variant:`row`,item:b(F(e.task).origin),title:e.task.title,linked:!1})})}),(0,Y.jsx)(B,{className:Tt,children:(0,Y.jsx)(xt,{row:e,now:n})}),(0,Y.jsx)(B,{className:m(`py-3 align-top`,Z),children:(0,Y.jsx)(Et,{task:e.task})}),(0,Y.jsx)(B,{className:m(`py-3 text-right align-top`,Z),children:(0,Y.jsx)(we,{pullRequests:F(e.task).pullRequests,className:`relative z-10 justify-end`})}),(0,Y.jsx)(B,{className:$,children:(0,Y.jsx)(wt,{task:e.task,now:n})}),(0,Y.jsx)(B,{className:m($,Q),children:e.task.usage.pools.length>0&&(0,Y.jsx)(_t,{usage:e.task.usage,label:`Tokens: ${w(e.task.usage.tokens)}. Show per pool`,note:null,children:w(e.task.usage.tokens)})}),(0,Y.jsx)(B,{className:m($,Q),children:(0,Y.jsx)(Ct,{usage:e.task.usage})})]}),Ot=({totals:e})=>(0,Y.jsx)(`p`,{className:`-mt-2 text-sm text-muted-foreground tabular-nums`,children:Le(e).map(({figure:e,words:t,lowerBound:n},r)=>(0,Y.jsxs)(K.Fragment,{children:[r>0&&`, `,n===null?e:(0,Y.jsx)(`span`,{title:n,children:`${e}*`}),` `,t]},t))}),kt=[`@md:[--side:clamp(7rem,calc((100cqw-26rem-var(--rest))/var(--sides)),13rem)]`,`[--rest:7rem] [--sides:1] @4xl:[--rest:16.5rem] @5xl:[--rest:23rem] @5xl:[--sides:2]`].join(` `),At=({project:e,stalled:t})=>{let n=Se(3e4),r=Me(e.board.lanes,t);return(0,Y.jsxs)(a,{width:`full`,children:[(0,Y.jsx)(i,{title:`Tasks`,counts:Be(r)}),r.length===0?(0,Y.jsx)(Ae,{children:`No runs yet`}):(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(Ot,{totals:Re(r,n)}),(0,Y.jsx)(`div`,{className:`@container -mx-2`,children:(0,Y.jsxs)(Oe,{"aria-label":`${e.repository} tasks`,className:kt,children:[(0,Y.jsx)(Ee,{children:(0,Y.jsxs)(z,{className:`hover:bg-transparent`,children:[(0,Y.jsx)(R,{children:`Task`}),(0,Y.jsx)(R,{children:`Status`}),(0,Y.jsx)(R,{className:Z,children:`Runs`}),(0,Y.jsx)(R,{className:m(`text-right`,Z),children:`Pull request`}),(0,Y.jsx)(R,{className:`text-right`,children:`Elapsed time`}),(0,Y.jsx)(R,{className:m(`text-right`,Q),children:`Tokens`}),(0,Y.jsx)(R,{className:m(`text-right`,Q),children:`Estimated cost`})]})}),(0,Y.jsx)(De,{children:r.map(t=>(0,Y.jsx)(Dt,{row:t,repository:e.repository,now:n},t.task.itemKey))})]})})]})]})},jt=()=>{let{repository:e}=xe.useParams(),{data:t}=I(d()),n=I(r()),i=t.projects.find(t=>t.repository===e);return i===void 0?(0,Y.jsx)(We,{}):(0,Y.jsx)(At,{project:i,stalled:n.data.notMoving})};export{jt as component};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e,r as t,s as n}from"./useRouter-Hur3RN7j.js";import{D as r,S as i,b as a,d as o,j as s,w as c,z as l}from"./mark-B8EExm_5.js";import{A as u,D as d,M as f,P as p,r as m,v as h}from"./button-4rhhIcK8.js";import{d as g,g as _,p as v}from"./strings-BeaABxX0.js";import{A as y,C as b,Ct as x,D as S,E as C,F as w,I as T,K as E,L as D,N as O,O as k,P as A,S as j,St as M,T as N,U as P,V as F,Y as I,_ as L,b as R,c as z,g as B,h as V,k as H,m as U,n as W,p as ee,r as te,v as ne,w as G,xt as re,y as ie}from"./useScrollLock-77tiYKUD.js";import{a as ae,i as oe,l as se,n as ce,o as le,r as ue,t as de}from"./usePositioner-BeAdUrxb.js";import{a as fe,n as pe,o as me,r as he,t as ge}from"./useAnchoredPopupScrollLock-DEVFEHhP.js";import{t as _e}from"./ToolbarRootContext-aq6udDVh.js";var K=n(e(),1),q=K.createContext(void 0);function J(e){let t=K.useContext(q);if(t===void 0&&!e)throw Error(f(47));return t}var ve=n(l(),1),ye={...U,disabled:e=>e.disabled,instantType:e=>e.instantType===`trigger-change`&&!U.open(e)?void 0:e.instantType,openMethod:e=>e.openMethod,openChangeReason:e=>e.openChangeReason,isPressOpenedByTrigger:(e,t)=>e.openChangeReason===`trigger-press`&&U.isOpenedByTrigger(e,t),isTouchPressOpen:(e,t)=>t&&e.openMethod===`touch`&&e.openChangeReason===`trigger-press`,hasTriggerFocusGuards:(e,t)=>U.isOpenedByTrigger(e,t)&&!e.focusManagerModal,modal:e=>e.modal,titleElementId:e=>e.titleElementId,descriptionElementId:e=>e.descriptionElementId,openOnHover:e=>e.openOnHover,closeDelay:e=>e.closeDelay,adaptiveOrigin:e=>e.adaptiveOrigin},be=class extends V{constructor(e,t,n){let r=new ne;super(xe(e,r,t,n),Se(r),ye)}setOpen=(e,t)=>{let n=t.reason===a,r=t.reason===`trigger-press`&&t.event.detail===0,i=!e&&(t.reason===`escape-key`||t.reason==null),o=j(t),s=this.select(`activeTriggerId`);if(!e&&t.reason===`close-press`&&t.trigger==null&&s!=null&&(t.trigger=this.context.triggerElements.getById(s)??this.select(`activeTriggerElement`)??void 0),this.context.onOpenChange?.(e,t),t.isCanceled)return;this.state.floatingRootContext.dispatchOpenChange(e,t);let c=()=>{let n=G(this.state,e,t.trigger,o());n.openChangeReason=t.reason,this.update(n)};n?(this.context.stickIfOpen=!0,this.context.stickIfOpenTimeout.start(500,()=>{this.context.stickIfOpen=!1}),ve.flushSync(c)):c();let l;r?l=`click`:i?l=`dismiss`:t.reason===`focus-out`&&(l=`focus`),this.set(`instantType`,l)}};function xe(e,t,n,r=!1){let i={...ee(t,n,r),disabled:!1,modal:!1,focusManagerModal:!1,instantType:void 0,openMethod:null,openChangeReason:null,titleElementId:void 0,descriptionElementId:void 0,openOnHover:!1,closeDelay:0,adaptiveOrigin:void 0,...e};return i.open&&e?.mounted===void 0&&(i.mounted=!0),i}function Se(e){return{popupRef:K.createRef(),onOpenChange:void 0,onOpenChangeComplete:void 0,triggerFocusTargetRef:K.createRef(),beforeTriggerFocusGuardRef:K.createRef(),beforeContentFocusGuardRef:K.createRef(),stickIfOpenTimeout:new r,stickIfOpen:!0,triggerElements:e}}var Y=t(),X=B(function({props:e}){let{children:t,open:n,defaultOpen:r=!1,onOpenChange:a,onOpenChangeComplete:s,modal:c=!1,handle:l,triggerId:u,defaultTriggerId:d=null}=e,f=we(l,{modal:c,open:r,openProp:n,activeTriggerId:d,triggerIdProp:u});f.useControlledProp(`openProp`,n),f.useControlledProp(`triggerIdProp`,u);let p=f.useState(`open`),m=f.useState(`mounted`),h=f.useState(`payload`);f.useContextCallback(`onOpenChange`,a),f.useContextCallback(`onOpenChangeComplete`,s),H(f,p),N(f);let{forceUnmount:g}=C(p,f,()=>{f.context.stickIfOpen=!0,f.set(`openChangeReason`,null)});f.useSyncedValues({modal:c}),K.useEffect(()=>{p||f.context.stickIfOpenTimeout.clear()},[f,p]),K.useImperativeHandle(e.actionsRef,()=>({unmount:g,close:()=>f.setOpen(!1,i(o))}),[g,f]);let _=p||m||l!=null;return(0,Y.jsxs)(q.Provider,{value:f,children:[l&&(0,Y.jsx)(R,{handle:l,store:f}),_&&(0,Y.jsx)(Te,{store:f,modal:c}),typeof t==`function`?t({payload:h}):t]})});function Ce(e){return J(!0)?(0,Y.jsx)(X,{props:e}):(0,Y.jsx)(T,{children:(0,Y.jsx)(X,{props:e})})}function we(e,t){let n=k((e,n)=>new be(t,e,n));return K.useEffect(()=>n.context.stickIfOpenTimeout.disposeEffect(),[n]),n}function Te({store:e,modal:t}){let n=e.useState(`floatingRootContext`),r=O(n,{outsidePressEvent:{mouse:t===`trap-focus`?`sloppy`:`intentional`,touch:`sloppy`}}),i=r.reference,a=r.floating;return S(e,{activeTriggerProps:i,inactiveTriggerProps:i,popupProps:a}),null}var Ee=L(function(e,t){let{render:n,className:r,style:i,disabled:a=!1,nativeButton:o=!0,handle:s,payload:l,openOnHover:d=!1,delay:h=300,closeDelay:g=0,id:_,...v}=e,b=J(!0),S=se(s)??b;if(!S)throw Error(f(74));let C=c(_),w=S.useState(`isTriggerActive`,C),T=S.useState(`floatingRootContext`),E=S.useState(`isOpenedByTrigger`,C),D=S.useState(`triggerPopupId`,C),O=K.useRef(null),{registerTrigger:k,isMountedByThisTrigger:A}=y(C,O,S,{payload:l,disabled:a,openOnHover:d,closeDelay:g}),j=S.useState(`isPressOpenedByTrigger`,C),N=S.useState(`isTouchPressOpen`,d),F=S.useState(`hasTriggerFocusGuards`,C),L=ae(T,{enabled:!a&&d&&!N,mouseOnly:!0,move:!1,handleClose:oe(),restMs:h,delay:{close:g},triggerElementRef:O,isActiveTrigger:w,isClosing:()=>S.select(`transitionStatus`)===`ending`}),R=u(()=>S.context.stickIfOpen),z=me(T,{stickIfOpen:R}),B=fe(()=>S.select(`open`),e=>{S.set(`openMethod`,e)}),V=S.useState(`triggerProps`,A),{getButtonProps:H,buttonRef:U}=m({disabled:a,native:o}),W={open(e){return j?M.open(e):x.open(e)}},{handlePreFocusGuardFocus:ee,handleFocusTargetFocus:te}=he(S,O),ne=p(`button`,e,{state:{disabled:a,open:E},ref:[U,t,k,O],props:[z.reference,L,V,B,{[P]:``,id:C,"aria-haspopup":`dialog`,"aria-expanded":E,"aria-controls":D},v,H],stateAttributesMapping:W}),G=(0,Y.jsx)(K.Fragment,{children:ne},C);return F?(0,Y.jsxs)(K.Fragment,{children:[(0,Y.jsx)(I,{ref:S.context.beforeTriggerFocusGuardRef,onFocus:ee}),G,(0,Y.jsx)(I,{ref:S.context.triggerFocusTargetRef,onFocus:te})]}):G}),De=K.createContext(void 0);function Oe(){let e=K.useContext(De);if(e===void 0)throw Error(f(45));return e}var ke=K.forwardRef(function(e,t){let{keepMounted:n=!1,...r}=e;return J().useState(`mounted`)||n?(0,Y.jsx)(De.Provider,{value:n,children:(0,Y.jsx)(F,{ref:t,...r})}):null}),Ae=K.createContext(void 0);function je(){let e=K.useContext(Ae);if(!e)throw Error(f(46));return e}var Me=K.forwardRef(function(e,t){let{render:n,className:r,style:i,anchor:a,positionMethod:o,side:s,align:c,sideOffset:l,alignOffset:u,collisionBoundary:d=`clipping-ancestors`,collisionPadding:f,arrowPadding:p,sticky:m,disableAnchorTracking:h=!1,collisionAvoidance:g=E,..._}=e,v=J(),y=Oe(),b=D(),x=v.useState(`floatingRootContext`),S=v.useState(`mounted`),C=v.useState(`open`),T=v.useState(`openChangeReason`),O=v.useState(`activeTriggerElement`),k=v.useState(`modal`),A=v.useState(`openMethod`),j=v.useState(`positionerElement`),M=v.useState(`instantType`),N=v.useState(`transitionStatus`),P=v.useState(`adaptiveOrigin`),F=ue({anchor:a,floatingRootContext:x,positionMethod:o,mounted:S,side:s,sideOffset:l,align:c,alignOffset:u,arrowPadding:p,collisionBoundary:d,collisionPadding:f,sticky:m,disableAnchorTracking:h,keepMounted:y,nodeId:b,collisionAvoidance:g,adaptiveOrigin:P}),I=x.useState(`domReferenceElement`);pe({store:v,domReference:I,positionerElement:j,open:C});let L=k===!0&&T!==`trigger-hover`;ge(C&&L,A===`touch`,j,O);let R=v.useStateSetter(`positionerElement`),z={open:C,side:F.side,align:F.align,anchorHidden:F.anchorHidden,instant:M},B=de(e,z,{styles:F.positionerStyles,transitionStatus:N,props:_,refs:[t,R],hidden:!S,inert:!C});return(0,Y.jsxs)(Ae.Provider,{value:F,children:[S&&L&&(0,Y.jsx)(W,{inert:te(!C),cutout:O}),(0,Y.jsx)(w,{id:b,children:B})]})}),Ne=K.createContext(void 0);function Pe(){let[e,t]=K.useState(0),n=u(()=>(t(e=>e+1),()=>{t(e=>Math.max(0,e-1))}));return{context:K.useMemo(()=>({register:n}),[n]),hasClosePart:e>0}}var Fe=K.forwardRef(function(e,t){let{render:n,className:r,style:i,initialFocus:a,finalFocus:o,...c}=e,l=J(),u=je(),d=_e(!0)!=null,{context:f,hasClosePart:m}=Pe(),g=l.useState(`open`),_=l.useState(`openMethod`),v=l.useState(`instantType`),y=l.useState(`transitionStatus`),x=l.useState(`popupProps`),S=l.useState(`titleElementId`),C=l.useState(`descriptionElementId`),w=l.useState(`modal`),T=l.useState(`mounted`),E=l.useState(`openChangeReason`),D=l.useState(`activeTriggerElement`),O=l.useState(`floatingRootContext`),k=O.useState(`floatingId`),j=l.useState(`disabled`),M=l.useState(`openOnHover`),N=l.useState(`closeDelay`);s({open:g,ref:l.context.popupRef,onComplete(){g&&l.context.onOpenChangeComplete?.(!0)}}),le(O,{enabled:M&&!j,closeDelay:N});let P=a===void 0?b(l.context.popupRef):a,F=w!==!1&&m;l.useSyncedValue(`focusManagerModal`,F);let I=l.useStateSetter(`popupElement`),L={open:g,side:u.side,align:u.align,instant:v,transitionStatus:y},R=p(`div`,e,{state:L,ref:[t,l.context.popupRef,I],props:[x,{id:k,role:`dialog`,...ie,"aria-labelledby":S,"aria-describedby":C,onKeyDown(e){d&&z.has(e.key)&&e.stopPropagation()}},ce(y),c],stateAttributesMapping:re});return(0,Y.jsx)(A,{context:O,openInteractionType:_,modal:F,disabled:!T||E===`trigger-hover`,initialFocus:P,returnFocus:o,restoreFocus:`popup`,getInsideElements:()=>[l.context.beforeTriggerFocusGuardRef.current],previousFocusableElement:h(D)?D:void 0,nextFocusableElement:l.context.triggerFocusTargetRef,beforeContentFocusGuardRef:l.context.beforeContentFocusGuardRef,children:(0,Y.jsx)(Ne.Provider,{value:f,children:R})})});function Ie({...e}){return(0,Y.jsx)(Ce,{"data-slot":`popover`,...e})}function Z({...e}){return(0,Y.jsx)(Ee,{"data-slot":`popover-trigger`,...e})}function Le({className:e,align:t=`center`,alignOffset:n=0,side:r=`bottom`,sideOffset:i=4,...a}){return(0,Y.jsx)(ke,{children:(0,Y.jsx)(Me,{align:t,alignOffset:n,side:r,sideOffset:i,className:`isolate z-50`,children:(0,Y.jsx)(Fe,{"data-slot":`popover-content`,className:d(`z-50 flex w-72 origin-(--transform-origin) flex-col gap-4 rounded-lg bg-popover p-2.5 text-xs text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...a})})})}var Q=new Intl.NumberFormat(`en`),Re=({cost:e})=>e===null?null:(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)(`span`,{className:`font-mono text-foreground tabular-nums`,children:_(e.usd)}),e.estimate&&(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:` estimate`})]}),ze=({session:e})=>e._tag===`ParentSession`?`Parent`:e.agent,Be=`grid grid-cols-[minmax(0,1fr)_auto_7rem] items-baseline gap-x-3 py-0.5`,Ve=`grid grid-cols-[minmax(0,1fr)_auto_10rem] items-baseline gap-x-3 py-0.5`,He=e=>`unpriced`in e&&e.unpriced,$=({pools:e})=>{let t=e.some(e=>He(e)&&e.cost!==null);return(0,Y.jsxs)(`section`,{"aria-label":`Tokens per pool`,children:[(0,Y.jsx)(`h2`,{className:`pb-1 text-sm font-medium text-foreground`,children:`Tokens per pool`}),e.map(e=>(0,Y.jsxs)(`div`,{className:t?Ve:Be,children:[(0,Y.jsx)(`span`,{className:`truncate text-foreground`,children:g(e.pool)}),(0,Y.jsx)(`span`,{className:`text-right font-mono text-foreground tabular-nums`,children:Q.format(e.tokens)}),(0,Y.jsxs)(`span`,{className:`text-right`,children:[He(e)&&e.cost!==null&&(0,Y.jsx)(`span`,{className:`text-muted-foreground`,children:`at least `}),(0,Y.jsx)(Re,{cost:e.cost})]})]},e.pool))]})},Ue=({usage:e,attempts:t})=>(0,Y.jsxs)(Y.Fragment,{children:[(0,Y.jsx)($,{pools:e.pools}),(0,Y.jsxs)(`section`,{"aria-label":`Tokens per session`,className:`border-t pt-2.5`,children:[(0,Y.jsx)(`h2`,{className:`pb-1 text-sm font-medium text-foreground`,children:`Tokens per session`}),t.map(t=>{let n=e.sessions.filter(({attemptId:e})=>e===t.id);return n.length===0?null:(0,Y.jsxs)(`div`,{className:`pb-1`,children:[(0,Y.jsxs)(`h3`,{className:`pt-1 text-muted-foreground`,children:[`Attempt `,t.number]}),n.map(e=>(0,Y.jsxs)(`div`,{className:Be,children:[(0,Y.jsxs)(`span`,{className:`flex min-w-0 items-baseline gap-2`,children:[(0,Y.jsx)(`span`,{className:`shrink-0 text-foreground`,children:ze(e)}),(0,Y.jsx)(`span`,{className:`truncate font-mono text-muted-foreground`,children:e.session.brain.model})]}),(0,Y.jsx)(`span`,{className:`text-right font-mono text-foreground tabular-nums`,children:Q.format(e.tokens)}),(0,Y.jsx)(`span`,{className:`text-right`,children:(0,Y.jsx)(Re,{cost:e.cost})})]},e.session.id))]},t.id)})]}),(0,Y.jsx)(`p`,{className:`text-muted-foreground`,children:`Tokens are output and uncached input. Dollars are the price each harness reports, or for Codex, the OpenAI API price.`})]}),We=({usage:e,attempts:t})=>(0,Y.jsxs)(Ie,{children:[(0,Y.jsxs)(Z,{"aria-label":`Tokens: ${Q.format(e.tokens)}. Show per pool and session`,className:`rounded-sm text-primary underline-offset-4 outline-none hover:underline focus-visible:ring-2 focus-visible:ring-ring/70`,children:[(0,Y.jsx)(`span`,{className:`font-mono text-xs tabular-nums`,children:v(e.tokens)}),` tokens`]}),(0,Y.jsx)(Le,{align:`start`,className:`w-[26rem] max-w-[calc(100vw-2rem)] gap-3 p-3 text-xs shadow-raised`,children:(0,Y.jsx)(Ue,{usage:e,attempts:t})})]});export{Z as a,Le as i,We as n,Ie as r,$ as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e,s as t}from"./useRouter-Hur3RN7j.js";import{L as n,M as r,O as i,S as a,u as o,x as s,z as c}from"./mark-B8EExm_5.js";import{A as l,R as u,k as d}from"./button-4rhhIcK8.js";import{$ as f,Ft as p,Vt as m,_t as h,ct as g,et as _,t as v,ut as y,zt as b}from"./useScrollLock-77tiYKUD.js";import{ct as x}from"./index-BdDPka5v.js";var S=t(e(),1);function C(e,t={}){let{enabled:r=!0,event:o=`click`,toggle:c=!0,ignoreMouse:l=!1,stickIfOpen:d=!0,touchOpenDelay:f=0,reason:m=s}=t,_=e.context.dataRef,v=S.useRef(void 0),b=n(),x=i(),C=S.useMemo(()=>{function t(t,n,r,i){let o=a(m,n,r);t&&i===`touch`&&f>0?x.start(f,()=>{e.setOpen(!0,o)}):e.setOpen(t,o)}function n(t,n,r){let i=_.current.openEvent,a=e.select(`domReferenceElement`)!==n;return t&&a||!t||!c?!0:i&&(typeof d==`function`?d():d)?!r(i.type):!1}return{onPointerDown(e){v.current=g(e.pointerType,!0)&&y(e.nativeEvent)?`virtual`:e.pointerType},onMouseDown(r){let i=v.current,a=r.nativeEvent,s=e.select(`open`);if(r.button!==0||o===`click`||g(i,!0)&&l)return;let c=n(s,r.currentTarget,e=>e===`click`||e===`mousedown`),u=p(a),d=h(u);if(d||i===`virtual`){t(c,a,d?u:r.currentTarget,i);return}let f=r.currentTarget;b.request(()=>{t(c,a,f,i)})},onClick(r){if(o===`mousedown-only`)return;let i=v.current;o===`mousedown`&&i?v.current=void 0:g(i,!0)&&l||t(n(e.select(`open`),r.currentTarget,e=>e===`click`||e===`mousedown`||e===`keydown`||e===`keyup`),r.nativeEvent,r.currentTarget,i)},onKeyDown(){v.current=void 0}}},[_,o,l,m,e,d,c,b,x,f]);return S.useMemo(()=>r?{reference:C}:u,[r,C])}function w(e){let t=S.useRef(``),n=S.useCallback(n=>{n.defaultPrevented||(t.current=n.pointerType,e(n,n.pointerType))},[e]);return{onClick:S.useCallback(n=>{n.detail===0?e(n,`keyboard`):(`pointerType`in n?e(n,n.pointerType):e(n,t.current),t.current=``)},[e]),onPointerDown:n}}function T(e,t){let{onClick:n,onPointerDown:r}=w(l((n,r)=>{(typeof e==`function`?e():e)||t(r||(b?`touch`:``))}));return S.useMemo(()=>({onClick:n,onPointerDown:r}),[n,r])}function E(e){let[t,n]=S.useState(null),r=T(e,n);return x(e,t=>{t&&!e&&n(null)}),S.useMemo(()=>({openMethod:t,triggerProps:r}),[t,r])}var D=t(c(),1);function O(e,t){function n(n,r,i){let s=n.currentTarget;D.flushSync(()=>{e.setOpen(!1,a(o,n.nativeEvent,s))}),f(s.isConnected?s:t.current,r,i)?.focus()}function r(t){n(t,-1,e.select(`positionerElement`))}function i(t){let r=e.select(`positionerElement`);r&&_(t,r)?e.context.beforeContentFocusGuardRef.current?.focus():n(t,1,r)}return{handlePreFocusGuardFocus:r,handleFocusTargetFocus:i}}function k(e){let{store:t,domReference:n,positionerElement:i,open:a}=e,o=S.useRef(null),s=S.useRef(null),c=r(i);d(()=>{a||(s.current?.abort(),s.current=null,t.state.instantType===`trigger-change`&&t.set(`instantType`,void 0))},[a,t]),d(()=>{let e=n,r=o.current;if(e&&(o.current=e),!r||!e||e===r||!t.select(`open`))return;t.set(`instantType`,void 0);let i=new AbortController;return s.current=i,c(()=>{t.select(`open`)&&t.set(`instantType`,`trigger-change`)},i.signal),()=>{i.abort()}},[n,c,t])}var A=20;function j(e,t,n,r){let[i,a]=S.useState(!1);d(()=>{if(!e||!t||n==null){a(!1);return}let r=m(n).documentElement.clientWidth,i=n.offsetWidth;a(r>0&&i>0&&i>=r-A)},[e,t,n]),v(e&&(!t||i),r)}export{T as a,E as i,k as n,C as o,O as r,j as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e,s as t}from"./useRouter-Hur3RN7j.js";import{D as n,O as r,R as i,S as a,b as o,y as s,z as c}from"./mark-B8EExm_5.js";import{n as l}from"./with-selector-Dwf291_Q.js";import{A as u,C as d,H as f,P as p,R as m,T as h,_ as g,c as _,d as v,f as y,g as b,h as x,k as S,l as C,m as w,p as T,s as E,u as D,v as O,w as k,x as A,y as j,z as M}from"./button-4rhhIcK8.js";import{Bt as N,Ft as P,J as ee,Mt as F,Nt as te,Pt as I,Q as L,R as ne,Rt as re,Vt as ie,W as ae,X as R,Z as z,_t as oe,bt as B,ct as se,ft as ce,ht as le,mt as ue,vt as de,z as V}from"./useScrollLock-77tiYKUD.js";import{s as fe}from"./identity-DlGZ_gKf.js";var H=t(e(),1),pe=l(),me=t(c(),1),he=Math.min,U=Math.max,W=Math.round,ge=Math.floor,G=e=>({x:e,y:e}),_e={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function ve(e,t,n){return U(e,he(t,n))}function K(e,t){return typeof e==`function`?e(t):e}function q(e){return e.split(`-`)[0]}function J(e){return e.split(`-`)[1]}function Y(e){return e===`x`?`y`:`x`}function ye(e){return e===`y`?`height`:`width`}function X(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function be(e){return Y(X(e))}function xe(e,t,n){n===void 0&&(n=!1);let r=J(e),i=be(e),a=ye(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=ke(o)),[o,ke(o)]}function Se(e){let t=ke(e);return[Ce(e),t,Ce(t)]}function Ce(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var we=[`left`,`right`],Te=[`right`,`left`],Z=[`top`,`bottom`],Ee=[`bottom`,`top`];function De(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Te:we:t?we:Te;case`left`:case`right`:return t?Z:Ee;default:return[]}}function Oe(e,t,n,r){let i=J(e),a=De(q(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(Ce)))),a}function ke(e){let t=q(e);return _e[t]+e.slice(t.length)}function Ae(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function je(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Ae(e)}function Q(e){let{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function Me(e,t){return t!=null&&!se(t)?0:typeof e==`function`?e():e}function Ne(e,t,n){let r=Me(e,n);return typeof r==`number`?r:r?.[t]}function Pe(e){return typeof e==`function`?e():e}function Fe(e,t){return t||e===`click`||e===`mousedown`}function Ie(e){return e?.includes(`mouse`)&&e!==`mousedown`}function Le(e){let t=H.useCallback(t=>e===void 0?M:e.subscribeStore(t),[e]),n=H.useCallback(()=>e===void 0?void 0:e.store,[e]);return(0,pe.useSyncExternalStore)(t,n,()=>e?.serverStore)}var Re=N&&re;function ze(e,t={}){let{enabled:n=!0,delay:i}=t,{events:o,dataRef:c}=e.context,l=H.useRef(!1),u=H.useRef(null),d=H.useRef(!0),f=r();H.useEffect(()=>{let t=e.select(`domReferenceElement`);if(!n)return;let r=x(t);function i(){let t=e.select(`domReferenceElement`);!e.select(`open`)&&O(t)&&t===F(ie(t))&&(l.current=!0,u.current=t)}function a(){d.current=!0}function o(){d.current=!1}return z(L(r,`blur`,i),Re&&L(r,`keydown`,a,!0),Re&&L(r,`pointerdown`,o,!0))},[e,n]),H.useEffect(()=>{if(!n)return;function t(t){if(t.reason===`trigger-press`||t.reason===`escape-key`){let t=e.select(`domReferenceElement`);g(t)&&(u.current=t,l.current=!0)}}return o.on(`openchange`,t),()=>{o.off(`openchange`,t)}},[o,n,e]);let p=H.useMemo(()=>{function t(){l.current=!1,u.current=null}return{onMouseLeave(){t()},onFocus(n){let r=n.currentTarget;if(l.current){if(u.current===r)return;t()}let o=P(n.nativeEvent);if(g(o)){if(Re&&!n.relatedTarget){if(!d.current&&!oe(o))return}else if(!de(o))return}let c=le(n.relatedTarget,e.context.triggerElements),{nativeEvent:p,currentTarget:m}=n;e.select(`open`)&&c||!i?e.setOpen(!0,a(s,p,m)):f.start(i,()=>{l.current||e.setOpen(!0,a(s,p,m))})},onBlur(n){t();let r=n.relatedTarget,i=n.nativeEvent,o=g(r)&&r.hasAttribute(ee(`focus-guard`))&&r.getAttribute(`data-type`)===`outside`;f.start(0,()=>{let t=e.select(`domReferenceElement`),n=F(ie(t));(r||n!==t)&&(I(c.current.floatingContext?.refs.floating.current,n)||I(t,n)||o||le(r??n,e.context.triggerElements)||e.setOpen(!1,a(s,i)))})}}},[c,i,e,f]);return H.useMemo(()=>n?{reference:p,trigger:p}:{},[n,p])}var Be=class e{pointerType=void 0;interactedInside=!1;handler=void 0;blockMouseMove=!0;performedPointerEventsMutation=!1;pointerEventsScopeElement=null;pointerEventsReferenceElement=null;pointerEventsFloatingElement=null;restTimeoutPending=!1;openChangeTimeout=new n;restTimeout=new n;handleCloseOptions=void 0;static create(){return new e}dispose=()=>{this.openChangeTimeout.clear(),this.restTimeout.clear()};disposeEffect=()=>this.dispose},Ve=new WeakMap;function He(e){if(!e.performedPointerEventsMutation)return;let t=e.pointerEventsScopeElement;t&&Ve.get(t)===e&&(e.pointerEventsScopeElement?.style.removeProperty(`pointer-events`),e.pointerEventsReferenceElement?.style.removeProperty(`pointer-events`),e.pointerEventsFloatingElement?.style.removeProperty(`pointer-events`),Ve.delete(t)),e.performedPointerEventsMutation=!1,e.pointerEventsScopeElement=null,e.pointerEventsReferenceElement=null,e.pointerEventsFloatingElement=null}function Ue(e,t){let{scopeElement:n,referenceElement:r,floatingElement:i}=t,a=Ve.get(n);a&&a!==e&&He(a),He(e),e.performedPointerEventsMutation=!0,e.pointerEventsScopeElement=n,e.pointerEventsReferenceElement=r,e.pointerEventsFloatingElement=i,Ve.set(n,e),n.style.pointerEvents=`none`,r.style.pointerEvents=`auto`,i.style.pointerEvents=`auto`}function We(e){let t=e.context.dataRef.current,n=f(()=>t.hoverInteractionState??Be.create()).current;return t.hoverInteractionState||=n,i(t.hoverInteractionState.disposeEffect),t.hoverInteractionState}function Ge(e,t={}){let{enabled:n=!0,closeDelay:i=0,nodeId:s}=t,c=e.useState(`open`),l=e.useState(`floatingElement`),d=e.useState(`domReferenceElement`),{dataRef:f}=e.context,p=V(),m=ne(),h=We(e),_=r(),v=u(()=>Fe(f.current.openEvent?.type,h.interactedInside)),y=u(()=>Ie(f.current.openEvent?.type)),b=u(()=>{He(h)});S(()=>{c||(h.pointerType=void 0,h.restTimeoutPending=!1,h.interactedInside=!1,b())},[c,h,b]),H.useEffect(()=>b,[b]),S(()=>{if(n&&c&&h.handleCloseOptions?.blockPointerEvents&&y()&&g(d)&&l){let e=d,t=l,n=ie(l),r=p?.nodesRef.current.find(e=>e.id===m)?.context?.elements.floating;r&&(r.style.pointerEvents=``);let i=h.pointerEventsScopeElement===t?null:h.pointerEventsScopeElement,a=r===t?null:r,o=h.handleCloseOptions?.getScope?.()??i??a??te(e,`[data-rootownerid]`)??n.body;return Ue(h,{scopeElement:o,referenceElement:e,floatingElement:t}),()=>{b()}}},[n,c,d,l,h,y,p,m,b]),H.useEffect(()=>{if(!n)return;function t(){return!!(p&&m&&ce(p.nodesRef.current,m).length>0)}function r(t){let n=Ne(i,`close`,h.pointerType),r=()=>{e.setOpen(!1,a(o,t)),p?.events.emit(`floating.closed`,t)};n?h.openChangeTimeout.start(n,r):(h.openChangeTimeout.clear(),r())}function c(e){let t=P(e);ue(t)?h.interactedInside=te(t,`[aria-haspopup]`)!=null:h.interactedInside=!1}function u(){h.openChangeTimeout.clear(),_.clear(),p?.events.off(`floating.closed`,x),b()}function d(n){if(t()&&p){p.events.on(`floating.closed`,x);return}if(le(n.relatedTarget,e.context.triggerElements))return;let i=f.current.floatingContext?.nodeId??s,a=n.relatedTarget;p&&i&&g(a)&&ce(p.nodesRef.current,i,!1).some(e=>I(e.context?.elements.floating,a))||(h.handler?h.handler(n):(b(),y()&&!v()&&r(n)))}function x(n){p&&m&&!t()&&_.start(0,()=>{p.events.off(`floating.closed`,x),e.setOpen(!1,a(o,n)),p.events.emit(`floating.closed`,n)})}let S=l;return z(S&&L(S,`mouseenter`,u),S&&L(S,`mouseleave`,d),S&&L(S,`pointerdown`,c,!0),()=>{p?.events.off(`floating.closed`,x)})},[n,l,e,f,i,s,y,v,b,h,p,m,_])}var Ke={current:null};function qe(e,t={}){let{enabled:n=!0,delay:r=0,handleClose:i=null,mouseOnly:s=!1,restMs:c=0,move:l=!0,triggerElementRef:d=Ke,externalTree:f,isActiveTrigger:p=!0,getHandleCloseContext:m,isClosing:h,shouldOpen:_,guardStaleOpen:v=!1}=t,{dataRef:y,events:b}=e.context,x=V(f),S=We(e),C=H.useRef(!1),w=R(i),T=R(r),E=R(c),D=R(n),O=R(_),k=R(h),A=u(()=>Fe(y.current.openEvent?.type,S.interactedInside)),j=u(()=>O.current?.()!==!1),M=u((t,n,r)=>{let i=e.context.triggerElements;if(i.hasElement(n))return!t||!I(t,n);if(!g(r))return!1;let a=r;return i.hasMatchingElement(e=>I(e,a))&&(!t||!I(t,a))}),N=u(()=>{S.handler&&=(ie(e.select(`domReferenceElement`)).removeEventListener(`mousemove`,S.handler),void 0)}),ee=u(()=>{He(S)});return p&&(S.handleCloseOptions=i?.__options),H.useEffect(()=>N,[N]),H.useEffect(()=>{if(!n)return;function e(e){e.open?C.current=!1:(C.current=e.reason===o,N(),S.openChangeTimeout.clear(),S.restTimeout.clear(),S.blockMouseMove=!0,S.restTimeoutPending=!1)}return b.on(`openchange`,e),()=>{b.off(`openchange`,e)}},[n,b,S,N]),H.useEffect(()=>{if(!n)return;function t(t,n=!0){let r=Ne(T.current,`close`,S.pointerType);r?S.openChangeTimeout.start(r,()=>{e.setOpen(!1,a(o,t)),x?.events.emit(`floating.closed`,t)}):n&&(S.openChangeTimeout.clear(),e.setOpen(!1,a(o,t)),x?.events.emit(`floating.closed`,t))}let r=d.current??(p?e.select(`domReferenceElement`):null);if(!g(r))return;function i(t){if(S.openChangeTimeout.clear(),S.blockMouseMove=!1,s&&!se(S.pointerType))return;let n=Pe(E.current),r=Ne(T.current,`open`,S.pointerType),i=P(t),c=t.currentTarget??null,l=e.select(`domReferenceElement`),u=c;if(g(i)&&!e.context.triggerElements.hasElement(i)){for(let t of e.context.triggerElements.elements())if(I(t,i)){u=t;break}}g(c)&&g(l)&&!e.context.triggerElements.hasElement(c)&&I(c,l)&&(u=l);let d=u!=null&&M(l,u,i),f=e.select(`open`),p=k.current?.()??e.select(`transitionStatus`)===`ending`,m=!f&&p&&C.current,h=!d&&g(u)&&g(l)&&I(l,u)&&m,_=n>0&&!r,v=d&&(f||m)||h,y=!f||d;v?j()&&e.setOpen(!0,a(o,t,u)):_||(r?S.openChangeTimeout.start(r,()=>{y&&j()&&e.setOpen(!0,a(o,t,u))}):y&&j()&&e.setOpen(!0,a(o,t,u)))}function c(n){if(A()){ee();return}N();let r=e.select(`domReferenceElement`),i=ie(r);S.restTimeout.clear(),S.restTimeoutPending=!1;let a=y.current.floatingContext??m?.();if(!le(n.relatedTarget,e.context.triggerElements)){if(w.current&&a){e.select(`open`)||S.openChangeTimeout.clear();let r=d.current;S.handler=w.current({...a,tree:x,x:n.clientX,y:n.clientY,onClose(){ee(),N(),D.current&&!A()&&r===e.select(`domReferenceElement`)&&t(n,!0)}}),i.addEventListener(`mousemove`,S.handler),S.handler(n)}else(S.pointerType!==`touch`||!I(e.select(`floatingElement`),n.relatedTarget))&&t(n)}}function u(e){I(r,e.relatedTarget)||(S.openChangeTimeout.clear(),S.restTimeout.clear(),S.restTimeoutPending=!1)}let f=v?L(r,`mouseout`,u):void 0;return l?z(L(r,`mousemove`,i,{once:!0}),L(r,`mouseenter`,i),L(r,`mouseleave`,c),f):z(L(r,`mouseenter`,i),L(r,`mouseleave`,c),f)},[N,ee,y,T,e,n,w,S,p,M,A,s,l,E,d,x,D,m,k,j,v]),H.useMemo(()=>{if(!n)return;function t(e){S.pointerType=e.pointerType}return{onPointerDown:t,onPointerEnter:t,onMouseMove(t){let{nativeEvent:n}=t,r=t.currentTarget,i=e.select(`domReferenceElement`),c=e.select(`open`),l=M(i,r,t.target);if(s&&!se(S.pointerType))return;if(c&&l&&S.handleCloseOptions?.blockPointerEvents){let t=e.select(`floatingElement`);if(t){let e=S.handleCloseOptions?.getScope?.()??r.ownerDocument.body;Ue(S,{scopeElement:e,referenceElement:r,floatingElement:t})}}let u=Pe(E.current);if(c&&!l||u===0||!l&&S.restTimeoutPending&&t.movementX**2+t.movementY**2<2)return;S.restTimeout.clear();function d(){if(S.restTimeoutPending=!1,A())return;let t=e.select(`open`);!S.blockMouseMove&&(!t||l)&&j()&&e.setOpen(!0,a(o,n,r))}S.pointerType===`touch`?me.flushSync(()=>{d()}):l&&c?d():(S.restTimeoutPending=!0,S.restTimeout.start(u,d))}}},[n,S,A,M,s,e,E,j])}var Je=.1,Ye=Je*Je,$=.5;function Xe(e,t,n,r,i,a){return r>=t!=a>=t&&e<=(i-n)*(t-r)/(a-r)+n}function Ze(e,t,n,r,i,a,o,s,c,l){let u=!1;return Xe(e,t,n,r,i,a)&&(u=!u),Xe(e,t,i,a,o,s)&&(u=!u),Xe(e,t,o,s,c,l)&&(u=!u),Xe(e,t,c,l,n,r)&&(u=!u),u}function Qe(e,t,n){return e>=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height}function $e(e,t,n,r,i,a){return e>=Math.min(n,i)&&e<=Math.max(n,i)&&t>=Math.min(r,a)&&t<=Math.max(r,a)}function et(e={}){let{blockPointerEvents:t=!1}=e,r=new n,i=({x:e,y:t,placement:n,elements:i,onClose:a,nodeId:o,tree:s})=>{let c=n?.split(`-`)[0],l=!1,u=null,d=null,f=typeof performance<`u`?performance.now():0;function p(e,t){let n=performance.now(),r=n-f;if(u===null||d===null||r===0)return u=e,d=t,f=n,!1;let i=e-u,a=t-d,o=i*i+a*a,s=r*r*Ye;return u=e,d=t,f=n,o<s}function m(){r.clear(),a()}return function(n){r.clear();let a=i.domReference,u=i.floating;if(!a||!u||c==null||e==null||t==null)return;let{clientX:d,clientY:f}=n,h=P(n),_=n.type===`mouseleave`,v=I(u,h),y=I(a,h);if(v&&(l=!0,!_))return;if(y&&(l=!1,!_)){l=!0;return}if(_&&g(n.relatedTarget)&&I(u,n.relatedTarget))return;function b(){return!!(s&&ce(s.nodesRef.current,o).length>0)}function x(){b()||m()}if(b())return;let S=a.getBoundingClientRect(),C=u.getBoundingClientRect(),w=e>C.right-C.width/2,T=t>C.bottom-C.height/2,E=C.width>S.width,D=C.height>S.height,O=(E?S:C).left,k=(E?S:C).right,A=(D?S:C).top,j=(D?S:C).bottom;if(c===`top`&&t>=S.bottom-1||c===`bottom`&&t<=S.top+1||c===`left`&&e>=S.right-1||c===`right`&&e<=S.left+1){x();return}let M=!1;switch(c){case`top`:M=$e(d,f,O,S.top+1,k,C.bottom-1);break;case`bottom`:M=$e(d,f,O,C.top+1,k,S.bottom-1);break;case`left`:M=$e(d,f,C.right-1,j,S.left+1,A);break;case`right`:M=$e(d,f,S.right-1,j,C.left+1,A)}if(M)return;if(l&&!Qe(d,f,S)||!_&&p(d,f)){x();return}let N=!1;switch(c){case`top`:{let n=E?$/2:$*4,r=E||w?e+n:e-n,i=E?e-n:w?e+n:e-n,a=t+$+1,o=w||E?C.bottom-$:C.top,s=w?E?C.bottom-$:C.top:C.bottom-$;N=Ze(d,f,r,a,i,a,C.left,o,C.right,s);break}case`bottom`:{let n=E?$/2:$*4,r=E||w?e+n:e-n,i=E?e-n:w?e+n:e-n,a=t-$,o=w||E?C.top+$:C.bottom,s=w?E?C.top+$:C.bottom:C.top+$;N=Ze(d,f,r,a,i,a,C.left,o,C.right,s);break}case`left`:{let n=D?$/2:$*4,r=D||T?t+n:t-n,i=D?t-n:T?t+n:t-n,a=e+$+1,o=T||D?C.right-$:C.left,s=T?D?C.right-$:C.left:C.right-$;N=Ze(d,f,o,C.top,s,C.bottom,a,r,a,i);break}case`right`:{let n=D?$/2:$*4,r=D||T?t+n:t-n,i=D?t-n:T?t+n:t-n,a=e-$,o=T||D?C.left+$:C.right,s=T?D?C.left+$:C.right:C.left+$;N=Ze(d,f,a,r,a,i,o,C.top,s,C.bottom);break}}N?l||r.start(40,x):x()}};return i.__options={...e,blockPointerEvents:t},i}function tt(e,t,n){let{reference:r,floating:i}=e,a=X(t),o=be(t),s=ye(o),c=q(t),l=a===`y`,u=r.x+r.width/2-i.width/2,d=r.y+r.height/2-i.height/2,f=r[s]/2-i[s]/2,p;switch(c){case`top`:p={x:u,y:r.y-i.height};break;case`bottom`:p={x:u,y:r.y+r.height};break;case`right`:p={x:r.x+r.width,y:d};break;case`left`:p={x:r.x-i.width,y:d};break;default:p={x:r.x,y:r.y}}let m=J(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function nt(e,t){t===void 0&&(t={});let{x:n,y:r,platform:i,rects:a,elements:o,strategy:s}=e,{boundary:c=`clippingAncestors`,rootBoundary:l=`viewport`,elementContext:u=`floating`,altBoundary:d=!1,padding:f=0}=K(t,e),p=je(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Q(await i.getClippingRect({element:await(i.isElement==null?void 0:i.isElement(m))??!0?m:m.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(o.floating)),boundary:c,rootBoundary:l,strategy:s})),g=u===`floating`?{x:n,y:r,width:a.floating.width,height:a.floating.height}:a.reference,_=await(i.getOffsetParent==null?void 0:i.getOffsetParent(o.floating)),v=await(i.isElement==null?void 0:i.isElement(_))&&await(i.getScale==null?void 0:i.getScale(_))||{x:1,y:1},y=Q(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:o,rect:g,offsetParent:_,strategy:s}):g);return{top:(h.top-y.top+p.top)/v.y,bottom:(y.bottom-h.bottom+p.bottom)/v.y,left:(h.left-y.left+p.left)/v.x,right:(y.right-h.right+p.right)/v.x}}var rt=50,it=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:nt},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=tt(l,r,c),f=r,p=0,m={};for(let n=0;n<a.length;n++){let h=a[n];if(!h)continue;let{name:g,fn:_}=h,{x:v,y,data:b,reset:x}=await _({x:u,y:d,initialPlacement:r,placement:f,strategy:i,middlewareData:m,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,d=y??d,m[g]={...m[g],...b},x&&p<rt&&(p++,typeof x==`object`&&(x.placement&&(f=x.placement),x.rects&&(l=x.rects===!0?await o.getElementRects({reference:e,floating:t,strategy:i}):x.rects),{x:u,y:d}=tt(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},at=function(e){return e===void 0&&(e={}),{name:`flip`,options:e,async fn(t){var n;let{placement:r,middlewareData:i,rects:a,initialPlacement:o,platform:s,elements:c}=t,{mainAxis:l=!0,crossAxis:u=!0,fallbackPlacements:d,fallbackStrategy:f=`bestFit`,fallbackAxisSideDirection:p=`none`,flipAlignment:m=!0,...h}=K(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=q(r),_=X(o),v=q(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[ke(o)]:Se(o)),x=p!==`none`;!d&&x&&b.push(...Oe(o,m,p,y));let S=[o,...b],C=await s.detectOverflow(t,h),w=[],T=i.flip?.overflows||[];if(l&&w.push(C[g]),u){let e=xe(r,a,y);w.push(C[e[0]],C[e[1]])}if(T=[...T,{placement:r,overflows:w}],!w.every(e=>e<=0)){let e=(i.flip?.index||0)+1,t=S[e];if(t&&(u!==`alignment`||_===X(t)||T.every(e=>X(e.placement)!==_||e.overflows[0]>0)))return{data:{index:e,overflows:T},reset:{placement:t}};let n=T.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0]?.placement;if(!n)switch(f){case`bestFit`:{let e=T.filter(e=>{if(x){let t=X(e.placement);return t===_||t===`y`}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0]?.[0];e&&(n=e);break}case`initialPlacement`:n=o}if(r!==n)return{reset:{placement:n}}}return{}}}},ot=new Set([`left`,`top`]);async function st(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=q(n),s=J(n),c=X(n)===`y`,l=ot.has(o)?-1:1,u=a&&c?-1:1,d=K(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:m}=typeof d==`number`?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&typeof m==`number`&&(p=s===`end`?m*-1:m),c?{x:p*u,y:f*l}:{x:f*l,y:p*u}}var ct=function(e){return e===void 0&&(e=0),{name:`offset`,options:e,async fn(t){var n;let{x:r,y:i,placement:a,middlewareData:o}=t,s=await st(t,e);return a===o.offset?.placement&&(n=o.arrow)!=null&&n.alignmentOffset?{}:{x:r+s.x,y:i+s.y,data:{...s,placement:a}}}}},lt=function(e){return e===void 0&&(e={}),{name:`shift`,options:e,async fn(t){let{x:n,y:r,placement:i,platform:a}=t,{mainAxis:o=!0,crossAxis:s=!1,limiter:c={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=K(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=X(i),p=Y(f),m=u[p],h=u[f],g=(e,t)=>ve(t+d[e===`y`?`top`:`left`],t,t-d[e===`y`?`bottom`:`right`]);o&&(m=g(p,m)),s&&(h=g(f,h));let _=c.fn({...t,[p]:m,[f]:h});return{..._,data:{x:_.x-n,y:_.y-r,enabled:{[p]:o,[f]:s}}}}}},ut=function(e){return e===void 0&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:a,middlewareData:o}=t,{offset:s=0,mainAxis:c=!0,crossAxis:l=!0}=K(e,t),u={x:n,y:r},d=X(i),f=Y(d),p=u[f],m=u[d],h=K(s,t),g=typeof h==`number`?{mainAxis:h,crossAxis:0}:{mainAxis:h.mainAxis??0,crossAxis:h.crossAxis??0};if(c){let e=f===`y`?`height`:`width`,t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(l){let e=f===`y`?`width`:`height`,t=ot.has(q(i)),n=a.reference[d]-a.floating[e]+(t&&o.offset?.[d]||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:o.offset?.[d]||0)-(t?g.crossAxis:0);m<n?m=n:m>r&&(m=r)}return{[f]:p,[d]:m}}}},dt=function(e){return e===void 0&&(e={}),{name:`size`,options:e,async fn(t){let{placement:n,rects:r,platform:i,elements:a}=t,{apply:o=()=>{},...s}=K(e,t),c=await i.detectOverflow(t,s),l=q(n),u=J(n),d=X(n)===`y`,{width:f,height:p}=r.floating,m,h;l===`top`||l===`bottom`?(m=l,h=u===(await(i.isRTL==null?void 0:i.isRTL(a.floating))?`start`:`end`)?`left`:`right`):(h=l,m=u===`end`?`top`:`bottom`);let g=p-c.top-c.bottom,_=f-c.left-c.right,v=he(p-c[m],g),y=he(f-c[h],_),b=t.middlewareData.shift,x=!b,S=v,C=y;b!=null&&b.enabled.x&&(C=_),b!=null&&b.enabled.y&&(S=g),x&&!u&&(d?C=f-2*U(c.left,c.right):S=p-2*U(c.top,c.bottom)),await o({...t,availableWidth:C,availableHeight:S});let w=await i.getDimensions(a.floating);return f!==w.width||p!==w.height?{reset:{rects:!0}}:{}}}};function ft(e){let t=E(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=O(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=W(n)!==a||W(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function pt(e){return g(e)?e:e.contextElement}function mt(e){let t=pt(e);if(!O(t))return G(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=ft(t),o=(a?W(n.width):n.width)/r,s=(a?W(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var ht=G(0);function gt(e){let t=x(e);return!h()||!t.visualViewport?ht:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function _t(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===x(e)}function vt(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=pt(e),o=G(1);t&&(r?g(r)&&(o=mt(r)):o=mt(e));let s=_t(a,n,r)?gt(a):G(0),c=(i.left+s.x)/o.x,l=(i.top+s.y)/o.y,u=i.width/o.x,d=i.height/o.y;if(a&&r){let e=x(a),t=g(r)?x(r):r,n=e,i=D(n);for(;i&&t!==n;){let e=mt(i),t=i.getBoundingClientRect(),r=E(i),a=t.left+(i.clientLeft+parseFloat(r.paddingLeft))*e.x,o=t.top+(i.clientTop+parseFloat(r.paddingTop))*e.y;c*=e.x,l*=e.y,u*=e.x,d*=e.y,c+=a,l+=o,n=x(i),i=D(n)}}return Q({width:u,height:d,x:c,y:l})}function yt(e,t){let n=y(e).scrollLeft;return t?t.left+n:vt(C(e)).left+n}function bt(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-yt(e,n),y:n.top+t.scrollTop}}function xt(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=C(r),s=t?k(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=G(1),u=G(0),d=O(r);if((d||!a)&&((v(r)!==`body`||A(o))&&(c=y(r)),d)){let e=vt(r);l=mt(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?bt(o,c):G(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+f.x,y:n.y*l.y-c.scrollTop*l.y+u.y+f.y}}function St(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function Ct(e){let t=y(e),n=e.ownerDocument.body,r=U(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=U(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+yt(e),o=-t.scrollTop;return E(n).direction===`rtl`&&(a+=U(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var wt=25;function Tt(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=x(e),a=C(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!h()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(yt(a)<=0){let e=a.ownerDocument,t=e.body,n=getComputedStyle(t),r=e.compatMode===`CSS1Compat`&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(a.clientWidth-t.clientWidth-r),o=getComputedStyle(a).scrollbarGutter===`stable both-edges`?i/2:i;o<=wt&&(s-=o)}return{width:s,height:c,x:l,y:u}}function Et(e,t){let n=vt(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=mt(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function Dt(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=Tt(e,n,t);else if(t===`document`)r=Ct(C(e));else if(g(t))r=Et(t,n);else{let n=gt(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Q(r)}function Ot(e,t){let n=t.get(e);if(n)return n;let r=T(e,[],!1).filter(e=>g(e)&&v(e)!==`body`),i=null,a=E(e).position===`fixed`,o=a?w(e):e;for(;g(o)&&!j(o);){let e=E(o),t=b(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=w(o)}return t.set(e,r),r}function kt(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?k(t)?[]:Ot(t,this._c):[].concat(n),r],o=Dt(t,a[0],i),s=o.top,c=o.right,l=o.bottom,u=o.left;for(let e=1;e<a.length;e++){let n=Dt(t,a[e],i);s=U(n.top,s),c=he(n.right,c),l=he(n.bottom,l),u=U(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function At(e){let{width:t,height:n}=ft(e);return{width:t,height:n}}function jt(e,t,n){let r=O(t),i=C(t),a=n===`fixed`,o=vt(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=G(0);if((r||!a)&&((v(t)!==`body`||A(i))&&(s=y(t)),r)){let e=vt(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=yt(i));let l=i&&!r&&!a?bt(i,s):G(0);return{x:o.left+s.scrollLeft-c.x-l.x,y:o.top+s.scrollTop-c.y-l.y,width:o.width,height:o.height}}function Mt(e){return E(e).position===`static`}function Nt(e,t){if(!O(e)||E(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return C(e)===n&&(n=n.ownerDocument.body),n}function Pt(e,t){let n=x(e);if(k(e))return n;if(!O(e)){let t=w(e);for(;t&&!j(t);){if(g(t)&&!Mt(t))return t;t=w(t)}return n}let r=Nt(e,t);for(;r&&d(r)&&Mt(r);)r=Nt(r,t);return r&&j(r)&&Mt(r)&&!b(r)?n:r||_(e)||n}var Ft=async function(e){let t=this.getOffsetParent||Pt,n=this.getDimensions,r=await n(e.floating);return{reference:jt(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function It(e){return E(e).direction===`rtl`}var Lt={convertOffsetParentRelativeRectToViewportRelativeRect:xt,getDocumentElement:C,getClippingRect:kt,getOffsetParent:Pt,getElementRects:Ft,getClientRects:St,getDimensions:At,getScale:mt,isElement:g,isRTL:It};function Rt(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function zt(e,t,n){let r=null,i,a=C(e);function o(){var e;clearTimeout(i),(e=r)==null||e.disconnect(),r=null}function s(n,c){n===void 0&&(n=!1),c===void 0&&(c=1),o();let l=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=l;if(n||t(),!f||!p)return;let m=ge(d),h=ge(a.clientWidth-(u+f)),g=ge(a.clientHeight-(d+p)),_=ge(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:U(0,he(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!Rt(l,e.getBoundingClientRect()))return s();if(n!==c){if(!y)return s();n?s(!1,n):i=setTimeout(()=>{s(!1,1e-7)},1e3)}y=!1}try{r=new IntersectionObserver(b,{...v,root:a.ownerDocument})}catch{r=new IntersectionObserver(b,v)}r.observe(e)}let c=x(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function Bt(e,t,n,r){r===void 0&&(r={});let{ancestorScroll:i=!0,ancestorResize:a=!0,elementResize:o=typeof ResizeObserver==`function`,layoutShift:s=typeof IntersectionObserver==`function`,animationFrame:c=!1}=r,l=pt(e),u=i||a?[...l?T(l):[],...t?T(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?zt(l,n,a):null,f=-1,p=null;o&&(p=new ResizeObserver(e=>{let[r]=e;r&&r.target===l&&p&&t&&(p.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var e;(e=p)==null||e.observe(t)})),n()}),l&&!c&&p.observe(l),t&&p.observe(t));let m,h=c?vt(e):null;c&&g();function g(){let t=vt(e);h&&!Rt(h,t)&&n(),h=t,m=requestAnimationFrame(g)}return n(),()=>{var e;u.forEach(e=>{i&&e.removeEventListener(`scroll`,n),a&&e.removeEventListener(`resize`,n)}),d?.(),(e=p)==null||e.disconnect(),p=null,c&&cancelAnimationFrame(m)}}var Vt=ct,Ht=lt,Ut=at,Wt=dt,Gt=ut,Kt=(e,t,n)=>{let r=new Map,i=n??{},a={...Lt,...i.platform,_c:r};return it(e,t,{...i,platform:a})},qt=typeof document<`u`?H.useLayoutEffect:function(){};function Jt(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e==`function`&&e.toString()===t.toString())return!0;let n,r,i;if(e&&t&&typeof e==`object`){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!Jt(e[r],t[r]))return!1;return!0}if(i=Object.keys(e),n=i.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,i[r]))return!1;for(r=n;r--!==0;){let n=i[r];if(!(n===`_owner`&&e.$$typeof)&&!Jt(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Yt(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Xt(e,t){let n=Yt(e);return Math.round(t*n)/n}function Zt(e){let t=H.useRef(e);return qt(()=>{t.current=e}),t}function Qt(e){e===void 0&&(e={});let{placement:t=`bottom`,strategy:n=`absolute`,middleware:r=[],platform:i,elements:{reference:a,floating:o}={},transform:s=!0,whileElementsMounted:c,open:l}=e,[u,d]=H.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=H.useState(r);Jt(f,r)||p(r);let[m,h]=H.useState(null),[g,_]=H.useState(null),v=H.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=H.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=H.useRef(null),C=H.useRef(null),w=H.useRef(u),T=c!=null,E=Zt(c),D=Zt(i),O=Zt(l),k=H.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),Kt(S.current,C.current,e).then(e=>{let t={...e,isPositioned:O.current!==!1};A.current&&!Jt(w.current,t)&&(w.current=t,me.flushSync(()=>{d(t)}))})},[f,t,n,D,O]);qt(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let A=H.useRef(!1);qt(()=>(A.current=!0,()=>{A.current=!1}),[]),qt(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,k);k()}},[b,x,k,E,T]);let j=H.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),M=H.useMemo(()=>({reference:b,floating:x}),[b,x]),N=H.useMemo(()=>{let e={position:n,left:0,top:0};if(!M.floating)return e;let t=Xt(M.floating,u.x),r=Xt(M.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Yt(M.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,M.floating,u.x,u.y]);return H.useMemo(()=>({...u,update:k,refs:j,elements:M,floatingStyles:N}),[u,k,j,M,N])}var $t=(e,t)=>{let n=Vt(e);return{name:n.name,fn:n.fn,options:[e,t]}},en=(e,t)=>{let n=Ht(e);return{name:n.name,fn:n.fn,options:[e,t]}},tn=(e,t)=>({fn:Gt(e).fn,options:[e,t]}),nn=(e,t)=>{let n=Ut(e);return{name:n.name,fn:n.fn,options:[e,t]}},rn=(e,t)=>{let n=Wt(e);return{name:n.name,fn:n.fn,options:[e,t]}};function an(e){let{nodeId:t,externalTree:n,rootContext:r}=e,i=r.useState(`referenceElement`),a=r.useState(`floatingElement`),o=r.useState(`domReferenceElement`),s=r.useState(`open`),c=r.useState(`floatingId`),[l,u]=H.useState(null),d=H.useRef(null),f=V(n),p=H.useMemo(()=>({reference:i,floating:a,domReference:o}),[i,a,o]),m=Qt({...e,elements:{...p,...l&&{reference:l}}}),h=H.useCallback(e=>{let t=g(e)?{getBoundingClientRect:()=>e.getBoundingClientRect(),getClientRects:()=>e.getClientRects(),contextElement:e}:e;u(t),m.refs.setReference(t)},[m.refs]),_=H.useMemo(()=>({...m.refs,setPositionReference:h,domReference:d}),[m.refs,h]),v=H.useMemo(()=>({...m.elements,domReference:o}),[m.elements,o]),y=H.useMemo(()=>({...m,dataRef:r.context.dataRef,open:s,onOpenChange:r.setOpen,events:r.context.events,floatingId:c,refs:_,elements:v,nodeId:t,rootStore:r}),[m,_,v,t,r,s,c]);return S(()=>{o&&(d.current=o)},[o]),S(()=>{r.context.dataRef.current.floatingContext=y;let e=f?.nodesRef.current.find(e=>e.id===t);e&&(e.context=y)}),H.useMemo(()=>({...m,context:y,refs:_,elements:v,rootStore:r}),[m,_,v,y,r])}var on=e=>({name:`arrow`,options:e,async fn(t){let{x:n,y:r,placement:i,rects:a,platform:o,elements:s,middlewareData:c}=t,{element:l,padding:u=0}=K(e,t)||{};if(l==null)return{};let d=je(u),f={x:n,y:r},p=be(i),m=ye(p),h=await o.getDimensions(l),g=p===`y`,_=g?`top`:`left`,v=g?`bottom`:`right`,y=g?`clientHeight`:`clientWidth`,b=a.reference[m]+a.reference[p]-f[p]-a.floating[m],x=f[p]-a.reference[p],S=s.floating[y]||a.floating[m],C=b/2-x/2,w=S/2-h[m]/2-1,T=Math.min(d[_],w),E=Math.min(d[v],w),D=T,O=S-h[m]-E,k=S/2-h[m]/2+C,A=ve(D,k,O),j=!c.arrow&&J(i)!=null&&k!==A&&a.reference[m]/2-(k<D?T:E)-h[m]/2<0,M=j?k<D?k-D:k-O:0;return{[p]:f[p]+M,data:{[p]:A,centerOffset:k-A-M,...j&&{alignmentOffset:M}},reset:j}}}),sn=(e,t)=>{let{name:n,fn:r}=on(e);return{name:n,fn:r,options:[e,t]}},cn={name:`hide`,async fn(e){let{width:t,height:n,x:r,y:i}=e.rects.reference,a=t===0&&n===0&&r===0&&i===0,o=await e.platform.detectOverflow(e,{elementContext:`reference`});return{data:{referenceHidden:o.top-n>=0||o.right-t>=0||o.bottom-n>=0||o.left-t>=0||a}}}},ln={sideX:`left`,sideY:`top`},un=`--available-width`,dn=`--available-height`,fn=`--anchor-width`,pn=`--anchor-height`,mn=`--transform-origin`,hn=un,gn=dn;function _n(e,t,n){let r=e===`inline-start`||e===`inline-end`;return{top:`top`,right:r?n?`inline-start`:`inline-end`:`right`,bottom:`bottom`,left:r?n?`inline-end`:`inline-start`:`left`}[t]}function vn(e,t,n){let{rects:r,placement:i}=e;return{side:_n(t,q(i),n),align:J(i)||`center`,anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function yn(e){return bn(e,an)}function bn(e,t){let{anchor:n,positionMethod:r=`absolute`,side:i=`bottom`,sideOffset:a=0,align:o=`center`,alignOffset:s=0,collisionBoundary:c,collisionPadding:l=5,sticky:d=!1,arrowPadding:f=5,disableAnchorTracking:p=!1,inline:m,keepMounted:h=!1,floatingRootContext:g,mounted:_,collisionAvoidance:v,shift:y,nodeId:b,adaptiveOrigin:C,lazyFlip:w=!1,externalTree:T}=e,E=v.side||`flip`,D=v.align||`flip`,O=v.fallbackAxisSide||`end`,k=y?.crossAxis??!1,A=y?.rootBoundary,j=typeof n==`function`?n:void 0,M=u(j),N=j?M:n,P=R(n),ee=R(_),F=fe()===`rtl`,[te,I]=H.useState(null);!_&&te!==null&&I(null);let L=w===`placement`,ne=te?q(te):null,re=te&&L?J(te)||`center`:null,ae=ne||{top:`top`,right:`right`,bottom:`bottom`,left:`left`,"inline-end":F?`left`:`right`,"inline-start":F?`right`:`left`}[i],z=re||o,oe=z===`center`?ae:`${ae}-${z}`,B=l;typeof B==`number`?B={top:B,right:B,bottom:B,left:B}:B&&={top:B.top||0,right:B.right||0,bottom:B.bottom||0,left:B.left||0};let se=+(i===`bottom`),ce=+(i===`top`),le=+(i===`right`),ue=+(i===`left`),de={boundary:c===`clipping-ancestors`?`clippingAncestors`:c,padding:B},V=H.useRef(null),pe=R(a),me=R(s),he=typeof a==`function`?0:a,U=typeof s==`function`?0:s,W=[];m&&W.push(m),W.push($t(e=>{let t=vn(e,i,F),n=typeof pe.current==`function`?pe.current(t):pe.current,r=typeof me.current==`function`?me.current(t):me.current;return{mainAxis:n,crossAxis:r,alignmentAxis:r}},[he,U,F,i]));let ge=D===`none`&&E!==`shift`,G=!ge&&(d||k||E===`shift`),_e=E===`none`?null:nn({...de,padding:{top:B.top+1+se,right:B.right+1+ue,bottom:B.bottom+1+ce,left:B.left+1+le},mainAxis:!k&&E===`flip`,crossAxis:D===`flip`&&`alignment`,fallbackAxisSideDirection:O}),ve=ge?null:en({...de,rootBoundary:A,mainAxis:D!==`none`,crossAxis:G,limiter:d||k?void 0:tn(e=>{if(!V.current)return{};let{width:t,height:n}=V.current.getBoundingClientRect(),r=X(q(e.placement)),i=r===`y`?t:n,a=r===`y`?B.left+B.right:B.top+B.bottom;return{offset:i/2+a/2}})},[de,d,k,A,B,D]);E===`shift`||D===`shift`||z===`center`?W.push(ve,_e):W.push(_e,ve),W.push(rn({...de,apply({elements:{floating:e},availableWidth:t,availableHeight:n,rects:r}){if(!ee.current)return;let i=e.style;i.setProperty(hn,`${t}px`),i.setProperty(gn,`${n}px`);let a=x(e).devicePixelRatio||1,{x:o,y:s,width:c,height:l}=r.reference,u=(Math.round((o+c)*a)-Math.round(o*a))/a,d=(Math.round((s+l)*a)-Math.round(s*a))/a;i.setProperty(fn,`${u}px`),i.setProperty(pn,`${d}px`)}}),sn(e=>({element:V.current||ie(e.elements.floating).createElement(`div`),padding:V.current?f:0}),[f]),{name:`transformOrigin`,fn(e){let{elements:{floating:t},middlewareData:n,placement:r,platform:o,rects:s,y:c}=e,l=q(r),u=J(r),d=X(l)===`y`,f=V.current,p=typeof a==`function`?a(vn(e,i,F)):a,m;m=!f&&u&&Math.abs(d?n.shift?.x||0:n.shift?.y||0)<=1?u===`start`===(d&&o.isRTL?.(t)===!0)?`100%`:`0%`:`${(d?n.arrow?.x||0:n.arrow?.y||0)+(d?f?.clientWidth||0:f?.clientHeight||0)/2}px`;let h=l===`top`||l===`left`?`calc(100% + ${p}px)`:`${-p}px`;return G&&d&&Math.abs(n.shift?.y||0)>p&&(h=`${s.reference.y+s.reference.height/2-c}px`),t.style.setProperty(mn,d?`${m} ${h}`:`${h} ${m}`),{}}},cn,C),S(()=>{!_&&g&&g.update({referenceElement:null,floatingElement:null,domReferenceElement:null,positionReference:null})},[_,g]);let K=H.useMemo(()=>({ancestorScroll:!p,elementResize:!p&&typeof ResizeObserver<`u`,layoutShift:!p&&typeof IntersectionObserver<`u`}),[p]),{refs:Y,elements:ye,x:be,y:xe,middlewareData:Se,update:Ce,placement:we,context:Te,isPositioned:Z,floatingStyles:Ee}=t({rootContext:g,open:h?_:void 0,placement:oe,middleware:W,strategy:r,whileElementsMounted:h?void 0:(...e)=>Bt(...e,K),nodeId:b,externalTree:T}),{sideX:De,sideY:Oe}=Se.adaptiveOrigin||ln,ke=Z?r:`fixed`,Ae=H.useMemo(()=>{let e;return e=Z?C?{position:ke,[De]:be,[Oe]:xe}:{...Ee,position:ke}:{position:ke,top:0,left:0},e[hn]=`100vw`,e[gn]=`100vh`,Z||(e.opacity=0),e},[C,ke,De,be,Oe,xe,Ee,Z]),je=H.useRef(null);S(()=>{if(!_)return;let e=P.current,t=typeof e==`function`?e():e,n=(xn(t)?t.current:t)||null;n!==je.current&&(Y.setPositionReference(n),je.current=n)},[_,Y,N,P]),H.useEffect(()=>{if(!_)return;let e=P.current;typeof e!=`function`&&xn(e)&&e.current!==je.current&&(Y.setPositionReference(e.current),je.current=e.current)},[_,Y,N,P]),H.useEffect(()=>{if(h&&_&&ye.reference&&ye.floating)return Bt(ye.reference,ye.floating,Ce,K)},[h,_,ye,Ce,K]);let Q=q(we),Me=_n(i,Q,F),Ne=J(we)||`center`,Pe=!!Se.hide?.referenceHidden;S(()=>{w&&_&&Z&&(Q!==ae||L&&Ne!==z)&&I(we)},[w,L,_,Z,we,Q,Ne,ae,z]);let Fe=H.useMemo(()=>({position:`absolute`,top:Se.arrow?.y,left:Se.arrow?.x}),[Se.arrow]),Ie=Se.arrow?.centerOffset!==0;return H.useMemo(()=>({positionerStyles:Ae,arrowStyles:Fe,arrowRef:V,arrowUncentered:Ie,side:Me,align:Ne,physicalSide:Q,anchorHidden:Pe,refs:Y,context:Te,isPositioned:Z,update:Ce}),[Ae,Fe,V,Ie,Me,Ne,Q,Pe,Y,Te,Z,Ce])}function xn(e){return e!=null&&`current`in e}function Sn(e){return e===`starting`?ae:m}function Cn(e,t,{styles:n,transitionStatus:r,props:i,refs:a,hidden:o,inert:s=!1}){let c={...n};return s&&(c.pointerEvents=`none`),p(`div`,e,{state:t,ref:a,props:[{role:`presentation`,hidden:o,style:c},Sn(r),i],stateAttributesMapping:B})}export{qe as a,ze as c,et as i,Le as l,Sn as n,Ge as o,yn as r,We as s,Cn as t,Ne as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i as e,r as t,s as n}from"./useRouter-Hur3RN7j.js";import{A as r,D as i,E as a,F as o,I as s,L as c,N as l,O as u,P as d,S as f,T as p,b as m,g as h,h as g,i as _,j as ee,k as v,l as y,u as te,x as b,z as x}from"./mark-B8EExm_5.js";import{n as ne,t as S}from"./with-selector-Dwf291_Q.js";import{A as C,B as w,H as T,P as E,R as D,S as re,V as ie,_ as O,b as k,d as A,h as j,k as M,m as N,s as P,v as F,x as I,y as ae,z as L}from"./button-4rhhIcK8.js";var R=n(e(),1);function z(e){return e?.ownerDocument||document}function oe(){return typeof navigator>`u`?{userAgent:``,platform:``,maxTouchPoints:0}:{userAgent:navigator.userAgent,platform:navigator.platform??``,maxTouchPoints:navigator.maxTouchPoints??0}}var{userAgent:B,platform:V,maxTouchPoints:H}=oe(),U=B.toLowerCase(),W=V.toLowerCase(),G=/^i(os$|p)/.test(W)||W===`macintel`&&H>1,se=`android`,K=W===se||U.includes(se),ce=!G&&W.startsWith(`mac`);W.startsWith(`win`),!K&&/^(linux|chrome os)/.test(W);var le=ce||G,ue=typeof CSS<`u`&&!!CSS.supports?.(`-webkit-backdrop-filter:none`);!ue&&U.includes(`firefox`),!ue&&U.includes(`chrom`);var q=le,J=/jsdom|happydom/.test(U),Y=t();function X(e){let t=e.activeElement;for(;t?.shadowRoot?.activeElement!=null;)t=t.shadowRoot.activeElement;return t}function Z(e,t){if(!e||!t)return!1;let n=t.getRootNode?.();if(e.contains(t))return!0;if(n&&re(n)){let n=t;for(;n;){if(e===n)return!0;n=n.parentNode||n.host}}return!1}function de(e,t){let n=e;for(;n;){if(O(n)&&n.matches(t))return n;n=n.assignedSlot??n.parentNode??(re(n)?n.host:null)}return null}function fe(e){return`composedPath`in e?e.composedPath()[0]??e.target:e.target}var Q=`data-base-ui-focusable`,pe=`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`,me=`ArrowLeft`,he=`ArrowRight`,ge=`ArrowUp`,_e=`ArrowDown`,ve=`data-open`,ye=`data-closed`,be=d,xe=l,Se=`data-anchor-hidden`,Ce=`data-popup-open`,we=`data-pressed`,Te={[Ce]:``},Ee={[Ce]:``,[we]:``},De={[ve]:``},Oe={[ye]:``},ke={[Se]:``},Ae={open(e){return e?Te:null}},je={open(e){return e?Ee:null}},Me={open(e){return e?De:Oe},anchorHidden(e){return e?ke:null}},Ne={...Me,...r},Pe=`data-trigger-disabled`;function Fe(e,t){if(!O(e))return!1;let n=e;if(t.hasElement(n))return!n.hasAttribute(Pe);for(let[,e]of t.entries())if(Z(e,n))return!e.hasAttribute(Pe);return!1}function Ie(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 Le(e){return e.matches(`html,body`)}function Re(e){return F(e)&&e.matches(`input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])`)}function ze(e){return de(e,`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),${pe}`)!=null}function Be(e){return e?e.getAttribute(`role`)===`combobox`&&Re(e):!1}function Ve(e){if(!e||J)return!0;try{return e.matches(`:focus-visible`)}catch{return!0}}function He(e){return e?e.hasAttribute(`data-base-ui-focusable`)?e:e.querySelector(`[data-base-ui-focusable]`)||e:null}function Ue(e,t,n=!0){return e.filter(e=>e.parentId===t).flatMap(t=>[...!n||t.context?.open?[t]:[],...Ue(e,t.id,n)])}function We(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 Ge(e){e.preventDefault(),e.stopPropagation()}function Ke(e){return`nativeEvent`in e}function qe(e){return e.pointerType===``&&e.isTrusted?!0:K&&e.pointerType?e.type===`click`&&e.buttons===1:e.detail===0&&!e.pointerType}function Je(e){return J?!1:!K&&e.width===0&&e.height===0||e.type===`pointerdown`&&e.width===1&&e.height===1&&e.pressure===0&&e.detail===0&&e.pointerType===`mouse`&&(K||e.buttons===0)||e.width<1&&e.height<1&&e.pressure===0&&e.detail===0&&e.pointerType===`touch`}function Ye(e,t){let n=[`mouse`,`pen`];return t||n.push(``,void 0),n.includes(e)}function Xe(e){let t=e.type;return t===`click`||t===`mousedown`||t===`keydown`||t===`keyup`}function Ze(e,t){return t<0||t>=e.length}function Qe(e,t){return tt(e.current,{disabledIndices:t})}function $e(e,t){return tt(e.current,{decrement:!0,startingIndex:e.current.length,disabledIndices:t})}function et(e,t,n){let{decrement:r,loopFocus:i,allowEscape:a,disabledIndices:o,minIndex:s,maxIndex:c}=n,l=()=>tt(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:Ze(e,u)?-1:u,wrapped:d}}function tt(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&&nt(e,a,r));return a}function nt(e,t,n){if(typeof n==`function`?n(t):n?.includes(t)??!1)return!0;let r=e[t];return r?!it(r)||r.matches(`:disabled`)?!0:!n&&(r.hasAttribute(`disabled`)||r.getAttribute(`aria-disabled`)===`true`):!1}function rt(e){return e.visibility===`hidden`||e.visibility===`collapse`}function it(e,t=e?P(e):null){return!e||!e.isConnected||!t||rt(t)?!1:typeof e.checkVisibility==`function`?e.checkVisibility():t.display!==`none`&&t.display!==`contents`}var at=`a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]`;function ot(e){let t=e.assignedSlot;if(t)return t;if(e.parentElement)return e.parentElement;let n=e.getRootNode();return re(n)?n.host:null}function st(e){for(let t of Array.from(e.children))if(A(t)===`summary`)return t;return null}function ct(e,t){let n=st(t);return!!n&&(e===n||Z(n,e))}function lt(e){let t=e?A(e):``;return e!=null&&e.matches(at)&&(t!==`summary`||e.parentElement!=null&&A(e.parentElement)===`details`&&st(e.parentElement)===e)&&(t!==`details`||st(e)==null)&&(t!==`input`||e.type!==`hidden`)}function ut(e){if(!lt(e)||!e.isConnected||e.matches(`:disabled`))return!1;for(let t=e;t;t=ot(t)){let n=t!==e,r=A(t)===`slot`;if(t.hasAttribute(`inert`)||n&&A(t)===`details`&&!t.open&&!ct(e,t)||t.hasAttribute(`hidden`)||!r&&!dt(t,n))return!1}return!0}function dt(e,t){let n=P(e);return t?n.display!==`none`:it(e,n)}function ft(e){let t=e.tabIndex;if(t<0){let t=A(e);if(t===`details`||t===`audio`||t===`video`||F(e)&&e.isContentEditable)return 0}return t}function pt(e){if(A(e)!==`input`)return null;let t=e;return t.type===`radio`&&t.name!==``?t:null}function mt(e,t){let n=pt(e);if(!n)return!0;let r=t.find(e=>{let t=pt(e);return t?.name===n.name&&t.form===n.form&&t.checked});return r?r===n:t.find(e=>{let t=pt(e);return t?.name===n.name&&t.form===n.form})===n}function ht(e){if(F(e)&&A(e)===`slot`){let t=e.assignedElements({flatten:!0});if(t.length>0)return t}return F(e)&&e.shadowRoot?Array.from(e.shadowRoot.children):Array.from(e.children)}function gt(e,t){ht(e).forEach(e=>{lt(e)&&t.push(e),gt(e,t)})}function _t(e,t,n){ht(e).forEach(e=>{F(e)&&e.matches(t)&&n.push(e),_t(e,t,n)})}function vt(e){return ut(e)&&ft(e)>=0}function yt(e){let t=[];return gt(e,t),t.filter(ut)}function bt(e){let t=yt(e);return t.filter(e=>ft(e)>=0&&mt(e,t))}function xt(e,t){let n=bt(e),r=n.length;if(r===0)return;let i=X(z(e)),a=n.indexOf(i);return n[a===-1?t===1?0:r-1:a+t]}function St(e){return xt(z(e).body,1)||e}function Ct(e){return xt(z(e).body,-1)||e}function wt(e,t,n){if(!e)return null;let r=[];gt(z(e).body,r);let i=r.indexOf(e);if(i===-1)return null;let a=r.filter(ut);for(let e=1;e<r.length;e+=1){let o=r[(i+t*e+r.length)%r.length];if(!Z(n,o)&&vt(o)&&mt(o,a))return o}return r[i]}function Tt(e,t){let n=t||e.currentTarget,r=e.relatedTarget;return!r||!Z(n,r)}function Et(e){bt(e).forEach(e=>{e.dataset.tabindex=e.getAttribute(`tabindex`)||``,e.setAttribute(`tabindex`,`-1`)})}function Dt(e){let t=[];_t(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 $(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function Ot(...e){return()=>{for(let t=0;t<e.length;t+=1){let n=e[t];n&&n()}}}function kt(e){let t=T(At,e).current;return t.next=e,M(t.effect),t}function At(e){let t={current:e,next:e,effect:()=>{t.current=t.next}};return t}var jt=R.forwardRef(function(e,t){let[n,r]=R.useState();M(()=>{q&&ue&&r(`button`)},[]);let i={tabIndex:0,role:n};return(0,Y.jsx)(`span`,{...e,ref:t,style:_,"aria-hidden":!n||void 0,...i,"data-base-ui-focus-guard":``})});function Mt(e){return`data-base-ui-${e}`}var Nt=0;function Pt(e,t={}){let{preventScroll:n=!1,sync:r=!1,shouldFocus:i}=t;cancelAnimationFrame(Nt);function a(){(!i||i())&&e?.focus({preventScroll:n})}if(r)return a(),L;let o=requestAnimationFrame(a);return Nt=o,()=>{Nt===o&&(cancelAnimationFrame(o),Nt=0)}}var Ft=`data-base-ui-inert`,It=new WeakMap,Lt=new WeakSet,Rt=new WeakMap,zt=0;function Bt(e){return e?re(e)?e.host:Bt(e.parentNode):null}var Vt=(e,t)=>t.map(t=>{if(e.contains(t))return t;let n=Bt(t);return e.contains(n)?n:null}).filter(e=>e!=null),Ht=e=>{let t=new Set;return e.forEach(e=>{let n=e;for(;n&&!t.has(n);)t.add(n),n=n.parentNode}),t},Ut=(e,t,n)=>{let r=[],i=e=>{e&&!n.has(e)&&Array.from(e.children).forEach(e=>{A(e)!==`script`&&(t.has(e)?i(e):r.push(e))})};return i(e),r};function Wt(e,t,n,{mark:r=!0}){let i=Vt(t,e),a=r?Ut(t,Ht(i),new Set(i)):[],o=[],s=[];if(n){let e=Vt(t,Array.from(t.querySelectorAll(`[aria-live]`))),n=i.concat(e);Ut(t,Ht(n),new Set(n)).forEach(e=>{let t=e.getAttribute(`aria-hidden`),n=t!==null&&t!==`false`,r=(It.get(e)||0)+1;It.set(e,r),o.push(e),r===1&&n&&Lt.add(e),n||e.setAttribute(`aria-hidden`,`true`)})}return r&&a.forEach(e=>{let t=(Rt.get(e)||0)+1;Rt.set(e,t),s.push(e),t===1&&e.setAttribute(Ft,``)}),zt+=1,()=>{o.forEach(e=>{let t=(It.get(e)||0)-1;It.set(e,t),t||(Lt.has(e)||e.removeAttribute(`aria-hidden`),Lt.delete(e))}),r&&s.forEach(e=>{let t=(Rt.get(e)||0)-1;Rt.set(e,t),t||e.removeAttribute(Ft)}),--zt,zt||(It=new WeakMap,Lt=new WeakSet,Rt=new WeakMap)}}function Gt(e,t={}){let{ariaHidden:n=!1,mark:r=!0}=t,i=z(e[0]).body;return Wt(e,i,n,{mark:r})}var Kt=n(x(),1),qt={style:{transition:`none`}},Jt=`data-base-ui-click-trigger`,Yt={fallbackAxisSide:`none`},Xt={fallbackAxisSide:`end`},Zt={clipPath:`inset(50%)`,position:`fixed`,top:0,left:0},Qt=R.createContext(null),$t=()=>R.useContext(Qt),en=Mt(`portal`);function tn(e={}){let{ref:t,container:n,componentProps:r=D,elementProps:i}=e,a=p(),o=$t()?.portalNode,[s,c]=R.useState(null),[l,u]=R.useState(null),d=C(e=>{e!==null&&u(e)}),f=R.useRef(null);M(()=>{if(n===null){f.current&&(f.current=null,u(null),c(null));return}let e=(n&&(k(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 m=E(`div`,r,{ref:[t,d],props:[{id:a,[en]:``},i]}),h=s&&m?Kt.createPortal(m,s):null;return{node:l,nodeId:R.isValidElement(m)?m.props.id:void 0,subtree:h}}var nn=R.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}=tn({container:o,ref:t,componentProps:e,elementProps:c}),p=R.useRef(null),m=R.useRef(null),h=R.useRef(null),g=R.useRef(null),[_,ee]=R.useState(null),v=R.useRef(!1),y=_?.modal,te=_?.open,b=!!_&&!_.modal&&_.open&&!!l;R.useEffect(()=>{if(!l||y)return;function e(e){l&&e.relatedTarget&&Tt(e)&&(e.type===`focusin`?v.current&&=(Dt(l),!1):(Et(l),v.current=!0))}return Ot($(l,`focusin`,e,!0),$(l,`focusout`,e,!0))},[l,y]),M(()=>{l&&te===!0&&v.current&&(Dt(l),v.current=!1)},[te,l]);let x=R.useMemo(()=>({beforeOutsideRef:p,afterOutsideRef:m,beforeInsideRef:h,afterInsideRef:g,portalNode:l,setFocusManagerState:ee}),[l]);return(0,Y.jsxs)(R.Fragment,{children:[d,(0,Y.jsxs)(Qt.Provider,{value:x,children:[b&&l&&(0,Y.jsx)(jt,{"data-type":`outside`,ref:p,onFocus:e=>{Tt(e,l)?h.current?.focus():Ct(_?_.domReference:null)?.focus()}}),b&&l&&(0,Y.jsx)(`span`,{role:s,"aria-owns":u,style:Zt}),l&&Kt.createPortal(a,l),b&&l&&(0,Y.jsx)(jt,{"data-type":`outside`,ref:m,onFocus:e=>{Tt(e,l)?g.current?.focus():(St(_?_.domReference:null)?.focus(),_?.closeOnFocusOut&&_?.onOpenChange(!1,f(`focus-out`,e.nativeEvent)))}})]})]})});function rn(){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 an=class{nodesRef={current:[]};events=rn();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)}},on=R.createContext(null),sn=R.createContext(null),cn=()=>R.useContext(on)?.id||null,ln=e=>{let t=R.useContext(sn);return e??t};function un(e){let t=p(),n=ln(e),r=cn();return M(()=>{if(!t)return;let e={id:t,parentId:r};return n?.addNode(e),()=>{n?.removeNode(e)}},[n,t,r]),t}function dn(e){let{children:t,id:n}=e,r=cn();return(0,Y.jsx)(on.Provider,{value:R.useMemo(()=>({id:n,parentId:r}),[n,r]),children:t})}function fn(e){let{children:t,externalTree:n}=e,r=T(()=>n??new an).current;return(0,Y.jsx)(sn.Provider,{value:r,children:t})}function pn(e,t){let n=j(fe(e));return e instanceof n.KeyboardEvent?`keyboard`:e instanceof n.FocusEvent?t||`keyboard`:`pointerType`in e?e.pointerType||(qe(e)?`keyboard`:t||`mouse`):`touches`in e?`touch`:e instanceof n.MouseEvent?t||(e.detail===0?`keyboard`:`mouse`):``}var mn=20,hn=[];function gn(){hn=hn.filter(e=>e.deref()?.isConnected)}function _n(e){gn(),e&&A(e)!==`body`&&(hn.push(new WeakRef(e)),hn.length>mn&&(hn=hn.slice(-20)))}function vn(){return gn(),hn[hn.length-1]?.deref()}function yn(e){return e?vt(e)?e:bt(e)[0]||e:null}function bn(e){if(e.hasAttribute(`tabindex`)&&!e.hasAttribute(`data-tabindex`)||!e.getAttribute(`role`)?.includes(`dialog`))return;let t=yt(e).filter(e=>{let t=e.getAttribute(`data-tabindex`)||``;return vt(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 xn(e){let{context:t,children:n,disabled:r=!1,initialFocus:i=!0,returnFocus:a=!0,explicitReturnFocus:s,restoreFocus:l=!1,modal:d=!0,closeOnFocusOut:p=!0,openInteractionType:m=``,nextFocusableElement:h,previousFocusableElement:g,beforeContentFocusGuardRef:_,externalTree:ee,getInsideElements:v}=e,y=t.useState(`open`),b=t.useState(`domReferenceElement`),x=t.useState(`floatingElement`),{events:ne,dataRef:S}=t.context,w=C(()=>S.current.floatingContext?.nodeId),T=i===!1,E=Be(b)&&T,D=kt(i),re=kt(a),O=kt(s),k=kt(m),j=kt(y),N=ln(ee),P=$t(),I=R.useRef(!1),ae=R.useRef(!1),L=R.useRef(!1),oe=R.useRef(null),B=R.useRef(``),V=R.useRef(``),H=R.useRef(null),U=R.useRef(null),W=ie(H,_,P?.beforeInsideRef),G=ie(U,P?.afterInsideRef),se=u(),K=u(),ce=c(),le=P!=null,q=He(x),J=C((e=q)=>e?bt(e):[]),Q=C(()=>v?.().filter(e=>e!=null)??[]);R.useEffect(()=>{if(r||!d)return;function e(e){e.key===`Tab`&&Z(q,X(z(q)))&&J().length===0&&!E&&Ge(e)}return $(z(q),`keydown`,e)},[r,q,d,E,J]),R.useEffect(()=>{if(r||!y)return;let e=z(q);function t(){L.current=!1}function n(e){let t=fe(e),n=Q(),r=Z(x,t)||Z(b,t)||Z(P?.portalNode,t)||n.some(e=>e===t||Z(e,t));L.current=!r,V.current=e.pointerType||`keyboard`,de(t,`[data-base-ui-click-trigger]`)&&(ae.current=!0,K.start(0,()=>{ae.current=!1}))}function i(){V.current=`keyboard`}return Ot($(e,`pointerdown`,n,!0),$(e,`pointerup`,t,!0),$(e,`pointercancel`,t,!0),$(e,`keydown`,i,!0),t)},[r,x,b,q,y,P,K,Q]),R.useEffect(()=>{if(r||!p)return;let e=z(q);function n(){ae.current=!0,K.start(0,()=>{ae.current=!1})}function i(e){let t=fe(e);vt(t)&&(oe.current=t)}function a(n){let r=n.relatedTarget,i=n.currentTarget,a=fe(n);d&&r==null&&a!=null&&Z(x,a)&&_n(a),queueMicrotask(()=>{let s=w(),c=t.context.triggerElements,u=Q(),p=r?.hasAttribute(Mt(`focus-guard`))&&[H.current,U.current,P?.beforeInsideRef.current,P?.afterInsideRef.current,P?.beforeOutsideRef.current,P?.afterOutsideRef.current,o(g),o(h)].includes(r),m=!(Z(b,r)||Z(x,r)||Z(r,x)||Z(P?.portalNode,r)||u.some(e=>e===r||Z(e,r))||c.hasMatchingElement(e=>Z(e,r))||p||N&&(Ue(N.nodesRef.current,s).find(e=>Z(e.context?.elements.floating,r)||Z(e.context?.elements.domReference,r))||We(N.nodesRef.current,s).find(e=>[e.context?.elements.floating,He(e.context?.elements.floating)].includes(r)||e.context?.elements.domReference===r)));if(i===b&&q&&bn(q),l&&i!==b&&!it(a)&&X(e)===e.body){if(F(q)&&(q.focus(),l===`popup`)){ce.request(()=>{q.focus()});return}let e=J(),t=oe.current,n=(t&&e.includes(t)?t:null)||e[e.length-1]||q;F(n)&&n.focus()}S.current.insideReactTree?S.current.insideReactTree=!1:(E||!d)&&r&&m&&!ae.current&&(E||r!==vn())&&(I.current=!0,t.setOpen(!1,f(te,n)))})}function s(){L.current||(S.current.insideReactTree=!0,se.start(0,()=>{S.current.insideReactTree=!1}))}let c=F(b)?b:null;if(x||c)return Ot(c&&$(c,`focusout`,a),c&&$(c,`pointerdown`,n),x&&$(x,`focusin`,i),x&&$(x,`focusout`,a),x&&P&&$(x,`focusout`,s,!0))},[r,b,x,q,d,N,P,t,p,l,J,E,w,S,se,K,ce,h,g,Q]),R.useEffect(()=>{if(r||!x||!y)return;let e=Array.from(P?.portalNode?.querySelectorAll(`[${Mt(`portal`)}]`)||[]),t=(N?We(N.nodesRef.current,w()):[]).find(e=>Be(e.context?.elements.domReference||null))?.context?.elements.domReference,n=Gt([x,...e,H.current,U.current,P?.beforeOutsideRef.current,P?.afterOutsideRef.current,...Q(),t,o(g),o(h),E?b:null].filter(e=>e!=null),{ariaHidden:d||E,mark:!1}),i=Gt([x,...e].filter(e=>e!=null));return()=>{i(),n()}},[y,r,b,x,d,P,E,N,w,h,g,Q]),M(()=>{if(!y||r||!F(q))return;B.current=``,V.current=``;let e=z(q),t=X(e);queueMicrotask(()=>{let n=D.current,r=typeof n==`function`?n(k.current||``):n;if(r===void 0||r===!1||Z(q,t))return;let i=null,a=()=>(i??=J(q),i[0]||q),s;s=r===!0||r===null?a():o(r),s||=a();let c=Z(q,X(e)),l=S.current.openEvent,u=l?.type===`mousedown`&&qe(l);Pt(s,{sync:u,preventScroll:s===q,shouldFocus(){if(!j.current)return!1;if(c)return!0;let t=X(e);return!(t!==s&&Z(q,t))}})})},[r,y,q,J,D,k,j,S]);let pe=R.useRef(null);M(()=>{if(r||!q){pe.current=null;return}pe.current&&=(pe.current.cancelled=!0,null);let e=z(q),t=X(e),n=k.current==null;_n(t);function i(e){if(e.open||(B.current=pn(e.nativeEvent,V.current)),(e.reason===`focus-out`&&e.triggerElement?.hasAttribute(Mt(`focus-guard`))||e.reason===`trigger-hover`&&e.nativeEvent.type===`mouseleave`)&&(I.current=!0),e.reason===`outside-press`){if(e.nested)I.current=!1;else if(qe(e.nativeEvent)||Je(e.nativeEvent))I.current=!1;else{let e=!1;z(q).createElement(`div`).focus({get preventScroll(){return e=!0,!1}}),e?I.current=!1:I.current=!0}}}ne.on(`openchange`,i);function a(e){let r=re.current,i=typeof r==`function`?r(e):r;if(i===void 0||i===!1)return null;i===null&&(i=!0);let a=b?.isConnected?b:null,s=t?.isConnected&&A(t)!==`body`?t:null,c=n?s||a:a||s;return c||=vn()||null,typeof i==`boolean`?c:o(i)||c||null}return()=>{ne.off(`openchange`,i);let t=X(e),n=Q(),r=Z(x,t)||n.some(e=>e===t||Z(e,t))||N&&Ue(N.nodesRef.current,w(),!1).some(e=>Z(e.context?.elements.floating,t)),o=re.current,s=B.current,c=a(s),l={cancelled:!1};pe.current=l,queueMicrotask(()=>{pe.current===l&&(pe.current=null);let n=yn(c),i=O.current??typeof o!=`boolean`;if(!l.cancelled&&o&&!I.current&&F(n)&&(i||n===t||t===e.body||r)){let e={preventScroll:!0};s===`keyboard`&&(e.focusVisible=!0),n.focus(e)}I.current=!1})}},[r,x,q,re,O,k,ne,N,b,w,Q]),M(()=>{if(!ue||y||!x)return;let e=X(z(x));F(e)&&Re(e)&&Z(x,e)&&e.blur()},[y,x]),M(()=>{if(!r&&P)return P.setFocusManagerState({modal:d,closeOnFocusOut:p,open:y,onOpenChange:t.setOpen,domReference:b}),()=>{P.setFocusManagerState(null)}},[r,P,d,y,t,p,b]),M(()=>{if(!r&&q)return bn(q),()=>{queueMicrotask(gn)}},[r,q]);let me=!r&&(!d||!E)&&(le||d);return(0,Y.jsxs)(R.Fragment,{children:[me&&(0,Y.jsx)(jt,{"data-type":`inside`,ref:W,onFocus:e=>{if(d){let e=J();Pt(e[e.length-1])}else P?.portalNode&&(I.current=!1,Tt(e,P.portalNode)?St(b)?.focus():o(g??P.beforeOutsideRef)?.focus())}}),n,me&&(0,Y.jsx)(jt,{"data-type":`inside`,ref:G,onFocus:e=>{d?Pt(J()[0]):P?.portalNode&&(p&&(I.current=!0),Tt(e,P.portalNode)?Ct(b)?.focus():o(h??P.afterOutsideRef)?.focus())}})]})}function Sn(){return!1}function Cn(e){return{escapeKey:typeof e==`boolean`?e:e?.escapeKey??!1,outsidePress:typeof e==`boolean`?e:e?.outsidePress??!0}}function wn(e,t={}){let{enabled:n=!0,escapeKey:r=!0,outsidePress:a=!0,outsidePressEvent:o=`sloppy`,referencePress:s=Sn,bubbles:c,externalTree:l}=t,d=e.useState(`open`),p=e.useState(`floatingElement`),{dataRef:m,events:g}=e.context,_=ln(l),ee=C(typeof a==`function`?a:()=>!1),v=typeof a==`function`?ee:a,te=v!==!1,x=C(()=>o),{escapeKey:ne,outsidePress:S}=Cn(c),w=R.useRef(!1),T=R.useRef(!1),E=R.useRef(!1),D=R.useRef(!1),ie=R.useRef(!1),k=R.useRef(``),A=R.useRef(null),j=u(),M=u(),I=u(),L=C(()=>{M.clear(),m.current.insideReactTree=!1}),oe=C(e=>{let t=m.current.floatingContext?.nodeId;return(_?Ue(_.nodesRef.current,t):[]).some(t=>t.context?.open&&!t.context.dataRef.current[e])}),B=C(t=>Ie(t,e.select(`floatingElement`))||Ie(t,e.select(`domReferenceElement`))),V=C(t=>{s()&&e.setOpen(!1,f(b,t.nativeEvent))}),H=C(t=>{if(!d||!n||!r||t.key!==`Escape`)return;let i=Ke(t)?t.nativeEvent:t;if(ie.current||i.isComposing||!ne&&oe(`__escapeKeyBubbles`))return;let a=f(y,i);e.setOpen(!1,a),a.isCanceled||t.preventDefault(),!ne&&!a.isPropagationAllowed&&t.stopPropagation()}),U=C(()=>{m.current.insideReactTree=!0,M.start(0,L)}),W=C(t=>{if(!d||!n||t.button!==0)return;let r=fe(t.nativeEvent);Z(e.select(`floatingElement`),r)&&(w.current||(w.current=!0,T.current=!1))}),G=C(e=>{d&&n&&(e.defaultPrevented||e.nativeEvent.defaultPrevented)&&w.current&&(T.current=!0)});R.useEffect(()=>{function e(e){e.open||(D.current=!1)}return g.on(`openchange`,e),()=>{g.off(`openchange`,e)}},[g]),R.useEffect(()=>L,[L]),R.useEffect(()=>{if(!d||!n)return d||(D.current=!1,ie.current=!1,k.current=``,A.current=null),L;m.current.__escapeKeyBubbles=ne,m.current.__outsidePressBubbles=S;let t=new i,a=z(p);function o(){I.clear(),ie.current=!0}function s(){ie.current=!0,I.start(ue?5:0,()=>{ie.current=!1})}function c(){E.current=!0,t.start(0,()=>{E.current=!1})}function l(){w.current=!1,T.current=!1}function u(){let e=k.current,t=e===`pen`||!e?`mouse`:e,n=x(),r=typeof n==`function`?n():n;return typeof r==`string`?r:r[t]}function g(e){let t=u();return t===`intentional`&&e.type!==`click`||t===`sloppy`&&e.type===`click`}function ee(e){let t=m.current.floatingContext?.nodeId,n=_&&Ue(_.nodesRef.current,t).some(t=>Ie(e,t.context?.elements.floating));return B(e)||n}function y(n){if(g(n)){n.type!==`click`&&!B(n)&&(t.clear(),E.current=!1),L();return}if(m.current.insideReactTree){L();return}let r=fe(n),i=`[${Mt(`inert`)}]`,a=O(r)?r.getRootNode():null,o=Array.from((re(a)?a:z(e.select(`floatingElement`))).querySelectorAll(i)),s=e.context.triggerElements;if(r&&(s.hasElement(r)||s.hasMatchingElement(e=>Z(e,r))))return;let c=O(r)?r:null;for(;c&&!ae(c);){let e=N(c);if(ae(e)||!O(e))break;c=e}if(!(o.length&&O(r)&&!Le(r)&&!Z(r,e.select(`floatingElement`))&&o.every(e=>!Z(c,e)))){if(F(r)&&!(`touches`in n)){let e=ae(r),t=P(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(!ee(n)){if(u()===`intentional`){if(n.detail!==0&&!qe(n)&&!D.current)return;if(E.current){t.clear(),E.current=!1;return}}(typeof v!=`function`||v(n))&&(oe(`__outsidePressBubbles`)||(e.setOpen(!1,f(h,n)),L()))}}}function b(t){u()===`sloppy`&&t.pointerType!==`touch`&&e.select(`open`)&&n&&!B(t)&&y(t)}function C(t){if(u()!==`sloppy`||!e.select(`open`)||!n||B(t))return;let r=t.touches[0];r&&(A.current={startTime:Date.now(),startX:r.clientX,startY:r.clientY,dismissOnTouchEnd:!1,dismissOnMouseDown:!0},j.start(1e3,()=>{A.current&&(A.current.dismissOnTouchEnd=!1,A.current.dismissOnMouseDown=!1)}))}function M(e,t){let n=fe(e);if(!n)return;let r=$(n,e.type,()=>{t(e),r()})}function R(e){k.current=`touch`,M(e,C)}function V(e){j.clear(),e.type===`pointerdown`&&(e.button===0&&(D.current=!0),k.current=e.pointerType),(e.type!==`mousedown`||!A.current||A.current.dismissOnMouseDown)&&M(e,e=>{e.type===`pointerdown`?b(e):y(e)})}function U(e){if(e.type===`pointercancel`&&(D.current=!1),!w.current)return;let n=T.current;l(),u()===`intentional`&&(e.type===`pointercancel`?n&&c():ee(e)||(n?c():(typeof v!=`function`||v(e))&&(t.clear(),E.current=!0,L())))}function W(e){if(u()!==`sloppy`||!A.current||B(e))return;let t=e.touches[0];if(!t)return;let n=Math.abs(t.clientX-A.current.startX),r=Math.abs(t.clientY-A.current.startY),i=Math.sqrt(n*n+r*r);i>5&&(A.current.dismissOnTouchEnd=!0),i>10&&(y(e),j.clear(),A.current=null)}function G(e){M(e,W)}function se(e){u()===`sloppy`&&A.current&&!B(e)&&(A.current.dismissOnTouchEnd&&y(e),j.clear(),A.current=null)}function K(e){M(e,se)}let ce=Ot(r&&Ot($(a,`keydown`,H),$(a,`compositionstart`,o),$(a,`compositionend`,s)),te&&Ot($(a,`click`,V,!0),$(a,`pointerdown`,V,!0),$(a,`pointerup`,U,!0),$(a,`pointercancel`,U,!0),$(a,`mousedown`,V,!0),$(a,`mouseup`,U,!0),$(a,`touchstart`,R,{capture:!0,passive:!0}),$(a,`touchmove`,G,{capture:!0,passive:!0}),$(a,`touchend`,K,{capture:!0,passive:!0})));return()=>{ce(),t.clear(),l(),E.current=!1}},[m,p,r,te,v,d,n,ne,S,H,L,x,oe,B,_,e,j,I]);let se=R.useMemo(()=>({onKeyDown:H,onPointerDown:V,onClick:V}),[H,V]),K=R.useMemo(()=>({onKeyDown:H,onPointerDown:G,onMouseDown:G,onClickCapture:U,onMouseDownCapture(e){U(),W(e)},onPointerDownCapture(e){U(),W(e)},onMouseUpCapture:U,onTouchEndCapture:U,onTouchMoveCapture:U}),[H,U,W,G]);return R.useMemo(()=>n?{reference:se,floating:K,trigger:se}:{},[n,se,K])}function Tn(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),M(()=>{let e={open:s,floatingId:i,referenceElement:c,floatingElement:l};O(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 En(e){let{open:t,ref:n,preventUnmountOnClose:r,setPreventUnmountOnClose:i,onUnmount:o,animateInitialOpen:s}=e,c=C(i),{mounted:l,setMounted:u,transitionStatus:d}=v(t,!1,!1,s),f=!t&&r;M(()=>{t&&c(!1)},[t,c]);let p=R.useRef(l),m=R.useRef(!1),h=a(),g=()=>{p.current=!1,u(!1),o()};M(()=>{p.current=l,m.current&&(m.current=!1,!t&&l&&g())});let _=C(()=>{p.current&&(t?(m.current=!0,h()):g())});return ee({enabled:l&&!t&&!f,open:t,ref:n,onComplete(){t||_()}}),{mounted:l,transitionStatus:d,preventUnmountingOnClose:f,forceUnmount:_}}var Dn={tabIndex:-1,[Q]:``};function On(e){return t=>t!==`touch`||e.current}function kn(e,t=!1){let n=p(),r=cn()!=null,i=T(()=>e(n,r)).current;return Tn({popupStore:i,treatPopupAsFloatingElement:t,floatingRootContext:i.state.floatingRootContext,floatingId:n,nested:r,onOpenChange:i.setOpen}),i}function An({handle:e,store:t}){return M(()=>e.attachStore(t),[e,t]),null}function jn(e){let t=e.context.triggerElements.size;e.select(`open`)&&e.state.triggerCount!==t&&e.set(`triggerCount`,t)}function Mn(e,t){let n=R.useRef(null);return C(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),jn(a))}r!==null&&e!==void 0&&(n.current={store:t,id:e,element:r},t.context.triggerElements.add(e,r),jn(t))})}function Nn(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 Pn(e){let t=!1;return e.preventUnmountOnClose=()=>{t=!0},()=>t}function Fn(e,t,n,r={}){let i=n.reason,a=i===m,o=t&&i===`trigger-focus`,s=!t&&(i===`trigger-press`||i===`escape-key`),c=Pn(n);if(e.context.onOpenChange?.(t,n),n.isCanceled)return;r.onBeforeDispatch?.(),e.state.floatingRootContext.dispatchOpenChange(t,n);let l=()=>{let i=Nn(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?Kt.flushSync(l):l()}function In(e,t,n,r){let i=n.useState(`isMountedByTrigger`,e),a=Mn(e,n),o=C(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=C(e=>{a(e),e&&o(e)});return M(()=>(s(t.current),()=>s(null)),[s,t,n,e]),M(()=>{if(i){let e={activeTriggerElement:t.current,...r};n.update(e)}},[i,n,t,...Object.values(r)]),{registerTrigger:s,isMountedByThisTrigger:i}}function Ln(e,t={}){let{closeOnActiveTriggerUnmount:n=!1}=t,r=R.useRef(null),i=e.useState(`open`),a=e.useState(`triggerCount`),o=e.useState(`activeTriggerId`),s=e.useState(`activeTriggerElement`);M(()=>{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=f(g);e.setOpen(!1,t),t.isCanceled||e.update({activeTriggerId:null,activeTriggerElement:null})}})},[i,e,a,o,s,n])}function Rn(e,t,n,r){let{mounted:i,transitionStatus:a,forceUnmount:o}=En({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 T(()=>(t.set(`mounted`,i),null)),t.useSyncedValues({mounted:i,transitionStatus:a}),{forceUnmount:o,transitionStatus:a}}function zn(e,t){e.useSyncedValues(t),M(()=>()=>{e.update({activeTriggerProps:D,inactiveTriggerProps:D,popupProps:D})},[e])}function Bn(e,t){M(()=>{!t&&e.state.openMethod!==null&&e.set(`openMethod`,null)},[t,e]),M(()=>()=>{e.state.openMethod!==null&&e.set(`openMethod`,null)},[e])}var Vn=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}},Hn=ne(),Un=S(),Wn=[],Gn=void 0;function Kn(){return Gn}function qn(e){Wn.push(e)}function Jn(e){let t=(t,n)=>{let r=T(Xn).current,i;try{Gn=r;for(let e of Wn)e.before(r);i=e(t,n);for(let e of Wn)e.after(r);r.didInitialize=!0}finally{Gn=void 0}return i};return t.displayName=e.displayName||e.name,t}function Yn(e){return R.forwardRef(Jn(e))}function Xn(){return{didInitialize:!1}}var Zn=w(19)?er:tr;function Qn(e,t,n,r,i){return Zn(e,t,n,r,i)}function $n(e,t,n,r,i){let a=R.useCallback(()=>t(e.getSnapshot(),n,r,i),[e,t,n,r,i]);return(0,Hn.useSyncExternalStore)(e.subscribe,a,a)}qn({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,Hn.useSyncExternalStore)(e.subscribe,e.getSnapshot,e.getSnapshot))}});function er(e,t,n,r,i){let a=Kn();if(!a)return $n(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 tr(e,t,n,r,i){return(0,Un.useSyncExternalStoreWithSelector)(e.subscribe,e.getSnapshot,e.getSnapshot,e=>t(e,n,r,i))}var nr=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 Qn(this,e,t,n,r)}},rr=class extends nr{constructor(e,t={},n){super(e),this.context=t,this.selectors=n}useSyncedValue(e,t){R.useDebugValue(e);let n=this;M(()=>{n.state[e]!==t&&n.set(e,t)},[n,e,t])}useSyncedValueWithCleanup(e,t){let n=this;M(()=>(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);M(()=>{t.update(e)},[t,...n])}useControlledProp(e,t){R.useDebugValue(e);let n=this,r=t!==void 0;M(()=>{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 R.useDebugValue(e),Qn(this,this.selectors[e],t,n,r)}useContextCallback(e,t){R.useDebugValue(e);let n=C(t??L);this.context[e]=n}useStateSetter(e){let t=R.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)}})}},ir={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},ar=class extends rr{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:rn(),nested:n,triggerElements:i},ir),this.syncOnly=t}syncOpenEvent=(e,t)=>{(!e||!this.state.open||t!=null&&Xe(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 or(e,t,n=!1){return{open:!1,openProp:void 0,mounted:!1,transitionStatus:void 0,floatingRootContext:new ar({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:D,inactiveTriggerProps:D,popupProps:D}}var sr=e=>e.triggerIdProp??e.activeTriggerId,cr=e=>e.openProp??e.open,lr=e=>(e.popupElement?.id??e.floatingId)||void 0;function ur(e,t){return t!==void 0&&cr(e)&&sr(e)===t}function dr(e,t){return ur(e,t)?!0:t!==void 0&&cr(e)&&sr(e)==null&&!e.openedWithoutTrigger&&e.triggerCount===1}var fr={open:cr,mounted:e=>e.mounted,transitionStatus:e=>cr(e)&&!e.mounted?`starting`:e.transitionStatus,floatingRootContext:e=>e.floatingRootContext,triggerCount:e=>e.triggerCount,preventUnmountingOnClose:e=>e.preventUnmountingOnClose,payload:e=>e.payload,activeTriggerId:sr,activeTriggerElement:e=>e.mounted?e.activeTriggerElement:null,popupId:lr,isTriggerActive:(e,t)=>t!==void 0&&sr(e)===t,isOpenedByTrigger:(e,t)=>ur(e,t),isMountedByTrigger:(e,t)=>t!==void 0&&sr(e)===t&&e.mounted,triggerProps:(e,t)=>t?e.activeTriggerProps:e.inactiveTriggerProps,triggerPopupId:(e,t)=>dr(e,t)?lr(e):void 0,popupProps:e=>e.popupProps,popupElement:e=>e.popupElement,positionerElement:e=>e.positionerElement},pr=`ArrowUp`,mr=`ArrowDown`,hr=`ArrowLeft`,gr=`ArrowRight`,_r=`Home`,vr=new Set([pr,mr,hr,gr,_r,`End`]),yr=[`Shift`,`Control`,`Alt`,`Meta`];function br(e){return F(e)&&e.tagName===`INPUT`}function xr(e){return!!(br(e)&&e.selectionStart!=null||F(e)&&e.tagName===`TEXTAREA`)}function Sr(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=Cr(e,t,`left`),a=wr(e),o=wr(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=Cr(e,t,`top`),r=wr(e),i=wr(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 Cr(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 wr(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 Tr(e){return w(19)?e:e?`true`:void 0}var Er=R.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,Y.jsx)(`div`,{ref:t,role:`presentation`,"data-base-ui-inert":``,...r,style:{position:`fixed`,inset:0,userSelect:`none`,WebkitUserSelect:`none`,clipPath:i}})}),Dr={},Or={},kr=``;function Ar(e,t){return I(e)?e:t}function jr(e,t,n){return/hidden|clip/.test(e.getComputedStyle(Ar(t,n)).overflowY)}function Mr(e){if(typeof document>`u`)return!1;let t=z(e);return j(t).innerWidth-t.documentElement.clientWidth>0}function Nr(e){if(!(typeof CSS<`u`&&CSS.supports&&CSS.supports(`scrollbar-gutter`,`stable`))||typeof document>`u`)return!1;let t=z(e),n=t.documentElement,r=t.body,i=Ar(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 Pr(e){let t=z(e),n=t.documentElement,r=t.body,i=Ar(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 Fr(e){let t=z(e),n=t.documentElement,r=t.body,i=j(n),a=0,o=0,c=!1,l=s.create();if(ue&&(i.visualViewport?.scale??1)!==1)return()=>{};function u(){let t=i.getComputedStyle(n),s=i.getComputedStyle(r),l=(t.scrollbarGutter||``).includes(`both-edges`)?`stable both-edges`:`stable`;a=n.scrollTop,o=n.scrollLeft,Dr={scrollbarGutter:n.style.scrollbarGutter,overflowY:n.style.overflowY,overflowX:n.style.overflowX},kr=n.style.scrollBehavior,Or={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`||s.overflowY===`scroll`,p=t.overflowX===`scroll`||s.overflowX===`scroll`,m=Math.max(0,i.innerWidth-r.clientWidth),h=Math.max(0,i.innerHeight-r.clientHeight),g=parseFloat(s.marginTop)+parseFloat(s.marginBottom),_=parseFloat(s.marginLeft)+parseFloat(s.marginRight),ee=Ar(n,r);c=Nr(e),c?(n.style.scrollbarGutter=l,ee.style.overflowY=`hidden`,ee.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 d(){Object.assign(n.style,Dr),Object.assign(r.style,Or),c||(n.scrollTop=a,n.scrollLeft=o,n.removeAttribute(`data-base-ui-scroll-locked`),n.style.scrollBehavior=kr)}function f(){d(),l.request(u)}u();let p=$(i,`resize`,f);return()=>{l.cancel(),d(),typeof i.removeEventListener==`function`&&p()}}var Ir=new class{lockCount=0;restore=null;timeoutLock=i.create();timeoutUnlock=i.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=z(e),n=t.documentElement,r=t.body,i=j(n);if(jr(i,n,r)){let t=new i.MutationObserver(()=>{jr(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=G||!Mr(e);this.restore=a?Pr(e):Fr(e)}};function Lr(e=!0,t=null){M(()=>{if(e)return Ir.acquire(t)},[e,t])}export{wt as $,In as A,he as At,an as B,ce as Bt,On as C,Ae as Ct,zn as D,be as Dt,Rn as E,ve as Et,dn as F,fe as Ft,Yt as G,tn as H,fn as I,J as It,Mt as J,Xt as K,un as L,q as Lt,Tn as M,X as Mt,wn as N,de as Nt,kn as O,_e as Ot,xn as P,Z as Pt,$ as Q,cn as R,ue as Rt,Pn as S,je as St,Ln as T,xe as Tt,Jt as U,nn as V,z as Vt,qt as W,kt as X,jt as Y,Ot as Z,Yn as _,Re as _t,hr as a,it as at,An as b,Me as bt,vr as c,Ye as ct,xr as d,Ge as dt,Tt as et,Sr as f,Ue as ft,Jn as g,Be as gt,rr as h,Fe as ht,mr as i,et as it,Mn as j,ge as jt,Bn as k,me as kt,_r as l,qe as lt,fr as m,ze as mt,Er as n,$e as nt,gr as o,Ze as ot,or as p,He as pt,Pt as q,Tr as r,Qe as rt,pr as s,nt as st,Lr as t,tt,yr as u,Je as ut,Vn as v,Ve as vt,Nn as w,ye as wt,Fn as x,Ne as xt,Dn as y,Pe as yt,ln as z,G as zt};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e}from"./useRouter-Hur3RN7j.js";import{D as t,J as n,O as r,d as i,l as a,q as o,t as s}from"./section-D4djNiAN.js";import{O as c,j as l}from"./overview-BixI1Gdc.js";import{n as u}from"./useNavigate-AT5VkfZa.js";import{t as d}from"./link-C7GfYrMt.js";import{a as f}from"./strings-BeaABxX0.js";import{T as p,jt as m}from"./index-BdDPka5v.js";import{t as h}from"./use-now-vNgLntlV.js";import{r as g}from"./status-badge-CLPsMXtK.js";import{a as _,i as v,n as y,o as b,r as x,t as S}from"./table-hbKjhjeL.js";import{t as C}from"./fill-cell-CjksmixH.js";import{t as w}from"./slots-n0NbUO7Z.js";var T=e(),E={passed:{state:`Succeeded`,label:`Passed`},degraded:{state:`Waiting`,label:`Degraded`},deferred:{state:`Deferred`,label:`Deferred`},failed:{state:`Failed`,label:`Failed`}},D=({worker:e})=>{let{state:t,checkedAt:n}=r(e);return t===`unchecked`?(0,T.jsx)(`span`,{className:`text-muted-foreground`,children:`Not checked`}):(0,T.jsxs)(`span`,{className:`inline-flex flex-wrap items-baseline gap-x-2`,children:[(0,T.jsx)(g,{...E[t]}),n!==null&&(0,T.jsx)(`span`,{className:`font-mono text-xs text-muted-foreground tabular-nums`,children:f(n)})]})},O=({worker:e})=>{let t=h(15e3),r=u(),s={worker:e.name};return(0,T.jsxs)(a,{open:()=>void r({to:`/configuration/workers/$worker`,params:s}),children:[(0,T.jsx)(x,{className:`py-3`,children:(0,T.jsx)(d,{to:`/configuration/workers/$worker`,params:s,onClick:e=>e.stopPropagation(),className:i,children:e.name})}),(0,T.jsx)(x,{children:o[e.kind]}),(0,T.jsx)(x,{className:`hidden font-mono text-xs @2xl:table-cell`,children:n(e)}),(0,T.jsx)(x,{className:`tabular-nums`,children:e.slots===null?(0,T.jsxs)(`span`,{className:`text-muted-foreground`,children:[e.maxConcurrentAttempts,` max`]}):(0,T.jsxs)(`span`,{className:`inline-flex items-center gap-2`,children:[(0,T.jsx)(w,{slots:e.slots}),(0,T.jsxs)(`span`,{className:`max-sm:sr-only`,children:[e.slots.leased,` of `,e.slots.capacity]})]})}),(0,T.jsxs)(C,{className:`whitespace-normal`,children:[(0,T.jsx)(D,{worker:e}),e.provisioning?.blocked===!0&&(0,T.jsxs)(`p`,{className:`text-xs text-destructive tabular-nums`,title:e.provisioning.message,children:[c(e.provisioning),`.`,` `,l(e.provisioning,t)]})]})]})},k=({configuration:e})=>{let n=e.workers.some(({slots:e})=>e!==null);return(0,T.jsxs)(s,{title:`Workers`,createKind:`worker`,counts:t(e.workers.length,`worker`),children:[!n&&(0,T.jsx)(`p`,{className:`text-muted-foreground`,children:`No attempts run until the GitHub App is set up.`}),(0,T.jsx)(`div`,{className:`@container -mx-2`,children:(0,T.jsxs)(S,{children:[(0,T.jsx)(_,{children:(0,T.jsxs)(b,{className:`hover:bg-transparent`,children:[(0,T.jsx)(v,{children:`Worker`}),(0,T.jsx)(v,{children:`Kind`}),(0,T.jsx)(v,{className:`hidden @2xl:table-cell`,children:`Location`}),(0,T.jsx)(v,{children:`Slots in use`}),(0,T.jsx)(v,{children:`Last preflight`})]})}),(0,T.jsx)(y,{children:e.workers.map(e=>(0,T.jsx)(O,{worker:e},e.name))})]})}),e.removedWorkers.length>0&&(0,T.jsx)(`ul`,{className:`flex flex-col gap-1 text-muted-foreground`,children:e.removedWorkers.map(({name:e,running:n})=>(0,T.jsxs)(`li`,{children:[(0,T.jsx)(`span`,{className:`font-mono text-xs text-foreground`,children:e}),` removed by a reload,`,` `,t(n,`attempt`),` still running`]},e))})]})},A=()=>{let{data:e}=m(p());return(0,T.jsx)(k,{configuration:e})};export{A as component};
|
package/dist/web/index.html
CHANGED
|
@@ -5,33 +5,24 @@
|
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<meta name="theme-color" content="#181825" />
|
|
7
7
|
<title>usine</title>
|
|
8
|
-
<script type="module" crossorigin src="/assets/index-
|
|
8
|
+
<script type="module" crossorigin src="/assets/index-BdDPka5v.js"></script>
|
|
9
9
|
<link rel="modulepreload" crossorigin href="/assets/useRouter-Hur3RN7j.js">
|
|
10
|
-
<link rel="modulepreload" crossorigin href="/assets/strings-
|
|
11
|
-
<link rel="modulepreload" crossorigin href="/assets/overview-
|
|
10
|
+
<link rel="modulepreload" crossorigin href="/assets/strings-BeaABxX0.js">
|
|
11
|
+
<link rel="modulepreload" crossorigin href="/assets/overview-BixI1Gdc.js">
|
|
12
12
|
<link rel="modulepreload" crossorigin href="/assets/button-4rhhIcK8.js">
|
|
13
|
-
<link rel="modulepreload" crossorigin href="/assets/page-
|
|
14
|
-
<link rel="modulepreload" crossorigin href="/assets/error-alert-
|
|
15
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
16
|
-
<link rel="modulepreload" crossorigin href="/assets/useSuspenseQuery-DbhQN-t-.js">
|
|
17
|
-
<link rel="modulepreload" crossorigin href="/assets/queries-BZMW2wiD.js">
|
|
18
|
-
<link rel="modulepreload" crossorigin href="/assets/queries-oea_Y4on.js">
|
|
19
|
-
<link rel="modulepreload" crossorigin href="/assets/actions-CG0hkpe7.js">
|
|
13
|
+
<link rel="modulepreload" crossorigin href="/assets/page-BLxt7Xfg.js">
|
|
14
|
+
<link rel="modulepreload" crossorigin href="/assets/error-alert-BVIxPJFU.js">
|
|
15
|
+
<link rel="modulepreload" crossorigin href="/assets/mark-B8EExm_5.js">
|
|
20
16
|
<link rel="modulepreload" crossorigin href="/assets/useNavigate-AT5VkfZa.js">
|
|
21
17
|
<link rel="modulepreload" crossorigin href="/assets/matchContext-D_B3XAQH.js">
|
|
22
18
|
<link rel="modulepreload" crossorigin href="/assets/link-C7GfYrMt.js">
|
|
23
19
|
<link rel="modulepreload" crossorigin href="/assets/with-selector-Dwf291_Q.js">
|
|
24
|
-
<link rel="modulepreload" crossorigin href="/assets/useSelector-CRBsgquS.js">
|
|
25
|
-
<link rel="modulepreload" crossorigin href="/assets/lazyRouteComponent-BnRF0Crs.js">
|
|
26
|
-
<link rel="modulepreload" crossorigin href="/assets/Match-BsHjCE-9.js">
|
|
27
20
|
<link rel="modulepreload" crossorigin href="/assets/empty-B9bymfss.js">
|
|
28
21
|
<link rel="modulepreload" crossorigin href="/assets/boot-screen-Su4MyrBh.js">
|
|
29
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
30
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
31
|
-
<link rel="modulepreload" crossorigin href="/assets/
|
|
32
|
-
<link rel="
|
|
33
|
-
<link rel="modulepreload" crossorigin href="/assets/route-status-DGpeFNCC.js">
|
|
34
|
-
<link rel="stylesheet" crossorigin href="/assets/index-C_S4sA5L.css">
|
|
22
|
+
<link rel="modulepreload" crossorigin href="/assets/useScrollLock-77tiYKUD.js">
|
|
23
|
+
<link rel="modulepreload" crossorigin href="/assets/identity-DlGZ_gKf.js">
|
|
24
|
+
<link rel="modulepreload" crossorigin href="/assets/usePositioner-BeAdUrxb.js">
|
|
25
|
+
<link rel="stylesheet" crossorigin href="/assets/index-B3ZB08sw.css">
|
|
35
26
|
</head>
|
|
36
27
|
<body>
|
|
37
28
|
<div id="root"></div>
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@usine/server",
|
|
3
|
-
"version": "0.4.1-next.
|
|
3
|
+
"version": "0.4.1-next.265.g59d6496",
|
|
4
4
|
"description": "The usine orchestrator as a headless server: a thin CLI over @usine/orchestrator that serves the web UI.",
|
|
5
5
|
"license": "AGPL-3.0-only",
|
|
6
6
|
"repository": {
|
|
@@ -23,19 +23,19 @@
|
|
|
23
23
|
"@effect/platform-node": "4.0.6",
|
|
24
24
|
"@effect/platform-node-shared": "4.0.6",
|
|
25
25
|
"effect": "4.0.6",
|
|
26
|
-
"@usine/
|
|
27
|
-
"@usine/
|
|
28
|
-
"@usine/
|
|
29
|
-
"@usine/
|
|
30
|
-
"@usine/
|
|
31
|
-
"@usine/engine": "0.5.1-next.
|
|
32
|
-
"@usine/orchestrator": "0.4.1-next.
|
|
26
|
+
"@usine/core": "0.5.1-next.265.g59d6496",
|
|
27
|
+
"@usine/config": "0.4.1-next.265.g59d6496",
|
|
28
|
+
"@usine/durable": "0.2.1-next.265.g59d6496",
|
|
29
|
+
"@usine/expression": "0.4.1-next.265.g59d6496",
|
|
30
|
+
"@usine/github": "0.3.1-next.265.g59d6496",
|
|
31
|
+
"@usine/engine": "0.5.1-next.265.g59d6496",
|
|
32
|
+
"@usine/orchestrator": "0.4.1-next.265.g59d6496"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"typescript": "7.0.2",
|
|
36
36
|
"vitest": "5.0.5",
|
|
37
37
|
"yaml": "2.9.1",
|
|
38
|
-
"@usine/executor": "0.4.1-next.
|
|
38
|
+
"@usine/executor": "0.4.1-next.265.g59d6496",
|
|
39
39
|
"@usine/tsconfig": "0.0.0",
|
|
40
40
|
"@usine/web": "0.0.0"
|
|
41
41
|
},
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e,r as t,s as n,t as r}from"./useRouter-Hur3RN7j.js";import{r as i,u as a}from"./matchContext-D_B3XAQH.js";import{t as o}from"./useSelector-CRBsgquS.js";var s=n(e(),1),c=t(),l=class extends s.Component{constructor(...e){super(...e),this.state={error:0},this.reset=()=>{this.setState({error:0})}}static getDerivedStateFromProps(e,t){let n=e.getResetKey();return t.error&&t.resetKey!==n?{resetKey:n,error:0}:{resetKey:n}}static getDerivedStateFromError(e){return{error:[e]}}componentDidCatch(e,t){this.props.onCatch?.(e,t)}render(){let e=this.state.error;return e?s.createElement(this.props.errorComponent??u,{error:e[0],reset:this.reset}):this.props.children}};function u({error:e}){let[t,n]=s.useState(!1);return(0,c.jsxs)(`div`,{style:{padding:`.5rem`,maxWidth:`100%`},children:[(0,c.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:`.5rem`},children:[(0,c.jsx)(`strong`,{style:{fontSize:`1rem`},children:`Something went wrong!`}),(0,c.jsx)(`button`,{style:{appearance:`none`,fontSize:`.6em`,border:`1px solid currentColor`,padding:`.1rem .2rem`,fontWeight:`bold`,borderRadius:`.25rem`},onClick:()=>n(e=>!e),children:t?`Hide Error`:`Show Error`})]}),(0,c.jsx)(`div`,{style:{height:`.25rem`}}),t?(0,c.jsx)(`div`,{children:(0,c.jsx)(`pre`,{style:{fontSize:`.7em`,border:`1px solid red`,borderRadius:`.25rem`,padding:`.3rem`,color:`red`,overflow:`auto`},children:e?.message?(0,c.jsx)(`code`,{children:e.message}):null})}):null]})}var d=()=>!0,f=()=>!1;function p({children:e,fallback:t=null}){return(0,c.jsx)(s.Fragment,{children:m()?e:t})}function m(e=!0){return s.useSyncExternalStore(h,d,e?f:d)}function h(){return()=>{}}function g(e){let t=r(),n=`not-found-${o(t.stores.location,e=>e.pathname)}-${o(t.stores.status)}`;return(0,c.jsx)(l,{getResetKey:()=>n,onCatch:(t,n)=>{if(a(t))e.onCatch?.(t,n);else throw t},errorComponent:({error:t})=>{if(a(t))return e.fallback?.(t);throw t},children:e.children})}function _(){return(0,c.jsx)(`p`,{children:`Not Found`})}function v(e,t,n){return t.options.notFoundComponent?(0,c.jsx)(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?(0,c.jsx)(e.options.defaultNotFoundComponent,{...n}):(0,c.jsx)(_,{})}function y(e,t){let n=t?.options.pendingComponent??e.options.defaultPendingComponent;return n?(0,c.jsx)(n,{}):null}var b=(e,t)=>e[0]===t[0]&&e[1]===t[1],x=(e,t,n)=>!t.isRoot||t.options.shellComponent||t.options.wrapInSuspense||n===!1||n===`data-only`||!e.ssr,S=s.memo(function({routeId:e}){let t=r(),n=t.stores.getMatchStore(e);return C(t,o(n))});function C(e,t){let n=e.routesById[t.routeId],r=y(e,n),o=n.options.errorComponent??e.options.defaultErrorComponent,u=n.options.onCatch??e.options.defaultOnCatch,d=n.isRoot?n.options.notFoundComponent??e.options.notFoundRoute?.options.component:n.options.notFoundComponent,f=t.ssr===!1||t.ssr===`data-only`,m=x(e,n,t.ssr)&&(n.options.wrapInSuspense??r??(n.options.errorComponent?.preload||f)),h=(0,c.jsx)(w,{match:t});f&&(h=(0,c.jsx)(p,{fallback:r,children:h})),d&&(h=(0,c.jsx)(g,{fallback:e=>{if(e.routeId??=t.routeId,e.routeId!==t.routeId)throw e;return s.createElement(d,e)},children:h})),o&&(h=(0,c.jsx)(l,{getResetKey:()=>t,errorComponent:o,onCatch:(e,n)=>{if(a(e))throw e.routeId??=t.routeId,e;u?.(e,n)},children:h})),m&&(h=(0,c.jsx)(s.Suspense,{fallback:r,children:h}));let _=n.isRoot&&n.options.shellComponent;return _?(0,c.jsx)(i.Provider,{value:t.routeId,children:(0,c.jsxs)(_,{children:[h,null]})}):(0,c.jsxs)(i.Provider,{value:t.routeId,children:[h,null]})}var w=s.memo(function({match:e}){let t=r(),n=e.routeId,i=t.routesById[n],a=s.useMemo(()=>{let r=(i.options.remountDeps??t.options.defaultRemountDeps)?.({routeId:n,loaderDeps:e.loaderDeps,params:e._strictParams,search:e._strictSearch});return r?JSON.stringify(r):void 0},[n,e.loaderDeps,e._strictParams,e._strictSearch,i.options.remountDeps,t.options.defaultRemountDeps]),o=s.useMemo(()=>{let e=i.options.component??t.options.defaultComponent;return e?(0,c.jsx)(e,{},a):(0,c.jsx)(T,{})},[a,i.options.component,t.options.defaultComponent]);if(e.status===`pending`){if(t.ssr&&!x(t,i,e.ssr))return o;if(t._tx)throw t._tx[5];return y(t,i)}if(e.status===`notFound`)return v(t,i,e.error);if(e.status===`error`)throw e.error;return o}),T=s.memo(function(){let e=r(),t=s.useContext(i),n,a,l;{let r=e.stores.getMatchStore(t);[n,a]=o(r,e=>[!!e._notFound,e.error],{compare:b}),l=o(e.stores.ids,e=>e[e.indexOf(t)+1])}if(n)return v(e,e.routesById[t],a);if(!l)return null;let u=(0,c.jsx)(S,{routeId:l});return t===`__root__`?(0,c.jsx)(s.Suspense,{fallback:y(e),children:u}):u});export{l as i,T as n,y as r,S as t};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./useRouter-Hur3RN7j.js";import{t}from"./useSuspenseQuery-DbhQN-t-.js";import{n}from"./queries-BZMW2wiD.js";import{u as r}from"./index-Dki55xSv.js";import{t as i}from"./agents-D3eAK_60.js";var a=e(),o=()=>{let{agent:e}=r.useParams(),{data:o}=t(n());return(0,a.jsx)(i,{name:e,configuration:o})};export{o as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./useRouter-Hur3RN7j.js";import{K as t,t as n}from"./section-eyIYzZrG.js";import{l as r}from"./index-Dki55xSv.js";var i=e(),a=()=>{let{label:e}=r.useParams();return(0,i.jsx)(n,{title:e,entity:t(`label`,e),children:null})};export{a as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./useRouter-Hur3RN7j.js";import{C as t,K as n,a as r,c as i,g as a,i as o,n as s,o as c,r as l,s as u,t as d,u as f,w as p}from"./section-eyIYzZrG.js";import{t as m}from"./error-alert-hABzwCSY.js";import{t as h}from"./useSuspenseQuery-DbhQN-t-.js";import{t as g}from"./link-C7GfYrMt.js";import{n as _,r as v}from"./list-NcxSR9Ja.js";import{Dt as y,n as b}from"./strings-DXB6PB2g.js";import{n as x}from"./queries-BZMW2wiD.js";import{c as S,nt as C,p as w,tt as T}from"./index-Dki55xSv.js";import{t as E}from"./markdown-BNebzGGH.js";import{t as D}from"./file-error-B5tv6DhJ.js";var O=e(),k=({repository:e})=>{let{owner:t,name:n}=y(e);return(0,O.jsxs)(g,{to:`/configuration/repositories/$owner/$name`,params:{owner:t,name:n},className:`flex w-fit items-center gap-2 text-primary hover:underline`,children:[(0,O.jsx)(T,{repository:e}),e]})},A=({loop:e,configuration:n})=>{let i=n.agents.find(({name:t})=>t===e.agent);return(0,O.jsxs)(r,{children:[(0,O.jsxs)(o,{label:`Agent`,children:[(0,O.jsx)(g,{to:`/configuration/agents/$agent`,params:{agent:e.agent},className:`text-primary hover:underline`,children:e.agent}),i!==void 0&&(0,O.jsx)(`p`,{className:`mt-0.5 font-mono text-xs text-muted-foreground`,children:b(i)})]}),(0,O.jsx)(o,{label:`Repositories`,children:e.repositories.length===0?(0,O.jsx)(f,{children:`No registered repository matches the selector`}):(0,O.jsx)(`ul`,{className:`flex flex-col gap-0.5`,children:e.repositories.map(e=>(0,O.jsx)(`li`,{children:(0,O.jsx)(k,{repository:e})},e))})}),(0,O.jsx)(o,{label:`Approval`,children:a[e.approval]}),(0,O.jsxs)(o,{label:`Max cycles`,children:[(0,O.jsx)(`span`,{className:`tabular-nums`,children:e.maxCycles}),` `,(0,O.jsx)(f,{children:`runs per item before a reset`})]}),(0,O.jsx)(o,{label:`Permissions`,children:t[e.permissions]}),(0,O.jsx)(o,{label:`Priority`,children:e.priority===null?(0,O.jsx)(f,{children:`None; runs wait in lane order`}):(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`span`,{className:`tabular-nums`,children:e.priority}),` `,(0,O.jsx)(f,{children:`queued ahead of runs in lane order`})]})}),(0,O.jsx)(o,{label:`Step`,children:(0,O.jsx)(`code`,{className:`font-mono text-xs`,children:e.step})})]})},j=/\{\{([\s\S]*?)\}\}/gu,M=e=>[...e.matchAll(j)].map(([,e=``])=>e.trim()),N=e=>{let t=e.value??``,n=[],r=0;for(let e of t.matchAll(j))e.index>r&&n.push({type:`text`,value:t.slice(r,e.index)}),n.push({type:`inlineCode`,value:(e[1]??``).trim(),data:{hName:`mark`}}),r=e.index+e[0].length;return n.length===0?[e]:(r<t.length&&n.push({type:`text`,value:t.slice(r)}),n)},P=e=>{e.children!==void 0&&(e.children=e.children.flatMap(e=>e.type===`text`?N(e):(P(e),[e])))},F=()=>P,I=({children:e})=>(0,O.jsx)(`mark`,{className:`bg-transparent p-0 text-inherit`,title:`Filled in from the item when a run opens`,children:(0,O.jsxs)(`code`,{className:`bg-transparent [font-variant-ligatures:none] ring-1 ring-input ring-inset [box-decoration-break:clone]`,children:[(0,O.jsx)(`span`,{className:`text-muted-foreground`,children:`{{\xA0`}),e,(0,O.jsx)(`span`,{className:`text-muted-foreground`,children:`\xA0}}`})]})}),L=({template:e})=>(0,O.jsx)(E,{className:`max-w-[72ch] text-md`,remarkPlugins:[F],components:{mark:I},children:e}),R=e=>[[`on`,e.stream],[`if`,e.condition],...e.cron===null?[]:[[`cron`,e.cron]],...e.timeZone===null?[]:[[`tz`,e.timeZone]]],z=({repos:e,tags:t})=>[...e===null?[]:[[`repos`,e.join(`, `)]],...t===null?[]:[[`tags`,t.join(`, `)]]],B=({loop:e,configuration:t,pause:n})=>{let r=M(e.prompt).length;return(0,O.jsxs)(O.Fragment,{children:[n?.isError===!0&&(0,O.jsx)(m,{message:n.error.message}),(0,O.jsxs)(s,{facts:(0,O.jsx)(A,{loop:e,configuration:t}),children:[(0,O.jsxs)(l,{title:`Trigger`,children:[(0,O.jsx)(c,{entries:R(e)}),e.undeclaredLabels.length>0&&(0,O.jsxs)(`p`,{className:`flex items-start gap-1.5 text-xs text-muted-foreground`,children:[(0,O.jsx)(C,{weight:`fill`,className:`mt-0.5 size-3 shrink-0 text-warning`}),(0,O.jsxs)(`span`,{children:[`Condition uses`,` `,e.undeclaredLabels.length===1?`an undeclared label`:`undeclared labels`,`:`,` `,e.undeclaredLabels.join(`, `),`. usine creates only the labels under`,` `,(0,O.jsx)(`code`,{children:`labels`}),` in `,(0,O.jsx)(`code`,{children:`usine.yaml`}),`.`]})]})]}),(0,O.jsx)(l,{title:`Selector`,children:e.selector===null?(0,O.jsx)(`p`,{className:`text-muted-foreground`,children:`No selector: every registered repository`}):(0,O.jsx)(c,{entries:z(e.selector)})}),(0,O.jsx)(l,{title:`Prompt`,aside:r===0?`Same text for every run`:`${p(r,`outlined expression`)} filled in from each item`,children:(0,O.jsx)(L,{template:e.prompt})})]})]})},V=({name:e,configuration:t,pause:r})=>{let a=t.loops.find(t=>t.name===e);if(a!==void 0)return(0,O.jsx)(d,{entity:n(`loop`,e),title:a.name,marks:(0,O.jsx)(v,{paused:a.paused}),file:a.file,actions:r!==null&&(0,O.jsx)(_,{loop:a,pause:r,variant:`outline`}),children:(0,O.jsx)(B,{loop:a,configuration:t,pause:r})});let o=t.quarantinedLoops.find(t=>t.name===e);return o===void 0?(0,O.jsx)(d,{entity:n(`loop`,e),title:e,children:(0,O.jsxs)(u,{title:`Loop not found`,children:[`The configuration has no file `,(0,O.jsxs)(`code`,{children:[`loops/`,e,`.md`]}),`.`,` `,(0,O.jsx)(g,{to:`/configuration/loops`,className:`text-primary hover:underline`,children:`See all loops`}),`.`]})}):(0,O.jsx)(d,{entity:n(`loop`,e),title:o.name,marks:(0,O.jsx)(i,{}),file:o.file,children:(0,O.jsx)(D,{error:o.error,consequence:`No runs until the file loads.`})})},H=()=>{let{loop:e}=S.useParams(),{data:t}=h(x());return(0,O.jsx)(V,{name:e,configuration:t,pause:w()})};export{H as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./useRouter-Hur3RN7j.js";import{n as t}from"./Match-BsHjCE-9.js";var n=e(),r=()=>(0,n.jsx)(t,{});export{r as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./route-status-DGpeFNCC.js";var t=e;export{t as errorComponent};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as e}from"./useRouter-Hur3RN7j.js";import{K as t,a as n,i as r,n as i,r as a,s as o,t as s,u as c}from"./section-eyIYzZrG.js";import{t as l}from"./useSuspenseQuery-DbhQN-t-.js";import{r as u}from"./overview-C73v5kbv.js";import{t as d}from"./link-C7GfYrMt.js";import{n as f}from"./queries-BZMW2wiD.js";import{o as p,tt as m}from"./index-Dki55xSv.js";import{a as h,i as g,n as _,o as v,r as y,t as b}from"./table-hbKjhjeL.js";import{t as x}from"./fill-cell-CjksmixH.js";import{n as S,t as C}from"./label-badge-JdNthOHh.js";import{t as w}from"./repositories-D4wYJfa_.js";var T=e(),E=({label:e})=>e.failure===null?e.onGitHub===!1?(0,T.jsxs)(`span`,{className:`text-destructive`,children:[`Missing on GitHub`,e.declared?`, created at the next poll`:``]}):null:(0,T.jsx)(`span`,{className:`text-destructive`,children:e.failure.message}),D=({source:e})=>e._tag===`Label`?(0,T.jsxs)(`span`,{className:`inline-flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,T.jsx)(C,{name:e.label.name,label:e.label}),(0,T.jsx)(`span`,{className:`text-xs`,children:(0,T.jsx)(E,{label:e.label})})]}):(0,T.jsx)(S,{variant:`outline`,className:`text-muted-foreground`,children:e.state}),O=({repository:e})=>(0,T.jsx)(`div`,{className:`-mx-2`,children:(0,T.jsxs)(b,{children:[(0,T.jsx)(h,{children:(0,T.jsxs)(v,{className:`hover:bg-transparent`,children:[(0,T.jsx)(g,{className:`text-right`,children:`#`}),(0,T.jsx)(g,{children:`Lane`}),(0,T.jsx)(g,{children:`Items with`})]})}),(0,T.jsx)(_,{children:e.lanes.map((e,t)=>(0,T.jsxs)(v,{className:`hover:bg-transparent`,children:[(0,T.jsx)(y,{className:`py-3 text-right align-top font-mono text-xs text-muted-foreground tabular-nums`,children:t+1}),(0,T.jsx)(y,{className:`py-3 align-top font-medium`,children:e.name}),(0,T.jsx)(x,{className:`py-3 whitespace-normal`,children:(0,T.jsx)(`ul`,{className:`flex flex-wrap items-center gap-x-3 gap-y-1.5`,children:e.sources.map(e=>(0,T.jsx)(`li`,{children:(0,T.jsx)(D,{source:e})},e._tag===`Label`?e.label.name:e.state))})})]},e.name))})]})}),k=({repository:e})=>(0,T.jsxs)(n,{children:[(0,T.jsx)(r,{label:`Board`,children:(0,T.jsx)(d,{to:`/projects/$owner/$name`,params:u(e.name),className:`text-primary hover:underline`,children:`Open the board`})}),(0,T.jsx)(r,{label:`Tags`,children:e.tags.length===0?(0,T.jsx)(c,{children:`None`}):e.tags.join(`, `)}),(0,T.jsx)(r,{label:`Loops`,children:e.loops.length===0?(0,T.jsx)(c,{children:`Not selected by any loop`}):(0,T.jsx)(`ul`,{className:`flex flex-col gap-0.5`,children:e.loops.map(e=>(0,T.jsx)(`li`,{children:(0,T.jsx)(d,{to:`/configuration/loops/$loop`,params:{loop:e},className:`text-primary hover:underline`,children:e})},e))})})]}),A=({owner:e,name:n,configuration:r})=>{let l=`${e}/${n}`,u=r.repositories.find(e=>e.name.toLowerCase()===l.toLowerCase());return u===void 0?(0,T.jsx)(s,{entity:t(`repository`,l),title:l,children:(0,T.jsxs)(o,{title:`Repository not registered`,children:[l,` is not under `,(0,T.jsx)(`code`,{children:`repos`}),` in `,(0,T.jsx)(`code`,{children:`usine.yaml`}),`.`,` `,(0,T.jsx)(d,{to:`/configuration/repositories`,className:`text-primary hover:underline`,children:`See all repositories`}),`.`]})}):(0,T.jsx)(s,{entity:t(`repository`,u.name),title:u.name,leading:(0,T.jsx)(m,{repository:u.name,size:`title`}),children:(0,T.jsxs)(i,{facts:(0,T.jsx)(k,{repository:u}),children:[(0,T.jsxs)(a,{title:`Lanes`,aside:u.lanes.length===0?void 0:`In board order, as listed in repos[].lanes`,children:[[...u.declaredLabels,...w(u)].some(({onGitHub:e})=>e===null)&&(0,T.jsx)(`p`,{className:`text-muted-foreground`,children:`Labels not polled yet. Whether each label is on GitHub shows after the first poll.`}),u.lanes.length===0?(0,T.jsxs)(`p`,{className:`max-w-[72ch] text-muted-foreground`,children:[(0,T.jsx)(`code`,{children:`usine.yaml`}),` has no lanes for this repository. The board shows lanes proposed from the repository labels, and cards cannot be moved. To move cards, add lanes under `,(0,T.jsx)(`code`,{children:`repos[].lanes`}),`.`]}):(0,T.jsx)(O,{repository:u})]}),(0,T.jsx)(a,{title:`Labels usine creates`,aside:`From labels in usine.yaml`,children:u.declaredLabels.length===0?(0,T.jsxs)(`p`,{className:`text-muted-foreground`,children:[`No labels under `,(0,T.jsx)(`code`,{children:`labels`}),` in `,(0,T.jsx)(`code`,{children:`usine.yaml`}),`.`]}):(0,T.jsx)(`ul`,{className:`flex flex-col gap-2`,children:u.declaredLabels.map(e=>(0,T.jsxs)(`li`,{className:`flex flex-wrap items-center gap-x-2 gap-y-1`,children:[(0,T.jsx)(C,{name:e.name,label:e}),(0,T.jsx)(`span`,{className:`text-xs`,children:e.onGitHub===!0&&e.failure===null?(0,T.jsx)(c,{children:`On GitHub`}):(0,T.jsx)(E,{label:e})})]},e.name))})})]})})},j=()=>{let{owner:e,name:t}=p.useParams(),{data:n}=l(f());return(0,T.jsx)(A,{owner:e,name:t,configuration:n})};export{j as component};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{i as e,r as t,s as n}from"./useRouter-Hur3RN7j.js";import{a as r,i}from"./page-C47YAWAl.js";import{t as a}from"./error-alert-hABzwCSY.js";import{t as o}from"./useSuspenseQuery-DbhQN-t-.js";import{C as s,b as c,g as l,n as u,r as d,x as f,y as p}from"./overview-C73v5kbv.js";import{a as m,i as h,n as g,s as _}from"./actions-CG0hkpe7.js";import{t as v}from"./link-C7GfYrMt.js";import{a as y,i as b,n as x,o as S,r as C,s as ee,t as te}from"./moves-DS1ecXd6.js";import{a as ne,c as w,d as re,i as T,l as E,n as ie,o as ae,r as oe,s as D,t as se,u as ce}from"./dropdown-menu-BHKHYfLs.js";import{D as O,W as k,t as A}from"./button-4rhhIcK8.js";import{ct as le,f as j,s as M}from"./strings-DXB6PB2g.js";import{r as ue,t as N}from"./mark-uyeJ8aPC.js";import{t as de}from"./use-open-run-B8nD_BT1.js";import{C as fe,S as pe,T as me,a as he,b as ge,tt as _e,v as ve,w as ye,x as P,y as be}from"./index-Dki55xSv.js";import{t as F}from"./use-now-vNgLntlV.js";import{n as I,r as xe,t as Se}from"./status-badge-CLPsMXtK.js";import{a as Ce,i as L,n as we,o as R,r as z,t as Te}from"./table-hbKjhjeL.js";import{a as Ee,c as De,d as B,f as Oe,g as ke,h as Ae,i as je,l as Me,m as V,o as Ne,p as Pe,r as Fe,s as Ie,t as Le}from"./sortable.esm-Lp8AM6j2.js";import{n as H,t as U}from"./label-badge-JdNthOHh.js";import{t as Re}from"./action-DQzkdVHs.js";import{f as ze,o as Be,u as Ve}from"./model-87X7P9Uh.js";import{n as He,t as Ue}from"./strings-Bexnszes.js";import{t as We}from"./project-not-found-CutZoVCI.js";var W=n(e(),1),Ge=new Map([[`bold`,W.createElement(W.Fragment,null,W.createElement(`path`,{d:`M204,64V168a12,12,0,0,1-24,0V93L72.49,200.49a12,12,0,0,1-17-17L163,76H88a12,12,0,0,1,0-24H192A12,12,0,0,1,204,64Z`}))],[`duotone`,W.createElement(W.Fragment,null,W.createElement(`path`,{d:`M192,64V168L88,64Z`,opacity:`0.2`}),W.createElement(`path`,{d:`M192,56H88a8,8,0,0,0-5.66,13.66L128.69,116,58.34,186.34a8,8,0,0,0,11.32,11.32L140,127.31l46.34,46.35A8,8,0,0,0,200,168V64A8,8,0,0,0,192,56Zm-8,92.69-38.34-38.34h0L107.31,72H184Z`}))],[`fill`,W.createElement(W.Fragment,null,W.createElement(`path`,{d:`M200,64V168a8,8,0,0,1-13.66,5.66L140,127.31,69.66,197.66a8,8,0,0,1-11.32-11.32L128.69,116,82.34,69.66A8,8,0,0,1,88,56H192A8,8,0,0,1,200,64Z`}))],[`light`,W.createElement(W.Fragment,null,W.createElement(`path`,{d:`M198,64V168a6,6,0,0,1-12,0V78.48L68.24,196.24a6,6,0,0,1-8.48-8.48L177.52,70H88a6,6,0,0,1,0-12H192A6,6,0,0,1,198,64Z`}))],[`regular`,W.createElement(W.Fragment,null,W.createElement(`path`,{d:`M200,64V168a8,8,0,0,1-16,0V83.31L69.66,197.66a8,8,0,0,1-11.32-11.32L172.69,72H88a8,8,0,0,1,0-16H192A8,8,0,0,1,200,64Z`}))],[`thin`,W.createElement(W.Fragment,null,W.createElement(`path`,{d:`M196,64V168a4,4,0,0,1-8,0V73.66L66.83,194.83a4,4,0,0,1-5.66-5.66L182.34,68H88a4,4,0,0,1,0-8H192A4,4,0,0,1,196,64Z`}))]]),Ke=new Map([[`bold`,W.createElement(W.Fragment,null,W.createElement(`path`,{d:`M140,40V216a12,12,0,0,1-24,0V40a12,12,0,0,1,24,0ZM64.49,87.51a12,12,0,0,0-17,17L59,116H16a12,12,0,0,0,0,24H59L47.51,151.51a12,12,0,0,0,17,17l32-32a12,12,0,0,0,0-17ZM240,116H197l11.52-11.51a12,12,0,0,0-17-17l-32,32a12,12,0,0,0,0,17l32,32a12,12,0,0,0,17-17L197,140h43a12,12,0,0,0,0-24Z`}))],[`duotone`,W.createElement(W.Fragment,null,W.createElement(`path`,{d:`M240,56V200a16,16,0,0,1-16,16H32a16,16,0,0,1-16-16V56A16,16,0,0,1,32,40H224A16,16,0,0,1,240,56Z`,opacity:`0.2`}),W.createElement(`path`,{d:`M136,40V216a8,8,0,0,1-16,0V40a8,8,0,0,1,16,0ZM69.66,90.34a8,8,0,0,0-11.32,11.32L76.69,120H16a8,8,0,0,0,0,16H76.69L58.34,154.34a8,8,0,0,0,11.32,11.32l32-32a8,8,0,0,0,0-11.32ZM240,120H179.31l18.35-18.34a8,8,0,0,0-11.32-11.32l-32,32a8,8,0,0,0,0,11.32l32,32a8,8,0,0,0,11.32-11.32L179.31,136H240a8,8,0,0,0,0-16Z`}))],[`fill`,W.createElement(W.Fragment,null,W.createElement(`path`,{d:`M101.66,122.34a8,8,0,0,1,0,11.32l-32,32A8,8,0,0,1,56,160V136H16a8,8,0,0,1,0-16H56V96a8,8,0,0,1,13.66-5.66ZM240,120H200V96a8,8,0,0,0-13.66-5.66l-32,32a8,8,0,0,0,0,11.32l32,32A8,8,0,0,0,200,160V136h40a8,8,0,0,0,0-16ZM128,32a8,8,0,0,0-8,8V216a8,8,0,0,0,16,0V40A8,8,0,0,0,128,32Z`}))],[`light`,W.createElement(W.Fragment,null,W.createElement(`path`,{d:`M134,40V216a6,6,0,0,1-12,0V40a6,6,0,0,1,12,0ZM68.24,91.76a6,6,0,0,0-8.48,8.48L81.51,122H16a6,6,0,0,0,0,12H81.51L59.76,155.76a6,6,0,1,0,8.48,8.48l32-32a6,6,0,0,0,0-8.48ZM240,122H174.49l21.75-21.76a6,6,0,0,0-8.48-8.48l-32,32a6,6,0,0,0,0,8.48l32,32a6,6,0,0,0,8.48-8.48L174.49,134H240a6,6,0,0,0,0-12Z`}))],[`regular`,W.createElement(W.Fragment,null,W.createElement(`path`,{d:`M136,40V216a8,8,0,0,1-16,0V40a8,8,0,0,1,16,0ZM69.66,90.34a8,8,0,0,0-11.32,11.32L76.69,120H16a8,8,0,0,0,0,16H76.69L58.34,154.34a8,8,0,0,0,11.32,11.32l32-32a8,8,0,0,0,0-11.32ZM240,120H179.31l18.35-18.34a8,8,0,0,0-11.32-11.32l-32,32a8,8,0,0,0,0,11.32l32,32a8,8,0,0,0,11.32-11.32L179.31,136H240a8,8,0,0,0,0-16Z`}))],[`thin`,W.createElement(W.Fragment,null,W.createElement(`path`,{d:`M132,40V216a4,4,0,0,1-8,0V40a4,4,0,0,1,8,0ZM66.83,93.17a4,4,0,0,0-5.66,5.66L86.34,124H16a4,4,0,0,0,0,8H86.34L61.17,157.17a4,4,0,0,0,5.66,5.66l32-32a4,4,0,0,0,0-5.66ZM240,124H169.66l25.17-25.17a4,4,0,1,0-5.66-5.66l-32,32a4,4,0,0,0,0,5.66l32,32a4,4,0,0,0,5.66-5.66L169.66,132H240a4,4,0,0,0,0-8Z`}))]]),G=W.forwardRef((e,t)=>W.createElement(k,{ref:t,...e,weights:Ge}));G.displayName=`ArrowUpRightIcon`;var K=W.forwardRef((e,t)=>W.createElement(k,{ref:t,...e,weights:Ke}));K.displayName=`ArrowsInLineHorizontalIcon`;var qe={above:!1,below:!1},Je=()=>{let[e,t]=(0,W.useState)(qe),n=(0,W.useRef)(null);return[(0,W.useCallback)(e=>{if(n.current?.(),n.current=null,e===null)return;let r=()=>{let n=e.scrollTop>1,r=e.scrollHeight-e.clientHeight-e.scrollTop>1;t(e=>e.above===n&&e.below===r?e:{above:n,below:r})},i=new ResizeObserver(r),a=()=>{i.observe(e);for(let t of e.children)i.observe(t)},o=new MutationObserver(()=>{i.disconnect(),a(),r()});a(),o.observe(e,{childList:!0}),e.addEventListener(`scroll`,r,{passive:!0}),r(),n.current=()=>{e.removeEventListener(`scroll`,r),o.disconnect(),i.disconnect()}},[]),e]},q=t();function J({className:e,size:t=`default`,...n}){return(0,q.jsx)(`div`,{"data-slot":`card`,"data-size":t,className:O(`group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-lg bg-card py-(--card-spacing) text-sm text-card-foreground ring-1 ring-border [--card-spacing:--spacing(4)] has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(3)] *:[img:first-child]:rounded-t-lg *:[img:last-child]:rounded-b-lg`,e),...n})}function Ye({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`card-header`,className:O(`group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-t-lg px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)`,e),...t})}function Xe({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`card-title`,className:O(`text-lg font-semibold`,e),...t})}function Ze({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`card-description`,className:O(`text-sm text-muted-foreground`,e),...t})}function Qe({className:e,...t}){return(0,q.jsx)(`div`,{"data-slot":`card-content`,className:O(`px-(--card-spacing)`,e),...t})}var $e=(e,t)=>e===`Running`?`Running since ${j(t)}`:e===`Failed`?`Failed at ${j(t)}`:l(t),Y=3,et=({labels:e,catalog:t})=>{if(e.length===0)return null;let n=e.slice(Y);return(0,q.jsxs)(`div`,{className:`flex flex-wrap gap-1`,children:[e.slice(0,Y).map(e=>(0,q.jsx)(U,{name:e,label:t.get(e)},e)),n.length>0&&(0,q.jsxs)(H,{variant:`outline`,className:`text-muted-foreground tabular-nums`,title:n.join(`, `),"aria-label":`${n.length} more: ${n.join(`, `)}`,children:[`+`,n.length]})]})},tt=`block w-full cursor-pointer text-left outline-none after:absolute after:inset-0 after:rounded-lg`,nt=({item:e,repository:t})=>(0,q.jsx)(`h3`,{className:`text-sm/snug font-medium text-card-foreground`,title:e.title,children:(0,q.jsx)(v,{to:`/projects/$owner/$name/tasks/$number`,params:{...d(t),number:Ve(e)},draggable:!1,className:tt,children:(0,q.jsx)(`span`,{className:`line-clamp-2`,children:e.title})})}),rt=({failure:e,children:t})=>(0,q.jsxs)(`div`,{className:`flex flex-col items-start gap-1.5 rounded-md bg-destructive/8 px-2 py-1.5 text-xs text-destructive`,children:[(0,q.jsx)(`p`,{className:`line-clamp-2 wrap-anywhere`,title:e.message,children:e.message}),t]}),it=({failure:e,action:t})=>t!==null&&e.run.canRetry&&!t.isPending?(0,q.jsx)(A,{variant:`outline`,size:`xs`,className:`relative z-10`,title:p(e.run.agentBrain),onClick:()=>t.mutate({runId:e.run.id,request:{action:`retry`}}),children:c.retry}):null,at=({run:e})=>{let t=F(3e4),n=y(e);return(0,q.jsxs)(`p`,{className:`flex min-w-0 items-center gap-1.5 text-xs whitespace-nowrap text-muted-foreground`,children:[(0,q.jsx)(I,{state:e.state,className:`mr-0.5`}),(0,q.jsx)(`span`,{className:`truncate text-foreground`,children:e.loop}),(0,q.jsx)(`span`,{className:`shrink-0`,children:e.state}),n!==null&&(0,q.jsx)(`time`,{className:`shrink-0 font-mono tabular-nums`,dateTime:n,title:$e(e.state,n),children:M(n,t)}),(0,q.jsx)(`span`,{className:`ml-auto truncate pl-2`,children:e.agent})]})},ot=({stalled:e,named:t,children:n})=>{let r=F(3e4),i=He(e,r);return(0,q.jsxs)(`div`,{"data-slot":`stall-note`,className:`flex flex-col items-start gap-1.5 text-xs`,children:[(0,q.jsxs)(`p`,{className:`line-clamp-3 text-muted-foreground`,title:`${e.loop}: ${i}`,children:[t&&(0,q.jsxs)(`span`,{className:`font-medium text-foreground`,children:[e.loop,` `]}),i]}),n]})},st=e=>[`run-again`,`board-card`,e],ct=(e,t)=>{let n=st(e),r=m({mutationKey:n,onClaimed:t}),i=_({filters:{mutationKey:n,exact:!0},select:({state:e})=>e}).at(-1);return{isPending:i?.status===`pending`,data:i?.data,error:i?.error??null,send:e=>r.mutate(g(e))}},X=({item:e,lane:t,catalog:n,repository:r,stall:i,readOnly:a,action:o,again:s,progress:c})=>{let l=S(e),u=b(e),d=o?.error?.message??null,f=s?.error?.message??null,p=i!==null&&l!==null&&(i.reason._tag===`RunFailed`||i.reason._tag===`SuppressedForOperator`)&&i.reason.run.id===l.run.id,m=i===null||o===null?null:(0,q.jsx)(Re,{stalled:i,readOnly:a,appearance:`card`}),h=e.needsYou&&!(u?.canApprove||u?.canResolveFailure)&&i===null;return(0,q.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1.5 px-3`,children:[(0,q.jsx)(`p`,{className:`flex flex-wrap items-baseline gap-x-2.5 pr-6`,children:e.items.map(e=>(0,q.jsx)(N,{item:e,className:`relative z-10`},e.itemKey))}),(0,q.jsx)(nt,{item:e,repository:r}),(0,q.jsx)(et,{labels:C(e,t),catalog:n}),u!==null&&(0,q.jsx)(at,{run:u}),c!==null&&(0,q.jsx)(`p`,{role:`status`,className:`text-xs text-muted-foreground`,children:c}),l!==null&&(0,q.jsx)(rt,{failure:l,children:p&&i?.reason._tag===`SuppressedForOperator`?m:(0,q.jsx)(it,{failure:l,action:o})}),i!==null&&!p&&(0,q.jsx)(ot,{stalled:i,named:(u===null||Be(i)?.id!==u.id)&&!Ue(i),children:m}),s?.data?._tag===`CycleBlocked`&&(0,q.jsx)(`p`,{role:`status`,className:`text-xs text-needs-you`,children:`No run opened: cycle budget used up. Reset it in Needs attention`}),d!==null&&(0,q.jsx)(`p`,{className:`text-xs text-destructive wrap-anywhere`,children:d}),f!==null&&(0,q.jsx)(`p`,{className:`text-xs text-destructive wrap-anywhere`,children:f}),e.conflicting&&(0,q.jsx)(`p`,{className:`text-xs text-destructive`,children:`Conflicts with base`}),h&&(0,q.jsx)(`p`,{className:`text-xs text-needs-you`,children:`Needs attention`})]})},lt=({runs:e,openRun:t})=>(0,q.jsxs)(D,{children:[(0,q.jsx)(E,{children:`Run history`}),(0,q.jsx)(w,{className:`min-w-48`,children:[...e].reverse().map(e=>(0,q.jsxs)(T,{onClick:()=>t(e.id),children:[(0,q.jsx)(`span`,{className:`truncate`,children:e.loop}),(0,q.jsxs)(`span`,{className:`ml-auto flex shrink-0 items-center gap-2 pl-4 text-xs text-muted-foreground`,children:[(0,q.jsxs)(`span`,{className:`flex items-center gap-1.5`,children:[(0,q.jsx)(I,{state:e.state}),e.state]}),(0,q.jsx)(`time`,{dateTime:e.openedAt,title:l(e.openedAt),className:`font-mono tabular-nums`,children:M(e.openedAt)})]})]},e.id))})]}),ut=({item:e,run:t,moves:n,openRun:r,action:i,again:a,className:o})=>{let[s,l]=(0,W.useState)(!1),u=ue(e),d=e.runs.filter(({id:e})=>e!==t?.id),f=e.run?.canRunAgain===!0?e.run:null,m=[{key:`links`,content:e.items.map(e=>(0,q.jsxs)(ne,{href:e.url,target:`_blank`,rel:`noreferrer`,closeOnClick:!0,children:[`Open `,(0,q.jsx)(N,{item:e,linked:!1}),` on GitHub`,(0,q.jsx)(ee,{className:`ml-auto text-muted-foreground`,"aria-hidden":`true`})]},e.itemKey))}];(t!==null||d.length>0)&&m.push({key:`runs`,content:(0,q.jsxs)(q.Fragment,{children:[t!==null&&(0,q.jsx)(T,{onClick:()=>r(t.id),children:`Open run`}),d.length>0&&(0,q.jsx)(lt,{runs:d,openRun:r})]})});let h=i.isPending||a.isPending,g=f!==null||t!==null&&(t.canApprove||t.canRetry||t.canCancel);return!h&&g&&m.push({key:`actions`,content:(0,q.jsxs)(q.Fragment,{children:[t?.canApprove&&(0,q.jsx)(T,{onClick:()=>i.mutate({runId:t.id,request:{action:`approve`}}),children:c.approve}),t?.canRetry&&(0,q.jsx)(T,{title:p(t.agentBrain),onClick:()=>i.mutate({runId:t.id,request:{action:`retry`}}),children:c.retry}),f!==null&&(0,q.jsxs)(T,{onClick:()=>a.send(f),children:[c.runAgain,(0,q.jsx)(`span`,{className:`ml-auto truncate pl-4 text-xs text-muted-foreground`,children:f.loop})]}),t?.canCancel&&(0,q.jsx)(T,{variant:`destructive`,onClick:()=>l(!0),children:c.cancel})]})}),!n.disabled&&n.targets.length>0&&m.push({key:`move`,content:(0,q.jsxs)(D,{children:[(0,q.jsx)(E,{children:`Move to`}),(0,q.jsx)(w,{className:`min-w-40`,children:n.targets.map(t=>(0,q.jsx)(T,{onClick:()=>n.onMove(e,t),children:t.name},t.id))})]})}),(0,q.jsxs)(q.Fragment,{children:[(0,q.jsxs)(se,{children:[(0,q.jsx)(ce,{render:(0,q.jsx)(A,{variant:`ghost`,size:`icon-sm`,className:O(`text-muted-foreground hover:text-foreground aria-expanded:text-foreground`,o)}),"aria-label":`Actions for ${u}`,children:(0,q.jsx)(re,{weight:`bold`,className:`size-4`,"aria-hidden":`true`})}),(0,q.jsx)(ie,{align:`end`,className:`w-auto min-w-48`,children:m.map(({key:e,content:t},n)=>(0,q.jsxs)(W.Fragment,{children:[n>0&&(0,q.jsx)(ae,{}),(0,q.jsx)(oe,{children:t})]},e))})]}),t!==null&&(0,q.jsx)(ve,{open:s,onOpenChange:l,children:(0,q.jsxs)(P,{children:[(0,q.jsxs)(ye,{children:[(0,q.jsxs)(me,{children:[`Cancel `,t.loop,`?`]}),(0,q.jsxs)(pe,{children:[`The run on `,u,` stops, including any attempt in progress.`]})]}),(0,q.jsxs)(fe,{children:[(0,q.jsx)(ge,{children:c.keepRunning}),(0,q.jsx)(be,{variant:`destructive`,onClick:()=>{l(!1),i.mutate({runId:t.id,request:{action:`cancel`}})},children:c.confirmCancel})]})]})})]})},Z=e=>O(`relative gap-0 py-2.5 transition-[box-shadow] hover:ring-foreground/15 has-[:focus-visible]:ring-2 has-[:focus-visible]:ring-ring/70`,e&&`ring-needs-you/45 hover:ring-needs-you/65`),dt=(e,t,n)=>e.isPending&&e.variables!==void 0?f[e.variables.request.action]:t.isPending?s:n===void 0?null:x(n),ft=({item:e,lane:t,catalog:n,draggable:r,phase:i,moves:a,stall:o,readOnly:s,openRun:c,repository:l})=>{let u=h(),d=ct(e.itemKey,c),{attributes:f,listeners:p,setNodeRef:m,setActivatorNodeRef:g,transform:_,transition:v,isDragging:y}=je({id:e.itemKey,disabled:{draggable:!r,droppable:t._tag!==`WritableBoardLane`}});return(0,q.jsxs)(`div`,{ref:m,style:{transform:ke.Translate.toString(_),transition:v},className:O(`group/task relative`,y&&`opacity-40`),children:[(0,q.jsx)(J,{ref:g,size:`sm`,className:O(Z(e.needsYou),r&&`touch-none focus-visible:ring-2 focus-visible:ring-ring/70`),...r&&f,...r&&p,children:(0,q.jsx)(X,{item:e,lane:t,catalog:n,repository:l,stall:o,readOnly:s,action:u,again:d,progress:dt(u,d,i)})}),(0,q.jsx)(ut,{item:e,run:b(e),moves:a,openRun:c,action:u,again:d,className:`absolute top-1.5 right-1.5 transition-opacity [@media(hover:hover)]:opacity-0 [@media(hover:hover)]:group-hover/task:opacity-100 [@media(hover:hover)]:group-focus-within/task:opacity-100 [@media(hover:hover)]:aria-expanded:opacity-100`})]})},pt=new Set([`Waiting`,`Queued`,`Running`]),mt=(e,t)=>new Map(e.flatMap((n,r)=>{let i=e[r+1];if(i===void 0||n._tag!==`WritableBoardLane`||i._tag!==`WritableBoardLane`)return[];let a=new Set(n.items.flatMap(e=>e.loops)),o=n.items.flatMap(({runs:e})=>e.filter(({state:e,loop:t})=>pt.has(e)&&a.has(t))),s={next:i,loops:t.filter(({name:e})=>a.has(e)).map(({name:e,paused:t})=>({name:e,paused:t})),tone:o.some(({state:e})=>e!==`Waiting`)?`active`:o.length>0?`waiting`:`idle`};return[[n.id,s]]})),ht=e=>e.map(({name:e,paused:t})=>t?`${e} (paused)`:e).join(`, `),gt=({flow:e})=>{let t=e.loops.length>0;return(0,q.jsxs)(`p`,{"data-slot":`flow-arrow`,className:O(`-mr-3 ml-auto flex min-w-0 items-center gap-1.5 pl-2 text-xs`,e.tone===`active`?`text-run-active`:e.tone===`waiting`?`text-run-waiting`:`text-muted-foreground`),title:t?`Loops matching this lane: ${ht(e.loops)}. Flows to ${e.next.name}`:void 0,children:[(0,q.jsxs)(`span`,{className:`sr-only`,children:[`Flows to `,e.next.name]}),t&&(0,q.jsx)(`span`,{className:`truncate`,children:e.loops.map(({name:e,paused:t},n)=>(0,q.jsxs)(W.Fragment,{children:[n>0&&`, `,e,t&&(0,q.jsx)(`span`,{className:`text-muted-foreground`,children:` paused`})]},e))}),(0,q.jsx)(`svg`,{"aria-hidden":`true`,viewBox:`0 0 22 8`,className:O(`h-2 w-5.5 shrink-0 fill-none stroke-current`,e.tone===`idle`&&`text-faint`),strokeWidth:`1`,strokeLinecap:`round`,strokeLinejoin:`round`,children:(0,q.jsx)(`path`,{d:`M0.5 4h18M15.5 1l3 3-3 3`})})]})},_t=e=>e.origin===`fallback`||e.sources.length>0&&e.sources.every(e=>`state`in e&&le(e.state)),vt=({sources:e,catalog:t})=>(0,q.jsx)(`ul`,{"aria-label":`Lane sources`,className:`flex flex-wrap gap-1`,children:e.map(e=>(0,q.jsx)(`li`,{className:`flex`,children:`label`in e?(0,q.jsx)(U,{name:e.label,label:t.get(e.label)}):(0,q.jsx)(H,{variant:`outline`,className:`text-muted-foreground`,children:e.state})},`label`in e?`label:${e.label}`:`state:${e.state}`))}),yt=({lane:e,open:t})=>(0,q.jsx)(`section`,{"aria-label":`${e.name} lane`,className:`w-10 shrink-0`,children:(0,q.jsx)(`button`,{type:`button`,"aria-expanded":!1,title:`Open ${e.name}`,onClick:t,className:`flex h-full min-h-40 w-full items-start justify-center rounded-lg bg-card/60 ring-1 ring-border transition-colors outline-none hover:bg-muted/50 focus-visible:ring-2 focus-visible:ring-ring/70`,children:(0,q.jsxs)(`span`,{className:`sticky top-0 flex flex-col-reverse items-center gap-2 py-3`,children:[(0,q.jsx)(`span`,{className:`max-h-60 truncate text-sm font-semibold [writing-mode:vertical-rl]`,children:e.name}),` `,(0,q.jsx)(`span`,{className:`text-sm text-muted-foreground tabular-nums`,children:e.items.length})]})})}),bt=({lane:e,lanes:t,flow:n,catalog:r,targeted:i,pending:a,readOnly:o,moves:s,stallOf:c,openRun:l,onMove:u,repository:d})=>{let f=_t(e),[p,m]=(0,W.useState)(f),h=e._tag===`WritableBoardLane`,{setNodeRef:g}=Pe({id:e.id,disabled:!h||a}),_=t.filter(t=>t._tag===`WritableBoardLane`&&t.id!==e.id),v=e.items.length,[y,b]=Je();return f&&p?(0,q.jsx)(yt,{lane:e,open:()=>m(!1)}):(0,q.jsxs)(`section`,{ref:g,"aria-label":`${e.name} lane`,className:O(`flex w-68 shrink-0 flex-col gap-2 rounded-lg transition-[background-color,box-shadow]`,i&&`bg-muted/40 ring-6 ring-muted/40`),children:[(0,q.jsxs)(`header`,{className:O(`z-20 -mx-0.5 flex shrink-0 flex-col gap-1.5 px-1 pt-1 pb-1`,!i&&`bg-background`),children:[(0,q.jsxs)(`div`,{className:`flex h-6 items-center`,children:[(0,q.jsxs)(`h2`,{className:`flex min-w-0 items-baseline gap-2`,children:[(0,q.jsx)(`span`,{className:`truncate text-sm font-semibold`,children:e.name}),(0,q.jsx)(`span`,{className:`text-sm text-muted-foreground tabular-nums`,children:v})]}),n!==void 0&&(0,q.jsx)(gt,{flow:n}),f&&(0,q.jsx)(A,{variant:`ghost`,size:`icon-xs`,"aria-expanded":!0,"aria-label":`Fold ${e.name}`,title:`Fold ${e.name}`,className:`ml-auto text-muted-foreground hover:text-foreground`,onClick:()=>m(!0),children:(0,q.jsx)(K,{"aria-hidden":`true`})})]}),(0,q.jsx)(`div`,{className:`min-h-5`,children:e.sources.length>0&&(0,q.jsx)(vt,{sources:e.sources,catalog:r})})]}),(0,q.jsx)(`div`,{ref:y,"aria-label":`${e.name} cards`,tabIndex:b.above||b.below?0:void 0,className:O(`-mx-1 flex min-h-0 flex-1 flex-col gap-2 overflow-y-auto overscroll-y-contain px-1 pb-1 outline-none focus-visible:ring-2 focus-visible:ring-ring/70`,b.above&&`mask-t-from-[calc(100%-2.5rem)]`,b.below&&`mask-b-from-[calc(100%-2.5rem)]`),children:(0,q.jsxs)(Le,{items:e.items.map(({itemKey:e})=>e),strategy:Ee,children:[v===0&&(0,q.jsx)(`p`,{className:`rounded-lg border border-dashed border-input px-3 py-2.5 text-xs text-muted-foreground`,children:`No tasks`}),e.items.map(t=>{let n=s.find(({itemKey:e})=>e===t.itemKey)?.phase,i=a||n!==void 0;return(0,q.jsx)(ft,{item:t,lane:e,catalog:r,draggable:!i&&_.length>0,phase:n,moves:{targets:_,disabled:i,onMove:u},stall:c(t),readOnly:o,openRun:l,repository:d},t.itemKey)})]})})]})},Q=({item:e,lane:t,catalog:n,repository:r,stall:i})=>(0,q.jsx)(J,{size:`sm`,className:O(Z(e.needsYou),`cursor-grabbing shadow-raised`),children:(0,q.jsx)(X,{item:e,lane:t,catalog:n,repository:r,stall:i,readOnly:!0,action:null,again:null,progress:null})}),xt=({runs:e,openRun:t})=>(0,q.jsxs)(J,{className:`sticky left-4 w-[min(64rem,calc(100cqw-2rem))] md:left-5 md:w-[min(64rem,calc(100cqw-2.5rem))]`,children:[(0,q.jsxs)(Ye,{children:[(0,q.jsx)(Xe,{children:`Runs without a card`}),(0,q.jsxs)(Ze,{children:[e.length,` run`,e.length===1?``:`s`,` with no card on this board`]})]}),(0,q.jsx)(Qe,{children:(0,q.jsxs)(Te,{children:[(0,q.jsx)(Ce,{children:(0,q.jsxs)(R,{children:[(0,q.jsx)(L,{children:`Loop`}),(0,q.jsx)(L,{children:`Agent`}),(0,q.jsx)(L,{children:`Item`}),(0,q.jsx)(L,{children:`State`}),(0,q.jsx)(L,{className:`w-0`})]})}),(0,q.jsx)(we,{children:e.map(e=>(0,q.jsxs)(R,{className:`cursor-pointer`,onClick:()=>t(e.id),children:[(0,q.jsx)(z,{className:`font-medium`,children:e.loop}),(0,q.jsx)(z,{children:e.agent}),(0,q.jsx)(z,{className:`max-w-64 truncate font-mono text-xs`,children:e.itemKey}),(0,q.jsx)(z,{children:(0,q.jsx)(xe,{state:e.state})}),(0,q.jsx)(z,{className:`text-right`,children:(0,q.jsx)(A,{variant:`ghost`,size:`icon-sm`,"aria-label":`Open run ${e.id}`,onClick:n=>{n.stopPropagation(),t(e.id)},children:(0,q.jsx)(G,{"aria-hidden":`true`})})})]},e.id))})]})})]}),St=e=>[...e.filter(({_tag:e})=>e===`WritableBoardLane`),...e.filter(({_tag:e,origin:t})=>e!==`WritableBoardLane`&&t!==`fallback`),...e.filter(({origin:e})=>e===`fallback`)],$=(e,t)=>t.find(t=>t.id===e)??t.find(t=>t.items.some(({itemKey:t})=>t===e)),Ct=e=>{let t=B(e);if(t.length>0)return t;if(e.pointerCoordinates===null){let t=B({...e,pointerCoordinates:{x:e.collisionRect.left+1,y:e.collisionRect.top+1}});if(t.length>0)return t}return Oe(e)},wt=e=>(t,n)=>{let r=t.code===`ArrowRight`;if(!r&&t.code!==`ArrowLeft`)return Fe(t,n);t.preventDefault();let{collisionRect:i,droppableRects:a,droppableContainers:o}=n.context;if(i===null)return;let s=new Set(e.map(({id:e})=>e)),[c]=o.getEnabled().flatMap(({id:e})=>{let t=a.get(e);return t!==void 0&&s.has(e)?[t]:[]}).filter(({left:e})=>r?e>i.left:e<i.left).sort((e,t)=>r?e.left-t.left:t.left-e.left);return c===void 0?void 0:{x:c.left,y:c.top}},Tt=(e,t)=>{let n=e.flatMap(({items:e})=>e).find(({itemKey:e})=>e===t.itemKey);if(n===void 0)return e;let r=new Set(e.flatMap(e=>e._tag===`WritableBoardLane`?e.labels:[])),i={...n,labels:n.labels.filter(e=>!r.has(e))};return e.map(e=>{let n=e.items.filter(({itemKey:e})=>e!==t.itemKey);return e.id===t.toLane?{...e,items:[i,...n]}:{...e,items:n}})},Et=e=>{let t=new Set(e.board.lanes.flatMap(({items:e})=>e.flatMap(({items:e})=>e.map(({itemKey:e})=>e))));return e.runs.filter(({itemKey:e})=>!t.has(e))},Dt=({project:e,loops:t,stalled:n,disabled:r,openRun:o})=>{let[s,c]=(0,W.useState)(null),[l,u]=(0,W.useState)(null),{moves:d,moveItem:f,isPending:p,error:m}=te(e),h=Et(e),g=d.reduce(Tt,St(e.board.lanes)),_=Ae(V(Me,{activationConstraint:{distance:6}}),V(De,{coordinateGetter:wt(g)})),v=mt(g,t),y=g.reduce((e,t)=>e+t.items.length,0),b=e=>ze(n,e),x=new Map(e.labels.map(e=>[e.name,e])),S=r||p,C=()=>{c(null),u(null)};return(0,q.jsxs)(`div`,{className:`flex min-h-96 flex-1 flex-col gap-4 pt-5`,children:[(0,q.jsx)(i,{title:e.repository,leading:(0,q.jsx)(_e,{repository:e.repository,size:`title`}),counts:`${g.length} lane${g.length===1?``:`s`}, ${y} item${y===1?``:`s`}`,className:`px-4 md:px-5`,children:e.status===`needs-you`&&(0,q.jsx)(Se,{})}),e.board.lanes.some(({origin:e})=>e===`proposed`)&&(0,q.jsxs)(`p`,{className:`mx-4 max-w-3xl text-muted-foreground md:mx-5`,children:[`Proposed lanes are read-only. To enable moves, add lanes with labels for this project under `,(0,q.jsx)(`code`,{children:`repos[].lanes`}),` in `,(0,q.jsx)(`code`,{children:`usine.yaml`}),`, then reload the configuration from Configuration > Loops.`]}),e.board.failures.length>0&&(0,q.jsx)(a,{className:`mx-4 max-w-3xl md:mx-5`,title:`${e.board.failures.length} ${e.board.failures.length===1?`item`:`items`} not shown on the board`,message:e.board.failures.map(e=>e.message).join(`
|
|
2
|
-
`)}),m!==null&&(0,q.jsx)(a,{className:`mx-4 max-w-3xl md:mx-5`,message:m.message}),(0,q.jsxs)(Ne,{sensors:_,collisionDetection:Ct,onDragStart:({active:e})=>{let t=g.find(({items:t})=>t.some(({itemKey:t})=>t===e.id)),n=t?.items.find(({itemKey:t})=>t===e.id);c(t===void 0||n===void 0?null:{item:n,lane:t})},onDragOver:({over:e})=>u(e===null?null:$(e.id,g)?.id??null),onDragEnd:({over:e})=>{if(C(),e===null||s===null)return;let t=$(e.id,g);t!==void 0&&f(s.item,t)},onDragCancel:C,children:[(0,q.jsx)(`div`,{className:`min-h-0 flex-1 overflow-auto overscroll-contain [container-type:size]`,"aria-label":`${e.repository} project board`,children:(0,q.jsxs)(`div`,{className:`flex w-max min-w-full flex-col gap-6 px-4 pb-4 md:px-5`,children:[(0,q.jsx)(`div`,{className:`flex h-[calc(100cqh-1rem)] min-h-80 shrink-0 gap-3`,children:g.map(t=>(0,q.jsx)(bt,{lane:t,lanes:g,flow:v.get(t.id),catalog:x,targeted:s!==null&&l===t.id&&t.id!==s.lane.id&&t._tag===`WritableBoardLane`,pending:S,readOnly:r,moves:d,stallOf:b,openRun:o,onMove:f,repository:e.repository},t.id))}),h.length>0&&(0,q.jsx)(xt,{runs:h,openRun:o})]})}),(0,q.jsx)(Ie,{children:s!==null&&(0,q.jsx)(Q,{item:s.item,lane:s.lane,catalog:x,repository:e.repository,stall:b(s.item)})})]})]})},Ot=()=>{let{repository:e}=he.useParams(),{data:t}=o(u()),n=o(r()),i=de(),a=t.projects.find(t=>t.repository===e);return a===void 0?(0,q.jsx)(We,{}):(0,q.jsx)(Dt,{project:a,loops:t.loops,stalled:n.data.notMoving,disabled:t._tag===`NeedsSetup`,openRun:i})};export{Ot as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./route-status-DGpeFNCC.js";var t=e;export{t as errorComponent};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e,r as t,s as n}from"./useRouter-Hur3RN7j.js";import{n as r,r as i}from"./page-C47YAWAl.js";import{t as a}from"./error-alert-hABzwCSY.js";import{t as o}from"./useSuspenseQuery-DbhQN-t-.js";import{C as s,S as c,b as l,h as u,m as d,n as f,r as p,x as m,y as h}from"./overview-C73v5kbv.js";import{a as g,i as _,n as v}from"./actions-CG0hkpe7.js";import{t as y}from"./useNavigate-AT5VkfZa.js";import{t as b}from"./link-C7GfYrMt.js";import{n as x,r as ee,s as S,t as te}from"./moves-DS1ecXd6.js";import{a as ne}from"./native-select-BzF8xUnx.js";import{d as re,i as C,n as w,r as T,t as E,u as D}from"./dropdown-menu-BHKHYfLs.js";import{D as O,t as k}from"./button-4rhhIcK8.js";import{Hn as ie,Mn as ae,S as oe,a as A,f as j,jn as se,kn as ce,o as le,zn as M}from"./strings-DXB6PB2g.js";import{c as ue,o as de,r as fe,t as N}from"./mark-uyeJ8aPC.js";import{t as pe}from"./use-open-run-B8nD_BT1.js";import{C as me,S as he,T as ge,b as _e,it as P,n as F,t as I,v as ve,w as ye,x as be,y as xe}from"./index-Dki55xSv.js";import{t as Se}from"./use-now-vNgLntlV.js";import{t as Ce}from"./heading-zIOXe3qT.js";import{t as we}from"./pull-request-marks-B4f7z4xa.js";import{n as L,t as Te}from"./status-badge-CLPsMXtK.js";import{n as Ee,t as De}from"./edit-and-retry-DZ5FH7N6.js";import{a as Oe,i as R,n as z,o as B,r as V,t as H}from"./table-hbKjhjeL.js";import{t as U}from"./fill-cell-CjksmixH.js";import{t as ke}from"./label-badge-JdNthOHh.js";import{a as Ae,n as je,t as Me}from"./model-87X7P9Uh.js";import{n as Ne,t as Pe}from"./run-again-DPa5c27z.js";import{t as Fe}from"./not-found-D7GT8Sj7.js";import{i as W,n as G,r as K,t as q}from"./section-BwxXJ9H0.js";var J=t(),Ie=e=>e.postedAt===null?e.attemptEndedAt===null?null:{at:e.attemptEndedAt,title:`Posted during the attempt that ended ${j(e.attemptEndedAt)}`}:{at:e.postedAt,title:`Posted ${j(e.postedAt)}`},Le=({task:e})=>{let t=new Map(e.runs.map(e=>[e.id,e])),n=new Map(e.items.map(e=>[e.itemKey,e]));return(0,J.jsxs)(`section`,{"aria-labelledby":`task-comments`,className:`flex flex-col gap-2`,children:[(0,J.jsx)(G,{id:`task-comments`,title:`Comments and reviews`,count:e.comments.length}),e.comments.length===0?(0,J.jsx)(q,{title:`No comments or reviews`,children:`Comments and reviews an agent posts on the task's items appear here after the attempt ends`}):(0,J.jsx)(`div`,{className:`-mx-2`,children:(0,J.jsx)(H,{"aria-labelledby":`task-comments`,children:(0,J.jsx)(z,{className:`border-t`,children:e.comments.map(e=>{let r=t.get(e.runId),i=r===void 0?void 0:n.get(r.itemKey),a=Ie(e);return(0,J.jsxs)(B,{className:K,children:[(0,J.jsx)(U,{className:`py-3 whitespace-normal`,children:(0,J.jsxs)(`a`,{"data-row-link":!0,href:e.url,target:`_blank`,rel:`noreferrer`,className:`font-medium ${W}`,children:[je(e.kind),i!==void 0&&(0,J.jsxs)(`span`,{className:`ml-2 text-xs font-normal text-muted-foreground`,children:[`on `,(0,J.jsx)(N,{item:i,linked:!1})]})]})}),(0,J.jsx)(V,{className:`py-3`,children:r!==void 0&&(0,J.jsx)(b,{to:`/projects/$owner/$name/runs/$run`,params:{...p(r.repository),run:r.id},className:`relative z-10 rounded-sm text-muted-foreground underline-offset-4 outline-none hover:text-foreground hover:underline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring/70 focus-visible:outline-solid`,children:r.loop})}),(0,J.jsx)(V,{className:`py-3 text-right`,children:a!==null&&(0,J.jsx)(`time`,{dateTime:a.at,title:a.title,className:`font-mono text-xs text-muted-foreground tabular-nums`,children:A(a.at)})})]},e.url)})})})})]})},Re=({task:e,project:t,disabled:n})=>{let o=te(t),[s]=e.items,c=e.items.find(({itemKey:t})=>t===e.current)??s,l=t.board.lanes.flatMap(e=>e.items.map(t=>({lane:e,card:t}))).find(({card:t})=>t.itemKey===e.current),u=l===void 0?void 0:o.moves.find(({itemKey:e})=>e===l.card.itemKey),d=l===void 0?[]:t.board.lanes.filter(e=>e._tag===`WritableBoardLane`&&e.id!==l.lane.id),f=t.board.lanes.find(({id:e})=>e===u?.toLane)?.name??l?.lane.name??e.lane.name,p=new Set(t.board.lanes.flatMap(e=>e._tag===`WritableBoardLane`?e.labels:[])),m=l===void 0?c.labels:ee(l.card,l.lane).filter(e=>u===void 0||!p.has(e)),h=new Map(t.labels.map(e=>[e.name,e])),g=!n&&!o.isPending&&u===void 0&&d.length>0,{origin:_,pullRequests:v}=ue(e.items);return(0,J.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,J.jsx)(i,{actionsBeside:`sm`,heading:(0,J.jsx)(Ce,{variant:`page`,item:ie(_),title:e.title}),facts:(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(we,{pullRequests:v}),(0,J.jsx)(r,{icon:P,title:`Lane`,children:(0,J.jsx)(`span`,{className:`text-foreground`,children:f})}),u!==void 0&&(0,J.jsx)(`span`,{role:`status`,children:x(u.phase)}),m.length>0&&(0,J.jsx)(`span`,{className:`flex flex-wrap gap-1`,children:m.map(e=>(0,J.jsx)(ke,{name:e,label:h.get(e)},e))}),e.needsYou&&(0,J.jsx)(Te,{})]}),...l!==void 0&&g?{actions:(0,J.jsxs)(E,{children:[(0,J.jsxs)(D,{render:(0,J.jsx)(k,{variant:`outline`}),"aria-label":`Move ${fe(c)} to another lane`,children:[`Move to`,(0,J.jsx)(ne,{"data-icon":`inline-end`,"aria-hidden":`true`})]}),(0,J.jsx)(w,{align:`end`,className:`w-auto min-w-40`,children:(0,J.jsx)(T,{children:d.map(e=>(0,J.jsx)(C,{onClick:()=>o.moveItem(l.card,e),children:e.name},e.id))})})]})}:{}}),o.error!==null&&(0,J.jsx)(a,{className:`max-w-3xl`,message:o.error.message})]})},ze=({task:e})=>{let t=e.items.filter(({kind:e})=>e===`pr`);return(0,J.jsxs)(`section`,{"aria-labelledby":`task-pull-requests`,className:`flex flex-col gap-2`,children:[(0,J.jsx)(G,{id:`task-pull-requests`,title:`Pull requests`,count:t.length}),t.length===0?(0,J.jsx)(q,{title:`No pull requests`,children:`Pull requests that close the issue, or that a run on the issue opened, appear here`}):(0,J.jsx)(`div`,{className:`-mx-2`,children:(0,J.jsx)(H,{"aria-labelledby":`task-pull-requests`,children:(0,J.jsx)(z,{className:`border-t`,children:t.map(e=>(0,J.jsxs)(B,{className:K,children:[(0,J.jsx)(V,{className:`w-0 py-3`,children:(0,J.jsx)(N,{item:e,linked:!1})}),(0,J.jsx)(U,{className:`py-3 whitespace-normal`,children:(0,J.jsxs)(`a`,{"data-row-link":!0,href:e.url,target:`_blank`,rel:`noreferrer`,className:`font-medium wrap-anywhere ${W}`,children:[e.title,(0,J.jsx)(S,{className:`ml-1.5 inline size-3.5 text-muted-foreground`,"aria-label":`Opens on GitHub`})]})}),(0,J.jsx)(V,{className:`py-3 text-right`,children:e.conflicting&&(0,J.jsx)(`span`,{className:`text-xs text-destructive`,children:`Conflicts with base`})})]},e.itemKey))})})})]})},Y=n(e(),1),X=({run:e})=>{let t=Se(3e4);return M(Me(e,t),{onNone:()=>null,onSome:e=>(0,J.jsx)(`span`,{className:`font-mono text-xs tabular-nums`,title:`Total attempt time`,children:le(e)})})},Be=({run:e})=>M(Ae(e),{onNone:()=>null,onSome:e=>(0,J.jsxs)(`p`,{className:`line-clamp-2 text-xs wrap-anywhere`,title:d(e),children:[(0,J.jsx)(`span`,{className:`font-medium text-destructive`,children:u(e)}),` `,(0,J.jsx)(`span`,{className:`text-muted-foreground`,children:d(e)})]})}),Z=({run:e})=>(0,J.jsx)(`time`,{dateTime:e.openedAt,title:`Opened ${j(e.openedAt)}`,className:`font-mono text-xs whitespace-nowrap tabular-nums`,children:A(e.openedAt)}),Q=({pullRequest:e})=>M(e,{onNone:()=>null,onSome:e=>(0,J.jsx)(N,{item:e,className:`relative z-10`})}),Ve=(e,t)=>`${e} ${t}${e===1?``:`s`}`,$=({run:e,pullRequest:t})=>(0,J.jsxs)(`p`,{className:`flex flex-wrap items-baseline gap-x-3 gap-y-0.5 text-xs text-muted-foreground xl:hidden`,children:[(0,J.jsx)(`span`,{className:`font-medium text-foreground sm:hidden`,children:e.state}),(0,J.jsx)(`span`,{children:e.agent}),(0,J.jsx)(`span`,{children:Ve(e.attempts.length,`attempt`)}),(0,J.jsx)(X,{run:e}),(0,J.jsx)(Z,{run:e}),(0,J.jsx)(Q,{pullRequest:t})]}),He=e=>e.canApprove?`approve`:e.canRetry&&e.canResolveFailure?`retry`:null,Ue=({run:e,onEdit:t,openRun:n,status:r})=>{let i=_(),a=g(),[o,u]=(0,Y.useState)(!1);if(i.isPending&&i.variables!==void 0)return(0,J.jsx)(`span`,{role:`status`,className:`text-xs text-muted-foreground`,children:m[i.variables.request.action]});if(a.isPending)return(0,J.jsx)(`span`,{role:`status`,className:`text-xs text-muted-foreground`,children:s});let d=t=>i.mutate({runId:e.id,request:t},{onSuccess:()=>r(null),onError:e=>r((0,J.jsx)(`span`,{className:`text-destructive`,children:e.message}))}),f=()=>a.mutate(v(e),{onSuccess:e=>{e._tag===`Claimed`?(r(null),n(e.runId)):r((0,J.jsx)(`span`,{className:`text-needs-you`,children:c}))},onError:e=>r((0,J.jsx)(`span`,{className:`text-destructive`,children:e.message}))}),p=e.attempts.at(-1),y=He(e),b=p?.outcome?._tag===`Failed`&&p.outcome.failure._tag===`QuestionFailure`,x=[];return e.canApprove&&y!==`approve`&&x.push({label:l.approve,select:()=>d({action:`approve`})}),e.canRetry&&y!==`retry`&&x.push({label:l.retry,description:h(e.agentBrain),select:()=>d({action:`retry`})}),e.canRetry&&x.push({label:`Edit and retry`,select:()=>t(`retry`)}),e.canRunAgain&&(x.push({label:l.runAgain,select:f}),x.push({label:`Edit and run again`,select:()=>t(`runAgain`)})),e.canResolveFailure&&p!==void 0&&x.push({label:b?`Mark answered`:`Mark resolved`,select:()=>d({action:`resolveFailure`,attemptId:p.id})}),e.canCancel&&x.push({label:l.cancel,destructive:!0,select:()=>u(!0)}),(0,J.jsxs)(`div`,{className:`relative z-10 flex items-center justify-end gap-1`,children:[y!==null&&(0,J.jsx)(k,{variant:`outline`,size:`sm`,title:y===`retry`?h(e.agentBrain):void 0,onClick:()=>d({action:y}),children:l[y]}),x.length>0&&(0,J.jsxs)(E,{children:[(0,J.jsx)(D,{render:(0,J.jsx)(k,{variant:`ghost`,size:`icon-sm`,className:`text-muted-foreground hover:text-foreground aria-expanded:text-foreground`}),"aria-label":`Actions for the ${e.loop} run opened ${A(e.openedAt)}`,children:(0,J.jsx)(re,{weight:`bold`,className:`size-4`,"aria-hidden":`true`})}),(0,J.jsx)(w,{align:`end`,className:`w-auto min-w-44`,children:(0,J.jsx)(T,{children:x.map(({label:e,description:t,destructive:n,select:r})=>(0,J.jsx)(C,{title:t,variant:n===!0?`destructive`:`default`,onClick:r,children:e},e))})})]}),e.canCancel&&(0,J.jsx)(ve,{open:o,onOpenChange:u,children:(0,J.jsxs)(be,{children:[(0,J.jsxs)(ye,{children:[(0,J.jsxs)(ge,{children:[`Cancel `,e.loop,`?`]}),(0,J.jsx)(he,{children:`The run stops, including any attempt in progress.`})]}),(0,J.jsxs)(me,{children:[(0,J.jsx)(_e,{children:l.keepRunning}),(0,J.jsx)(xe,{variant:`destructive`,onClick:()=>{u(!1),d({action:`cancel`})},children:l.confirmCancel})]})]})})]})},We=8,Ge=({run:e,item:t,pullRequest:n,openRun:r})=>{let[i,a]=(0,Y.useState)(null),[o,s]=(0,Y.useState)(null);return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(B,{className:O(K,`[&>td]:align-top`),children:[(0,J.jsx)(V,{className:`hidden py-3 sm:table-cell`,children:(0,J.jsxs)(`span`,{className:`inline-flex items-center gap-2 text-foreground`,children:[(0,J.jsx)(L,{state:e.state}),e.state]})}),(0,J.jsx)(U,{className:`py-3 whitespace-normal`,children:(0,J.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,J.jsxs)(`p`,{className:`flex min-w-0 items-baseline gap-2`,children:[(0,J.jsx)(L,{state:e.state,className:`self-center sm:hidden`}),(0,J.jsx)(b,{"data-row-link":!0,to:`/projects/$owner/$name/runs/$run`,params:{...p(e.repository),run:e.id},className:O(`font-medium wrap-anywhere`,W),children:e.loop}),t!==null&&(0,J.jsx)(N,{item:t,className:`relative z-10 shrink-0`})]}),(0,J.jsx)(Be,{run:e}),e.runAgain!==null&&(0,J.jsx)(Pe,{run:e,source:`link`,className:`text-xs`}),e.approval!==null&&(0,J.jsx)(Ne,{approval:e.approval,className:`text-xs`}),(0,J.jsx)($,{run:e,pullRequest:n}),o!==null&&(0,J.jsx)(`p`,{role:`status`,className:`text-xs`,children:o})]})}),(0,J.jsx)(V,{className:`hidden py-3 xl:table-cell`,children:e.agent}),(0,J.jsx)(V,{className:`hidden py-3 text-right tabular-nums xl:table-cell`,children:e.attempts.length}),(0,J.jsx)(V,{className:`hidden py-3 text-right xl:table-cell`,children:(0,J.jsx)(X,{run:e})}),(0,J.jsx)(V,{className:`hidden py-3 xl:table-cell`,children:(0,J.jsx)(Z,{run:e})}),(0,J.jsx)(V,{className:`hidden py-3 xl:table-cell`,children:(0,J.jsx)(Q,{pullRequest:n})}),(0,J.jsx)(V,{className:`py-2.5`,children:(0,J.jsx)(Ue,{run:e,onEdit:a,openRun:r,status:s})})]}),i!==null&&Ee(e,i)&&(0,J.jsx)(B,{className:`hover:bg-transparent`,children:(0,J.jsx)(V,{colSpan:We,className:`px-2 pt-1 pb-4 whitespace-normal`,children:(0,J.jsx)(De,{run:e,intent:i,close:()=>a(null),openRun:r,className:`max-w-2xl rounded-lg border p-4`},`${e.id}:${i}`)})})]})},Ke=({task:e,openRun:t})=>{let n=new Map(e.items.map(e=>[e.itemKey,e])),r=e.items.length>1;return(0,J.jsxs)(`section`,{"aria-labelledby":`task-runs`,className:`flex flex-col gap-2`,children:[(0,J.jsx)(G,{id:`task-runs`,title:`Runs`,count:e.runs.length}),e.runs.length===0?(0,J.jsx)(q,{title:`No runs yet`,children:`A run opens when a loop's trigger matches one of the task's items`}):(0,J.jsx)(`div`,{className:`-mx-2`,children:(0,J.jsxs)(H,{children:[(0,J.jsx)(Oe,{children:(0,J.jsxs)(B,{className:`hover:bg-transparent`,children:[(0,J.jsx)(R,{className:`hidden sm:table-cell`,children:`State`}),(0,J.jsx)(R,{children:`Run`}),(0,J.jsx)(R,{className:`hidden xl:table-cell`,children:`Agent`}),(0,J.jsx)(R,{className:`hidden text-right xl:table-cell`,children:`Attempts`}),(0,J.jsx)(R,{className:`hidden text-right xl:table-cell`,children:`Duration`}),(0,J.jsx)(R,{className:`hidden xl:table-cell`,children:`Opened`}),(0,J.jsx)(R,{className:`hidden xl:table-cell`,children:`Pull request`}),(0,J.jsx)(R,{children:(0,J.jsx)(`span`,{className:`sr-only`,children:`Actions`})})]})}),(0,J.jsx)(z,{children:e.runs.map(i=>{let a=se(ae(i.pullRequestUrl),t=>de(t,e.items)),o=r?n.get(i.itemKey)??null:null;return(0,J.jsx)(Ge,{run:i,item:o===null||ce(a,({number:e})=>e===o.number)?null:o,pullRequest:a,openRun:t},i.id)})})]})})]})},qe=({children:e})=>(0,J.jsx)(`main`,{className:`px-4 pt-5 pb-10 md:px-5`,children:(0,J.jsx)(`div`,{className:`flex max-w-5xl flex-col gap-8`,children:e})}),Je=({repository:e,number:t})=>{let{data:n}=o(f()),r=n.projects.find(t=>t.repository===e),i=pe(),s=o(F(e,t));if(s.error instanceof oe&&s.error.error===`BoardItemNotFoundError`)return(0,J.jsx)(Fe,{repository:e,number:String(t)});let c=s.isError&&(0,J.jsx)(a,{className:`max-w-3xl`,title:`Could not refresh the task`,message:s.error.message}),l=s.data;return l.number===t?(0,J.jsxs)(qe,{children:[c,r!==void 0&&(0,J.jsx)(Re,{task:l,project:r,disabled:n._tag===`NeedsSetup`}),(0,J.jsx)(Ke,{task:l,openRun:i}),(0,J.jsx)(ze,{task:l}),(0,J.jsx)(Le,{task:l})]}):(0,J.jsx)(y,{to:`/projects/$owner/$name/tasks/$number`,params:{...p(e),number:String(l.number)},search:e=>e,replace:!0})},Ye=()=>{let{repository:e}=I.useParams(),{number:t}=I.useLoaderData();return(0,J.jsx)(Je,{repository:e,number:t},`${e}#${t}`)};export{Ye as component};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./route-status-DGpeFNCC.js";var t=e;export{t as errorComponent};
|