import { __exports as d } from "../../../../../../../_virtual/with-selector.development.js";
import W from "react";
import { __require as I } from "../../shim/index.js";
/**
 * @license React
 * use-sync-external-store-shim/with-selector.development.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */
var h;
function N() {
  return h ? d : (h = 1, process.env.NODE_ENV !== "production" && function() {
    typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
    var i = W, A = I();
    function R(e, r) {
      return e === r && (e !== 0 || 1 / e === 1 / r) || e !== e && r !== r;
    }
    var T = typeof Object.is == "function" ? Object.is : R, V = A.useSyncExternalStore, D = i.useRef, M = i.useEffect, g = i.useMemo, y = i.useDebugValue;
    function G(e, r, a, f, n) {
      var l = D(null), t;
      l.current === null ? (t = {
        hasValue: !1,
        value: null
      }, l.current = t) : t = l.current;
      var m = g(function() {
        var E = !1, c, _, L = function(u) {
          if (!E) {
            E = !0, c = u;
            var v = f(u);
            if (n !== void 0 && t.hasValue) {
              var O = t.value;
              if (n(O, v))
                return _ = O, O;
            }
            return _ = v, v;
          }
          var K = c, s = _;
          if (T(K, u))
            return s;
          var S = f(u);
          return n !== void 0 && n(s, S) ? s : (c = u, _ = S, S);
        }, p = a === void 0 ? null : a, C = function() {
          return L(r());
        }, H = p === null ? void 0 : function() {
          return L(p());
        };
        return [C, H];
      }, [r, a, f, n]), b = m[0], B = m[1], o = V(e, b, B);
      return M(function() {
        t.hasValue = !0, t.value = o;
      }, [o]), y(o), o;
    }
    d.useSyncExternalStoreWithSelector = G, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
  }(), d);
}
export {
  N as __require
};
//# sourceMappingURL=with-selector.development.js.map
