'use client';'use strict';

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,...n},a)=>{let r=recipes.modal();return jsxRuntime.jsx(reactDialog.Overlay,{ref:a,className:css.cx(r.bgOverlay,t),...n})});u.displayName="ModalBackgroundOverlay";var N=react.forwardRef(({className:t,children:n,...a},r)=>{let s=recipes.modal();return jsxRuntime.jsx(reactDialog.Content,{ref:r,className:css.cx(recipes.customScrollbar(),s.content,t),onInteractOutside:l=>{let d=l.detail.originalEvent.target;d instanceof Element&&d.closest("[data-sonner-toast]")&&l.preventDefault();},...a,children:n})});N.displayName="ModalContent";var W=react.forwardRef(({children:t,open:n,onOpenChange:a,trigger:r,title:s,description:l,size:d="lg",hideTitle:p,hideDescription:k,hideCloseButton:C,...x},I)=>{let i=react.useRef(null),v=react.useRef(),o=recipes.modal();return react.useEffect(()=>{if(!i.current)return;i.current.getRootNode().nodeType===Node.DOCUMENT_FRAGMENT_NODE&&(v.current=i.current.getRootNode());},[]),jsxRuntime.jsxs(reactDialog.Root,{open:n,onOpenChange:a,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:v.current,children:jsxRuntime.jsx(u,{onWheel:c=>c.stopPropagation(),onTouchMove:c=>c.stopPropagation(),children:jsxRuntime.jsx(N,{ref:I,...x,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:s}),!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:s}),jsxRuntime.jsxs("div",{className:o.cardContent,children:[jsxRuntime.jsx(reactDialog.Description,{className:o.description,"data-hidden":k,children:l}),t]})]})})})})]})});W.displayName="Modal";var _={Root:reactDialog.Root,Trigger:reactDialog.Trigger,Portal:reactDialog.Portal,Close:reactDialog.Close,Overlay:u,Content:N,Title:reactDialog.Title,Description:reactDialog.Description};

exports.a = W;
exports.b = _;
//# sourceMappingURL=out.js.map
//# sourceMappingURL=chunk-BST5PQPJ.cjs.map