"use client";
import * as React from "react";
import { useTooltipRootContext } from "../root/TooltipRootContext.js";
import { TooltipPortalContext } from "./TooltipPortalContext.js";
import { FloatingPortalLite } from "../../utils/FloatingPortalLite.js";
import { jsx } from "react/jsx-runtime";
const TooltipPortal = /* @__PURE__ */ React.forwardRef(function TooltipPortal2(props, forwardedRef) {
  const {
    keepMounted = false,
    ...portalProps
  } = props;
  const store = useTooltipRootContext();
  const mounted = store.useState("mounted");
  const shouldRender = mounted || keepMounted;
  if (!shouldRender) {
    return null;
  }
  return /* @__PURE__ */ jsx(TooltipPortalContext.Provider, {
    value: keepMounted,
    children: /* @__PURE__ */ jsx(FloatingPortalLite, {
      ref: forwardedRef,
      ...portalProps
    })
  });
});
if (process.env.NODE_ENV !== "production") TooltipPortal.displayName = "TooltipPortal";
export {
  TooltipPortal
};
//# sourceMappingURL=TooltipPortal.js.map
