import{r as n,j as e}from"./vendor-react-wBh_31cN.js";import{D as j,z as g,B as u,C as w,d as m,F as z}from"./index-dNe6i2rS.js";import{I as D}from"./icon-button-BZeFL7T7.js";import{T as v}from"./tooltip-DFFgUYh6.js";import{a7 as N,a8 as R}from"./vendor-icons-BUUmD6ht.js";const b=({titleContent:x,isOpen:s,onClose:l,children:f,footer:i,expandable:h=!1,initiallyFullscreen:o=!1,bodyOverflowHidden:d=!1})=>{const[r,t]=n.useState(o),c=n.useRef(s);n.useEffect(()=>{const a=c.current;c.current=s,s&&!a&&t(o)},[s,o]);const p=h||o;return e.jsx(j,{open:s,onOpenChange:a=>{a||(t(o),l())},children:e.jsxs(g,{className:m("flex flex-col",r?"h-screen w-screen max-w-none max-h-none rounded-none":"max-w-4xl max-h-[85vh]"),children:[e.jsx(u,{children:e.jsx(w,{children:x})}),p&&e.jsx(v,{content:r?"Restore":"Maximize",children:e.jsx(D,{variant:"ghost",size:"icon-sm",className:"absolute top-2 right-10",onClick:()=>t(a=>!a),"aria-label":r?"Restore":"Maximize",children:r?e.jsx(N,{className:"size-4"}):e.jsx(R,{className:"size-4"})})}),e.jsx("div",{className:m("min-h-0 flex-1 p-1",d?"overflow-hidden":"overflow-y-auto"),children:f}),i&&e.jsx(z,{children:i})]})})};export{b as P};
