"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
const React = require("react");
function _interopNamespaceDefault(e) {
  const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
  if (e) {
    for (const k in e) {
      if (k !== "default") {
        const d = Object.getOwnPropertyDescriptor(e, k);
        Object.defineProperty(n, k, d.get ? d : {
          enumerable: true,
          get: () => e[k]
        });
      }
    }
  }
  n.default = e;
  return Object.freeze(n);
}
const React__namespace = /* @__PURE__ */ _interopNamespaceDefault(React);
function useIsMounted() {
  const isMounted = React__namespace.useRef(false);
  React__namespace.useEffect(() => {
    isMounted.current = true;
    return () => {
      isMounted.current = false;
    };
  }, []);
  return isMounted;
}
function useDidUpdateEffect(callback, deps) {
  const isMounted = useIsMounted();
  const isInitialMount = React__namespace.useRef(true);
  React__namespace.useEffect(() => {
    let effectCleanupFunc;
    if (isInitialMount.current) {
      isInitialMount.current = false;
    } else {
      effectCleanupFunc = callback();
    }
    return () => {
      effectCleanupFunc == null ? void 0 : effectCleanupFunc();
      if (!isMounted.current) {
        isInitialMount.current = true;
      }
    };
  }, deps);
}
exports.useDidUpdateEffect = useDidUpdateEffect;
//# sourceMappingURL=useDidUpdateEffect.cjs.map
