PageSourceSearch

https://www.alphaxiv.org/assets/dialog-CUWFHBkz.js

js alphaxiv.org collected 2026-09-24 08:54:35 UTC 8,569 bytes, 7 lines download raw bytes

vendor: 4,286 bytes, line 1
1!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._posthogChunkIds=e._posthogChunkIds||{},e._posthogChunkIds[n]="01a0b70c-5360-75d1-b146-63f5bf3d9a7b")}catch(e){}}();import{a as e}from"./rolldown-runtime-Cyuzqnbw.js";import{t}from"./react-BjcluYZV.js";import{t as n}from"./jsx-runtime-BH1R-mb2.js";import{t as r}from"./x-B3lahyzy.js";import{n as i}from"./dist-BAX2d9SI.js";import{t as a}from"./cn-B9URw_CD.js";import{a as o,f as s,l as c,m as l,n as u,p as d,r as f,s as ee,t as p,u as m}from"./dist-Dd41IRS9.js";import{a as te,i as ne,n as re,t as ie}from"./es2015-CA7TsTR8.js";var h=e(t(),1),g=n(),_=`Dialog`,[v,ae]=d(_),[oe,y]=v(_),b=e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=h.useRef(null),l=h.useRef(null),[u,d]=c({prop:r,defaultProp:i??!1,onChange:a,caller:_});return(0,g.jsx)(oe,{scope:t,triggerRef:s,contentRef:l,contentId:m(),titleId:m(),descriptionId:m(),open:u,onOpenChange:d,onOpenToggle:h.useCallback(()=>d(e=>!e),[d]),modal:o,children:n})};b.displayName=_;var x=`DialogTrigger`,S=h.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,a=y(x,n),s=i(t,a.triggerRef);return(0,g.jsx)(o.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":a.open,"aria-controls":a.contentId,"data-state":L(a.open),...r,ref:s,onClick:l(e.onClick,a.onOpenToggle)})});S.displayName=x;var C=`DialogPortal`,[se,w]=v(C,{forceMount:void 0}),T=e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=y(C,t);return(0,g.jsx)(se,{scope:t,forceMount:n,children:h.Children.map(r,e=>(0,g.jsx)(p,{present:n||a.open,children:(0,g.jsx)(u,{asChild:!0,container:i,children:e})}))})};T.displayName=C;var E=`DialogOverlay`,D=h.forwardRef((e,t)=>{let n=w(E,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=y(E,e.__scopeDialog);return a.modal?(0,g.jsx)(p,{present:r||a.open,children:(0,g.jsx)(le,{...i,ref:t})}):null});D.displayName=E;var ce=ee(`DialogOverlay.RemoveScroll`),le=h.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=y(E,n);return(0,g.jsx)(re,{as:ce,allowPinchZoom:!0,shards:[i.contentRef],children:(0,g.jsx)(o.div,{"data-state":L(i.open),...r,ref:t,style:{pointerEvents:`auto`,...r.style}})})}),O=`DialogContent`,k=h.forwardRef((e,t)=>{let n=w(O,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=y(O,e.__scopeDialog);return(0,g.jsx)(p,{present:r||a.open,children:a.modal?(0,g.jsx)(ue,{...i,ref:t}):(0,g.jsx)(de,{...i,ref:t})})});k.displayName=O;var ue=h.forwardRef((e,t)=>{let n=y(O,e.__scopeDialog),r=h.useRef(null),a=i(t,n.contentRef,r);return h.useEffect(()=>{let e=r.current;if(e)return ie(e)},[]),(0,g.jsx)(A,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:l(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:l(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:l(e.onFocusOutside,e=>e.preventDefault())})}),de=h.forwardRef((e,t)=>{let n=y(O,e.__scopeDialog),r=h.useRef(!1),i=h.useRef(!1);return(0,g.jsx)(A,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})}),A=h.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:o,...s}=e,c=y(O,n),l=h.useRef(null),u=i(t,l);return ne(),(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(te,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:o,children:(0,g.jsx)(f,{role:`dialog`,id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":L(c.open),...s,ref:u,onDismiss:()=>c.onOpenChange(!1)})}),(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(B,{titleId:c.titleId}),(0,g.jsx)(me,{contentRef:l,descriptionId:c.descriptionId})]})]})}),j=`DialogTitle`,M=h.forwardRef((e,t)=>
1{let{__scopeDialog:n,...r}=e,i=y(j,n);return(0,g.jsx)(o.h2,{id:i.titleId,...r,ref:t})});M.displayName=j;var N=`DialogDescription`,P=h.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=y(N,n);return(0,g.jsx)(o.p,{id:i.descriptionId,...r,ref:t})});P.displayName=N;var F=`DialogClose`,I=h.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=y(F,n);return(0,g.jsx)(o.button,{type:`button`,...r,ref:t,onClick:l(e.onClick,()=>i.onOpenChange(!1))})});I.displayName=F;function L(e){return e?`open`:`closed`}var R=`DialogTitleWarning`,[fe,z]=s(R,{contentName:O,titleName:j,docsSlug:`dialog`}),B=({titleId:e})=>{let t=z(R),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
2
3If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
4
5For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return h.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},pe=`DialogDescriptionWarning`,me=({contentRef:e,descriptionId:t})=>{let n=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${z(pe).contentName}}.`;return h.useEffect(()=>{let r=e.current?.getAttribute(`aria-describedby`);t&&r&&(document.getElementById(t)||console.warn(n))},[n,e,t]),null},V=b,H=S,U=T,W=D,G=k,K=M,q=P,J=I,Y=h.createContext(!1);function he({error:e=!1,...t}){return(0,g.jsx)(Y.Provider,{value:e,children:(0,g.jsx)(V,{"data-slot":`dialog`,...t})})}function ge({...e}){return(0,g.jsx)(H,{"data-slot":`dialog-trigger`,...e})}function X({...e}){return(0,g.jsx)(U,{"data-slot":`dialog-portal`,...e})}function Z({className:e,...t}){return(0,g.jsx)(W,{"data-slot":`dialog-overlay`,className:a(`fixed inset-0 z-50 bg-black/50 data-[state=closed]:pointer-events-none data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0`,e),...t})}var _e=`data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95`,ve=`data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 fixed z-50 grid w-full`,ye=`data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 fixed z-50 grid w-full`,Q=`top-[50%] left-[50%] max-w-[calc(100%-2rem)] translate-[-50%] border border-border bg-bg text-text shadow-lg outline-hidden duration-200 sm:max-w-lg`,$=`gap-4 p-5 rounded-4xl`,be=`p-0 rounded-2xl`,xe=`${Q} ${$}`;function Se({className:e,children:t,transparentOverlay:n,showCloseButton:i=!0,asChild:o=!1,flush:s=!1,...c}){let l=h.use(Y),u=h.useRef(!1);return u.current||=l,(0,g.jsxs)(X,{"data-slot":`dialog-portal`,children:[(0,g.jsx)(Z,{className:n?`bg-transparent`:void 0}),(0,g.jsx)(G,{"data-slot":`dialog-content`,className:a(!u.current&&_e,ve,Q,s?be:$,l&&`not-motion-reduce:animate-dialog-shake`,e),...c,children:o||!i?t:(0,g.jsxs)(g.Fragment,{children:[t,i&&(0,g.jsxs)(J,{className:`absolute top-3 right-3 z-10 grid size-7 cursor-pointer place-items-center rounded-full text-subtext transition-colors hover:text-text disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4`,children:[(0,g.jsx)(r,{}),(0,g.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})})]})}function Ce({className:e,...t}){return(0,g.jsx)(`div`,{"data-slot":`dialog-header`,className:a(`flex flex-col gap-2 text-center text-text sm:text-left`,e),...t})}function we({className:e,...t}){return(0,g.jsx)(`div`,{"data-slot":`dialog-footer`,className:a(`-mr-1.5 -mb-1.5 flex flex-col-reverse gap-2 text-text sm:flex-row sm:justify-end`,e),...t})}function Te({className:e,...t}){return(0,g.jsx)(K,{"data-slot":`dialog-title`,className:a(`text-lg leading-none font-semibold text-text`,e),...t})}function Ee({className:e,...t}){return(0,g.jsx)(q,{"data-slot":`dialog-description`,className:a(`text-sm text-subtext`,e),...t})}export{ae as C,fe as S,W as _,we as a,K as b,X as c,ye as d,J as f,M as g,P as h,Ee as i,Te as l,q as m,he as n,Ce as o,G as p,Se as r,Z as s,xe as t,ge as u,U as v,H as x,V as y};
6//# sourceMappingURL=dialog-CUWFHBkz.js.map
7//# chunkId=01a0b70c-5360-75d1-b146-63f5bf3d9a7b

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.