import{s as D,l as v,i as z,d as h,q as M,O as S,r as x,e as b,c as g,a as p,f as w,g as B,u as k,v as I,w as L,x as N,H as E,F as T,B as V}from"./scheduler.DB3Sqaa-.js";import{S as j,i as A,t as _,g as F,a as y,c as H,h as C}from"./index.CidI1d1E.js";import{f as K}from"./index.BronEFe7.js";import{f as O}from"./index.DMdt0oYD.js";function q(a){let o,s,e,n,r,f,d,c;const m=a[5].default,i=x(m,a,a[4],null);return{c(){o=b("div"),s=b("div"),i&&i.c(),this.h()},l(l){o=g(l,"DIV",{class:!0});var u=p(o);s=g(u,"DIV",{class:!0});var t=p(s);i&&i.l(t),t.forEach(h),u.forEach(h),this.h()},h(){w(s,"class",e="m-auto rounded-2xl max-w-full "+a[3](a[1])+" mx-2 bg-gray-50 dark:bg-gray-900 shadow-3xl max-h-[100dvh] overflow-y-auto scrollbar-hidden svelte-fq1rhy"),w(o,"class","modal fixed top-0 right-0 left-0 bottom-0 bg-black/60 w-full h-screen max-h-[100dvh] flex justify-center z-[9999] overflow-hidden overscroll-contain")},m(l,u){z(l,o,u),B(o,s),i&&i.m(s,null),a[6](o),f=!0,d||(c=[k(s,"mousedown",W),k(o,"mousedown",a[7])],d=!0)},p(l,u){i&&i.p&&(!f||u&16)&&I(i,m,l,l[4],f?N(m,l[4],u,null):L(l[4]),null),(!f||u&2&&e!==(e="m-auto rounded-2xl max-w-full "+l[3](l[1])+" mx-2 bg-gray-50 dark:bg-gray-900 shadow-3xl max-h-[100dvh] overflow-y-auto scrollbar-hidden svelte-fq1rhy"))&&w(s,"class",e)},i(l){f||(_(i,l),l&&(n||E(()=>{n=C(s,O,{}),n.start()})),l&&(r||E(()=>{r=C(o,K,{duration:10}),r.start()})),f=!0)},o(l){y(i,l),f=!1},d(l){l&&h(o),i&&i.d(l),a[6](null),d=!1,T(c)}}}function P(a){let o,s,e=a[0]&&q(a);return{c(){e&&e.c(),o=v()},l(n){e&&e.l(n),o=v()},m(n,r){e&&e.m(n,r),z(n,o,r),s=!0},p(n,[r]){n[0]?e?(e.p(n,r),r&1&&_(e,1)):(e=q(n),e.c(),_(e,1),e.m(o.parentNode,o)):e&&(F(),y(e,1,1,()=>{e=null}),H())},i(n){s||(_(e),s=!0)},o(n){y(e),s=!1},d(n){n&&h(o),e&&e.d(n)}}}const W=a=>{a.stopPropagation()};function G(a,o,s){let{$$slots:e={},$$scope:n}=o,{show:r=!0}=o,{size:f="md"}=o,d=null;const c=t=>t==="xs"?"w-[16rem]":t==="sm"?"w-[30rem]":t==="md"?"w-[48rem]":"w-[56rem]",m=t=>{t.key==="Escape"&&i()&&(console.log("Escape"),s(0,r=!1))},i=()=>{const t=document.getElementsByClassName("modal");return t.length&&t[t.length-1]===d};M(()=>{}),S(()=>{s(0,r=!1),d&&document.body.removeChild(d)});function l(t){V[t?"unshift":"push"](()=>{d=t,s(2,d)})}const u=()=>{s(0,r=!1)};return a.$$set=t=>{"show"in t&&s(0,r=t.show),"size"in t&&s(1,f=t.size),"$$scope"in t&&s(4,n=t.$$scope)},a.$$.update=()=>{a.$$.dirty&5&&(r&&d?(document.body.appendChild(d),window.addEventListener("keydown",m),document.body.style.overflow="hidden"):d&&(window.removeEventListener("keydown",m),document.body.removeChild(d),document.body.style.overflow="unset"))},[r,f,d,c,n,e,l,u]}class X extends j{constructor(o){super(),A(this,o,G,P,D,{show:0,size:1})}}export{X as M}; //# sourceMappingURL=Modal.DcRcsIox.js.map