import * as o from "react";
import n from "react-dom";
import { Primitive as s } from "../../../../../@radix-ui_react-primitive@2.1.3_@types_react-dom@19.2.3_@types_react@19.2.8__@types_rea_b16411dad6e6f8e2d0d80dbd3d639048/node_modules/@radix-ui/react-primitive/dist/index.es.js";
import { useLayoutEffect as c } from "../../../../../@radix-ui_react-use-layout-effect@1.1.1_@types_react@19.2.8_react@19.2.3/node_modules/@radix-ui/react-use-layout-effect/dist/index.es.js";
import { jsx as u } from "react/jsx-runtime";
var l = "Portal", p = o.forwardRef((r, e) => {
  const { container: a, ...f } = r, [i, m] = o.useState(!1);
  c(() => m(!0), []);
  const t = a || i && globalThis?.document?.body;
  return t ? n.createPortal(/* @__PURE__ */ u(s.div, { ...f, ref: e }), t) : null;
});
p.displayName = l;
export {
  p as Portal
};
//# sourceMappingURL=index.es.js.map
