@m4l/core 2.0.7 → 2.0.9-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/contexts/AuthContext/{index-Dmmn1GmI.js → AuthContext.js} +38 -37
  2. package/contexts/AuthContext/constants.js +4 -0
  3. package/contexts/AuthContext/index.js +1 -0
  4. package/contexts/AuthContext/types.d.ts +6 -6
  5. package/contexts/BaseContext/types.d.ts +1 -1
  6. package/contexts/DomainContext/{index-GtnXeXqv.js → index.js} +5 -5
  7. package/contexts/DomainContext/types.d.ts +1 -1
  8. package/contexts/DomainCountryContext/{index-i1cLdKpa.js → index.js} +3 -3
  9. package/contexts/EnvironmentContext/types.d.ts +1 -1
  10. package/contexts/FlagsContext/index.js +14 -0
  11. package/contexts/FlagsContext/store.d.ts +1 -1
  12. package/contexts/FlagsContext/store.js +27 -0
  13. package/contexts/FlagsContext/types.d.ts +1 -1
  14. package/contexts/HostToolsContext/types.d.ts +1 -1
  15. package/contexts/ModuleDictionaryContext/{index-B_ZNLNhp.js → index.js} +16 -14
  16. package/contexts/ModulePrivilegesContext/{index-Ccm23KLv.js → index.js} +4 -4
  17. package/contexts/ModuleSkeletonContext/{index-op94InUL.js → index.js} +1 -1
  18. package/contexts/NetworkContext/{index-BdJ5VM1I.js → index.js} +7 -7
  19. package/contexts/NetworkContext/types.d.ts +2 -2
  20. package/contexts/index.js +1 -0
  21. package/hooks/index.js +1 -0
  22. package/hooks/useAuth/index.js +1 -0
  23. package/hooks/useAuth/useAuth.js +11 -0
  24. package/hooks/useBase/index.js +11 -0
  25. package/hooks/useDomain/index.js +11 -0
  26. package/hooks/useDomainCountry/index.js +11 -0
  27. package/hooks/useEnvironment/index.js +11 -0
  28. package/hooks/useFlagsStore/index.js +20 -0
  29. package/hooks/useHostTools/index.js +11 -0
  30. package/hooks/useLocalStorage/index.js +23 -0
  31. package/hooks/useLocalStorageWithListener/index.d.ts +1 -1
  32. package/hooks/useLocalStorageWithListener/index.js +33 -0
  33. package/hooks/useModuleDictionary/{index-BUUV7OWG.js → index.js} +1 -1
  34. package/hooks/useModulePrivileges/{index-DCvSiJ_1.js → index.js} +1 -1
  35. package/hooks/useModuleSkeleton/{index-CGP_hVSJ.js → index.js} +1 -1
  36. package/hooks/useNetwork/index.js +11 -0
  37. package/hooks/usePaginate/{index-BTDulhEo.js → index.js} +23 -27
  38. package/hooks/usePaginate/types.js +8 -0
  39. package/hooks/usePropageteMF/{index-BqiRJLJL.js → index.js} +1 -1
  40. package/index.js +50 -43
  41. package/package.json +28 -13
  42. package/types/dictionary.d.ts +1 -1
  43. package/types/index.d.ts +12 -11
  44. package/utils/{axiosOperation-CEky_K0E.js → axiosOperation/index.js} +1 -1
  45. package/utils/axiosOperation/types.d.ts +2 -2
  46. package/utils/evaluateWithContext/index.js +11 -0
  47. package/utils/getLocalStorage/index.js +11 -0
  48. package/utils/getPropertyByString/index.d.ts +1 -1
  49. package/utils/getPropertyByString/index.js +26 -0
  50. package/utils/index.js +1 -0
  51. package/utils/setLocalStorage/index.js +16 -0
  52. package/utils/voidFunction.js +5 -0
  53. package/vite-env.d.ts +4 -4
  54. package/contexts/FlagsContext/index-B-2B4Igz.js +0 -36
  55. package/hooks/useAuth/index-nEcvoYpH.js +0 -10
  56. package/hooks/useBase/index-D-4p1Xgw.js +0 -10
  57. package/hooks/useDomain/index-KteEl45C.js +0 -17
  58. package/hooks/useEnvironment/index-AJ50P5z7.js +0 -10
  59. package/hooks/useFlagsStore/index-C0OfnwSn.js +0 -19
  60. package/hooks/useHostTools/index-B20cHM5K.js +0 -10
  61. package/hooks/useLocalStorage/index-CsLmjbAr.js +0 -53
  62. package/hooks/useNetwork/index-Dr3i8fXz.js +0 -10
  63. package/node_modules-C59GSzS1.js +0 -377
  64. package/utils/index-C67J5HEa.js +0 -61
  65. /package/contexts/BaseContext/{index-DNyrnDVT.js → index.js} +0 -0
  66. /package/contexts/EnvironmentContext/{index-Ba_eINub.js → index.js} +0 -0
  67. /package/contexts/HostToolsContext/{index-Djz-c1-2.js → index.js} +0 -0
  68. /package/types/{index-TbOJOhBX.js → index.js} +0 -0
@@ -1,53 +0,0 @@
1
- import { useState as a, useEffect as g } from "react";
2
- function S(o, e) {
3
- const [n, s] = a(() => {
4
- try {
5
- const t = window.localStorage.getItem(o);
6
- return t !== null ? typeof e == "string" ? t : JSON.parse(t) : e;
7
- } catch {
8
- return e;
9
- }
10
- });
11
- return [n, (t) => {
12
- try {
13
- window.localStorage.setItem(
14
- o,
15
- typeof e == "string" ? String(t) : JSON.stringify(t)
16
- ), s(t);
17
- } catch {
18
- }
19
- }];
20
- }
21
- function u(o, e) {
22
- const [n, s] = a(() => {
23
- try {
24
- const t = localStorage.getItem(o);
25
- return t !== null ? typeof e == "string" ? t : JSON.parse(t) : e;
26
- } catch {
27
- return e;
28
- }
29
- });
30
- return g(() => {
31
- const t = (r) => {
32
- if (r.storageArea === localStorage && r.key === o)
33
- try {
34
- r.newValue && s(typeof e == "string" ? r.newValue : JSON.parse(r.newValue));
35
- } catch {
36
- }
37
- };
38
- return window.addEventListener("storage", t), () => {
39
- window.removeEventListener("storage", t);
40
- };
41
- }, [o, e]), [n, (t) => {
42
- let r;
43
- if (typeof t == "function")
44
- throw Error("Funcions are not allowed in useLocalStorageWithListener");
45
- if (typeof t != typeof e)
46
- throw Error("Not allowed change type from initial value");
47
- typeof t == "string" ? r = t : r = JSON.stringify(t), localStorage.setItem(o, r), s(t);
48
- }];
49
- }
50
- export {
51
- S as a,
52
- u
53
- };
@@ -1,10 +0,0 @@
1
- import { useContext as e } from "react";
2
- import { N as o } from "../../contexts/NetworkContext/index-BdJ5VM1I.js";
3
- const s = () => {
4
- const t = e(o);
5
- if (!t) throw new Error("useNetwork context must be use inside NetworkContext");
6
- return t;
7
- };
8
- export {
9
- s as u
10
- };
@@ -1,377 +0,0 @@
1
- function s(e) {
2
- for (var t = arguments.length, r = Array(t > 1 ? t - 1 : 0), n = 1; n < t; n++) r[n - 1] = arguments[n];
3
- if (process.env.NODE_ENV !== "production") {
4
- var o = ve[e], i = o ? typeof o == "function" ? o.apply(null, r) : o : "unknown error nr: " + e;
5
- throw Error("[Immer] " + i);
6
- }
7
- throw Error("[Immer] minified error nr: " + e + (r.length ? " " + r.map(function(u) {
8
- return "'" + u + "'";
9
- }).join(",") : "") + ". Find the full error at: https://bit.ly/3cXEKWf");
10
- }
11
- function O(e) {
12
- return !!e && !!e[p];
13
- }
14
- function b(e) {
15
- var t;
16
- return !!e && (function(r) {
17
- if (!r || typeof r != "object") return !1;
18
- var n = Object.getPrototypeOf(r);
19
- if (n === null) return !0;
20
- var o = Object.hasOwnProperty.call(n, "constructor") && n.constructor;
21
- return o === Object || typeof o == "function" && Function.toString.call(o) === he;
22
- }(e) || Array.isArray(e) || !!e[ne] || !!(!((t = e.constructor) === null || t === void 0) && t[ne]) || V(e) || U(e));
23
- }
24
- function S(e, t, r) {
25
- r === void 0 && (r = !1), w(e) === 0 ? (r ? Object.keys : q)(e).forEach(function(n) {
26
- r && typeof n == "symbol" || t(n, e[n], e);
27
- }) : e.forEach(function(n, o) {
28
- return t(o, n, e);
29
- });
30
- }
31
- function w(e) {
32
- var t = e[p];
33
- return t ? t.i > 3 ? t.i - 4 : t.i : Array.isArray(e) ? 1 : V(e) ? 2 : U(e) ? 3 : 0;
34
- }
35
- function F(e, t) {
36
- return w(e) === 2 ? e.has(t) : Object.prototype.hasOwnProperty.call(e, t);
37
- }
38
- function fe(e, t) {
39
- return w(e) === 2 ? e.get(t) : e[t];
40
- }
41
- function oe(e, t, r) {
42
- var n = w(e);
43
- n === 2 ? e.set(t, r) : n === 3 ? e.add(r) : e[t] = r;
44
- }
45
- function ce(e, t) {
46
- return e === t ? e !== 0 || 1 / e == 1 / t : e != e && t != t;
47
- }
48
- function V(e) {
49
- return de && e instanceof Map;
50
- }
51
- function U(e) {
52
- return ye && e instanceof Set;
53
- }
54
- function m(e) {
55
- return e.o || e.t;
56
- }
57
- function W(e) {
58
- if (Array.isArray(e)) return Array.prototype.slice.call(e);
59
- var t = me(e);
60
- delete t[p];
61
- for (var r = q(t), n = 0; n < r.length; n++) {
62
- var o = r[n], i = t[o];
63
- i.writable === !1 && (i.writable = !0, i.configurable = !0), (i.get || i.set) && (t[o] = { configurable: !0, writable: !0, enumerable: i.enumerable, value: e[o] });
64
- }
65
- return Object.create(Object.getPrototypeOf(e), t);
66
- }
67
- function $(e, t) {
68
- return t === void 0 && (t = !1), G(e) || O(e) || !b(e) || (w(e) > 1 && (e.set = e.add = e.clear = e.delete = se), Object.freeze(e), t && S(e, function(r, n) {
69
- return $(n, !0);
70
- }, !0)), e;
71
- }
72
- function se() {
73
- s(2);
74
- }
75
- function G(e) {
76
- return e == null || typeof e != "object" || Object.isFrozen(e);
77
- }
78
- function v(e) {
79
- var t = be[e];
80
- return t || s(18, e), t;
81
- }
82
- function Q() {
83
- return process.env.NODE_ENV === "production" || P || s(0), P;
84
- }
85
- function k(e, t) {
86
- t && (v("Patches"), e.u = [], e.s = [], e.v = t);
87
- }
88
- function j(e) {
89
- M(e), e.p.forEach(le), e.p = null;
90
- }
91
- function M(e) {
92
- e === P && (P = e.l);
93
- }
94
- function Y(e) {
95
- return P = { p: [], l: P, h: e, m: !0, _: 0 };
96
- }
97
- function le(e) {
98
- var t = e[p];
99
- t.i === 0 || t.i === 1 ? t.j() : t.g = !0;
100
- }
101
- function A(e, t) {
102
- t._ = t.p.length;
103
- var r = t.p[0], n = e !== void 0 && e !== r;
104
- return t.h.O || v("ES5").S(t, e, n), n ? (r[p].P && (j(t), s(4)), b(e) && (e = I(t, e), t.l || _(t, e)), t.u && v("Patches").M(r[p].t, e, t.u, t.s)) : e = I(t, r, []), j(t), t.u && t.v(t.u, t.s), e !== ie ? e : void 0;
105
- }
106
- function I(e, t, r) {
107
- if (G(t)) return t;
108
- var n = t[p];
109
- if (!n) return S(t, function(a, c) {
110
- return Z(e, n, t, a, c, r);
111
- }, !0), t;
112
- if (n.A !== e) return t;
113
- if (!n.P) return _(e, n.t, !0), n.t;
114
- if (!n.I) {
115
- n.I = !0, n.A._--;
116
- var o = n.i === 4 || n.i === 5 ? n.o = W(n.k) : n.o, i = o, u = !1;
117
- n.i === 3 && (i = new Set(o), o.clear(), u = !0), S(i, function(a, c) {
118
- return Z(e, n, o, a, c, r, u);
119
- }), _(e, o, !1), r && e.u && v("Patches").N(n, r, e.u, e.s);
120
- }
121
- return n.o;
122
- }
123
- function Z(e, t, r, n, o, i, u) {
124
- if (process.env.NODE_ENV !== "production" && o === r && s(5), O(o)) {
125
- var a = I(e, o, i && t && t.i !== 3 && !F(t.R, n) ? i.concat(n) : void 0);
126
- if (oe(r, n, a), !O(a)) return;
127
- e.m = !1;
128
- } else u && r.add(o);
129
- if (b(o) && !G(o)) {
130
- if (!e.h.D && e._ < 1) return;
131
- I(e, o), t && t.A.l || _(e, o);
132
- }
133
- }
134
- function _(e, t, r) {
135
- r === void 0 && (r = !1), !e.l && e.h.D && e.m && $(t, r);
136
- }
137
- function z(e, t) {
138
- var r = e[p];
139
- return (r ? m(r) : e)[t];
140
- }
141
- function B(e, t) {
142
- if (t in e) for (var r = Object.getPrototypeOf(e); r; ) {
143
- var n = Object.getOwnPropertyDescriptor(r, t);
144
- if (n) return n;
145
- r = Object.getPrototypeOf(r);
146
- }
147
- }
148
- function T(e) {
149
- e.P || (e.P = !0, e.l && T(e.l));
150
- }
151
- function R(e) {
152
- e.o || (e.o = W(e.t));
153
- }
154
- function C(e, t, r) {
155
- var n = V(t) ? v("MapSet").F(t, r) : U(t) ? v("MapSet").T(t, r) : e.O ? function(o, i) {
156
- var u = Array.isArray(o), a = { i: u ? 1 : 0, A: i ? i.A : Q(), P: !1, I: !1, R: {}, l: i, t: o, k: null, o: null, j: null, C: !1 }, c = a, f = K;
157
- u && (c = [a], f = N);
158
- var l = Proxy.revocable(c, f), g = l.revoke, y = l.proxy;
159
- return a.k = y, a.j = g, y;
160
- }(t, r) : v("ES5").J(t, r);
161
- return (r ? r.A : Q()).p.push(n), n;
162
- }
163
- function pe(e) {
164
- return O(e) || s(22, e), function t(r) {
165
- if (!b(r)) return r;
166
- var n, o = r[p], i = w(r);
167
- if (o) {
168
- if (!o.P && (o.i < 4 || !v("ES5").K(o))) return o.t;
169
- o.I = !0, n = ee(r, i), o.I = !1;
170
- } else n = ee(r, i);
171
- return S(n, function(u, a) {
172
- o && fe(o.t, u) === a || oe(n, u, t(a));
173
- }), i === 3 ? new Set(n) : n;
174
- }(e);
175
- }
176
- function ee(e, t) {
177
- switch (t) {
178
- case 2:
179
- return new Map(e);
180
- case 3:
181
- return Array.from(e);
182
- }
183
- return W(e);
184
- }
185
- var te, P, X = typeof Symbol < "u" && typeof Symbol("x") == "symbol", de = typeof Map < "u", ye = typeof Set < "u", re = typeof Proxy < "u" && Proxy.revocable !== void 0 && typeof Reflect < "u", ie = X ? Symbol.for("immer-nothing") : ((te = {})["immer-nothing"] = !0, te), ne = X ? Symbol.for("immer-draftable") : "__$immer_draftable", p = X ? Symbol.for("immer-state") : "__$immer_state", ve = { 0: "Illegal state", 1: "Immer drafts cannot have computed properties", 2: "This object has been frozen and should not be mutated", 3: function(e) {
186
- return "Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? " + e;
187
- }, 4: "An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.", 5: "Immer forbids circular references", 6: "The first or second argument to `produce` must be a function", 7: "The third argument to `produce` must be a function or undefined", 8: "First argument to `createDraft` must be a plain object, an array, or an immerable object", 9: "First argument to `finishDraft` must be a draft returned by `createDraft`", 10: "The given draft is already finalized", 11: "Object.defineProperty() cannot be used on an Immer draft", 12: "Object.setPrototypeOf() cannot be used on an Immer draft", 13: "Immer only supports deleting array indices", 14: "Immer only supports setting array indices and the 'length' property", 15: function(e) {
188
- return "Cannot apply patch, path doesn't resolve: " + e;
189
- }, 16: 'Sets cannot have "replace" patches.', 17: function(e) {
190
- return "Unsupported patch operation: " + e;
191
- }, 18: function(e) {
192
- return "The plugin for '" + e + "' has not been loaded into Immer. To enable the plugin, import and call `enable" + e + "()` when initializing your application.";
193
- }, 20: "Cannot use proxies if Proxy, Proxy.revocable or Reflect are not available", 21: function(e) {
194
- 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 '" + e + "'";
195
- }, 22: function(e) {
196
- return "'current' expects a draft, got: " + e;
197
- }, 23: function(e) {
198
- return "'original' expects a draft, got: " + e;
199
- }, 24: "Patching reserved attributes like __proto__, prototype and constructor is not allowed" }, he = "" + Object.prototype.constructor, q = typeof Reflect < "u" && Reflect.ownKeys ? Reflect.ownKeys : Object.getOwnPropertySymbols !== void 0 ? function(e) {
200
- return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e));
201
- } : Object.getOwnPropertyNames, me = Object.getOwnPropertyDescriptors || function(e) {
202
- var t = {};
203
- return q(e).forEach(function(r) {
204
- t[r] = Object.getOwnPropertyDescriptor(e, r);
205
- }), t;
206
- }, be = {}, K = { get: function(e, t) {
207
- if (t === p) return e;
208
- var r = m(e);
209
- if (!F(r, t)) return function(o, i, u) {
210
- var a, c = B(i, u);
211
- return c ? "value" in c ? c.value : (a = c.get) === null || a === void 0 ? void 0 : a.call(o.k) : void 0;
212
- }(e, r, t);
213
- var n = r[t];
214
- return e.I || !b(n) ? n : n === z(e.t, t) ? (R(e), e.o[t] = C(e.A.h, n, e)) : n;
215
- }, has: function(e, t) {
216
- return t in m(e);
217
- }, ownKeys: function(e) {
218
- return Reflect.ownKeys(m(e));
219
- }, set: function(e, t, r) {
220
- var n = B(m(e), t);
221
- if (n?.set) return n.set.call(e.k, r), !0;
222
- if (!e.P) {
223
- var o = z(m(e), t), i = o?.[p];
224
- if (i && i.t === r) return e.o[t] = r, e.R[t] = !1, !0;
225
- if (ce(r, o) && (r !== void 0 || F(e.t, t))) return !0;
226
- R(e), T(e);
227
- }
228
- return e.o[t] === r && (r !== void 0 || t in e.o) || Number.isNaN(r) && Number.isNaN(e.o[t]) || (e.o[t] = r, e.R[t] = !0), !0;
229
- }, deleteProperty: function(e, t) {
230
- return z(e.t, t) !== void 0 || t in e.t ? (e.R[t] = !1, R(e), T(e)) : delete e.R[t], e.o && delete e.o[t], !0;
231
- }, getOwnPropertyDescriptor: function(e, t) {
232
- var r = m(e), n = Reflect.getOwnPropertyDescriptor(r, t);
233
- return n && { writable: !0, configurable: e.i !== 1 || t !== "length", enumerable: n.enumerable, value: r[t] };
234
- }, defineProperty: function() {
235
- s(11);
236
- }, getPrototypeOf: function(e) {
237
- return Object.getPrototypeOf(e.t);
238
- }, setPrototypeOf: function() {
239
- s(12);
240
- } }, N = {};
241
- S(K, function(e, t) {
242
- N[e] = function() {
243
- return arguments[0] = arguments[0][0], t.apply(this, arguments);
244
- };
245
- }), N.deleteProperty = function(e, t) {
246
- return process.env.NODE_ENV !== "production" && isNaN(parseInt(t)) && s(13), N.set.call(this, e, t, void 0);
247
- }, N.set = function(e, t, r) {
248
- return process.env.NODE_ENV !== "production" && t !== "length" && isNaN(parseInt(t)) && s(14), K.set.call(this, e[0], t, r, e[0]);
249
- };
250
- var ge = function() {
251
- function e(r) {
252
- var n = this;
253
- this.O = re, this.D = !0, this.produce = function(o, i, u) {
254
- if (typeof o == "function" && typeof i != "function") {
255
- var a = i;
256
- i = o;
257
- var c = n;
258
- return function(h) {
259
- var ue = this;
260
- h === void 0 && (h = a);
261
- for (var x = arguments.length, J = Array(x > 1 ? x - 1 : 0), E = 1; E < x; E++) J[E - 1] = arguments[E];
262
- return c.produce(h, function(ae) {
263
- var L;
264
- return (L = i).call.apply(L, [ue, ae].concat(J));
265
- });
266
- };
267
- }
268
- var f;
269
- if (typeof i != "function" && s(6), u !== void 0 && typeof u != "function" && s(7), b(o)) {
270
- var l = Y(n), g = C(n, o, void 0), y = !0;
271
- try {
272
- f = i(g), y = !1;
273
- } finally {
274
- y ? j(l) : M(l);
275
- }
276
- return typeof Promise < "u" && f instanceof Promise ? f.then(function(h) {
277
- return k(l, u), A(h, l);
278
- }, function(h) {
279
- throw j(l), h;
280
- }) : (k(l, u), A(f, l));
281
- }
282
- if (!o || typeof o != "object") {
283
- if ((f = i(o)) === void 0 && (f = o), f === ie && (f = void 0), n.D && $(f, !0), u) {
284
- var D = [], H = [];
285
- v("Patches").M(o, f, D, H), u(D, H);
286
- }
287
- return f;
288
- }
289
- s(21, o);
290
- }, this.produceWithPatches = function(o, i) {
291
- if (typeof o == "function") return function(f) {
292
- for (var l = arguments.length, g = Array(l > 1 ? l - 1 : 0), y = 1; y < l; y++) g[y - 1] = arguments[y];
293
- return n.produceWithPatches(f, function(D) {
294
- return o.apply(void 0, [D].concat(g));
295
- });
296
- };
297
- var u, a, c = n.produce(o, i, function(f, l) {
298
- u = f, a = l;
299
- });
300
- return typeof Promise < "u" && c instanceof Promise ? c.then(function(f) {
301
- return [f, u, a];
302
- }) : [c, u, a];
303
- }, typeof r?.useProxies == "boolean" && this.setUseProxies(r.useProxies), typeof r?.autoFreeze == "boolean" && this.setAutoFreeze(r.autoFreeze);
304
- }
305
- var t = e.prototype;
306
- return t.createDraft = function(r) {
307
- b(r) || s(8), O(r) && (r = pe(r));
308
- var n = Y(this), o = C(this, r, void 0);
309
- return o[p].C = !0, M(n), o;
310
- }, t.finishDraft = function(r, n) {
311
- var o = r && r[p];
312
- process.env.NODE_ENV !== "production" && (o && o.C || s(9), o.I && s(10));
313
- var i = o.A;
314
- return k(i, n), A(void 0, i);
315
- }, t.setAutoFreeze = function(r) {
316
- this.D = r;
317
- }, t.setUseProxies = function(r) {
318
- r && !re && s(20), this.O = r;
319
- }, t.applyPatches = function(r, n) {
320
- var o;
321
- for (o = n.length - 1; o >= 0; o--) {
322
- var i = n[o];
323
- if (i.path.length === 0 && i.op === "replace") {
324
- r = i.value;
325
- break;
326
- }
327
- }
328
- o > -1 && (n = n.slice(o + 1));
329
- var u = v("Patches").$;
330
- return O(r) ? u(r, n) : this.produce(r, function(a) {
331
- return u(a, n);
332
- });
333
- }, e;
334
- }(), d = new ge(), Oe = d.produce;
335
- d.produceWithPatches.bind(d);
336
- d.setAutoFreeze.bind(d);
337
- d.setUseProxies.bind(d);
338
- d.applyPatches.bind(d);
339
- d.createDraft.bind(d);
340
- d.finishDraft.bind(d);
341
- const Pe = (e) => (t, r, n) => (n.setState = (o, i, ...u) => {
342
- const a = typeof o == "function" ? Oe(o) : o;
343
- return t(a, i, ...u);
344
- }, e(n.setState, r, n)), we = Pe;
345
- function Ne(e, t) {
346
- if (Object.is(e, t))
347
- return !0;
348
- if (typeof e != "object" || e === null || typeof t != "object" || t === null)
349
- return !1;
350
- if (e instanceof Map && t instanceof Map) {
351
- if (e.size !== t.size)
352
- return !1;
353
- for (const [n, o] of e)
354
- if (!Object.is(o, t.get(n)))
355
- return !1;
356
- return !0;
357
- }
358
- if (e instanceof Set && t instanceof Set) {
359
- if (e.size !== t.size)
360
- return !1;
361
- for (const n of e)
362
- if (!t.has(n))
363
- return !1;
364
- return !0;
365
- }
366
- const r = Object.keys(e);
367
- if (r.length !== Object.keys(t).length)
368
- return !1;
369
- for (let n = 0; n < r.length; n++)
370
- if (!Object.prototype.hasOwnProperty.call(t, r[n]) || !Object.is(e[r[n]], t[r[n]]))
371
- return !1;
372
- return !0;
373
- }
374
- export {
375
- we as i,
376
- Ne as s
377
- };
@@ -1,61 +0,0 @@
1
- function u() {
2
- }
3
- function g(n, r, e) {
4
- const o = r.split(".");
5
- let t = n;
6
- for (const a of o) {
7
- const c = a.match(/^(\w+)\[(\w+)\]$/);
8
- if (c) {
9
- const s = c[1], i = c[2];
10
- if (t[s] && Array.isArray(t[s])) {
11
- if (i === "lastIndex")
12
- return t[s][t[s].length - 1];
13
- {
14
- const l = parseInt(i);
15
- return t[s][l];
16
- }
17
- } else
18
- return e;
19
- } else if (t[a] !== void 0)
20
- t = t[a];
21
- else
22
- return e;
23
- }
24
- return t;
25
- }
26
- function f(n, r) {
27
- try {
28
- const o = new Function(...Object.keys(n), `return \`${r}\``)(...Object.values(n));
29
- return String(o).replace(/`/g, "");
30
- } catch (e) {
31
- return console.error(`Error evaluating expression: ${e}`), "";
32
- }
33
- }
34
- function y(n, r) {
35
- try {
36
- const e = window.localStorage.getItem(n);
37
- return e !== null ? typeof r == "string" ? e : JSON.parse(e) : r;
38
- } catch {
39
- return r;
40
- }
41
- }
42
- function S(n, r, e = !1) {
43
- try {
44
- let o = null;
45
- if (typeof r == "string") {
46
- window.localStorage.setItem(n, r);
47
- return;
48
- }
49
- e && (o = window.localStorage.getItem(n));
50
- let t = o !== null ? JSON.parse(o) : {};
51
- t = { ...t, ...r }, window.localStorage.setItem(n, JSON.stringify(t));
52
- } catch {
53
- }
54
- }
55
- export {
56
- g as a,
57
- f as e,
58
- y as g,
59
- S as s,
60
- u as v
61
- };
File without changes