import{s as j}from"./chunk-DZLz74EQ.js";import{t as $e}from"./react-BcIddLXZ.js";import{n as P,t as ke}from"./jsx-runtime-DvsdsEjx.js";import{i as Te,o as N,r as ze}from"./useEventListener-C5BS4xuN.js";import{t as p}from"./cn-C5VTNYKf.js";import{n as b}from"./button-nRVaalxL.js";import{S as M,_ as w,b as v,c as Be,f as He,h,i as We,l as qe,n as Ke,o as Le,r as Ue,t as Ve,u as A,v as Ye,x as Ze}from"./Combination-DR4iFoRS.js";var i=j($e(),1),l=j(ke(),1),_="Dialog",[S,$]=M(_),[Ge,f]=S(_),k=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]=Ye({prop:a,defaultProp:o??!1,onChange:n,caller:_});return(0,l.jsx)(Ge,{scope:r,triggerRef:c,contentRef:d,contentId:A(),titleId:A(),descriptionId:A(),open:u,onOpenChange:x,onOpenToggle:i.useCallback(()=>x(Se=>!Se),[x]),modal:s,children:e})};k.displayName=_;var T="DialogTrigger",z=i.forwardRef((t,r)=>{let{__scopeDialog:e,...a}=t,o=f(T,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":I(o.open),...a,ref:n,onClick:v(t.onClick,o.onOpenToggle)})});z.displayName=T;var C="DialogPortal",[Je,B]=S(C,{forceMount:void 0}),H=t=>{let{__scopeDialog:r,forceMount:e,children:a,container:o}=t,n=f(C,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)(qe,{asChild:!0,container:o,children:s})}))})};H.displayName=C;var R="DialogOverlay",W=i.forwardRef((t,r)=>{let e=B(R,t.__scopeDialog),{forceMount:a=e.forceMount,...o}=t,n=f(R,t.__scopeDialog);return n.modal?(0,l.jsx)(w,{present:a||n.open,children:(0,l.jsx)(Xe,{...o,ref:r})}):null});W.displayName=R;var Qe=ze("DialogOverlay.RemoveScroll"),Xe=i.forwardRef((t,r)=>{let{__scopeDialog:e,...a}=t,o=f(R,e);return(0,l.jsx)(Ve,{as:Qe,allowPinchZoom:!0,shards:[o.contentRef],children:(0,l.jsx)(h.div,{"data-state":I(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 Ke(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 We(),(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(Ue,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:o,onUnmountAutoFocus:n,children:(0,l.jsx)(He,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":I(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})]})]})}),O="DialogTitle",L=i.forwardRef((t,r)=>{let{__scopeDialog:e,...a}=t,o=f(O,e);return(0,l.jsx)(h.h2,{id:o.titleId,...a,ref:r})});L.displayName=O;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 I(t){return t?"open":"closed"}var G="DialogTitleWarning",[tr,J]=Ze(G,{contentName:y,titleName:O,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=k,X=z,ee=H,re=W,te=q,ae=L,oe=V,F=Z,ne="AlertDialog",[sr,Ar]=M(ne,[$]),m=$(),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=Te("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)(F,{...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)(F,{...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,E=ge,he=xe,je=fe,_e=me,xr=j(P(),1);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=j(P(),1),vr=gr,Dr=yr,be=Le(({children:t,...r})=>(0,l.jsx)(ve,{...r,children:(0,l.jsx)(Be,{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(b(),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});Ee.displayName=E.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(b({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)(E,{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(b({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,F 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};
