1 line
10 KiB
JavaScript
1 line
10 KiB
JavaScript
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3572],{83572:(e,t,n)=>{n.d(t,{UC:()=>P,VY:()=>S,ZD:()=>L,ZL:()=>F,bL:()=>T,hE:()=>k,hJ:()=>M,l9:()=>_,rc:()=>U});var r=n(12115),o=n(18166),a=n(88068),i=n(66217),l=n(93610),s=n(12317),u=n(95155),d="AlertDialog",[c,f]=(0,o.A)(d,[i.Hs]),p=(0,i.Hs)(),m=e=>{let{__scopeAlertDialog:t,...n}=e,r=p(t);return(0,u.jsx)(i.bL,{...r,...n,modal:!0})};m.displayName=d;var g=r.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,o=p(n);return(0,u.jsx)(i.l9,{...o,...r,ref:t})});g.displayName="AlertDialogTrigger";var v=e=>{let{__scopeAlertDialog:t,...n}=e,r=p(t);return(0,u.jsx)(i.ZL,{...r,...n})};v.displayName="AlertDialogPortal";var y=r.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,o=p(n);return(0,u.jsx)(i.hJ,{...o,...r,ref:t})});y.displayName="AlertDialogOverlay";var N="AlertDialogContent",[h,D]=c(N),b=(0,s.Dc)("AlertDialogContent"),x=r.forwardRef((e,t)=>{let{__scopeAlertDialog:n,children:o,...s}=e,d=p(n),c=r.useRef(null),f=(0,a.s)(t,c),m=r.useRef(null);return(0,u.jsx)(i.G$,{contentName:N,titleName:w,docsSlug:"alert-dialog",children:(0,u.jsx)(h,{scope:n,cancelRef:m,children:(0,u.jsxs)(i.UC,{role:"alertdialog",...d,...s,ref:f,onOpenAutoFocus:(0,l.m)(s.onOpenAutoFocus,e=>{var t;e.preventDefault(),null===(t=m.current)||void 0===t||t.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:[(0,u.jsx)(b,{children:o}),(0,u.jsx)(E,{contentRef:c})]})})})});x.displayName=N;var w="AlertDialogTitle",R=r.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,o=p(n);return(0,u.jsx)(i.hE,{...o,...r,ref:t})});R.displayName=w;var j="AlertDialogDescription",O=r.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,o=p(n);return(0,u.jsx)(i.VY,{...o,...r,ref:t})});O.displayName=j;var A=r.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,o=p(n);return(0,u.jsx)(i.bm,{...o,...r,ref:t})});A.displayName="AlertDialogAction";var C="AlertDialogCancel",I=r.forwardRef((e,t)=>{let{__scopeAlertDialog:n,...r}=e,{cancelRef:o}=D(C,n),l=p(n),s=(0,a.s)(t,o);return(0,u.jsx)(i.bm,{...l,...r,ref:s})});I.displayName=C;var E=e=>{let{contentRef:t}=e,n="`".concat(N,"` requires a description for the component to be accessible for screen reader users.\n\nYou can add a description to the `").concat(N,"` by passing a `").concat(j,"` component as a child, which also benefits sighted users by adding visible context to the dialog.\n\nAlternatively, 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 `").concat(N,"`. 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.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/alert-dialog");return r.useEffect(()=>{var e;document.getElementById(null===(e=t.current)||void 0===e?void 0:e.getAttribute("aria-describedby"))||console.warn(n)},[n,t]),null},T=m,_=g,F=v,M=y,P=x,U=A,L=I,k=R,S=O},66217:(e,t,n)=>{n.d(t,{G$:()=>J,Hs:()=>b,UC:()=>en,VY:()=>eo,ZL:()=>ee,bL:()=>Q,bm:()=>ea,hE:()=>er,hJ:()=>et,l9:()=>X});var r=n(12115),o=n(93610),a=n(88068),i=n(18166),l=n(67668),s=n(1488),u=n(59674),d=n(20196),c=n(17323),f=n(17028),p=n(23360),m=n(62292),g=n(64065),v=n(15587),y=n(12317),N=n(95155),h="Dialog",[D,b]=(0,i.A)(h),[x,w]=D(h),R=e=>{let{__scopeDialog:t,children:n,open:o,defaultOpen:a,onOpenChange:i,modal:u=!0}=e,d=r.useRef(null),c=r.useRef(null),[f=!1,p]=(0,s.i)({prop:o,defaultProp:a,onChange:i});return(0,N.jsx)(x,{scope:t,triggerRef:d,contentRef:c,contentId:(0,l.B)(),titleId:(0,l.B)(),descriptionId:(0,l.B)(),open:f,onOpenChange:p,onOpenToggle:r.useCallback(()=>p(e=>!e),[p]),modal:u,children:n})};R.displayName=h;var j="DialogTrigger",O=r.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,i=w(j,n),l=(0,a.s)(t,i.triggerRef);return(0,N.jsx)(p.sG.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":H(i.open),...r,ref:l,onClick:(0,o.m)(e.onClick,i.onOpenToggle)})});O.displayName=j;var A="DialogPortal",[C,I]=D(A,{forceMount:void 0}),E=e=>{let{__scopeDialog:t,forceMount:n,children:o,container:a}=e,i=w(A,t);return(0,N.jsx)(C,{scope:t,forceMount:n,children:r.Children.map(o,e=>(0,N.jsx)(f.C,{present:n||i.open,children:(0,N.jsx)(c.Z,{asChild:!0,container:a,children:e})}))})};E.displayName=A;var T="DialogOverlay",_=r.forwardRef((e,t)=>{let n=I(T,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,a=w(T,e.__scopeDialog);return a.modal?(0,N.jsx)(f.C,{present:r||a.open,children:(0,N.jsx)(M,{...o,ref:t})}):null});_.displayName=T;var F=(0,y.TL)("DialogOverlay.RemoveScroll"),M=r.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,o=w(T,n);return(0,N.jsx)(g.A,{as:F,allowPinchZoom:!0,shards:[o.contentRef],children:(0,N.jsx)(p.sG.div,{"data-state":H(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),P="DialogContent",U=r.forwardRef((e,t)=>{let n=I(P,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,a=w(P,e.__scopeDialog);return(0,N.jsx)(f.C,{present:r||a.open,children:a.modal?(0,N.jsx)(L,{...o,ref:t}):(0,N.jsx)(k,{...o,ref:t})})});U.displayName=P;var L=r.forwardRef((e,t)=>{let n=w(P,e.__scopeDialog),i=r.useRef(null),l=(0,a.s)(t,n.contentRef,i);return r.useEffect(()=>{let e=i.current;if(e)return(0,v.Eq)(e)},[]),(0,N.jsx)(S,{...e,ref:l,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:(0,o.m)(e.onCloseAutoFocus,e=>{var t;e.preventDefault(),null===(t=n.triggerRef.current)||void 0===t||t.focus()}),onPointerDownOutside:(0,o.m)(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey;(2===t.button||n)&&e.preventDefault()}),onFocusOutside:(0,o.m)(e.onFocusOutside,e=>e.preventDefault())})}),k=r.forwardRef((e,t)=>{let n=w(P,e.__scopeDialog),o=r.useRef(!1),a=r.useRef(!1);return(0,N.jsx)(S,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{var r,i;null===(r=e.onCloseAutoFocus)||void 0===r||r.call(e,t),t.defaultPrevented||(o.current||null===(i=n.triggerRef.current)||void 0===i||i.focus(),t.preventDefault()),o.current=!1,a.current=!1},onInteractOutside:t=>{var r,i;null===(r=e.onInteractOutside)||void 0===r||r.call(e,t),t.defaultPrevented||(o.current=!0,"pointerdown"!==t.detail.originalEvent.type||(a.current=!0));let l=t.target;(null===(i=n.triggerRef.current)||void 0===i?void 0:i.contains(l))&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&a.current&&t.preventDefault()}})}),S=r.forwardRef((e,t)=>{let{__scopeDialog:n,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:l,...s}=e,c=w(P,n),f=r.useRef(null),p=(0,a.s)(t,f);return(0,m.Oh)(),(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(d.n,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:i,onUnmountAutoFocus:l,children:(0,N.jsx)(u.qW,{role:"dialog",id:c.contentId,"aria-describedby":c.descriptionId,"aria-labelledby":c.titleId,"data-state":H(c.open),...s,ref:p,onDismiss:()=>c.onOpenChange(!1)})}),(0,N.jsxs)(N.Fragment,{children:[(0,N.jsx)(K,{titleId:c.titleId}),(0,N.jsx)(z,{contentRef:f,descriptionId:c.descriptionId})]})]})}),W="DialogTitle",G=r.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,o=w(W,n);return(0,N.jsx)(p.sG.h2,{id:o.titleId,...r,ref:t})});G.displayName=W;var B="DialogDescription",Z=r.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,o=w(B,n);return(0,N.jsx)(p.sG.p,{id:o.descriptionId,...r,ref:t})});Z.displayName=B;var q="DialogClose",V=r.forwardRef((e,t)=>{let{__scopeDialog:n,...r}=e,a=w(q,n);return(0,N.jsx)(p.sG.button,{type:"button",...r,ref:t,onClick:(0,o.m)(e.onClick,()=>a.onOpenChange(!1))})});function H(e){return e?"open":"closed"}V.displayName=q;var Y="DialogTitleWarning",[J,$]=(0,i.q)(Y,{contentName:P,titleName:W,docsSlug:"dialog"}),K=e=>{let{titleId:t}=e,n=$(Y),o="`".concat(n.contentName,"` requires a `").concat(n.titleName,"` for the component to be accessible for screen reader users.\n\nIf you want to hide the `").concat(n.titleName,"`, you can wrap it with our VisuallyHidden component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/").concat(n.docsSlug);return r.useEffect(()=>{t&&!document.getElementById(t)&&console.error(o)},[o,t]),null},z=e=>{let{contentRef:t,descriptionId:n}=e,o=$("DialogDescriptionWarning"),a="Warning: Missing `Description` or `aria-describedby={undefined}` for {".concat(o.contentName,"}.");return r.useEffect(()=>{var e;let r=null===(e=t.current)||void 0===e?void 0:e.getAttribute("aria-describedby");n&&r&&!document.getElementById(n)&&console.warn(a)},[a,t,n]),null},Q=R,X=O,ee=E,et=_,en=U,er=G,eo=Z,ea=V},17028:(e,t,n)=>{n.d(t,{C:()=>i});var r=n(12115),o=n(88068),a=n(46611),i=e=>{let{present:t,children:n}=e,i=function(e){var t,n;let[o,i]=r.useState(),s=r.useRef({}),u=r.useRef(e),d=r.useRef("none"),[c,f]=(t=e?"mounted":"unmounted",n={mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}},r.useReducer((e,t)=>{let r=n[e][t];return null!=r?r:e},t));return r.useEffect(()=>{let e=l(s.current);d.current="mounted"===c?e:"none"},[c]),(0,a.N)(()=>{let t=s.current,n=u.current;if(n!==e){let r=d.current,o=l(t);e?f("MOUNT"):"none"===o||(null==t?void 0:t.display)==="none"?f("UNMOUNT"):n&&r!==o?f("ANIMATION_OUT"):f("UNMOUNT"),u.current=e}},[e,f]),(0,a.N)(()=>{if(o){var e;let t;let n=null!==(e=o.ownerDocument.defaultView)&&void 0!==e?e:window,r=e=>{let r=l(s.current).includes(e.animationName);if(e.target===o&&r&&(f("ANIMATION_END"),!u.current)){let e=o.style.animationFillMode;o.style.animationFillMode="forwards",t=n.setTimeout(()=>{"forwards"===o.style.animationFillMode&&(o.style.animationFillMode=e)})}},a=e=>{e.target===o&&(d.current=l(s.current))};return o.addEventListener("animationstart",a),o.addEventListener("animationcancel",r),o.addEventListener("animationend",r),()=>{n.clearTimeout(t),o.removeEventListener("animationstart",a),o.removeEventListener("animationcancel",r),o.removeEventListener("animationend",r)}}f("ANIMATION_END")},[o,f]),{isPresent:["mounted","unmountSuspended"].includes(c),ref:r.useCallback(e=>{e&&(s.current=getComputedStyle(e)),i(e)},[])}}(t),s="function"==typeof n?n({present:i.isPresent}):r.Children.only(n),u=(0,o.s)(i.ref,function(e){var t,n;let r=null===(t=Object.getOwnPropertyDescriptor(e.props,"ref"))||void 0===t?void 0:t.get,o=r&&"isReactWarning"in r&&r.isReactWarning;return o?e.ref:(o=(r=null===(n=Object.getOwnPropertyDescriptor(e,"ref"))||void 0===n?void 0:n.get)&&"isReactWarning"in r&&r.isReactWarning)?e.props.ref:e.props.ref||e.ref}(s));return"function"==typeof n||i.isPresent?r.cloneElement(s,{ref:u}):null};function l(e){return(null==e?void 0:e.animationName)||"none"}i.displayName="Presence"}}]); |