'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 u=react.forwardRef(({className:t,...a},r)=>{let n=recipes.modal();return jsxRuntime.jsx(reactDialog.Overlay,{ref:r,className:css.cx(n.bgOverlay,t),"data-beam-modal":!0,...a})});u.displayName="ModalBackgroundOverlay";var N=react.forwardRef(({className:t,children:a,...r},n)=>{let l=recipes.modal();return jsxRuntime.jsx(reactDialog.Content,{ref:n,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();},...r,children:a})});N.displayName="ModalContent";var k=react.forwardRef(({children:t,open:a,onOpenChange:r,trigger:n,title:l,description:s,size:d="lg",hideTitle:p,hideDescription:x,hideCloseButton:v,triggerTooltip:y,...I},w)=>{let i=react.useRef(null),C=react.useRef(),o=recipes.modal();return react.useEffect(()=>{if(!i.current)return;i.current.getRootNode().nodeType===Node.DOCUMENT_FRAGMENT_NODE&&(C.current=i.current.getRootNode());},[]),jsxRuntime.jsxs(reactDialog.Root,{open:a,onOpenChange:r,children:[jsxRuntime.jsx(y?chunkWHYG63JU_cjs.a:react.Fragment,{...y,children:jsxRuntime.jsx(reactDialog.Trigger,{ref:i,asChild:!0,children:n??jsxRuntime.jsx("div",{"aria-hidden":!0,className:o.hidden})})}),jsxRuntime.jsx(reactDialog.Portal,{container:C.current,children:jsxRuntime.jsx(u,{onWheel:c=>c.stopPropagation(),onTouchMove:c=>c.stopPropagation(),children:jsxRuntime.jsx(N,{ref:w,...I,children:jsxRuntime.jsxs(chunk5MDNIIWX_cjs.a,{size:d,noMaxWidth:!0,className:o.card,children:[!p||!v?jsxRuntime.jsxs("div",{className:o.header,children:[jsxRuntime.jsx(reactDialog.Title,{className:o.title,"data-hidden":p,children:l}),!v&&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:u,Content:N,Title:reactDialog.Title,Description:reactDialog.Description};

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