import * as l from "react";
import { useStableCallback as m } from "../../../../../../@base-ui_utils@0.2.4_@types_react@18.3.27_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@base-ui/utils/esm/useStableCallback.js";
import { useAnimationsFinished as f } from "./useAnimationsFinished.js";
function c(a) {
  const {
    enabled: e = !0,
    open: n,
    ref: i,
    onComplete: s
  } = a, o = m(s), t = f(i, n, !1);
  l.useEffect(() => {
    if (!e)
      return;
    const r = new AbortController();
    return t(o, r.signal), () => {
      r.abort();
    };
  }, [e, n, o, t]);
}
export {
  c as useOpenChangeComplete
};
