import{j as n}from"./jsx-runtime-hUI6LOBV.js";import{r as i}from"./index-CFdT0RIo.js";import{u as K,a as U,b as h,d as N,P as m,e as p,f as C,g as Z,h as J,D as Q,l as X}from"./tooltip-CoTdGGXz.js";import{h as ee,R as te,u as oe,F as ae}from"./index-SfOF7hjq.js";import{c as f,I as ne}from"./misc-BNcbB3dR.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};e.SENTRY_RELEASE={id:"66e9b849450b819e11683314a547a341cb57f7d0"};var t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="938c5dc2-e908-4006-8da6-89da1cf03a55",e._sentryDebugIdIdentifier="sentry-dbid-938c5dc2-e908-4006-8da6-89da1cf03a55")}catch{}})();var x="Dialog",[E]=U(x),[re,d]=E(x),I=e=>{const{__scopeDialog:t,children:o,open:r,defaultOpen:s,onOpenChange:a,modal:c=!0}=e,l=i.useRef(null),g=i.useRef(null),[v,y]=K({prop:r,defaultProp:s??!1,onChange:a,caller:x});return n.jsx(re,{scope:t,triggerRef:l,contentRef:g,contentId:h(),titleId:h(),descriptionId:h(),open:v,onOpenChange:y,onOpenToggle:i.useCallback(()=>y(q=>!q),[y]),modal:c,children:o})};I.displayName=x;var j="DialogTrigger",P=i.forwardRef((e,t)=>{const{__scopeDialog:o,...r}=e,s=d(j,o),a=N(t,s.triggerRef);return n.jsx(m.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":_(s.open),...r,ref:a,onClick:p(e.onClick,s.onOpenToggle)})});P.displayName=j;var b="DialogPortal",[se,O]=E(b,{forceMount:void 0}),T=e=>{const{__scopeDialog:t,forceMount:o,children:r,container:s}=e,a=d(b,t);return n.jsx(se,{scope:t,forceMount:o,children:i.Children.map(r,c=>n.jsx(C,{present:o||a.open,children:n.jsx(Z,{asChild:!0,container:s,children:c})}))})};T.displayName=b;var D="DialogOverlay",w=i.forwardRef((e,t)=>{const o=O(D,e.__scopeDialog),{forceMount:r=o.forceMount,...s}=e,a=d(D,e.__scopeDialog);return a.modal?n.jsx(C,{present:r||a.open,children:n.jsx(le,{...s,ref:t})}):null});w.displayName=D;var ie=J("DialogOverlay.RemoveScroll"),le=i.forwardRef((e,t)=>{const{__scopeDialog:o,...r}=e,s=d(D,o);return n.jsx(te,{as:ie,allowPinchZoom:!0,shards:[s.contentRef],children:n.jsx(m.div,{"data-state":_(s.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),u="DialogContent",A=i.forwardRef((e,t)=>{const o=O(u,e.__scopeDialog),{forceMount:r=o.forceMount,...s}=e,a=d(u,e.__scopeDialog);return n.jsx(C,{present:r||a.open,children:a.modal?n.jsx(ce,{...s,ref:t}):n.jsx(de,{...s,ref:t})})});A.displayName=u;var ce=i.forwardRef((e,t)=>{const o=d(u,e.__scopeDialog),r=i.useRef(null),s=N(t,o.contentRef,r);return i.useEffect(()=>{const a=r.current;if(a)return ee(a)},[]),n.jsx(M,{...e,ref:s,trapFocus:o.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:p(e.onCloseAutoFocus,a=>{a.preventDefault(),o.triggerRef.current?.focus()}),onPointerDownOutside:p(e.onPointerDownOutside,a=>{const c=a.detail.originalEvent,l=c.button===0&&c.ctrlKey===!0;(c.button===2||l)&&a.preventDefault()}),onFocusOutside:p(e.onFocusOutside,a=>a.preventDefault())})}),de=i.forwardRef((e,t)=>{const o=d(u,e.__scopeDialog),r=i.useRef(!1),s=i.useRef(!1);return n.jsx(M,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:a=>{e.onCloseAutoFocus?.(a),a.defaultPrevented||(r.current||o.triggerRef.current?.focus(),a.preventDefault()),r.current=!1,s.current=!1},onInteractOutside:a=>{e.onInteractOutside?.(a),a.defaultPrevented||(r.current=!0,a.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const c=a.target;o.triggerRef.current?.contains(c)&&a.preventDefault(),a.detail.originalEvent.type==="focusin"&&s.current&&a.preventDefault()}})}),M=i.forwardRef((e,t)=>{const{__scopeDialog:o,trapFocus:r,onOpenAutoFocus:s,onCloseAutoFocus:a,...c}=e,l=d(u,o),g=i.useRef(null),v=N(t,g);return oe(),n.jsxs(n.Fragment,{children:[n.jsx(ae,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:s,onUnmountAutoFocus:a,children:n.jsx(Q,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":_(l.open),...c,ref:v,onDismiss:()=>l.onOpenChange(!1)})}),n.jsxs(n.Fragment,{children:[n.jsx(ue,{titleId:l.titleId}),n.jsx(ge,{contentRef:g,descriptionId:l.descriptionId})]})]})}),R="DialogTitle",F=i.forwardRef((e,t)=>{const{__scopeDialog:o,...r}=e,s=d(R,o);return n.jsx(m.h2,{id:s.titleId,...r,ref:t})});F.displayName=R;var S="DialogDescription",k=i.forwardRef((e,t)=>{const{__scopeDialog:o,...r}=e,s=d(S,o);return n.jsx(m.p,{id:s.descriptionId,...r,ref:t})});k.displayName=S;var $="DialogClose",W=i.forwardRef((e,t)=>{const{__scopeDialog:o,...r}=e,s=d($,o);return n.jsx(m.button,{type:"button",...r,ref:t,onClick:p(e.onClick,()=>s.onOpenChange(!1))})});W.displayName=$;function _(e){return e?"open":"closed"}var L="DialogTitleWarning",[Pe,G]=X(L,{contentName:u,titleName:R,docsSlug:"dialog"}),ue=({titleId:e})=>{const t=G(L),o=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.

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

For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return i.useEffect(()=>{e&&(document.getElementById(e)||console.error(o))},[o,e]),null},fe="DialogDescriptionWarning",ge=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${G(fe).contentName}}.`;return i.useEffect(()=>{const s=e.current?.getAttribute("aria-describedby");t&&s&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},pe=I,me=P,De=T,z=w,H=A,B=F,V=k,xe=W;const Oe=pe,Te=me,ve=De;function Y({className:e,ref:t,...o}){return n.jsx(z,{ref:t,className:f("bg-background/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 backdrop-blur-sm",e),...o})}Y.displayName=z.displayName;function ye({className:e,children:t,ref:o,...r}){return n.jsxs(ve,{children:[n.jsx(Y,{}),n.jsxs(H,{ref:o,className:f("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border p-6 shadow-lg duration-200 sm:rounded-lg md:w-full",e),...r,children:[t,n.jsxs(xe,{className:"ring-offset-background data-[state=open]:bg-accent data-[state=open]:text-muted-foreground focus:ring-ring absolute top-4 right-4 rounded-sm opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-none disabled:pointer-events-none",children:[n.jsx(ne,{name:"Close"}),n.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}ye.displayName=H.displayName;function he({className:e,...t}){return n.jsx("div",{className:f("flex flex-col space-y-1.5 text-center sm:text-left",e),...t})}he.displayName="DialogHeader";function Ne({className:e,...t}){return n.jsx("div",{className:f("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t})}Ne.displayName="DialogFooter";function Ce({className:e,ref:t,...o}){return n.jsx(B,{ref:t,className:f("text-lg leading-none font-semibold tracking-tight",e),...o})}Ce.displayName=B.displayName;function be({className:e,ref:t,...o}){return n.jsx(V,{ref:t,className:f("text-muted-foreground text-sm",e),...o})}be.displayName=V.displayName;export{H as C,Oe as D,B as T,ye as a,he as b,Ce as c,be as d,Ne as e,Te as f,V as g,ve as h,Y as i};
//# sourceMappingURL=dialog-7CAwytT4.js.map
