@wjarka/cezarion 0.14.4 → 0.14.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/README.md +4 -1
- package/dist/automations/types.d.ts +2 -0
- package/dist/contract/automations.d.ts +8 -0
- package/dist/contract/index.js +4 -0
- package/dist/contract/runs.d.ts +10 -2
- package/dist/contract/skills.d.ts +1 -0
- package/dist/contract/workflows.d.ts +6 -0
- package/dist/delegation/cli.js +60 -1
- package/dist/delegation/cli.js.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/runs/store.d.ts +1 -0
- package/dist/server/server.d.ts +72 -0
- package/dist/server/server.js +6 -5
- package/dist/server/server.js.map +1 -1
- package/dist/workflows/run.d.ts +4 -0
- package/dist/workflows/run.js +64 -19
- package/dist/workflows/run.js.map +1 -1
- package/dist/workflows/types.d.ts +3 -0
- package/dist/workflows/types.js +2 -1
- package/dist/workflows/types.js.map +1 -1
- package/package.json +3 -3
- package/web/dist/assets/{agent-accounts-BxBsIXGa.js → agent-accounts-4EqNShyp.js} +1 -1
- package/web/dist/assets/{alert-dialog-BOp2HnnL.js → alert-dialog-CVF_qvQ8.js} +1 -1
- package/web/dist/assets/{collapsible-bb0csfMs.js → collapsible-DVDGHZAE.js} +1 -1
- package/web/dist/assets/{commit-list-DOWYQ7G6.js → commit-list-BuNsBn8P.js} +1 -1
- package/web/dist/assets/{compare-variants-B1XteHt-.js → compare-variants-BnQ1O8Ix.js} +1 -1
- package/web/dist/assets/{diff-BjLZHKfD2.js → diff-DWmKlqw52.js} +2 -2
- package/web/dist/assets/{diff-controls-DaO836o4.js → diff-controls-CuqRa-63.js} +1 -1
- package/web/dist/assets/{diff-stat-DpHwISUB.js → diff-stat-BXriPIds.js} +1 -1
- package/web/dist/assets/{diff-view-BaYxuP8L.js → diff-view-DLPDcgEV.js} +1 -1
- package/web/dist/assets/{dropdown-menu-DAmCVaLJ.js → dropdown-menu-IsTcumXE.js} +1 -1
- package/web/dist/assets/{git-toolbar-rk3doc2w.js → git-toolbar-BjMzETip.js} +1 -1
- package/web/dist/assets/{github-BhnijVvD.js → github-BvowTAuy.js} +1 -1
- package/web/dist/assets/{image-preview-CFHgISfb.js → image-preview-WXKTY8KT.js} +1 -1
- package/web/dist/assets/index-Cz3N9b18.js +7 -0
- package/web/dist/assets/{markdown-Ir62-VMS.js → markdown-gFxX4dDH.js} +1 -1
- package/web/dist/assets/pill-BlaWNkHk.js +1 -0
- package/web/dist/assets/{project-router-CvFAMDcP.js → project-router-CX1jLqj-.js} +1 -1
- package/web/dist/assets/{prompt-templates-BGGpAIzb.js → prompt-templates-DwdQcfSc.js} +1 -1
- package/web/dist/assets/{repo-git-QEHH7y-w.js → repo-git-DnbE8dR5.js} +1 -1
- package/web/dist/assets/{run-diff-DrQsmf3-.js → run-diff-Mfc85irR.js} +1 -1
- package/web/dist/assets/run-header-CDO3LV4z.js +1 -0
- package/web/dist/assets/{skills-DOT1odMt.js → skills-DHfsyXTQ.js} +1 -1
- package/web/dist/assets/{tab-link-CkIV8ixq.js → tab-link-DhREnUYE.js} +1 -1
- package/web/dist/assets/{task-changes-CUQTi97I.js → task-changes-Cfo-vtEl.js} +1 -1
- package/web/dist/assets/{task-commits-D_N8-awD.js → task-commits-CvK4flXT.js} +1 -1
- package/web/dist/assets/{task-files-CfYcMt07.js → task-files-BwVGUObK.js} +1 -1
- package/web/dist/assets/{task-thread-Bnd_Pc07.js → task-thread-g1vc4tKn.js} +6 -6
- package/web/dist/assets/{textarea-DfvlPIgO.js → textarea-DCP8bOOf.js} +1 -1
- package/web/dist/assets/{thread-loading-B0WsjYr0.js → thread-loading-D9DbIsIS.js} +1 -1
- package/web/dist/assets/{token-metrics-BLzFUb8F.js → token-metrics-PSnNTJZF.js} +1 -1
- package/web/dist/assets/{utils-GZNjgma4.js → utils-DNvmfH6b.js} +1 -1
- package/web/dist/assets/{workflows-C1I-xV9B.js → workflows-BDdUJIFT.js} +3 -3
- package/web/dist/assets/{zoomable-image-COhBxkky.js → zoomable-image-yNqiuVu7.js} +1 -1
- package/web/dist/index.html +13 -13
- package/web/dist/assets/index-DTsigc4h.js +0 -7
- package/web/dist/assets/pill-BoBISMI9.js +0 -1
- package/web/dist/assets/run-header-BKeByMek.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{A as r,D as i,M as a,N as o,O as s,j as c,k as l,z as u}from"./alert-dialog-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{A as r,D as i,M as a,N as o,O as s,j as c,k as l,z as u}from"./alert-dialog-CVF_qvQ8.js";var d=e(t(),1),f=n(),p=`Collapsible`,[m,h]=a(p),[g,_]=m(p),v=d.forwardRef((e,t)=>{let{__scopeCollapsible:n,open:r,defaultOpen:a,disabled:s,onOpenChange:c,...u}=e,[m,h]=l({prop:r,defaultProp:a??!1,onChange:c,caller:p});return(0,f.jsx)(g,{scope:n,disabled:s,contentId:i(),open:m,onOpenToggle:d.useCallback(()=>h(e=>!e),[h]),children:(0,f.jsx)(o.div,{"data-state":w(m),"data-disabled":s?``:void 0,...u,ref:t})})});v.displayName=p;var y=`CollapsibleTrigger`,b=d.forwardRef((e,t)=>{let{__scopeCollapsible:n,...r}=e,i=_(y,n);return(0,f.jsx)(o.button,{type:`button`,"aria-controls":i.open?i.contentId:void 0,"aria-expanded":i.open||!1,"data-state":w(i.open),"data-disabled":i.disabled?``:void 0,disabled:i.disabled,...r,ref:t,onClick:c(e.onClick,i.onOpenToggle)})});b.displayName=y;var x=`CollapsibleContent`,S=d.forwardRef((e,t)=>{let{forceMount:n,...r}=e,i=_(x,e.__scopeCollapsible);return(0,f.jsx)(s,{present:n||i.open,children:({present:e})=>(0,f.jsx)(C,{...r,ref:t,present:e})})});S.displayName=x;var C=d.forwardRef((e,t)=>{let{__scopeCollapsible:n,present:i,children:a,...s}=e,c=_(x,n),[l,p]=d.useState(i),m=d.useRef(null),h=u(t,m),g=d.useRef(0),v=g.current,y=d.useRef(0),b=y.current,S=c.open||l,C=d.useRef(S),T=d.useRef(void 0);return d.useEffect(()=>{let e=requestAnimationFrame(()=>C.current=!1);return()=>cancelAnimationFrame(e)},[]),r(()=>{let e=m.current;if(e){T.current=T.current||{transitionDuration:e.style.transitionDuration,animationName:e.style.animationName},e.style.transitionDuration=`0s`,e.style.animationName=`none`;let t=e.getBoundingClientRect();g.current=t.height,y.current=t.width,C.current||(e.style.transitionDuration=T.current.transitionDuration,e.style.animationName=T.current.animationName),p(i)}},[c.open,i]),(0,f.jsx)(o.div,{"data-state":w(c.open),"data-disabled":c.disabled?``:void 0,id:c.contentId,hidden:!S,...s,ref:h,style:{"--radix-collapsible-content-height":v?`${v}px`:void 0,"--radix-collapsible-content-width":b?`${b}px`:void 0,...e.style},children:S&&a})});function w(e){return e?`open`:`closed`}var T=v;function E({...e}){return(0,f.jsx)(T,{"data-slot":`collapsible`,...e})}function D({...e}){return(0,f.jsx)(b,{"data-slot":`collapsible-trigger`,...e})}function O({...e}){return(0,f.jsx)(S,{"data-slot":`collapsible-content`,...e})}export{O as n,D as r,E as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Rt as r,_t as i,lt as a}from"./alert-dialog-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Rt as r,_t as i,lt as a}from"./alert-dialog-CVF_qvQ8.js";import{t as o}from"./utils-DNvmfH6b.js";import{t as s}from"./project-router-CX1jLqj-.js";import{h as c}from"./index-Cz3N9b18.js";import{t as l}from"./lib-BQXq3kEf.js";var u=e(t(),1),d=n(),f=77;function p({slot:e,commits:t,className:n,heading:i}){let[a,s]=(0,u.useState)(``),p=a.trim().toLowerCase(),h=p?t.filter(e=>e.subject.toLowerCase().includes(p)):t,g=h.length>150,_=(0,u.useRef)(null),v=(0,u.useRef)(null),[y,b]=(0,u.useState)(0);(0,u.useLayoutEffect)(()=>{if(!g)return;let e=()=>{let e=_.current,t=v.current;!e||!t||b(Math.max(0,Math.round(e.getBoundingClientRect().top-t.getBoundingClientRect().top+t.scrollTop)))};return e(),window.addEventListener(`resize`,e),()=>window.removeEventListener(`resize`,e)},[g]);let x=h.map(n=>(0,d.jsx)(m,{commit:n,detailed:e===`task-commits`&&t.length===1},n.sha));return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(`label`,{className:`relative mb-[22px] block`,children:[(0,d.jsx)(r,{size:16,"aria-hidden":`true`,className:`pointer-events-none absolute top-3.5 left-3 size-4 text-muted-foreground`}),(0,d.jsx)(c,{"aria-label":`Search commit messages`,placeholder:`Search commit messages…`,value:a,onChange:e=>s(e.target.value),className:`h-11 bg-card pl-10`})]}),(0,d.jsxs)(`div`,{ref:e=>{_.current=e,e&&(v.current=e.closest(`[data-slot="main"]`))},"data-slot":e,"data-virtualized":g,className:o(`flex flex-col divide-y divide-border rounded-xl border border-border bg-card px-4 py-1 md:px-5`,n),children:[i?(0,d.jsx)(`div`,{className:`flex min-h-14 flex-wrap items-center gap-2 py-4`,children:i}):null,h.length===0?(0,d.jsx)(`p`,{role:`status`,className:`py-5 text-sm text-muted-foreground`,children:`No loaded commits match your search.`}):null,g?(0,d.jsx)(l,{scrollRef:v,startMargin:y,itemSize:f,children:x}):x]})]})}function m({commit:e,detailed:t}){return(0,d.jsx)(`div`,{className:`[contain-intrinsic-block-size:auto_77px] [content-visibility:auto]`,children:(0,d.jsxs)(s,{"data-slot":`commit-row`,"data-sha":e.sha,to:e.href,className:o(`flex min-h-[76px] min-w-0 flex-col items-start gap-3 rounded-sm py-4 hover:bg-muted`,!t&&`md:flex-row md:items-center md:py-3`),children:[(0,d.jsx)(i,{size:16,"aria-hidden":`true`,className:o(`shrink-0 text-accent-text`,t?`size-[22px]`:`size-4`)}),(0,d.jsxs)(`span`,{className:o(`min-w-0 w-full`,!t&&`md:w-auto md:flex-1`),children:[(0,d.jsx)(`span`,{className:o(`block font-normal`,t?`text-[22px] leading-snug`:`text-[13px] md:truncate`),children:e.subject}),(0,d.jsxs)(`span`,{className:`mt-1 block truncate text-[11px] text-soft-foreground`,children:[e.author,` · `,e.when]})]}),(0,d.jsx)(`span`,{className:`shrink-0 rounded-md bg-muted px-2 py-1 font-mono text-[11px] text-muted-foreground`,children:e.shaLabel}),t?(0,d.jsxs)(`span`,{className:`inline-flex min-h-11 items-center gap-2 rounded-lg bg-action px-3 text-xs font-medium text-action-foreground`,children:[(0,d.jsx)(a,{size:16,"aria-hidden":`true`,className:`size-4`}),`View changes`]}):null]})})}export{p as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Aa as r,Ca as i,Cn as a,Hi as o,Hr as s,Ta as c,Tr as l,Xr as u,Y as d,Z as f,a as p,c as m,cr as h,d as g,i as _,in as v,kr as y,l as b,n as x,ni as S,o as C,r as w,s as T,sa as E,t as D,wn as O}from"./alert-dialog-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Aa as r,Ca as i,Cn as a,Hi as o,Hr as s,Ta as c,Tr as l,Xr as u,Y as d,Z as f,a as p,c as m,cr as h,d as g,i as _,in as v,kr as y,l as b,n as x,ni as S,o as C,r as w,s as T,sa as E,t as D,wn as O}from"./alert-dialog-CVF_qvQ8.js";import{t as k}from"./utils-DNvmfH6b.js";import{n as A,r as j,t as M}from"./collapsible-DVDGHZAE.js";import{c as N,t as P}from"./project-router-CX1jLqj-.js";import{t as F}from"./search-x-I9Q8pgUa.js";import{t as I}from"./markdown-gFxX4dDH.js";import{n as L,t as R}from"./token-metrics-PSnNTJZF.js";import{g as z,m as B}from"./index-Cz3N9b18.js";import{t as V}from"./run-diff-Mfc85irR.js";var H=e(t(),1),U=n();function W(){let{groupId:e}=i(),t=a(e),n=R(O().data),o=r();if((0,H.useEffect)(()=>{e&&o.invalidateQueries({queryKey:v.groups.detail(e)})},[o,e,(h().data??[]).filter(t=>t.groupId===e).map(e=>`${e.id}:${e.status}:${e.archived}`).sort().join(`,`)]),t.isPending)return(0,U.jsx)(B,{});if(t.isError){let e=t.error instanceof S&&t.error.status===404;return(0,U.jsx)(`div`,{"data-route":`compare`,className:`task-flow-page flex min-h-full flex-col`,children:(0,U.jsx)(b,{icon:e?(0,U.jsx)(F,{}):(0,U.jsx)(z,{}),tone:e?`neutral`:`danger`,title:e?`No such variant group`:`Could not load variants`,subtitle:e?`No runs share this group id. The group may have been deleted, or a winner was already picked and the others removed.`:t.error.message,actions:(0,U.jsxs)(`div`,{className:`flex flex-wrap gap-2`,children:[(0,U.jsx)(g,{asChild:!0,variant:`outline`,children:(0,U.jsx)(P,{to:`/`,children:`Back to tasks`})}),e?null:(0,U.jsx)(g,{variant:`outline`,onClick:()=>void t.refetch(),children:`Retry`})]})})})}return(0,U.jsx)(G,{groupId:e,variants:t.data.runs,showTokens:n.tokens,showCost:n.cost})}function G({groupId:e,variants:t,showTokens:n,showCost:i}){let a=N(),u=r(),[d,f]=(0,H.useState)(null),h=t.every(e=>l.has(e.status)),g=t[0]?s(t[0]):``,y=c({mutationFn:t=>o(e,t),onSuccess:(t,n)=>{u.invalidateQueries({queryKey:v.runs.all}),u.invalidateQueries({queryKey:v.groups.detail(e)}),a(`/tasks/${t.winner?.id??n}`)},onError:e=>E(e.message,{tone:`danger`})});return(0,U.jsxs)(`div`,{"data-route":`compare`,className:`task-flow-page flex w-full flex-col`,children:[(0,U.jsxs)(`header`,{className:`flex flex-col gap-1`,children:[(0,U.jsxs)(`h1`,{className:`flex items-center gap-2 text-xl font-semibold`,children:[(0,U.jsx)(z,{className:`size-5 shrink-0 text-accent-icon`,"aria-hidden":`true`}),(0,U.jsx)(`span`,{children:`Compare variants`})]}),(0,U.jsxs)(`p`,{className:`text-[13px] text-muted-foreground`,children:[g,` · `,t.length,` `,h?`completed variants with distinct committed diffs.`:`variants of the same task, each in its own worktree.`]})]}),h?null:(0,U.jsxs)(`section`,{role:`status`,className:`rounded-xl border border-border bg-card p-5`,children:[(0,U.jsx)(`h2`,{className:`text-lg font-normal`,children:`Variants are still running`}),(0,U.jsx)(`p`,{className:`mt-3 text-[13px] text-muted-foreground`,children:`Compare progress now. Picking a result is disabled until every variant finishes.`})]}),(0,U.jsx)(`div`,{"data-slot":`compare-columns`,className:k(`grid grid-cols-1 gap-3`,t.length>=3?`md:grid-cols-3`:`md:grid-cols-2`),children:t.map(e=>(0,U.jsx)(K,{variant:e,allTerminal:h,pickPending:y.isPending,onPick:()=>f(e),showTokens:n,showCost:i},e.id))}),(0,U.jsx)(`section`,{"aria-label":`Full diffs`,className:`flex flex-col gap-[22px]`,children:t.map(e=>(0,U.jsx)(q,{variant:e},e.id))}),(0,U.jsx)(D,{open:d!==null,onOpenChange:e=>!e&&f(null),children:(0,U.jsxs)(_,{"data-slot":`variant-confirm-dialog`,children:[(0,U.jsxs)(T,{children:[(0,U.jsxs)(m,{children:[`Pick variant `,d?.variant,`?`]}),(0,U.jsxs)(p,{children:[`Variant `,d?.variant,`'s changes go to the review gate. The other`,` `,t.length-1==1?`variant is`:`${t.length-1} variants are`,` `,`cancelled if still open, archived, and their worktrees and branches removed. There is no undo.`]})]}),(0,U.jsxs)(C,{children:[(0,U.jsx)(w,{children:`Cancel`}),(0,U.jsxs)(x,{"data-slot":`confirm-pick`,onClick:()=>{d&&y.mutate(d.id),f(null)},children:[`Pick variant `,d?.variant]})]})]})})]})}function K({variant:e,allTerminal:t,pickPending:n,onPick:r,showTokens:i,showCost:a}){let o=u(e),s=y(e.costUsd),c=e.inputTokens!==void 0||e.outputTokens!==void 0;return(0,U.jsxs)(`article`,{"data-slot":`variant-column`,"data-variant":e.variant,className:`flex min-w-0 flex-col gap-3 rounded-lg border border-border bg-card p-3.5 shadow-xs`,children:[(0,U.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,U.jsx)(`span`,{"data-slot":`variant-letter`,"aria-label":`Variant ${e.variant}`,className:`inline-flex size-6 shrink-0 items-center justify-center rounded-full bg-accent-strong/15 font-mono text-xs font-semibold text-accent-text`,children:e.variant}),(0,U.jsxs)(`span`,{"data-slot":`variant-status`,className:`text-lg font-normal`,children:[`· `,(0,U.jsx)(`span`,{className:`capitalize`,children:o.label})]}),i&&c||a&&s?(0,U.jsxs)(`span`,{"data-slot":`variant-token-metrics`,className:`ml-auto flex shrink-0 items-center gap-1.5 text-[11px] text-soft-foreground`,children:[i?(0,U.jsx)(L,{inputTokens:e.inputTokens,outputTokens:e.outputTokens}):null,i&&c&&a&&s?(0,U.jsx)(`span`,{"aria-hidden":`true`,children:`·`}):null,a&&s?(0,U.jsx)(`span`,{className:`font-mono tabular-nums`,children:s}):null]}):null]}),(0,U.jsxs)(`div`,{className:`flex min-w-0 flex-col gap-1`,children:[(0,U.jsx)(`span`,{className:`text-[10.5px] font-semibold tracking-[0.04em] text-soft-foreground uppercase`,children:`git diff --stat`}),(0,U.jsx)(`pre`,{"data-slot":`variant-diffstat`,className:`max-h-36 overflow-auto rounded-md bg-muted/60 px-2.5 py-2 font-mono text-[11px] leading-[1.6] whitespace-pre text-muted-foreground`,children:e.diffStat.trimEnd()||`(no changes)`})]}),(0,U.jsxs)(`div`,{className:`flex min-w-0 flex-1 flex-col gap-1`,children:[(0,U.jsx)(`span`,{className:`text-[10.5px] font-semibold tracking-[0.04em] text-soft-foreground uppercase`,children:`Progress`}),e.handoffExcerpt?(0,U.jsx)(`div`,{"data-slot":`variant-progress`,className:`max-h-28 min-w-0 overflow-hidden text-[12.5px] text-muted-foreground [mask-image:linear-gradient(to_bottom,black_75%,transparent)]`,children:(0,U.jsx)(I,{children:e.handoffExcerpt})}):(0,U.jsx)(`p`,{"data-slot":`variant-progress`,className:`text-xs text-soft-foreground`,children:`(no progress notes)`})]}),(0,U.jsx)(g,{asChild:!0,variant:`outline`,className:`self-start`,children:(0,U.jsx)(P,{to:`/tasks/${e.id}`,children:`Open task`})}),(0,U.jsxs)(g,{"data-slot":`variant-pick`,title:t?`Keep variant ${e.variant}'s changes and archive the others`:`Every variant must finish before you can pick`,disabled:!t||n,onClick:r,children:[(0,U.jsx)(d,{"aria-hidden":`true`}),`Pick variant `,e.variant]})]})}function q({variant:e}){let[t,n]=(0,H.useState)(!1);return(0,U.jsxs)(M,{open:t,onOpenChange:n,"data-slot":`variant-diff`,"data-variant":e.variant,className:`min-w-0 overflow-hidden rounded-lg border border-border bg-card`,children:[(0,U.jsxs)(j,{className:`flex w-full items-center gap-2 px-3.5 py-2.5 text-left text-[13px] font-medium hover:bg-muted/50`,children:[(0,U.jsx)(f,{className:k(`size-3.5 shrink-0 text-soft-foreground transition-transform`,t&&`rotate-90`),"aria-hidden":`true`}),`Variant `,e.variant,` — full diff`]}),(0,U.jsx)(A,{children:(0,U.jsx)(`div`,{className:`border-t border-border/50 px-3 py-3`,children:(0,U.jsx)(V,{runId:e.id})})})]})}export{W as CompareVariantsRoute};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/diff-view-
|
|
2
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{t as r}from"./utils-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/diff-view-DLPDcgEV.js","assets/rolldown-runtime-QTnfLwEv.js","assets/react-runtime-CCIEwYL0.js","assets/utils-DNvmfH6b.js","assets/bundle-mjs-BT31bpU6.js","assets/chevron-right-BENZ-1ZN.js","assets/createLucideIcon-BHp8sXmF.js","assets/diff-stat-BXriPIds.js","assets/highlighter-CdHqIwFr.js","assets/lib-BQXq3kEf.js","assets/image-preview-WXKTY8KT.js","assets/zoomable-image-yNqiuVu7.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{t as r}from"./utils-DNvmfH6b.js";import{i}from"./bundle-mjs-BT31bpU6.js";import{t as a}from"./diff-stat-BXriPIds.js";import{n as o,t as s}from"./image-preview-WXKTY8KT.js";var c=e(t(),1),l=n();function u(e){let[t,n]=(0,c.useState)(null);return(0,c.useEffect)(()=>{let e=!1;return i(()=>import(`./diff-view-DLPDcgEV.js`).then(t=>{e||n({View:t.DiffView})},()=>{e||n(`failed`)}),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11])),()=>{e=!0}},[]),e.files.length===0?(0,l.jsx)(`p`,{"data-slot":`diff-empty`,className:r(`px-1 text-xs text-soft-foreground`,e.className),children:`No changes.`}):t===`failed`?(0,l.jsx)(d,{...e}):t===null?(0,l.jsx)(`p`,{"data-slot":`diff-loading`,className:r(`px-1 text-xs text-soft-foreground`,e.className),children:`Loading diff…`}):(0,l.jsx)(t.View,{...e})}function d({files:e,wrap:t=!1,imageSrc:n,onOpenInApp:i,viewRef:o,className:s}){let u={adds:e.reduce((e,t)=>e+t.adds,0),dels:e.reduce((e,t)=>e+t.dels,0),files:e.length},d=(0,c.useRef)(null);return(0,c.useImperativeHandle)(o,()=>({scrollToPath:e=>{for(let t of d.current?.querySelectorAll(`[data-slot="diff-file"]`)??[])if(t.dataset.path===e){t.scrollIntoView({block:`start`,behavior:`smooth`});return}}})),(0,l.jsxs)(`div`,{ref:d,"data-slot":`diff`,"data-fallback":`true`,className:r(`flex min-w-0 flex-col gap-3`,s),children:[(0,l.jsxs)(`p`,{"data-slot":`diff-totals`,className:`flex items-center gap-2 px-1 text-xs text-muted-foreground`,children:[(0,l.jsxs)(`span`,{children:[u.files,` `,u.files===1?`file`:`files`,` changed`]}),(0,l.jsx)(a,{stat:u})]}),e.map(e=>(0,l.jsx)(f,{file:e,wrap:t,imageSrc:n,onOpenInApp:i},`${e.oldPath??``}→${e.path}`))]})}function f({file:e,wrap:t,imageSrc:n,onOpenInApp:i}){return(0,l.jsxs)(`section`,{"data-slot":`diff-file`,"data-path":e.path,className:`min-w-0 overflow-clip rounded-md border border-border bg-card`,children:[(0,l.jsxs)(`header`,{className:`flex items-center gap-2 border-b border-border/50 px-3 py-2`,children:[(0,l.jsx)(`span`,{"data-slot":`diff-file-path`,className:`min-w-0 truncate font-mono text-xs font-medium`,children:e.oldPath?`${e.oldPath} → ${e.path}`:e.path}),(0,l.jsx)(`span`,{className:`ml-auto shrink-0`,children:(0,l.jsx)(a,{stat:{adds:e.adds,dels:e.dels,files:1},className:`text-[11px]`})})]}),o(e)?(0,l.jsx)(s,{file:e,imageSrc:n,onOpenInApp:i}):e.binary?(0,l.jsx)(`p`,{className:`px-4 py-2.5 text-xs text-soft-foreground`,children:`Binary file — no text diff.`}):e.patch===``?(0,l.jsx)(`p`,{className:`px-4 py-2.5 text-xs text-soft-foreground`,children:`No content changes (metadata only).`}):(0,l.jsx)(`pre`,{className:r(`py-2 font-mono text-xs leading-[1.7]`,t?`break-words whitespace-pre-wrap`:`overflow-x-auto whitespace-pre`),children:e.patch.split(`
|
|
3
3
|
`).map((e,t)=>(0,l.jsxs)(`span`,{className:r(`block px-4`,e.startsWith(`+`)&&!e.startsWith(`+++`)&&`bg-diff-add`,e.startsWith(`-`)&&!e.startsWith(`---`)&&`bg-diff-del`,e.startsWith(`@@`)&&`text-soft-foreground`),children:[e,e===``?` `:``]},t))})]})}export{u as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./react-runtime-CCIEwYL0.js";import{d as t,gt as n,rt as r}from"./alert-dialog-
|
|
1
|
+
import{t as e}from"./react-runtime-CCIEwYL0.js";import{d as t,gt as n,rt as r}from"./alert-dialog-CVF_qvQ8.js";import{t as i}from"./utils-DNvmfH6b.js";import{t as a}from"./createLucideIcon-BHp8sXmF.js";var o=a(`circle-question-mark`,[[`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`}]]),s=a(`text-wrap`,[[`path`,{d:`m16 16-3 3 3 3`,key:`117b85`}],[`path`,{d:`M3 12h14.5a1 1 0 0 1 0 7H13`,key:`18xa6z`}],[`path`,{d:`M3 19h6`,key:`1ygdsz`}],[`path`,{d:`M3 5h18`,key:`1u36vt`}]]),c=e();function l({mode:e,wrap:n,onModeChange:r,onWrapChange:a}){return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsxs)(`span`,{"data-slot":`diff-mode-toggle`,role:`group`,"aria-label":`Diff layout`,className:`flex items-center gap-2`,children:[(0,c.jsx)(u,{current:e,value:`unified`,onModeChange:r}),(0,c.jsx)(u,{current:e,value:`split`,onModeChange:r})]}),(0,c.jsx)(t,{variant:`ghost`,size:`icon-sm`,"data-slot":`wrap-toggle`,"aria-pressed":n,"aria-label":`Wrap long lines`,title:`Wrap long lines`,className:i(`size-11`,n&&`bg-muted text-foreground`),onClick:()=>a(!n),children:(0,c.jsx)(s,{"aria-hidden":`true`})})]})}function u({current:e,value:t,onModeChange:n}){let a=e===t;return(0,c.jsxs)(`button`,{type:`button`,"data-mode":t,"aria-pressed":a,onClick:()=>n(t),className:i(`inline-flex items-center gap-2 min-h-11 rounded-lg border border-border bg-card px-3 text-xs font-medium capitalize`,a?`border-accent-text/40 text-accent-text`:`text-muted-foreground hover:text-foreground`),children:[t===`unified`?(0,c.jsx)(o,{"aria-hidden":`true`,className:`size-4`}):(0,c.jsx)(r,{size:16,"aria-hidden":`true`,className:`size-4`}),t]})}function d({branch:e}){return(0,c.jsxs)(`span`,{"data-slot":`branch-chip`,className:`flex min-w-0 items-center gap-1 rounded-sm border border-border bg-card px-1.5 py-px font-mono text-[11px] font-medium`,children:[(0,c.jsx)(n,{size:16,"aria-hidden":`true`,className:`size-3 shrink-0`}),(0,c.jsx)(`span`,{className:`truncate`,children:e})]})}export{l as n,d as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./react-runtime-CCIEwYL0.js";import{t}from"./utils-
|
|
1
|
+
import{t as e}from"./react-runtime-CCIEwYL0.js";import{t}from"./utils-DNvmfH6b.js";var n=e();function r(e){if(e<1e3)return String(e);let t=[`k`,`M`,`B`,`T`],n=Math.floor(Math.log10(e)/3);return n>t.length?e.toExponential(0).replace(`+`,``):`${Math.floor(e/1e3**n)}${t[n-1]}`}function i({stat:e,className:i,compact:a=!1}){let o=`+${e.adds} −${e.dels} across ${e.files} ${e.files===1?`file`:`files`}`,s=e.repointed?`${o} — measured against another branch checked out in this task's worktree, as this task found it`:void 0;return(0,n.jsxs)(`span`,{"data-slot":`diff-stat`,...s?{"data-repointed":`true`,"aria-label":s}:{},...a&&!s?{"aria-label":o}:{},title:s??o,className:t(`font-mono text-xs font-semibold tabular-nums`,e.repointed&&`cursor-help underline decoration-dotted underline-offset-2`,i),children:[(0,n.jsxs)(`span`,{className:`text-success`,children:[`+`,a?r(e.adds):e.adds.toLocaleString(`en-US`)]}),` `,(0,n.jsxs)(`span`,{className:`text-danger`,children:[`−`,a?r(e.dels):e.dels.toLocaleString(`en-US`)]})]})}export{i as t};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{t as r}from"./utils-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{t as r}from"./utils-DNvmfH6b.js";import{t as i}from"./chevron-right-BENZ-1ZN.js";import{t as a}from"./diff-stat-BXriPIds.js";import{a as o,i as s,r as c}from"./highlighter-CdHqIwFr.js";import{t as l}from"./lib-BQXq3kEf.js";import{n as u,t as d}from"./image-preview-WXKTY8KT.js";var f=e(t(),1),p=44;function m(e){if(e.binary===!0||e.patch===``)return 1;let t=e.patch.split(`
|
|
2
2
|
`),n=t.findIndex(e=>e.startsWith(`@@`));return n===-1?t.length:t.length-n}function h(e){return m(e)*20+p}function g(e){return e.reduce((e,t)=>e+m(t),0)}function _(e,t){let n=new URLSearchParams(e).get(`diff`);return n===`flat`||n===`virtual`?n:t>1500?`virtual`:`flat`}function v(e){return`${e.oldPath??``}→${e.path}`}function y(e){let t=0;for(let n of e.split(`
|
|
3
3
|
`))n.length>t&&(t=n.length);return t}var b=/[A-Za-z0-9_]+|\s+|[^\sA-Za-z0-9_]+/g,x=300,S=.3;function C(e,t){if(e===t)return null;let n=e.match(b)??[],r=t.match(b)??[];if(n.length===0||r.length===0||n.length>x||r.length>x)return null;let i=r.length+1,a=new Uint16Array((n.length+1)*i);for(let e=1;e<=n.length;e++)for(let t=1;t<=r.length;t++)a[e*i+t]=n[e-1]===r[t-1]?(a[(e-1)*i+(t-1)]??0)+1:Math.max(a[(e-1)*i+t]??0,a[e*i+(t-1)]??0);if((a[n.length*i+r.length]??0)/Math.max(n.length,r.length)<S)return null;let o=Array(n.length).fill(!1),s=Array(r.length).fill(!1),c=n.length,l=r.length;for(;c>0&&l>0;)n[c-1]===r[l-1]?(o[c-1]=!0,s[l-1]=!0,c--,l--):(a[(c-1)*i+l]??0)>=(a[c*i+(l-1)]??0)?c--:l--;return{del:w(n,o),add:w(r,s)}}function w(e,t){let n=[];return e.forEach((e,r)=>{let i=!(t[r]??!1),a=n[n.length-1];a&&a.changed===i?a.text+=e:n.push({text:e,changed:i})}),n}function T(e,t,n){if(!t||t.length===0)return e?e.map(e=>({text:e.content,color:e.color,changed:!1})):n===``?[]:[{text:n,changed:!1}];if(!e||e.length===0)return t.map(e=>({text:e.text,changed:e.changed}));let r=[],i=0,a=0,o=0,s=0;for(;i<e.length&&o<t.length;){let n=e[i],c=t[o],l=n.content.length-a,u=c.text.length-s,d=Math.min(l,u);d>0&&(r.push({text:n.content.slice(a,a+d),color:n.color,changed:c.changed}),a+=d,s+=d),n.content.length-a<=0&&(i++,a=0),c.text.length-s<=0&&(o++,s=0)}for(;i<e.length;){let t=e[i],n=t.content.slice(a);n!==``&&r.push({text:n,color:t.color,changed:!1}),i++,a=0}return r}var E=/^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/,D=`… (patch truncated)`;function O(e){let t=[],n=!1,r=null,i=0,a=0,o=e.split(`
|
|
4
4
|
`);o.at(-1)===``&&o.pop();for(let e of o){let o=E.exec(e);if(o){r={header:e,oldStart:Number(o[1]),oldCount:o[2]===void 0?1:Number(o[2]),newStart:Number(o[3]),newCount:o[4]===void 0?1:Number(o[4]),lines:[]},i=r.oldStart,a=r.newStart,t.push(r);continue}if(e.includes(D)){n=!0,r=null;continue}r&&(e.startsWith(`+`)?r.lines.push({kind:`add`,text:e.slice(1),newLine:a++}):e.startsWith(`-`)?r.lines.push({kind:`del`,text:e.slice(1),oldLine:i++}):e.startsWith(`\\`)||r.lines.push({kind:`context`,text:e.slice(1),oldLine:i++,newLine:a++}))}return{hunks:t,truncated:n}}function k(e,t=!1){let n=[],r=e[0];if(!r)return n;r.newStart>1&&n.push({beforeHunk:0,count:r.newStart-1,oldStart:1,newStart:1});for(let t=1;t<e.length;t++){let r=e[t-1],i=e[t],a=r.oldStart+r.oldCount,o=r.newStart+r.newCount,s=i.newStart-o;s>0&&n.push({beforeHunk:t,count:s,oldStart:a,newStart:o})}if(t){let t=e[e.length-1];n.push({beforeHunk:e.length,oldStart:t.oldStart+t.oldCount,newStart:t.newStart+t.newCount})}return n}function A(e,t){let n=e.count===void 0?t.length:e.newStart+e.count-1,r=e.oldStart-e.newStart,i=[];for(let a=e.newStart;a<=Math.min(n,t.length);a++)i.push({kind:`context`,text:t[a-1]??``,oldLine:a+r,newLine:a});return i}function j(e,t){let n=Array(e.length),r=Array(t.length),i=Math.min(e.length,t.length);for(let a=0;a<i;a++){let i=C(e[a].text,t[a].text);i&&(n[a]=i.del,r[a]=i.add)}return{dels:e,adds:t,delSpans:n,addSpans:r}}function M(e,t,n){let r=0;for(;r<e.lines.length;){let i=e.lines[r];if(i.kind===`del`||i.kind===`add`){let t=[],i=[];for(;r<e.lines.length&&e.lines[r].kind===`del`;)t.push(e.lines[r++]);for(;r<e.lines.length&&e.lines[r].kind===`add`;)i.push(e.lines[r++]);n(j(t,i))}else t(i),r++}}function N(e,t=[],n){let r=new Map(t.map(e=>[e.beforeHunk,e])),i=[],a=e=>{let t=r.get(e);if(!t)return;let a=n?.get(e);if(a)for(let e of a)i.push({type:`line`,cell:{line:e}});else i.push({type:`gap`,gap:t})};return e.forEach((e,t)=>{a(t),i.push({type:`hunk`,hunk:e}),M(e,e=>i.push({type:`line`,cell:{line:e}}),e=>{e.dels.forEach((t,n)=>i.push({type:`line`,cell:{line:t,spans:e.delSpans[n]}})),e.adds.forEach((t,n)=>i.push({type:`line`,cell:{line:t,spans:e.addSpans[n]}}))})}),a(e.length),i}function P(e,t=[],n){let r=new Map(t.map(e=>[e.beforeHunk,e])),i=[],a=e=>{let t=r.get(e);if(!t)return;let a=n?.get(e);if(a)for(let e of a)i.push({type:`pair`,left:{line:e},right:{line:e}});else i.push({type:`gap`,gap:t})};return e.forEach((e,t)=>{a(t),i.push({type:`hunk`,hunk:e}),M(e,e=>i.push({type:`pair`,left:{line:e},right:{line:e}}),e=>{let t=Math.max(e.dels.length,e.adds.length);for(let n=0;n<t;n++){let t=e.dels[n],r=e.adds[n];i.push({type:`pair`,...t?{left:{line:t,spans:e.delSpans[n]}}:{},...r?{right:{line:r,spans:e.addSpans[n]}}:{}})}})}),a(e.length),i}var F=n(),I=1500,L=new Map;function R(e,t){if(e){for(let n of e.querySelectorAll(`[data-slot="diff-file"]`))if(n.dataset.path===t)return n}}function z({files:e,mode:t=`unified`,wrap:n=!1,loadFileText:i,imageSrc:o,onOpenInApp:s,viewRef:c,className:l}){let u=(0,f.useMemo)(()=>({adds:e.reduce((e,t)=>e+t.adds,0),dels:e.reduce((e,t)=>e+t.dels,0),files:e.length}),[e]),[d,p]=(0,f.useState)(()=>new Set),[m,y]=(0,f.useState)(()=>new Map),b=(0,f.useCallback)(e=>{p(t=>{let n=new Set(t);return n.delete(e)||n.add(e),n})},[]),x=(0,f.useCallback)(async(e,t)=>{if(!i)return;let n=await i(e.path);if(n===null)return;let r=A(t,n.split(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,r as n,t as r}from"./react-runtime-CCIEwYL0.js";import{A as i,C as a,D as o,E as s,I as c,M as l,N as u,O as d,P as f,S as p,T as m,Y as h,b as g,et as _,j as v,k as y,w as b,x,z as S}from"./alert-dialog-BOp2HnnL.js";import{t as C}from"./utils-GZNjgma4.js";var w=e(t(),1),T=r();function E(e){let t=e+`CollectionProvider`,[n,r]=l(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=e=>{let{scope:t,children:n}=e,r=w.useRef(null),a=w.useRef(new Map).current;return(0,T.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})};o.displayName=t;let s=e+`CollectionSlot`,u=c(s),d=w.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=S(t,a(s,n).collectionRef);return(0,T.jsx)(u,{ref:i,children:r})});d.displayName=s;let f=e+`CollectionItemSlot`,p=`data-radix-collection-item`,m=c(f),h=w.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=w.useRef(null),s=S(t,o),c=a(f,n);return w.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,T.jsx)(m,{[p]:``,ref:s,children:r})});h.displayName=f;function g(t){let n=a(e+`CollectionConsumer`,t);return w.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${p}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:o,Slot:d,ItemSlot:h},g,r]}var D=w.createContext(void 0);function O(e){let t=w.useContext(D);return e||t||`ltr`}var k=e(n(),1);function A(e){let[t,n]=w.useState(void 0);return i(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else n(void 0)},[e]),t}var j=[`top`,`right`,`bottom`,`left`],M=Math.min,N=Math.max,P=Math.round,F=Math.floor,I=e=>({x:e,y:e}),ee={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function te(e,t,n){return N(e,M(t,n))}function L(e,t){return typeof e==`function`?e(t):e}function R(e){return e.split(`-`)[0]}function z(e){return e.split(`-`)[1]}function B(e){return e===`x`?`y`:`x`}function ne(e){return e===`y`?`height`:`width`}function V(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function re(e){return B(V(e))}function ie(e,t,n){n===void 0&&(n=!1);let r=z(e),i=re(e),a=ne(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=pe(o)),[o,pe(o)]}function ae(e){let t=pe(e);return[oe(e),t,oe(t)]}function oe(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var se=[`left`,`right`],ce=[`right`,`left`],le=[`top`,`bottom`],ue=[`bottom`,`top`];function de(e,t,n){switch(e){case`top`:case`bottom`:return n?t?ce:se:t?se:ce;case`left`:case`right`:return t?le:ue;default:return[]}}function fe(e,t,n,r){let i=z(e),a=de(R(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(oe)))),a}function pe(e){let t=R(e);return ee[t]+e.slice(t.length)}function me(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function he(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:me(e)}function ge(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 _e(e,t,n){let{reference:r,floating:i}=e,a=V(t),o=re(t),s=ne(o),c=R(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=z(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function ve(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}=L(t,e),p=he(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=ge(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=ge(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 ye=50,be=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:ve},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=_e(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<ye&&(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}=_e(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},xe=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}=L(e,t)||{};if(l==null)return{};let d=he(u),f={x:n,y:r},p=re(i),m=ne(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=M(d[_],T),D=M(d[v],T),O=C-h[m]-D,k=C/2-h[m]/2+w,A=te(E,k,O),j=!c.arrow&&z(i)!=null&&k!==A&&a.reference[m]/2-(k<E?E:D)-h[m]/2<0,N=j?k<E?k-E:k-O:0;return{[p]:f[p]+N,data:{[p]:A,centerOffset:k-A-N,...j&&{alignmentOffset:N}},reset:j}}}),Se=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}=L(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=R(r),_=V(o),v=R(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[pe(o)]:ae(o)),x=p!==`none`;!d&&x&&b.push(...fe(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=ie(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`&&_!==V(t))||T.every(e=>V(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=V(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;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function Ce(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function we(e){return j.some(t=>e[t]>=0)}var Te=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=L(e,t);switch(i){case`referenceHidden`:{let e=Ce(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:we(e)}}}case`escaped`:{let e=Ce(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:we(e)}}}default:return{}}}}},Ee=new Set([`left`,`top`]);async function De(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=R(n),s=z(n),c=V(n)===`y`,l=Ee.has(o)?-1:1,u=a&&c?-1:1,d=L(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 Oe=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 De(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}}}}},ke=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}=L(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=V(i),p=B(f),m=u[p],h=u[f],g=(e,t)=>te(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}}}}}},Ae=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}=L(e,t),u={x:n,y:r},d=V(i),f=B(d),p=u[f],m=u[d],h=L(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=Ee.has(R(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}}}},je=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}=L(e,t),c=await i.detectOverflow(t,s),l=R(n),u=z(n),d=V(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=M(p-c[m],g),y=M(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*N(c.left,c.right):S=p-2*N(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 Me(){return typeof window<`u`}function Ne(e){return Pe(e)?(e.nodeName||``).toLowerCase():`#document`}function H(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function U(e){return((Pe(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Pe(e){return Me()?e instanceof Node||e instanceof H(e).Node:!1}function W(e){return Me()?e instanceof Element||e instanceof H(e).Element:!1}function G(e){return Me()?e instanceof HTMLElement||e instanceof H(e).HTMLElement:!1}function Fe(e){return!Me()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof H(e).ShadowRoot}function Ie(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=q(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Le(e){return/^(table|td|th)$/.test(Ne(e))}function Re(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var ze=/transform|translate|scale|rotate|perspective|filter/,Be=/paint|layout|strict|content/,K=e=>!!e&&e!==`none`,Ve;function He(e){let t=W(e)?q(e):e;return K(t.transform)||K(t.translate)||K(t.scale)||K(t.rotate)||K(t.perspective)||!We()&&(K(t.backdropFilter)||K(t.filter))||ze.test(t.willChange||``)||Be.test(t.contain||``)}function Ue(e){let t=J(e);for(;G(t)&&!Ge(t);){if(He(t))return t;if(Re(t))return null;t=J(t)}return null}function We(){return Ve??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Ve}function Ge(e){return/^(html|body|#document)$/.test(Ne(e))}function q(e){return H(e).getComputedStyle(e)}function Ke(e){return W(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function J(e){if(Ne(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Fe(e)&&e.host||U(e);return Fe(t)?t.host:t}function qe(e){let t=J(e);return Ge(t)?(e.ownerDocument||e).body:G(t)&&Ie(t)?t:qe(t)}function Je(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=qe(e),i=r===e.ownerDocument?.body,a=H(r);if(i){let e=Ye(a);return t.concat(a,a.visualViewport||[],Ie(r)?r:[],e&&n?Je(e):[])}else return t.concat(r,Je(r,[],n))}function Ye(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Xe(e){let t=q(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=G(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=P(n)!==a||P(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Ze(e){return W(e)?e:e.contextElement}function Qe(e){let t=Ze(e);if(!G(t))return I(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Xe(t),o=(a?P(n.width):n.width)/r,s=(a?P(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var $e=I(0);function et(e){let t=H(e);return!We()||!t.visualViewport?$e:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function tt(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===H(e)}function Y(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Ze(e),o=I(1);t&&(r?W(r)&&(o=Qe(r)):o=Qe(e));let s=tt(a,n,r)?et(a):I(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=H(a),t=W(r)?H(r):r,n=e,i=Ye(n);for(;i&&t!==n;){let e=Qe(i),t=i.getBoundingClientRect(),r=q(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=H(i),i=Ye(n)}}return ge({width:u,height:d,x:c,y:l})}function nt(e,t){let n=Ke(e).scrollLeft;return t?t.left+n:Y(U(e)).left+n}function rt(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-nt(e,n),y:n.top+t.scrollTop}}function it(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=U(r),s=t?Re(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=I(1),u=I(0),d=G(r);if((d||!a)&&((Ne(r)!==`body`||Ie(o))&&(c=Ke(r)),d)){let e=Y(r);l=Qe(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?rt(o,c):I(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 at(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function ot(e){let t=Ke(e),n=e.ownerDocument.body,r=N(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=N(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+nt(e),o=-t.scrollTop;return q(n).direction===`rtl`&&(a+=N(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var st=25;function ct(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=H(e),a=U(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!We()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(nt(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<=st&&(s-=o)}return{width:s,height:c,x:l,y:u}}function lt(e,t){let n=Y(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Qe(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function ut(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=ct(e,n,t);else if(t===`document`)r=ot(U(e));else if(W(t))r=lt(t,n);else{let n=et(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return ge(r)}function dt(e,t){let n=t.get(e);if(n)return n;let r=Je(e,[],!1).filter(e=>W(e)&&Ne(e)!==`body`),i=null,a=q(e).position===`fixed`,o=a?J(e):e;for(;W(o)&&!Ge(o);){let e=q(o),t=He(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=J(o)}return t.set(e,r),r}function ft(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Re(t)?[]:dt(t,this._c):[].concat(n),r],o=ut(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=ut(t,a[e],i);s=N(n.top,s),c=M(n.right,c),l=M(n.bottom,l),u=N(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function pt(e){let{width:t,height:n}=Xe(e);return{width:t,height:n}}function mt(e,t,n){let r=G(t),i=U(t),a=n===`fixed`,o=Y(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=I(0);if((r||!a)&&((Ne(t)!==`body`||Ie(i))&&(s=Ke(t)),r)){let e=Y(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=nt(i));let l=i&&!r&&!a?rt(i,s):I(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 ht(e){return q(e).position===`static`}function gt(e,t){if(!G(e)||q(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return U(e)===n&&(n=n.ownerDocument.body),n}function _t(e,t){let n=H(e);if(Re(e))return n;if(!G(e)){let t=J(e);for(;t&&!Ge(t);){if(W(t)&&!ht(t))return t;t=J(t)}return n}let r=gt(e,t);for(;r&&Le(r)&&ht(r);)r=gt(r,t);return r&&Ge(r)&&ht(r)&&!He(r)?n:r||Ue(e)||n}var vt=async function(e){let t=this.getOffsetParent||_t,n=this.getDimensions,r=await n(e.floating);return{reference:mt(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function yt(e){return q(e).direction===`rtl`}var bt={convertOffsetParentRelativeRectToViewportRelativeRect:it,getDocumentElement:U,getClippingRect:ft,getOffsetParent:_t,getElementRects:vt,getClientRects:at,getDimensions:pt,getScale:Qe,isElement:W,isRTL:yt};function xt(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function St(e,t,n){let r=null,i,a=U(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=F(d),h=F(a.clientWidth-(u+f)),g=F(a.clientHeight-(d+p)),_=F(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:N(0,M(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!xt(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=H(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function Ct(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=Ze(e),u=i||a?[...l?Je(l):[],...t?Je(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?St(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?Y(e):null;c&&g();function g(){let t=Y(e);h&&!xt(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 wt=Oe,Tt=ke,Et=Se,Dt=je,Ot=Te,kt=xe,At=Ae,jt=(e,t,n)=>{let r=new Map,i=n??{},a={...bt,...i.platform,_c:r};return be(e,t,{...i,platform:a})},Mt=typeof document<`u`?w.useLayoutEffect:function(){};function Nt(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(!Nt(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)&&!Nt(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Pt(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ft(e,t){let n=Pt(e);return Math.round(t*n)/n}function It(e){let t=w.useRef(e);return Mt(()=>{t.current=e}),t}function Lt(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]=w.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=w.useState(r);Nt(f,r)||p(r);let[m,h]=w.useState(null),[g,_]=w.useState(null),v=w.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=w.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=w.useRef(null),C=w.useRef(null),T=w.useRef(u),E=c!=null,D=It(c),O=It(i),A=It(l),j=w.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),jt(S.current,C.current,e).then(e=>{let t={...e,isPositioned:A.current!==!1};M.current&&!Nt(T.current,t)&&(T.current=t,k.flushSync(()=>{d(t)}))})},[f,t,n,O,A]);Mt(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let M=w.useRef(!1);Mt(()=>(M.current=!0,()=>{M.current=!1}),[]),Mt(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(D.current)return D.current(b,x,j);j()}},[b,x,j,D,E]);let N=w.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),P=w.useMemo(()=>({reference:b,floating:x}),[b,x]),F=w.useMemo(()=>{let e={position:n,left:0,top:0};if(!P.floating)return e;let t=Ft(P.floating,u.x),r=Ft(P.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Pt(P.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,P.floating,u.x,u.y]);return w.useMemo(()=>({...u,update:j,refs:N,elements:P,floatingStyles:F}),[u,j,N,P,F])}var Rt=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?{}:kt({element:r.current,padding:i}).fn(n):r?kt({element:r,padding:i}).fn(n):{}}}},zt=(e,t)=>{let n=wt(e);return{name:n.name,fn:n.fn,options:[e,t]}},Bt=(e,t)=>{let n=Tt(e);return{name:n.name,fn:n.fn,options:[e,t]}},Vt=(e,t)=>({fn:At(e).fn,options:[e,t]}),Ht=(e,t)=>{let n=Et(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ut=(e,t)=>{let n=Dt(e);return{name:n.name,fn:n.fn,options:[e,t]}},Wt=(e,t)=>{let n=Ot(e);return{name:n.name,fn:n.fn,options:[e,t]}},Gt=(e,t)=>{let n=Rt(e);return{name:n.name,fn:n.fn,options:[e,t]}},Kt=`Arrow`,qt=w.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,T.jsx)(u.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,T.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});qt.displayName=Kt;var Jt=qt,Yt=`Popper`,[Xt,Zt]=l(Yt),[Qt,$t]=Xt(Yt),en=e=>{let{__scopePopper:t,children:n}=e,[r,i]=w.useState(null),[a,o]=w.useState(void 0);return(0,T.jsx)(Qt,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})};en.displayName=Yt;var tn=`PopperAnchor`,nn=w.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=$t(tn,n),o=w.useRef(null),s=a.onAnchorChange,c=S(t,w.useCallback(e=>{o.current=e,e&&s(e)},[s])),l=w.useRef(null);w.useEffect(()=>{if(!r)return;let e=l.current;l.current=r.current,e!==l.current&&s(l.current)});let d=a.placementState&&pn(a.placementState),f=d?.[0],p=d?.[1];return r?null:(0,T.jsx)(u.div,{"data-radix-popper-side":f,"data-radix-popper-align":p,...i,ref:c})});nn.displayName=tn;var rn=`PopperContent`,[an,on]=Xt(rn),sn=w.forwardRef((e,t)=>{let{__scopePopper:n,side:r=`bottom`,sideOffset:a=0,align:o=`center`,alignOffset:c=0,arrowPadding:l=0,avoidCollisions:d=!0,collisionBoundary:f=[],collisionPadding:p=0,sticky:m=`partial`,hideWhenDetached:h=!1,updatePositionStrategy:g=`optimized`,onPlaced:_,...v}=e,y=$t(rn,n),[b,x]=w.useState(null),C=S(t,x),[E,D]=w.useState(null),O=A(E),k=O?.width??0,j=O?.height??0,M=r+(o===`center`?``:`-`+o),N=typeof p==`number`?p:{top:0,right:0,bottom:0,left:0,...p},P=Array.isArray(f)?f:[f],F=P.length>0,I={padding:N,boundary:P.filter(dn),altBoundary:F},{refs:ee,floatingStyles:te,placement:L,isPositioned:R,middlewareData:z}=Lt({strategy:`fixed`,placement:M,whileElementsMounted:(...e)=>Ct(...e,{animationFrame:g===`always`}),elements:{reference:y.anchor},middleware:[zt({mainAxis:a+j,alignmentAxis:c}),d&&Bt({mainAxis:!0,crossAxis:!1,limiter:m===`partial`?Vt():void 0,...I}),d&&Ht({...I}),Ut({...I,apply:({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`)}}),E&&Gt({element:E,padding:l}),fn({arrowWidth:k,arrowHeight:j}),h&&Wt({strategy:`referenceHidden`,...I,boundary:F?I.boundary:void 0})]}),B=y.setPlacementState;i(()=>(B(L),()=>{B(void 0)}),[L,B]);let[ne,V]=pn(L),re=s(_);i(()=>{R&&re?.()},[R,re]);let ie=z.arrow?.x,ae=z.arrow?.y,oe=z.arrow?.centerOffset!==0,[se,ce]=w.useState();return i(()=>{b&&ce(window.getComputedStyle(b).zIndex)},[b]),(0,T.jsx)(`div`,{ref:ee.setFloating,"data-radix-popper-content-wrapper":``,style:{...te,transform:R?te.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:se,"--radix-popper-transform-origin":[z.transformOrigin?.x,z.transformOrigin?.y].join(` `),...z.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,T.jsx)(an,{scope:n,placedSide:ne,placedAlign:V,onArrowChange:D,arrowX:ie,arrowY:ae,shouldHideArrow:oe,children:(0,T.jsx)(u.div,{"data-side":ne,"data-align":V,...v,ref:C,style:{...v.style,animation:R?void 0:`none`}})})})});sn.displayName=rn;var cn=`PopperArrow`,ln={top:`bottom`,right:`left`,bottom:`top`,left:`right`},un=w.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=on(cn,n),a=ln[i.placedSide];return(0,T.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,T.jsx)(Jt,{...r,ref:t,style:{...r.style,display:`block`}})})});un.displayName=cn;function dn(e){return e!==null}var fn=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]=pn(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}}}});function pn(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var mn=en,hn=nn,gn=sn,_n=un,vn=!1;function yn(){let[e,t]=w.useState(vn);return w.useEffect(()=>{vn||(vn=!0,t(!0))},[]),e}var bn=w.useSyncExternalStore;function xn(){return()=>{}}function Sn(){return bn(xn,()=>!0,()=>!1)}var Cn=typeof bn==`function`?Sn:yn,wn=`rovingFocusGroup.onEntryFocus`,Tn={bubbles:!1,cancelable:!0},En=`RovingFocusGroup`,[Dn,On,kn]=E(En),[An,jn]=l(En,[kn]),[Mn,Nn]=An(En),Pn=w.forwardRef((e,t)=>(0,T.jsx)(Dn.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,T.jsx)(Dn.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,T.jsx)(Fn,{...e,ref:t})})}));Pn.displayName=En;var Fn=w.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:l,onEntryFocus:d,preventScrollOnEntryFocus:f=!1,...p}=e,m=w.useRef(null),h=S(t,m),g=O(a),[_,b]=y({prop:o,defaultProp:c??null,onChange:l,caller:En}),[x,C]=w.useState(!1),E=s(d),D=On(n),k=w.useRef(!1),[A,j]=w.useState(0);return w.useEffect(()=>{let e=m.current;if(e)return e.addEventListener(wn,E),()=>e.removeEventListener(wn,E)},[E]),(0,T.jsx)(Mn,{scope:n,orientation:r,dir:g,loop:i,currentTabStopId:_,onItemFocus:w.useCallback(e=>b(e),[b]),onItemShiftTab:w.useCallback(()=>C(!0),[]),onFocusableItemAdd:w.useCallback(()=>j(e=>e+1),[]),onFocusableItemRemove:w.useCallback(()=>j(e=>e-1),[]),children:(0,T.jsx)(u.div,{tabIndex:x||A===0?-1:0,"data-orientation":r,...p,ref:h,style:{outline:`none`,...e.style},onMouseDown:v(e.onMouseDown,()=>{k.current=!0}),onFocus:v(e.onFocus,e=>{let t=!k.current;if(e.target===e.currentTarget&&t&&!x){let t=new CustomEvent(wn,Tn);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=D().filter(e=>e.focusable);Vn([e.find(e=>e.active),e.find(e=>e.id===_),...e].filter(Boolean).map(e=>e.ref.current),f)}}k.current=!1}),onBlur:v(e.onBlur,()=>C(!1))})})}),In=`RovingFocusGroupItem`,Ln=w.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,focusable:r=!0,active:a=!1,tabStopId:s,children:c,...l}=e,d=o(),f=s||d,p=Nn(In,n),m=p.currentTabStopId===f,h=On(n),{onFocusableItemAdd:g,onFocusableItemRemove:_,currentTabStopId:y}=p,b=Cn();return i(()=>{if(!(!b||!r))return g(),()=>_()},[b,r,g,_]),w.useEffect(()=>{if(!(b||!r))return g(),()=>_()},[b,r,g,_]),(0,T.jsx)(Dn.ItemSlot,{scope:n,id:f,focusable:r,active:a,children:(0,T.jsx)(u.span,{tabIndex:m?0:-1,"data-orientation":p.orientation,...l,ref:t,onMouseDown:v(e.onMouseDown,e=>{r?p.onItemFocus(f):e.preventDefault()}),onFocus:v(e.onFocus,()=>p.onItemFocus(f)),onKeyDown:v(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){p.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=Bn(e,p.orientation,p.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=h().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=p.loop?Hn(n,r+1):n.slice(r+1)}setTimeout(()=>Vn(n))}}),children:typeof c==`function`?c({isCurrentTabStop:m,hasTabStop:y!=null}):c})})});Ln.displayName=In;var Rn={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function zn(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function Bn(e,t,n){let r=zn(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return Rn[r]}function Vn(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function Hn(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Un=Pn,Wn=Ln,Gn=[`Enter`,` `],Kn=[`ArrowDown`,`PageUp`,`Home`],qn=[`ArrowUp`,`PageDown`,`End`],Jn=[...Kn,...qn],Yn={ltr:[...Gn,`ArrowRight`],rtl:[...Gn,`ArrowLeft`]},Xn={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},Zn=`Menu`,[Qn,$n,er]=E(Zn),[X,tr]=l(Zn,[er,Zt,jn]),nr=Zt(),rr=jn(),[ir,Z]=X(Zn),[ar,or]=X(Zn),sr=e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,c=nr(t),[l,u]=w.useState(null),d=w.useRef(!1),f=s(a),p=O(i);return w.useEffect(()=>{let e=()=>{d.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},t=()=>d.current=!1;return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),w.useEffect(()=>{if(!n)return;let e=()=>f(!1);return window.addEventListener(`blur`,e),()=>window.removeEventListener(`blur`,e)},[n,f]),(0,T.jsx)(mn,{...c,children:(0,T.jsx)(ir,{scope:t,open:n,onOpenChange:f,content:l,onContentChange:u,children:(0,T.jsx)(ar,{scope:t,onClose:w.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:d,dir:p,modal:o,children:r})})})};sr.displayName=Zn;var cr=`MenuAnchor`,lr=w.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=nr(n);return(0,T.jsx)(hn,{...i,...r,ref:t})});lr.displayName=cr;var ur=`MenuPortal`,[dr,fr]=X(ur,{forceMount:void 0}),pr=e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,o=Z(ur,t);return(0,T.jsx)(dr,{scope:t,forceMount:n,children:(0,T.jsx)(d,{present:n||o.open,children:(0,T.jsx)(a,{asChild:!0,container:i,children:r})})})};pr.displayName=ur;var Q=`MenuContent`,[mr,hr]=X(Q),gr=w.forwardRef((e,t)=>{let n=fr(Q,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=Z(Q,e.__scopeMenu),o=or(Q,e.__scopeMenu);return(0,T.jsx)(Qn.Provider,{scope:e.__scopeMenu,children:(0,T.jsx)(d,{present:r||a.open,children:(0,T.jsx)(Qn.Slot,{scope:e.__scopeMenu,children:o.modal?(0,T.jsx)(_r,{...i,ref:t}):(0,T.jsx)(vr,{...i,ref:t})})})})}),_r=w.forwardRef((e,t)=>{let n=Z(Q,e.__scopeMenu),r=w.useRef(null),i=S(t,r);return w.useEffect(()=>{let e=r.current;if(e)return g(e)},[]),(0,T.jsx)(br,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:v(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),vr=w.forwardRef((e,t)=>{let n=Z(Q,e.__scopeMenu);return(0,T.jsx)(br,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),yr=c(`MenuContent.ScrollLock`),br=w.forwardRef((e,t)=>{let{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:h,disableOutsideScroll:g,..._}=e,y=Z(Q,n),C=or(Q,n),E=nr(n),D=rr(n),O=$n(n),[k,A]=w.useState(null),j=w.useRef(null),M=S(t,j,y.onContentChange),N=w.useRef(0),P=w.useRef(``),F=w.useRef(0),I=w.useRef(null),ee=w.useRef(`right`),te=w.useRef(0),L=g?x:w.Fragment,R=g?{as:yr,allowPinchZoom:!0}:void 0,z=e=>{let t=P.current+e,n=O().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=ii(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;(function e(t){P.current=t,window.clearTimeout(N.current),t!==``&&(N.current=window.setTimeout(()=>e(``),1e3))})(t),o&&setTimeout(()=>o.focus())};w.useEffect(()=>()=>window.clearTimeout(N.current),[]),p();let B=w.useCallback(e=>ee.current===I.current?.side&&oi(e,I.current?.area),[]);return(0,T.jsx)(mr,{scope:n,searchRef:P,onItemEnter:w.useCallback(e=>{B(e)&&e.preventDefault()},[B]),onItemLeave:w.useCallback(e=>{B(e)||(j.current?.focus(),A(null))},[B]),onTriggerLeave:w.useCallback(e=>{B(e)&&e.preventDefault()},[B]),pointerGraceTimerRef:F,onPointerGraceIntentChange:w.useCallback(e=>{I.current=e},[]),children:(0,T.jsx)(L,{...R,children:(0,T.jsx)(b,{asChild:!0,trapped:i,onMountAutoFocus:v(a,e=>{e.preventDefault(),j.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:(0,T.jsx)(m,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:h,children:(0,T.jsx)(Un,{asChild:!0,...D,dir:C.dir,orientation:`vertical`,loop:r,currentTabStopId:k,onCurrentTabStopIdChange:A,onEntryFocus:v(c,e=>{C.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,T.jsx)(gn,{role:`menu`,"aria-orientation":`vertical`,"data-state":$r(y.open),"data-radix-menu-content":``,dir:C.dir,...E,..._,ref:M,style:{outline:`none`,..._.style},onKeyDown:v(_.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&z(e.key));let i=j.current;if(e.target!==i||!Jn.includes(e.key))return;e.preventDefault();let a=O().filter(e=>!e.disabled).map(e=>e.ref.current);qn.includes(e.key)&&a.reverse(),ni(a)}),onBlur:v(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(N.current),P.current=``)}),onPointerMove:v(e.onPointerMove,si(e=>{let t=e.target,n=te.current!==e.clientX;if(e.currentTarget.contains(t)&&n){let t=e.clientX>te.current?`right`:`left`;ee.current=t,te.current=e.clientX}}))})})})})})})});gr.displayName=Q;var xr=`MenuGroup`,Sr=w.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,T.jsx)(u.div,{role:`group`,...r,ref:t})});Sr.displayName=xr;var Cr=`MenuLabel`,wr=w.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,T.jsx)(u.div,{...r,ref:t})});wr.displayName=Cr;var Tr=`MenuItem`,Er=`menu.itemSelect`,Dr=w.forwardRef((e,t)=>{let{disabled:n=!1,onSelect:r,...i}=e,a=w.useRef(null),o=or(Tr,e.__scopeMenu),s=hr(Tr,e.__scopeMenu),c=S(t,a),l=w.useRef(!1),u=()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(Er,{bubbles:!0,cancelable:!0});e.addEventListener(Er,e=>r?.(e),{once:!0}),f(e,t),t.defaultPrevented?l.current=!1:o.onClose()}};return(0,T.jsx)(Or,{...i,ref:c,disabled:n,onClick:v(e.onClick,u),onPointerDown:t=>{e.onPointerDown?.(t),l.current=!0},onPointerUp:v(e.onPointerUp,e=>{l.current||e.currentTarget?.click()}),onKeyDown:v(e.onKeyDown,e=>{n||e.target!==e.currentTarget||s.searchRef.current!==``&&e.key===` `||Gn.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});Dr.displayName=Tr;var Or=w.forwardRef((e,t)=>{let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=hr(Tr,n),s=rr(n),c=w.useRef(null),l=S(t,c),[d,f]=w.useState(!1),[p,m]=w.useState(``);return w.useEffect(()=>{let e=c.current;e&&m((e.textContent??``).trim())},[a.children]),(0,T.jsx)(Qn.ItemSlot,{scope:n,disabled:r,textValue:i??p,children:(0,T.jsx)(Wn,{asChild:!0,...s,focusable:!r,children:(0,T.jsx)(u.div,{role:`menuitem`,"data-highlighted":d?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...a,ref:l,onPointerMove:v(e.onPointerMove,si(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:v(e.onPointerLeave,si(e=>o.onItemLeave(e))),onFocus:v(e.onFocus,()=>f(!0)),onBlur:v(e.onBlur,()=>f(!1))})})})}),kr=`MenuCheckboxItem`,Ar=w.forwardRef((e,t)=>{let{checked:n=!1,onCheckedChange:r,...i}=e;return(0,T.jsx)(Rr,{scope:e.__scopeMenu,checked:n,children:(0,T.jsx)(Dr,{role:`menuitemcheckbox`,"aria-checked":ei(n)?`mixed`:n,...i,ref:t,"data-state":ti(n),onSelect:v(i.onSelect,()=>r?.(ei(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Ar.displayName=kr;var jr=`MenuRadioGroup`,[Mr,Nr]=X(jr,{value:void 0,onValueChange:()=>{}}),Pr=w.forwardRef((e,t)=>{let{value:n,onValueChange:r,...i}=e,a=s(r);return(0,T.jsx)(Mr,{scope:e.__scopeMenu,value:n,onValueChange:a,children:(0,T.jsx)(Sr,{...i,ref:t})})});Pr.displayName=jr;var Fr=`MenuRadioItem`,Ir=w.forwardRef((e,t)=>{let{value:n,...r}=e,i=Nr(Fr,e.__scopeMenu),a=n===i.value;return(0,T.jsx)(Rr,{scope:e.__scopeMenu,checked:a,children:(0,T.jsx)(Dr,{role:`menuitemradio`,"aria-checked":a,...r,ref:t,"data-state":ti(a),onSelect:v(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});Ir.displayName=Fr;var Lr=`MenuItemIndicator`,[Rr,zr]=X(Lr,{checked:!1}),Br=w.forwardRef((e,t)=>{let{__scopeMenu:n,forceMount:r,...i}=e,a=zr(Lr,n);return(0,T.jsx)(d,{present:r||ei(a.checked)||a.checked===!0,children:(0,T.jsx)(u.span,{...i,ref:t,"data-state":ti(a.checked)})})});Br.displayName=Lr;var Vr=`MenuSeparator`,Hr=w.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,T.jsx)(u.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})});Hr.displayName=Vr;var Ur=`MenuArrow`,Wr=w.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=nr(n);return(0,T.jsx)(_n,{...i,...r,ref:t})});Wr.displayName=Ur;var Gr=`MenuSub`,[Kr,qr]=X(Gr),Jr=e=>{let{__scopeMenu:t,children:n,open:r=!1,onOpenChange:i}=e,a=Z(Gr,t),c=nr(t),[l,u]=w.useState(null),[d,f]=w.useState(null),p=s(i);return w.useEffect(()=>(a.open===!1&&p(!1),()=>p(!1)),[a.open,p]),(0,T.jsx)(mn,{...c,children:(0,T.jsx)(ir,{scope:t,open:r,onOpenChange:p,content:d,onContentChange:f,children:(0,T.jsx)(Kr,{scope:t,contentId:o(),triggerId:o(),trigger:l,onTriggerChange:u,children:n})})})};Jr.displayName=Gr;var Yr=`MenuSubTrigger`,Xr=w.forwardRef((e,t)=>{let n=Z(Yr,e.__scopeMenu),r=or(Yr,e.__scopeMenu),i=qr(Yr,e.__scopeMenu),a=hr(Yr,e.__scopeMenu),o=w.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:c}=a,l={__scopeMenu:e.__scopeMenu},u=w.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);w.useEffect(()=>u,[u]),w.useEffect(()=>{let e=s.current;return()=>{window.clearTimeout(e),c(null)}},[s,c]);let d=S(t,i.onTriggerChange);return(0,T.jsx)(lr,{asChild:!0,...l,children:(0,T.jsx)(Or,{id:i.triggerId,"aria-haspopup":`menu`,"aria-expanded":n.open,"aria-controls":n.open?i.contentId:void 0,"data-state":$r(n.open),...e,ref:d,onClick:t=>{e.onClick?.(t),!(e.disabled||t.defaultPrevented)&&(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:v(e.onPointerMove,si(t=>{a.onItemEnter(t),!t.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(a.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:v(e.onPointerLeave,si(e=>{u();let t=n.content?.getBoundingClientRect();if(t){let r=n.content?.dataset.side,i=r===`right`,o=i?-5:5,c=t[i?`left`:`right`],l=t[i?`right`:`left`];a.onPointerGraceIntentChange({area:[{x:e.clientX+o,y:e.clientY},{x:c,y:t.top},{x:l,y:t.top},{x:l,y:t.bottom},{x:c,y:t.bottom}],side:r}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(e),e.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:v(e.onKeyDown,t=>{e.disabled||t.target!==t.currentTarget||a.searchRef.current!==``&&t.key===` `||Yn[r.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())})})})});Xr.displayName=Yr;var Zr=`MenuSubContent`,Qr=w.forwardRef((e,t)=>{let n=fr(Q,e.__scopeMenu),{forceMount:r=n.forceMount,align:i=`start`,...a}=e,o=Z(Q,e.__scopeMenu),s=or(Q,e.__scopeMenu),c=qr(Zr,e.__scopeMenu),l=w.useRef(null),u=S(t,l);return(0,T.jsx)(Qn.Provider,{scope:e.__scopeMenu,children:(0,T.jsx)(d,{present:r||o.open,children:(0,T.jsx)(Qn.Slot,{scope:e.__scopeMenu,children:(0,T.jsx)(br,{id:c.contentId,"aria-labelledby":c.triggerId,...a,ref:u,align:i,side:s.dir===`rtl`?`left`:`right`,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{s.isUsingKeyboardRef.current&&l.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:v(e.onFocusOutside,e=>{e.target!==c.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:v(e.onEscapeKeyDown,e=>{s.onClose(),e.preventDefault()}),onKeyDown:v(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=Xn[s.dir].includes(e.key);t&&n&&(o.onOpenChange(!1),c.trigger?.focus(),e.preventDefault())})})})})})});Qr.displayName=Zr;function $r(e){return e?`open`:`closed`}function ei(e){return e===`indeterminate`}function ti(e){return ei(e)?`indeterminate`:e?`checked`:`unchecked`}function ni(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function ri(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function ii(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=ri(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function ai(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}function oi(e,t){return t?ai({x:e.clientX,y:e.clientY},t):!1}function si(e){return t=>t.pointerType===`mouse`?e(t):void 0}var ci=sr,li=lr,ui=pr,di=gr,fi=Sr,pi=wr,mi=Dr,hi=Ar,gi=Pr,_i=Ir,vi=Br,yi=Hr,bi=Wr,xi=Xr,Si=Qr,Ci=`DropdownMenu`,[wi,Ti]=l(Ci,[tr]),$=tr(),[Ei,Di]=wi(Ci),Oi=e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:s,modal:c=!0}=e,l=$(t),u=w.useRef(null),[d,f]=y({prop:i,defaultProp:a??!1,onChange:s,caller:Ci});return(0,T.jsx)(Ei,{scope:t,triggerId:o(),triggerRef:u,contentId:o(),open:d,onOpenChange:f,onOpenToggle:w.useCallback(()=>f(e=>!e),[f]),modal:c,children:(0,T.jsx)(ci,{...l,open:d,onOpenChange:f,dir:r,modal:c,children:n})})};Oi.displayName=Ci;var ki=`DropdownMenuTrigger`,Ai=w.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=Di(ki,n),o=$(n),s=S(t,a.triggerRef);return(0,T.jsx)(li,{asChild:!0,...o,children:(0,T.jsx)(u.button,{type:`button`,id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,disabled:r,...i,ref:s,onPointerDown:v(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:v(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})});Ai.displayName=ki;var ji=`DropdownMenuPortal`,Mi=e=>{let{__scopeDropdownMenu:t,...n}=e,r=$(t);return(0,T.jsx)(ui,{...r,...n})};Mi.displayName=ji;var Ni=`DropdownMenuContent`,Pi=w.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Di(Ni,n),a=$(n),o=w.useRef(!1);return(0,T.jsx)(di,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:v(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:v(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!i.modal||r)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});Pi.displayName=Ni;var Fi=`DropdownMenuGroup`,Ii=w.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,T.jsx)(fi,{...i,...r,ref:t})});Ii.displayName=Fi;var Li=`DropdownMenuLabel`,Ri=w.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,T.jsx)(pi,{...i,...r,ref:t})});Ri.displayName=Li;var zi=`DropdownMenuItem`,Bi=w.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,T.jsx)(mi,{...i,...r,ref:t})});Bi.displayName=zi;var Vi=`DropdownMenuCheckboxItem`,Hi=w.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,T.jsx)(hi,{...i,...r,ref:t})});Hi.displayName=Vi;var Ui=`DropdownMenuRadioGroup`,Wi=w.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,T.jsx)(gi,{...i,...r,ref:t})});Wi.displayName=Ui;var Gi=`DropdownMenuRadioItem`,Ki=w.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,T.jsx)(_i,{...i,...r,ref:t})});Ki.displayName=Gi;var qi=`DropdownMenuItemIndicator`,Ji=w.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,T.jsx)(vi,{...i,...r,ref:t})});Ji.displayName=qi;var Yi=`DropdownMenuSeparator`,Xi=w.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,T.jsx)(yi,{...i,...r,ref:t})});Xi.displayName=Yi;var Zi=`DropdownMenuArrow`,Qi=w.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,T.jsx)(bi,{...i,...r,ref:t})});Qi.displayName=Zi;var $i=`DropdownMenuSubTrigger`,ea=w.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,T.jsx)(xi,{...i,...r,ref:t})});ea.displayName=$i;var ta=`DropdownMenuSubContent`,na=w.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,T.jsx)(Si,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});na.displayName=ta;var ra=Oi,ia=Ai,aa=Mi,oa=Pi,sa=Ri,ca=Bi,la=Hi,ua=Wi,da=Ki,fa=Ji,pa=Xi;function ma({...e}){return(0,T.jsx)(ra,{"data-slot":`dropdown-menu`,...e})}function ha({...e}){return(0,T.jsx)(ia,{"data-slot":`dropdown-menu-trigger`,...e})}function ga({className:e,sideOffset:t=4,...n}){return(0,T.jsx)(aa,{children:(0,T.jsx)(oa,{"data-slot":`dropdown-menu-content`,sideOffset:t,className:C(`z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] max-w-(--radix-dropdown-menu-content-available-width) [overflow-wrap:anywhere] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95`,e),...n})})}function _a({className:e,inset:t,variant:n=`default`,...r}){return(0,T.jsx)(ca,{"data-slot":`dropdown-menu-item`,"data-inset":t,"data-variant":n,className:C(`relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground data-[variant=destructive]:*:[svg]:text-destructive!`,e),...r})}function va({className:e,children:t,checked:n,...r}){return(0,T.jsxs)(la,{"data-slot":`dropdown-menu-checkbox-item`,className:C(`relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),checked:n,...r,children:[(0,T.jsx)(`span`,{className:`pointer-events-none absolute left-2 flex size-3.5 items-center justify-center`,children:(0,T.jsx)(fa,{children:(0,T.jsx)(h,{className:`size-4`})})}),t]})}function ya({...e}){return(0,T.jsx)(ua,{"data-slot":`dropdown-menu-radio-group`,...e})}function ba({className:e,children:t,...n}){return(0,T.jsxs)(da,{"data-slot":`dropdown-menu-radio-item`,className:C(`relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...n,children:[(0,T.jsx)(`span`,{className:`pointer-events-none absolute left-2 flex size-3.5 items-center justify-center`,children:(0,T.jsx)(fa,{children:(0,T.jsx)(_,{className:`size-2 fill-current`})})}),t]})}function xa({className:e,inset:t,...n}){return(0,T.jsx)(sa,{"data-slot":`dropdown-menu-label`,"data-inset":t,className:C(`px-2 py-1.5 text-sm font-medium data-[inset]:pl-8`,e),...n})}function Sa({className:e,...t}){return(0,T.jsx)(pa,{"data-slot":`dropdown-menu-separator`,className:C(`-mx-1 my-1 h-px bg-border`,e),...t})}export{Zt as _,xa as a,Sa as c,Un as d,jn as f,mn as g,gn as h,_a as i,ha as l,_n as m,va as n,ya as o,hn as p,ga as r,ba as s,ma as t,Wn as u,A as v,O as y};
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,r as n,t as r}from"./react-runtime-CCIEwYL0.js";import{A as i,C as a,D as o,E as s,I as c,M as l,N as u,O as d,P as f,S as p,T as m,Y as h,b as g,et as _,j as v,k as y,w as b,x,z as S}from"./alert-dialog-CVF_qvQ8.js";import{t as C}from"./utils-DNvmfH6b.js";var w=e(t(),1),T=r();function E(e){let t=e+`CollectionProvider`,[n,r]=l(t),[i,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),o=e=>{let{scope:t,children:n}=e,r=w.useRef(null),a=w.useRef(new Map).current;return(0,T.jsx)(i,{scope:t,itemMap:a,collectionRef:r,children:n})};o.displayName=t;let s=e+`CollectionSlot`,u=c(s),d=w.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=S(t,a(s,n).collectionRef);return(0,T.jsx)(u,{ref:i,children:r})});d.displayName=s;let f=e+`CollectionItemSlot`,p=`data-radix-collection-item`,m=c(f),h=w.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,o=w.useRef(null),s=S(t,o),c=a(f,n);return w.useEffect(()=>(c.itemMap.set(o,{ref:o,...i}),()=>void c.itemMap.delete(o))),(0,T.jsx)(m,{[p]:``,ref:s,children:r})});h.displayName=f;function g(t){let n=a(e+`CollectionConsumer`,t);return w.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${p}]`));return Array.from(n.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[n.collectionRef,n.itemMap])}return[{Provider:o,Slot:d,ItemSlot:h},g,r]}var D=w.createContext(void 0);function O(e){let t=w.useContext(D);return e||t||`ltr`}var k=e(n(),1);function A(e){let[t,n]=w.useState(void 0);return i(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{if(!Array.isArray(t)||!t.length)return;let r=t[0],i,a;if(`borderBoxSize`in r){let e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;i=t.inlineSize,a=t.blockSize}else i=e.offsetWidth,a=e.offsetHeight;n({width:i,height:a})});return t.observe(e,{box:`border-box`}),()=>t.unobserve(e)}else n(void 0)},[e]),t}var j=[`top`,`right`,`bottom`,`left`],M=Math.min,N=Math.max,P=Math.round,F=Math.floor,I=e=>({x:e,y:e}),ee={left:`right`,right:`left`,bottom:`top`,top:`bottom`};function te(e,t,n){return N(e,M(t,n))}function L(e,t){return typeof e==`function`?e(t):e}function R(e){return e.split(`-`)[0]}function z(e){return e.split(`-`)[1]}function B(e){return e===`x`?`y`:`x`}function ne(e){return e===`y`?`height`:`width`}function V(e){let t=e[0];return t===`t`||t===`b`?`y`:`x`}function re(e){return B(V(e))}function ie(e,t,n){n===void 0&&(n=!1);let r=z(e),i=re(e),a=ne(i),o=i===`x`?r===(n?`end`:`start`)?`right`:`left`:r===`start`?`bottom`:`top`;return t.reference[a]>t.floating[a]&&(o=pe(o)),[o,pe(o)]}function ae(e){let t=pe(e);return[oe(e),t,oe(t)]}function oe(e){return e.includes(`start`)?e.replace(`start`,`end`):e.replace(`end`,`start`)}var se=[`left`,`right`],ce=[`right`,`left`],le=[`top`,`bottom`],ue=[`bottom`,`top`];function de(e,t,n){switch(e){case`top`:case`bottom`:return n?t?ce:se:t?se:ce;case`left`:case`right`:return t?le:ue;default:return[]}}function fe(e,t,n,r){let i=z(e),a=de(R(e),n===`start`,r);return i&&(a=a.map(e=>e+`-`+i),t&&(a=a.concat(a.map(oe)))),a}function pe(e){let t=R(e);return ee[t]+e.slice(t.length)}function me(e){return{top:e.top??0,right:e.right??0,bottom:e.bottom??0,left:e.left??0}}function he(e){return typeof e==`number`?{top:e,right:e,bottom:e,left:e}:me(e)}function ge(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 _e(e,t,n){let{reference:r,floating:i}=e,a=V(t),o=re(t),s=ne(o),c=R(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=z(t);return m&&(p[o]+=f*(m===`end`?1:-1)*(n&&l?-1:1)),p}async function ve(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}=L(t,e),p=he(f),m=o[d?u===`floating`?`reference`:`floating`:u],h=ge(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=ge(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 ye=50,be=async(e,t,n)=>{let{placement:r=`bottom`,strategy:i=`absolute`,middleware:a=[],platform:o}=n,s=o.detectOverflow?o:{...o,detectOverflow:ve},c=await(o.isRTL==null?void 0:o.isRTL(t)),l=await o.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:d}=_e(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<ye&&(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}=_e(l,f,c)),n=-1)}return{x:u,y:d,placement:f,strategy:i,middlewareData:m}},xe=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}=L(e,t)||{};if(l==null)return{};let d=he(u),f={x:n,y:r},p=re(i),m=ne(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=M(d[_],T),D=M(d[v],T),O=C-h[m]-D,k=C/2-h[m]/2+w,A=te(E,k,O),j=!c.arrow&&z(i)!=null&&k!==A&&a.reference[m]/2-(k<E?E:D)-h[m]/2<0,N=j?k<E?k-E:k-O:0;return{[p]:f[p]+N,data:{[p]:A,centerOffset:k-A-N,...j&&{alignmentOffset:N}},reset:j}}}),Se=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}=L(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};let g=R(r),_=V(o),v=R(o)===o,y=await(s.isRTL==null?void 0:s.isRTL(c.floating)),b=d||(v||!m?[pe(o)]:ae(o)),x=p!==`none`;!d&&x&&b.push(...fe(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=ie(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`&&_!==V(t))||T.every(e=>V(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=V(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;break}if(r!==n)return{reset:{placement:n}}}return{}}}};function Ce(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function we(e){return j.some(t=>e[t]>=0)}var Te=function(e){return e===void 0&&(e={}),{name:`hide`,options:e,async fn(t){let{rects:n,platform:r}=t,{strategy:i=`referenceHidden`,...a}=L(e,t);switch(i){case`referenceHidden`:{let e=Ce(await r.detectOverflow(t,{...a,elementContext:`reference`}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:we(e)}}}case`escaped`:{let e=Ce(await r.detectOverflow(t,{...a,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:we(e)}}}default:return{}}}}},Ee=new Set([`left`,`top`]);async function De(e,t){let{placement:n,platform:r,elements:i}=e,a=await(r.isRTL==null?void 0:r.isRTL(i.floating)),o=R(n),s=z(n),c=V(n)===`y`,l=Ee.has(o)?-1:1,u=a&&c?-1:1,d=L(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 Oe=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 De(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}}}}},ke=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}=L(e,t),u={x:n,y:r},d=await a.detectOverflow(t,l),f=V(i),p=B(f),m=u[p],h=u[f],g=(e,t)=>te(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}}}}}},Ae=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}=L(e,t),u={x:n,y:r},d=V(i),f=B(d),p=u[f],m=u[d],h=L(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=Ee.has(R(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}}}},je=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}=L(e,t),c=await i.detectOverflow(t,s),l=R(n),u=z(n),d=V(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=M(p-c[m],g),y=M(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*N(c.left,c.right):S=p-2*N(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 Me(){return typeof window<`u`}function Ne(e){return Pe(e)?(e.nodeName||``).toLowerCase():`#document`}function H(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function U(e){return((Pe(e)?e.ownerDocument:e.document)||window.document)?.documentElement}function Pe(e){return Me()?e instanceof Node||e instanceof H(e).Node:!1}function W(e){return Me()?e instanceof Element||e instanceof H(e).Element:!1}function G(e){return Me()?e instanceof HTMLElement||e instanceof H(e).HTMLElement:!1}function Fe(e){return!Me()||typeof ShadowRoot>`u`?!1:e instanceof ShadowRoot||e instanceof H(e).ShadowRoot}function Ie(e){let{overflow:t,overflowX:n,overflowY:r,display:i}=q(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&i!==`inline`&&i!==`contents`}function Le(e){return/^(table|td|th)$/.test(Ne(e))}function Re(e){try{if(e.matches(`:popover-open`))return!0}catch{}try{return e.matches(`:modal`)}catch{return!1}}var ze=/transform|translate|scale|rotate|perspective|filter/,Be=/paint|layout|strict|content/,K=e=>!!e&&e!==`none`,Ve;function He(e){let t=W(e)?q(e):e;return K(t.transform)||K(t.translate)||K(t.scale)||K(t.rotate)||K(t.perspective)||!We()&&(K(t.backdropFilter)||K(t.filter))||ze.test(t.willChange||``)||Be.test(t.contain||``)}function Ue(e){let t=J(e);for(;G(t)&&!Ge(t);){if(He(t))return t;if(Re(t))return null;t=J(t)}return null}function We(){return Ve??=typeof CSS<`u`&&CSS.supports&&CSS.supports(`-webkit-backdrop-filter`,`none`),Ve}function Ge(e){return/^(html|body|#document)$/.test(Ne(e))}function q(e){return H(e).getComputedStyle(e)}function Ke(e){return W(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function J(e){if(Ne(e)===`html`)return e;let t=e.assignedSlot||e.parentNode||Fe(e)&&e.host||U(e);return Fe(t)?t.host:t}function qe(e){let t=J(e);return Ge(t)?(e.ownerDocument||e).body:G(t)&&Ie(t)?t:qe(t)}function Je(e,t,n){t===void 0&&(t=[]),n===void 0&&(n=!0);let r=qe(e),i=r===e.ownerDocument?.body,a=H(r);if(i){let e=Ye(a);return t.concat(a,a.visualViewport||[],Ie(r)?r:[],e&&n?Je(e):[])}else return t.concat(r,Je(r,[],n))}function Ye(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Xe(e){let t=q(e),n=parseFloat(t.width)||0,r=parseFloat(t.height)||0,i=G(e),a=i?e.offsetWidth:n,o=i?e.offsetHeight:r,s=P(n)!==a||P(r)!==o;return s&&(n=a,r=o),{width:n,height:r,$:s}}function Ze(e){return W(e)?e:e.contextElement}function Qe(e){let t=Ze(e);if(!G(t))return I(1);let n=t.getBoundingClientRect(),{width:r,height:i,$:a}=Xe(t),o=(a?P(n.width):n.width)/r,s=(a?P(n.height):n.height)/i;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}var $e=I(0);function et(e){let t=H(e);return!We()||!t.visualViewport?$e:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function tt(e,t,n){return t===void 0&&(t=!1),!!n&&t&&n===H(e)}function Y(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);let i=e.getBoundingClientRect(),a=Ze(e),o=I(1);t&&(r?W(r)&&(o=Qe(r)):o=Qe(e));let s=tt(a,n,r)?et(a):I(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=H(a),t=W(r)?H(r):r,n=e,i=Ye(n);for(;i&&t!==n;){let e=Qe(i),t=i.getBoundingClientRect(),r=q(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=H(i),i=Ye(n)}}return ge({width:u,height:d,x:c,y:l})}function nt(e,t){let n=Ke(e).scrollLeft;return t?t.left+n:Y(U(e)).left+n}function rt(e,t){let n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-nt(e,n),y:n.top+t.scrollTop}}function it(e){let{elements:t,rect:n,offsetParent:r,strategy:i}=e,a=i===`fixed`,o=U(r),s=t?Re(t.floating):!1;if(r===o||s&&a)return n;let c={scrollLeft:0,scrollTop:0},l=I(1),u=I(0),d=G(r);if((d||!a)&&((Ne(r)!==`body`||Ie(o))&&(c=Ke(r)),d)){let e=Y(r);l=Qe(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}let f=o&&!d&&!a?rt(o,c):I(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 at(e){return e.getClientRects?Array.from(e.getClientRects()):[]}function ot(e){let t=Ke(e),n=e.ownerDocument.body,r=N(e.scrollWidth,e.clientWidth,n.scrollWidth,n.clientWidth),i=N(e.scrollHeight,e.clientHeight,n.scrollHeight,n.clientHeight),a=-t.scrollLeft+nt(e),o=-t.scrollTop;return q(n).direction===`rtl`&&(a+=N(e.clientWidth,n.clientWidth)-r),{width:r,height:i,x:a,y:o}}var st=25;function ct(e,t,n){n===void 0&&(n=`viewport`);let r=n===`layoutViewport`,i=H(e),a=U(e),o=i.visualViewport,s=a.clientWidth,c=a.clientHeight,l=0,u=0;if(o){let e=!We()||t===`fixed`;r?e||(l=-o.offsetLeft,u=-o.offsetTop):(s=o.width,c=o.height,e&&(l=o.offsetLeft,u=o.offsetTop))}if(nt(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<=st&&(s-=o)}return{width:s,height:c,x:l,y:u}}function lt(e,t){let n=Y(e,!0,t===`fixed`),r=n.top+e.clientTop,i=n.left+e.clientLeft,a=Qe(e);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:i*a.x,y:r*a.y}}function ut(e,t,n){let r;if(t===`viewport`||t===`layoutViewport`)r=ct(e,n,t);else if(t===`document`)r=ot(U(e));else if(W(t))r=lt(t,n);else{let n=et(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return ge(r)}function dt(e,t){let n=t.get(e);if(n)return n;let r=Je(e,[],!1).filter(e=>W(e)&&Ne(e)!==`body`),i=null,a=q(e).position===`fixed`,o=a?J(e):e;for(;W(o)&&!Ge(o);){let e=q(o),t=He(o),n=i?i.position:a?`fixed`:``;!t&&(n===`fixed`||n===`absolute`&&e.position===`static`)?r=r.filter(e=>e!==o):i=e,o=J(o)}return t.set(e,r),r}function ft(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,a=[...n===`clippingAncestors`?Re(t)?[]:dt(t,this._c):[].concat(n),r],o=ut(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=ut(t,a[e],i);s=N(n.top,s),c=M(n.right,c),l=M(n.bottom,l),u=N(n.left,u)}return{width:c-u,height:l-s,x:u,y:s}}function pt(e){let{width:t,height:n}=Xe(e);return{width:t,height:n}}function mt(e,t,n){let r=G(t),i=U(t),a=n===`fixed`,o=Y(e,!0,a,t),s={scrollLeft:0,scrollTop:0},c=I(0);if((r||!a)&&((Ne(t)!==`body`||Ie(i))&&(s=Ke(t)),r)){let e=Y(t,!0,a,t);c.x=e.x+t.clientLeft,c.y=e.y+t.clientTop}!r&&i&&(c.x=nt(i));let l=i&&!r&&!a?rt(i,s):I(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 ht(e){return q(e).position===`static`}function gt(e,t){if(!G(e)||q(e).position===`fixed`)return null;if(t)return t(e);let n=e.offsetParent;return U(e)===n&&(n=n.ownerDocument.body),n}function _t(e,t){let n=H(e);if(Re(e))return n;if(!G(e)){let t=J(e);for(;t&&!Ge(t);){if(W(t)&&!ht(t))return t;t=J(t)}return n}let r=gt(e,t);for(;r&&Le(r)&&ht(r);)r=gt(r,t);return r&&Ge(r)&&ht(r)&&!He(r)?n:r||Ue(e)||n}var vt=async function(e){let t=this.getOffsetParent||_t,n=this.getDimensions,r=await n(e.floating);return{reference:mt(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function yt(e){return q(e).direction===`rtl`}var bt={convertOffsetParentRelativeRectToViewportRelativeRect:it,getDocumentElement:U,getClippingRect:ft,getOffsetParent:_t,getElementRects:vt,getClientRects:at,getDimensions:pt,getScale:Qe,isElement:W,isRTL:yt};function xt(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function St(e,t,n){let r=null,i,a=U(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=F(d),h=F(a.clientWidth-(u+f)),g=F(a.clientHeight-(d+p)),_=F(u),v={rootMargin:-m+`px `+-h+`px `+-g+`px `+-_+`px`,threshold:N(0,M(1,c))||1},y=!0;function b(t){let n=t[0].intersectionRatio;if(!xt(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=H(e),l=()=>s(n);return c.addEventListener(`resize`,l),s(!0),()=>{c.removeEventListener(`resize`,l),o()}}function Ct(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=Ze(e),u=i||a?[...l?Je(l):[],...t?Je(t):[]]:[];u.forEach(e=>{i&&e.addEventListener(`scroll`,n),a&&e.addEventListener(`resize`,n)});let d=l&&s?St(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?Y(e):null;c&&g();function g(){let t=Y(e);h&&!xt(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 wt=Oe,Tt=ke,Et=Se,Dt=je,Ot=Te,kt=xe,At=Ae,jt=(e,t,n)=>{let r=new Map,i=n??{},a={...bt,...i.platform,_c:r};return be(e,t,{...i,platform:a})},Mt=typeof document<`u`?w.useLayoutEffect:function(){};function Nt(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(!Nt(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)&&!Nt(e[n],t[n]))return!1}return!0}return e!==e&&t!==t}function Pt(e){return typeof window>`u`?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Ft(e,t){let n=Pt(e);return Math.round(t*n)/n}function It(e){let t=w.useRef(e);return Mt(()=>{t.current=e}),t}function Lt(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]=w.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[f,p]=w.useState(r);Nt(f,r)||p(r);let[m,h]=w.useState(null),[g,_]=w.useState(null),v=w.useCallback(e=>{e!==S.current&&(S.current=e,h(e))},[]),y=w.useCallback(e=>{e!==C.current&&(C.current=e,_(e))},[]),b=a||m,x=o||g,S=w.useRef(null),C=w.useRef(null),T=w.useRef(u),E=c!=null,D=It(c),O=It(i),A=It(l),j=w.useCallback(()=>{if(!S.current||!C.current)return;let e={placement:t,strategy:n,middleware:f};O.current&&(e.platform=O.current),jt(S.current,C.current,e).then(e=>{let t={...e,isPositioned:A.current!==!1};M.current&&!Nt(T.current,t)&&(T.current=t,k.flushSync(()=>{d(t)}))})},[f,t,n,O,A]);Mt(()=>{l===!1&&T.current.isPositioned&&(T.current.isPositioned=!1,d(e=>({...e,isPositioned:!1})))},[l]);let M=w.useRef(!1);Mt(()=>(M.current=!0,()=>{M.current=!1}),[]),Mt(()=>{if(b&&(S.current=b),x&&(C.current=x),b&&x){if(D.current)return D.current(b,x,j);j()}},[b,x,j,D,E]);let N=w.useMemo(()=>({reference:S,floating:C,setReference:v,setFloating:y}),[v,y]),P=w.useMemo(()=>({reference:b,floating:x}),[b,x]),F=w.useMemo(()=>{let e={position:n,left:0,top:0};if(!P.floating)return e;let t=Ft(P.floating,u.x),r=Ft(P.floating,u.y);return s?{...e,transform:`translate(`+t+`px, `+r+`px)`,...Pt(P.floating)>=1.5&&{willChange:`transform`}}:{position:n,left:t,top:r}},[n,s,P.floating,u.x,u.y]);return w.useMemo(()=>({...u,update:j,refs:N,elements:P,floatingStyles:F}),[u,j,N,P,F])}var Rt=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?{}:kt({element:r.current,padding:i}).fn(n):r?kt({element:r,padding:i}).fn(n):{}}}},zt=(e,t)=>{let n=wt(e);return{name:n.name,fn:n.fn,options:[e,t]}},Bt=(e,t)=>{let n=Tt(e);return{name:n.name,fn:n.fn,options:[e,t]}},Vt=(e,t)=>({fn:At(e).fn,options:[e,t]}),Ht=(e,t)=>{let n=Et(e);return{name:n.name,fn:n.fn,options:[e,t]}},Ut=(e,t)=>{let n=Dt(e);return{name:n.name,fn:n.fn,options:[e,t]}},Wt=(e,t)=>{let n=Ot(e);return{name:n.name,fn:n.fn,options:[e,t]}},Gt=(e,t)=>{let n=Rt(e);return{name:n.name,fn:n.fn,options:[e,t]}},Kt=`Arrow`,qt=w.forwardRef((e,t)=>{let{children:n,width:r=10,height:i=5,...a}=e;return(0,T.jsx)(u.svg,{...a,ref:t,width:r,height:i,viewBox:`0 0 30 10`,preserveAspectRatio:`none`,children:e.asChild?n:(0,T.jsx)(`polygon`,{points:`0,0 30,0 15,10`})})});qt.displayName=Kt;var Jt=qt,Yt=`Popper`,[Xt,Zt]=l(Yt),[Qt,$t]=Xt(Yt),en=e=>{let{__scopePopper:t,children:n}=e,[r,i]=w.useState(null),[a,o]=w.useState(void 0);return(0,T.jsx)(Qt,{scope:t,anchor:r,onAnchorChange:i,placementState:a,setPlacementState:o,children:n})};en.displayName=Yt;var tn=`PopperAnchor`,nn=w.forwardRef((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,a=$t(tn,n),o=w.useRef(null),s=a.onAnchorChange,c=S(t,w.useCallback(e=>{o.current=e,e&&s(e)},[s])),l=w.useRef(null);w.useEffect(()=>{if(!r)return;let e=l.current;l.current=r.current,e!==l.current&&s(l.current)});let d=a.placementState&&pn(a.placementState),f=d?.[0],p=d?.[1];return r?null:(0,T.jsx)(u.div,{"data-radix-popper-side":f,"data-radix-popper-align":p,...i,ref:c})});nn.displayName=tn;var rn=`PopperContent`,[an,on]=Xt(rn),sn=w.forwardRef((e,t)=>{let{__scopePopper:n,side:r=`bottom`,sideOffset:a=0,align:o=`center`,alignOffset:c=0,arrowPadding:l=0,avoidCollisions:d=!0,collisionBoundary:f=[],collisionPadding:p=0,sticky:m=`partial`,hideWhenDetached:h=!1,updatePositionStrategy:g=`optimized`,onPlaced:_,...v}=e,y=$t(rn,n),[b,x]=w.useState(null),C=S(t,x),[E,D]=w.useState(null),O=A(E),k=O?.width??0,j=O?.height??0,M=r+(o===`center`?``:`-`+o),N=typeof p==`number`?p:{top:0,right:0,bottom:0,left:0,...p},P=Array.isArray(f)?f:[f],F=P.length>0,I={padding:N,boundary:P.filter(dn),altBoundary:F},{refs:ee,floatingStyles:te,placement:L,isPositioned:R,middlewareData:z}=Lt({strategy:`fixed`,placement:M,whileElementsMounted:(...e)=>Ct(...e,{animationFrame:g===`always`}),elements:{reference:y.anchor},middleware:[zt({mainAxis:a+j,alignmentAxis:c}),d&&Bt({mainAxis:!0,crossAxis:!1,limiter:m===`partial`?Vt():void 0,...I}),d&&Ht({...I}),Ut({...I,apply:({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`)}}),E&&Gt({element:E,padding:l}),fn({arrowWidth:k,arrowHeight:j}),h&&Wt({strategy:`referenceHidden`,...I,boundary:F?I.boundary:void 0})]}),B=y.setPlacementState;i(()=>(B(L),()=>{B(void 0)}),[L,B]);let[ne,V]=pn(L),re=s(_);i(()=>{R&&re?.()},[R,re]);let ie=z.arrow?.x,ae=z.arrow?.y,oe=z.arrow?.centerOffset!==0,[se,ce]=w.useState();return i(()=>{b&&ce(window.getComputedStyle(b).zIndex)},[b]),(0,T.jsx)(`div`,{ref:ee.setFloating,"data-radix-popper-content-wrapper":``,style:{...te,transform:R?te.transform:`translate(0, -200%)`,minWidth:`max-content`,zIndex:se,"--radix-popper-transform-origin":[z.transformOrigin?.x,z.transformOrigin?.y].join(` `),...z.hide?.referenceHidden&&{visibility:`hidden`,pointerEvents:`none`}},dir:e.dir,children:(0,T.jsx)(an,{scope:n,placedSide:ne,placedAlign:V,onArrowChange:D,arrowX:ie,arrowY:ae,shouldHideArrow:oe,children:(0,T.jsx)(u.div,{"data-side":ne,"data-align":V,...v,ref:C,style:{...v.style,animation:R?void 0:`none`}})})})});sn.displayName=rn;var cn=`PopperArrow`,ln={top:`bottom`,right:`left`,bottom:`top`,left:`right`},un=w.forwardRef(function(e,t){let{__scopePopper:n,...r}=e,i=on(cn,n),a=ln[i.placedSide];return(0,T.jsx)(`span`,{ref:i.onArrowChange,style:{position:`absolute`,left:i.arrowX,top:i.arrowY,[a]:0,transformOrigin:{top:``,right:`0 0`,bottom:`center 0`,left:`100% 0`}[i.placedSide],transform:{top:`translateY(100%)`,right:`translateY(50%) rotate(90deg) translateX(-50%)`,bottom:`rotate(180deg)`,left:`translateY(50%) rotate(-90deg) translateX(50%)`}[i.placedSide],visibility:i.shouldHideArrow?`hidden`:void 0},children:(0,T.jsx)(Jt,{...r,ref:t,style:{...r.style,display:`block`}})})});un.displayName=cn;function dn(e){return e!==null}var fn=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]=pn(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}}}});function pn(e){let[t,n=`center`]=e.split(`-`);return[t,n]}var mn=en,hn=nn,gn=sn,_n=un,vn=!1;function yn(){let[e,t]=w.useState(vn);return w.useEffect(()=>{vn||(vn=!0,t(!0))},[]),e}var bn=w.useSyncExternalStore;function xn(){return()=>{}}function Sn(){return bn(xn,()=>!0,()=>!1)}var Cn=typeof bn==`function`?Sn:yn,wn=`rovingFocusGroup.onEntryFocus`,Tn={bubbles:!1,cancelable:!0},En=`RovingFocusGroup`,[Dn,On,kn]=E(En),[An,jn]=l(En,[kn]),[Mn,Nn]=An(En),Pn=w.forwardRef((e,t)=>(0,T.jsx)(Dn.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,T.jsx)(Dn.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,T.jsx)(Fn,{...e,ref:t})})}));Pn.displayName=En;var Fn=w.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,orientation:r,loop:i=!1,dir:a,currentTabStopId:o,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:l,onEntryFocus:d,preventScrollOnEntryFocus:f=!1,...p}=e,m=w.useRef(null),h=S(t,m),g=O(a),[_,b]=y({prop:o,defaultProp:c??null,onChange:l,caller:En}),[x,C]=w.useState(!1),E=s(d),D=On(n),k=w.useRef(!1),[A,j]=w.useState(0);return w.useEffect(()=>{let e=m.current;if(e)return e.addEventListener(wn,E),()=>e.removeEventListener(wn,E)},[E]),(0,T.jsx)(Mn,{scope:n,orientation:r,dir:g,loop:i,currentTabStopId:_,onItemFocus:w.useCallback(e=>b(e),[b]),onItemShiftTab:w.useCallback(()=>C(!0),[]),onFocusableItemAdd:w.useCallback(()=>j(e=>e+1),[]),onFocusableItemRemove:w.useCallback(()=>j(e=>e-1),[]),children:(0,T.jsx)(u.div,{tabIndex:x||A===0?-1:0,"data-orientation":r,...p,ref:h,style:{outline:`none`,...e.style},onMouseDown:v(e.onMouseDown,()=>{k.current=!0}),onFocus:v(e.onFocus,e=>{let t=!k.current;if(e.target===e.currentTarget&&t&&!x){let t=new CustomEvent(wn,Tn);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=D().filter(e=>e.focusable);Vn([e.find(e=>e.active),e.find(e=>e.id===_),...e].filter(Boolean).map(e=>e.ref.current),f)}}k.current=!1}),onBlur:v(e.onBlur,()=>C(!1))})})}),In=`RovingFocusGroupItem`,Ln=w.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:n,focusable:r=!0,active:a=!1,tabStopId:s,children:c,...l}=e,d=o(),f=s||d,p=Nn(In,n),m=p.currentTabStopId===f,h=On(n),{onFocusableItemAdd:g,onFocusableItemRemove:_,currentTabStopId:y}=p,b=Cn();return i(()=>{if(!(!b||!r))return g(),()=>_()},[b,r,g,_]),w.useEffect(()=>{if(!(b||!r))return g(),()=>_()},[b,r,g,_]),(0,T.jsx)(Dn.ItemSlot,{scope:n,id:f,focusable:r,active:a,children:(0,T.jsx)(u.span,{tabIndex:m?0:-1,"data-orientation":p.orientation,...l,ref:t,onMouseDown:v(e.onMouseDown,e=>{r?p.onItemFocus(f):e.preventDefault()}),onFocus:v(e.onFocus,()=>p.onItemFocus(f)),onKeyDown:v(e.onKeyDown,e=>{if(e.key===`Tab`&&e.shiftKey){p.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=Bn(e,p.orientation,p.dir);if(t!==void 0){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let n=h().filter(e=>e.focusable).map(e=>e.ref.current);if(t===`last`)n.reverse();else if(t===`prev`||t===`next`){t===`prev`&&n.reverse();let r=n.indexOf(e.currentTarget);n=p.loop?Hn(n,r+1):n.slice(r+1)}setTimeout(()=>Vn(n))}}),children:typeof c==`function`?c({isCurrentTabStop:m,hasTabStop:y!=null}):c})})});Ln.displayName=In;var Rn={ArrowLeft:`prev`,ArrowUp:`prev`,ArrowRight:`next`,ArrowDown:`next`,PageUp:`first`,Home:`first`,PageDown:`last`,End:`last`};function zn(e,t){return t===`rtl`?e===`ArrowLeft`?`ArrowRight`:e===`ArrowRight`?`ArrowLeft`:e:e}function Bn(e,t,n){let r=zn(e.key,n);if(!(t===`vertical`&&[`ArrowLeft`,`ArrowRight`].includes(r))&&!(t===`horizontal`&&[`ArrowUp`,`ArrowDown`].includes(r)))return Rn[r]}function Vn(e,t=!1){let n=document.activeElement;for(let r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function Hn(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Un=Pn,Wn=Ln,Gn=[`Enter`,` `],Kn=[`ArrowDown`,`PageUp`,`Home`],qn=[`ArrowUp`,`PageDown`,`End`],Jn=[...Kn,...qn],Yn={ltr:[...Gn,`ArrowRight`],rtl:[...Gn,`ArrowLeft`]},Xn={ltr:[`ArrowLeft`],rtl:[`ArrowRight`]},Zn=`Menu`,[Qn,$n,er]=E(Zn),[X,tr]=l(Zn,[er,Zt,jn]),nr=Zt(),rr=jn(),[ir,Z]=X(Zn),[ar,or]=X(Zn),sr=e=>{let{__scopeMenu:t,open:n=!1,children:r,dir:i,onOpenChange:a,modal:o=!0}=e,c=nr(t),[l,u]=w.useState(null),d=w.useRef(!1),f=s(a),p=O(i);return w.useEffect(()=>{let e=()=>{d.current=!0,document.addEventListener(`pointerdown`,t,{capture:!0,once:!0}),document.addEventListener(`pointermove`,t,{capture:!0,once:!0})},t=()=>d.current=!1;return document.addEventListener(`keydown`,e,{capture:!0}),()=>{document.removeEventListener(`keydown`,e,{capture:!0}),document.removeEventListener(`pointerdown`,t,{capture:!0}),document.removeEventListener(`pointermove`,t,{capture:!0})}},[]),w.useEffect(()=>{if(!n)return;let e=()=>f(!1);return window.addEventListener(`blur`,e),()=>window.removeEventListener(`blur`,e)},[n,f]),(0,T.jsx)(mn,{...c,children:(0,T.jsx)(ir,{scope:t,open:n,onOpenChange:f,content:l,onContentChange:u,children:(0,T.jsx)(ar,{scope:t,onClose:w.useCallback(()=>f(!1),[f]),isUsingKeyboardRef:d,dir:p,modal:o,children:r})})})};sr.displayName=Zn;var cr=`MenuAnchor`,lr=w.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=nr(n);return(0,T.jsx)(hn,{...i,...r,ref:t})});lr.displayName=cr;var ur=`MenuPortal`,[dr,fr]=X(ur,{forceMount:void 0}),pr=e=>{let{__scopeMenu:t,forceMount:n,children:r,container:i}=e,o=Z(ur,t);return(0,T.jsx)(dr,{scope:t,forceMount:n,children:(0,T.jsx)(d,{present:n||o.open,children:(0,T.jsx)(a,{asChild:!0,container:i,children:r})})})};pr.displayName=ur;var Q=`MenuContent`,[mr,hr]=X(Q),gr=w.forwardRef((e,t)=>{let n=fr(Q,e.__scopeMenu),{forceMount:r=n.forceMount,...i}=e,a=Z(Q,e.__scopeMenu),o=or(Q,e.__scopeMenu);return(0,T.jsx)(Qn.Provider,{scope:e.__scopeMenu,children:(0,T.jsx)(d,{present:r||a.open,children:(0,T.jsx)(Qn.Slot,{scope:e.__scopeMenu,children:o.modal?(0,T.jsx)(_r,{...i,ref:t}):(0,T.jsx)(vr,{...i,ref:t})})})})}),_r=w.forwardRef((e,t)=>{let n=Z(Q,e.__scopeMenu),r=w.useRef(null),i=S(t,r);return w.useEffect(()=>{let e=r.current;if(e)return g(e)},[]),(0,T.jsx)(br,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:v(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),vr=w.forwardRef((e,t)=>{let n=Z(Q,e.__scopeMenu);return(0,T.jsx)(br,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),yr=c(`MenuContent.ScrollLock`),br=w.forwardRef((e,t)=>{let{__scopeMenu:n,loop:r=!1,trapFocus:i,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:s,onEntryFocus:c,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:h,disableOutsideScroll:g,..._}=e,y=Z(Q,n),C=or(Q,n),E=nr(n),D=rr(n),O=$n(n),[k,A]=w.useState(null),j=w.useRef(null),M=S(t,j,y.onContentChange),N=w.useRef(0),P=w.useRef(``),F=w.useRef(0),I=w.useRef(null),ee=w.useRef(`right`),te=w.useRef(0),L=g?x:w.Fragment,R=g?{as:yr,allowPinchZoom:!0}:void 0,z=e=>{let t=P.current+e,n=O().filter(e=>!e.disabled),r=document.activeElement,i=n.find(e=>e.ref.current===r)?.textValue,a=ii(n.map(e=>e.textValue),t,i),o=n.find(e=>e.textValue===a)?.ref.current;(function e(t){P.current=t,window.clearTimeout(N.current),t!==``&&(N.current=window.setTimeout(()=>e(``),1e3))})(t),o&&setTimeout(()=>o.focus())};w.useEffect(()=>()=>window.clearTimeout(N.current),[]),p();let B=w.useCallback(e=>ee.current===I.current?.side&&oi(e,I.current?.area),[]);return(0,T.jsx)(mr,{scope:n,searchRef:P,onItemEnter:w.useCallback(e=>{B(e)&&e.preventDefault()},[B]),onItemLeave:w.useCallback(e=>{B(e)||(j.current?.focus(),A(null))},[B]),onTriggerLeave:w.useCallback(e=>{B(e)&&e.preventDefault()},[B]),pointerGraceTimerRef:F,onPointerGraceIntentChange:w.useCallback(e=>{I.current=e},[]),children:(0,T.jsx)(L,{...R,children:(0,T.jsx)(b,{asChild:!0,trapped:i,onMountAutoFocus:v(a,e=>{e.preventDefault(),j.current?.focus({preventScroll:!0})}),onUnmountAutoFocus:o,children:(0,T.jsx)(m,{asChild:!0,disableOutsidePointerEvents:s,onEscapeKeyDown:l,onPointerDownOutside:u,onFocusOutside:d,onInteractOutside:f,onDismiss:h,children:(0,T.jsx)(Un,{asChild:!0,...D,dir:C.dir,orientation:`vertical`,loop:r,currentTabStopId:k,onCurrentTabStopIdChange:A,onEntryFocus:v(c,e=>{C.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,T.jsx)(gn,{role:`menu`,"aria-orientation":`vertical`,"data-state":$r(y.open),"data-radix-menu-content":``,dir:C.dir,...E,..._,ref:M,style:{outline:`none`,..._.style},onKeyDown:v(_.onKeyDown,e=>{let t=e.target.closest(`[data-radix-menu-content]`)===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=e.key.length===1;t&&(e.key===`Tab`&&e.preventDefault(),!n&&r&&z(e.key));let i=j.current;if(e.target!==i||!Jn.includes(e.key))return;e.preventDefault();let a=O().filter(e=>!e.disabled).map(e=>e.ref.current);qn.includes(e.key)&&a.reverse(),ni(a)}),onBlur:v(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(N.current),P.current=``)}),onPointerMove:v(e.onPointerMove,si(e=>{let t=e.target,n=te.current!==e.clientX;if(e.currentTarget.contains(t)&&n){let t=e.clientX>te.current?`right`:`left`;ee.current=t,te.current=e.clientX}}))})})})})})})});gr.displayName=Q;var xr=`MenuGroup`,Sr=w.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,T.jsx)(u.div,{role:`group`,...r,ref:t})});Sr.displayName=xr;var Cr=`MenuLabel`,wr=w.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,T.jsx)(u.div,{...r,ref:t})});wr.displayName=Cr;var Tr=`MenuItem`,Er=`menu.itemSelect`,Dr=w.forwardRef((e,t)=>{let{disabled:n=!1,onSelect:r,...i}=e,a=w.useRef(null),o=or(Tr,e.__scopeMenu),s=hr(Tr,e.__scopeMenu),c=S(t,a),l=w.useRef(!1),u=()=>{let e=a.current;if(!n&&e){let t=new CustomEvent(Er,{bubbles:!0,cancelable:!0});e.addEventListener(Er,e=>r?.(e),{once:!0}),f(e,t),t.defaultPrevented?l.current=!1:o.onClose()}};return(0,T.jsx)(Or,{...i,ref:c,disabled:n,onClick:v(e.onClick,u),onPointerDown:t=>{e.onPointerDown?.(t),l.current=!0},onPointerUp:v(e.onPointerUp,e=>{l.current||e.currentTarget?.click()}),onKeyDown:v(e.onKeyDown,e=>{n||e.target!==e.currentTarget||s.searchRef.current!==``&&e.key===` `||Gn.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});Dr.displayName=Tr;var Or=w.forwardRef((e,t)=>{let{__scopeMenu:n,disabled:r=!1,textValue:i,...a}=e,o=hr(Tr,n),s=rr(n),c=w.useRef(null),l=S(t,c),[d,f]=w.useState(!1),[p,m]=w.useState(``);return w.useEffect(()=>{let e=c.current;e&&m((e.textContent??``).trim())},[a.children]),(0,T.jsx)(Qn.ItemSlot,{scope:n,disabled:r,textValue:i??p,children:(0,T.jsx)(Wn,{asChild:!0,...s,focusable:!r,children:(0,T.jsx)(u.div,{role:`menuitem`,"data-highlighted":d?``:void 0,"aria-disabled":r||void 0,"data-disabled":r?``:void 0,...a,ref:l,onPointerMove:v(e.onPointerMove,si(e=>{r?o.onItemLeave(e):(o.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:v(e.onPointerLeave,si(e=>o.onItemLeave(e))),onFocus:v(e.onFocus,()=>f(!0)),onBlur:v(e.onBlur,()=>f(!1))})})})}),kr=`MenuCheckboxItem`,Ar=w.forwardRef((e,t)=>{let{checked:n=!1,onCheckedChange:r,...i}=e;return(0,T.jsx)(Rr,{scope:e.__scopeMenu,checked:n,children:(0,T.jsx)(Dr,{role:`menuitemcheckbox`,"aria-checked":ei(n)?`mixed`:n,...i,ref:t,"data-state":ti(n),onSelect:v(i.onSelect,()=>r?.(ei(n)?!0:!n),{checkForDefaultPrevented:!1})})})});Ar.displayName=kr;var jr=`MenuRadioGroup`,[Mr,Nr]=X(jr,{value:void 0,onValueChange:()=>{}}),Pr=w.forwardRef((e,t)=>{let{value:n,onValueChange:r,...i}=e,a=s(r);return(0,T.jsx)(Mr,{scope:e.__scopeMenu,value:n,onValueChange:a,children:(0,T.jsx)(Sr,{...i,ref:t})})});Pr.displayName=jr;var Fr=`MenuRadioItem`,Ir=w.forwardRef((e,t)=>{let{value:n,...r}=e,i=Nr(Fr,e.__scopeMenu),a=n===i.value;return(0,T.jsx)(Rr,{scope:e.__scopeMenu,checked:a,children:(0,T.jsx)(Dr,{role:`menuitemradio`,"aria-checked":a,...r,ref:t,"data-state":ti(a),onSelect:v(r.onSelect,()=>i.onValueChange?.(n),{checkForDefaultPrevented:!1})})})});Ir.displayName=Fr;var Lr=`MenuItemIndicator`,[Rr,zr]=X(Lr,{checked:!1}),Br=w.forwardRef((e,t)=>{let{__scopeMenu:n,forceMount:r,...i}=e,a=zr(Lr,n);return(0,T.jsx)(d,{present:r||ei(a.checked)||a.checked===!0,children:(0,T.jsx)(u.span,{...i,ref:t,"data-state":ti(a.checked)})})});Br.displayName=Lr;var Vr=`MenuSeparator`,Hr=w.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e;return(0,T.jsx)(u.div,{role:`separator`,"aria-orientation":`horizontal`,...r,ref:t})});Hr.displayName=Vr;var Ur=`MenuArrow`,Wr=w.forwardRef((e,t)=>{let{__scopeMenu:n,...r}=e,i=nr(n);return(0,T.jsx)(_n,{...i,...r,ref:t})});Wr.displayName=Ur;var Gr=`MenuSub`,[Kr,qr]=X(Gr),Jr=e=>{let{__scopeMenu:t,children:n,open:r=!1,onOpenChange:i}=e,a=Z(Gr,t),c=nr(t),[l,u]=w.useState(null),[d,f]=w.useState(null),p=s(i);return w.useEffect(()=>(a.open===!1&&p(!1),()=>p(!1)),[a.open,p]),(0,T.jsx)(mn,{...c,children:(0,T.jsx)(ir,{scope:t,open:r,onOpenChange:p,content:d,onContentChange:f,children:(0,T.jsx)(Kr,{scope:t,contentId:o(),triggerId:o(),trigger:l,onTriggerChange:u,children:n})})})};Jr.displayName=Gr;var Yr=`MenuSubTrigger`,Xr=w.forwardRef((e,t)=>{let n=Z(Yr,e.__scopeMenu),r=or(Yr,e.__scopeMenu),i=qr(Yr,e.__scopeMenu),a=hr(Yr,e.__scopeMenu),o=w.useRef(null),{pointerGraceTimerRef:s,onPointerGraceIntentChange:c}=a,l={__scopeMenu:e.__scopeMenu},u=w.useCallback(()=>{o.current&&window.clearTimeout(o.current),o.current=null},[]);w.useEffect(()=>u,[u]),w.useEffect(()=>{let e=s.current;return()=>{window.clearTimeout(e),c(null)}},[s,c]);let d=S(t,i.onTriggerChange);return(0,T.jsx)(lr,{asChild:!0,...l,children:(0,T.jsx)(Or,{id:i.triggerId,"aria-haspopup":`menu`,"aria-expanded":n.open,"aria-controls":n.open?i.contentId:void 0,"data-state":$r(n.open),...e,ref:d,onClick:t=>{e.onClick?.(t),!(e.disabled||t.defaultPrevented)&&(t.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:v(e.onPointerMove,si(t=>{a.onItemEnter(t),!t.defaultPrevented&&!e.disabled&&!n.open&&!o.current&&(a.onPointerGraceIntentChange(null),o.current=window.setTimeout(()=>{n.onOpenChange(!0),u()},100))})),onPointerLeave:v(e.onPointerLeave,si(e=>{u();let t=n.content?.getBoundingClientRect();if(t){let r=n.content?.dataset.side,i=r===`right`,o=i?-5:5,c=t[i?`left`:`right`],l=t[i?`right`:`left`];a.onPointerGraceIntentChange({area:[{x:e.clientX+o,y:e.clientY},{x:c,y:t.top},{x:l,y:t.top},{x:l,y:t.bottom},{x:c,y:t.bottom}],side:r}),window.clearTimeout(s.current),s.current=window.setTimeout(()=>a.onPointerGraceIntentChange(null),300)}else{if(a.onTriggerLeave(e),e.defaultPrevented)return;a.onPointerGraceIntentChange(null)}})),onKeyDown:v(e.onKeyDown,t=>{e.disabled||t.target!==t.currentTarget||a.searchRef.current!==``&&t.key===` `||Yn[r.dir].includes(t.key)&&(n.onOpenChange(!0),n.content?.focus(),t.preventDefault())})})})});Xr.displayName=Yr;var Zr=`MenuSubContent`,Qr=w.forwardRef((e,t)=>{let n=fr(Q,e.__scopeMenu),{forceMount:r=n.forceMount,align:i=`start`,...a}=e,o=Z(Q,e.__scopeMenu),s=or(Q,e.__scopeMenu),c=qr(Zr,e.__scopeMenu),l=w.useRef(null),u=S(t,l);return(0,T.jsx)(Qn.Provider,{scope:e.__scopeMenu,children:(0,T.jsx)(d,{present:r||o.open,children:(0,T.jsx)(Qn.Slot,{scope:e.__scopeMenu,children:(0,T.jsx)(br,{id:c.contentId,"aria-labelledby":c.triggerId,...a,ref:u,align:i,side:s.dir===`rtl`?`left`:`right`,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{s.isUsingKeyboardRef.current&&l.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:v(e.onFocusOutside,e=>{e.target!==c.trigger&&o.onOpenChange(!1)}),onEscapeKeyDown:v(e.onEscapeKeyDown,e=>{s.onClose(),e.preventDefault()}),onKeyDown:v(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),n=Xn[s.dir].includes(e.key);t&&n&&(o.onOpenChange(!1),c.trigger?.focus(),e.preventDefault())})})})})})});Qr.displayName=Zr;function $r(e){return e?`open`:`closed`}function ei(e){return e===`indeterminate`}function ti(e){return ei(e)?`indeterminate`:e?`checked`:`unchecked`}function ni(e){let t=document.activeElement;for(let n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function ri(e,t){return e.map((n,r)=>e[(t+r)%e.length])}function ii(e,t,n){let r=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=n?e.indexOf(n):-1,a=ri(e,Math.max(i,0));r.length===1&&(a=a.filter(e=>e!==n));let o=a.find(e=>e.toLowerCase().startsWith(r.toLowerCase()));return o===n?void 0:o}function ai(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}function oi(e,t){return t?ai({x:e.clientX,y:e.clientY},t):!1}function si(e){return t=>t.pointerType===`mouse`?e(t):void 0}var ci=sr,li=lr,ui=pr,di=gr,fi=Sr,pi=wr,mi=Dr,hi=Ar,gi=Pr,_i=Ir,vi=Br,yi=Hr,bi=Wr,xi=Xr,Si=Qr,Ci=`DropdownMenu`,[wi,Ti]=l(Ci,[tr]),$=tr(),[Ei,Di]=wi(Ci),Oi=e=>{let{__scopeDropdownMenu:t,children:n,dir:r,open:i,defaultOpen:a,onOpenChange:s,modal:c=!0}=e,l=$(t),u=w.useRef(null),[d,f]=y({prop:i,defaultProp:a??!1,onChange:s,caller:Ci});return(0,T.jsx)(Ei,{scope:t,triggerId:o(),triggerRef:u,contentId:o(),open:d,onOpenChange:f,onOpenToggle:w.useCallback(()=>f(e=>!e),[f]),modal:c,children:(0,T.jsx)(ci,{...l,open:d,onOpenChange:f,dir:r,modal:c,children:n})})};Oi.displayName=Ci;var ki=`DropdownMenuTrigger`,Ai=w.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,disabled:r=!1,...i}=e,a=Di(ki,n),o=$(n),s=S(t,a.triggerRef);return(0,T.jsx)(li,{asChild:!0,...o,children:(0,T.jsx)(u.button,{type:`button`,id:a.triggerId,"aria-haspopup":`menu`,"aria-expanded":a.open,"aria-controls":a.open?a.contentId:void 0,"data-state":a.open?`open`:`closed`,"data-disabled":r?``:void 0,disabled:r,...i,ref:s,onPointerDown:v(e.onPointerDown,e=>{!r&&e.button===0&&e.ctrlKey===!1&&(a.onOpenToggle(),a.open||e.preventDefault())}),onKeyDown:v(e.onKeyDown,e=>{r||([`Enter`,` `].includes(e.key)&&a.onOpenToggle(),e.key===`ArrowDown`&&a.onOpenChange(!0),[`Enter`,` `,`ArrowDown`].includes(e.key)&&e.preventDefault())})})})});Ai.displayName=ki;var ji=`DropdownMenuPortal`,Mi=e=>{let{__scopeDropdownMenu:t,...n}=e,r=$(t);return(0,T.jsx)(ui,{...r,...n})};Mi.displayName=ji;var Ni=`DropdownMenuContent`,Pi=w.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=Di(Ni,n),a=$(n),o=w.useRef(!1);return(0,T.jsx)(di,{id:i.contentId,"aria-labelledby":i.triggerId,...a,...r,ref:t,onCloseAutoFocus:v(e.onCloseAutoFocus,e=>{o.current||i.triggerRef.current?.focus(),o.current=!1,e.preventDefault()}),onInteractOutside:v(e.onInteractOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0,r=t.button===2||n;(!i.modal||r)&&(o.current=!0)}),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});Pi.displayName=Ni;var Fi=`DropdownMenuGroup`,Ii=w.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,T.jsx)(fi,{...i,...r,ref:t})});Ii.displayName=Fi;var Li=`DropdownMenuLabel`,Ri=w.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,T.jsx)(pi,{...i,...r,ref:t})});Ri.displayName=Li;var zi=`DropdownMenuItem`,Bi=w.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,T.jsx)(mi,{...i,...r,ref:t})});Bi.displayName=zi;var Vi=`DropdownMenuCheckboxItem`,Hi=w.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,T.jsx)(hi,{...i,...r,ref:t})});Hi.displayName=Vi;var Ui=`DropdownMenuRadioGroup`,Wi=w.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,T.jsx)(gi,{...i,...r,ref:t})});Wi.displayName=Ui;var Gi=`DropdownMenuRadioItem`,Ki=w.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,T.jsx)(_i,{...i,...r,ref:t})});Ki.displayName=Gi;var qi=`DropdownMenuItemIndicator`,Ji=w.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,T.jsx)(vi,{...i,...r,ref:t})});Ji.displayName=qi;var Yi=`DropdownMenuSeparator`,Xi=w.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,T.jsx)(yi,{...i,...r,ref:t})});Xi.displayName=Yi;var Zi=`DropdownMenuArrow`,Qi=w.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,T.jsx)(bi,{...i,...r,ref:t})});Qi.displayName=Zi;var $i=`DropdownMenuSubTrigger`,ea=w.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,T.jsx)(xi,{...i,...r,ref:t})});ea.displayName=$i;var ta=`DropdownMenuSubContent`,na=w.forwardRef((e,t)=>{let{__scopeDropdownMenu:n,...r}=e,i=$(n);return(0,T.jsx)(Si,{...i,...r,ref:t,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":`var(--radix-popper-transform-origin)`,"--radix-dropdown-menu-content-available-width":`var(--radix-popper-available-width)`,"--radix-dropdown-menu-content-available-height":`var(--radix-popper-available-height)`,"--radix-dropdown-menu-trigger-width":`var(--radix-popper-anchor-width)`,"--radix-dropdown-menu-trigger-height":`var(--radix-popper-anchor-height)`}})});na.displayName=ta;var ra=Oi,ia=Ai,aa=Mi,oa=Pi,sa=Ri,ca=Bi,la=Hi,ua=Wi,da=Ki,fa=Ji,pa=Xi;function ma({...e}){return(0,T.jsx)(ra,{"data-slot":`dropdown-menu`,...e})}function ha({...e}){return(0,T.jsx)(ia,{"data-slot":`dropdown-menu-trigger`,...e})}function ga({className:e,sideOffset:t=4,...n}){return(0,T.jsx)(aa,{children:(0,T.jsx)(oa,{"data-slot":`dropdown-menu-content`,sideOffset:t,className:C(`z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] max-w-(--radix-dropdown-menu-content-available-width) [overflow-wrap:anywhere] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95`,e),...n})})}function _a({className:e,inset:t,variant:n=`default`,...r}){return(0,T.jsx)(ca,{"data-slot":`dropdown-menu-item`,"data-inset":t,"data-variant":n,className:C(`relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground data-[variant=destructive]:*:[svg]:text-destructive!`,e),...r})}function va({className:e,children:t,checked:n,...r}){return(0,T.jsxs)(la,{"data-slot":`dropdown-menu-checkbox-item`,className:C(`relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),checked:n,...r,children:[(0,T.jsx)(`span`,{className:`pointer-events-none absolute left-2 flex size-3.5 items-center justify-center`,children:(0,T.jsx)(fa,{children:(0,T.jsx)(h,{className:`size-4`})})}),t]})}function ya({...e}){return(0,T.jsx)(ua,{"data-slot":`dropdown-menu-radio-group`,...e})}function ba({className:e,children:t,...n}){return(0,T.jsxs)(da,{"data-slot":`dropdown-menu-radio-item`,className:C(`relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,e),...n,children:[(0,T.jsx)(`span`,{className:`pointer-events-none absolute left-2 flex size-3.5 items-center justify-center`,children:(0,T.jsx)(fa,{children:(0,T.jsx)(_,{className:`size-2 fill-current`})})}),t]})}function xa({className:e,inset:t,...n}){return(0,T.jsx)(sa,{"data-slot":`dropdown-menu-label`,"data-inset":t,className:C(`px-2 py-1.5 text-sm font-medium data-[inset]:pl-8`,e),...n})}function Sa({className:e,...t}){return(0,T.jsx)(pa,{"data-slot":`dropdown-menu-separator`,className:C(`-mx-1 my-1 h-px bg-border`,e),...t})}export{Zt as _,xa as a,Sa as c,Un as d,jn as f,mn as g,gn as h,_a as i,ha as l,_n as m,va as n,ya as o,hn as p,ga as r,ba as s,ma as t,Wn as u,A as v,O as y};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Xt as r,Z as i,_t as a,d as o,dt as s,xt as c}from"./alert-dialog-
|
|
1
|
+
import{r as e}from"./rolldown-runtime-QTnfLwEv.js";import{i as t,t as n}from"./react-runtime-CCIEwYL0.js";import{Xt as r,Z as i,_t as a,d as o,dt as s,xt as c}from"./alert-dialog-CVF_qvQ8.js";import{n as l,t as u}from"./utils-DNvmfH6b.js";import{i as d,l as f,r as p,t as m}from"./dropdown-menu-IsTcumXE.js";import{t as h}from"./createLucideIcon-BHp8sXmF.js";import{n as g,t as _}from"./diff-controls-CuqRa-63.js";import{t as v}from"./external-link-BE6y205O.js";import{t as y}from"./square-terminal-B6RYYieR.js";import{t as b}from"./diff-stat-BXriPIds.js";var x=h(`ellipsis-vertical`,[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`12`,cy:`5`,r:`1`,key:`gxeob9`}],[`circle`,{cx:`12`,cy:`19`,r:`1`,key:`lyex9k`}]]),S=h(`file`,[[`path`,{d:`M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z`,key:`1oefj6`}],[`path`,{d:`M14 2v5a1 1 0 0 0 1 1h5`,key:`wfsgrz`}]]),C=e(t(),1),w=n();function T({root:e,selected:t,onSelect:n}){return(0,w.jsx)(`nav`,{"data-slot":`changes-tree`,"aria-label":`Changed files`,className:`min-w-0 text-[13px]`,children:(0,w.jsxs)(`ul`,{className:`flex flex-col gap-px`,children:[e.dirs.map(e=>(0,w.jsx)(D,{dir:e,depth:0,selected:t,onSelect:n},e.path)),e.files.map(e=>(0,w.jsx)(k,{file:e,depth:0,selected:t,onSelect:n},e.path))]})})}function E({adds:e,dels:t}){return(0,w.jsxs)(`span`,{className:`ml-auto shrink-0 pl-2 font-mono text-[11px] font-medium tabular-nums`,children:[e>0?(0,w.jsxs)(`span`,{className:`text-success`,children:[`+`,e]}):null,e>0&&t>0?` `:null,t>0?(0,w.jsxs)(`span`,{className:`text-danger`,children:[`−`,t]}):null]})}function D({dir:e,depth:t,selected:n,onSelect:r}){let[a,o]=(0,C.useState)(!0);return(0,w.jsxs)(`li`,{children:[(0,w.jsxs)(`button`,{type:`button`,"data-slot":`tree-dir`,"data-path":e.path,"data-state":a?`open`:`closed`,"aria-expanded":a,onClick:()=>o(e=>!e),className:`flex min-h-11 w-full min-w-0 items-center gap-1.5 rounded-sm px-1.5 py-1 text-left text-muted-foreground hover:bg-muted hover:text-foreground`,style:{paddingLeft:`${6+t*14}px`},children:[(0,w.jsx)(i,{size:16,"aria-hidden":`true`,className:u(`size-3.5 shrink-0 transition-transform motion-reduce:transition-none`,a&&`rotate-90`)}),(0,w.jsx)(s,{size:16,"aria-hidden":`true`,className:`size-3.5 shrink-0`}),(0,w.jsx)(`span`,{className:`min-w-0 truncate font-medium`,children:e.name}),(0,w.jsx)(E,{adds:e.adds,dels:e.dels})]}),a?(0,w.jsxs)(`ul`,{className:`flex flex-col gap-px`,children:[e.dirs.map(e=>(0,w.jsx)(D,{dir:e,depth:t+1,selected:n,onSelect:r},e.path)),e.files.map(e=>(0,w.jsx)(k,{file:e,depth:t+1,selected:n,onSelect:r},e.path))]}):null]})}var O={added:`text-success`,deleted:`text-danger`};function k({file:e,depth:t,selected:n,onSelect:r}){let i=n===e.path;return(0,w.jsx)(`li`,{children:(0,w.jsxs)(`button`,{type:`button`,"data-slot":`tree-file`,"data-path":e.path,"aria-current":i?`true`:void 0,onClick:()=>r(e.path),className:u(`flex min-h-11 w-full min-w-0 items-center gap-1.5 rounded-sm px-1.5 py-1 text-left hover:bg-muted`,i?`bg-muted font-medium text-foreground`:`text-muted-foreground hover:text-foreground`),style:{paddingLeft:`${24+t*14}px`},children:[(0,w.jsx)(S,{"aria-hidden":`true`,className:u(`size-3.5 shrink-0`,O[e.status])}),(0,w.jsx)(`span`,{className:`min-w-0 truncate`,children:e.name}),(0,w.jsx)(E,{adds:e.adds,dels:e.dels})]})})}function A(e,t){return{kind:`dir`,name:e,path:t,dirs:[],files:[],adds:0,dels:0,fileCount:0}}function j(e){let t=e;for(;t.files.length===0&&t.dirs.length===1;){let e=t.dirs[0];t={...e,name:`${t.name}/${e.name}`}}return{...t,dirs:t.dirs.map(j)}}var M=(e,t)=>e.name.localeCompare(t.name);function N(e){let t=A(``,``),n=new Map([[``,t]]),r=e=>{let t=n.get(e);if(t)return t;let i=e.lastIndexOf(`/`),a=r(i===-1?``:e.slice(0,i)),o=A(i===-1?e:e.slice(i+1),e);return a.dirs.push(o),n.set(e,o),o};for(let t of e){let e=t.path.lastIndexOf(`/`);r(e===-1?``:t.path.slice(0,e)).files.push({kind:`file`,name:e===-1?t.path:t.path.slice(e+1),path:t.path,status:t.status,adds:t.adds,dels:t.dels,binary:t.binary})}let i=e=>{e.dirs.forEach(i),e.adds=e.files.reduce((e,t)=>e+t.adds,0)+e.dirs.reduce((e,t)=>e+t.adds,0),e.dels=e.files.reduce((e,t)=>e+t.dels,0)+e.dirs.reduce((e,t)=>e+t.dels,0),e.fileCount=e.files.length+e.dirs.reduce((e,t)=>e+t.fileCount,0),e.dirs.sort(M),e.files.sort(M)};return i(t),{...t,dirs:t.dirs.map(j)}}function P({bar:e,branch:t,stat:n,mode:r,wrap:i,onModeChange:a,onWrapChange:s,onAction:c}){return(0,w.jsxs)(`div`,{"data-slot":`git-toolbar`,className:`flex flex-wrap items-center gap-x-2.5 gap-y-1.5 px-[18px] py-[22px] md:px-9 [&_button]:min-h-11`,children:[t?(0,w.jsx)(_,{branch:t}):null,n?(0,w.jsx)(L,{stat:n}):null,(0,w.jsxs)(`span`,{className:`ml-auto flex items-center gap-1`,children:[(0,w.jsx)(`span`,{className:`hidden items-center gap-1 md:flex`,children:(0,w.jsx)(g,{mode:r,wrap:i,onModeChange:a,onWrapChange:s})}),e.secondary.map(e=>(0,w.jsx)(I,{action:e,variant:`outline`,onAction:c},e.id)),(0,w.jsx)(I,{action:e.primary,variant:`primary`,onAction:c}),e.menu.length>0?(0,w.jsxs)(m,{children:[(0,w.jsx)(f,{asChild:!0,children:(0,w.jsx)(o,{variant:`ghost`,size:`icon-sm`,"aria-label":`More git actions`,children:(0,w.jsx)(x,{"aria-hidden":`true`})})}),(0,w.jsx)(p,{align:`end`,"data-slot":`git-toolbar-menu`,children:e.menu.map(e=>(0,w.jsxs)(d,{disabled:!e.enabled,title:e.reason,onSelect:()=>c(e.id),children:[F[e.id],e.label]},e.id))})]}):null]})]})}var F={commit:(0,w.jsx)(a,{size:16,"aria-hidden":`true`}),push:(0,w.jsx)(r,{size:16,"aria-hidden":`true`}),"create-pr":(0,w.jsx)(c,{size:16,"aria-hidden":`true`}),"view-pr":(0,w.jsx)(v,{"aria-hidden":`true`}),"open-terminal":(0,w.jsx)(y,{"aria-hidden":`true`})};function I({action:e,variant:t,onAction:n}){return e.id===`view-pr`?l(e.href)?(0,w.jsx)(o,{asChild:!0,variant:t,size:`sm`,"data-action":e.id,children:(0,w.jsxs)(`a`,{href:e.href,target:`_blank`,rel:`noopener noreferrer`,children:[F[e.id],e.label]})}):(0,w.jsxs)(o,{variant:t,size:`sm`,"data-action":e.id,disabled:!0,title:`View PR unavailable — the recorded PR link is not an http(s) URL`,children:[F[e.id],e.label]}):(0,w.jsxs)(o,{variant:t,size:`sm`,"data-action":e.id,disabled:!e.enabled,title:e.enabled?void 0:e.reason,onClick:()=>n(e.id),children:[F[e.id],e.label]})}function L({stat:e}){return(0,w.jsx)(`span`,{"data-slot":`changes-stat`,children:(0,w.jsx)(b,{stat:{adds:R(e.adds),dels:R(e.dels),files:e.files}})})}function R(e){let[t,n]=(0,C.useState)(e),r=(0,C.useRef)(e);return(0,C.useEffect)(()=>{let t=r.current;if(t===e)return;if(typeof window.matchMedia==`function`&&window.matchMedia(`(prefers-reduced-motion: reduce)`).matches||typeof requestAnimationFrame!=`function`){r.current=e,n(e);return}let i=performance.now(),a=0,o=s=>{let c=Math.min(1,(s-i)/350),l=1-(1-c)**3;n(Math.round(t+(e-t)*l)),c<1?a=requestAnimationFrame(o):r.current=e};return a=requestAnimationFrame(o),()=>{cancelAnimationFrame(a),r.current=e,n(e)}},[e]),t}export{T as i,P as n,N as r,L as t};
|