'use client';'use strict';

var chunkWHYG63JU_cjs = require('./chunk-WHYG63JU.cjs');
var chunk5MDNIIWX_cjs = require('./chunk-5MDNIIWX.cjs');
var reactDialog = require('@radix-ui/react-dialog');
var css = require('@onbeam/styled-system/css');
var react = require('react');
var icons = require('@onbeam/icons');
var recipes = require('@onbeam/styled-system/recipes');
var jsxRuntime = require('react/jsx-runtime');

var v=react.forwardRef(({className:t,...a},n)=>{let r=recipes.modal();return jsxRuntime.jsx(reactDialog.Overlay,{ref:n,className:css.cx(r.bgOverlay,t),"data-beam-modal":!0,...a})});v.displayName="ModalBackgroundOverlay";var y=react.forwardRef(({className:t,children:a,...n},r)=>{let l=recipes.modal();return jsxRuntime.jsx(reactDialog.Content,{ref:r,className:css.cx(recipes.customScrollbar(),l.content,t),onInteractOutside:s=>{let d=s.detail.originalEvent.target;d instanceof Element&&d.closest("[data-sonner-toast], #beam-overlay")&&s.preventDefault();},...n,children:a})});y.displayName="ModalContent";var k=react.forwardRef(({children:t,open:a,onOpenChange:n,trigger:r,title:l,description:s,size:d="lg",hideTitle:p,hideDescription:x,hideCloseButton:C,triggerTooltip:f,...I},w)=>{let i=react.useRef(null),g=react.useRef(),o=recipes.modal();return react.useEffect(()=>{if(!i.current)return;i.current.getRootNode().nodeType===Node.DOCUMENT_FRAGMENT_NODE&&(g.current=i.current.getRootNode());},[]),jsxRuntime.jsxs(reactDialog.Root,{open:a,onOpenChange:n,children:[jsxRuntime.jsx(f?chunkWHYG63JU_cjs.a:react.Fragment,{...f?{side:"top",...f}:{},children:jsxRuntime.jsx(reactDialog.Trigger,{ref:i,asChild:!0,children:r??jsxRuntime.jsx("div",{"aria-hidden":!0,className:o.hidden})})}),jsxRuntime.jsx(reactDialog.Portal,{container:g.current,children:jsxRuntime.jsx(v,{onWheel:c=>c.stopPropagation(),onTouchMove:c=>c.stopPropagation(),children:jsxRuntime.jsx(y,{ref:w,...I,children:jsxRuntime.jsxs(chunk5MDNIIWX_cjs.a,{size:d,noMaxWidth:!0,className:o.card,children:[!p||!C?jsxRuntime.jsxs("div",{className:o.header,children:[jsxRuntime.jsx(reactDialog.Title,{className:o.title,"data-hidden":p,children:l}),!C&&jsxRuntime.jsx(reactDialog.Close,{className:o.close,children:jsxRuntime.jsx(icons.CloseIcon,{height:16,width:16})})]}):jsxRuntime.jsx(reactDialog.Title,{className:o.title,"data-hidden":p,children:l}),jsxRuntime.jsxs("div",{className:o.cardContent,children:[jsxRuntime.jsx(reactDialog.Description,{className:o.description,"data-hidden":x,children:s}),t]})]})})})})]})});k.displayName="Modal";var A={Root:reactDialog.Root,Trigger:reactDialog.Trigger,Portal:reactDialog.Portal,Close:reactDialog.Close,Overlay:v,Content:y,Title:reactDialog.Title,Description:reactDialog.Description};

exports.a = k;
exports.b = A;
//# sourceMappingURL=out.js.map
//# sourceMappingURL=chunk-6LAMG7G6.cjs.map