import c from "../../../rc-util/es/raf.mjs";
import { composeRef as s } from "../../../rc-util/es/ref.mjs";
import * as n from "react";
import { useRef as f } from "react";
import m from "../tooltip/index.mjs";
const u = /* @__PURE__ */ n.forwardRef((r, a) => {
  const {
    open: t
  } = r, l = f(null), e = f(null);
  function i() {
    c.cancel(e.current), e.current = null;
  }
  function p() {
    e.current = c(() => {
      var o;
      (o = l.current) === null || o === void 0 || o.forceAlign(), e.current = null;
    });
  }
  return n.useEffect(() => (t ? p() : i(), i), [t, r.title]), /* @__PURE__ */ n.createElement(m, Object.assign({
    ref: s(l, a)
  }, r));
});
process.env.NODE_ENV !== "production" && (u.displayName = "SliderTooltip");
const E = u;
export {
  E as default
};
