"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const jsxRuntime = require("react/jsx-runtime");
const React = require("react");
;/* empty css                                                                                                                                                                                              */
;/* empty css                                                                                                                                                                                               */
;/* empty css                                                                                                                                                                                                       */
;/* empty css                                                                                                                                                                                                  */
;/* empty css                                                                                                                                                                                                  */
const navMenuRefContext = require("./nav-menu-ref-context.cjs");
const Portal = require("../../../../node_modules/.pnpm/@mantine_core@7.15.2_patch_hash_jclkxeaefn6uz54h34k3r3yjsq_@mantine_hooks@7.15.2_react@18.3.1_szqfuioo5damkjdixckhzmwycq/node_modules/@mantine/core/esm/components/Portal/Portal.cjs");
const NavMenuPortal = ({ children }) => {
  const ctx = React.useContext(navMenuRefContext.NavMenuRefContext);
  const [target, setTarget] = React.useState();
  React.useEffect(() => {
    if (ctx == null ? void 0 : ctx.current) {
      setTarget(ctx.current);
    }
  }, [ctx]);
  if (!ctx) {
    return null;
  }
  if (!target) {
    return null;
  }
  return /* @__PURE__ */ jsxRuntime.jsx(Portal.Portal, { target, children });
};
exports.NavMenuPortal = NavMenuPortal;
