import{Ai as e,Hi as t,Ji as n,Mi as r,Oi as i,Si as a,Yi as o,Zi as s,bi as c,gi as l,hi as u,li as d,n as f,o as p,pi as m}from"./CWa6_HoJ.js";var h=[`aria-labelledby`],g={class:`sticky top-0 z-10 flex items-center justify-between px-5 py-4 max-sm:pt-[max(1rem,env(safe-area-inset-top))]`,style:{background:`var(--color-base-200)`,borderBottom:`1px solid var(--modal-border)`}},_={class:`flex items-center gap-3 text-lg font-bold text-base-content [&>svg]:text-primary`},v=[`id`],y={key:0,class:`flex-1 overflow-y-auto p-5 max-sm:pb-[max(1.25rem,env(safe-area-inset-bottom))]`},b={key:1,class:`sticky bottom-0 z-10 flex items-center justify-end px-5 py-4 max-sm:pb-[max(1rem,env(safe-area-inset-bottom))]`,style:{background:`var(--color-base-200)`,borderTop:`1px solid var(--modal-border)`}},x={class:`flex justify-end gap-2`},S=360,C=a({__name:`Modal`,props:{title:{}},emits:[`close`],setup(a,{expose:f,emit:C}){let w=C,T=t(),E=t(!1),D=t(!1),O=r(),k;function A(){return window.matchMedia(`(prefers-reduced-motion: reduce)`).matches}function j(){k!==void 0&&(clearTimeout(k),k=void 0)}function M(){j(),T.value?.showModal(),D.value=!0,requestAnimationFrame(()=>{E.value=!0})}function N(){E.value=!1,j(),k=setTimeout(()=>{k=void 0,T.value?.close(),D.value=!1,w(`close`)},A()?0:S)}return f({open:M,close:N}),(t,r)=>(i(),l(`dialog`,{ref_key:`dialogRef`,ref:T,class:`modal modal-bottom sm:modal-middle`,"aria-modal":`true`,"aria-labelledby":a.title?n(O):void 0,style:{"--modal-border":`color-mix(in oklab, var(--color-base-content) 10%, transparent)`},onCancel:d(N,[`prevent`])},[m(`div`,{class:o([`modal-shell flex max-h-[90vh] w-[95%] max-w-2xl flex-col overflow-hidden rounded-2xl p-0 sm:w-11/12`,n(E)?`is-open`:``]),style:{background:`var(--color-base-100)`,border:`1px solid var(--modal-border)`,boxShadow:`0 25px 50px -12px color-mix(in oklab, var(--color-base-content) 25%, transparent), 0 0 0 1px var(--modal-border), inset 0 1px 0 0 color-mix(in oklab, var(--color-base-content) 6%, transparent)`},onContextmenu:r[0]||=d(()=>{},[`prevent`])},[m(`div`,g,[m(`div`,_,[e(t.$slots,`icon`,{},void 0,!0),m(`span`,{id:n(O)},s(a.title),9,v)]),m(`button`,{class:`modal-close flex h-8 w-8 cursor-pointer items-center justify-center rounded-lg bg-transparent`,style:{border:`1px solid var(--modal-border)`,color:`color-mix(in oklab, var(--color-base-content) 60%, transparent)`},onClick:N},[c(n(p),{size:18})])]),n(D)?(i(),l(`div`,y,[e(t.$slots,`default`,{},void 0,!0)])):u(``,!0),n(D)&&t.$slots.actions?(i(),l(`div`,b,[m(`div`,x,[e(t.$slots,`actions`,{},void 0,!0)])])):u(``,!0)],34),m(`form`,{method:`dialog`,class:o([`fixed inset-0 modal-backdrop -z-[1]`,n(E)?`is-open`:``])},[m(`button`,{class:`absolute inset-0 h-full w-full cursor-pointer border-none bg-transparent`,onClick:N})],2)],40,h))}}),w=Object.assign(f(C,[[`__scopeId`,`data-v-fed32a7d`]]),{__name:`Modal`});export{w as t};