import{z as w,k as v,H as x,j as p,o as h,c as b,b as o,w as l,v as n,a,K as c,J as i,n as g,r as k,f as B,L as C}from"./app-WJL2kJBE.js";const L={class:"fixed inset-0 print:static overflow-y-auto px-4 py-6 sm:px-0 z-50 flex items-center justify-center","scroll-region":""},z={__name:"Modal",props:{show:{type:Boolean,default:!1},maxWidth:{type:String,default:"2xl"},closeable:{type:Boolean,default:!0}},emits:["close"],setup(e,{emit:u}){const s=e,y=u;w(()=>s.show,()=>{s.show?(document.body.style.overflow="hidden",document.body.classList.add("modal-open")):(document.body.style.overflow=null,document.body.classList.remove("modal-open"))});const r=()=>{s.closeable&&y("close")},d=t=>{t.key==="Escape"&&s.show&&r()};v(()=>document.addEventListener("keydown",d)),x(()=>{document.removeEventListener("keydown",d),document.body.style.overflow=null});const f=p(()=>({xs:"sm:max-w-xs",sm:"sm:max-w-sm",md:"sm:max-w-md",lg:"sm:max-w-lg",xl:"sm:max-w-xl","2xl":"sm:max-w-2xl","4xl":"sm:max-w-4xl"})[s.maxWidth]);return(t,m)=>(h(),b(C,{to:"body"},[o(c,{"leave-active-class":"duration-200"},{default:l(()=>[n(a("div",L,[o(c,{"enter-active-class":"ease-out duration-300","enter-from-class":"opacity-0","enter-to-class":"opacity-100","leave-active-class":"ease-in duration-200","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:l(()=>[n(a("div",{class:"print:hidden fixed inset-0 transform transition-all",onClick:r},m[0]||(m[0]=[a("div",{class:"absolute inset-0 bg-gray-500 opacity-75 backdrop-blur-sm"},null,-1)]),512),[[i,e.show]])]),_:1}),o(c,{"enter-active-class":"ease-out duration-300","enter-from-class":"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95","enter-to-class":"opacity-100 translate-y-0 sm:scale-100","leave-active-class":"ease-in duration-200","leave-from-class":"opacity-100 translate-y-0 sm:scale-100","leave-to-class":"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"},{default:l(()=>[n(a("div",{class:g(["modal m-auto bg-white dark:bg-gray-800 rounded-lg overflow-hidden shadow-xl transform transition-all sm:w-full sm:mx-auto",f.value])},[e.show?k(t.$slots,"default",{key:0}):B("",!0)],2),[[i,e.show]])]),_:3})],512),[[i,e.show]])]),_:3})]))}};export{z as _};
