"use client"
import{a as u}from"./chunk-NWME2ANF.mjs";import{j as l}from"./chunk-ASW4CA57.mjs";import*as o from"@radix-ui/react-dialog";import*as n from"@radix-ui/react-visually-hidden";import{useRouter as w}from"next/navigation";import{Drawer as a}from"vaul";import{jsx as e,jsxs as r}from"react/jsx-runtime";function C({children:d,className:s,showModal:p,setShowModal:i,onClose:c,desktopOnly:g,preventDefaultClose:f,drawerRootProps:D}){let b=w(),m=({dragged:t}={})=>{f&&!t||(c&&c(),i?i(!1):b.back())},{isMobile:y}=u();return y&&!g?e(a.Root,{open:i?p:!0,onOpenChange:t=>{t||m({dragged:!0})},...D,children:r(a.Portal,{children:[e(a.Overlay,{className:"fixed inset-0 z-50 bg-gray-100 bg-opacity-10 backdrop-blur"}),r(a.Content,{className:l("fixed bottom-0 left-0 right-0 z-50 rounded-t-[10px] border-t border-gray-200 bg-white",s),children:[r(n.Root,{children:[e(a.Title,{children:"Modal"}),e(a.Description,{children:"This is a modal"})]}),e("div",{className:"sticky top-0 z-20 flex w-full items-center justify-center rounded-t-[10px] bg-inherit",children:e("div",{className:"my-3 h-1 w-12 rounded-full bg-gray-300"})}),d]}),e(a.Overlay,{})]})}):e(o.Root,{open:i?p:!0,onOpenChange:t=>{t||m()},children:r(o.Portal,{children:[e(o.Overlay,{id:"modal-backdrop",className:"animate-fade-in fixed inset-0 z-40 bg-gray-100 bg-opacity-50 backdrop-blur-md"}),r(o.Content,{onOpenAutoFocus:t=>t.preventDefault(),onCloseAutoFocus:t=>t.preventDefault(),className:l("animate-scale-in fixed inset-0 z-40 m-auto max-h-fit w-full max-w-md overflow-hidden border border-gray-200 bg-white p-0 shadow-xl sm:rounded-2xl",s),children:[r(n.Root,{children:[e(o.Title,{children:"Modal"}),e(o.Description,{children:"This is a modal"})]}),d]})]})})}export{C as a};
