"use client";
const require_Mantine_context = require("../../core/MantineProvider/Mantine.context.cjs");
const require_factory = require("../../core/factory/factory.cjs");
const require_Portal = require("./Portal.cjs");
let react_jsx_runtime = require("react/jsx-runtime");
//#region packages/@mantine/core/src/components/Portal/OptionalPortal.tsx
const OptionalPortal = require_factory.factory(({ withinPortal = true, children, ...others }) => {
	if (require_Mantine_context.useMantineEnv() === "test" || !withinPortal) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_jsx_runtime.Fragment, { children });
	return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Portal.Portal, {
		...others,
		children
	});
});
OptionalPortal.displayName = "@mantine/core/OptionalPortal";
//#endregion
exports.OptionalPortal = OptionalPortal;

//# sourceMappingURL=OptionalPortal.cjs.map