import{r as k,j as e,T as v,I as A,ec as B,K as t}from"./index-43bf7a1c.js";import{D as c,a as d}from"./DialogContent-d5902709.js";import{D as x}from"./DialogTitle-20dc6f66.js";import{D as p}from"./DialogContentText-abf03c9f.js";import{D as h}from"./DialogActions-d63c6496.js";import{L as I}from"./LoadingButton-570cb73d.js";const z=({isOpen:u,title:m,children:g,onClose:o,onOK:f,okText:a,closeText:n,status:L,loading:j,showFooter:C=!0,maxWidth:b,...y})=>{const[D,r]=k.useState(!1),s=()=>{r(!0)},w=()=>{r(!1),o==null||o()},l=()=>{r(!1)};return e.jsxs(e.Fragment,{children:[e.jsxs(c,{open:u,onClose:s,sx:{"& .MuiDialog-paper":{borderRadius:"15px",overflow:"hidden"}},maxWidth:b||"sm",fullWidth:!0,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",...y,children:[e.jsxs(x,{sx:{background:"linear-gradient(90deg, #5b6ef5 0%, #9b59b6 100%)",color:"white",p:2.5,display:"flex",alignItems:"center",justifyContent:"space-between"},id:"alert-dialog-title",children:[e.jsx(v,{variant:"h6",sx:{fontWeight:700},children:m}),e.jsx(A,{onClick:s,sx:{color:"white"},children:e.jsx(B,{size:20})})]}),e.jsx(d,{sx:i=>({p:"12px !important",bgcolor:i.palette.background.default}),children:e.jsx(p,{id:"alert-dialog-description",sx:i=>({p:2,borderRadius:"10px",bgcolor:i.palette.background.paper}),children:g})}),C&&e.jsxs(h,{sx:{display:"flex",justifyContent:"center"},children:[n&&e.jsx(t,{onClick:s,color:"secondary",variant:"outlined",children:n}),a&&e.jsx(I,{loading:j,onClick:f,variant:"contained",children:a})]})]}),e.jsxs(c,{open:D,onClose:l,children:[e.jsx(x,{children:"Confirm Close"}),e.jsx(d,{children:e.jsx(p,{children:"⚠️ Are you sure you want to close? Any unsaved changes will be lost."})}),e.jsxs(h,{children:[e.jsx(t,{onClick:l,color:"primary",children:"Cancel"}),e.jsx(t,{onClick:w,color:"error",variant:"contained",children:"Close"})]})]})]})};export{z as C};
