import{s as E}from"./chunk-LvLJmgfZ.js";import{t as Te}from"./react-Bj1aDYRI.js";import{t as P}from"./compiler-runtime-B3qBwwSJ.js";import{r as N}from"./useEventListener-CjXriKgk.js";import{t as $e}from"./jsx-runtime-CP2fAiZX.js";import{n as R}from"./button-BmOH9agK.js";import{t as p}from"./cn-d_A4rA-x.js";import{E as M,S as ke,T as ze,_ as h,a as Be,b as He,d as We,f as b,i as qe,m as Ke,r as Le,s as Ue,t as Ve,u as Ye,w as v,x as w,y as Ze}from"./Combination-tjZP3FH6.js";var i=E(Te(),1),l=E($e(),1),j="Dialog",[S,T]=M(j),[Ge,f]=S(j),$=t=>{let{__scopeDialog:r,children:e,open:a,defaultOpen:o,onOpenChange:n,modal:s=!0}=t,c=i.useRef(null),d=i.useRef(null),[u,x]=ke({prop:a,defaultProp:o??!1,onChange:n,caller:j});return(0,l.jsx)(Ge,{scope:r,triggerRef:c,contentRef:d,contentId:b(),titleId:b(),descriptionId:b(),open:u,onOpenChange:x,onOpenToggle:i.useCallback(()=>x(Se=>!Se),[x]),modal:s,children:e})};$.displayName=j;var k="DialogTrigger",z=i.forwardRef((t,r)=>{let{__scopeDialog:e,...a}=t,o=f(k,e),n=N(r,o.triggerRef);return(0,l.jsx)(h.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":O(o.open),...a,ref:n,onClick:v(t.onClick,o.onOpenToggle)})});z.displayName=k;var A="DialogPortal",[Je,B]=S(A,{forceMount:void 0}),H=t=>{let{__scopeDialog:r,forceMount:e,children:a,container:o}=t,n=f(A,r);return(0,l.jsx)(Je,{scope:r,forceMount:e,children:i.Children.map(a,s=>(0,l.jsx)(w,{present:e||n.open,children:(0,l.jsx)(We,{asChild:!0,container:o,children:s})}))})};H.displayName=A;var _="DialogOverlay",W=i.forwardRef((t,r)=>{let e=B(_,t.__scopeDialog),{forceMount:a=e.forceMount,...o}=t,n=f(_,t.__scopeDialog);return n.modal?(0,l.jsx)(w,{present:a||n.open,children:(0,l.jsx)(Xe,{...o,ref:r})}):null});W.displayName=_;var Qe=Ze("DialogOverlay.RemoveScroll"),Xe=i.forwardRef((t,r)=>{let{__scopeDialog:e,...a}=t,o=f(_,e);return(0,l.jsx)(Ve,{as:Qe,allowPinchZoom:!0,shards:[o.contentRef],children:(0,l.jsx)(h.div,{"data-state":O(o.open),...a,ref:r,style:{pointerEvents:"auto",...a.style}})})}),y="DialogContent",q=i.forwardRef((t,r)=>{let e=B(y,t.__scopeDialog),{forceMount:a=e.forceMount,...o}=t,n=f(y,t.__scopeDialog);return(0,l.jsx)(w,{present:a||n.open,children:n.modal?(0,l.jsx)(er,{...o,ref:r}):(0,l.jsx)(rr,{...o,ref:r})})});q.displayName=y;var er=i.forwardRef((t,r)=>{let e=f(y,t.__scopeDialog),a=i.useRef(null),o=N(r,e.contentRef,a);return i.useEffect(()=>{let n=a.current;if(n)return Le(n)},[]),(0,l.jsx)(K,{...t,ref:o,trapFocus:e.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:v(t.onCloseAutoFocus,n=>{var s;n.preventDefault(),(s=e.triggerRef.current)==null||s.focus()}),onPointerDownOutside:v(t.onPointerDownOutside,n=>{let s=n.detail.originalEvent,c=s.button===0&&s.ctrlKey===!0;(s.button===2||c)&&n.preventDefault()}),onFocusOutside:v(t.onFocusOutside,n=>n.preventDefault())})}),rr=i.forwardRef((t,r)=>{let e=f(y,t.__scopeDialog),a=i.useRef(!1),o=i.useRef(!1);return(0,l.jsx)(K,{...t,ref:r,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:n=>{var s,c;(s=t.onCloseAutoFocus)==null||s.call(t,n),n.defaultPrevented||(a.current||((c=e.triggerRef.current)==null||c.focus()),n.preventDefault()),a.current=!1,o.current=!1},onInteractOutside:n=>{var c,d;(c=t.onInteractOutside)==null||c.call(t,n),n.defaultPrevented||(a.current=!0,n.detail.originalEvent.type==="pointerdown"&&(o.current=!0));let s=n.target;(d=e.triggerRef.current)!=null&&d.contains(s)&&n.preventDefault(),n.detail.originalEvent.type==="focusin"&&o.current&&n.preventDefault()}})}),K=i.forwardRef((t,r)=>{let{__scopeDialog:e,trapFocus:a,onOpenAutoFocus:o,onCloseAutoFocus:n,...s}=t,c=f(y,e),d=i.useRef(null),u=N(r,d);return Be(),(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(qe,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:o,onUnmountAutoFocus:n,children:(0,l.jsx)(Ke,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":O(c.open),...s,ref:u,onDismiss:()=>c.onOpenChange(!1)})}),(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(ar,{titleId:c.titleId}),(0,l.jsx)(nr,{contentRef:d,descriptionId:c.descriptionId})]})]})}),C="DialogTitle",L=i.forwardRef((t,r)=>{let{__scopeDialog:e,...a}=t,o=f(C,e);return(0,l.jsx)(h.h2,{id:o.titleId,...a,ref:r})});L.displayName=C;var U="DialogDescription",V=i.forwardRef((t,r)=>{let{__scopeDialog:e,...a}=t,o=f(U,e);return(0,l.jsx)(h.p,{id:o.descriptionId,...a,ref:r})});V.displayName=U;var Y="DialogClose",Z=i.forwardRef((t,r)=>{let{__scopeDialog:e,...a}=t,o=f(Y,e);return(0,l.jsx)(h.button,{type:"button",...a,ref:r,onClick:v(t.onClick,()=>o.onOpenChange(!1))})});Z.displayName=Y;function O(t){return t?"open":"closed"}var G="DialogTitleWarning",[tr,J]=ze(G,{contentName:y,titleName:C,docsSlug:"dialog"}),ar=({titleId:t})=>{let r=J(G),e=`\`${r.contentName}\` requires a \`${r.titleName}\` for the component to be accessible for screen reader users.

If you want to hide the \`${r.titleName}\`, you can wrap it with our VisuallyHidden component.

For more information, see https://radix-ui.com/primitives/docs/components/${r.docsSlug}`;return i.useEffect(()=>{t&&(document.getElementById(t)||console.error(e))},[e,t]),null},or="DialogDescriptionWarning",nr=({contentRef:t,descriptionId:r})=>{let e=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${J(or).contentName}}.`;return i.useEffect(()=>{var o;let a=(o=t.current)==null?void 0:o.getAttribute("aria-describedby");r&&a&&(document.getElementById(r)||console.warn(e))},[e,t,r]),null},Q=$,X=z,ee=H,re=W,te=q,ae=L,oe=V,I=Z,ne="AlertDialog",[sr,Cr]=M(ne,[T]),m=T(),se=t=>{let{__scopeAlertDialog:r,...e}=t,a=m(r);return(0,l.jsx)(Q,{...a,...e,modal:!0})};se.displayName=ne;var lr="AlertDialogTrigger",le=i.forwardRef((t,r)=>{let{__scopeAlertDialog:e,...a}=t,o=m(e);return(0,l.jsx)(X,{...o,...a,ref:r})});le.displayName=lr;var ir="AlertDialogPortal",ie=t=>{let{__scopeAlertDialog:r,...e}=t,a=m(r);return(0,l.jsx)(ee,{...a,...e})};ie.displayName=ir;var cr="AlertDialogOverlay",ce=i.forwardRef((t,r)=>{let{__scopeAlertDialog:e,...a}=t,o=m(e);return(0,l.jsx)(re,{...o,...a,ref:r})});ce.displayName=cr;var D="AlertDialogContent",[dr,ur]=sr(D),fr=He("AlertDialogContent"),de=i.forwardRef((t,r)=>{let{__scopeAlertDialog:e,children:a,...o}=t,n=m(e),s=i.useRef(null),c=N(r,s),d=i.useRef(null);return(0,l.jsx)(tr,{contentName:D,titleName:ue,docsSlug:"alert-dialog",children:(0,l.jsx)(dr,{scope:e,cancelRef:d,children:(0,l.jsxs)(te,{role:"alertdialog",...n,...o,ref:c,onOpenAutoFocus:v(o.onOpenAutoFocus,u=>{var x;u.preventDefault(),(x=d.current)==null||x.focus({preventScroll:!0})}),onPointerDownOutside:u=>u.preventDefault(),onInteractOutside:u=>u.preventDefault(),children:[(0,l.jsx)(fr,{children:a}),(0,l.jsx)(mr,{contentRef:s})]})})})});de.displayName=D;var ue="AlertDialogTitle",fe=i.forwardRef((t,r)=>{let{__scopeAlertDialog:e,...a}=t,o=m(e);return(0,l.jsx)(ae,{...o,...a,ref:r})});fe.displayName=ue;var pe="AlertDialogDescription",me=i.forwardRef((t,r)=>{let{__scopeAlertDialog:e,...a}=t,o=m(e);return(0,l.jsx)(oe,{...o,...a,ref:r})});me.displayName=pe;var pr="AlertDialogAction",ge=i.forwardRef((t,r)=>{let{__scopeAlertDialog:e,...a}=t,o=m(e);return(0,l.jsx)(I,{...o,...a,ref:r})});ge.displayName=pr;var ye="AlertDialogCancel",xe=i.forwardRef((t,r)=>{let{__scopeAlertDialog:e,...a}=t,{cancelRef:o}=ur(ye,e),n=m(e),s=N(r,o);return(0,l.jsx)(I,{...n,...a,ref:s})});xe.displayName=ye;var mr=({contentRef:t})=>{let r=`\`${D}\` requires a description for the component to be accessible for screen reader users.

You can add a description to the \`${D}\` by passing a \`${pe}\` component as a child, which also benefits sighted users by adding visible context to the dialog.

Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${D}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.

For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return i.useEffect(()=>{var e;document.getElementById((e=t.current)==null?void 0:e.getAttribute("aria-describedby"))||console.warn(r)},[r,t]),null},gr=se,yr=le,ve=ie,De=ce,Ne=de,F=ge,he=xe,je=fe,_e=me,xr=P();function Re(){let t=(0,xr.c)(3),[r,e]=(0,i.useState)(null),a;t[0]===Symbol.for("react.memo_cache_sentinel")?(a=()=>{e(document.activeElement)},t[0]=a):a=t[0];let o=a,n;return t[1]===r?n=t[2]:(n={onOpenAutoFocus:o,onCloseAutoFocus:s=>{document.activeElement===document.body&&(r instanceof HTMLElement&&r.focus(),s.preventDefault())}},t[1]=r,t[2]=n),n}var g=P(),vr=gr,Dr=yr,be=Ue(({children:t,...r})=>(0,l.jsx)(ve,{...r,children:(0,l.jsx)(Ye,{children:(0,l.jsx)("div",{className:"fixed inset-0 z-50 flex items-end justify-center sm:items-start sm:top-[15%]",children:t})})}));be.displayName=ve.displayName;var we=i.forwardRef((t,r)=>{let e=(0,g.c)(9),a,o;if(e[0]!==t){let{className:c,children:d,...u}=t;a=c,o=u,e[0]=t,e[1]=a,e[2]=o}else a=e[1],o=e[2];let n;e[3]===a?n=e[4]:(n=p("fixed inset-0 z-50 bg-background/80 backdrop-blur-xs transition-opacity animate-in fade-in",a),e[3]=a,e[4]=n);let s;return e[5]!==o||e[6]!==r||e[7]!==n?(s=(0,l.jsx)(De,{className:n,...o,ref:r}),e[5]=o,e[6]=r,e[7]=n,e[8]=s):s=e[8],s});we.displayName=De.displayName;var Ae=i.forwardRef((t,r)=>{let e=(0,g.c)(11),a,o;e[0]===t?(a=e[1],o=e[2]):({className:a,...o}=t,e[0]=t,e[1]=a,e[2]=o);let n=Re(),s;e[3]===Symbol.for("react.memo_cache_sentinel")?(s=(0,l.jsx)(we,{}),e[3]=s):s=e[3];let c;e[4]===a?c=e[5]:(c=p("fixed z-50 grid w-full max-w-2xl scale-100 gap-4 border bg-background p-6 opacity-100 shadow-sm animate-in fade-in-90 slide-in-from-bottom-10 sm:rounded-lg sm:zoom-in-90 sm:slide-in-from-bottom-0 md:w-full",a),e[4]=a,e[5]=c);let d;return e[6]!==o||e[7]!==r||e[8]!==n||e[9]!==c?(d=(0,l.jsxs)(be,{children:[s,(0,l.jsx)(Ne,{ref:r,className:c,...n,...o})]}),e[6]=o,e[7]=r,e[8]=n,e[9]=c,e[10]=d):d=e[10],d});Ae.displayName=Ne.displayName;var Ce=t=>{let r=(0,g.c)(8),e,a;r[0]===t?(e=r[1],a=r[2]):({className:e,...a}=t,r[0]=t,r[1]=e,r[2]=a);let o;r[3]===e?o=r[4]:(o=p("flex flex-col space-y-2 text-center sm:text-left",e),r[3]=e,r[4]=o);let n;return r[5]!==a||r[6]!==o?(n=(0,l.jsx)("div",{className:o,...a}),r[5]=a,r[6]=o,r[7]=n):n=r[7],n};Ce.displayName="AlertDialogHeader";var Oe=t=>{let r=(0,g.c)(8),e,a;r[0]===t?(e=r[1],a=r[2]):({className:e,...a}=t,r[0]=t,r[1]=e,r[2]=a);let o;r[3]===e?o=r[4]:(o=p("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),r[3]=e,r[4]=o);let n;return r[5]!==a||r[6]!==o?(n=(0,l.jsx)("div",{className:o,...a}),r[5]=a,r[6]=o,r[7]=n):n=r[7],n};Oe.displayName="AlertDialogFooter";var Ie=i.forwardRef((t,r)=>{let e=(0,g.c)(9),a,o;e[0]===t?(a=e[1],o=e[2]):({className:a,...o}=t,e[0]=t,e[1]=a,e[2]=o);let n;e[3]===a?n=e[4]:(n=p("text-lg font-semibold",a),e[3]=a,e[4]=n);let s;return e[5]!==o||e[6]!==r||e[7]!==n?(s=(0,l.jsx)(je,{ref:r,className:n,...o}),e[5]=o,e[6]=r,e[7]=n,e[8]=s):s=e[8],s});Ie.displayName=je.displayName;var Fe=i.forwardRef((t,r)=>{let e=(0,g.c)(9),a,o;e[0]===t?(a=e[1],o=e[2]):({className:a,...o}=t,e[0]=t,e[1]=a,e[2]=o);let n;e[3]===a?n=e[4]:(n=p("text-muted-foreground",a),e[3]=a,e[4]=n);let s;return e[5]!==o||e[6]!==r||e[7]!==n?(s=(0,l.jsx)(_e,{ref:r,className:n,...o}),e[5]=o,e[6]=r,e[7]=n,e[8]=s):s=e[8],s});Fe.displayName=_e.displayName;var Ee=i.forwardRef((t,r)=>{let e=(0,g.c)(9),a,o;e[0]===t?(a=e[1],o=e[2]):({className:a,...o}=t,e[0]=t,e[1]=a,e[2]=o);let n;e[3]===a?n=e[4]:(n=p(R(),a),e[3]=a,e[4]=n);let s;return e[5]!==o||e[6]!==r||e[7]!==n?(s=(0,l.jsx)(F,{ref:r,className:n,...o}),e[5]=o,e[6]=r,e[7]=n,e[8]=s):s=e[8],s});Ee.displayName=F.displayName;var Pe=i.forwardRef((t,r)=>{let e=(0,g.c)(9),a,o;e[0]===t?(a=e[1],o=e[2]):({className:a,...o}=t,e[0]=t,e[1]=a,e[2]=o);let n;e[3]===a?n=e[4]:(n=p(R({variant:"destructive"}),a),e[3]=a,e[4]=n);let s;return e[5]!==o||e[6]!==r||e[7]!==n?(s=(0,l.jsx)(F,{ref:r,className:n,...o}),e[5]=o,e[6]=r,e[7]=n,e[8]=s):s=e[8],s});Pe.displayName="AlertDialogDestructiveAction";var Me=i.forwardRef((t,r)=>{let e=(0,g.c)(9),a,o;e[0]===t?(a=e[1],o=e[2]):({className:a,...o}=t,e[0]=t,e[1]=a,e[2]=o);let n;e[3]===a?n=e[4]:(n=p(R({variant:"secondary"}),"mt-2 sm:mt-0",a),e[3]=a,e[4]=n);let s;return e[5]!==o||e[6]!==r||e[7]!==n?(s=(0,l.jsx)(he,{ref:r,className:n,...o}),e[5]=o,e[6]=r,e[7]=n,e[8]=s):s=e[8],s});Me.displayName=he.displayName;export{Q as _,Fe as a,Ce as c,Re as d,I as f,ee as g,re as h,Ae as i,Ie as l,oe as m,Ee as n,Pe as o,te as p,Me as r,Oe as s,vr as t,Dr as u,ae as v,X as y};
