prismalens 0.5.4 → 0.5.5
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/dist/{chunk-ZZ3DOHTJ.js → chunk-3PSZIGUA.js} +14 -2
- package/dist/src/cli/up.js +1 -1
- package/dist/src/cli/update-notice.js +1 -1
- package/dist/src/cli/upgrade.js +70 -10
- package/node_modules/@prismalens/api/dist/src/core/settings/about.service.js +28 -8
- package/node_modules/@prismalens/api/dist/src/core/settings/update.service.js +9 -3
- package/node_modules/@prismalens/api/public/assets/{AddProjectDialog-BEBKziDJ.js → AddProjectDialog-p3LLsE1B.js} +1 -1
- package/node_modules/@prismalens/api/public/assets/{AgentDetail-DNNZ2RSQ.js → AgentDetail-CbhnttdO.js} +1 -1
- package/node_modules/@prismalens/api/public/assets/{AlertsBlank-M7HkWlgo.js → AlertsBlank-CVPQuVxb.js} +1 -1
- package/node_modules/@prismalens/api/public/assets/Composer-DIYA4JDp.js +1 -0
- package/node_modules/@prismalens/api/public/assets/{HelperThread-BmGnmkL5.js → HelperThread-DNWceguA.js} +1 -1
- package/node_modules/@prismalens/api/public/assets/{Hint-BCpVhAvV.js → Hint-Od6cnmvm.js} +1 -1
- package/node_modules/@prismalens/api/public/assets/{HomeComposer-BI6Vhge8.js → HomeComposer-sotk5r71.js} +1 -1
- package/node_modules/@prismalens/api/public/assets/{HypothesesCard-HKxfxVbG.js → HypothesesCard-BcaBcZ8b.js} +1 -1
- package/node_modules/@prismalens/api/public/assets/{IncidentHeader-BIYafwD0.js → IncidentHeader-GG30mdkp.js} +1 -1
- package/node_modules/@prismalens/api/public/assets/{KeptWorkspaces-ozJb7lRG.js → KeptWorkspaces-B_TvW0ro.js} +1 -1
- package/node_modules/@prismalens/api/public/assets/{MergeDialog-DRjChRQQ.js → MergeDialog-82IoAwUo.js} +1 -1
- package/node_modules/@prismalens/api/public/assets/{NewThread-HisGwIRc.js → NewThread-CAT5otyD.js} +1 -1
- package/node_modules/@prismalens/api/public/assets/{PanelShell-BHpdPx3P.js → PanelShell-ghqMmsZW.js} +1 -1
- package/node_modules/@prismalens/api/public/assets/{ProjectList-lAMigyat.js → ProjectList-DAPGOIoj.js} +1 -1
- package/node_modules/@prismalens/api/public/assets/{ResolveDialog-DbMNHrwo.js → ResolveDialog-CPNlWRrP.js} +1 -1
- package/node_modules/@prismalens/api/public/assets/{RingTick-DkMvLoUV.js → RingTick-Zd_duqBv.js} +1 -1
- package/node_modules/@prismalens/api/public/assets/{RunStrip-CLaYEj2D.js → RunStrip-CAosRfHY.js} +1 -1
- package/node_modules/@prismalens/api/public/assets/{RunsMenu-CD4Yy4jT.js → RunsMenu-B9_X_90y.js} +1 -1
- package/node_modules/@prismalens/api/public/assets/{ScheduleDialog-DPYtmK0g.js → ScheduleDialog-DKRvxEa7.js} +1 -1
- package/node_modules/@prismalens/api/public/assets/{ServiceFormDialog-9-qDnObk.js → ServiceFormDialog-Bfyz7V7X.js} +1 -1
- package/node_modules/@prismalens/api/public/assets/{SubagentPane-exGNOprU.js → SubagentPane-DxVUfFbn.js} +1 -1
- package/node_modules/@prismalens/api/public/assets/{Transcript-2ke3pjya.js → Transcript-Csly_ODF.js} +4 -4
- package/node_modules/@prismalens/api/public/assets/{TriggerCard-BIAznpA9.js → TriggerCard-B4_zrVDz.js} +1 -1
- package/node_modules/@prismalens/api/public/assets/{WebhookCopy-C8w9xwD6.js → WebhookCopy-Cy9bof9B.js} +1 -1
- package/node_modules/@prismalens/api/public/assets/{WorkspaceFields-DCSJCThm.js → WorkspaceFields-CXSg1krp.js} +1 -1
- package/node_modules/@prismalens/api/public/assets/{___design-8brlEBqd.js → ___design-F8T4DJmm.js} +1 -1
- package/node_modules/@prismalens/api/public/assets/{_authenticated-BETuqAeS.js → _authenticated-CJYOmwQf.js} +1 -1
- package/node_modules/@prismalens/api/public/assets/{_id-y5y3CxjT.js → _id-0EUmYM6O.js} +1 -1
- package/node_modules/@prismalens/api/public/assets/{_id-B8v8uWe_.js → _id-B4P0alBy.js} +1 -1
- package/node_modules/@prismalens/api/public/assets/{_id-DiQnst4D.js → _id-C_OturvV.js} +1 -1
- package/node_modules/@prismalens/api/public/assets/{_id-BeO8QWfB.js → _id-D3aRrGal.js} +1 -1
- package/node_modules/@prismalens/api/public/assets/{_id-Cnh_sXTf.js → _id-Jd8V68_n.js} +1 -1
- package/node_modules/@prismalens/api/public/assets/{_id-VgE-Xeq5.js → _id-o6KZri3X.js} +1 -1
- package/node_modules/@prismalens/api/public/assets/{_id_.runs._runId-U4P5LH-M.js → _id_.runs._runId-B2eT22Ak.js} +1 -1
- package/node_modules/@prismalens/api/public/assets/{alerts-BI1l8Cxn.js → alerts-DkmUI_TY.js} +1 -1
- package/node_modules/@prismalens/api/public/assets/{automation-FhFtuS5_.js → automation-Cw0qe0-8.js} +1 -1
- package/node_modules/@prismalens/api/public/assets/{boxes-Dh2QZfJa.js → boxes-B__2zYVO.js} +1 -1
- package/node_modules/@prismalens/api/public/assets/check-C96xWdLm.js +1 -0
- package/node_modules/@prismalens/api/public/assets/chevron-left-S6eOHk4C.js +1 -0
- package/node_modules/@prismalens/api/public/assets/chevron-right-DXWfiPu3.js +1 -0
- package/node_modules/@prismalens/api/public/assets/circle-Dy7W2aR3.js +1 -0
- package/node_modules/@prismalens/api/public/assets/{command-chip-5Lf0FARB.js → command-chip-BFhgzAY5.js} +1 -1
- package/node_modules/@prismalens/api/public/assets/{conversation-CXkaesO_.js → conversation-Cf7_OnZb.js} +1 -1
- package/node_modules/@prismalens/api/public/assets/{copy-BUnkkIK-.js → copy-_5FNPl7W.js} +1 -1
- package/node_modules/@prismalens/api/public/assets/desktop-yb-lqHMd.js +9 -0
- package/node_modules/@prismalens/api/public/assets/{device-name-CZPntaj6.js → device-name-CxC_JUpj.js} +1 -1
- package/node_modules/@prismalens/api/public/assets/{dist-CYLssYEL.js → dist-CtE2KbbF.js} +1 -1
- package/node_modules/@prismalens/api/public/assets/{dist-CQz4Osl1.js → dist-zIr1CK3Q.js} +1 -1
- package/node_modules/@prismalens/api/public/assets/{dropdown-menu-Db9u3UIb.js → dropdown-menu-yoILSLgJ.js} +1 -1
- package/node_modules/@prismalens/api/public/assets/{ellipsis-d1vABf4v.js → ellipsis-BsNLvnl9.js} +1 -1
- package/node_modules/@prismalens/api/public/assets/{evidence-files-C9UcJR1J.js → evidence-files-C_a9Ct8m.js} +1 -1
- package/node_modules/@prismalens/api/public/assets/{fixes-CgjsPkfr.js → fixes-BWFKY2Zx.js} +1 -1
- package/node_modules/@prismalens/api/public/assets/{folder-git-2-DRsiaeAx.js → folder-git-2-Co_pliwR.js} +1 -1
- package/node_modules/@prismalens/api/public/assets/{globe-D2S-zGel.js → globe-C0OZE9Nx.js} +1 -1
- package/node_modules/@prismalens/api/public/assets/{highlighted-body-JLMTFACH-B_v9yJZa.js → highlighted-body-JLMTFACH-DGWjXpHw.js} +1 -1
- package/node_modules/@prismalens/api/public/assets/{incidents-B0KnIveX.js → incidents-TJ2Rty4H.js} +1 -1
- package/node_modules/@prismalens/api/public/assets/{index-DZMj9YK4.js → index-BoI68UdU.js} +6 -6
- package/node_modules/@prismalens/api/public/assets/{key-CjFGD02m.js → key-BjaZOgBI.js} +1 -1
- package/node_modules/@prismalens/api/public/assets/{live-refresh-C5Jfxdxb.js → live-refresh-DlFUKDgl.js} +1 -1
- package/node_modules/@prismalens/api/public/assets/mermaid-WFAXDIZX-BQk6GVWB.js +1 -0
- package/node_modules/@prismalens/api/public/assets/{new-Ci475pgf.js → new-Bo1xcbFc.js} +1 -1
- package/node_modules/@prismalens/api/public/assets/{pair-CobM73_c.js → pair-BePmSLQZ.js} +1 -1
- package/node_modules/@prismalens/api/public/assets/{pencil-BwNhunJy.js → pencil-CKAiE_29.js} +1 -1
- package/node_modules/@prismalens/api/public/assets/plus-f3bDJe68.js +1 -0
- package/node_modules/@prismalens/api/public/assets/projects-Cwgyv1jw.js +1 -0
- package/node_modules/@prismalens/api/public/assets/{restart-40l7XMmi.js → restart-FIcq7DzH.js} +1 -1
- package/node_modules/@prismalens/api/public/assets/{route-DX3TI7JD.js → route-1kdlRYKk.js} +1 -1
- package/node_modules/@prismalens/api/public/assets/{route-Dvao2bBW.js → route-CLgiK_od.js} +1 -1
- package/node_modules/@prismalens/api/public/assets/{route-Bg17GbpR.js → route-q1BFinlW.js} +1 -1
- package/node_modules/@prismalens/api/public/assets/{route-ah1SnYbH.js → route-rOkhgLEt.js} +1 -1
- package/node_modules/@prismalens/api/public/assets/{run-details-DTzMO1X0.js → run-details-B1I5SE7k.js} +1 -1
- package/node_modules/@prismalens/api/public/assets/{run-labels-ubQZmnqd.js → run-labels-BLTL5eG9.js} +1 -1
- package/node_modules/@prismalens/api/public/assets/{select-98_n4DVz.js → select-hkRu0Dxf.js} +1 -1
- package/node_modules/@prismalens/api/public/assets/{service-detail.utils-ulWHS1Ao.js → service-detail.utils-BQfYgq-F.js} +1 -1
- package/node_modules/@prismalens/api/public/assets/{services-CZQMzqYj.js → services-CnYlTAN3.js} +1 -1
- package/node_modules/@prismalens/api/public/assets/{settings-QPxeIS82.js → settings-COMwARMq.js} +1 -1
- package/node_modules/@prismalens/api/public/assets/{source-words-B5oOdiQU.js → source-words-CCeTLwOy.js} +1 -1
- package/node_modules/@prismalens/api/public/assets/{state-tone-DEsvSFn6.js → state-tone-DOGSNxJV.js} +1 -1
- package/node_modules/@prismalens/api/public/assets/{switch-DpPkkZxw.js → switch-u0tmvVOg.js} +1 -1
- package/node_modules/@prismalens/api/public/assets/{theme-provider-C9jvt7JX.js → theme-provider-Cg3suR2p.js} +1 -1
- package/node_modules/@prismalens/api/public/assets/{threads-BqAHgCGd.js → threads-Pk0lpo7I.js} +1 -1
- package/node_modules/@prismalens/api/public/assets/{tick-copy-B7dbIrfQ.js → tick-copy-DPjahm-5.js} +1 -1
- package/node_modules/@prismalens/api/public/assets/{use-operator-BH6GxjAY.js → use-operator-BdSmIxpm.js} +1 -1
- package/node_modules/@prismalens/api/public/assets/{use-repositories-orpc-c6hPOKjE.js → use-repositories-orpc-Ban_zGD7.js} +1 -1
- package/node_modules/@prismalens/api/public/assets/{use-threads-orpc-rBrvQXJf.js → use-threads-orpc-mbpsuq3G.js} +1 -1
- package/node_modules/@prismalens/api/public/assets/{useInvestigationRun-xdB0R08B.js → useInvestigationRun-BJKQxOF2.js} +1 -1
- package/node_modules/@prismalens/api/public/assets/{useQueries-CGpidxif.js → useQueries-B6U7UAZl.js} +1 -1
- package/node_modules/@prismalens/api/public/index.html +2 -2
- package/node_modules/@prismalens/config/dist/index.js +2 -1
- package/node_modules/@prismalens/config/dist/utils/install-channel.js +3 -3
- package/node_modules/@prismalens/config/dist/utils/update-channel.js +65 -0
- package/node_modules/@prismalens/config/dist/utils/update-check.js +67 -34
- package/node_modules/@prismalens/contracts/dist/schemas/settings.js +16 -0
- package/package.json +3 -2
- package/node_modules/@prismalens/api/public/assets/Composer-MAXlRLhF.js +0 -1
- package/node_modules/@prismalens/api/public/assets/check-DfKru7HJ.js +0 -1
- package/node_modules/@prismalens/api/public/assets/chevron-left-DWLaEwl8.js +0 -1
- package/node_modules/@prismalens/api/public/assets/chevron-right-tPbGnTHi.js +0 -1
- package/node_modules/@prismalens/api/public/assets/circle-BqIhGHXt.js +0 -1
- package/node_modules/@prismalens/api/public/assets/desktop-Bqso9PNq.js +0 -9
- package/node_modules/@prismalens/api/public/assets/mermaid-WFAXDIZX-CqliGVff.js +0 -1
- package/node_modules/@prismalens/api/public/assets/plus-DWSahnrj.js +0 -1
- package/node_modules/@prismalens/api/public/assets/projects-CIckRlw8.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,n as t,t as n}from"./jsx-runtime-Wy9s6hX0.js";import{t as r}from"./react-dom-g7hNCJoM.js";import{Xt as i,_t as a,a as o,c as s,gt as c}from"./desktop-Bqso9PNq.js";import{t as l}from"./utils-A3okWeke.js";import{i as u,o as d}from"./button-DmIfWVZ8.js";import{$ as f,E as p,H as m,J as h,K as g,Q as _,W as v,X as y,Y as b,Z as x,q as S,z as C}from"./use-repositories-orpc-c6hPOKjE.js";var w={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]};w.node;var T=o(w),E={name:`chevron-up`,size:24,node:[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]};E.node;var D=o(E),ee=new Intl.DateTimeFormat(void 0,{dateStyle:`medium`,timeStyle:`short`}),O=new Intl.DateTimeFormat(void 0,{dateStyle:`medium`});function k(e){return ee.format(new Date(e))}function A(e){return O.format(new Date(e))}function j(e){let t=Math.max(0,Math.floor(e));return t<60?`${t}s`:t<3600?`${Math.floor(t/60)}m ${String(t%60).padStart(2,`0`)}s`:`${Math.floor(t/3600)}h ${String(Math.floor(t%3600/60)).padStart(2,`0`)}m`}var te=new Intl.DateTimeFormat(void 0,{hour:`2-digit`,minute:`2-digit`,hour12:!1});function M(e){return te.format(new Date(e))}var ne=new Intl.DateTimeFormat(void 0,{weekday:`short`}),re=5184e5;function ie(e,t){let n=new Date(e),r=new Date(t);r.setHours(0,0,0,0);let i=M(n);return n.getTime()>=r.getTime()?i:r.getTime()-n.getTime()<=re?`${ne.format(n)} ${i}`:`${A(n)} ${i}`}function ae(e){let t=e.recurrence.type===`cron`?e.recurrence.timezone:void 0;if(!t)return e.description;try{let n=new Intl.DateTimeFormat(`en-US`,{timeZone:t,timeZoneName:`short`}).formatToParts(new Date).find(e=>e.type===`timeZoneName`)?.value;return n?`${e.description} ${n}`:e.description}catch{return e.description}}var N=e(r(),1),P=e(t(),1),F=n(),oe=Object.defineProperty,se=(e,t)=>oe(e,`name`,{value:t,configurable:!0}),ce=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),le=P.forwardRef(se(function(e,t){return(0,F.jsx)(f.span,{...e,ref:t,style:{...ce,...e.style}})},`VisuallyHidden`)),ue=[`top`,`right`,`bottom`,`left`],I=Math.min,L=Math.max,de=Math.round,fe=Math.floor,R=e=>({x:e,y:e}),pe={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function me(e,t,n){return L(e,I(t,n))}function z(e,t){return typeof e==`function`?e(t):e}function B(e){return e.split(`-`)[0]}function V(e){return e.split(`-`)[1]}function he(e){return e===`x`?`y`:`x`}function ge(e){return e===`y`?`height`:`width`}function H(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function _e(e){return he(H(e))}function ve(e,t,n){n===void 0&&(n=!1);let r=V(e),i=_e(e),a=ge(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=De(o)),[o,De(o)]}function ye(e){let t=De(e);return[be(e),t,be(t)]}function be(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var xe=[`left`,`right`],Se=[`right`,`left`],Ce=[`top`,`bottom`],we=[`bottom`,`top`];function Te(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Se:xe:t?xe:Se;case`left`:case`right`:return t?Ce:we;default:return[]}}function Ee(e,t,n,r){let i=V(e),a=Te(B(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(be)))),a}function De(e){let t=B(e);return pe[t]+e.slice(t.length)}function Oe(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function ke(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Oe(e)}function Ae(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 je(e,t,n){let{reference:r,floating:i}=e,a=H(t),o=_e(t),s=ge(o),c=B(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=V(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function Me(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}=z(t,e),p=ke(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Ae(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=Ae(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 Ne=50,Pe=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Me},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=je(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<Ne&&(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}=je(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Fe=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}=z(e,t)||{};if(l==null)return{};let d=ke(u),f={x:n,y:r},p=_e(i),m=ge(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=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;C&&await(o.isElement==null?void 0:o.isElement(S))||(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=I(d[_],T),D=I(d[v],T),ee=C-h[m]-D,O=C/2-h[m]/2+w,k=me(E,O,ee),A=!c.arrow&&V(i)!=null&&O!==k&&a.reference[m]/2-(O<E?E:D)-h[m]/2<0,j=A?O<E?O-E:O-ee:0;return{[p]:f[p]+j,data:{[p]:k,centerOffset:O-k-j,...A&&{alignmentOffset:j}},reset:A}}}),Ie=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}=z(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=B(r),_=H(o),v=B(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[De(o)]:ye(o)),x=p!==`none`;!d&&x&&b.push(...Ee(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=ve(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`||_===H(t)||T.every(e=>H(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=H(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{}}}};function Le(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Re(e){return ue.some(t=>e[t]>=0)}var ze=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=z(e,t);switch(i){case`referenceHidden`:{let e=Le(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Re(e)}}}case`escaped`:{let e=Le(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Re(e)}}}default:return{}}}}},Be=new Set([`left`,`top`]);async function Ve(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=B(n),s=V(n),c=H(n)===`y`,l=Be.has(o)?-1:1,u=a&&c?-1:1,d=z(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 He=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 Ve(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}}}}},Ue=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}=z(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=H(i),p=he(f),m=u[p],h=u[f],g=(e,t)=>me(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}}}}}},We=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}=z(e,t),u={x:n,y:r},d=H(i),f=he(d),p=u[f],m=u[d],h=z(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=Be.has(B(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}}}},Ge=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}=z(e,t),c=await i.detectOverflow(t,s),l=B(n),u=V(n),d=H(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=I(p-c[m],g),y=I(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*L(c.left,c.right):S=p-2*L(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 Ke(){return typeof window<`u`}function qe(e){return Je(e)?(e.nodeName||``).toLowerCase():`#document`}function U(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function W(e){return((Je(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Je(e){return Ke()?e instanceof Node||e instanceof U(e).Node:!1}function G(e){return Ke()?e instanceof Element||e instanceof U(e).Element:!1}function K(e){return Ke()?e instanceof HTMLElement||e instanceof U(e).HTMLElement:!1}function Ye(e){return!Ke()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof U(e).ShadowRoot}function Xe(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=J(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Ze(e){return/^(table|td|th)$/.test(qe(e))}function Qe(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var $e=/transform|translate|scale|rotate|perspective|filter/,et=/paint|layout|strict|content/,q=e=>!!e&&e!==`none`,tt;function nt(e){let t=G(e)?J(e):e;return q(t.transform)||q(t.translate)||q(t.scale)||q(t.rotate)||q(t.perspective)||!it()&&(q(t.backdropFilter)||q(t.filter))||$e.test(t.willChange||``)||et.test(t.contain||``)}function rt(e){let t=Y(e);for(;K(t)&&!at(t);){if(nt(t))return t;if(Qe(t))return null;t=Y(t)}return null}function it(){return tt??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),tt}function at(e){return/^(html|body|#document)$/.test(qe(e))}function J(e){return U(e).getComputedStyle(e)}function ot(e){return G(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Y(e){if(qe(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Ye(e)&&e.host||W(e);return Ye(t)?t.host:t}function st(e){let t=Y(e);return at(t)?(e.ownerDocument||e).body:K(t)&&Xe(t)?t:st(t)}function ct(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=st(e),i=r===e.ownerDocument?.body,a=U(r);if(i){let e=lt(a);return t.concat(a,a.visualViewport||[],Xe(r)?r:[],e&&n?ct(e):[])}return t.concat(r,ct(r,[],n))}function lt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ut(e){let t=J(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=K(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=de(n)!==a||de(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function dt(e){return G(e)?e:e.contextElement}function ft(e){let t=dt(e);if(!K(t))return R(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=ut(t),o=(a?de(n.width):n.width)/r,s=(a?de(n.height):n.height)/i;return o&&Number.isFinite(o)||(o=1),s&&Number.isFinite(s)||(s=1),{x:o,y:s}}var pt=R(0);function mt(e){let t=U(e);return!it()||!t.visualViewport?pt:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ht(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===U(e)}function X(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=dt(e),o=R(1);t&&(r?G(r)&&(o=ft(r)):o=ft(e));let s=ht(a,n,r)?mt(a):R(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=U(a),t=G(r)?U(r):r,n=e,i=lt(n);for(;i&&t!==n;){let e=ft(i),t=i.getBoundingClientRect(),r=J(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=U(i),i=lt(n)}}return Ae({width:u,height:d,x:c,y:l})}function gt(e,t){let n=ot(e).scrollLeft;return t?t.left+n:X(W(e)).left+n}function _t(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-gt(e,n),y:n.top+t.scrollTop}}function vt(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=W(r),s=t?Qe(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=R(1),u=R(0),d=K(r);if((d||!a)&&((qe(r)!==`body`||Xe(o))&&(c=ot(r)),d)){let e=X(r);l=ft(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?_t(o,c):R(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 yt(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function bt(e){let t=ot(e),n=e.ownerDocument.body,r=L(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=L(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+gt(e),o=-t.scrollTop;return J(n).direction===`rtl`&&(a+=L(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var xt=25;function St(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=U(e),a=W(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!it()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(gt(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<=xt&&(s-=o)}return{width:s,height:c,x:l,y:u}}function Ct(e,t){let n=X(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=ft(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function wt(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=St(e,n,t);else if(t===`document`)r=bt(W(e));else if(G(t))r=Ct(t,n);else{let n=mt(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Ae(r)}function Tt(e,t){let n=t.get(e);if(n)return n;let r=ct(e,[],!1).filter(e=>G(e)&&qe(e)!==`body`),i=null,a=J(e).position===`fixed`,o=a?Y(e):e;for(;G(o)&&!at(o);){let e=J(o),t=nt(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=Y(o)}return t.set(e,r),r}function Et(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Qe(t)?[]:Tt(t,this._c):[].concat(n),r],o=wt(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=wt(t,a[e],i);s=L(n.top,s),c=I(n.right,c),l=I(n.bottom,l),u=L(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Dt(e){let{width:t,height:n}=ut(e);return{width:t,height:n}}function Ot(e,t,n){let r=K(t),i=W(t),a=n===`fixed`,o=X(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=R(0);if((r||!a)&&((qe(t)!==`body`||Xe(i))&&(s=ot(t)),r)){let e=X(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=gt(i));let l=i&&!r&&!a?_t(i,s):R(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 kt(e){return J(e).position===`static`}function At(e,t){if(!K(e)||J(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return W(e)===n&&(n=n.ownerDocument.body),n}function jt(e,t){let n=U(e);if(Qe(e))return n;if(!K(e)){let t=Y(e);for(;t&&!at(t);){if(G(t)&&!kt(t))return t;t=Y(t)}return n}let r=At(e,t);for(;r&&Ze(r)&&kt(r);)r=At(r,t);return r&&at(r)&&kt(r)&&!nt(r)?n:r||rt(e)||n}var Mt=async function(e){let t=this.getOffsetParent||jt,n=this.getDimensions,r=await n(e.floating);return{reference:Ot(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Nt(e){return J(e).direction===`rtl`}var Pt={convertOffsetParentRelativeRectToViewportRelativeRect:vt,getDocumentElement:W,getClippingRect:Et,getOffsetParent:jt,getElementRects:Mt,getClientRects:yt,getDimensions:Dt,getScale:ft,isElement:G,isRTL:Nt};function Ft(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function It(e,t,n){let r=null,i,a=W(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=fe(d),h=fe(a.clientWidth-(u+f)),g=fe(a.clientHeight-(d+p)),_=fe(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:L(0,I(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!Ft(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=U(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function Lt(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=dt(e),u=i||a?[...l?ct(l):[],...t?ct(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?It(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?X(e):null;c&&g();function g(){let t=X(e);h&&!Ft(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 Rt=He,zt=Ue,Bt=Ie,Vt=Ge,Ht=ze,Ut=Fe,Wt=We,Gt=(e,t,n)=>{let r=new Map,i=n??{},a={...Pt,...i.platform,_c:r};return Pe(e,t,{...i,platform:a})},Kt=typeof document<`u`?P.useLayoutEffect:function(){};function qt(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(!qt(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)&&!qt(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Jt(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Yt(e,t){let n=Jt(e);return Math.round(t*n)/n}function Xt(e){let t=P.useRef(e);return Kt(()=>{t.current=e}),t}function Zt(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]=P.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=P.useState(r);qt(f,r)||p(r);let[m,h]=P.useState(null),[g,_]=P.useState(null),v=P.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=P.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=P.useRef(null),C=P.useRef(null),w=P.useRef(u),T=c!=null,E=Xt(c),D=Xt(i),ee=Xt(l),O=P.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),Gt(S.current,C.current,e).then(e=>{let t={...e,isPositioned:ee.current!==!1};k.current&&!qt(w.current,t)&&(w.current=t,N.flushSync(()=>{d(t)}))})},[f,t,n,D,ee]);Kt(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let k=P.useRef(!1);Kt(()=>(k.current=!0,()=>{k.current=!1}),[]),Kt(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,O);O()}},[b,x,O,E,T]);let A=P.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),j=P.useMemo(()=>({reference:b,floating:x}),[b,x]),te=P.useMemo(()=>{let e={position:n,left:0,top:0};if(!j.floating)return e;let t=Yt(j.floating,u.x),r=Yt(j.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Jt(j.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,j.floating,u.x,u.y]);return P.useMemo(()=>({...u,update:O,refs:A,elements:j,floatingStyles:te}),[u,O,A,j,te])}var Qt=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:Ut({element:r.current,padding:i}).fn(n):r?Ut({element:r,padding:i}).fn(n):{}}}},$t=(e,t)=>{let n=Rt(e);return{name:n.name,fn:n.fn,options:[e,t]}},en=(e,t)=>{let n=zt(e);return{name:n.name,fn:n.fn,options:[e,t]}},tn=(e,t)=>({fn:Wt(e).fn,options:[e,t]}),nn=(e,t)=>{let n=Bt(e);return{name:n.name,fn:n.fn,options:[e,t]}},rn=(e,t)=>{let n=Vt(e);return{name:n.name,fn:n.fn,options:[e,t]}},an=(e,t)=>{let n=Ht(e);return{name:n.name,fn:n.fn,options:[e,t]}},on=(e,t)=>{let n=Qt(e);return{name:n.name,fn:n.fn,options:[e,t]}},sn=Object.defineProperty,Z=(e,t)=>sn(e,`name`,{value:t,configurable:!0}),cn={Partial:`partial`,Always:`always`},ln={Optimized:`optimized`,Always:`always`},un=`Popper`,[dn,fn]=_(un),[pn,mn]=dn(un),hn=Z(e=>{let{__scopePopper:t,children:n}=e,[r,i]=P.useState(null),[a,o]=P.useState(void 0);return(0,F.jsx)(pn,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},`Popper`),gn=`PopperAnchor`,_n=P.forwardRef(Z(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,a=mn(gn,n),o=P.useRef(null),s=a.onAnchorChange,c=P.useCallback(e=>{o.current=e,e&&s(e)},[s]),l=d(t,c),u=P.useRef(null);P.useEffect(()=>{if(!r)return;let e=u.current;u.current=r.current,e!==u.current&&s(u.current)});let p=a.placementState&&wn(a.placementState),m=p?.[0],h=p?.[1];return r?null:(0,F.jsx)(f.div,{"data-radix-popper-side":m,"data-radix-popper-align":h,...i,ref:l})},`PopperAnchor`)),vn=`PopperContent`,[yn,bn]=dn(vn),xn=P.forwardRef(Z(function(e,t){let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:m=cn.Partial,hideWhenDetached:h=!1,updatePositionStrategy:_=ln.Optimized,onPlaced:v,...y}=e,b=mn(vn,n),[S,C]=P.useState(null),w=d(t,C),[T,E]=P.useState(null),D=p(T),ee=D?.width??0,O=D?.height??0,k=r+(a===`center`?``:`-`+a),A=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},j=Array.isArray(l)?l:[l],te=j.length>0,M={padding:A,boundary:j.filter(Sn),altBoundary:te},{refs:ne,floatingStyles:re,placement:ie,isPositioned:ae,middlewareData:N}=Zt({strategy:`fixed`,placement:k,whileElementsMounted:Z((...e)=>Lt(...e,{animationFrame:_===ln.Always}),`whileElementsMounted`),elements:{reference:b.anchor},middleware:[$t({mainAxis:i+O,alignmentAxis:o}),c&&en({mainAxis:!0,crossAxis:!1,...m===cn.Partial?{limiter:tn()}:{},...M}),c&&nn({...M}),rn({...M,apply:Z(({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)},`apply`)}),T&&on({element:T,padding:s}),Cn({arrowWidth:ee,arrowHeight:O}),h&&an(te?{strategy:`referenceHidden`,...M}:{strategy:`referenceHidden`,padding:M.padding,altBoundary:M.altBoundary})]}),oe=b.setPlacementState;x(()=>(oe(ie),()=>{oe(void 0)}),[ie,oe]);let[se,ce]=wn(ie),le=g(v);x(()=>{ae&&le?.()},[ae,le]);let ue=N.arrow?.x,I=N.arrow?.y,L=N.arrow?.centerOffset!==0,[de,fe]=P.useState();return x(()=>{S&&fe(window.getComputedStyle(S).zIndex)},[S]),(0,F.jsx)(`div`,{ref:ne.setFloating,"data-radix-popper-content-wrapper":``,style:{...re,transform:ae?re.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:de,"--radix-popper-transform-origin":[N.transformOrigin?.x,N.transformOrigin?.y].join(` `),...N.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,F.jsx)(yn,{scope:n,placedSide:se,placedAlign:ce,onArrowChange:E,arrowX:ue,arrowY:I,shouldHideArrow:L,children:(0,F.jsx)(f.div,{"data-side":se,"data-align":ce,...y,ref:w,style:{...y.style,animation:ae?y.style?.animation:`none`}})})})},`PopperContent`));function Sn(e){return e!==null}Z(Sn,`isNotNull`);var Cn=Z(e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=wn(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}}),`transformOrigin`);function wn(e){let[t,n=`center`]=e.split(`-`);return[t,n]}Z(wn,`getSideAndAlignFromPlacement`);var Tn=Object.defineProperty,Q=(e,t)=>Tn(e,`name`,{value:t,configurable:!0}),[En,Dn]=_(`Tooltip`,[fn]),On=fn(),kn=`TooltipProvider`,An=700,jn=`tooltip.open`,[Mn,Nn]=En(kn),Pn=Q(e=>{let{__scopeTooltip:t,delayDuration:n=An,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=P.useRef(!0),s=P.useRef(!1),c=P.useRef(0);return P.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,F.jsx)(Mn,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:P.useCallback(()=>{r<=0||(window.clearTimeout(c.current),o.current=!1)},[r]),onClose:P.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r))},[r]),isPointerInTransitRef:s,onPointerInTransitChange:P.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})},`TooltipProvider`),Fn=`Tooltip`,[In,Ln]=En(Fn),Rn=Q(e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=Nn(Fn,e.__scopeTooltip),l=On(t),[u,d]=P.useState(null),[f,p]=P.useState(void 0),m=S(),h=P.useRef(0),g=o??c.disableHoverableContent,_=s??c.delayDuration,v=P.useRef(!1),[y,x]=b({prop:r,defaultProp:i??!1,onChange:Q(e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(jn))):c.onClose(),a?.(e)},`onChange`),caller:Fn}),C=P.useMemo(()=>y?v.current?`delayed-open`:`instant-open`:`closed`,[y]),w=P.useCallback(()=>{window.clearTimeout(h.current),h.current=0,v.current=!1,x(!0)},[x]),T=P.useCallback(()=>{window.clearTimeout(h.current),h.current=0,x(!1)},[x]),E=P.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{v.current=!0,x(!0),h.current=0},_)},[_,x]);P.useEffect(()=>()=>{h.current&&=(window.clearTimeout(h.current),0)},[]);let D=f??m;return(0,F.jsx)(hn,{...l,children:(0,F.jsx)(In,{scope:t,contentId:D,setContentId:p,open:y,stateAttribute:C,trigger:u,onTriggerChange:d,onTriggerEnter:P.useCallback(()=>{c.isOpenDelayedRef.current?E():w()},[c.isOpenDelayedRef,E,w]),onTriggerLeave:P.useCallback(()=>{g?T():(window.clearTimeout(h.current),h.current=0)},[T,g]),onOpen:w,onClose:T,disableHoverableContent:g,children:n})})},`Tooltip`),zn=`TooltipTrigger`,Bn=P.forwardRef(Q(function(e,t){let{__scopeTooltip:n,"aria-describedby":r,...i}=e,a=Ln(zn,n),o=Nn(zn,n),s=On(n),c=P.useRef(null),l=d(t,c,a.onTriggerChange),u=P.useRef(!1),p=P.useRef(!1),m=P.useCallback(()=>u.current=!1,[]);return P.useEffect(()=>()=>document.removeEventListener(`pointerup`,m),[m]),(0,F.jsx)(_n,{asChild:!0,...s,children:(0,F.jsx)(f.button,{"aria-describedby":a.open?nr(r,a.contentId):r,"data-state":a.stateAttribute,...i,ref:l,onPointerMove:y(e.onPointerMove,e=>{e.pointerType!==`touch`&&!p.current&&!o.isPointerInTransitRef.current&&(a.onTriggerEnter(),p.current=!0)}),onPointerLeave:y(e.onPointerLeave,()=>{a.onTriggerLeave(),p.current=!1}),onPointerDown:y(e.onPointerDown,()=>{a.open&&a.onClose(),u.current=!0,document.addEventListener(`pointerup`,m,{once:!0})}),onFocus:y(e.onFocus,()=>{u.current||a.onOpen()}),onBlur:y(e.onBlur,a.onClose),onClick:y(e.onClick,a.onClose)})})},`TooltipTrigger`)),Vn=`TooltipPortal`,[Hn,Un]=En(Vn,{forceMount:void 0}),Wn=Q(e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=Ln(Vn,t);return(0,F.jsx)(Hn,{scope:t,forceMount:n,children:(0,F.jsx)(h,{present:n||a.open,children:(0,F.jsx)(C,{asChild:!0,container:i,children:r})})})},`TooltipPortal`),Gn=`TooltipContent`,Kn=P.forwardRef(Q(function(e,t){let n=Un(Gn,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=Ln(Gn,e.__scopeTooltip);return(0,F.jsx)(h,{present:r||o.open,children:o.disableHoverableContent?(0,F.jsx)(Yn,{side:i,...a,ref:t}):(0,F.jsx)(qn,{side:i,...a,ref:t})})},`TooltipContent`)),qn=P.forwardRef(Q(function(e,t){let n=Ln(Gn,e.__scopeTooltip),r=Nn(Gn,e.__scopeTooltip),i=P.useRef(null),a=d(t,i),[o,s]=P.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:f}=r,p=P.useCallback(()=>{s(null),f(!1)},[f]),m=P.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=Zn(r,Xn(r,n.getBoundingClientRect())),a=Qn(t.getBoundingClientRect()),o=er([...i,...a]);s(o),f(!0)},[f]);return P.useEffect(()=>()=>p(),[p]),P.useEffect(()=>{if(c&&u){let e=Q(e=>m(e,u),`handleTriggerLeave`),t=Q(e=>m(e,c),`handleContentLeave`);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,m,p]),P.useEffect(()=>{if(o){let e=Q(e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!$n(n,o);r?p():i&&(p(),l())},`handleTrackPointerGrace`);return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,p]),(0,F.jsx)(Yn,{...e,ref:a})},`TooltipContentHoverable`)),Jn=u(`TooltipContent`),Yn=P.forwardRef(Q(function(e,t){let{__scopeTooltip:n,children:r,"aria-label":i,id:a,onEscapeKeyDown:o,onPointerDownOutside:s,...c}=e,l=Ln(Gn,n),u=On(n),{onClose:f}=l,[p,h]=P.useState(null),g=d(t,h);m(p),P.useEffect(()=>(document.addEventListener(jn,f),()=>document.removeEventListener(jn,f)),[f]),P.useEffect(()=>{if(l.trigger){let e=Q(e=>{e.target instanceof Node&&e.target.contains(l.trigger)&&f()},`handleScroll`);return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[l.trigger,f]);let{setContentId:_}=l;return x(()=>(_(a),()=>{_(void 0)}),[a,_]),(0,F.jsx)(v,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:f,children:(0,F.jsxs)(xn,{"data-state":l.stateAttribute,role:i?void 0:`tooltip`,id:i?void 0:l.contentId,...u,...c,ref:g,style:{...c.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,F.jsx)(Jn,{children:r}),i?(0,F.jsx)(le,{id:l.contentId,role:`tooltip`,children:i}):null]})})},`TooltipContentImpl`));function Xn(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}Q(Xn,`getExitSideFromRect`);function Zn(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return r}Q(Zn,`getPaddedExitPoints`);function Qn(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}Q(Qn,`getPointsFromRect`);function $n(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}Q($n,`isPointInPolygon`);function er(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),tr(t)}Q(er,`getHull`);function tr(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}Q(tr,`getHullPresorted`);function nr(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}Q(nr,`concatAriaDescribedby`);var rr={all:()=>s.alerts.key(),lists:()=>s.alerts.list.key(),list:e=>s.alerts.list.key({input:e}),details:()=>s.alerts.key({type:`query`}),detail:e=>s.alerts.get.key({input:{id:e}}),stats:()=>s.alerts.getStats.key()},ir={all:()=>s.incidents.key(),lists:()=>s.incidents.list.key(),list:e=>s.incidents.list.key({input:e}),detail:e=>s.incidents.get.key({input:{id:e}})};function ar(){let e=i();return c({...s.incidents.create.mutationOptions(),onSuccess:()=>{e.invalidateQueries({queryKey:ir.lists()})}})}function or(){let e=i();return c({...s.incidents.update.mutationOptions(),onSuccess:t=>{e.invalidateQueries({queryKey:ir.lists()}),e.setQueryData(ir.detail(t.id),t)}})}function sr(){let e=i();return c({...s.incidents.investigate.mutationOptions(),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:ir.detail(n.id)})}})}var $={all:()=>s.integrations.key(),templates:{all:()=>s.integrations.listTemplates.key(),detail:e=>s.integrations.getTemplate.key({input:{id:e}})},integrations:{all:()=>s.integrations.listIntegrations.key(),detail:e=>s.integrations.getIntegration.key({input:{id:e}})},connections:{all:()=>s.integrations.listConnections.key(),list:e=>s.integrations.listConnections.key({input:e??{}}),detail:e=>s.integrations.getConnection.key({input:{id:e}})}};function cr(){return a(s.integrations.listTemplates.queryOptions({input:{}}))}function lr(e){return a(s.integrations.listIntegrations.queryOptions({input:e??{}}))}function ur(){let e=i();return c({...s.integrations.createIntegration.mutationOptions(),onSuccess:()=>{e.invalidateQueries({queryKey:$.integrations.all()})}})}function dr(){let e=i();return c({...s.integrations.deleteIntegration.mutationOptions(),onSuccess:()=>{e.invalidateQueries({queryKey:$.integrations.all()})}})}function fr(e){return a({...s.integrations.getConnectionDeletionImpact.queryOptions({input:{id:e??``}}),enabled:!!e})}function pr(e){return a(s.integrations.listConnections.queryOptions({input:e??{}}))}function mr(){let e=i();return c({...s.integrations.createConnection.mutationOptions(),onSuccess:()=>{e.invalidateQueries({queryKey:$.connections.all()})}})}function hr(){let e=i();return c({...s.integrations.updateConnection.mutationOptions(),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:$.connections.all()}),e.invalidateQueries({queryKey:$.connections.detail(n.id)}),e.invalidateQueries({queryKey:s.sources.key()})}})}function gr(){let e=i();return c({...s.integrations.deleteConnection.mutationOptions(),onSuccess:()=>{e.invalidateQueries({queryKey:$.connections.all()}),e.invalidateQueries({queryKey:s.sources.key()})}})}function _r(){let e=i();return c({...s.integrations.testConnection.mutationOptions(),onSettled:()=>{e.invalidateQueries({queryKey:$.connections.all()}),e.invalidateQueries({queryKey:s.sources.key()})}})}var vr={forService:e=>s.integrations.getServiceIntegrations.key({input:{serviceId:e}})};function yr(e){return a({...s.integrations.getServiceIntegrations.queryOptions({input:{serviceId:e}}),enabled:!!e})}function br(){let e=i();return c({...s.integrations.createServiceIntegration.mutationOptions(),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:vr.forService(n.serviceId)}),e.invalidateQueries({queryKey:s.sources.key()})}})}function xr(){let e=i();return c({...s.integrations.setServiceIntegrationOrder.mutationOptions(),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:vr.forService(n.serviceId)}),e.invalidateQueries({queryKey:s.sources.key()})}})}function Sr(){let e=i();return c({...s.integrations.updateServiceIntegration.mutationOptions(),onSuccess:()=>{e.invalidateQueries({queryKey:s.integrations.key()}),e.invalidateQueries({queryKey:s.sources.key()})}})}function Cr(){let e=i();return c({...s.integrations.deleteServiceIntegration.mutationOptions(),onSuccess:()=>{e.invalidateQueries({queryKey:s.integrations.key()}),e.invalidateQueries({queryKey:s.sources.key()})}})}var wr={all:()=>s.investigations.key(),lists:()=>s.investigations.list.key(),list:e=>s.investigations.list.key({input:e}),detail:e=>s.investigations.get.key({input:{id:e}}),status:e=>s.investigations.getStatus.key({input:{id:e}}),byIncident:e=>s.investigations.list.key({input:{incidentId:e}})};function Tr(){let e=i();return c({...s.investigations.cancel.mutationOptions(),onSuccess:t=>{e.invalidateQueries({queryKey:wr.lists()}),e.setQueryData(wr.detail(t.id),t)}})}function Er(){let e=i();return c({...s.investigations.resume.mutationOptions(),onSuccess:t=>{e.invalidateQueries({queryKey:wr.detail(t.id)}),e.invalidateQueries({queryKey:wr.lists()}),e.invalidateQueries({queryKey:ir.all()})}})}function Dr(){return a({...s.investigations.restartSummary.queryOptions({input:{}}),staleTime:1/0,refetchOnWindowFocus:!1})}function Or(){return c(s.investigations.message.mutationOptions())}function kr(){return c(s.investigations.answerAsk.mutationOptions())}var Ar={status:()=>s.settings.harnesses.getHarnesses.key(),settings:()=>s.settings.harnesses.getSettings.key()};function jr(){return a({...s.settings.harnesses.getHarnesses.queryOptions({input:{}}),retryOnMount:!1})}function Mr(){return a(s.settings.harnesses.getSettings.queryOptions({input:{}}))}function Nr(){let e=i();return c({...s.settings.harnesses.updateSettings.mutationOptions(),onSuccess:()=>{e.invalidateQueries({queryKey:Ar.settings()}),e.invalidateQueries({queryKey:Ar.status()})}})}function Pr(){let e=i();return c({...s.settings.harnesses.checkHarness.mutationOptions(),onSuccess:()=>e.invalidateQueries({queryKey:Ar.status()})})}function Fr(){let{data:e,isLoading:t,isError:n}=jr(),r=e?.selection;if(r?.runnable)return{isReady:!0,blockedReason:void 0,isLoading:!1};let i=t?`Checking whether a coding agent is usable…`:n?`Could not check agent status — retry from Settings → Agent.`:`No coding agent is available — see Settings → Agent.`;return{isReady:!1,blockedReason:r?.blockedReason??i,isLoading:t}}function Ir(){let e=i();return c({...s.settings.danger.resetData.mutationOptions(),onSuccess:()=>{e.invalidateQueries()}})}function Lr(){return c({...s.settings.danger.factoryReset.mutationOptions()})}function Rr(){return a({...s.setup.getStatus.queryOptions({input:{}}),staleTime:1e4})}var zr={all:()=>s.timeline.key(),lists:()=>s.timeline.list.key(),list:(e,t)=>s.timeline.list.key({input:{incidentId:e,...t}}),detail:e=>s.timeline.get.key({input:{id:e}})};function Br(e,t){return a({...s.timeline.list.queryOptions({input:{incidentId:e,...t}}),enabled:!!e})}function Vr(){let e=i();return c({...s.timeline.create.mutationOptions(),onSuccess:t=>{e.invalidateQueries({queryKey:zr.list(t.incidentId)})}})}var Hr=Pn,Ur=Rn,Wr=Bn,Gr=P.forwardRef(({className:e,sideOffset:t=6,...n},r)=>(0,F.jsx)(Wn,{children:(0,F.jsx)(Kn,{ref:r,sideOffset:t,"data-float":`tip`,className:l(`pointer-events-none z-50 max-w-[280px] rounded-control bg-surface-4 px-2 py-1 text-meta text-text-1 shadow-float [@media(hover:none)]:hidden`,e),...n})}));Gr.displayName=Kn.displayName;function Kr({label:e,meta:t,keys:n,side:r=`bottom`,when:i=!0,open:a=!1,children:o}){let[s,c]=(0,P.useState)(!1),[l,u]=(0,P.useState)(!1);return!a&&l&&u(!1),i?(0,F.jsxs)(Ur,{disableHoverableContent:!0,open:s||a&&!l,onOpenChange:c,children:[(0,F.jsx)(Wr,{asChild:!0,children:o}),(0,F.jsxs)(Gr,{side:r,"data-testid":`hint`,onEscapeKeyDown:()=>a&&u(!0),children:[(0,F.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,F.jsx)(`span`,{className:`min-w-0`,children:e}),n?.map(e=>(0,F.jsx)(`kbd`,{className:`font-mono text-meta font-medium text-text-2`,"data-testid":`hint-key`,children:e},e))]}),t&&(0,F.jsx)(`span`,{className:`block text-text-2`,"data-testid":`hint-meta`,children:t})]})]}):o}export{T as $,xr as A,hn as B,ur as C,Cr as D,dr as E,ir as F,le as G,xn as H,ar as I,k as J,M as K,sr as L,_r as M,hr as N,lr as O,Sr as P,D as Q,or as R,mr as S,gr as T,fn as U,_n as V,ce as W,j as X,ie as Y,ae as Z,Dr as _,Br as a,fr as b,Lr as c,Fr as d,Ir as f,Tr as g,kr as h,Vr as i,cr as j,yr as k,Mr as l,wr as m,Hr as n,Rr as o,Nr as p,A as q,zr as r,Pr as s,Kr as t,jr as u,Er as v,br as w,pr as x,Or as y,rr as z};
|
|
1
|
+
import{a as e,n as t,t as n}from"./jsx-runtime-Wy9s6hX0.js";import{t as r}from"./react-dom-g7hNCJoM.js";import{Xt as i,_t as a,a as o,c as s,gt as c}from"./desktop-yb-lqHMd.js";import{t as l}from"./utils-A3okWeke.js";import{i as u,o as d}from"./button-DmIfWVZ8.js";import{$ as f,E as p,H as m,J as h,K as g,Q as _,W as v,X as y,Y as b,Z as x,q as S,z as C}from"./use-repositories-orpc-Ban_zGD7.js";var w={name:`chevron-down`,size:24,node:[[`path`,{d:`m6 9 6 6 6-6`,key:`qrunsl`}]]};w.node;var T=o(w),E={name:`chevron-up`,size:24,node:[[`path`,{d:`m18 15-6-6-6 6`,key:`153udz`}]]};E.node;var D=o(E),ee=new Intl.DateTimeFormat(void 0,{dateStyle:`medium`,timeStyle:`short`}),O=new Intl.DateTimeFormat(void 0,{dateStyle:`medium`});function k(e){return ee.format(new Date(e))}function A(e){return O.format(new Date(e))}function j(e){let t=Math.max(0,Math.floor(e));return t<60?`${t}s`:t<3600?`${Math.floor(t/60)}m ${String(t%60).padStart(2,`0`)}s`:`${Math.floor(t/3600)}h ${String(Math.floor(t%3600/60)).padStart(2,`0`)}m`}var te=new Intl.DateTimeFormat(void 0,{hour:`2-digit`,minute:`2-digit`,hour12:!1});function M(e){return te.format(new Date(e))}var ne=new Intl.DateTimeFormat(void 0,{weekday:`short`}),re=5184e5;function ie(e,t){let n=new Date(e),r=new Date(t);r.setHours(0,0,0,0);let i=M(n);return n.getTime()>=r.getTime()?i:r.getTime()-n.getTime()<=re?`${ne.format(n)} ${i}`:`${A(n)} ${i}`}function ae(e){let t=e.recurrence.type===`cron`?e.recurrence.timezone:void 0;if(!t)return e.description;try{let n=new Intl.DateTimeFormat(`en-US`,{timeZone:t,timeZoneName:`short`}).formatToParts(new Date).find(e=>e.type===`timeZoneName`)?.value;return n?`${e.description} ${n}`:e.description}catch{return e.description}}var N=e(r(),1),P=e(t(),1),F=n(),oe=Object.defineProperty,se=(e,t)=>oe(e,`name`,{value:t,configurable:!0}),ce=Object.freeze({position:`absolute`,border:0,width:1,height:1,padding:0,margin:-1,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,wordWrap:`normal`}),le=P.forwardRef(se(function(e,t){return(0,F.jsx)(f.span,{...e,ref:t,style:{...ce,...e.style}})},`VisuallyHidden`)),ue=[`top`,`right`,`bottom`,`left`],I=Math.min,L=Math.max,de=Math.round,fe=Math.floor,R=e=>({x:e,y:e}),pe={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function me(e,t,n){return L(e,I(t,n))}function z(e,t){return typeof e==`function`?e(t):e}function B(e){return e.split(`-`)[0]}function V(e){return e.split(`-`)[1]}function he(e){return e===`x`?`y`:`x`}function ge(e){return e===`y`?`height`:`width`}function H(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function _e(e){return he(H(e))}function ve(e,t,n){n===void 0&&(n=!1);let r=V(e),i=_e(e),a=ge(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=De(o)),[o,De(o)]}function ye(e){let t=De(e);return[be(e),t,be(t)]}function be(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var xe=[`left`,`right`],Se=[`right`,`left`],Ce=[`top`,`bottom`],we=[`bottom`,`top`];function Te(e,t,n){switch(e){case`top`:case`bottom`:return n?t?Se:xe:t?xe:Se;case`left`:case`right`:return t?Ce:we;default:return[]}}function Ee(e,t,n,r){let i=V(e),a=Te(B(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(be)))),a}function De(e){let t=B(e);return pe[t]+e.slice(t.length)}function Oe(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function ke(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:Oe(e)}function Ae(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 je(e,t,n){let{reference:r,floating:i}=e,a=H(t),o=_e(t),s=ge(o),c=B(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=V(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function Me(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}=z(t,e),p=ke(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=Ae(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=Ae(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 Ne=50,Pe=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:Me},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=je(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<Ne&&(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}=je(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},Fe=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}=z(e,t)||{};if(l==null)return{};let d=ke(u),f={x:n,y:r},p=_e(i),m=ge(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=await(o.getOffsetParent==null?void 0:o.getOffsetParent(l)),C=S?S[y]:0;C&&await(o.isElement==null?void 0:o.isElement(S))||(C=s.floating[y]||a.floating[m]);let w=b/2-x/2,T=C/2-h[m]/2-1,E=I(d[_],T),D=I(d[v],T),ee=C-h[m]-D,O=C/2-h[m]/2+w,k=me(E,O,ee),A=!c.arrow&&V(i)!=null&&O!==k&&a.reference[m]/2-(O<E?E:D)-h[m]/2<0,j=A?O<E?O-E:O-ee:0;return{[p]:f[p]+j,data:{[p]:k,centerOffset:O-k-j,...A&&{alignmentOffset:j}},reset:A}}}),Ie=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}=z(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=B(r),_=H(o),v=B(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[De(o)]:ye(o)),x=p!==`none`;!d&&x&&b.push(...Ee(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=ve(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`||_===H(t)||T.every(e=>H(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=H(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{}}}};function Le(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Re(e){return ue.some(t=>e[t]>=0)}var ze=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=z(e,t);switch(i){case`referenceHidden`:{let e=Le(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Re(e)}}}case`escaped`:{let e=Le(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Re(e)}}}default:return{}}}}},Be=new Set([`left`,`top`]);async function Ve(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=B(n),s=V(n),c=H(n)===`y`,l=Be.has(o)?-1:1,u=a&&c?-1:1,d=z(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 He=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 Ve(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}}}}},Ue=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}=z(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=H(i),p=he(f),m=u[p],h=u[f],g=(e,t)=>me(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}}}}}},We=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}=z(e,t),u={x:n,y:r},d=H(i),f=he(d),p=u[f],m=u[d],h=z(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=Be.has(B(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}}}},Ge=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}=z(e,t),c=await i.detectOverflow(t,s),l=B(n),u=V(n),d=H(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=I(p-c[m],g),y=I(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*L(c.left,c.right):S=p-2*L(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 Ke(){return typeof window<`u`}function qe(e){return Je(e)?(e.nodeName||``).toLowerCase():`#document`}function U(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function W(e){return((Je(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Je(e){return Ke()?e instanceof Node||e instanceof U(e).Node:!1}function G(e){return Ke()?e instanceof Element||e instanceof U(e).Element:!1}function K(e){return Ke()?e instanceof HTMLElement||e instanceof U(e).HTMLElement:!1}function Ye(e){return!Ke()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof U(e).ShadowRoot}function Xe(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=J(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Ze(e){return/^(table|td|th)$/.test(qe(e))}function Qe(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var $e=/transform|translate|scale|rotate|perspective|filter/,et=/paint|layout|strict|content/,q=e=>!!e&&e!==`none`,tt;function nt(e){let t=G(e)?J(e):e;return q(t.transform)||q(t.translate)||q(t.scale)||q(t.rotate)||q(t.perspective)||!it()&&(q(t.backdropFilter)||q(t.filter))||$e.test(t.willChange||``)||et.test(t.contain||``)}function rt(e){let t=Y(e);for(;K(t)&&!at(t);){if(nt(t))return t;if(Qe(t))return null;t=Y(t)}return null}function it(){return tt??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),tt}function at(e){return/^(html|body|#document)$/.test(qe(e))}function J(e){return U(e).getComputedStyle(e)}function ot(e){return G(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Y(e){if(qe(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Ye(e)&&e.host||W(e);return Ye(t)?t.host:t}function st(e){let t=Y(e);return at(t)?(e.ownerDocument||e).body:K(t)&&Xe(t)?t:st(t)}function ct(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=st(e),i=r===e.ownerDocument?.body,a=U(r);if(i){let e=lt(a);return t.concat(a,a.visualViewport||[],Xe(r)?r:[],e&&n?ct(e):[])}return t.concat(r,ct(r,[],n))}function lt(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ut(e){let t=J(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=K(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=de(n)!==a||de(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function dt(e){return G(e)?e:e.contextElement}function ft(e){let t=dt(e);if(!K(t))return R(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=ut(t),o=(a?de(n.width):n.width)/r,s=(a?de(n.height):n.height)/i;return o&&Number.isFinite(o)||(o=1),s&&Number.isFinite(s)||(s=1),{x:o,y:s}}var pt=R(0);function mt(e){let t=U(e);return!it()||!t.visualViewport?pt:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function ht(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===U(e)}function X(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=dt(e),o=R(1);t&&(r?G(r)&&(o=ft(r)):o=ft(e));let s=ht(a,n,r)?mt(a):R(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=U(a),t=G(r)?U(r):r,n=e,i=lt(n);for(;i&&t!==n;){let e=ft(i),t=i.getBoundingClientRect(),r=J(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=U(i),i=lt(n)}}return Ae({width:u,height:d,x:c,y:l})}function gt(e,t){let n=ot(e).scrollLeft;return t?t.left+n:X(W(e)).left+n}function _t(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-gt(e,n),y:n.top+t.scrollTop}}function vt(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=W(r),s=t?Qe(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=R(1),u=R(0),d=K(r);if((d||!a)&&((qe(r)!==`body`||Xe(o))&&(c=ot(r)),d)){let e=X(r);l=ft(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?_t(o,c):R(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 yt(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function bt(e){let t=ot(e),n=e.ownerDocument.body,r=L(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=L(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+gt(e),o=-t.scrollTop;return J(n).direction===`rtl`&&(a+=L(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var xt=25;function St(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=U(e),a=W(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!it()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(gt(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<=xt&&(s-=o)}return{width:s,height:c,x:l,y:u}}function Ct(e,t){let n=X(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=ft(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function wt(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=St(e,n,t);else if(t===`document`)r=bt(W(e));else if(G(t))r=Ct(t,n);else{let n=mt(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Ae(r)}function Tt(e,t){let n=t.get(e);if(n)return n;let r=ct(e,[],!1).filter(e=>G(e)&&qe(e)!==`body`),i=null,a=J(e).position===`fixed`,o=a?Y(e):e;for(;G(o)&&!at(o);){let e=J(o),t=nt(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=Y(o)}return t.set(e,r),r}function Et(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Qe(t)?[]:Tt(t,this._c):[].concat(n),r],o=wt(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=wt(t,a[e],i);s=L(n.top,s),c=I(n.right,c),l=I(n.bottom,l),u=L(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function Dt(e){let{width:t,height:n}=ut(e);return{width:t,height:n}}function Ot(e,t,n){let r=K(t),i=W(t),a=n===`fixed`,o=X(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=R(0);if((r||!a)&&((qe(t)!==`body`||Xe(i))&&(s=ot(t)),r)){let e=X(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=gt(i));let l=i&&!r&&!a?_t(i,s):R(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 kt(e){return J(e).position===`static`}function At(e,t){if(!K(e)||J(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return W(e)===n&&(n=n.ownerDocument.body),n}function jt(e,t){let n=U(e);if(Qe(e))return n;if(!K(e)){let t=Y(e);for(;t&&!at(t);){if(G(t)&&!kt(t))return t;t=Y(t)}return n}let r=At(e,t);for(;r&&Ze(r)&&kt(r);)r=At(r,t);return r&&at(r)&&kt(r)&&!nt(r)?n:r||rt(e)||n}var Mt=async function(e){let t=this.getOffsetParent||jt,n=this.getDimensions,r=await n(e.floating);return{reference:Ot(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Nt(e){return J(e).direction===`rtl`}var Pt={convertOffsetParentRelativeRectToViewportRelativeRect:vt,getDocumentElement:W,getClippingRect:Et,getOffsetParent:jt,getElementRects:Mt,getClientRects:yt,getDimensions:Dt,getScale:ft,isElement:G,isRTL:Nt};function Ft(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function It(e,t,n){let r=null,i,a=W(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=fe(d),h=fe(a.clientWidth-(u+f)),g=fe(a.clientHeight-(d+p)),_=fe(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:L(0,I(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!Ft(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=U(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function Lt(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=dt(e),u=i||a?[...l?ct(l):[],...t?ct(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?It(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?X(e):null;c&&g();function g(){let t=X(e);h&&!Ft(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 Rt=He,zt=Ue,Bt=Ie,Vt=Ge,Ht=ze,Ut=Fe,Wt=We,Gt=(e,t,n)=>{let r=new Map,i=n??{},a={...Pt,...i.platform,_c:r};return Pe(e,t,{...i,platform:a})},Kt=typeof document<`u`?P.useLayoutEffect:function(){};function qt(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(!qt(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)&&!qt(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Jt(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Yt(e,t){let n=Jt(e);return Math.round(t*n)/n}function Xt(e){let t=P.useRef(e);return Kt(()=>{t.current=e}),t}function Zt(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]=P.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=P.useState(r);qt(f,r)||p(r);let[m,h]=P.useState(null),[g,_]=P.useState(null),v=P.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=P.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=P.useRef(null),C=P.useRef(null),w=P.useRef(u),T=c!=null,E=Xt(c),D=Xt(i),ee=Xt(l),O=P.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};D.current&&(e.platform=D.current),Gt(S.current,C.current,e).then(e=>{let t={...e,isPositioned:ee.current!==!1};k.current&&!qt(w.current,t)&&(w.current=t,N.flushSync(()=>{d(t)}))})},[f,t,n,D,ee]);Kt(()=>{l===!1&&w.current.isPositioned&&(w.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let k=P.useRef(!1);Kt(()=>(k.current=!0,()=>{k.current=!1}),[]),Kt(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(E.current)return E.current(b,x,O);O()}},[b,x,O,E,T]);let A=P.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),j=P.useMemo(()=>({reference:b,floating:x}),[b,x]),te=P.useMemo(()=>{let e={position:n,left:0,top:0};if(!j.floating)return e;let t=Yt(j.floating,u.x),r=Yt(j.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Jt(j.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,j.floating,u.x,u.y]);return P.useMemo(()=>({...u,update:O,refs:A,elements:j,floatingStyles:te}),[u,O,A,j,te])}var Qt=e=>{function t(e){return{}.hasOwnProperty.call(e,`current`)}return{name:`arrow`,options:e,fn(n){let{element:r,padding:i}=typeof e==`function`?e(n):e;return r&&t(r)?r.current==null?{}:Ut({element:r.current,padding:i}).fn(n):r?Ut({element:r,padding:i}).fn(n):{}}}},$t=(e,t)=>{let n=Rt(e);return{name:n.name,fn:n.fn,options:[e,t]}},en=(e,t)=>{let n=zt(e);return{name:n.name,fn:n.fn,options:[e,t]}},tn=(e,t)=>({fn:Wt(e).fn,options:[e,t]}),nn=(e,t)=>{let n=Bt(e);return{name:n.name,fn:n.fn,options:[e,t]}},rn=(e,t)=>{let n=Vt(e);return{name:n.name,fn:n.fn,options:[e,t]}},an=(e,t)=>{let n=Ht(e);return{name:n.name,fn:n.fn,options:[e,t]}},on=(e,t)=>{let n=Qt(e);return{name:n.name,fn:n.fn,options:[e,t]}},sn=Object.defineProperty,Z=(e,t)=>sn(e,`name`,{value:t,configurable:!0}),cn={Partial:`partial`,Always:`always`},ln={Optimized:`optimized`,Always:`always`},un=`Popper`,[dn,fn]=_(un),[pn,mn]=dn(un),hn=Z(e=>{let{__scopePopper:t,children:n}=e,[r,i]=P.useState(null),[a,o]=P.useState(void 0);return(0,F.jsx)(pn,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})},`Popper`),gn=`PopperAnchor`,_n=P.forwardRef(Z(function(e,t){let{__scopePopper:n,virtualRef:r,...i}=e,a=mn(gn,n),o=P.useRef(null),s=a.onAnchorChange,c=P.useCallback(e=>{o.current=e,e&&s(e)},[s]),l=d(t,c),u=P.useRef(null);P.useEffect(()=>{if(!r)return;let e=u.current;u.current=r.current,e!==u.current&&s(u.current)});let p=a.placementState&&wn(a.placementState),m=p?.[0],h=p?.[1];return r?null:(0,F.jsx)(f.div,{"data-radix-popper-side":m,"data-radix-popper-align":h,...i,ref:l})},`PopperAnchor`)),vn=`PopperContent`,[yn,bn]=dn(vn),xn=P.forwardRef(Z(function(e,t){let{__scopePopper:n,side:r=`bottom`,sideOffset:i=0,align:a=`center`,alignOffset:o=0,arrowPadding:s=0,avoidCollisions:c=!0,collisionBoundary:l=[],collisionPadding:u=0,sticky:m=cn.Partial,hideWhenDetached:h=!1,updatePositionStrategy:_=ln.Optimized,onPlaced:v,...y}=e,b=mn(vn,n),[S,C]=P.useState(null),w=d(t,C),[T,E]=P.useState(null),D=p(T),ee=D?.width??0,O=D?.height??0,k=r+(a===`center`?``:`-`+a),A=typeof u==`number`?u:{top:0,right:0,bottom:0,left:0,...u},j=Array.isArray(l)?l:[l],te=j.length>0,M={padding:A,boundary:j.filter(Sn),altBoundary:te},{refs:ne,floatingStyles:re,placement:ie,isPositioned:ae,middlewareData:N}=Zt({strategy:`fixed`,placement:k,whileElementsMounted:Z((...e)=>Lt(...e,{animationFrame:_===ln.Always}),`whileElementsMounted`),elements:{reference:b.anchor},middleware:[$t({mainAxis:i+O,alignmentAxis:o}),c&&en({mainAxis:!0,crossAxis:!1,...m===cn.Partial?{limiter:tn()}:{},...M}),c&&nn({...M}),rn({...M,apply:Z(({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{let{width:i,height:a}=t.reference,o=e.floating.style;o.setProperty(`--radix-popper-available-width`,`${n}px`),o.setProperty(`--radix-popper-available-height`,`${r}px`),o.setProperty(`--radix-popper-anchor-width`,`${i}px`),o.setProperty(`--radix-popper-anchor-height`,`${a}px`)},`apply`)}),T&&on({element:T,padding:s}),Cn({arrowWidth:ee,arrowHeight:O}),h&&an(te?{strategy:`referenceHidden`,...M}:{strategy:`referenceHidden`,padding:M.padding,altBoundary:M.altBoundary})]}),oe=b.setPlacementState;x(()=>(oe(ie),()=>{oe(void 0)}),[ie,oe]);let[se,ce]=wn(ie),le=g(v);x(()=>{ae&&le?.()},[ae,le]);let ue=N.arrow?.x,I=N.arrow?.y,L=N.arrow?.centerOffset!==0,[de,fe]=P.useState();return x(()=>{S&&fe(window.getComputedStyle(S).zIndex)},[S]),(0,F.jsx)(`div`,{ref:ne.setFloating,"data-radix-popper-content-wrapper":``,style:{...re,transform:ae?re.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:de,"--radix-popper-transform-origin":[N.transformOrigin?.x,N.transformOrigin?.y].join(` `),...N.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,F.jsx)(yn,{scope:n,placedSide:se,placedAlign:ce,onArrowChange:E,arrowX:ue,arrowY:I,shouldHideArrow:L,children:(0,F.jsx)(f.div,{"data-side":se,"data-align":ce,...y,ref:w,style:{...y.style,animation:ae?y.style?.animation:`none`}})})})},`PopperContent`));function Sn(e){return e!==null}Z(Sn,`isNotNull`);var Cn=Z(e=>({name:`transformOrigin`,options:e,fn(t){let{placement:n,rects:r,middlewareData:i}=t,a=i.arrow?.centerOffset!==0,o=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[c,l]=wn(n),u={start:`0%`,center:`50%`,end:`100%`}[l],d=(i.arrow?.x??0)+o/2,f=(i.arrow?.y??0)+s/2,p=``,m=``;return c===`bottom`?(p=a?u:`${d}px`,m=`${-s}px`):c===`top`?(p=a?u:`${d}px`,m=`${r.floating.height+s}px`):c===`right`?(p=`${-s}px`,m=a?u:`${f}px`):c===`left`&&(p=`${r.floating.width+s}px`,m=a?u:`${f}px`),{data:{x:p,y:m}}}}),`transformOrigin`);function wn(e){let[t,n=`center`]=e.split(`-`);return[t,n]}Z(wn,`getSideAndAlignFromPlacement`);var Tn=Object.defineProperty,Q=(e,t)=>Tn(e,`name`,{value:t,configurable:!0}),[En,Dn]=_(`Tooltip`,[fn]),On=fn(),kn=`TooltipProvider`,An=700,jn=`tooltip.open`,[Mn,Nn]=En(kn),Pn=Q(e=>{let{__scopeTooltip:t,delayDuration:n=An,skipDelayDuration:r=300,disableHoverableContent:i=!1,children:a}=e,o=P.useRef(!0),s=P.useRef(!1),c=P.useRef(0);return P.useEffect(()=>{let e=c.current;return()=>window.clearTimeout(e)},[]),(0,F.jsx)(Mn,{scope:t,isOpenDelayedRef:o,delayDuration:n,onOpen:P.useCallback(()=>{r<=0||(window.clearTimeout(c.current),o.current=!1)},[r]),onClose:P.useCallback(()=>{r<=0||(window.clearTimeout(c.current),c.current=window.setTimeout(()=>o.current=!0,r))},[r]),isPointerInTransitRef:s,onPointerInTransitChange:P.useCallback(e=>{s.current=e},[]),disableHoverableContent:i,children:a})},`TooltipProvider`),Fn=`Tooltip`,[In,Ln]=En(Fn),Rn=Q(e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i,onOpenChange:a,disableHoverableContent:o,delayDuration:s}=e,c=Nn(Fn,e.__scopeTooltip),l=On(t),[u,d]=P.useState(null),[f,p]=P.useState(void 0),m=S(),h=P.useRef(0),g=o??c.disableHoverableContent,_=s??c.delayDuration,v=P.useRef(!1),[y,x]=b({prop:r,defaultProp:i??!1,onChange:Q(e=>{e?(c.onOpen(),document.dispatchEvent(new CustomEvent(jn))):c.onClose(),a?.(e)},`onChange`),caller:Fn}),C=P.useMemo(()=>y?v.current?`delayed-open`:`instant-open`:`closed`,[y]),w=P.useCallback(()=>{window.clearTimeout(h.current),h.current=0,v.current=!1,x(!0)},[x]),T=P.useCallback(()=>{window.clearTimeout(h.current),h.current=0,x(!1)},[x]),E=P.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{v.current=!0,x(!0),h.current=0},_)},[_,x]);P.useEffect(()=>()=>{h.current&&=(window.clearTimeout(h.current),0)},[]);let D=f??m;return(0,F.jsx)(hn,{...l,children:(0,F.jsx)(In,{scope:t,contentId:D,setContentId:p,open:y,stateAttribute:C,trigger:u,onTriggerChange:d,onTriggerEnter:P.useCallback(()=>{c.isOpenDelayedRef.current?E():w()},[c.isOpenDelayedRef,E,w]),onTriggerLeave:P.useCallback(()=>{g?T():(window.clearTimeout(h.current),h.current=0)},[T,g]),onOpen:w,onClose:T,disableHoverableContent:g,children:n})})},`Tooltip`),zn=`TooltipTrigger`,Bn=P.forwardRef(Q(function(e,t){let{__scopeTooltip:n,"aria-describedby":r,...i}=e,a=Ln(zn,n),o=Nn(zn,n),s=On(n),c=P.useRef(null),l=d(t,c,a.onTriggerChange),u=P.useRef(!1),p=P.useRef(!1),m=P.useCallback(()=>u.current=!1,[]);return P.useEffect(()=>()=>document.removeEventListener(`pointerup`,m),[m]),(0,F.jsx)(_n,{asChild:!0,...s,children:(0,F.jsx)(f.button,{"aria-describedby":a.open?nr(r,a.contentId):r,"data-state":a.stateAttribute,...i,ref:l,onPointerMove:y(e.onPointerMove,e=>{e.pointerType!==`touch`&&!p.current&&!o.isPointerInTransitRef.current&&(a.onTriggerEnter(),p.current=!0)}),onPointerLeave:y(e.onPointerLeave,()=>{a.onTriggerLeave(),p.current=!1}),onPointerDown:y(e.onPointerDown,()=>{a.open&&a.onClose(),u.current=!0,document.addEventListener(`pointerup`,m,{once:!0})}),onFocus:y(e.onFocus,()=>{u.current||a.onOpen()}),onBlur:y(e.onBlur,a.onClose),onClick:y(e.onClick,a.onClose)})})},`TooltipTrigger`)),Vn=`TooltipPortal`,[Hn,Un]=En(Vn,{forceMount:void 0}),Wn=Q(e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,a=Ln(Vn,t);return(0,F.jsx)(Hn,{scope:t,forceMount:n,children:(0,F.jsx)(h,{present:n||a.open,children:(0,F.jsx)(C,{asChild:!0,container:i,children:r})})})},`TooltipPortal`),Gn=`TooltipContent`,Kn=P.forwardRef(Q(function(e,t){let n=Un(Gn,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i=`top`,...a}=e,o=Ln(Gn,e.__scopeTooltip);return(0,F.jsx)(h,{present:r||o.open,children:o.disableHoverableContent?(0,F.jsx)(Yn,{side:i,...a,ref:t}):(0,F.jsx)(qn,{side:i,...a,ref:t})})},`TooltipContent`)),qn=P.forwardRef(Q(function(e,t){let n=Ln(Gn,e.__scopeTooltip),r=Nn(Gn,e.__scopeTooltip),i=P.useRef(null),a=d(t,i),[o,s]=P.useState(null),{trigger:c,onClose:l}=n,u=i.current,{onPointerInTransitChange:f}=r,p=P.useCallback(()=>{s(null),f(!1)},[f]),m=P.useCallback((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=Zn(r,Xn(r,n.getBoundingClientRect())),a=Qn(t.getBoundingClientRect()),o=er([...i,...a]);s(o),f(!0)},[f]);return P.useEffect(()=>()=>p(),[p]),P.useEffect(()=>{if(c&&u){let e=Q(e=>m(e,u),`handleTriggerLeave`),t=Q(e=>m(e,c),`handleContentLeave`);return c.addEventListener(`pointerleave`,e),u.addEventListener(`pointerleave`,t),()=>{c.removeEventListener(`pointerleave`,e),u.removeEventListener(`pointerleave`,t)}}},[c,u,m,p]),P.useEffect(()=>{if(o){let e=Q(e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=c?.contains(t)||u?.contains(t),i=!$n(n,o);r?p():i&&(p(),l())},`handleTrackPointerGrace`);return document.addEventListener(`pointermove`,e),()=>document.removeEventListener(`pointermove`,e)}},[c,u,o,l,p]),(0,F.jsx)(Yn,{...e,ref:a})},`TooltipContentHoverable`)),Jn=u(`TooltipContent`),Yn=P.forwardRef(Q(function(e,t){let{__scopeTooltip:n,children:r,"aria-label":i,id:a,onEscapeKeyDown:o,onPointerDownOutside:s,...c}=e,l=Ln(Gn,n),u=On(n),{onClose:f}=l,[p,h]=P.useState(null),g=d(t,h);m(p),P.useEffect(()=>(document.addEventListener(jn,f),()=>document.removeEventListener(jn,f)),[f]),P.useEffect(()=>{if(l.trigger){let e=Q(e=>{e.target instanceof Node&&e.target.contains(l.trigger)&&f()},`handleScroll`);return window.addEventListener(`scroll`,e,{capture:!0}),()=>window.removeEventListener(`scroll`,e,{capture:!0})}},[l.trigger,f]);let{setContentId:_}=l;return x(()=>(_(a),()=>{_(void 0)}),[a,_]),(0,F.jsx)(v,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:f,children:(0,F.jsxs)(xn,{"data-state":l.stateAttribute,role:i?void 0:`tooltip`,id:i?void 0:l.contentId,...u,...c,ref:g,style:{...c.style,"--radix-tooltip-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-tooltip-content-available-width":`var(--radix-popper-available-width)`,"--radix-tooltip-content-available-height":`var(--radix-popper-available-height)`,"--radix-tooltip-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-tooltip-trigger-height":`var(--radix-popper-anchor-height)`},children:[(0,F.jsx)(Jn,{children:r}),i?(0,F.jsx)(le,{id:l.contentId,role:`tooltip`,children:i}):null]})})},`TooltipContentImpl`));function Xn(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),a=Math.abs(t.left-e.x);switch(Math.min(n,r,i,a)){case a:return`left`;case i:return`right`;case n:return`top`;case r:return`bottom`;default:throw Error(`unreachable`)}}Q(Xn,`getExitSideFromRect`);function Zn(e,t,n=5){let r=[];switch(t){case`top`:r.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case`bottom`:r.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case`left`:r.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case`right`:r.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n})}return r}Q(Zn,`getPaddedExitPoints`);function Qn(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}Q(Qn,`getPointsFromRect`);function $n(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,a=t.length-1;e<t.length;a=e++){let o=t[e],s=t[a],c=o.x,l=o.y,u=s.x,d=s.y;l>r!=d>r&&n<(u-c)*(r-l)/(d-l)+c&&(i=!i)}return i}Q($n,`isPointInPolygon`);function er(e){let t=e.slice();return t.sort((e,t)=>e.x<t.x?-1:e.x>t.x?1:e.y<t.y?-1:+(e.y>t.y)),tr(t)}Q(er,`getHull`);function tr(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n<e.length;n++){let r=e[n];for(;t.length>=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}Q(tr,`getHullPresorted`);function nr(...e){let t=new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}Q(nr,`concatAriaDescribedby`);var rr={all:()=>s.alerts.key(),lists:()=>s.alerts.list.key(),list:e=>s.alerts.list.key({input:e}),details:()=>s.alerts.key({type:`query`}),detail:e=>s.alerts.get.key({input:{id:e}}),stats:()=>s.alerts.getStats.key()},ir={all:()=>s.incidents.key(),lists:()=>s.incidents.list.key(),list:e=>s.incidents.list.key({input:e}),detail:e=>s.incidents.get.key({input:{id:e}})};function ar(){let e=i();return c({...s.incidents.create.mutationOptions(),onSuccess:()=>{e.invalidateQueries({queryKey:ir.lists()})}})}function or(){let e=i();return c({...s.incidents.update.mutationOptions(),onSuccess:t=>{e.invalidateQueries({queryKey:ir.lists()}),e.setQueryData(ir.detail(t.id),t)}})}function sr(){let e=i();return c({...s.incidents.investigate.mutationOptions(),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:ir.detail(n.id)})}})}var $={all:()=>s.integrations.key(),templates:{all:()=>s.integrations.listTemplates.key(),detail:e=>s.integrations.getTemplate.key({input:{id:e}})},integrations:{all:()=>s.integrations.listIntegrations.key(),detail:e=>s.integrations.getIntegration.key({input:{id:e}})},connections:{all:()=>s.integrations.listConnections.key(),list:e=>s.integrations.listConnections.key({input:e??{}}),detail:e=>s.integrations.getConnection.key({input:{id:e}})}};function cr(){return a(s.integrations.listTemplates.queryOptions({input:{}}))}function lr(e){return a(s.integrations.listIntegrations.queryOptions({input:e??{}}))}function ur(){let e=i();return c({...s.integrations.createIntegration.mutationOptions(),onSuccess:()=>{e.invalidateQueries({queryKey:$.integrations.all()})}})}function dr(){let e=i();return c({...s.integrations.deleteIntegration.mutationOptions(),onSuccess:()=>{e.invalidateQueries({queryKey:$.integrations.all()})}})}function fr(e){return a({...s.integrations.getConnectionDeletionImpact.queryOptions({input:{id:e??``}}),enabled:!!e})}function pr(e){return a(s.integrations.listConnections.queryOptions({input:e??{}}))}function mr(){let e=i();return c({...s.integrations.createConnection.mutationOptions(),onSuccess:()=>{e.invalidateQueries({queryKey:$.connections.all()})}})}function hr(){let e=i();return c({...s.integrations.updateConnection.mutationOptions(),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:$.connections.all()}),e.invalidateQueries({queryKey:$.connections.detail(n.id)}),e.invalidateQueries({queryKey:s.sources.key()})}})}function gr(){let e=i();return c({...s.integrations.deleteConnection.mutationOptions(),onSuccess:()=>{e.invalidateQueries({queryKey:$.connections.all()}),e.invalidateQueries({queryKey:s.sources.key()})}})}function _r(){let e=i();return c({...s.integrations.testConnection.mutationOptions(),onSettled:()=>{e.invalidateQueries({queryKey:$.connections.all()}),e.invalidateQueries({queryKey:s.sources.key()})}})}var vr={forService:e=>s.integrations.getServiceIntegrations.key({input:{serviceId:e}})};function yr(e){return a({...s.integrations.getServiceIntegrations.queryOptions({input:{serviceId:e}}),enabled:!!e})}function br(){let e=i();return c({...s.integrations.createServiceIntegration.mutationOptions(),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:vr.forService(n.serviceId)}),e.invalidateQueries({queryKey:s.sources.key()})}})}function xr(){let e=i();return c({...s.integrations.setServiceIntegrationOrder.mutationOptions(),onSuccess:(t,n)=>{e.invalidateQueries({queryKey:vr.forService(n.serviceId)}),e.invalidateQueries({queryKey:s.sources.key()})}})}function Sr(){let e=i();return c({...s.integrations.updateServiceIntegration.mutationOptions(),onSuccess:()=>{e.invalidateQueries({queryKey:s.integrations.key()}),e.invalidateQueries({queryKey:s.sources.key()})}})}function Cr(){let e=i();return c({...s.integrations.deleteServiceIntegration.mutationOptions(),onSuccess:()=>{e.invalidateQueries({queryKey:s.integrations.key()}),e.invalidateQueries({queryKey:s.sources.key()})}})}var wr={all:()=>s.investigations.key(),lists:()=>s.investigations.list.key(),list:e=>s.investigations.list.key({input:e}),detail:e=>s.investigations.get.key({input:{id:e}}),status:e=>s.investigations.getStatus.key({input:{id:e}}),byIncident:e=>s.investigations.list.key({input:{incidentId:e}})};function Tr(){let e=i();return c({...s.investigations.cancel.mutationOptions(),onSuccess:t=>{e.invalidateQueries({queryKey:wr.lists()}),e.setQueryData(wr.detail(t.id),t)}})}function Er(){let e=i();return c({...s.investigations.resume.mutationOptions(),onSuccess:t=>{e.invalidateQueries({queryKey:wr.detail(t.id)}),e.invalidateQueries({queryKey:wr.lists()}),e.invalidateQueries({queryKey:ir.all()})}})}function Dr(){return a({...s.investigations.restartSummary.queryOptions({input:{}}),staleTime:1/0,refetchOnWindowFocus:!1})}function Or(){return c(s.investigations.message.mutationOptions())}function kr(){return c(s.investigations.answerAsk.mutationOptions())}var Ar={status:()=>s.settings.harnesses.getHarnesses.key(),settings:()=>s.settings.harnesses.getSettings.key()};function jr(){return a({...s.settings.harnesses.getHarnesses.queryOptions({input:{}}),retryOnMount:!1})}function Mr(){return a(s.settings.harnesses.getSettings.queryOptions({input:{}}))}function Nr(){let e=i();return c({...s.settings.harnesses.updateSettings.mutationOptions(),onSuccess:()=>{e.invalidateQueries({queryKey:Ar.settings()}),e.invalidateQueries({queryKey:Ar.status()})}})}function Pr(){let e=i();return c({...s.settings.harnesses.checkHarness.mutationOptions(),onSuccess:()=>e.invalidateQueries({queryKey:Ar.status()})})}function Fr(){let{data:e,isLoading:t,isError:n}=jr(),r=e?.selection;if(r?.runnable)return{isReady:!0,blockedReason:void 0,isLoading:!1};let i=t?`Checking whether a coding agent is usable…`:n?`Could not check agent status — retry from Settings → Agent.`:`No coding agent is available — see Settings → Agent.`;return{isReady:!1,blockedReason:r?.blockedReason??i,isLoading:t}}function Ir(){let e=i();return c({...s.settings.danger.resetData.mutationOptions(),onSuccess:()=>{e.invalidateQueries()}})}function Lr(){return c({...s.settings.danger.factoryReset.mutationOptions()})}function Rr(){return a({...s.setup.getStatus.queryOptions({input:{}}),staleTime:1e4})}var zr={all:()=>s.timeline.key(),lists:()=>s.timeline.list.key(),list:(e,t)=>s.timeline.list.key({input:{incidentId:e,...t}}),detail:e=>s.timeline.get.key({input:{id:e}})};function Br(e,t){return a({...s.timeline.list.queryOptions({input:{incidentId:e,...t}}),enabled:!!e})}function Vr(){let e=i();return c({...s.timeline.create.mutationOptions(),onSuccess:t=>{e.invalidateQueries({queryKey:zr.list(t.incidentId)})}})}var Hr=Pn,Ur=Rn,Wr=Bn,Gr=P.forwardRef(({className:e,sideOffset:t=6,...n},r)=>(0,F.jsx)(Wn,{children:(0,F.jsx)(Kn,{ref:r,sideOffset:t,"data-float":`tip`,className:l(`pointer-events-none z-50 max-w-[280px] rounded-control bg-surface-4 px-2 py-1 text-meta text-text-1 shadow-float [@media(hover:none)]:hidden`,e),...n})}));Gr.displayName=Kn.displayName;function Kr({label:e,meta:t,keys:n,side:r=`bottom`,when:i=!0,open:a=!1,children:o}){let[s,c]=(0,P.useState)(!1),[l,u]=(0,P.useState)(!1);return!a&&l&&u(!1),i?(0,F.jsxs)(Ur,{disableHoverableContent:!0,open:s||a&&!l,onOpenChange:c,children:[(0,F.jsx)(Wr,{asChild:!0,children:o}),(0,F.jsxs)(Gr,{side:r,"data-testid":`hint`,onEscapeKeyDown:()=>a&&u(!0),children:[(0,F.jsxs)(`span`,{className:`flex items-center gap-2`,children:[(0,F.jsx)(`span`,{className:`min-w-0`,children:e}),n?.map(e=>(0,F.jsx)(`kbd`,{className:`font-mono text-meta font-medium text-text-2`,"data-testid":`hint-key`,children:e},e))]}),t&&(0,F.jsx)(`span`,{className:`block text-text-2`,"data-testid":`hint-meta`,children:t})]})]}):o}export{T as $,xr as A,hn as B,ur as C,Cr as D,dr as E,ir as F,le as G,xn as H,ar as I,k as J,M as K,sr as L,_r as M,hr as N,lr as O,Sr as P,D as Q,or as R,mr as S,gr as T,fn as U,_n as V,ce as W,j as X,ie as Y,ae as Z,Dr as _,Br as a,fr as b,Lr as c,Fr as d,Ir as f,Tr as g,kr as h,Vr as i,cr as j,yr as k,Mr as l,wr as m,Hr as n,Rr as o,Nr as p,A as q,zr as r,Pr as s,Kr as t,jr as u,Er as v,br as w,pr as x,Or as y,rr as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./link-BHh9_evg.js";import{$ as t,Y as n,o as r,u as i,x as a}from"./Hint-
|
|
1
|
+
import{t as e}from"./link-BHh9_evg.js";import{$ as t,Y as n,o as r,u as i,x as a}from"./Hint-Od6cnmvm.js";import{At as o,I as s,at as c,lt as l,ut as u,wt as d}from"./index-BoI68UdU.js";import{a as f,n as p,t as m}from"./jsx-runtime-Wy9s6hX0.js";import"./WebhookCopy-Cy9bof9B.js";import"./AgentDetail-CbhnttdO.js";import{i as h,n as g,o as _,s as v,t as y}from"./select-hkRu0Dxf.js";import"./button-DmIfWVZ8.js";import{a as b,h as x}from"./use-repositories-orpc-Ban_zGD7.js";import{c as S,t as C}from"./ScheduleDialog-DKRvxEa7.js";import{t as w}from"./service-detail.utils-BQfYgq-F.js";import{t as T}from"./NewThread-CAT5otyD.js";import{a as E,d as D,i as O,n as k,o as A,r as j,s as M,t as N}from"./dropdown-menu-yoILSLgJ.js";import{t as P}from"./utils-A3okWeke.js";import{i as F}from"./trigger-DVo1oKMX.js";var I=f(p()),L=m(),R=e=>e?Date.parse(e):0,z=(e,t,n)=>`${e} ${e===1?t:n}`;function B(e,t){if(t===null)return[];let n=e=>R(e.createdAt??e.triggeredAt),r=e.filter(e=>F(e).kind!==`you`&&n(e)>t),i=e=>(e.investigations??[]).map(e=>R(e.completedAt)).filter(e=>e>t),a=e.filter(e=>i(e).length>0),o=a.reduce((e,t)=>e+i(t).length,0),c=e.filter(e=>d(e)===`asks`),l=[],u=e=>e.length===1?e[0]?.id??null:null,f=(e,t,n,r,i)=>{let[a]=[...e].sort((e,t)=>n(t)-n(e));if(!a?.title)return null;let o=s(a.title);return t===1?`${o} ${r}`:`${t} ${i} ${r}, newest ${o}`};return r.length&&l.push({key:`arrived`,text:f(r,r.length,n,`arrived`,`threads`)??(r.every(e=>F(e).kind===`alert`)?z(r.length,`alert arrived`,`alerts arrived`):z(r.length,`event arrived`,`events arrived`)),incidentId:u(r)}),a.length&&l.push({key:`finished`,text:f(a,o,e=>Math.max(...i(e)),`finished`,`runs`)??z(o,`run finished`,`runs finished`),incidentId:u(a)}),l.length&&c.length&&l.push({key:`needs`,text:`${c.length} waiting for you`,incidentId:u(c)}),l}var V=`pl.home.seenAt`;function H(){try{let e=Number(localStorage.getItem(V));return Number.isFinite(e)&&e>0?e:null}catch{return null}}function U(){let[t]=(0,I.useState)(H);(0,I.useEffect)(()=>{try{localStorage.setItem(V,String(Date.now()))}catch{}},[]);let r=l(),i=u(20),a=B([...r.incidents,...i.rows],t);return a.length===0?null:(0,L.jsxs)(`p`,{className:`flex flex-wrap items-center justify-center gap-x-3 gap-y-1 text-body text-text-2`,"data-testid":`away-strip`,children:[(0,L.jsxs)(`span`,{className:`text-text-3`,children:[`Since `,t?n(t,Date.now()):``]}),a.map(t=>t.incidentId?(0,L.jsx)(e,{to:`/incidents/$id`,params:{id:t.incidentId},className:`inline-flex min-h-6 max-w-full items-center text-center text-accent hover:underline`,"data-testid":`away-${t.key}`,children:(0,L.jsx)(`span`,{children:t.text})},t.key):(0,L.jsx)(e,{to:`/threads`,className:`inline-flex min-h-6 max-w-full items-center text-center text-accent hover:underline`,"data-testid":`away-${t.key}`,children:(0,L.jsx)(`span`,{children:t.text})},t.key))]})}function W(){let{data:e}=r(),{data:t}=c(),{data:n}=a({templateId:`alertmanager`}),{data:o}=a({templateId:`prometheus`}),{data:s}=i(),l=!!t,u=(n?.length??0)+(o?.length??0)>0,d=l||u,f=s?.harnesses.find(e=>e.id===s.selection.harness&&e.installed),p={webhook:l,pull:u,agent:f?.checked?.outcome===`answers-acp`,code:!!e?.steps.codeLocation};return{loaded:!!e&&!!s,steps:p,agent:f,harnesses:s?.harnesses??[],done:(d?2:0)+ +!!p.agent+ +!!p.code,alertsIn:d}}function G(){let t=W();if(!t.loaded||t.done===4)return null;let n=+!t.steps.agent+ +!t.alertsIn+ +!t.steps.code,[r,i]=t.steps.agent?t.alertsIn?[`no code linked.`,(0,L.jsx)(e,{to:`/services`,children:`Link code`},`v`)]:[`no alert source.`,(0,L.jsx)(e,{to:`/settings`,search:{tab:`alert-intake`},children:`Add a source`},`s`)]:[t.agent?t.agent.checked?`${t.agent.label} not ready.`:`${t.agent.label} not checked.`:`no agent ready.`,(0,L.jsx)(e,{to:`/settings`,search:{tab:`agent`},children:`Set up an agent`},`a`)];return(0,L.jsxs)(`p`,{className:`flex flex-wrap items-baseline gap-x-2.5 gap-y-1 pb-4 text-meta text-text-2 [&_a]:inline-flex [&_a]:min-h-6 [&_a]:items-center [&_a]:text-accent [&_a]:hover:underline`,"data-testid":`setup-line`,children:[(0,L.jsxs)(`span`,{children:[n===1?`One setup step left`:`${n} setup steps left`,`: `,r]}),i]})}var K=[`critical`,`high`,`medium`,`low`,`info`],q={critical:`Critical`,high:`High`,medium:`Medium`,low:`Low`,info:`Info`};function J(e){return e.project?{kind:`project`,repositoryId:e.project}:e.service?{kind:`service`,serviceId:e.service}:{kind:`none`}}function Y({search:t,onSearch:n}){let[r,i]=(0,I.useState)({}),a=t??r,s=n??(e=>i(t=>({...t,...e}))),c=x({limit:100}).data,u=c?.data??[],d=b({limit:100}).data?.data??[],f=S().data?.canEdit===!0,[p,m]=(0,I.useState)(null),{incidents:E}=l(),D=[...E].sort((e,t)=>Date.parse(t.updatedAt??t.triggeredAt)-Date.parse(e.updatedAt??e.triggeredAt)).map(e=>u.find(t=>t.id===e.serviceId)).filter(e=>!!e),O=a.project||a.service||a.none?void 0:D.find(e=>w(e))??D[0]??u.find(e=>w(e))??u[0],k=O?{...a,service:O.id}:a,A=J(k),j=d.find(e=>e.id===k.project),M=u.find(e=>e.id===k.service),N=!!k.project,F=a.incident&&!N?a.severity??`high`:null,R=e=>{let[t,n]=e.split(`:`);s({project:t===`project`?n:void 0,service:t===`service`?n:void 0,none:t===`none`||void 0,...t===`project`?{incident:void 0,note:void 0}:{}})},z=(0,L.jsxs)(`div`,{className:`flex flex-wrap items-center gap-1.5 px-0.5`,"data-testid":`composer-top`,children:[(0,L.jsxs)(`button`,{type:`button`,"aria-pressed":!!F,disabled:N,"aria-label":N?`Incident: needs a service`:void 0,onClick:()=>s({incident:!a.incident||void 0,note:void 0}),className:P(`inline-flex h-7 items-center gap-1.5 rounded-control px-2 text-meta transition-colors duration-(--dur-instant)`,F?`bg-surface-3 font-medium text-text-1`:`bg-surface-2 text-text-2 hover:text-text-1`,N&&`cursor-not-allowed opacity-50`),"data-testid":`composer-incident`,children:[(0,L.jsx)(o,{"aria-hidden":!0,className:`size-3.5`}),`Incident`]}),F&&(0,L.jsxs)(y,{value:F,onValueChange:e=>s({severity:e}),children:[(0,L.jsx)(_,{"aria-label":`Severity`,className:`text-meta`,"data-testid":`composer-severity`,children:(0,L.jsx)(v,{})}),(0,L.jsx)(g,{children:K.map(e=>(0,L.jsx)(h,{value:e,"data-testid":`severity-${e}`,children:q[e]},e))})]}),a.note&&F&&(0,L.jsx)(`span`,{className:`text-meta text-text-3`,"data-testid":`composer-note`,children:`Note only`})]}),B=!!c&&u.length===0&&d.length===0;return(0,L.jsxs)(`div`,{className:`mx-auto flex w-full max-w-[680px] flex-col gap-4 px-4 pt-[18vh] pb-12`,"data-testid":`home`,children:[(0,L.jsxs)(`div`,{className:`flex flex-col items-center gap-1`,children:[(0,L.jsx)(`h2`,{className:`text-center text-display text-text-1`,children:`What should we look into?`}),!B&&(0,L.jsxs)(`p`,{className:`flex items-center gap-1 text-body text-text-3`,children:[`in`,(0,L.jsx)(X,{value:k.project?`project:${k.project}`:k.service?`service:${k.service}`:`none`,label:j?.fullName??(M?M.displayName||M.name:`no project`),projects:d.map(e=>({id:e.id,name:e.fullName})),services:u.map(e=>({id:e.id,name:e.displayName||e.name})),onPick:R})]})]}),B&&(0,L.jsxs)(`p`,{className:`-mt-2 self-center text-body text-text-3`,children:[`Ask now, or`,` `,(0,L.jsx)(e,{to:`/services`,search:{add:`1`},className:`inline-flex min-h-6 items-center text-text-2 hover:text-text-1 hover:underline`,"data-testid":`home-add-folder`,children:`add a service`}),` `,`so the agent can read its code.`]}),(0,L.jsx)(T,{subject:A,branch:j?.defaultBranch??null,incident:F,note:!!a.note,top:z,placeholder:`Ask anything`,...f?{onRepeat:m}:{},slash:N?[]:[{id:`investigate`,label:`Investigate`,run:()=>s({incident:!0,note:void 0})},{id:`note`,label:`Note`,run:()=>s({incident:!0,note:!0})}]}),(0,L.jsx)(Z,{service:M??null}),(0,L.jsx)(U,{}),p&&(0,L.jsx)(C,{open:!0,onOpenChange:e=>{e||m(null)},prefill:p,canSetHostZone:!0})]})}function X({value:n,label:r,projects:i,services:a,onPick:o}){return(0,L.jsxs)(N,{children:[(0,L.jsxs)(D,{className:`inline-flex min-h-6 max-w-[28rem] items-center gap-1 rounded-control px-1.5 text-text-1 outline-none hover:bg-surface-3 focus-visible:ring-2 focus-visible:ring-accent`,"aria-label":`Subject: ${r}`,"data-testid":`composer-subject`,children:[(0,L.jsx)(`span`,{className:`truncate`,children:r}),(0,L.jsx)(t,{className:`size-4 self-center text-text-3`})]}),(0,L.jsxs)(k,{align:`center`,children:[(0,L.jsxs)(E,{value:n,onValueChange:o,children:[(0,L.jsx)(A,{value:`none`,"data-testid":`subject-none`,children:`No project`}),i.length>0&&(0,L.jsx)(O,{children:`Projects`}),i.map(e=>(0,L.jsx)(A,{value:`project:${e.id}`,"data-testid":`subject-project-${e.id}`,children:e.name},e.id)),a.length>0&&(0,L.jsx)(O,{children:`Services`}),a.map(e=>(0,L.jsx)(A,{value:`service:${e.id}`,"data-testid":`subject-service-${e.id}`,children:e.name},e.id))]}),(0,L.jsx)(M,{}),(0,L.jsx)(j,{asChild:!0,children:(0,L.jsx)(e,{to:`/projects`,search:{add:!0},children:`Add project`})}),(0,L.jsx)(j,{asChild:!0,children:(0,L.jsx)(e,{to:`/services`,search:{add:`1`},children:`Add a service`})})]})]})}function Z({service:t}){let n=W();if(!n.loaded)return null;let r=t&&!w(t),i=n.steps.agent?r&&t?(0,L.jsx)(e,{to:`/services/$id`,params:{id:t.id},children:`Link code`}):n.alertsIn?null:(0,L.jsx)(e,{to:`/alerts`,children:`Connect`}):(0,L.jsx)(e,{to:`/settings`,search:{tab:`agent`},children:`Set up`});if(!i)return null;let a=n.steps.agent?r&&t?`The agent can't read this service's code yet.`:`Alerts not connected.`:`No agent ready.`;return(0,L.jsxs)(`p`,{className:`text-center text-body text-text-2 [&_a]:inline-flex [&_a]:min-h-6 [&_a]:items-center [&_a]:text-accent [&_a]:underline [&_a]:underline-offset-2`,"data-testid":`setup-line`,children:[a,` `,i]})}export{U as i,G as n,W as r,Y as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e}from"./desktop-
|
|
1
|
+
import{a as e}from"./desktop-yb-lqHMd.js";import{t}from"./check-C96xWdLm.js";import{b as n}from"./Transcript-Csly_ODF.js";import{a as r,n as i,t as a}from"./jsx-runtime-Wy9s6hX0.js";import{K as o,t as s}from"./Hint-Od6cnmvm.js";import{a as c}from"./State-CCKzehkH.js";import{C as l,b as u,w as d,x as f,y as p}from"./use-repositories-orpc-Ban_zGD7.js";import{t as m}from"./evidence-files-C_a9Ct8m.js";import{f as h,i as g,p as _}from"./run-details-B1I5SE7k.js";import{rt as v}from"./source-words-CCeTLwOy.js";import{t as y}from"./utils-A3okWeke.js";var b={name:`ban`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M4.929 4.929 19.07 19.071`,key:`196cmz`}]]};b.node;var x=e(b),S={name:`check-check`,size:24,node:[[`path`,{d:`M18 6 7 17l-5-5`,key:`116fxf`}],[`path`,{d:`m22 10-7.5 7.5L13 16`,key:`ke71qq`}]]};S.node;var C=e(S),w={name:`circle-question-mark`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3`,key:`1u773s`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]],aliases:[`help-circle`,`circle-help`]};w.node;var T=e(w),E=r(i()),D=a(),O=360,k={confirmed:{icon:C,tone:`text-ok`},supported:{icon:t,tone:`text-accent`},speculative:{icon:T,tone:`text-warn`},refuted:{icon:x,tone:`text-text-3`}},A=`hypotheses-open-larger`;function j(e){let{report:t,at:r}=e,i=`${r?`From the report at ${o(r)}. `:``}${t.hypotheses.length?`${g(t.hypotheses.length)}.`:`No hypotheses.`}`,a=(0,E.useRef)(null),c=(0,E.useRef)(null),[m,h]=(0,E.useState)(!1),_=e.onPreview;(0,E.useLayoutEffect)(()=>{let e=a.current,t=c.current;if(!e||!t||!_)return;let n=()=>h(e.scrollHeight>361);n();let r=new ResizeObserver(n);return r.observe(t),()=>r.disconnect()},[_]);let v=(0,E.useRef)(!1),b=t=>(n,r)=>{if(!n.target)return;t&&(v.current=!0,e.onPreview?.(!1));let i=t?A:r;`file`in n.target?e.onOpenFile(n.target.file,i):e.onJump(n.target.step)};return(0,D.jsxs)(`li`,{className:`flex flex-col gap-1.5 rounded-[10px] bg-surface-2 px-3 pt-2.5 pb-3`,"data-testid":`hypotheses-card`,children:[(0,D.jsxs)(`div`,{className:`flex min-w-0 items-center gap-2`,children:[(0,D.jsxs)(`span`,{className:`flex min-w-0 flex-1 flex-col`,children:[(0,D.jsx)(`span`,{className:`truncate font-semibold`,children:`Hypotheses`}),(0,D.jsx)(`span`,{className:`text-meta text-text-3`,children:i})]}),_&&(0,D.jsx)(s,{label:`Open larger`,children:(0,D.jsx)(`button`,{type:`button`,id:`hypotheses-open-larger`,"aria-label":`Open Hypotheses larger`,onClick:()=>_(!0),className:`flex size-7 shrink-0 items-center justify-center rounded-control text-text-2 transition-colors duration-(--dur-instant) hover:bg-surface-3 hover:text-text-1`,"data-testid":`hypotheses-open`,children:(0,D.jsx)(n,{className:`size-4`,"aria-hidden":!0})})})]}),(0,D.jsx)(`div`,{ref:a,className:y(`relative rounded-control`,_&&`overflow-hidden`,m&&`after:pointer-events-none after:absolute after:inset-x-0 after:bottom-0 after:h-14 after:bg-[linear-gradient(transparent,var(--surface-2))]`),style:_?{maxHeight:O}:void 0,"data-clipped":m?``:void 0,"data-testid":`hypotheses-body`,children:(0,D.jsx)(`div`,{ref:c,children:(0,D.jsx)(M,{...e,onCite:b(!1),scope:`card`})})}),(0,D.jsx)(p,{open:!!_&&!!e.preview,onOpenChange:_,children:(0,D.jsxs)(u,{size:`xl`,className:`max-h-[88dvh] max-md:top-0 max-md:left-0 max-md:h-dvh max-md:max-h-none max-md:w-full max-md:translate-x-0 max-md:translate-y-0 max-md:rounded-none`,"data-testid":`hypotheses-preview`,onCloseAutoFocus:t=>{let n=v.current?null:e.returnTo?.(),r=n?document.getElementById(n):null;(v.current||r)&&t.preventDefault(),v.current=!1,r?.focus()},children:[(0,D.jsxs)(l,{children:[(0,D.jsx)(d,{children:`Hypotheses`}),(0,D.jsx)(f,{children:i})]}),(0,D.jsx)(M,{...e,onCite:b(!0),scope:`preview`})]})})]})}function M({report:e,targetOf:t,onCite:n,scope:r}){let[i,a]=(0,E.useState)(!1);if(e.hypotheses.length===0)return(0,D.jsx)(`p`,{className:`m-0 text-text-2`,children:`The report lists no hypotheses.`});let o={report:e,cites:N(e.hypotheses,t),onCite:n,scope:r};return i?(0,D.jsx)(R,{...o}):(0,D.jsx)(z,{onError:()=>a(!0),children:(0,D.jsx)(F,{...o})})}function N(e,t){let n=new Map,r=0;return e.forEach((e,i)=>{for(let a of e.evidence){let e=t(a);r+=1;let o=e?`file`in e?m(e.file):`${v(a.source)}, step ${e.step}`:v(a.source);n.set(i,[...n.get(i)??[],{n:r,label:o,target:e}])}}),n}var P=(e,t)=>`hyp-${e}-cite-${t.n}`;function F({report:e,cites:t,onCite:n,scope:r}){let i=_(e.hypotheses),a=Array.from(t.values()).flat();return(0,D.jsxs)(`section`,{className:`flex flex-col gap-2.5 text-meta`,"aria-label":`Hypotheses from the report`,"data-testid":`hypotheses-drawing`,children:[i.length>1&&(0,D.jsx)(I,{text:e.rootCause}),(0,D.jsx)(L,{nodes:i,depth:0,cites:t,onCite:n,scope:r}),a.length>0&&(0,D.jsxs)(D.Fragment,{children:[(0,D.jsx)(`span`,{className:`text-text-3`,children:`Citations`}),(0,D.jsx)(`ol`,{className:`m-0 flex list-none flex-col gap-0.5 p-0`,children:a.map(e=>(0,D.jsxs)(`li`,{className:`flex min-w-0 gap-1.5`,children:[(0,D.jsx)(`span`,{className:`text-text-3 tabular-nums`,children:e.n}),e.target?(0,D.jsx)(`button`,{type:`button`,id:`${P(r,e)}-list`,onClick:()=>n(e,`${P(r,e)}-list`),className:`min-h-6 min-w-0 rounded-control text-left font-mono text-mono text-accent underline underline-offset-[3px] [overflow-wrap:anywhere]`,"data-testid":`hypotheses-cite`,children:e.label}):(0,D.jsx)(`span`,{className:`min-w-0 font-mono text-mono text-text-2 [overflow-wrap:anywhere]`,"data-testid":`hypotheses-cite-text`,children:e.label})]},e.n))})]})]})}function I({text:e}){return e?(0,D.jsxs)(`div`,{className:`flex flex-col rounded-control bg-surface-2 px-2.5 py-2`,children:[(0,D.jsx)(`span`,{className:`font-medium text-text-2`,children:`Likely cause`}),(0,D.jsx)(`span`,{dir:`auto`,className:`text-body text-text-1`,children:e})]}):null}function L({nodes:e,depth:t,cites:n,onCite:r,scope:i}){return(0,D.jsx)(`ul`,{className:y(`m-0 flex min-w-0 list-none flex-col gap-0.5 p-0`,t>0&&`relative mt-0.5 pl-5 before:absolute before:top-0 before:bottom-1.5 before:left-2 before:w-px before:bg-hairline`),children:e.map(e=>{let a=e.hypothesis,{icon:o,tone:s}=k[a.status];return(0,D.jsxs)(`li`,{className:`flex min-w-0 flex-col`,children:[(0,D.jsxs)(`div`,{className:`flex min-w-0 items-start gap-2 rounded-control px-2 py-1`,"data-testid":`hypothesis-row`,"data-status":a.status,children:[(0,D.jsx)(o,{"aria-hidden":!0,className:y(`mt-0.5 size-3.5 shrink-0`,s)}),(0,D.jsxs)(`span`,{className:`min-w-0 flex-1 text-body`,children:[(0,D.jsx)(`span`,{dir:`auto`,className:y(`[overflow-wrap:anywhere]`,a.status===`refuted`?`text-text-3 line-through`:`text-text-1`),children:a.statement}),(n.get(e.index)??[]).map(e=>e.target?(0,D.jsx)(`button`,{type:`button`,id:P(i,e),"aria-label":`Citation ${e.n}: ${e.label}`,onClick:()=>r(e,P(i,e)),className:`ml-0.5 inline-flex min-h-6 min-w-6 items-center justify-center rounded-control text-meta text-accent underline`,children:e.n},e.n):(0,D.jsx)(`sup`,{className:`ml-1 px-0.5 text-meta text-text-3`,children:e.n},e.n))]}),(0,D.jsx)(`span`,{className:y(`shrink-0`,s),children:h[a.status]})]}),e.children.length>0&&(0,D.jsx)(L,{nodes:e.children,depth:t+1,cites:n,onCite:r,scope:i})]},e.key)})})}function R({report:e,cites:t,onCite:n,scope:r}){let i=_(e.hypotheses),a=e=>(0,D.jsx)(`ul`,{className:`m-0 flex list-disc flex-col gap-1 pl-5`,children:e.map(e=>{let i=e.hypothesis;return(0,D.jsxs)(`li`,{children:[(0,D.jsx)(`span`,{className:i.status===`refuted`?`text-text-3`:`text-text-1`,children:i.statement}),` `,(0,D.jsx)(`span`,{className:`text-meta text-text-2`,children:h[i.status]}),(t.get(e.index)??[]).map(e=>e.target?(0,D.jsx)(`button`,{type:`button`,id:`${P(r,e)}-text`,onClick:()=>n(e,`${P(r,e)}-text`),className:`ml-2 rounded-control text-meta text-accent underline`,children:e.label},e.n):(0,D.jsx)(`span`,{className:`ml-2 text-meta text-text-2`,children:e.label},e.n)),e.children.length>0&&a(e.children)]},e.key)})});return(0,D.jsxs)(`div`,{className:`flex flex-col gap-2`,"data-testid":`hypotheses-fallback`,children:[(0,D.jsx)(c,{className:`py-0`,text:`Unable to show the hypotheses drawing: it stopped with an error.`}),(0,D.jsxs)(`span`,{className:`text-text-2`,children:[`The same `,g(e.hypotheses.length),`, as text:`]}),e.rootCause&&(0,D.jsxs)(`span`,{className:`text-text-2`,children:[(0,D.jsx)(`span`,{className:`font-semibold text-ok`,children:`Conclusion`}),` `,e.rootCause]}),a(i)]})}var z=class extends E.Component{constructor(...e){super(...e),this.state={failed:!1}}static getDerivedStateFromError(){return{failed:!0}}componentDidCatch(){this.props.onError()}render(){return this.state.failed?null:this.props.children}};function B(){let e=(0,E.useRef)(void 0);return(0,E.useEffect)(()=>()=>window.clearTimeout(e.current),[]),(0,E.useCallback)(t=>{window.clearTimeout(e.current),e.current=window.setTimeout(()=>{let e=document.getElementById(t);e?.scrollIntoView({block:`center`}),e?.focus()},0)},[])}export{j as n,B as r,A as t};
|