UNPKG

@alpernative/tree

Version:

[`@alpernative/tree`](https://www.npmjs.com/package/@alpernative/tree) is a high-performance, customizable tree component for React. It provides a wide range of features, including virtualization, drag-and-drop, and nested drag-and-drop support.

1,416 lines (1,413 loc) 246 kB
var ks = Object.defineProperty; var Us = (e, t, r) => t in e ? ks(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r; var K = (e, t, r) => (Us(e, typeof t != "symbol" ? t + "" : t, r), r); import * as z from "react"; import M, { useState as jr, useRef as J, useEffect as Be, useContext as ni, useLayoutEffect as js, Component as Hr, createElement as Tt, PureComponent as Hs } from "react"; import qs, { unstable_batchedUpdates as Ys, flushSync as oi } from "react-dom"; function Ks(e) { return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e; } var Ir = { exports: {} }, ot = {}; /** * @license React * react-jsx-runtime.production.min.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 Vn; function Xs() { if (Vn) return ot; Vn = 1; var e = M, t = Symbol.for("react.element"), r = Symbol.for("react.fragment"), n = Object.prototype.hasOwnProperty, o = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, i = { key: !0, ref: !0, __self: !0, __source: !0 }; function s(a, c, d) { var f, u = {}, l = null, m = null; d !== void 0 && (l = "" + d), c.key !== void 0 && (l = "" + c.key), c.ref !== void 0 && (m = c.ref); for (f in c) n.call(c, f) && !i.hasOwnProperty(f) && (u[f] = c[f]); if (a && a.defaultProps) for (f in c = a.defaultProps, c) u[f] === void 0 && (u[f] = c[f]); return { $$typeof: t, type: a, key: l, ref: m, props: u, _owner: o.current }; } return ot.Fragment = r, ot.jsx = s, ot.jsxs = s, ot; } var it = {}; /** * @license React * react-jsx-runtime.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 $n; function Js() { return $n || ($n = 1, process.env.NODE_ENV !== "production" && function() { var e = M, t = Symbol.for("react.element"), r = Symbol.for("react.portal"), n = Symbol.for("react.fragment"), o = Symbol.for("react.strict_mode"), i = Symbol.for("react.profiler"), s = Symbol.for("react.provider"), a = Symbol.for("react.context"), c = Symbol.for("react.forward_ref"), d = Symbol.for("react.suspense"), f = Symbol.for("react.suspense_list"), u = Symbol.for("react.memo"), l = Symbol.for("react.lazy"), m = Symbol.for("react.offscreen"), b = Symbol.iterator, p = "@@iterator"; function g(h) { if (h === null || typeof h != "object") return null; var N = b && h[b] || h[p]; return typeof N == "function" ? N : null; } var E = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; function S(h) { { for (var N = arguments.length, x = new Array(N > 1 ? N - 1 : 0), T = 1; T < N; T++) x[T - 1] = arguments[T]; D("error", h, x); } } function D(h, N, x) { { var T = E.ReactDebugCurrentFrame, W = T.getStackAddendum(); W !== "" && (N += "%s", x = x.concat([W])); var Y = x.map(function(F) { return String(F); }); Y.unshift("Warning: " + N), Function.prototype.apply.call(console[h], console, Y); } } var _ = !1, y = !1, O = !1, I = !1, P = !1, A; A = Symbol.for("react.module.reference"); function L(h) { return !!(typeof h == "string" || typeof h == "function" || h === n || h === i || P || h === o || h === d || h === f || I || h === m || _ || y || O || typeof h == "object" && h !== null && (h.$$typeof === l || h.$$typeof === u || h.$$typeof === s || h.$$typeof === a || h.$$typeof === c || // This needs to include all possible module reference object // types supported by any Flight configuration anywhere since // we don't know which Flight build this will end up being used // with. h.$$typeof === A || h.getModuleId !== void 0)); } function q(h, N, x) { var T = h.displayName; if (T) return T; var W = N.displayName || N.name || ""; return W !== "" ? x + "(" + W + ")" : x; } function B(h) { return h.displayName || "Context"; } function G(h) { if (h == null) return null; if (typeof h.tag == "number" && S("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof h == "function") return h.displayName || h.name || null; if (typeof h == "string") return h; switch (h) { case n: return "Fragment"; case r: return "Portal"; case i: return "Profiler"; case o: return "StrictMode"; case d: return "Suspense"; case f: return "SuspenseList"; } if (typeof h == "object") switch (h.$$typeof) { case a: var N = h; return B(N) + ".Consumer"; case s: var x = h; return B(x._context) + ".Provider"; case c: return q(h, h.render, "ForwardRef"); case u: var T = h.displayName || null; return T !== null ? T : G(h.type) || "Memo"; case l: { var W = h, Y = W._payload, F = W._init; try { return G(F(Y)); } catch { return null; } } } return null; } var Z = Object.assign, Q = 0, ie, se, re, be, pe, ye, Ee; function ce() { } ce.__reactDisabledLog = !0; function de() { { if (Q === 0) { ie = console.log, se = console.info, re = console.warn, be = console.error, pe = console.group, ye = console.groupCollapsed, Ee = console.groupEnd; var h = { configurable: !0, enumerable: !0, value: ce, writable: !0 }; Object.defineProperties(console, { info: h, log: h, warn: h, error: h, group: h, groupCollapsed: h, groupEnd: h }); } Q++; } } function Se() { { if (Q--, Q === 0) { var h = { configurable: !0, enumerable: !0, writable: !0 }; Object.defineProperties(console, { log: Z({}, h, { value: ie }), info: Z({}, h, { value: se }), warn: Z({}, h, { value: re }), error: Z({}, h, { value: be }), group: Z({}, h, { value: pe }), groupCollapsed: Z({}, h, { value: ye }), groupEnd: Z({}, h, { value: Ee }) }); } Q < 0 && S("disabledDepth fell below zero. This is a bug in React. Please file an issue."); } } var Ce = E.ReactCurrentDispatcher, Te; function Ae(h, N, x) { { if (Te === void 0) try { throw Error(); } catch (W) { var T = W.stack.trim().match(/\n( *(at )?)/); Te = T && T[1] || ""; } return ` ` + Te + h; } } var De = !1, _e; { var qe = typeof WeakMap == "function" ? WeakMap : Map; _e = new qe(); } function w(h, N) { if (!h || De) return ""; { var x = _e.get(h); if (x !== void 0) return x; } var T; De = !0; var W = Error.prepareStackTrace; Error.prepareStackTrace = void 0; var Y; Y = Ce.current, Ce.current = null, de(); try { if (N) { var F = function() { throw Error(); }; if (Object.defineProperty(F.prototype, "props", { set: function() { throw Error(); } }), typeof Reflect == "object" && Reflect.construct) { try { Reflect.construct(F, []); } catch (Me) { T = Me; } Reflect.construct(h, [], F); } else { try { F.call(); } catch (Me) { T = Me; } h.call(F.prototype); } } else { try { throw Error(); } catch (Me) { T = Me; } h(); } } catch (Me) { if (Me && T && typeof Me.stack == "string") { for (var V = Me.stack.split(` `), le = T.stack.split(` `), ee = V.length - 1, te = le.length - 1; ee >= 1 && te >= 0 && V[ee] !== le[te]; ) te--; for (; ee >= 1 && te >= 0; ee--, te--) if (V[ee] !== le[te]) { if (ee !== 1 || te !== 1) do if (ee--, te--, te < 0 || V[ee] !== le[te]) { var Oe = ` ` + V[ee].replace(" at new ", " at "); return h.displayName && Oe.includes("<anonymous>") && (Oe = Oe.replace("<anonymous>", h.displayName)), typeof h == "function" && _e.set(h, Oe), Oe; } while (ee >= 1 && te >= 0); break; } } } finally { De = !1, Ce.current = Y, Se(), Error.prepareStackTrace = W; } var Ke = h ? h.displayName || h.name : "", Mn = Ke ? Ae(Ke) : ""; return typeof h == "function" && _e.set(h, Mn), Mn; } function me(h, N, x) { return w(h, !1); } function C(h) { var N = h.prototype; return !!(N && N.isReactComponent); } function Re(h, N, x) { if (h == null) return ""; if (typeof h == "function") return w(h, C(h)); if (typeof h == "string") return Ae(h); switch (h) { case d: return Ae("Suspense"); case f: return Ae("SuspenseList"); } if (typeof h == "object") switch (h.$$typeof) { case c: return me(h.render); case u: return Re(h.type, N, x); case l: { var T = h, W = T._payload, Y = T._init; try { return Re(Y(W), N, x); } catch { } } } return ""; } var Le = Object.prototype.hasOwnProperty, rt = {}, On = E.ReactDebugCurrentFrame; function wt(h) { if (h) { var N = h._owner, x = Re(h.type, h._source, N ? N.type : null); On.setExtraStackFrame(x); } else On.setExtraStackFrame(null); } function _s(h, N, x, T, W) { { var Y = Function.call.bind(Le); for (var F in h) if (Y(h, F)) { var V = void 0; try { if (typeof h[F] != "function") { var le = Error((T || "React class") + ": " + x + " type `" + F + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof h[F] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."); throw le.name = "Invariant Violation", le; } V = h[F](N, F, T, x, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"); } catch (ee) { V = ee; } V && !(V instanceof Error) && (wt(W), S("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", T || "React class", x, F, typeof V), wt(null)), V instanceof Error && !(V.message in rt) && (rt[V.message] = !0, wt(W), S("Failed %s type: %s", x, V.message), wt(null)); } } } var Os = Array.isArray; function Zt(h) { return Os(h); } function Ns(h) { { var N = typeof Symbol == "function" && Symbol.toStringTag, x = N && h[Symbol.toStringTag] || h.constructor.name || "Object"; return x; } } function xs(h) { try { return Nn(h), !1; } catch { return !0; } } function Nn(h) { return "" + h; } function xn(h) { if (xs(h)) return S("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", Ns(h)), Nn(h); } var nt = E.ReactCurrentOwner, Is = { key: !0, ref: !0, __self: !0, __source: !0 }, In, wn, Qt; Qt = {}; function ws(h) { if (Le.call(h, "ref")) { var N = Object.getOwnPropertyDescriptor(h, "ref").get; if (N && N.isReactWarning) return !1; } return h.ref !== void 0; } function Cs(h) { if (Le.call(h, "key")) { var N = Object.getOwnPropertyDescriptor(h, "key").get; if (N && N.isReactWarning) return !1; } return h.key !== void 0; } function Rs(h, N) { if (typeof h.ref == "string" && nt.current && N && nt.current.stateNode !== N) { var x = G(nt.current.type); Qt[x] || (S('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', G(nt.current.type), h.ref), Qt[x] = !0); } } function Ps(h, N) { { var x = function() { In || (In = !0, S("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", N)); }; x.isReactWarning = !0, Object.defineProperty(h, "key", { get: x, configurable: !0 }); } } function Ts(h, N) { { var x = function() { wn || (wn = !0, S("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", N)); }; x.isReactWarning = !0, Object.defineProperty(h, "ref", { get: x, configurable: !0 }); } } var As = function(h, N, x, T, W, Y, F) { var V = { // This tag allows us to uniquely identify this as a React Element $$typeof: t, // Built-in properties that belong on the element type: h, key: N, ref: x, props: F, // Record the component responsible for creating this element. _owner: Y }; return V._store = {}, Object.defineProperty(V._store, "validated", { configurable: !1, enumerable: !1, writable: !0, value: !1 }), Object.defineProperty(V, "_self", { configurable: !1, enumerable: !1, writable: !1, value: T }), Object.defineProperty(V, "_source", { configurable: !1, enumerable: !1, writable: !1, value: W }), Object.freeze && (Object.freeze(V.props), Object.freeze(V)), V; }; function Ls(h, N, x, T, W) { { var Y, F = {}, V = null, le = null; x !== void 0 && (xn(x), V = "" + x), Cs(N) && (xn(N.key), V = "" + N.key), ws(N) && (le = N.ref, Rs(N, W)); for (Y in N) Le.call(N, Y) && !Is.hasOwnProperty(Y) && (F[Y] = N[Y]); if (h && h.defaultProps) { var ee = h.defaultProps; for (Y in ee) F[Y] === void 0 && (F[Y] = ee[Y]); } if (V || le) { var te = typeof h == "function" ? h.displayName || h.name || "Unknown" : h; V && Ps(F, te), le && Ts(F, te); } return As(h, V, le, W, T, nt.current, F); } } var er = E.ReactCurrentOwner, Cn = E.ReactDebugCurrentFrame; function Ye(h) { if (h) { var N = h._owner, x = Re(h.type, h._source, N ? N.type : null); Cn.setExtraStackFrame(x); } else Cn.setExtraStackFrame(null); } var tr; tr = !1; function rr(h) { return typeof h == "object" && h !== null && h.$$typeof === t; } function Rn() { { if (er.current) { var h = G(er.current.type); if (h) return ` Check the render method of \`` + h + "`."; } return ""; } } function Ms(h) { { if (h !== void 0) { var N = h.fileName.replace(/^.*[\\\/]/, ""), x = h.lineNumber; return ` Check your code at ` + N + ":" + x + "."; } return ""; } } var Pn = {}; function Vs(h) { { var N = Rn(); if (!N) { var x = typeof h == "string" ? h : h.displayName || h.name; x && (N = ` Check the top-level render call using <` + x + ">."); } return N; } } function Tn(h, N) { { if (!h._store || h._store.validated || h.key != null) return; h._store.validated = !0; var x = Vs(N); if (Pn[x]) return; Pn[x] = !0; var T = ""; h && h._owner && h._owner !== er.current && (T = " It was passed a child from " + G(h._owner.type) + "."), Ye(h), S('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', x, T), Ye(null); } } function An(h, N) { { if (typeof h != "object") return; if (Zt(h)) for (var x = 0; x < h.length; x++) { var T = h[x]; rr(T) && Tn(T, N); } else if (rr(h)) h._store && (h._store.validated = !0); else if (h) { var W = g(h); if (typeof W == "function" && W !== h.entries) for (var Y = W.call(h), F; !(F = Y.next()).done; ) rr(F.value) && Tn(F.value, N); } } } function $s(h) { { var N = h.type; if (N == null || typeof N == "string") return; var x; if (typeof N == "function") x = N.propTypes; else if (typeof N == "object" && (N.$$typeof === c || // Note: Memo only checks outer props here. // Inner props are checked in the reconciler. N.$$typeof === u)) x = N.propTypes; else return; if (x) { var T = G(N); _s(x, h.props, "prop", T, h); } else if (N.PropTypes !== void 0 && !tr) { tr = !0; var W = G(N); S("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", W || "Unknown"); } typeof N.getDefaultProps == "function" && !N.getDefaultProps.isReactClassApproved && S("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead."); } } function Bs(h) { { for (var N = Object.keys(h.props), x = 0; x < N.length; x++) { var T = N[x]; if (T !== "children" && T !== "key") { Ye(h), S("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", T), Ye(null); break; } } h.ref !== null && (Ye(h), S("Invalid attribute `ref` supplied to `React.Fragment`."), Ye(null)); } } function Ln(h, N, x, T, W, Y) { { var F = L(h); if (!F) { var V = ""; (h === void 0 || typeof h == "object" && h !== null && Object.keys(h).length === 0) && (V += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."); var le = Ms(W); le ? V += le : V += Rn(); var ee; h === null ? ee = "null" : Zt(h) ? ee = "array" : h !== void 0 && h.$$typeof === t ? (ee = "<" + (G(h.type) || "Unknown") + " />", V = " Did you accidentally export a JSX literal instead of a component?") : ee = typeof h, S("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", ee, V); } var te = Ls(h, N, x, W, Y); if (te == null) return te; if (F) { var Oe = N.children; if (Oe !== void 0) if (T) if (Zt(Oe)) { for (var Ke = 0; Ke < Oe.length; Ke++) An(Oe[Ke], h); Object.freeze && Object.freeze(Oe); } else S("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."); else An(Oe, h); } return h === n ? Bs(te) : $s(te), te; } } function Fs(h, N, x) { return Ln(h, N, x, !0); } function zs(h, N, x) { return Ln(h, N, x, !1); } var Ws = zs, Gs = Fs; it.Fragment = n, it.jsx = Ws, it.jsxs = Gs; }()), it; } process.env.NODE_ENV === "production" ? Ir.exports = Xs() : Ir.exports = Js(); var Ve = Ir.exports; function ft(e) { "@babel/helpers - typeof"; return ft = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) { return typeof t; } : function(t) { return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t; }, ft(e); } function Zs(e, t) { if (ft(e) != "object" || !e) return e; var r = e[Symbol.toPrimitive]; if (r !== void 0) { var n = r.call(e, t || "default"); if (ft(n) != "object") return n; throw new TypeError("@@toPrimitive must return a primitive value."); } return (t === "string" ? String : Number)(e); } function Qs(e) { var t = Zs(e, "string"); return ft(t) == "symbol" ? t : String(t); } function ea(e, t, r) { return t = Qs(t), t in e ? Object.defineProperty(e, t, { value: r, enumerable: !0, configurable: !0, writable: !0 }) : e[t] = r, e; } function Bn(e, t) { var r = Object.keys(e); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); t && (n = n.filter(function(o) { return Object.getOwnPropertyDescriptor(e, o).enumerable; })), r.push.apply(r, n); } return r; } function Fn(e) { for (var t = 1; t < arguments.length; t++) { var r = arguments[t] != null ? arguments[t] : {}; t % 2 ? Bn(Object(r), !0).forEach(function(n) { ea(e, n, r[n]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(r)) : Bn(Object(r)).forEach(function(n) { Object.defineProperty(e, n, Object.getOwnPropertyDescriptor(r, n)); }); } return e; } function fe(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 zn = function() { return typeof Symbol == "function" && Symbol.observable || "@@observable"; }(), nr = function() { return Math.random().toString(36).substring(7).split("").join("."); }, Wn = { INIT: "@@redux/INIT" + nr(), REPLACE: "@@redux/REPLACE" + nr(), PROBE_UNKNOWN_ACTION: function() { return "@@redux/PROBE_UNKNOWN_ACTION" + nr(); } }; function ta(e) { if (typeof e != "object" || e === null) return !1; for (var t = e; Object.getPrototypeOf(t) !== null; ) t = Object.getPrototypeOf(t); return Object.getPrototypeOf(e) === t; } function ra(e) { if (e === void 0) return "undefined"; if (e === null) return "null"; var t = typeof e; switch (t) { case "boolean": case "string": case "number": case "symbol": case "function": return t; } if (Array.isArray(e)) return "array"; if (ia(e)) return "date"; if (oa(e)) return "error"; var r = na(e); switch (r) { case "Symbol": case "Promise": case "WeakMap": case "WeakSet": case "Map": case "Set": return r; } return t.slice(8, -1).toLowerCase().replace(/\s/g, ""); } function na(e) { return typeof e.constructor == "function" ? e.constructor.name : null; } function oa(e) { return e instanceof Error || typeof e.message == "string" && e.constructor && typeof e.constructor.stackTraceLimit == "number"; } function ia(e) { return e instanceof Date ? !0 : typeof e.toDateString == "function" && typeof e.getDate == "function" && typeof e.setDate == "function"; } function ke(e) { var t = typeof e; return process.env.NODE_ENV !== "production" && (t = ra(e)), t; } function ii(e, t, r) { var n; if (typeof t == "function" && typeof r == "function" || typeof r == "function" && typeof arguments[3] == "function") throw new Error(process.env.NODE_ENV === "production" ? fe(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" ? fe(1) : "Expected the enhancer to be a function. Instead, received: '" + ke(r) + "'"); return r(ii)(e, t); } if (typeof e != "function") throw new Error(process.env.NODE_ENV === "production" ? fe(2) : "Expected the root reducer to be a function. Instead, received: '" + ke(e) + "'"); var o = e, i = t, s = [], a = s, c = !1; function d() { a === s && (a = s.slice()); } function f() { if (c) throw new Error(process.env.NODE_ENV === "production" ? fe(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 i; } function u(p) { if (typeof p != "function") throw new Error(process.env.NODE_ENV === "production" ? fe(4) : "Expected the listener to be a function. Instead, received: '" + ke(p) + "'"); if (c) throw new Error(process.env.NODE_ENV === "production" ? fe(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."); var g = !0; return d(), a.push(p), function() { if (g) { if (c) throw new Error(process.env.NODE_ENV === "production" ? fe(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."); g = !1, d(); var S = a.indexOf(p); a.splice(S, 1), s = null; } }; } function l(p) { if (!ta(p)) throw new Error(process.env.NODE_ENV === "production" ? fe(7) : "Actions must be plain objects. Instead, the actual type was: '" + ke(p) + "'. 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 p.type > "u") throw new Error(process.env.NODE_ENV === "production" ? fe(8) : 'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.'); if (c) throw new Error(process.env.NODE_ENV === "production" ? fe(9) : "Reducers may not dispatch actions."); try { c = !0, i = o(i, p); } finally { c = !1; } for (var g = s = a, E = 0; E < g.length; E++) { var S = g[E]; S(); } return p; } function m(p) { if (typeof p != "function") throw new Error(process.env.NODE_ENV === "production" ? fe(10) : "Expected the nextReducer to be a function. Instead, received: '" + ke(p)); o = p, l({ type: Wn.REPLACE }); } function b() { var p, g = u; return p = { /** * The minimal observable subscription method. * @param {Object} observer Any object that can be used as an observer. * The observer object should have a `next` method. * @returns {subscription} 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: function(S) { if (typeof S != "object" || S === null) throw new Error(process.env.NODE_ENV === "production" ? fe(11) : "Expected the observer to be an object. Instead, received: '" + ke(S) + "'"); function D() { S.next && S.next(f()); } D(); var _ = g(D); return { unsubscribe: _ }; } }, p[zn] = function() { return this; }, p; } return l({ type: Wn.INIT }), n = { dispatch: l, subscribe: u, getState: f, replaceReducer: m }, n[zn] = b, n; } function Gn(e, t) { return function() { return t(e.apply(this, arguments)); }; } function kn(e, t) { if (typeof e == "function") return Gn(e, t); if (typeof e != "object" || e === null) throw new Error(process.env.NODE_ENV === "production" ? fe(16) : "bindActionCreators expected an object or a function, but instead received: '" + ke(e) + `'. Did you write "import ActionCreators from" instead of "import * as ActionCreators from"?`); var r = {}; for (var n in e) { var o = e[n]; typeof o == "function" && (r[n] = Gn(o, t)); } return r; } function si() { for (var e = arguments.length, t = new Array(e), r = 0; r < e; r++) t[r] = arguments[r]; return t.length === 0 ? function(n) { return n; } : t.length === 1 ? t[0] : t.reduce(function(n, o) { return function() { return n(o.apply(void 0, arguments)); }; }); } function sa() { for (var e = arguments.length, t = new Array(e), r = 0; r < e; r++) t[r] = arguments[r]; return function(n) { return function() { var o = n.apply(void 0, arguments), i = function() { throw new Error(process.env.NODE_ENV === "production" ? fe(15) : "Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch."); }, s = { getState: o.getState, dispatch: function() { return i.apply(void 0, arguments); } }, a = t.map(function(c) { return c(s); }); return i = si.apply(void 0, a)(o.dispatch), Fn(Fn({}, o), {}, { dispatch: i }); }; }; } var wr = { exports: {} }, or = {}; /** * @license React * use-sync-external-store-shim.production.min.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 Un; function aa() { if (Un) return or; Un = 1; var e = M; function t(u, l) { return u === l && (u !== 0 || 1 / u === 1 / l) || u !== u && l !== l; } var r = typeof Object.is == "function" ? Object.is : t, n = e.useState, o = e.useEffect, i = e.useLayoutEffect, s = e.useDebugValue; function a(u, l) { var m = l(), b = n({ inst: { value: m, getSnapshot: l } }), p = b[0].inst, g = b[1]; return i(function() { p.value = m, p.getSnapshot = l, c(p) && g({ inst: p }); }, [u, m, l]), o(function() { return c(p) && g({ inst: p }), u(function() { c(p) && g({ inst: p }); }); }, [u]), s(m), m; } function c(u) { var l = u.getSnapshot; u = u.value; try { var m = l(); return !r(u, m); } catch { return !0; } } function d(u, l) { return l(); } var f = typeof window > "u" || typeof window.document > "u" || typeof window.document.createElement > "u" ? d : a; return or.useSyncExternalStore = e.useSyncExternalStore !== void 0 ? e.useSyncExternalStore : f, or; } var ir = {}; /** * @license React * use-sync-external-store-shim.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 jn; function ca() { return jn || (jn = 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 e = M, t = e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; function r(D) { { for (var _ = arguments.length, y = new Array(_ > 1 ? _ - 1 : 0), O = 1; O < _; O++) y[O - 1] = arguments[O]; n("error", D, y); } } function n(D, _, y) { { var O = t.ReactDebugCurrentFrame, I = O.getStackAddendum(); I !== "" && (_ += "%s", y = y.concat([I])); var P = y.map(function(A) { return String(A); }); P.unshift("Warning: " + _), Function.prototype.apply.call(console[D], console, P); } } function o(D, _) { return D === _ && (D !== 0 || 1 / D === 1 / _) || D !== D && _ !== _; } var i = typeof Object.is == "function" ? Object.is : o, s = e.useState, a = e.useEffect, c = e.useLayoutEffect, d = e.useDebugValue, f = !1, u = !1; function l(D, _, y) { f || e.startTransition !== void 0 && (f = !0, r("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release.")); var O = _(); if (!u) { var I = _(); i(O, I) || (r("The result of getSnapshot should be cached to avoid an infinite loop"), u = !0); } var P = s({ inst: { value: O, getSnapshot: _ } }), A = P[0].inst, L = P[1]; return c(function() { A.value = O, A.getSnapshot = _, m(A) && L({ inst: A }); }, [D, O, _]), a(function() { m(A) && L({ inst: A }); var q = function() { m(A) && L({ inst: A }); }; return D(q); }, [D]), d(O), O; } function m(D) { var _ = D.getSnapshot, y = D.value; try { var O = _(); return !i(y, O); } catch { return !0; } } function b(D, _, y) { return _(); } var p = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u", g = !p, E = g ? b : l, S = e.useSyncExternalStore !== void 0 ? e.useSyncExternalStore : E; ir.useSyncExternalStore = S, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error()); }()), ir; } process.env.NODE_ENV === "production" ? wr.exports = aa() : wr.exports = ca(); var qr = wr.exports, sr = {}; /** * @license React * use-sync-external-store-shim/with-selector.production.min.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 Hn; function la() { if (Hn) return sr; Hn = 1; var e = M, t = qr; function r(d, f) { return d === f && (d !== 0 || 1 / d === 1 / f) || d !== d && f !== f; } var n = typeof Object.is == "function" ? Object.is : r, o = t.useSyncExternalStore, i = e.useRef, s = e.useEffect, a = e.useMemo, c = e.useDebugValue; return sr.useSyncExternalStoreWithSelector = function(d, f, u, l, m) { var b = i(null); if (b.current === null) { var p = { hasValue: !1, value: null }; b.current = p; } else p = b.current; b = a(function() { function E(O) { if (!S) { if (S = !0, D = O, O = l(O), m !== void 0 && p.hasValue) { var I = p.value; if (m(I, O)) return _ = I; } return _ = O; } if (I = _, n(D, O)) return I; var P = l(O); return m !== void 0 && m(I, P) ? I : (D = O, _ = P); } var S = !1, D, _, y = u === void 0 ? null : u; return [function() { return E(f()); }, y === null ? void 0 : function() { return E(y()); }]; }, [f, u, l, m]); var g = o(d, b[0], b[1]); return s(function() { p.hasValue = !0, p.value = g; }, [g]), c(g), g; }, sr; } var ar = {}; /** * @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 qn; function ua() { return qn || (qn = 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 e = M, t = qr; function r(f, u) { return f === u && (f !== 0 || 1 / f === 1 / u) || f !== f && u !== u; } var n = typeof Object.is == "function" ? Object.is : r, o = t.useSyncExternalStore, i = e.useRef, s = e.useEffect, a = e.useMemo, c = e.useDebugValue; function d(f, u, l, m, b) { var p = i(null), g; p.current === null ? (g = { hasValue: !1, value: null }, p.current = g) : g = p.current; var E = a(function() { var y = !1, O, I, P = function(B) { if (!y) { y = !0, O = B; var G = m(B); if (b !== void 0 && g.hasValue) { var Z = g.value; if (b(Z, G)) return I = Z, Z; } return I = G, G; } var Q = O, ie = I; if (n(Q, B)) return ie; var se = m(B); return b !== void 0 && b(ie, se) ? ie : (O = B, I = se, se); }, A = l === void 0 ? null : l, L = function() { return P(u()); }, q = A === null ? void 0 : function() { return P(A()); }; return [L, q]; }, [u, l, m, b]), S = E[0], D = E[1], _ = o(f, S, D); return s(function() { g.hasValue = !0, g.value = _; }, [_]), c(_), _; } ar.useSyncExternalStoreWithSelector = d, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error()); }()), ar; } process.env.NODE_ENV === "production" ? la() : ua(); function da(e) { e(); } let ai = da; const fa = (e) => ai = e, pa = () => ai, Yn = Symbol.for("react-redux-context"), Kn = typeof globalThis < "u" ? globalThis : ( /* fall back to a per-module scope (pre-8.1 behaviour) if `globalThis` is not available */ {} ); function ma() { var e; if (!z.createContext) return {}; const t = (e = Kn[Yn]) != null ? e : Kn[Yn] = /* @__PURE__ */ new Map(); let r = t.get(z.createContext); return r || (r = z.createContext(null), process.env.NODE_ENV !== "production" && (r.displayName = "ReactRedux"), t.set(z.createContext, r)), r; } const ci = /* @__PURE__ */ ma(), ga = () => { throw new Error("uSES not initialized!"); }; function $e() { return $e = Object.assign ? Object.assign.bind() : function(e) { for (var t = 1; t < arguments.length; t++) { var r = arguments[t]; for (var n in r) Object.prototype.hasOwnProperty.call(r, n) && (e[n] = r[n]); } return e; }, $e.apply(this, arguments); } function Vt(e, t) { if (e == null) return {}; var r = {}, n = Object.keys(e), o, i; for (i = 0; i < n.length; i++) o = n[i], !(t.indexOf(o) >= 0) && (r[o] = e[o]); return r; } var Cr = { exports: {} }, k = {}; /** @license React v16.13.1 * react-is.production.min.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 Xn; function ha() { if (Xn) return k; Xn = 1; var e = typeof Symbol == "function" && Symbol.for, t = e ? Symbol.for("react.element") : 60103, r = e ? Symbol.for("react.portal") : 60106, n = e ? Symbol.for("react.fragment") : 60107, o = e ? Symbol.for("react.strict_mode") : 60108, i = e ? Symbol.for("react.profiler") : 60114, s = e ? Symbol.for("react.provider") : 60109, a = e ? Symbol.for("react.context") : 60110, c = e ? Symbol.for("react.async_mode") : 60111, d = e ? Symbol.for("react.concurrent_mode") : 60111, f = e ? Symbol.for("react.forward_ref") : 60112, u = e ? Symbol.for("react.suspense") : 60113, l = e ? Symbol.for("react.suspense_list") : 60120, m = e ? Symbol.for("react.memo") : 60115, b = e ? Symbol.for("react.lazy") : 60116, p = e ? Symbol.for("react.block") : 60121, g = e ? Symbol.for("react.fundamental") : 60117, E = e ? Symbol.for("react.responder") : 60118, S = e ? Symbol.for("react.scope") : 60119; function D(y) { if (typeof y == "object" && y !== null) { var O = y.$$typeof; switch (O) { case t: switch (y = y.type, y) { case c: case d: case n: case i: case o: case u: return y; default: switch (y = y && y.$$typeof, y) { case a: case f: case b: case m: case s: return y; default: return O; } } case r: return O; } } } function _(y) { return D(y) === d; } return k.AsyncMode = c, k.ConcurrentMode = d, k.ContextConsumer = a, k.ContextProvider = s, k.Element = t, k.ForwardRef = f, k.Fragment = n, k.Lazy = b, k.Memo = m, k.Portal = r, k.Profiler = i, k.StrictMode = o, k.Suspense = u, k.isAsyncMode = function(y) { return _(y) || D(y) === c; }, k.isConcurrentMode = _, k.isContextConsumer = function(y) { return D(y) === a; }, k.isContextProvider = function(y) { return D(y) === s; }, k.isElement = function(y) { return typeof y == "object" && y !== null && y.$$typeof === t; }, k.isForwardRef = function(y) { return D(y) === f; }, k.isFragment = function(y) { return D(y) === n; }, k.isLazy = function(y) { return D(y) === b; }, k.isMemo = function(y) { return D(y) === m; }, k.isPortal = function(y) { return D(y) === r; }, k.isProfiler = function(y) { return D(y) === i; }, k.isStrictMode = function(y) { return D(y) === o; }, k.isSuspense = function(y) { return D(y) === u; }, k.isValidElementType = function(y) { return typeof y == "string" || typeof y == "function" || y === n || y === d || y === i || y === o || y === u || y === l || typeof y == "object" && y !== null && (y.$$typeof === b || y.$$typeof === m || y.$$typeof === s || y.$$typeof === a || y.$$typeof === f || y.$$typeof === g || y.$$typeof === E || y.$$typeof === S || y.$$typeof === p); }, k.typeOf = D, k; } var U = {}; /** @license React v16.13.1 * react-is.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 Jn; function va() { return Jn || (Jn = 1, process.env.NODE_ENV !== "production" && function() { var e = typeof Symbol == "function" && Symbol.for, t = e ? Symbol.for("react.element") : 60103, r = e ? Symbol.for("react.portal") : 60106, n = e ? Symbol.for("react.fragment") : 60107, o = e ? Symbol.for("react.strict_mode") : 60108, i = e ? Symbol.for("react.profiler") : 60114, s = e ? Symbol.for("react.provider") : 60109, a = e ? Symbol.for("react.context") : 60110, c = e ? Symbol.for("react.async_mode") : 60111, d = e ? Symbol.for("react.concurrent_mode") : 60111, f = e ? Symbol.for("react.forward_ref") : 60112, u = e ? Symbol.for("react.suspense") : 60113, l = e ? Symbol.for("react.suspense_list") : 60120, m = e ? Symbol.for("react.memo") : 60115, b = e ? Symbol.for("react.lazy") : 60116, p = e ? Symbol.for("react.block") : 60121, g = e ? Symbol.for("react.fundamental") : 60117, E = e ? Symbol.for("react.responder") : 60118, S = e ? Symbol.for("react.scope") : 60119; function D(w) { return typeof w == "string" || typeof w == "function" || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill. w === n || w === d || w === i || w === o || w === u || w === l || typeof w == "object" && w !== null && (w.$$typeof === b || w.$$typeof === m || w.$$typeof === s || w.$$typeof === a || w.$$typeof === f || w.$$typeof === g || w.$$typeof === E || w.$$typeof === S || w.$$typeof === p); } function _(w) { if (typeof w == "object" && w !== null) { var me = w.$$typeof; switch (me) { case t: var C = w.type; switch (C) { case c: case d: case n: case i: case o: case u: return C; default: var Re = C && C.$$typeof; switch (Re) { case a: case f: case b: case m: case s: return Re; default: return me; } } case r: return me; } } } var y = c, O = d, I = a, P = s, A = t, L = f, q = n, B = b, G = m, Z = r, Q = i, ie = o, se = u, re = !1; function be(w) { return re || (re = !0, console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")), pe(w) || _(w) === c; } function pe(w) { return _(w) === d; } function ye(w) { return _(w) === a; } function Ee(w) { return _(w) === s; } function ce(w) { return typeof w == "object" && w !== null && w.$$typeof === t; } function de(w) { return _(w) === f; } function Se(w) { return _(w) === n; } function Ce(w) { return _(w) === b; } function Te(w) { return _(w) === m; } function Ae(w) { return _(w) === r; } function De(w) { return _(w) === i; } function _e(w) { return _(w) === o; } function qe(w) { return _(w) === u; } U.AsyncMode = y, U.ConcurrentMode = O, U.ContextConsumer = I, U.ContextProvider = P, U.Element = A, U.ForwardRef = L, U.Fragment = q, U.Lazy = B, U.Memo = G, U.Portal = Z, U.Profiler = Q, U.StrictMode = ie, U.Suspense = se, U.isAsyncMode = be, U.isConcurrentMode = pe, U.isContextConsumer = ye, U.isContextProvider = Ee, U.isElement = ce, U.isForwardRef = de, U.isFragment = Se, U.isLazy = Ce, U.isMemo = Te, U.isPortal = Ae, U.isProfiler = De, U.isStrictMode = _e, U.isSuspense = qe, U.isValidElementType = D, U.typeOf = _; }()), U; } process.env.NODE_ENV === "production" ? Cr.exports = ha() : Cr.exports = va(); var ba = Cr.exports, Yr = ba, ya = { childContextTypes: !0, contextType: !0, contextTypes: !0, defaultProps: !0, displayName: !0, getDefaultProps: !0, getDerivedStateFromError: !0, getDerivedStateFromProps: !0, mixins: !0, propTypes: !0, type: !0 }, Ea = { name: !0, length: !0, prototype: !0, caller: !0, callee: !0, arguments: !0, arity: !0 }, Sa = { $$typeof: !0, render: !0, defaultProps: !0, displayName: !0, propTypes: !0 }, li = { $$typeof: !0, compare: !0, defaultProps: !0, displayName: !0, propTypes: !0, type: !0 }, Kr = {}; Kr[Yr.ForwardRef] = Sa; Kr[Yr.Memo] = li; function Zn(e) { return Yr.isMemo(e) ? li : Kr[e.$$typeof] || ya; } var Da = Object.defineProperty, _a = Object.getOwnPropertyNames, Qn = Object.getOwnPropertySymbols, Oa = Object.getOwnPropertyDescriptor, Na = Object.getPrototypeOf, eo = Object.prototype; function ui(e, t, r) { if (typeof t != "string") { if (eo) { var n = Na(t); n && n !== eo && ui(e, n, r); } var o = _a(t); Qn && (o = o.concat(Qn(t))); for (var i = Zn(e), s = Zn(t), a = 0; a < o.length; ++a) { var c = o[a]; if (!Ea[c] && !(r && r[c]) && !(s && s[c]) && !(i && i[c])) { var d = Oa(t, c); try { Da(e, c, d); } catch { } } } } return e; } var xa = ui; const to = /* @__PURE__ */ Ks(xa); var Rr = { exports: {} }, j = {}; /** * @license React * react-is.production.min.js * * Copyright (c) Facebook, Inc.