@documedis/react-components
Version:
React components for Documedis healthcare applications - prescription signing, pharmacy selection, and more
1,450 lines (1,449 loc) • 1.49 MB
JavaScript
import { jsx as yO } from "react/jsx-runtime";
import o0, { useRef as gO, useEffect as tl, useCallback as Ld, useSyncExternalStore as II, useLayoutEffect as PI, useState as AI } from "react";
function Ur(o) {
return `Minified Redux error #${o}; visit https://redux.js.org/Errors?code=${o} for the full message or use the non-minified dev environment for full errors. `;
}
var DI = typeof Symbol == "function" && Symbol.observable || "@@observable", JT = DI, Gk = () => Math.random().toString(36).substring(7).split("").join("."), LI = {
INIT: `@@redux/INIT${/* @__PURE__ */ Gk()}`,
REPLACE: `@@redux/REPLACE${/* @__PURE__ */ Gk()}`,
PROBE_UNKNOWN_ACTION: () => `@@redux/PROBE_UNKNOWN_ACTION${Gk()}`
}, Ad = LI;
function _v(o) {
if (typeof o != "object" || o === null)
return !1;
let n = o;
for (; Object.getPrototypeOf(n) !== null; )
n = Object.getPrototypeOf(n);
return Object.getPrototypeOf(o) === n || Object.getPrototypeOf(o) === null;
}
function MI(o) {
if (o === void 0)
return "undefined";
if (o === null)
return "null";
const n = typeof o;
switch (n) {
case "boolean":
case "string":
case "number":
case "symbol":
case "function":
return n;
}
if (Array.isArray(o))
return "array";
if (zI(o))
return "date";
if (jI(o))
return "error";
const i = FI(o);
switch (i) {
case "Symbol":
case "Promise":
case "WeakMap":
case "WeakSet":
case "Map":
case "Set":
return i;
}
return Object.prototype.toString.call(o).slice(8, -1).toLowerCase().replace(/\s/g, "");
}
function FI(o) {
return typeof o.constructor == "function" ? o.constructor.name : null;
}
function jI(o) {
return o instanceof Error || typeof o.message == "string" && o.constructor && typeof o.constructor.stackTraceLimit == "number";
}
function zI(o) {
return o instanceof Date ? !0 : typeof o.toDateString == "function" && typeof o.getDate == "function" && typeof o.setDate == "function";
}
function Dc(o) {
let n = typeof o;
return process.env.NODE_ENV !== "production" && (n = MI(o)), n;
}
function vO(o, n, i) {
if (typeof o != "function")
throw new Error(process.env.NODE_ENV === "production" ? Ur(2) : `Expected the root reducer to be a function. Instead, received: '${Dc(o)}'`);
if (typeof n == "function" && typeof i == "function" || typeof i == "function" && typeof arguments[3] == "function")
throw new Error(process.env.NODE_ENV === "production" ? Ur(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 n == "function" && typeof i > "u" && (i = n, n = void 0), typeof i < "u") {
if (typeof i != "function")
throw new Error(process.env.NODE_ENV === "production" ? Ur(1) : `Expected the enhancer to be a function. Instead, received: '${Dc(i)}'`);
return i(vO)(o, n);
}
let l = o, f = n, h = /* @__PURE__ */ new Map(), y = h, w = 0, b = !1;
function k() {
y === h && (y = /* @__PURE__ */ new Map(), h.forEach((A, L) => {
y.set(L, A);
}));
}
function x() {
if (b)
throw new Error(process.env.NODE_ENV === "production" ? Ur(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 f;
}
function _(A) {
if (typeof A != "function")
throw new Error(process.env.NODE_ENV === "production" ? Ur(4) : `Expected the listener to be a function. Instead, received: '${Dc(A)}'`);
if (b)
throw new Error(process.env.NODE_ENV === "production" ? Ur(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 L = !0;
k();
const V = w++;
return y.set(V, A), function() {
if (L) {
if (b)
throw new Error(process.env.NODE_ENV === "production" ? Ur(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.");
L = !1, k(), y.delete(V), h = null;
}
};
}
function E(A) {
if (!_v(A))
throw new Error(process.env.NODE_ENV === "production" ? Ur(7) : `Actions must be plain objects. Instead, the actual type was: '${Dc(A)}'. 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 A.type > "u")
throw new Error(process.env.NODE_ENV === "production" ? Ur(8) : 'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');
if (typeof A.type != "string")
throw new Error(process.env.NODE_ENV === "production" ? Ur(17) : `Action "type" property must be a string. Instead, the actual type was: '${Dc(A.type)}'. Value was: '${A.type}' (stringified)`);
if (b)
throw new Error(process.env.NODE_ENV === "production" ? Ur(9) : "Reducers may not dispatch actions.");
try {
b = !0, f = l(f, A);
} finally {
b = !1;
}
return (h = y).forEach((L) => {
L();
}), A;
}
function T(A) {
if (typeof A != "function")
throw new Error(process.env.NODE_ENV === "production" ? Ur(10) : `Expected the nextReducer to be a function. Instead, received: '${Dc(A)}`);
l = A, E({
type: Ad.REPLACE
});
}
function N() {
const A = _;
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(L) {
if (typeof L != "object" || L === null)
throw new Error(process.env.NODE_ENV === "production" ? Ur(11) : `Expected the observer to be an object. Instead, received: '${Dc(L)}'`);
function V() {
const U = L;
U.next && U.next(x());
}
return V(), {
unsubscribe: A(V)
};
},
[JT]() {
return this;
}
};
}
return E({
type: Ad.INIT
}), {
dispatch: E,
subscribe: _,
getState: x,
replaceReducer: T,
[JT]: N
};
}
function ZT(o) {
typeof console < "u" && typeof console.error == "function" && console.error(o);
try {
throw new Error(o);
} catch {
}
}
function VI(o, n, i, l) {
const f = Object.keys(n), h = i && i.type === Ad.INIT ? "preloadedState argument passed to createStore" : "previous state received by the reducer";
if (f.length === 0)
return "Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers.";
if (!_v(o))
return `The ${h} has unexpected type of "${Dc(o)}". Expected argument to be an object with the following keys: "${f.join('", "')}"`;
const y = Object.keys(o).filter((w) => !n.hasOwnProperty(w) && !l[w]);
if (y.forEach((w) => {
l[w] = !0;
}), !(i && i.type === Ad.REPLACE) && y.length > 0)
return `Unexpected ${y.length > 1 ? "keys" : "key"} "${y.join('", "')}" found in ${h}. Expected to find one of the known reducer keys instead: "${f.join('", "')}". Unexpected keys will be ignored.`;
}
function UI(o) {
Object.keys(o).forEach((n) => {
const i = o[n];
if (typeof i(void 0, {
type: Ad.INIT
}) > "u")
throw new Error(process.env.NODE_ENV === "production" ? Ur(12) : `The slice reducer for key "${n}" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.`);
if (typeof i(void 0, {
type: Ad.PROBE_UNKNOWN_ACTION()
}) > "u")
throw new Error(process.env.NODE_ENV === "production" ? Ur(13) : `The slice reducer for key "${n}" returned undefined when probed with a random type. Don't try to handle '${Ad.INIT}' or other actions in "redux/*" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.`);
});
}
function BI(o) {
const n = Object.keys(o), i = {};
for (let y = 0; y < n.length; y++) {
const w = n[y];
process.env.NODE_ENV !== "production" && typeof o[w] > "u" && ZT(`No reducer provided for key "${w}"`), typeof o[w] == "function" && (i[w] = o[w]);
}
const l = Object.keys(i);
let f;
process.env.NODE_ENV !== "production" && (f = {});
let h;
try {
UI(i);
} catch (y) {
h = y;
}
return function(y = {}, w) {
if (h)
throw h;
if (process.env.NODE_ENV !== "production") {
const x = VI(y, i, w, f);
x && ZT(x);
}
let b = !1;
const k = {};
for (let x = 0; x < l.length; x++) {
const _ = l[x], E = i[_], T = y[_], N = E(T, w);
if (typeof N > "u") {
const A = w && w.type;
throw new Error(process.env.NODE_ENV === "production" ? Ur(14) : `When called with an action of type ${A ? `"${String(A)}"` : "(unknown type)"}, the slice reducer for key "${_}" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.`);
}
k[_] = N, b = b || N !== T;
}
return b = b || l.length !== Object.keys(y).length, b ? k : y;
};
}
function zw(...o) {
return o.length === 0 ? (n) => n : o.length === 1 ? o[0] : o.reduce((n, i) => (...l) => n(i(...l)));
}
function HI(...o) {
return (n) => (i, l) => {
const f = n(i, l);
let h = () => {
throw new Error(process.env.NODE_ENV === "production" ? Ur(15) : "Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.");
};
const y = {
getState: f.getState,
dispatch: (b, ...k) => h(b, ...k)
}, w = o.map((b) => b(y));
return h = zw(...w)(f.dispatch), {
...f,
dispatch: h
};
};
}
function bO(o) {
return _v(o) && "type" in o && typeof o.type == "string";
}
var wO = Symbol.for("immer-nothing"), e1 = Symbol.for("immer-draftable"), vi = Symbol.for("immer-state"), $I = process.env.NODE_ENV !== "production" ? [
// All error codes, starting by 0:
function(o) {
return `The plugin for '${o}' has not been loaded into Immer. To enable the plugin, import and call \`enable${o}()\` when initializing your application.`;
},
function(o) {
return `produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${o}'`;
},
"This object has been frozen and should not be mutated",
function(o) {
return "Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? " + o;
},
"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.",
"Immer forbids circular references",
"The first or second argument to `produce` must be a function",
"The third argument to `produce` must be a function or undefined",
"First argument to `createDraft` must be a plain object, an array, or an immerable object",
"First argument to `finishDraft` must be a draft returned by `createDraft`",
function(o) {
return `'current' expects a draft, got: ${o}`;
},
"Object.defineProperty() cannot be used on an Immer draft",
"Object.setPrototypeOf() cannot be used on an Immer draft",
"Immer only supports deleting array indices",
"Immer only supports setting array indices and the 'length' property",
function(o) {
return `'original' expects a draft, got: ${o}`;
}
// Note: if more errors are added, the errorOffset in Patches.ts should be increased
// See Patches.ts for additional errors
] : [];
function Go(o, ...n) {
if (process.env.NODE_ENV !== "production") {
const i = $I[o], l = typeof i == "function" ? i.apply(null, n) : i;
throw new Error(`[Immer] ${l}`);
}
throw new Error(
`[Immer] minified error nr: ${o}. Full error at: https://bit.ly/3cXEKWf`
);
}
var mv = Object.getPrototypeOf;
function Md(o) {
return !!o && !!o[vi];
}
function du(o) {
return o ? kO(o) || Array.isArray(o) || !!o[e1] || !!o.constructor?.[e1] || Tv(o) || a0(o) : !1;
}
var qI = Object.prototype.constructor.toString(), t1 = /* @__PURE__ */ new WeakMap();
function kO(o) {
if (!o || typeof o != "object")
return !1;
const n = Object.getPrototypeOf(o);
if (n === null || n === Object.prototype)
return !0;
const i = Object.hasOwnProperty.call(n, "constructor") && n.constructor;
if (i === Object)
return !0;
if (typeof i != "function")
return !1;
let l = t1.get(i);
return l === void 0 && (l = Function.toString.call(i), t1.set(i, l)), l === qI;
}
function Vw(o, n, i = !0) {
i0(o) === 0 ? (i ? Reflect.ownKeys(o) : Object.keys(o)).forEach((l) => {
n(l, o[l], o);
}) : o.forEach((l, f) => n(f, l, o));
}
function i0(o) {
const n = o[vi];
return n ? n.type_ : Array.isArray(o) ? 1 : Tv(o) ? 2 : a0(o) ? 3 : 0;
}
function jS(o, n) {
return i0(o) === 2 ? o.has(n) : Object.prototype.hasOwnProperty.call(o, n);
}
function SO(o, n, i) {
const l = i0(o);
l === 2 ? o.set(n, i) : l === 3 ? o.add(i) : o[n] = i;
}
function WI(o, n) {
return o === n ? o !== 0 || 1 / o === 1 / n : o !== o && n !== n;
}
function Tv(o) {
return o instanceof Map;
}
function a0(o) {
return o instanceof Set;
}
function Cd(o) {
return o.copy_ || o.base_;
}
function zS(o, n) {
if (Tv(o))
return new Map(o);
if (a0(o))
return new Set(o);
if (Array.isArray(o))
return Array.prototype.slice.call(o);
const i = kO(o);
if (n === !0 || n === "class_only" && !i) {
const l = Object.getOwnPropertyDescriptors(o);
delete l[vi];
let f = Reflect.ownKeys(l);
for (let h = 0; h < f.length; h++) {
const y = f[h], w = l[y];
w.writable === !1 && (w.writable = !0, w.configurable = !0), (w.get || w.set) && (l[y] = {
configurable: !0,
writable: !0,
// could live with !!desc.set as well here...
enumerable: w.enumerable,
value: o[y]
});
}
return Object.create(mv(o), l);
} else {
const l = mv(o);
if (l !== null && i)
return { ...o };
const f = Object.create(l);
return Object.assign(f, o);
}
}
function SE(o, n = !1) {
return s0(o) || Md(o) || !du(o) || (i0(o) > 1 && Object.defineProperties(o, {
set: hw,
add: hw,
clear: hw,
delete: hw
}), Object.freeze(o), n && Object.values(o).forEach((i) => SE(i, !0))), o;
}
function QI() {
Go(2);
}
var hw = {
value: QI
};
function s0(o) {
return o === null || typeof o != "object" ? !0 : Object.isFrozen(o);
}
var GI = {};
function Fd(o) {
const n = GI[o];
return n || Go(0, o), n;
}
var yv;
function EO() {
return yv;
}
function YI(o, n) {
return {
drafts_: [],
parent_: o,
immer_: n,
// Whenever the modified draft contains a draft from another scope, we
// need to prevent auto-freezing so the unowned draft can be finalized.
canAutoFreeze_: !0,
unfinalizedDrafts_: 0
};
}
function n1(o, n) {
n && (Fd("Patches"), o.patches_ = [], o.inversePatches_ = [], o.patchListener_ = n);
}
function VS(o) {
US(o), o.drafts_.forEach(XI), o.drafts_ = null;
}
function US(o) {
o === yv && (yv = o.parent_);
}
function r1(o) {
return yv = YI(yv, o);
}
function XI(o) {
const n = o[vi];
n.type_ === 0 || n.type_ === 1 ? n.revoke_() : n.revoked_ = !0;
}
function o1(o, n) {
n.unfinalizedDrafts_ = n.drafts_.length;
const i = n.drafts_[0];
return o !== void 0 && o !== i ? (i[vi].modified_ && (VS(n), Go(4)), du(o) && (o = Uw(n, o), n.parent_ || Bw(n, o)), n.patches_ && Fd("Patches").generateReplacementPatches_(
i[vi].base_,
o,
n.patches_,
n.inversePatches_
)) : o = Uw(n, i, []), VS(n), n.patches_ && n.patchListener_(n.patches_, n.inversePatches_), o !== wO ? o : void 0;
}
function Uw(o, n, i) {
if (s0(n))
return n;
const l = o.immer_.shouldUseStrictIteration(), f = n[vi];
if (!f)
return Vw(
n,
(h, y) => i1(o, f, n, h, y, i),
l
), n;
if (f.scope_ !== o)
return n;
if (!f.modified_)
return Bw(o, f.base_, !0), f.base_;
if (!f.finalized_) {
f.finalized_ = !0, f.scope_.unfinalizedDrafts_--;
const h = f.copy_;
let y = h, w = !1;
f.type_ === 3 && (y = new Set(h), h.clear(), w = !0), Vw(
y,
(b, k) => i1(
o,
f,
h,
b,
k,
i,
w
),
l
), Bw(o, h, !1), i && o.patches_ && Fd("Patches").generatePatches_(
f,
i,
o.patches_,
o.inversePatches_
);
}
return f.copy_;
}
function i1(o, n, i, l, f, h, y) {
if (f == null || typeof f != "object" && !y)
return;
const w = s0(f);
if (!(w && !y)) {
if (process.env.NODE_ENV !== "production" && f === i && Go(5), Md(f)) {
const b = h && n && n.type_ !== 3 && // Set objects are atomic since they have no keys.
!jS(n.assigned_, l) ? h.concat(l) : void 0, k = Uw(o, f, b);
if (SO(i, l, k), Md(k))
o.canAutoFreeze_ = !1;
else
return;
} else y && i.add(f);
if (du(f) && !w) {
if (!o.immer_.autoFreeze_ && o.unfinalizedDrafts_ < 1 || n && n.base_ && n.base_[l] === f && w)
return;
Uw(o, f), (!n || !n.scope_.parent_) && typeof l != "symbol" && (Tv(i) ? i.has(l) : Object.prototype.propertyIsEnumerable.call(i, l)) && Bw(o, f);
}
}
}
function Bw(o, n, i = !1) {
!o.parent_ && o.immer_.autoFreeze_ && o.canAutoFreeze_ && SE(n, i);
}
function KI(o, n) {
const i = Array.isArray(o), l = {
type_: i ? 1 : 0,
// Track which produce call this is associated with.
scope_: n ? n.scope_ : EO(),
// True for both shallow and deep changes.
modified_: !1,
// Used during finalization.
finalized_: !1,
// Track which properties have been assigned (true) or deleted (false).
assigned_: {},
// The parent draft state.
parent_: n,
// The base state.
base_: o,
// The base proxy.
draft_: null,
// set below
// The base copy with any updated values.
copy_: null,
// Called by the `produce` function.
revoke_: null,
isManual_: !1
};
let f = l, h = EE;
i && (f = [l], h = gv);
const { revoke: y, proxy: w } = Proxy.revocable(f, h);
return l.draft_ = w, l.revoke_ = y, w;
}
var EE = {
get(o, n) {
if (n === vi)
return o;
const i = Cd(o);
if (!jS(i, n))
return JI(o, i, n);
const l = i[n];
return o.finalized_ || !du(l) ? l : l === Yk(o.base_, n) ? (Xk(o), o.copy_[n] = HS(l, o)) : l;
},
has(o, n) {
return n in Cd(o);
},
ownKeys(o) {
return Reflect.ownKeys(Cd(o));
},
set(o, n, i) {
const l = _O(Cd(o), n);
if (l?.set)
return l.set.call(o.draft_, i), !0;
if (!o.modified_) {
const f = Yk(Cd(o), n), h = f?.[vi];
if (h && h.base_ === i)
return o.copy_[n] = i, o.assigned_[n] = !1, !0;
if (WI(i, f) && (i !== void 0 || jS(o.base_, n)))
return !0;
Xk(o), BS(o);
}
return o.copy_[n] === i && // special case: handle new props with value 'undefined'
(i !== void 0 || n in o.copy_) || // special case: NaN
Number.isNaN(i) && Number.isNaN(o.copy_[n]) || (o.copy_[n] = i, o.assigned_[n] = !0), !0;
},
deleteProperty(o, n) {
return Yk(o.base_, n) !== void 0 || n in o.base_ ? (o.assigned_[n] = !1, Xk(o), BS(o)) : delete o.assigned_[n], o.copy_ && delete o.copy_[n], !0;
},
// Note: We never coerce `desc.value` into an Immer draft, because we can't make
// the same guarantee in ES5 mode.
getOwnPropertyDescriptor(o, n) {
const i = Cd(o), l = Reflect.getOwnPropertyDescriptor(i, n);
return l && {
writable: !0,
configurable: o.type_ !== 1 || n !== "length",
enumerable: l.enumerable,
value: i[n]
};
},
defineProperty() {
Go(11);
},
getPrototypeOf(o) {
return mv(o.base_);
},
setPrototypeOf() {
Go(12);
}
}, gv = {};
Vw(EE, (o, n) => {
gv[o] = function() {
return arguments[0] = arguments[0][0], n.apply(this, arguments);
};
});
gv.deleteProperty = function(o, n) {
return process.env.NODE_ENV !== "production" && isNaN(parseInt(n)) && Go(13), gv.set.call(this, o, n, void 0);
};
gv.set = function(o, n, i) {
return process.env.NODE_ENV !== "production" && n !== "length" && isNaN(parseInt(n)) && Go(14), EE.set.call(this, o[0], n, i, o[0]);
};
function Yk(o, n) {
const i = o[vi];
return (i ? Cd(i) : o)[n];
}
function JI(o, n, i) {
const l = _O(n, i);
return l ? "value" in l ? l.value : (
// This is a very special case, if the prop is a getter defined by the
// prototype, we should invoke it with the draft as context!
l.get?.call(o.draft_)
) : void 0;
}
function _O(o, n) {
if (!(n in o))
return;
let i = mv(o);
for (; i; ) {
const l = Object.getOwnPropertyDescriptor(i, n);
if (l)
return l;
i = mv(i);
}
}
function BS(o) {
o.modified_ || (o.modified_ = !0, o.parent_ && BS(o.parent_));
}
function Xk(o) {
o.copy_ || (o.copy_ = zS(
o.base_,
o.scope_.immer_.useStrictShallowCopy_
));
}
var ZI = class {
constructor(o) {
this.autoFreeze_ = !0, this.useStrictShallowCopy_ = !1, this.useStrictIteration_ = !0, this.produce = (n, i, l) => {
if (typeof n == "function" && typeof i != "function") {
const h = i;
i = n;
const y = this;
return function(w = h, ...b) {
return y.produce(w, (k) => i.call(this, k, ...b));
};
}
typeof i != "function" && Go(6), l !== void 0 && typeof l != "function" && Go(7);
let f;
if (du(n)) {
const h = r1(this), y = HS(n, void 0);
let w = !0;
try {
f = i(y), w = !1;
} finally {
w ? VS(h) : US(h);
}
return n1(h, l), o1(f, h);
} else if (!n || typeof n != "object") {
if (f = i(n), f === void 0 && (f = n), f === wO && (f = void 0), this.autoFreeze_ && SE(f, !0), l) {
const h = [], y = [];
Fd("Patches").generateReplacementPatches_(n, f, h, y), l(h, y);
}
return f;
} else
Go(1, n);
}, this.produceWithPatches = (n, i) => {
if (typeof n == "function")
return (h, ...y) => this.produceWithPatches(h, (w) => n(w, ...y));
let l, f;
return [this.produce(n, i, (h, y) => {
l = h, f = y;
}), l, f];
}, typeof o?.autoFreeze == "boolean" && this.setAutoFreeze(o.autoFreeze), typeof o?.useStrictShallowCopy == "boolean" && this.setUseStrictShallowCopy(o.useStrictShallowCopy), typeof o?.useStrictIteration == "boolean" && this.setUseStrictIteration(o.useStrictIteration);
}
createDraft(o) {
du(o) || Go(8), Md(o) && (o = eP(o));
const n = r1(this), i = HS(o, void 0);
return i[vi].isManual_ = !0, US(n), i;
}
finishDraft(o, n) {
const i = o && o[vi];
(!i || !i.isManual_) && Go(9);
const { scope_: l } = i;
return n1(l, n), o1(void 0, l);
}
/**
* Pass true to automatically freeze all copies created by Immer.
*
* By default, auto-freezing is enabled.
*/
setAutoFreeze(o) {
this.autoFreeze_ = o;
}
/**
* Pass true to enable strict shallow copy.
*
* By default, immer does not copy the object descriptors such as getter, setter and non-enumrable properties.
*/
setUseStrictShallowCopy(o) {
this.useStrictShallowCopy_ = o;
}
/**
* Pass false to use faster iteration that skips non-enumerable properties
* but still handles symbols for compatibility.
*
* By default, strict iteration is enabled (includes all own properties).
*/
setUseStrictIteration(o) {
this.useStrictIteration_ = o;
}
shouldUseStrictIteration() {
return this.useStrictIteration_;
}
applyPatches(o, n) {
let i;
for (i = n.length - 1; i >= 0; i--) {
const f = n[i];
if (f.path.length === 0 && f.op === "replace") {
o = f.value;
break;
}
}
i > -1 && (n = n.slice(i + 1));
const l = Fd("Patches").applyPatches_;
return Md(o) ? l(o, n) : this.produce(
o,
(f) => l(f, n)
);
}
};
function HS(o, n) {
const i = Tv(o) ? Fd("MapSet").proxyMap_(o, n) : a0(o) ? Fd("MapSet").proxySet_(o, n) : KI(o, n);
return (n ? n.scope_ : EO()).drafts_.push(i), i;
}
function eP(o) {
return Md(o) || Go(10, o), TO(o);
}
function TO(o) {
if (!du(o) || s0(o))
return o;
const n = o[vi];
let i, l = !0;
if (n) {
if (!n.modified_)
return n.base_;
n.finalized_ = !0, i = zS(o, n.scope_.immer_.useStrictShallowCopy_), l = n.scope_.immer_.shouldUseStrictIteration();
} else
i = zS(o, !0);
return Vw(
i,
(f, h) => {
SO(i, f, TO(h));
},
l
), n && (n.finalized_ = !1), i;
}
var tP = new ZI(), xO = tP.produce;
function OO(o) {
return ({ dispatch: n, getState: i }) => (l) => (f) => typeof f == "function" ? f(n, i, o) : l(f);
}
var nP = OO(), rP = OO, oP = typeof window < "u" && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ ? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ : function() {
if (arguments.length !== 0)
return typeof arguments[0] == "object" ? zw : zw.apply(null, arguments);
}, iP = (o) => o && typeof o.match == "function";
function a1(o, n) {
function i(...l) {
if (n) {
let f = n(...l);
if (!f)
throw new Error(process.env.NODE_ENV === "production" ? Kt(0) : "prepareAction did not return an object");
return {
type: o,
payload: f.payload,
..."meta" in f && {
meta: f.meta
},
..."error" in f && {
error: f.error
}
};
}
return {
type: o,
payload: l[0]
};
}
return i.toString = () => `${o}`, i.type = o, i.match = (l) => bO(l) && l.type === o, i;
}
function aP(o) {
return typeof o == "function" && "type" in o && // hasMatchFunction only wants Matchers but I don't see the point in rewriting it
iP(o);
}
function sP(o) {
const n = o ? `${o}`.split("/") : [], i = n[n.length - 1] || "actionCreator";
return `Detected an action creator with type "${o || "unknown"}" being dispatched.
Make sure you're calling the action creator before dispatching, i.e. \`dispatch(${i}())\` instead of \`dispatch(${i})\`. This is necessary even if the action has no payload.`;
}
function lP(o = {}) {
if (process.env.NODE_ENV === "production")
return () => (i) => (l) => i(l);
const {
isActionCreator: n = aP
} = o;
return () => (i) => (l) => (n(l) && console.warn(sP(l.type)), i(l));
}
function CO(o, n) {
let i = 0;
return {
measureTime(l) {
const f = Date.now();
try {
return l();
} finally {
const h = Date.now();
i += h - f;
}
},
warnIfExceeded() {
i > o && console.warn(`${n} took ${i}ms, which is more than the warning threshold of ${o}ms.
If your state or actions are very large, you may want to disable the middleware as it might cause too much of a slowdown in development mode. See https://redux-toolkit.js.org/api/getDefaultMiddleware for instructions.
It is disabled in production builds, so you don't need to worry about that.`);
}
};
}
var RO = class ov extends Array {
constructor(...n) {
super(...n), Object.setPrototypeOf(this, ov.prototype);
}
static get [Symbol.species]() {
return ov;
}
concat(...n) {
return super.concat.apply(this, n);
}
prepend(...n) {
return n.length === 1 && Array.isArray(n[0]) ? new ov(...n[0].concat(this)) : new ov(...n.concat(this));
}
};
function s1(o) {
return du(o) ? xO(o, () => {
}) : o;
}
function mw(o, n, i) {
return o.has(n) ? o.get(n) : o.set(n, i(n)).get(n);
}
function uP(o) {
return typeof o != "object" || o == null || Object.isFrozen(o);
}
function cP(o, n, i) {
const l = NO(o, n, i);
return {
detectMutations() {
return IO(o, n, l, i);
}
};
}
function NO(o, n = [], i, l = "", f = /* @__PURE__ */ new Set()) {
const h = {
value: i
};
if (!o(i) && !f.has(i)) {
f.add(i), h.children = {};
for (const y in i) {
const w = l ? l + "." + y : y;
n.length && n.indexOf(w) !== -1 || (h.children[y] = NO(o, n, i[y], w));
}
}
return h;
}
function IO(o, n = [], i, l, f = !1, h = "") {
const y = i ? i.value : void 0, w = y === l;
if (f && !w && !Number.isNaN(l))
return {
wasMutated: !0,
path: h
};
if (o(y) || o(l))
return {
wasMutated: !1
};
const b = {};
for (let x in i.children)
b[x] = !0;
for (let x in l)
b[x] = !0;
const k = n.length > 0;
for (let x in b) {
const _ = h ? h + "." + x : x;
if (k && n.some((T) => T instanceof RegExp ? T.test(_) : _ === T))
continue;
const E = IO(o, n, i.children[x], l[x], w, _);
if (E.wasMutated)
return E;
}
return {
wasMutated: !1
};
}
function fP(o = {}) {
if (process.env.NODE_ENV === "production")
return () => (n) => (i) => n(i);
{
let n = function(w, b, k, x) {
return JSON.stringify(w, i(b, x), k);
}, i = function(w, b) {
let k = [], x = [];
return b || (b = function(_, E) {
return k[0] === E ? "[Circular ~]" : "[Circular ~." + x.slice(0, k.indexOf(E)).join(".") + "]";
}), function(_, E) {
if (k.length > 0) {
var T = k.indexOf(this);
~T ? k.splice(T + 1) : k.push(this), ~T ? x.splice(T, 1 / 0, _) : x.push(_), ~k.indexOf(E) && (E = b.call(this, _, E));
} else k.push(E);
return w == null ? E : w.call(this, _, E);
};
}, {
isImmutable: l = uP,
ignoredPaths: f,
warnAfter: h = 32
} = o;
const y = cP.bind(null, l, f);
return ({
getState: w
}) => {
let b = w(), k = y(b), x;
return (_) => (E) => {
const T = CO(h, "ImmutableStateInvariantMiddleware");
T.measureTime(() => {
if (b = w(), x = k.detectMutations(), k = y(b), x.wasMutated)
throw new Error(process.env.NODE_ENV === "production" ? Kt(19) : `A state mutation was detected between dispatches, in the path '${x.path || ""}'. This may cause incorrect behavior. (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)`);
});
const N = _(E);
return T.measureTime(() => {
if (b = w(), x = k.detectMutations(), k = y(b), x.wasMutated)
throw new Error(process.env.NODE_ENV === "production" ? Kt(20) : `A state mutation was detected inside a dispatch, in the path: ${x.path || ""}. Take a look at the reducer(s) handling the action ${n(E)}. (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)`);
}), T.warnIfExceeded(), N;
};
};
}
}
function PO(o) {
const n = typeof o;
return o == null || n === "string" || n === "boolean" || n === "number" || Array.isArray(o) || _v(o);
}
function $S(o, n = "", i = PO, l, f = [], h) {
let y;
if (!i(o))
return {
keyPath: n || "<root>",
value: o
};
if (typeof o != "object" || o === null || h?.has(o)) return !1;
const w = l != null ? l(o) : Object.entries(o), b = f.length > 0;
for (const [k, x] of w) {
const _ = n ? n + "." + k : k;
if (!(b && f.some((E) => E instanceof RegExp ? E.test(_) : _ === E))) {
if (!i(x))
return {
keyPath: _,
value: x
};
if (typeof x == "object" && (y = $S(x, _, i, l, f, h), y))
return y;
}
}
return h && AO(o) && h.add(o), !1;
}
function AO(o) {
if (!Object.isFrozen(o)) return !1;
for (const n of Object.values(o))
if (!(typeof n != "object" || n === null) && !AO(n))
return !1;
return !0;
}
function dP(o = {}) {
if (process.env.NODE_ENV === "production")
return () => (n) => (i) => n(i);
{
const {
isSerializable: n = PO,
getEntries: i,
ignoredActions: l = [],
ignoredActionPaths: f = ["meta.arg", "meta.baseQueryMeta"],
ignoredPaths: h = [],
warnAfter: y = 32,
ignoreState: w = !1,
ignoreActions: b = !1,
disableCache: k = !1
} = o, x = !k && WeakSet ? /* @__PURE__ */ new WeakSet() : void 0;
return (_) => (E) => (T) => {
if (!bO(T))
return E(T);
const N = E(T), A = CO(y, "SerializableStateInvariantMiddleware");
return !b && !(l.length && l.indexOf(T.type) !== -1) && A.measureTime(() => {
const L = $S(T, "", n, i, f, x);
if (L) {
const {
keyPath: V,
value: U
} = L;
console.error(`A non-serializable value was detected in an action, in the path: \`${V}\`. Value:`, U, `
Take a look at the logic that dispatched this action: `, T, `
(See https://redux.js.org/faq/actions#why-should-type-be-a-string-or-at-least-serializable-why-should-my-action-types-be-constants)`, `
(To allow non-serializable values see: https://redux-toolkit.js.org/usage/usage-guide#working-with-non-serializable-data)`);
}
}), w || (A.measureTime(() => {
const L = _.getState(), V = $S(L, "", n, i, h, x);
if (V) {
const {
keyPath: U,
value: ee
} = V;
console.error(`A non-serializable value was detected in the state, in the path: \`${U}\`. Value:`, ee, `
Take a look at the reducer(s) handling this action type: ${T.type}.
(See https://redux.js.org/faq/organizing-state#can-i-put-functions-promises-or-other-non-serializable-items-in-my-store-state)`);
}
}), A.warnIfExceeded()), N;
};
}
}
function yw(o) {
return typeof o == "boolean";
}
var pP = () => function(o) {
const {
thunk: n = !0,
immutableCheck: i = !0,
serializableCheck: l = !0,
actionCreatorCheck: f = !0
} = o ?? {};
let h = new RO();
if (n && (yw(n) ? h.push(nP) : h.push(rP(n.extraArgument))), process.env.NODE_ENV !== "production") {
if (i) {
let y = {};
yw(i) || (y = i), h.unshift(fP(y));
}
if (l) {
let y = {};
yw(l) || (y = l), h.push(dP(y));
}
if (f) {
let y = {};
yw(f) || (y = f), h.unshift(lP(y));
}
}
return h;
}, hP = "RTK_autoBatch", l1 = (o) => (n) => {
setTimeout(n, o);
}, mP = (o = {
type: "raf"
}) => (n) => (...i) => {
const l = n(...i);
let f = !0, h = !1, y = !1;
const w = /* @__PURE__ */ new Set(), b = o.type === "tick" ? queueMicrotask : o.type === "raf" ? (
// requestAnimationFrame won't exist in SSR environments. Fall back to a vague approximation just to keep from erroring.
typeof window < "u" && window.requestAnimationFrame ? window.requestAnimationFrame : l1(10)
) : o.type === "callback" ? o.queueNotification : l1(o.timeout), k = () => {
y = !1, h && (h = !1, w.forEach((x) => x()));
};
return Object.assign({}, l, {
// Override the base `store.subscribe` method to keep original listeners
// from running if we're delaying notifications
subscribe(x) {
const _ = () => f && x(), E = l.subscribe(_);
return w.add(x), () => {
E(), w.delete(x);
};
},
// Override the base `store.dispatch` method so that we can check actions
// for the `shouldAutoBatch` flag and determine if batching is active
dispatch(x) {
try {
return f = !x?.meta?.[hP], h = !f, h && (y || (y = !0, b(k))), l.dispatch(x);
} finally {
f = !0;
}
}
});
}, yP = (o) => function(n) {
const {
autoBatch: i = !0
} = n ?? {};
let l = new RO(o);
return i && l.push(mP(typeof i == "object" ? i : void 0)), l;
};
function gP(o) {
const n = pP(), {
reducer: i = void 0,
middleware: l,
devTools: f = !0,
duplicateMiddlewareCheck: h = !0,
preloadedState: y = void 0,
enhancers: w = void 0
} = o || {};
let b;
if (typeof i == "function")
b = i;
else if (_v(i))
b = BI(i);
else
throw new Error(process.env.NODE_ENV === "production" ? Kt(1) : "`reducer` is a required argument, and must be a function or an object of functions that can be passed to combineReducers");
if (process.env.NODE_ENV !== "production" && l && typeof l != "function")
throw new Error(process.env.NODE_ENV === "production" ? Kt(2) : "`middleware` field must be a callback");
let k;
if (typeof l == "function") {
if (k = l(n), process.env.NODE_ENV !== "production" && !Array.isArray(k))
throw new Error(process.env.NODE_ENV === "production" ? Kt(3) : "when using a middleware builder function, an array of middleware must be returned");
} else
k = n();
if (process.env.NODE_ENV !== "production" && k.some((A) => typeof A != "function"))
throw new Error(process.env.NODE_ENV === "production" ? Kt(4) : "each middleware provided to configureStore must be a function");
if (process.env.NODE_ENV !== "production" && h) {
let A = /* @__PURE__ */ new Set();
k.forEach((L) => {
if (A.has(L))
throw new Error(process.env.NODE_ENV === "production" ? Kt(42) : "Duplicate middleware references found when creating the store. Ensure that each middleware is only included once.");
A.add(L);
});
}
let x = zw;
f && (x = oP({
// Enable capture of stack traces for dispatched Redux actions
trace: process.env.NODE_ENV !== "production",
...typeof f == "object" && f
}));
const _ = HI(...k), E = yP(_);
if (process.env.NODE_ENV !== "production" && w && typeof w != "function")
throw new Error(process.env.NODE_ENV === "production" ? Kt(5) : "`enhancers` field must be a callback");
let T = typeof w == "function" ? w(E) : E();
if (process.env.NODE_ENV !== "production" && !Array.isArray(T))
throw new Error(process.env.NODE_ENV === "production" ? Kt(6) : "`enhancers` callback must return an array");
if (process.env.NODE_ENV !== "production" && T.some((A) => typeof A != "function"))
throw new Error(process.env.NODE_ENV === "production" ? Kt(7) : "each enhancer provided to configureStore must be a function");
process.env.NODE_ENV !== "production" && k.length && !T.includes(_) && console.error("middlewares were provided, but middleware enhancer was not included in final enhancers - make sure to call `getDefaultEnhancers`");
const N = x(...T);
return vO(b, y, N);
}
function DO(o) {
const n = {}, i = [];
let l;
const f = {
addCase(h, y) {
if (process.env.NODE_ENV !== "production") {
if (i.length > 0)
throw new Error(process.env.NODE_ENV === "production" ? Kt(26) : "`builder.addCase` should only be called before calling `builder.addMatcher`");
if (l)
throw new Error(process.env.NODE_ENV === "production" ? Kt(27) : "`builder.addCase` should only be called before calling `builder.addDefaultCase`");
}
const w = typeof h == "string" ? h : h.type;
if (!w)
throw new Error(process.env.NODE_ENV === "production" ? Kt(28) : "`builder.addCase` cannot be called with an empty action type");
if (w in n)
throw new Error(process.env.NODE_ENV === "production" ? Kt(29) : `\`builder.addCase\` cannot be called with two reducers for the same action type '${w}'`);
return n[w] = y, f;
},
addAsyncThunk(h, y) {
if (process.env.NODE_ENV !== "production" && l)
throw new Error(process.env.NODE_ENV === "production" ? Kt(43) : "`builder.addAsyncThunk` should only be called before calling `builder.addDefaultCase`");
return y.pending && (n[h.pending.type] = y.pending), y.rejected && (n[h.rejected.type] = y.rejected), y.fulfilled && (n[h.fulfilled.type] = y.fulfilled), y.settled && i.push({
matcher: h.settled,
reducer: y.settled
}), f;
},
addMatcher(h, y) {
if (process.env.NODE_ENV !== "production" && l)
throw new Error(process.env.NODE_ENV === "production" ? Kt(30) : "`builder.addMatcher` should only be called before calling `builder.addDefaultCase`");
return i.push({
matcher: h,
reducer: y
}), f;
},
addDefaultCase(h) {
if (process.env.NODE_ENV !== "production" && l)
throw new Error(process.env.NODE_ENV === "production" ? Kt(31) : "`builder.addDefaultCase` can only be called once");
return l = h, f;
}
};
return o(f), [n, i, l];
}
function vP(o) {
return typeof o == "function";
}
function bP(o, n) {
if (process.env.NODE_ENV !== "production" && typeof n == "object")
throw new Error(process.env.NODE_ENV === "production" ? Kt(8) : "The object notation for `createReducer` has been removed. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createReducer");
let [i, l, f] = DO(n), h;
if (vP(o))
h = () => s1(o());
else {
const w = s1(o);
h = () => w;
}
function y(w = h(), b) {
let k = [i[b.type], ...l.filter(({
matcher: x
}) => x(b)).map(({
reducer: x
}) => x)];
return k.filter((x) => !!x).length === 0 && (k = [f]), k.reduce((x, _) => {
if (_)
if (Md(x)) {
const E = _(x, b);
return E === void 0 ? x : E;
} else {
if (du(x))
return xO(x, (E) => _(E, b));
{
const E = _(x, b);
if (E === void 0) {
if (x === null)
return x;
throw Error("A case reducer on a non-draftable value must not return undefined");
}
return E;
}
}
return x;
}, w);
}
return y.getInitialState = h, y;
}
var wP = /* @__PURE__ */ Symbol.for("rtk-slice-createasyncthunk");
function kP(o, n) {
return `${o}/${n}`;
}
function SP({
creators: o
} = {}) {
const n = o?.asyncThunk?.[wP];
return function(i) {
const {
name: l,
reducerPath: f = l
} = i;
if (!l)
throw new Error(process.env.NODE_ENV === "production" ? Kt(11) : "`name` is a required option for createSlice");
typeof process < "u" && process.env.NODE_ENV === "development" && i.initialState === void 0 && console.error("You must provide an `initialState` value that is not `undefined`. You may have misspelled `initialState`");
const h = (typeof i.reducers == "function" ? i.reducers(TP()) : i.reducers) || {}, y = Object.keys(h), w = {
sliceCaseReducersByName: {},
sliceCaseReducersByType: {},
actionCreators: {},
sliceMatchers: []
}, b = {
addCase(U, ee) {
const G = typeof U == "string" ? U : U.type;
if (!G)
throw new Error(process.env.NODE_ENV === "production" ? Kt(12) : "`context.addCase` cannot be called with an empty action type");
if (G in w.sliceCaseReducersByType)
throw new Error(process.env.NODE_ENV === "production" ? Kt(13) : "`context.addCase` cannot be called with two reducers for the same action type: " + G);
return w.sliceCaseReducersByType[G] = ee, b;
},
addMatcher(U, ee) {
return w.sliceMatchers.push({
matcher: U,
reducer: ee
}), b;
},
exposeAction(U, ee) {
return w.actionCreators[U] = ee, b;
},
exposeCaseReducer(U, ee) {
return w.sliceCaseReducersByName[U] = ee, b;
}
};
y.forEach((U) => {
const ee = h[U], G = {
reducerName: U,
type: kP(l, U),
createNotation: typeof i.reducers == "function"
};
OP(ee) ? RP(G, ee, b, n) : xP(G, ee, b);
});
function k() {
if (process.env.NODE_ENV !== "production" && typeof i.extraReducers == "object")
throw new Error(process.env.NODE_ENV === "production" ? Kt(14) : "The object notation for `createSlice.extraReducers` has been removed. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createSlice");
const [U = {}, ee = [], G = void 0] = typeof i.extraReducers == "function" ? DO(i.extraReducers) : [i.extraReducers], re = {
...U,
...w.sliceCaseReducersByType
};
return bP(i.initialState, (pe) => {
for (let Se in re)
pe.addCase(Se, re[Se]);
for (let Se of w.sliceMatchers)
pe.addMatcher(Se.matcher, Se.reducer);
for (let Se of ee)
pe.addMatcher(Se.matcher, Se.reducer);
G && pe.addDefaultCase(G);
});
}
const x = (U) => U, _ = /* @__PURE__ */ new Map(), E = /* @__PURE__ */ new WeakMap();
let T;
function N(U, ee) {
return T || (T = k()), T(U, ee);
}
function A() {
return T || (T = k()), T.getInitialState();
}
function L(U, ee = !1) {
function G(pe) {
let Se = pe[U];
if (typeof Se > "u") {
if (ee)
Se = mw(E, G, A);
else if (process.env.NODE_ENV !== "production")
throw new Error(process.env.NODE_ENV === "production" ? Kt(15) : "selectSlice returned undefined for an uninjected slice reducer");
}
return Se;
}
function re(pe = x) {
const Se = mw(_, ee, () => /* @__PURE__ */ new WeakMap());
return mw(Se, pe, () => {
const Je = {};
for (const [Ie, Ye] of Object.entries(i.selectors ?? {}))
Je[Ie] = EP(Ye, pe, () => mw(E, pe, A), ee);
return Je;
});
}
return {
reducerPath: U,
getSelectors: re,
get selectors() {
return re(G);
},
selectSlice: G
};
}
const V = {
name: l,
reducer: N,
actions: w.actionCreators,
caseReducers: w.sliceCaseReducersByName,
getInitialState: A,
...L(f),
injectInto(U, {
reducerPath: ee,
...G
} = {}) {
const re = ee ?? f;
return U.inject({
reducerPath: re,
reducer: N
}, G), {
...V,
...L(re, !0)
};
}
};
return V;
};
}
function EP(o, n, i, l) {
function f(h, ...y) {
let w = n(h);
if (typeof w > "u") {
if (l)
w = i();
else if (process.env.NODE_ENV !== "production")
throw new Error(process.env.NODE_ENV === "production" ? Kt(16) : "selectState returned undefined for an uninjected slice reducer");
}
return o(w, ...y);
}
return f.unwrapped = o, f;
}
var _P = /* @__PURE__ */ SP();
function TP() {
function o(n, i) {
return {
_reducerDefinitionType: "asyncThunk",
payloadCreator: n,
...i
};
}
return o.withTypes = () => o, {
reducer(n) {
return Object.assign({
// hack so the wrapping function has the same name as the original
// we need to create a wrapper so the `reducerDefinitionType` is not assigned to the original
[n.name](...i) {
return n(...i);
}
}[n.name], {
_reducerDefinitionType: "reducer"
/* reducer */
});
},
preparedReducer(n, i) {
return {
_reducerDefinitionType: "reducerWithPrepare",
prepare: n,
reducer: i
};
},
asyncThunk: o
};
}
function xP({
type: o,
reducerName: n,
createNotation: i
}, l, f) {
let h, y;
if ("reducer" in l) {
if (i && !CP(l))
throw new Error(process.env.NODE_ENV === "production" ? Kt(17) : "Please use the `create.preparedReducer` notation for prepared action creators with the `create` notation.");
h = l.reducer, y = l.prepare;
} else
h = l;
f.addCase(o, h).exposeCaseReducer(n, h).exposeAction(n, y ? a1(o, y) : a1(o));
}
function OP(o) {
return o._reducerDefinitionType === "asyncThunk";
}
function CP(o) {
return o._reducerDefinitionType === "reducerWithPrepare";
}
function RP({
type: o,
reducerName: n
}, i, l, f) {
if (!f)
throw new Error(process.env.NODE_ENV === "production" ? Kt(18) : "Cannot use `create.asyncThunk` in the built-in `createSlice`. Use `buildCreateSlice({ creators: { asyncThunk: asyncThunkCreator } })` to create a customised version of `createSlice`.");
const {
payloadCreator: h,
fulfilled: y,
pending: w,
rejected: b,
settled: k,
options: x
} = i, _ = f(o, h, x);
l.exposeAction(n, _), y && l.addCase(_.fulfilled, y), w && l.addCase(_.pending, w), b && l.addCase(_.rejected, b), k && l.addMatcher(_.settled, k), l.exposeCaseReducer(n, {
fulfilled: y || gw,
pending: w || gw,
rejected: b || gw,
settled: k || gw
});
}
function gw() {
}
function Kt(o) {
return `Minified Redux Toolkit error #${o}; visit https://redux-toolkit.js.org/Errors?code=${o} for the full message or use the non-minified dev environment for full errors. `;
}
const NP = {
local: "https://localhost:52247/api/graphql",
int: "https://int.apps.documedis.ch/api/graphql",
demo: "https://demo.apps.documedis.ch/api/graphql",
prod: "https://apps.documedis.ch/api/graphql"
};
function IP(o) {
return NP[o];
}
function Cw(o, n) {
throw new Error(n);
}
function PP(o) {
return typeof o == "object" && o !== null;
}
function AP(o, n) {
throw new Error(
"Unexpected invariant triggered."