import { useRef as f, useCallback as u, useLayoutEffect as i } from "react";
import { noop as l } from "es-toolkit/compat";
const a = {
  attributes: !0,
  childList: !1,
  subtree: !1
}, b = (e) => e !== null && typeof e == "object" && Object.hasOwn(e, "current"), O = (e) => b(e) ? e.current : e, d = (e, n = l, r = a) => {
  const t = f(null), s = u(() => t.current?.disconnect(), []), o = u(() => {
    const c = O(e);
    c && (t.current = new MutationObserver(n), t.current.observe(c, r));
  }, [n, r, e]);
  i(() => (o(), () => s()), [s, o]);
};
export {
  d as default
};
//# sourceMappingURL=useMutationObserver.js.map
