import{c as l,r as s,d as h,j as e}from"./index-DiwDH9aE.js";import{X as p}from"./x-D4vgwdOf.js";/**
 * @license lucide-react v0.544.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const v=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],k=l("plus",v);/**
 * @license lucide-react v0.544.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const b=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],j=l("save",b),N=({isOpen:t,onClose:r,title:d,size:c="md",closeOnClickOutside:n=!0,showCloseButton:i=!0,children:m,footer:o})=>{const x=s.useRef(null);s.useEffect(()=>(t?document.body.style.overflow="hidden":document.body.style.overflow="unset",()=>{document.body.style.overflow="unset"}),[t]),s.useEffect(()=>{const a=f=>{f.key==="Escape"&&t&&r()};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[t,r]);const u=a=>{n&&a.target===a.currentTarget&&r()},y={sm:"max-w-md",md:"max-w-2xl",lg:"max-w-4xl",xl:"max-w-6xl",full:"max-w-full mx-4"};return t?h.createPortal(e.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/50 backdrop-blur-sm animate-fadeIn",onClick:u,children:e.jsxs("div",{ref:x,className:`relative w-full ${y[c]} bg-white rounded-lg shadow-2xl animate-scaleIn`,onClick:a=>a.stopPropagation(),children:[e.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-gray-200",children:[e.jsx("h2",{className:"text-xl font-semibold text-gray-800",children:d}),i&&e.jsx("button",{onClick:r,className:"p-2 text-gray-400 hover:text-gray-600 hover:bg-gray-100 rounded-lg transition-colors","aria-label":"Cerrar modal",children:e.jsx(p,{className:"w-5 h-5"})})]}),e.jsx("div",{className:"px-6 py-4 max-h-[calc(100vh-200px)] overflow-y-auto",children:m}),o&&e.jsx("div",{className:"flex items-center justify-end gap-3 px-6 py-4 border-t border-gray-200 bg-gray-50",children:o})]})}),document.body):null};export{N as M,k as P,j as S};
