vendor: 5,295 bytes, lines 1-5
1import{r as i}from"./chunk-OB3PAWPO-CrLP7qWp.js";import{c as B,a as g,P as C,f as H,e as V,b as x}from"./index-B58C8f4i.js";import{u as R,c as q}from"./index-BhSMh_Q6.js";import{D as K,P as U}from"./index-D0ojq3C_.js";import{R as Y,h as Z,u as z,F as J}from"./Combination-Bx-bxrRf.js";import{P as p}from"./index-LroTIYiI.js";import{j as s}from"./jsx-runtime-C-_spy54.js";var _="Dialog",[y,pe]=B(_),[Q,u]=y(_),N=e=>{const{__scopeDialog:o,children:r,open:a,defaultOpen:n,onOpenChange:t,modal:l=!0}=e,c=i.useRef(null),f=i.useRef(null),[m=!1,v]=V({prop:a,defaultProp:n,onChange:t});return s.jsx(Q,{scope:o,triggerRef:c,contentRef:f,contentId:x(),titleId:x(),descriptionId:x(),open:m,onOpenChange:v,onOpenToggle:i.useCallback(()=>v($=>!$),[v]),modal:l,children:r})};N.displayName=_;var O="DialogTrigger",I=i.forwardRef((e,o)=>{const{__scopeDialog:r,...a}=e,n=u(O,r),t=R(o,n.triggerRef);return s.jsx(p.button,{type:"button","aria-haspopup":"dialog","aria-expanded":n.open,"aria-controls":n.contentId,"data-state":P(n.open),...a,ref:t,onClick:g(e.onClick,n.onOpenToggle)})});I.displayName=O;var h="DialogPortal",[X,A]=y(h,{forceMount:void 0}),T=e=>{const{__scopeDialog:o,forceMount:r,children:a,container:n}=e,t=u(h,o);return s.jsx(X,{scope:o,forceMount:r,children:i.Children.map(a,l=>s.jsx(C,{present:r||t.open,children:s.jsx(U,{asChild:!0,container:n,children:l})}))})};T.displayName=h;var D="DialogOverlay",b=i.forwardRef((e,o)=>{const r=A(D,e.__scopeDialog),{forceMount:a=r.forceMount,...n}=e,t=u(D,e.__scopeDialog);return t.modal?s.jsx(C,{present:a||t.open,children:s.jsx(te,{...n,ref:o})}):null});b.displayName=D;var ee=q("DialogOverlay.RemoveScroll"),te=i.forwardRef((e,o)=>{const{__scopeDialog:r,...a}=e,n=u(D,r);return s.jsx(Y,{as:ee,allowPinchZoom:!0,shards:[n.contentRef],children:s.jsx(p.div,{"data-state":P(n.open),...a,ref:o,style:{pointerEvents:"auto",...a.style}})})}),d="DialogContent",j=i.forwardRef((e,o)=>{const r=A(d,e.__scopeDialog),{forceMount:a=r.forceMount,...n}=e,t=u(d,e.__scopeDialog);return s.jsx(C,{present:a||t.open,children:t.modal?s.jsx(oe,{...n,ref:o}):s.jsx(ne,{...n,ref:o})})});j.displayName=d;var oe=i.forwardRef((e,o)=>{const r=u(d,e.__scopeDialog),a=i.useRef(null),n=R(o,r.contentRef,a);return i.useEffect(()=>{const t=a.current;if(t)return Z(t)},[]),s.jsx(M,{...e,ref:n,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:g(e.onCloseAutoFocus,t=>{t.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:g(e.onPointerDownOutside,t=>{const l=t.detail.originalEvent,c=l.button===0&&l.ctrlKey===!0;(l.button===2||c)&&t.preventDefault()}),onFocusOutside:g(e.onFocusOutside,t=>t.preventDefault())})}),ne=i.forwardRef((e,o)=>{const r=u(d,e.__scopeDialog),a=i.useRef(!1),n=i.useRef(!1);return s.jsx(M,{...e,ref:o,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(a.current||r.triggerRef.current?.focus(),t.preventDefault()),a.current=!1,n.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(a.current=!0,t.detail.originalEvent.type==="pointerdown"&&(n.current=!0));const l=t.target;r.triggerRef.current?.contains(l)&&t.preventDefault(),t.detail.originalEvent.type==="focusin"&&n.current&&t.preventDefault()}})}),M=i.forwardRef((e,o)=>{const{__scopeDialog:r,trapFocus:a,onOpenAutoFocus:n,onCloseAutoFocus:t,...l}=e,c=u(d,r),f=i.useRef(null),m=R(o,f);return z(),s.jsxs(s.Fragment,{children:[s.jsx(J,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:n,onUnmountAutoFocus:t,children:s.jsx(K,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":P(c.open),...l,ref:m,onDismiss:()=>c.onOpenChange(!1)})}),s.jsxs(s.Fragment,{children:[s.jsx(re,{titleId:c.titleId}),s.jsx(se,{contentRef:f,descriptionId:c.descriptionId})]})]})}),E="DialogTitle",F=i.forwardRef((e,o)=>{const{__scopeDialog:r,...a}=e,n=u(E,r);return s.jsx(p.h2,{id:n.titleId,...a,ref:o})});F.displayName=E;var w="DialogDescription",S=i.forwardRef((e,o)=>{const{__scopeDialog:r,...a}=e,n=u(w,r);return s.jsx(p.p,{id:n.descriptionId,...a,ref:o})});S.displayName=w;var W="DialogClose",k=i.forwardRef((e,o)=>{const{__scopeDialog:r,...a}=e,n=u(W,r);return s.jsx(p.button,{type:"button",...a,ref:o,onClick:g(e.onClick,()=>n.onOpenChange(!1))})});k.displayName=W;function P(e){return e?"open":"closed"}var G="DialogTitleWarning",[De,L]=H(G,{contentName:d,titleName:E,docsSlug:"dialog"}),re=({titleId:e})=>{const o=L(G),r=`\`${o.contentName}\` requires a \`${o.titleName}\` for the component to be accessible for screen reader users. 2 3If you want to hide the \`${o.titleName}\`, you can wrap it with our VisuallyHidden component. 4 5For more information, see https://radix-ui.com/primitives/docs/components/${o.docsSlug}`;return i.useEffect(()=>{e&&(document.getElementById(e)||console.error(r))},[r,e]),null},ae="DialogDescriptionWarning",se=({contentRef:e,descriptionId:o})=>{const a=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${L(ae).contentName}}.`;return i.useEffect(()=>{const n=e.current?.getAttribute("aria-describedby");o&&n&&(document.getElementById(o)||console.warn(a))},[a,e,o]),null},me=N,ve=I,xe=T,Ce=b,Re=j,_e=F,he=S,Ee=k;export{Re as C,he as D,Ce as O,xe as P,me as R,ve as T,De as W,_e as a,Ee as b,pe as c};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.