"use strict";const d=require("./jsx-runtime-Dszzpdy0.cjs"),n=require("./Animated-Ck-9v2gm.cjs"),j=require("react-dom"),e=require("./css-HnNQMUzV.cjs"),b=require("./Box-BvqALodh.cjs"),f=(l="root")=>document.getElementById(l)??document.body,p=({style:l,background:u=0,className:S,bordered:g=!0,rounded:m=1,passthrough:i=!1,children:x,...C})=>{const{ref:y,targetCorner:a,dialogCorner:s,style:c,modalPosition:B}=n.useInternalContext(),{visible:r,variant:t}=n.useContext();if(!r&&!i)return null;const E=r&&(Object.keys(c).length>0||t==="modal");let o=d.jsxRuntimeExports.jsx(b.Box$1,{pack:!0,ref:y,y:!0,background:u,className:e.CSS(e.CSS.BE("dialog","dialog"),e.CSS.loc(a.x),e.CSS.loc(a.y),e.CSS.BEM("dialog","dialog",s.x),e.CSS.BEM("dialog","dialog",s.y),e.CSS.visible(E),i&&e.CSS.BM("dialog","passthrough"),e.CSS.M(t),t==="modal"&&e.CSS.BM("dialog","modal","position",B.toString()),S),rounded:m,role:"dialog",empty:!0,bordered:g,align:"stretch",style:{...c,...l},...C,children:x});return t==="modal"&&(o=d.jsxRuntimeExports.jsx(n.Background,{empty:!0,align:"center",visible:r,children:o})),i?o:j.createPortal(o,f())};exports.Dialog=p;
