import{h as l,r as a,j as e}from"./index-CHN8jahE.js";import{c}from"./utils-CkSf8FUe.js";const h=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],k=l("plus",h);const b=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],w=l("trash-2",b);const f=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],x=l("x",f),p=({isOpen:t,onClose:s,title:i,children:u,action:n,className:m})=>{const[y,d]=a.useState(!1);a.useEffect(()=>{if(t)d(!0),document.body.style.overflow="hidden";else{const o=setTimeout(()=>d(!1),200);return document.body.style.overflow="unset",()=>clearTimeout(o)}},[t]);const r=a.useCallback(o=>{o.key==="Escape"&&s()},[s]);return a.useEffect(()=>{if(t)return document.addEventListener("keydown",r),()=>{document.removeEventListener("keydown",r)}},[t,r]),!y&&!t?null:e.jsxs("div",{className:c("fixed inset-0 z-50 flex items-center justify-center p-4 transition-opacity duration-200",t?"opacity-100":"opacity-0"),children:[e.jsx("div",{className:"absolute inset-0 bg-white/80 backdrop-blur-sm",onClick:s}),e.jsxs("div",{className:c("relative w-full max-w-lg bg-white rounded-xl shadow-2xl shadow-neutral-200/50 border border-neutral-100 transform transition-all duration-200",t?"scale-100 translate-y-0":"scale-95 translate-y-2",m),children:[e.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-neutral-50",children:[e.jsx("h3",{className:"font-semibold text-neutral-900",children:i}),e.jsx("button",{onClick:s,className:"text-neutral-400 hover:text-neutral-900 transition-colors",children:e.jsx(x,{size:18})})]}),e.jsx("div",{className:"p-6",children:u}),n?e.jsx("div",{className:"px-6 py-4 bg-neutral-50 rounded-b-xl border-t border-neutral-100 flex justify-end gap-3",children:n}):null]})]})},M=Object.freeze(Object.defineProperty({__proto__:null,Modal:p},Symbol.toStringTag,{value:"Module"}));export{p as M,k as P,w as T,x as X,M as m};
