function n(e) {
  return `Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `;
}
var _ = typeof Symbol == "function" && Symbol.observable || "@@observable", w = _, g = () => Math.random().toString(36).substring(7).split("").join("."), S = {
  INIT: `@@redux/INIT${/* @__PURE__ */ g()}`,
  REPLACE: `@@redux/REPLACE${/* @__PURE__ */ g()}`
}, N = S;
function I(e) {
  if (typeof e != "object" || e === null)
    return !1;
  let t = e;
  for (; Object.getPrototypeOf(t) !== null; )
    t = Object.getPrototypeOf(t);
  return Object.getPrototypeOf(e) === t || Object.getPrototypeOf(e) === null;
}
function A(e) {
  if (e === void 0)
    return "undefined";
  if (e === null)
    return "null";
  const t = typeof e;
  switch (t) {
    case "boolean":
    case "string":
    case "number":
    case "symbol":
    case "function":
      return t;
  }
  if (Array.isArray(e))
    return "array";
  if ($(e))
    return "date";
  if (j(e))
    return "error";
  const r = V(e);
  switch (r) {
    case "Symbol":
    case "Promise":
    case "WeakMap":
    case "WeakSet":
    case "Map":
    case "Set":
      return r;
  }
  return Object.prototype.toString.call(e).slice(8, -1).toLowerCase().replace(/\s/g, "");
}
function V(e) {
  return typeof e.constructor == "function" ? e.constructor.name : null;
}
function j(e) {
  return e instanceof Error || typeof e.message == "string" && e.constructor && typeof e.constructor.stackTraceLimit == "number";
}
function $(e) {
  return e instanceof Date ? !0 : typeof e.toDateString == "function" && typeof e.getDate == "function" && typeof e.setDate == "function";
}
function p(e) {
  let t = typeof e;
  return process.env.NODE_ENV !== "production" && (t = A(e)), t;
}
function k(e, t, r) {
  if (typeof e != "function")
    throw new Error(process.env.NODE_ENV === "production" ? n(2) : `Expected the root reducer to be a function. Instead, received: '${p(e)}'`);
  if (typeof t == "function" && typeof r == "function" || typeof r == "function" && typeof arguments[3] == "function")
    throw new Error(process.env.NODE_ENV === "production" ? n(0) : "It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.");
  if (typeof t == "function" && typeof r > "u" && (r = t, t = void 0), typeof r < "u") {
    if (typeof r != "function")
      throw new Error(process.env.NODE_ENV === "production" ? n(1) : `Expected the enhancer to be a function. Instead, received: '${p(r)}'`);
    return r(k)(e, t);
  }
  let c = e, s = t, a = /* @__PURE__ */ new Map(), f = a, h = 0, i = !1;
  function l() {
    f === a && (f = /* @__PURE__ */ new Map(), a.forEach((o, u) => {
      f.set(u, o);
    }));
  }
  function b() {
    if (i)
      throw new Error(process.env.NODE_ENV === "production" ? n(3) : "You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");
    return s;
  }
  function E(o) {
    if (typeof o != "function")
      throw new Error(process.env.NODE_ENV === "production" ? n(4) : `Expected the listener to be a function. Instead, received: '${p(o)}'`);
    if (i)
      throw new Error(process.env.NODE_ENV === "production" ? n(5) : "You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");
    let u = !0;
    l();
    const d = h++;
    return f.set(d, o), function() {
      if (u) {
        if (i)
          throw new Error(process.env.NODE_ENV === "production" ? n(6) : "You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");
        u = !1, l(), f.delete(d), a = null;
      }
    };
  }
  function y(o) {
    if (!I(o))
      throw new Error(process.env.NODE_ENV === "production" ? n(7) : `Actions must be plain objects. Instead, the actual type was: '${p(o)}'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.`);
    if (typeof o.type > "u")
      throw new Error(process.env.NODE_ENV === "production" ? n(8) : 'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');
    if (typeof o.type != "string")
      throw new Error(process.env.NODE_ENV === "production" ? n(17) : `Action "type" property must be a string. Instead, the actual type was: '${p(o.type)}'. Value was: '${o.type}' (stringified)`);
    if (i)
      throw new Error(process.env.NODE_ENV === "production" ? n(9) : "Reducers may not dispatch actions.");
    try {
      i = !0, s = c(s, o);
    } finally {
      i = !1;
    }
    return (a = f).forEach((d) => {
      d();
    }), o;
  }
  function v(o) {
    if (typeof o != "function")
      throw new Error(process.env.NODE_ENV === "production" ? n(10) : `Expected the nextReducer to be a function. Instead, received: '${p(o)}`);
    c = o, y({
      type: N.REPLACE
    });
  }
  function x() {
    const o = E;
    return {
      /**
       * The minimal observable subscription method.
       * @param observer Any object that can be used as an observer.
       * The observer object should have a `next` method.
       * @returns An object with an `unsubscribe` method that can
       * be used to unsubscribe the observable from the store, and prevent further
       * emission of values from the observable.
       */
      subscribe(u) {
        if (typeof u != "object" || u === null)
          throw new Error(process.env.NODE_ENV === "production" ? n(11) : `Expected the observer to be an object. Instead, received: '${p(u)}'`);
        function d() {
          const m = u;
          m.next && m.next(b());
        }
        return d(), {
          unsubscribe: o(d)
        };
      },
      [w]() {
        return this;
      }
    };
  }
  return y({
    type: N.INIT
  }), {
    dispatch: y,
    subscribe: E,
    getState: b,
    replaceReducer: v,
    [w]: x
  };
}
function O(e, t) {
  return function(...r) {
    return t(e.apply(this, r));
  };
}
function M(e, t) {
  if (typeof e == "function")
    return O(e, t);
  if (typeof e != "object" || e === null)
    throw new Error(process.env.NODE_ENV === "production" ? n(16) : `bindActionCreators expected an object or a function, but instead received: '${p(e)}'. Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?`);
  const r = {};
  for (const c in e) {
    const s = e[c];
    typeof s == "function" && (r[c] = O(s, t));
  }
  return r;
}
function P(...e) {
  return e.length === 0 ? (t) => t : e.length === 1 ? e[0] : e.reduce((t, r) => (...c) => t(r(...c)));
}
function L(...e) {
  return (t) => (r, c) => {
    const s = t(r, c);
    let a = () => {
      throw new Error(process.env.NODE_ENV === "production" ? n(15) : "Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.");
    };
    const f = {
      getState: s.getState,
      dispatch: (i, ...l) => a(i, ...l)
    }, h = e.map((i) => i(f));
    return a = P(...h)(s.dispatch), {
      ...s,
      dispatch: a
    };
  };
}
export {
  N as __DO_NOT_USE__ActionTypes,
  L as applyMiddleware,
  M as bindActionCreators,
  P as compose,
  k as createStore,
  I as isPlainObject
};
//# sourceMappingURL=redux.js.map
