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