@nizza/core 0.3.0-alpha.0 → 0.3.0-alpha.1

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 (194) hide show
  1. package/package.json +13 -10
  2. package/src/environments/environment.d.js +3 -0
  3. package/src/environments/environment.d.js.map +1 -0
  4. package/src/environments/environment.js +28 -0
  5. package/src/environments/environment.js.map +1 -0
  6. package/src/environments/environment.prod.d.js +3 -0
  7. package/src/environments/environment.prod.d.js.map +1 -0
  8. package/src/environments/environment.prod.d.ts +20 -0
  9. package/src/environments/environment.prod.js +27 -0
  10. package/src/environments/environment.prod.js.map +1 -0
  11. package/src/environments/environment.staging.d.js +3 -0
  12. package/src/environments/environment.staging.d.js.map +1 -0
  13. package/src/environments/environment.staging.d.ts +20 -0
  14. package/src/environments/environment.staging.js +27 -0
  15. package/src/environments/environment.staging.js.map +1 -0
  16. package/src/index.d.js +8 -0
  17. package/src/index.d.js.map +1 -0
  18. package/src/index.js +8 -0
  19. package/src/index.js.map +1 -0
  20. package/src/lib/constants/index.d.js +3 -0
  21. package/src/lib/constants/index.d.js.map +1 -0
  22. package/src/lib/constants/index.js +3 -0
  23. package/src/lib/constants/index.js.map +1 -0
  24. package/src/lib/constants/products.d.js +3 -0
  25. package/src/lib/constants/products.d.js.map +1 -0
  26. package/src/lib/constants/products.js +6 -0
  27. package/src/lib/constants/products.js.map +1 -0
  28. package/src/lib/domain/AggregateRoot.d.js +3 -0
  29. package/src/lib/domain/AggregateRoot.d.js.map +1 -0
  30. package/src/lib/domain/AggregateRoot.js +22 -0
  31. package/src/lib/domain/AggregateRoot.js.map +1 -0
  32. package/src/lib/domain/BaseMobxStore.d.js +3 -0
  33. package/src/lib/domain/BaseMobxStore.d.js.map +1 -0
  34. package/src/lib/domain/BaseMobxStore.js +4 -0
  35. package/src/lib/domain/BaseMobxStore.js.map +1 -0
  36. package/src/lib/domain/ValueObject.d.js +3 -0
  37. package/src/lib/domain/ValueObject.d.js.map +1 -0
  38. package/src/lib/domain/ValueObject.js +12 -0
  39. package/src/lib/domain/ValueObject.js.map +1 -0
  40. package/src/lib/domain/errors/DomainError.d.js +3 -0
  41. package/src/lib/domain/errors/DomainError.d.js.map +1 -0
  42. package/src/lib/domain/errors/DomainError.js +18 -0
  43. package/src/lib/domain/errors/DomainError.js.map +1 -0
  44. package/src/lib/domain/errors/api.d.js +3 -0
  45. package/src/lib/domain/errors/api.d.js.map +1 -0
  46. package/src/lib/domain/errors/api.js +8 -0
  47. package/src/lib/domain/errors/api.js.map +1 -0
  48. package/src/lib/domain/errors/app.d.js +3 -0
  49. package/src/lib/domain/errors/app.d.js.map +1 -0
  50. package/src/lib/domain/errors/app.js +14 -0
  51. package/src/lib/domain/errors/app.js.map +1 -0
  52. package/src/lib/domain/errors/index.d.js +5 -0
  53. package/src/lib/domain/errors/index.d.js.map +1 -0
  54. package/src/lib/domain/errors/index.js +5 -0
  55. package/src/lib/domain/errors/index.js.map +1 -0
  56. package/src/lib/domain/index.d.js +6 -0
  57. package/src/lib/domain/index.d.js.map +1 -0
  58. package/src/lib/domain/index.js +6 -0
  59. package/src/lib/domain/index.js.map +1 -0
  60. package/src/lib/providers/StoreProvider.d.js +3 -0
  61. package/src/lib/providers/StoreProvider.d.js.map +1 -0
  62. package/src/lib/providers/StoreProvider.js +36 -0
  63. package/src/lib/providers/StoreProvider.js.map +1 -0
  64. package/src/lib/providers/index.d.js +3 -0
  65. package/src/lib/providers/index.d.js.map +1 -0
  66. package/src/lib/providers/index.js +3 -0
  67. package/src/lib/providers/index.js.map +1 -0
  68. package/src/lib/stores/NizzaStore.d.js +3 -0
  69. package/src/lib/stores/NizzaStore.d.js.map +1 -0
  70. package/src/lib/stores/NizzaStore.js +18 -0
  71. package/src/lib/stores/NizzaStore.js.map +1 -0
  72. package/src/lib/stores/index.d.js +3 -0
  73. package/src/lib/stores/index.d.js.map +1 -0
  74. package/src/lib/stores/index.js +3 -0
  75. package/src/lib/stores/index.js.map +1 -0
  76. package/src/lib/types/api-graphql-types.d.js +3 -0
  77. package/src/lib/types/api-graphql-types.d.js.map +1 -0
  78. package/{dist → src}/lib/types/api-graphql-types.d.ts +57 -57
  79. package/src/lib/types/api-graphql-types.js +2003 -0
  80. package/src/lib/types/api-graphql-types.js.map +1 -0
  81. package/src/lib/types/app-module.d.js +3 -0
  82. package/src/lib/types/app-module.d.js.map +1 -0
  83. package/src/lib/types/app-module.js +3 -0
  84. package/src/lib/types/app-module.js.map +1 -0
  85. package/src/lib/types/index.d.js +9 -0
  86. package/src/lib/types/index.d.js.map +1 -0
  87. package/src/lib/types/index.js +9 -0
  88. package/src/lib/types/index.js.map +1 -0
  89. package/src/lib/types/mobx-store.d.js +3 -0
  90. package/src/lib/types/mobx-store.d.js.map +1 -0
  91. package/src/lib/types/mobx-store.d.ts +3 -0
  92. package/src/lib/types/mobx-store.js +3 -0
  93. package/src/lib/types/mobx-store.js.map +1 -0
  94. package/src/lib/types/nizzaGlobalObject.d.js +3 -0
  95. package/src/lib/types/nizzaGlobalObject.d.js.map +1 -0
  96. package/src/lib/types/nizzaGlobalObject.js +3 -0
  97. package/src/lib/types/nizzaGlobalObject.js.map +1 -0
  98. package/src/lib/types/products/base.d.js +8 -0
  99. package/src/lib/types/products/base.d.js.map +1 -0
  100. package/src/lib/types/products/base.js +8 -0
  101. package/src/lib/types/products/base.js.map +1 -0
  102. package/src/lib/types/products/index.d.js +4 -0
  103. package/src/lib/types/products/index.d.js.map +1 -0
  104. package/src/lib/types/products/index.js +4 -0
  105. package/src/lib/types/products/index.js.map +1 -0
  106. package/src/lib/types/products/product.d.js +3 -0
  107. package/src/lib/types/products/product.d.js.map +1 -0
  108. package/src/lib/types/products/product.d.ts +16 -0
  109. package/src/lib/types/products/product.js +3 -0
  110. package/src/lib/types/products/product.js.map +1 -0
  111. package/src/lib/types/utils.d.js +3 -0
  112. package/src/lib/types/utils.d.js.map +1 -0
  113. package/{dist → src}/lib/types/utils.d.ts +3 -3
  114. package/src/lib/types/utils.js +4 -0
  115. package/src/lib/types/utils.js.map +1 -0
  116. package/src/lib/utils/Result.d.js +3 -0
  117. package/src/lib/utils/Result.d.js.map +1 -0
  118. package/{dist → src}/lib/utils/Result.d.ts +1 -1
  119. package/src/lib/utils/Result.js +63 -0
  120. package/src/lib/utils/Result.js.map +1 -0
  121. package/src/lib/utils/apiCall.d.js +3 -0
  122. package/src/lib/utils/apiCall.d.js.map +1 -0
  123. package/src/lib/utils/apiCall.js +28 -0
  124. package/src/lib/utils/apiCall.js.map +1 -0
  125. package/src/lib/utils/customStorage/MemoryStorage.d.js +3 -0
  126. package/src/lib/utils/customStorage/MemoryStorage.d.js.map +1 -0
  127. package/src/lib/utils/customStorage/MemoryStorage.js +44 -0
  128. package/src/lib/utils/customStorage/MemoryStorage.js.map +1 -0
  129. package/src/lib/utils/customStorage/index.d.js +3 -0
  130. package/src/lib/utils/customStorage/index.d.js.map +1 -0
  131. package/src/lib/utils/customStorage/index.js +36 -0
  132. package/src/lib/utils/customStorage/index.js.map +1 -0
  133. package/src/lib/utils/customStorage/utils.d.js +3 -0
  134. package/src/lib/utils/customStorage/utils.d.js.map +1 -0
  135. package/{dist → src}/lib/utils/customStorage/utils.d.ts +1 -1
  136. package/src/lib/utils/customStorage/utils.js +24 -0
  137. package/src/lib/utils/customStorage/utils.js.map +1 -0
  138. package/src/lib/utils/fingerprint.d.js +3 -0
  139. package/src/lib/utils/fingerprint.d.js.map +1 -0
  140. package/src/lib/utils/fingerprint.d.ts +1 -0
  141. package/src/lib/utils/fingerprint.js +14 -0
  142. package/src/lib/utils/fingerprint.js.map +1 -0
  143. package/src/lib/utils/helpers.d.js +3 -0
  144. package/src/lib/utils/helpers.d.js.map +1 -0
  145. package/{dist → src}/lib/utils/helpers.d.ts +1 -1
  146. package/src/lib/utils/helpers.js +15 -0
  147. package/src/lib/utils/helpers.js.map +1 -0
  148. package/src/lib/utils/index.d.js +8 -0
  149. package/src/lib/utils/index.d.js.map +1 -0
  150. package/src/lib/utils/index.js +8 -0
  151. package/src/lib/utils/index.js.map +1 -0
  152. package/src/lib/utils/lazyLoad.d.js +3 -0
  153. package/src/lib/utils/lazyLoad.d.js.map +1 -0
  154. package/{dist → src}/lib/utils/lazyLoad.d.ts +1 -1
  155. package/src/lib/utils/lazyLoad.js +17 -0
  156. package/src/lib/utils/lazyLoad.js.map +1 -0
  157. package/src/typings/libs.d.js +2 -0
  158. package/src/typings/libs.d.js.map +1 -0
  159. package/vite-env.d.js +3 -0
  160. package/vite-env.d.js.map +1 -0
  161. package/vite.config.js +10 -0
  162. package/vite.config.js.map +1 -0
  163. package/README.md +0 -3
  164. package/dist/index.es.js +0 -2795
  165. package/dist/lib/types/mobx-store.d.ts +0 -3
  166. package/dist/lib/types/products/product.d.ts +0 -16
  167. package/dist/lib/utils/fingerprint.d.ts +0 -1
  168. package/dist/package.json +0 -21
  169. package/dist/typings/libs.d.ts +0 -0
  170. /package/{dist → src}/environments/environment.d.ts +0 -0
  171. /package/{dist → src}/index.d.ts +0 -0
  172. /package/{dist → src}/lib/constants/index.d.ts +0 -0
  173. /package/{dist → src}/lib/constants/products.d.ts +0 -0
  174. /package/{dist → src}/lib/domain/AggregateRoot.d.ts +0 -0
  175. /package/{dist → src}/lib/domain/BaseMobxStore.d.ts +0 -0
  176. /package/{dist → src}/lib/domain/ValueObject.d.ts +0 -0
  177. /package/{dist → src}/lib/domain/errors/DomainError.d.ts +0 -0
  178. /package/{dist → src}/lib/domain/errors/api.d.ts +0 -0
  179. /package/{dist → src}/lib/domain/errors/app.d.ts +0 -0
  180. /package/{dist → src}/lib/domain/errors/index.d.ts +0 -0
  181. /package/{dist → src}/lib/domain/index.d.ts +0 -0
  182. /package/{dist → src}/lib/providers/StoreProvider.d.ts +0 -0
  183. /package/{dist → src}/lib/providers/index.d.ts +0 -0
  184. /package/{dist → src}/lib/stores/NizzaStore.d.ts +0 -0
  185. /package/{dist → src}/lib/stores/index.d.ts +0 -0
  186. /package/{dist → src}/lib/types/app-module.d.ts +0 -0
  187. /package/{dist → src}/lib/types/index.d.ts +0 -0
  188. /package/{dist → src}/lib/types/nizzaGlobalObject.d.ts +0 -0
  189. /package/{dist → src}/lib/types/products/base.d.ts +0 -0
  190. /package/{dist → src}/lib/types/products/index.d.ts +0 -0
  191. /package/{dist → src}/lib/utils/apiCall.d.ts +0 -0
  192. /package/{dist → src}/lib/utils/customStorage/MemoryStorage.d.ts +0 -0
  193. /package/{dist → src}/lib/utils/customStorage/index.d.ts +0 -0
  194. /package/{dist → src}/lib/utils/index.d.ts +0 -0
package/dist/index.es.js DELETED
@@ -1,2795 +0,0 @@
1
- import { jsx as et } from "react/jsx-runtime";
2
- import { createContext as Gn, useContext as Mt, useMemo as Kn, lazy as zn, Suspense as qn } from "react";
3
- var Wn = /* @__PURE__ */ ((e) => (e.COMBO = "Combo", e))(Wn || {});
4
- class Hn {
5
- aggregate;
6
- _numSetPropsApplied = 0;
7
- constructor(t) {
8
- this.aggregate = t;
9
- }
10
- setProps(t) {
11
- for (const [i, n] of Object.entries(t))
12
- i in this.aggregate && (this.aggregate[i] = n);
13
- this._numSetPropsApplied++;
14
- }
15
- get isFirstSetProps() {
16
- return this._numSetPropsApplied === 1;
17
- }
18
- }
19
- function Zr(e) {
20
- return new Hn(e);
21
- }
22
- class ea {
23
- }
24
- class dt extends Error {
25
- constructor(t, i, n) {
26
- super(i), this.value = n, this.name = t;
27
- }
28
- toDTO() {
29
- return {
30
- name: this.name,
31
- message: this.message,
32
- ...this.value && { value: this.value }
33
- };
34
- }
35
- }
36
- class ta extends dt {
37
- constructor(t) {
38
- super(
39
- "RESOURCE_NOT_FOUND_ERROR",
40
- `Resource with id '${t}' not found.`,
41
- t
42
- );
43
- }
44
- }
45
- class na extends dt {
46
- constructor(t) {
47
- super(
48
- "APP_UNEXPECTED_ERROR",
49
- t.message ?? "An unexpected error occurred.",
50
- t
51
- );
52
- }
53
- }
54
- class ia extends dt {
55
- constructor() {
56
- super("APP_ACCOUNT_INVALID_ERROR", "Account not defined");
57
- }
58
- }
59
- class ra {
60
- _value;
61
- constructor(t) {
62
- t !== void 0 && (this._value = t);
63
- }
64
- get value() {
65
- return this._value;
66
- }
67
- }
68
- let ct = /* @__PURE__ */ new Map();
69
- const tt = Gn(ct), aa = ({ children: e, stores: t, instances: i }) => {
70
- const n = Mt(tt), r = Kn(() => {
71
- const a = /* @__PURE__ */ new Map();
72
- return t.forEach((o) => {
73
- let s;
74
- try {
75
- s = o();
76
- } catch {
77
- s = new o();
78
- }
79
- a.set(o, s);
80
- }), i?.forEach(
81
- (o) => a.set(o.constructor, o)
82
- ), ct = new Map([...n, ...a]);
83
- }, []);
84
- return /* @__PURE__ */ et(tt.Provider, { value: r, children: e });
85
- };
86
- function oa(e) {
87
- return Mt(tt).get(e);
88
- }
89
- function sa(e) {
90
- return ct.get(e);
91
- }
92
- function m(e) {
93
- for (var t = arguments.length, i = new Array(t > 1 ? t - 1 : 0), n = 1; n < t; n++)
94
- i[n - 1] = arguments[n];
95
- throw new Error(typeof e == "number" ? "[MobX] minified error nr: " + e + (i.length ? " " + i.map(String).join(",") : "") + ". Find the full error at: https://github.com/mobxjs/mobx/blob/main/packages/mobx/src/errors.ts" : "[MobX] " + e);
96
- }
97
- var Xn = {};
98
- function $t() {
99
- return typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : Xn;
100
- }
101
- var Jn = Object.assign, De = Object.getOwnPropertyDescriptor, x = Object.defineProperty, Le = Object.prototype, nt = [];
102
- Object.freeze(nt);
103
- var Gt = {};
104
- Object.freeze(Gt);
105
- var Yn = typeof Proxy < "u", Qn = /* @__PURE__ */ Object.toString();
106
- function Kt() {
107
- Yn || m("Proxy not available");
108
- }
109
- function zt(e) {
110
- var t = !1;
111
- return function() {
112
- if (!t)
113
- return t = !0, e.apply(this, arguments);
114
- };
115
- }
116
- var J = function() {
117
- };
118
- function C(e) {
119
- return typeof e == "function";
120
- }
121
- function K(e) {
122
- var t = typeof e;
123
- switch (t) {
124
- case "string":
125
- case "symbol":
126
- case "number":
127
- return !0;
128
- }
129
- return !1;
130
- }
131
- function Ue(e) {
132
- return e !== null && typeof e == "object";
133
- }
134
- function R(e) {
135
- if (!Ue(e))
136
- return !1;
137
- var t = Object.getPrototypeOf(e);
138
- if (t == null)
139
- return !0;
140
- var i = Object.hasOwnProperty.call(t, "constructor") && t.constructor;
141
- return typeof i == "function" && i.toString() === Qn;
142
- }
143
- function qt(e) {
144
- var t = e?.constructor;
145
- return t ? t.name === "GeneratorFunction" || t.displayName === "GeneratorFunction" : !1;
146
- }
147
- function Me(e, t, i) {
148
- x(e, t, {
149
- enumerable: !1,
150
- writable: !0,
151
- configurable: !0,
152
- value: i
153
- });
154
- }
155
- function Wt(e, t, i) {
156
- x(e, t, {
157
- enumerable: !1,
158
- writable: !1,
159
- configurable: !0,
160
- value: i
161
- });
162
- }
163
- function q(e, t) {
164
- var i = "isMobX" + e;
165
- return t.prototype[i] = !0, function(n) {
166
- return Ue(n) && n[i] === !0;
167
- };
168
- }
169
- function ie(e) {
170
- return e instanceof Map;
171
- }
172
- function _e(e) {
173
- return e instanceof Set;
174
- }
175
- var Ht = typeof Object.getOwnPropertySymbols < "u";
176
- function Zn(e) {
177
- var t = Object.keys(e);
178
- if (!Ht)
179
- return t;
180
- var i = Object.getOwnPropertySymbols(e);
181
- return i.length ? [].concat(t, i.filter(function(n) {
182
- return Le.propertyIsEnumerable.call(e, n);
183
- })) : t;
184
- }
185
- var le = typeof Reflect < "u" && Reflect.ownKeys ? Reflect.ownKeys : Ht ? function(e) {
186
- return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e));
187
- } : (
188
- /* istanbul ignore next */
189
- Object.getOwnPropertyNames
190
- );
191
- function Xt(e) {
192
- return e === null ? null : typeof e == "object" ? "" + e : e;
193
- }
194
- function L(e, t) {
195
- return Le.hasOwnProperty.call(e, t);
196
- }
197
- var ei = Object.getOwnPropertyDescriptors || function(t) {
198
- var i = {};
199
- return le(t).forEach(function(n) {
200
- i[n] = De(t, n);
201
- }), i;
202
- };
203
- function yt(e, t) {
204
- for (var i = 0; i < t.length; i++) {
205
- var n = t[i];
206
- n.enumerable = n.enumerable || !1, n.configurable = !0, "value" in n && (n.writable = !0), Object.defineProperty(e, n.key, n);
207
- }
208
- }
209
- function ft(e, t, i) {
210
- return t && yt(e.prototype, t), i && yt(e, i), Object.defineProperty(e, "prototype", {
211
- writable: !1
212
- }), e;
213
- }
214
- function de() {
215
- return de = Object.assign || function(e) {
216
- for (var t = 1; t < arguments.length; t++) {
217
- var i = arguments[t];
218
- for (var n in i)
219
- Object.prototype.hasOwnProperty.call(i, n) && (e[n] = i[n]);
220
- }
221
- return e;
222
- }, de.apply(this, arguments);
223
- }
224
- function Jt(e, t) {
225
- e.prototype = Object.create(t.prototype), e.prototype.constructor = e, it(e, t);
226
- }
227
- function it(e, t) {
228
- return it = Object.setPrototypeOf || function(n, r) {
229
- return n.__proto__ = r, n;
230
- }, it(e, t);
231
- }
232
- function St(e) {
233
- if (e === void 0)
234
- throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
235
- return e;
236
- }
237
- function ti(e, t) {
238
- if (e) {
239
- if (typeof e == "string")
240
- return Nt(e, t);
241
- var i = Object.prototype.toString.call(e).slice(8, -1);
242
- if (i === "Object" && e.constructor && (i = e.constructor.name), i === "Map" || i === "Set")
243
- return Array.from(e);
244
- if (i === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))
245
- return Nt(e, t);
246
- }
247
- }
248
- function Nt(e, t) {
249
- (t == null || t > e.length) && (t = e.length);
250
- for (var i = 0, n = new Array(t); i < t; i++)
251
- n[i] = e[i];
252
- return n;
253
- }
254
- function Y(e, t) {
255
- var i = typeof Symbol < "u" && e[Symbol.iterator] || e["@@iterator"];
256
- if (i)
257
- return (i = i.call(e)).next.bind(i);
258
- if (Array.isArray(e) || (i = ti(e)) || t && e && typeof e.length == "number") {
259
- i && (e = i);
260
- var n = 0;
261
- return function() {
262
- return n >= e.length ? {
263
- done: !0
264
- } : {
265
- done: !1,
266
- value: e[n++]
267
- };
268
- };
269
- }
270
- throw new TypeError(`Invalid attempt to iterate non-iterable instance.
271
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
272
- }
273
- var Q = /* @__PURE__ */ Symbol("mobx-stored-annotations");
274
- function T(e) {
275
- function t(i, n) {
276
- pe(i, n, e);
277
- }
278
- return Object.assign(t, e);
279
- }
280
- function pe(e, t, i) {
281
- L(e, Q) || Me(e, Q, de({}, e[Q])), li(i) || (e[Q][t] = i);
282
- }
283
- var f = /* @__PURE__ */ Symbol("mobx administration"), ge = /* @__PURE__ */ function() {
284
- function e(i) {
285
- i === void 0 && (i = "Atom"), this.name_ = void 0, this.isPendingUnobservation_ = !1, this.isBeingObserved_ = !1, this.observers_ = /* @__PURE__ */ new Set(), this.diffValue_ = 0, this.lastAccessedBy_ = 0, this.lowestObserverState_ = v.NOT_TRACKING_, this.onBOL = void 0, this.onBUOL = void 0, this.name_ = i;
286
- }
287
- var t = e.prototype;
288
- return t.onBO = function() {
289
- this.onBOL && this.onBOL.forEach(function(n) {
290
- return n();
291
- });
292
- }, t.onBUO = function() {
293
- this.onBUOL && this.onBUOL.forEach(function(n) {
294
- return n();
295
- });
296
- }, t.reportObserved = function() {
297
- return _n(this);
298
- }, t.reportChanged = function() {
299
- y(), pn(this), S();
300
- }, t.toString = function() {
301
- return this.name_;
302
- }, e;
303
- }(), vt = /* @__PURE__ */ q("Atom", ge);
304
- function Yt(e, t, i) {
305
- t === void 0 && (t = J), i === void 0 && (i = J);
306
- var n = new ge(e);
307
- return t !== J && ur(n, t), i !== J && On(n, i), n;
308
- }
309
- function ni(e, t) {
310
- return e === t;
311
- }
312
- function ii(e, t) {
313
- return bt(e, t);
314
- }
315
- function ri(e, t) {
316
- return bt(e, t, 1);
317
- }
318
- function ai(e, t) {
319
- return Object.is ? Object.is(e, t) : e === t ? e !== 0 || 1 / e === 1 / t : e !== e && t !== t;
320
- }
321
- var Pe = {
322
- identity: ni,
323
- structural: ii,
324
- default: ai,
325
- shallow: ri
326
- };
327
- function te(e, t, i) {
328
- return En(e) ? e : Array.isArray(e) ? b.array(e, {
329
- name: i
330
- }) : R(e) ? b.object(e, void 0, {
331
- name: i
332
- }) : ie(e) ? b.map(e, {
333
- name: i
334
- }) : _e(e) ? b.set(e, {
335
- name: i
336
- }) : typeof e == "function" && !_t(e) && !Ve(e) ? qt(e) ? ve(e) : fe(i, e) : e;
337
- }
338
- function oi(e, t, i) {
339
- if (e == null || me(e) || qe(e) || W(e) || ae(e))
340
- return e;
341
- if (Array.isArray(e))
342
- return b.array(e, {
343
- name: i,
344
- deep: !1
345
- });
346
- if (R(e))
347
- return b.object(e, void 0, {
348
- name: i,
349
- deep: !1
350
- });
351
- if (ie(e))
352
- return b.map(e, {
353
- name: i,
354
- deep: !1
355
- });
356
- if (_e(e))
357
- return b.set(e, {
358
- name: i,
359
- deep: !1
360
- });
361
- }
362
- function $e(e) {
363
- return e;
364
- }
365
- function si(e, t) {
366
- return bt(e, t) ? t : e;
367
- }
368
- var ui = "override";
369
- function li(e) {
370
- return e.annotationType_ === ui;
371
- }
372
- function be(e, t) {
373
- return {
374
- annotationType_: e,
375
- options_: t,
376
- make_: di,
377
- extend_: ci
378
- };
379
- }
380
- function di(e, t, i, n) {
381
- var r;
382
- if ((r = this.options_) != null && r.bound)
383
- return this.extend_(e, t, i, !1) === null ? 0 : 1;
384
- if (n === e.target_)
385
- return this.extend_(e, t, i, !1) === null ? 0 : 2;
386
- if (_t(i.value))
387
- return 1;
388
- var a = Qt(e, this, t, i, !1);
389
- return x(n, t, a), 2;
390
- }
391
- function ci(e, t, i, n) {
392
- var r = Qt(e, this, t, i);
393
- return e.defineProperty_(t, r, n);
394
- }
395
- function fi(e, t, i, n) {
396
- t.annotationType_, n.value;
397
- }
398
- function Qt(e, t, i, n, r) {
399
- var a, o, s, u, l, c, h;
400
- r === void 0 && (r = d.safeDescriptors), fi(e, t, i, n);
401
- var _ = n.value;
402
- if ((a = t.options_) != null && a.bound) {
403
- var P;
404
- _ = _.bind((P = e.proxy_) != null ? P : e.target_);
405
- }
406
- return {
407
- value: ne(
408
- (o = (s = t.options_) == null ? void 0 : s.name) != null ? o : i.toString(),
409
- _,
410
- (u = (l = t.options_) == null ? void 0 : l.autoAction) != null ? u : !1,
411
- // https://github.com/mobxjs/mobx/discussions/3140
412
- (c = t.options_) != null && c.bound ? (h = e.proxy_) != null ? h : e.target_ : void 0
413
- ),
414
- // Non-configurable for classes
415
- // prevents accidental field redefinition in subclass
416
- configurable: r ? e.isPlainObject_ : !0,
417
- // https://github.com/mobxjs/mobx/pull/2641#issuecomment-737292058
418
- enumerable: !1,
419
- // Non-obsevable, therefore non-writable
420
- // Also prevents rewriting in subclass constructor
421
- writable: !r
422
- };
423
- }
424
- function Zt(e, t) {
425
- return {
426
- annotationType_: e,
427
- options_: t,
428
- make_: vi,
429
- extend_: mi
430
- };
431
- }
432
- function vi(e, t, i, n) {
433
- var r;
434
- if (n === e.target_)
435
- return this.extend_(e, t, i, !1) === null ? 0 : 2;
436
- if ((r = this.options_) != null && r.bound && (!L(e.target_, t) || !Ve(e.target_[t])) && this.extend_(e, t, i, !1) === null)
437
- return 0;
438
- if (Ve(i.value))
439
- return 1;
440
- var a = en(e, this, t, i, !1, !1);
441
- return x(n, t, a), 2;
442
- }
443
- function mi(e, t, i, n) {
444
- var r, a = en(e, this, t, i, (r = this.options_) == null ? void 0 : r.bound);
445
- return e.defineProperty_(t, a, n);
446
- }
447
- function hi(e, t, i, n) {
448
- t.annotationType_, n.value;
449
- }
450
- function en(e, t, i, n, r, a) {
451
- a === void 0 && (a = d.safeDescriptors), hi(e, t, i, n);
452
- var o = n.value;
453
- if (Ve(o) || (o = ve(o)), r) {
454
- var s;
455
- o = o.bind((s = e.proxy_) != null ? s : e.target_), o.isMobXFlow = !0;
456
- }
457
- return {
458
- value: o,
459
- // Non-configurable for classes
460
- // prevents accidental field redefinition in subclass
461
- configurable: a ? e.isPlainObject_ : !0,
462
- // https://github.com/mobxjs/mobx/pull/2641#issuecomment-737292058
463
- enumerable: !1,
464
- // Non-obsevable, therefore non-writable
465
- // Also prevents rewriting in subclass constructor
466
- writable: !a
467
- };
468
- }
469
- function mt(e, t) {
470
- return {
471
- annotationType_: e,
472
- options_: t,
473
- make_: _i,
474
- extend_: pi
475
- };
476
- }
477
- function _i(e, t, i) {
478
- return this.extend_(e, t, i, !1) === null ? 0 : 1;
479
- }
480
- function pi(e, t, i, n) {
481
- return gi(e, this, t, i), e.defineComputedProperty_(t, de({}, this.options_, {
482
- get: i.get,
483
- set: i.set
484
- }), n);
485
- }
486
- function gi(e, t, i, n) {
487
- t.annotationType_, n.get;
488
- }
489
- function Ge(e, t) {
490
- return {
491
- annotationType_: e,
492
- options_: t,
493
- make_: bi,
494
- extend_: ki
495
- };
496
- }
497
- function bi(e, t, i) {
498
- return this.extend_(e, t, i, !1) === null ? 0 : 1;
499
- }
500
- function ki(e, t, i, n) {
501
- var r, a;
502
- return yi(e, this), e.defineObservableProperty_(t, i.value, (r = (a = this.options_) == null ? void 0 : a.enhancer) != null ? r : te, n);
503
- }
504
- function yi(e, t, i, n) {
505
- t.annotationType_;
506
- }
507
- var Si = "true", Ni = /* @__PURE__ */ tn();
508
- function tn(e) {
509
- return {
510
- annotationType_: Si,
511
- options_: e,
512
- make_: Oi,
513
- extend_: Ai
514
- };
515
- }
516
- function Oi(e, t, i, n) {
517
- var r, a;
518
- if (i.get)
519
- return Ke.make_(e, t, i, n);
520
- if (i.set) {
521
- var o = ne(t.toString(), i.set);
522
- return n === e.target_ ? e.defineProperty_(t, {
523
- configurable: d.safeDescriptors ? e.isPlainObject_ : !0,
524
- set: o
525
- }) === null ? 0 : 2 : (x(n, t, {
526
- configurable: !0,
527
- set: o
528
- }), 2);
529
- }
530
- if (n !== e.target_ && typeof i.value == "function") {
531
- var s;
532
- if (qt(i.value)) {
533
- var u, l = (u = this.options_) != null && u.autoBind ? ve.bound : ve;
534
- return l.make_(e, t, i, n);
535
- }
536
- var c = (s = this.options_) != null && s.autoBind ? fe.bound : fe;
537
- return c.make_(e, t, i, n);
538
- }
539
- var h = ((r = this.options_) == null ? void 0 : r.deep) === !1 ? b.ref : b;
540
- if (typeof i.value == "function" && (a = this.options_) != null && a.autoBind) {
541
- var _;
542
- i.value = i.value.bind((_ = e.proxy_) != null ? _ : e.target_);
543
- }
544
- return h.make_(e, t, i, n);
545
- }
546
- function Ai(e, t, i, n) {
547
- var r, a;
548
- if (i.get)
549
- return Ke.extend_(e, t, i, n);
550
- if (i.set)
551
- return e.defineProperty_(t, {
552
- configurable: d.safeDescriptors ? e.isPlainObject_ : !0,
553
- set: ne(t.toString(), i.set)
554
- }, n);
555
- if (typeof i.value == "function" && (r = this.options_) != null && r.autoBind) {
556
- var o;
557
- i.value = i.value.bind((o = e.proxy_) != null ? o : e.target_);
558
- }
559
- var s = ((a = this.options_) == null ? void 0 : a.deep) === !1 ? b.ref : b;
560
- return s.extend_(e, t, i, n);
561
- }
562
- var wi = "observable", Ci = "observable.ref", Ei = "observable.shallow", Fi = "observable.struct", nn = {
563
- deep: !0,
564
- name: void 0,
565
- defaultDecorator: void 0,
566
- proxy: !0
567
- };
568
- Object.freeze(nn);
569
- function Ae(e) {
570
- return e || nn;
571
- }
572
- var rn = /* @__PURE__ */ Ge(wi), Ti = /* @__PURE__ */ Ge(Ci, {
573
- enhancer: $e
574
- }), Di = /* @__PURE__ */ Ge(Ei, {
575
- enhancer: oi
576
- }), Pi = /* @__PURE__ */ Ge(Fi, {
577
- enhancer: si
578
- }), an = /* @__PURE__ */ T(rn);
579
- function we(e) {
580
- return e.deep === !0 ? te : e.deep === !1 ? $e : xi(e.defaultDecorator);
581
- }
582
- function ji(e) {
583
- var t;
584
- return e ? (t = e.defaultDecorator) != null ? t : tn(e) : void 0;
585
- }
586
- function xi(e) {
587
- var t, i;
588
- return e && (t = (i = e.options_) == null ? void 0 : i.enhancer) != null ? t : te;
589
- }
590
- function on(e, t, i) {
591
- if (K(t)) {
592
- pe(e, t, rn);
593
- return;
594
- }
595
- return En(e) ? e : R(e) ? b.object(e, t, i) : Array.isArray(e) ? b.array(e, t) : ie(e) ? b.map(e, t) : _e(e) ? b.set(e, t) : typeof e == "object" && e !== null ? e : b.box(e, t);
596
- }
597
- Object.assign(on, an);
598
- var Ri = {
599
- box: function(t, i) {
600
- var n = Ae(i);
601
- return new ee(t, we(n), n.name, !0, n.equals);
602
- },
603
- array: function(t, i) {
604
- var n = Ae(i);
605
- return (d.useProxies === !1 || n.proxy === !1 ? Er : br)(t, we(n), n.name);
606
- },
607
- map: function(t, i) {
608
- var n = Ae(i);
609
- return new Pn(t, we(n), n.name);
610
- },
611
- set: function(t, i) {
612
- var n = Ae(i);
613
- return new Rn(t, we(n), n.name);
614
- },
615
- object: function(t, i, n) {
616
- return wn(d.useProxies === !1 || n?.proxy === !1 ? We({}, n) : hr({}, n), t, i);
617
- },
618
- ref: /* @__PURE__ */ T(Ti),
619
- shallow: /* @__PURE__ */ T(Di),
620
- deep: an,
621
- struct: /* @__PURE__ */ T(Pi)
622
- }, b = /* @__PURE__ */ Jn(on, Ri), sn = "computed", Vi = "computed.struct", un = /* @__PURE__ */ mt(sn), Ii = /* @__PURE__ */ mt(Vi, {
623
- equals: Pe.structural
624
- }), Ke = function(t, i) {
625
- if (K(i))
626
- return pe(t, i, un);
627
- if (R(t))
628
- return T(mt(sn, t));
629
- var n = R(i) ? i : {};
630
- return n.get = t, n.name || (n.name = t.name || ""), new ce(n);
631
- };
632
- Object.assign(Ke, un);
633
- Ke.struct = /* @__PURE__ */ T(Ii);
634
- var Ot, At, je = 0, Bi = 1, Li = (Ot = (At = /* @__PURE__ */ De(function() {
635
- }, "name")) == null ? void 0 : At.configurable) != null ? Ot : !1, wt = {
636
- value: "action",
637
- configurable: !0,
638
- writable: !1,
639
- enumerable: !1
640
- };
641
- function ne(e, t, i, n) {
642
- i === void 0 && (i = !1);
643
- function r() {
644
- return Ui(e, i, t, n || this, arguments);
645
- }
646
- return r.isMobxAction = !0, Li && (wt.value = e, Object.defineProperty(r, "name", wt)), r;
647
- }
648
- function Ui(e, t, i, n, r) {
649
- var a = Mi(e, t);
650
- try {
651
- return i.apply(n, r);
652
- } catch (o) {
653
- throw a.error_ = o, o;
654
- } finally {
655
- $i(a);
656
- }
657
- }
658
- function Mi(e, t, i, n) {
659
- var r = !1, a = 0, o = d.trackingDerivation, s = !t || !o;
660
- y();
661
- var u = d.allowStateChanges;
662
- s && (re(), u = ke(!0));
663
- var l = ht(!0), c = {
664
- runAsAction_: s,
665
- prevDerivation_: o,
666
- prevAllowStateChanges_: u,
667
- prevAllowStateReads_: l,
668
- notifySpy_: r,
669
- startTime_: a,
670
- actionId_: Bi++,
671
- parentActionId_: je
672
- };
673
- return je = c.actionId_, c;
674
- }
675
- function $i(e) {
676
- je !== e.actionId_ && m(30), je = e.parentActionId_, e.error_ !== void 0 && (d.suppressReactionErrors = !0), ye(e.prevAllowStateChanges_), se(e.prevAllowStateReads_), S(), e.runAsAction_ && U(e.prevDerivation_), d.suppressReactionErrors = !1;
677
- }
678
- function Gi(e, t) {
679
- var i = ke(e);
680
- try {
681
- return t();
682
- } finally {
683
- ye(i);
684
- }
685
- }
686
- function ke(e) {
687
- var t = d.allowStateChanges;
688
- return d.allowStateChanges = e, t;
689
- }
690
- function ye(e) {
691
- d.allowStateChanges = e;
692
- }
693
- var ln;
694
- ln = Symbol.toPrimitive;
695
- var ee = /* @__PURE__ */ function(e) {
696
- Jt(t, e);
697
- function t(n, r, a, o, s) {
698
- var u;
699
- return a === void 0 && (a = "ObservableValue"), s === void 0 && (s = Pe.default), u = e.call(this, a) || this, u.enhancer = void 0, u.name_ = void 0, u.equals = void 0, u.hasUnreportedChange_ = !1, u.interceptors_ = void 0, u.changeListeners_ = void 0, u.value_ = void 0, u.dehancer = void 0, u.enhancer = r, u.name_ = a, u.equals = s, u.value_ = r(n, void 0, a), u;
700
- }
701
- var i = t.prototype;
702
- return i.dehanceValue = function(r) {
703
- return this.dehancer !== void 0 ? this.dehancer(r) : r;
704
- }, i.set = function(r) {
705
- this.value_, r = this.prepareNewValue_(r), r !== d.UNCHANGED && this.setNewValue_(r);
706
- }, i.prepareNewValue_ = function(r) {
707
- if (N(this)) {
708
- var a = O(this, {
709
- object: this,
710
- type: D,
711
- newValue: r
712
- });
713
- if (!a)
714
- return d.UNCHANGED;
715
- r = a.newValue;
716
- }
717
- return r = this.enhancer(r, this.value_, this.name_), this.equals(this.value_, r) ? d.UNCHANGED : r;
718
- }, i.setNewValue_ = function(r) {
719
- var a = this.value_;
720
- this.value_ = r, this.reportChanged(), A(this) && w(this, {
721
- type: D,
722
- object: this,
723
- newValue: r,
724
- oldValue: a
725
- });
726
- }, i.get = function() {
727
- return this.reportObserved(), this.dehanceValue(this.value_);
728
- }, i.intercept_ = function(r) {
729
- return Se(this, r);
730
- }, i.observe_ = function(r, a) {
731
- return a && r({
732
- observableKind: "value",
733
- debugObjectName: this.name_,
734
- object: this,
735
- type: D,
736
- newValue: this.value_,
737
- oldValue: void 0
738
- }), Ne(this, r);
739
- }, i.raw = function() {
740
- return this.value_;
741
- }, i.toJSON = function() {
742
- return this.get();
743
- }, i.toString = function() {
744
- return this.name_ + "[" + this.value_ + "]";
745
- }, i.valueOf = function() {
746
- return Xt(this.get());
747
- }, i[ln] = function() {
748
- return this.valueOf();
749
- }, t;
750
- }(ge), dn;
751
- dn = Symbol.toPrimitive;
752
- var ce = /* @__PURE__ */ function() {
753
- function e(i) {
754
- this.dependenciesState_ = v.NOT_TRACKING_, this.observing_ = [], this.newObserving_ = null, this.isBeingObserved_ = !1, this.isPendingUnobservation_ = !1, this.observers_ = /* @__PURE__ */ new Set(), this.diffValue_ = 0, this.runId_ = 0, this.lastAccessedBy_ = 0, this.lowestObserverState_ = v.UP_TO_DATE_, this.unboundDepsCount_ = 0, this.value_ = new xe(null), this.name_ = void 0, this.triggeredBy_ = void 0, this.isComputing_ = !1, this.isRunningSetter_ = !1, this.derivation = void 0, this.setter_ = void 0, this.isTracing_ = G.NONE, this.scope_ = void 0, this.equals_ = void 0, this.requiresReaction_ = void 0, this.keepAlive_ = void 0, this.onBOL = void 0, this.onBUOL = void 0, i.get || m(31), this.derivation = i.get, this.name_ = i.name || "ComputedValue", i.set && (this.setter_ = ne("ComputedValue-setter", i.set)), this.equals_ = i.equals || (i.compareStructural || i.struct ? Pe.structural : Pe.default), this.scope_ = i.context, this.requiresReaction_ = i.requiresReaction, this.keepAlive_ = !!i.keepAlive;
755
- }
756
- var t = e.prototype;
757
- return t.onBecomeStale_ = function() {
758
- Wi(this);
759
- }, t.onBO = function() {
760
- this.onBOL && this.onBOL.forEach(function(n) {
761
- return n();
762
- });
763
- }, t.onBUO = function() {
764
- this.onBUOL && this.onBUOL.forEach(function(n) {
765
- return n();
766
- });
767
- }, t.get = function() {
768
- if (this.isComputing_ && m(32, this.name_, this.derivation), d.inBatch === 0 && // !globalState.trackingDerivatpion &&
769
- this.observers_.size === 0 && !this.keepAlive_)
770
- rt(this) && (this.warnAboutUntrackedRead_(), y(), this.value_ = this.computeValue_(!1), S());
771
- else if (_n(this), rt(this)) {
772
- var n = d.trackingContext;
773
- this.keepAlive_ && !n && (d.trackingContext = this), this.trackAndCompute() && qi(this), d.trackingContext = n;
774
- }
775
- var r = this.value_;
776
- if (Fe(r))
777
- throw r.cause;
778
- return r;
779
- }, t.set = function(n) {
780
- if (this.setter_) {
781
- this.isRunningSetter_ && m(33, this.name_), this.isRunningSetter_ = !0;
782
- try {
783
- this.setter_.call(this.scope_, n);
784
- } finally {
785
- this.isRunningSetter_ = !1;
786
- }
787
- } else
788
- m(34, this.name_);
789
- }, t.trackAndCompute = function() {
790
- var n = this.value_, r = (
791
- /* see #1208 */
792
- this.dependenciesState_ === v.NOT_TRACKING_
793
- ), a = this.computeValue_(!0), o = r || Fe(n) || Fe(a) || !this.equals_(n, a);
794
- return o && (this.value_ = a), o;
795
- }, t.computeValue_ = function(n) {
796
- this.isComputing_ = !0;
797
- var r = ke(!1), a;
798
- if (n)
799
- a = cn(this, this.derivation, this.scope_);
800
- else if (d.disableErrorBoundaries === !0)
801
- a = this.derivation.call(this.scope_);
802
- else
803
- try {
804
- a = this.derivation.call(this.scope_);
805
- } catch (o) {
806
- a = new xe(o);
807
- }
808
- return ye(r), this.isComputing_ = !1, a;
809
- }, t.suspend_ = function() {
810
- this.keepAlive_ || (at(this), this.value_ = void 0);
811
- }, t.observe_ = function(n, r) {
812
- var a = this, o = !0, s = void 0;
813
- return ir(function() {
814
- var u = a.get();
815
- if (!o || r) {
816
- var l = re();
817
- n({
818
- observableKind: "computed",
819
- debugObjectName: a.name_,
820
- type: D,
821
- object: a,
822
- newValue: u,
823
- oldValue: s
824
- }), U(l);
825
- }
826
- o = !1, s = u;
827
- });
828
- }, t.warnAboutUntrackedRead_ = function() {
829
- }, t.toString = function() {
830
- return this.name_ + "[" + this.derivation.toString() + "]";
831
- }, t.valueOf = function() {
832
- return Xt(this.get());
833
- }, t[dn] = function() {
834
- return this.valueOf();
835
- }, e;
836
- }(), ze = /* @__PURE__ */ q("ComputedValue", ce), v;
837
- (function(e) {
838
- e[e.NOT_TRACKING_ = -1] = "NOT_TRACKING_", e[e.UP_TO_DATE_ = 0] = "UP_TO_DATE_", e[e.POSSIBLY_STALE_ = 1] = "POSSIBLY_STALE_", e[e.STALE_ = 2] = "STALE_";
839
- })(v || (v = {}));
840
- var G;
841
- (function(e) {
842
- e[e.NONE = 0] = "NONE", e[e.LOG = 1] = "LOG", e[e.BREAK = 2] = "BREAK";
843
- })(G || (G = {}));
844
- var xe = function(t) {
845
- this.cause = void 0, this.cause = t;
846
- };
847
- function Fe(e) {
848
- return e instanceof xe;
849
- }
850
- function rt(e) {
851
- switch (e.dependenciesState_) {
852
- case v.UP_TO_DATE_:
853
- return !1;
854
- case v.NOT_TRACKING_:
855
- case v.STALE_:
856
- return !0;
857
- case v.POSSIBLY_STALE_: {
858
- for (var t = ht(!0), i = re(), n = e.observing_, r = n.length, a = 0; a < r; a++) {
859
- var o = n[a];
860
- if (ze(o)) {
861
- if (d.disableErrorBoundaries)
862
- o.get();
863
- else
864
- try {
865
- o.get();
866
- } catch {
867
- return U(i), se(t), !0;
868
- }
869
- if (e.dependenciesState_ === v.STALE_)
870
- return U(i), se(t), !0;
871
- }
872
- }
873
- return vn(e), U(i), se(t), !1;
874
- }
875
- }
876
- }
877
- function cn(e, t, i) {
878
- var n = ht(!0);
879
- vn(e), e.newObserving_ = new Array(e.observing_.length + 100), e.unboundDepsCount_ = 0, e.runId_ = ++d.runId;
880
- var r = d.trackingDerivation;
881
- d.trackingDerivation = e, d.inBatch++;
882
- var a;
883
- if (d.disableErrorBoundaries === !0)
884
- a = t.call(i);
885
- else
886
- try {
887
- a = t.call(i);
888
- } catch (o) {
889
- a = new xe(o);
890
- }
891
- return d.inBatch--, d.trackingDerivation = r, Ki(e), se(n), a;
892
- }
893
- function Ki(e) {
894
- for (var t = e.observing_, i = e.observing_ = e.newObserving_, n = v.UP_TO_DATE_, r = 0, a = e.unboundDepsCount_, o = 0; o < a; o++) {
895
- var s = i[o];
896
- s.diffValue_ === 0 && (s.diffValue_ = 1, r !== o && (i[r] = s), r++), s.dependenciesState_ > n && (n = s.dependenciesState_);
897
- }
898
- for (i.length = r, e.newObserving_ = null, a = t.length; a--; ) {
899
- var u = t[a];
900
- u.diffValue_ === 0 && mn(u, e), u.diffValue_ = 0;
901
- }
902
- for (; r--; ) {
903
- var l = i[r];
904
- l.diffValue_ === 1 && (l.diffValue_ = 0, zi(l, e));
905
- }
906
- n !== v.UP_TO_DATE_ && (e.dependenciesState_ = n, e.onBecomeStale_());
907
- }
908
- function at(e) {
909
- var t = e.observing_;
910
- e.observing_ = [];
911
- for (var i = t.length; i--; )
912
- mn(t[i], e);
913
- e.dependenciesState_ = v.NOT_TRACKING_;
914
- }
915
- function fn(e) {
916
- var t = re();
917
- try {
918
- return e();
919
- } finally {
920
- U(t);
921
- }
922
- }
923
- function re() {
924
- var e = d.trackingDerivation;
925
- return d.trackingDerivation = null, e;
926
- }
927
- function U(e) {
928
- d.trackingDerivation = e;
929
- }
930
- function ht(e) {
931
- var t = d.allowStateReads;
932
- return d.allowStateReads = e, t;
933
- }
934
- function se(e) {
935
- d.allowStateReads = e;
936
- }
937
- function vn(e) {
938
- if (e.dependenciesState_ !== v.UP_TO_DATE_) {
939
- e.dependenciesState_ = v.UP_TO_DATE_;
940
- for (var t = e.observing_, i = t.length; i--; )
941
- t[i].lowestObserverState_ = v.UP_TO_DATE_;
942
- }
943
- }
944
- var Xe = function() {
945
- this.version = 6, this.UNCHANGED = {}, this.trackingDerivation = null, this.trackingContext = null, this.runId = 0, this.mobxGuid = 0, this.inBatch = 0, this.pendingUnobservations = [], this.pendingReactions = [], this.isRunningReactions = !1, this.allowStateChanges = !1, this.allowStateReads = !0, this.enforceActions = !0, this.spyListeners = [], this.globalReactionErrorHandlers = [], this.computedRequiresReaction = !1, this.reactionRequiresObservable = !1, this.observableRequiresReaction = !1, this.disableErrorBoundaries = !1, this.suppressReactionErrors = !1, this.useProxies = !0, this.verifyProxies = !1, this.safeDescriptors = !0;
946
- }, Je = !0, d = /* @__PURE__ */ function() {
947
- var e = /* @__PURE__ */ $t();
948
- return e.__mobxInstanceCount > 0 && !e.__mobxGlobals && (Je = !1), e.__mobxGlobals && e.__mobxGlobals.version !== new Xe().version && (Je = !1), Je ? e.__mobxGlobals ? (e.__mobxInstanceCount += 1, e.__mobxGlobals.UNCHANGED || (e.__mobxGlobals.UNCHANGED = {}), e.__mobxGlobals) : (e.__mobxInstanceCount = 1, e.__mobxGlobals = /* @__PURE__ */ new Xe()) : (setTimeout(function() {
949
- m(35);
950
- }, 1), new Xe());
951
- }();
952
- function zi(e, t) {
953
- e.observers_.add(t), e.lowestObserverState_ > t.dependenciesState_ && (e.lowestObserverState_ = t.dependenciesState_);
954
- }
955
- function mn(e, t) {
956
- e.observers_.delete(t), e.observers_.size === 0 && hn(e);
957
- }
958
- function hn(e) {
959
- e.isPendingUnobservation_ === !1 && (e.isPendingUnobservation_ = !0, d.pendingUnobservations.push(e));
960
- }
961
- function y() {
962
- d.inBatch++;
963
- }
964
- function S() {
965
- if (--d.inBatch === 0) {
966
- gn();
967
- for (var e = d.pendingUnobservations, t = 0; t < e.length; t++) {
968
- var i = e[t];
969
- i.isPendingUnobservation_ = !1, i.observers_.size === 0 && (i.isBeingObserved_ && (i.isBeingObserved_ = !1, i.onBUO()), i instanceof ce && i.suspend_());
970
- }
971
- d.pendingUnobservations = [];
972
- }
973
- }
974
- function _n(e) {
975
- var t = d.trackingDerivation;
976
- return t !== null ? (t.runId_ !== e.lastAccessedBy_ && (e.lastAccessedBy_ = t.runId_, t.newObserving_[t.unboundDepsCount_++] = e, !e.isBeingObserved_ && d.trackingContext && (e.isBeingObserved_ = !0, e.onBO())), !0) : (e.observers_.size === 0 && d.inBatch > 0 && hn(e), !1);
977
- }
978
- function pn(e) {
979
- e.lowestObserverState_ !== v.STALE_ && (e.lowestObserverState_ = v.STALE_, e.observers_.forEach(function(t) {
980
- t.dependenciesState_ === v.UP_TO_DATE_ && t.onBecomeStale_(), t.dependenciesState_ = v.STALE_;
981
- }));
982
- }
983
- function qi(e) {
984
- e.lowestObserverState_ !== v.STALE_ && (e.lowestObserverState_ = v.STALE_, e.observers_.forEach(function(t) {
985
- t.dependenciesState_ === v.POSSIBLY_STALE_ ? t.dependenciesState_ = v.STALE_ : t.dependenciesState_ === v.UP_TO_DATE_ && (e.lowestObserverState_ = v.UP_TO_DATE_);
986
- }));
987
- }
988
- function Wi(e) {
989
- e.lowestObserverState_ === v.UP_TO_DATE_ && (e.lowestObserverState_ = v.POSSIBLY_STALE_, e.observers_.forEach(function(t) {
990
- t.dependenciesState_ === v.UP_TO_DATE_ && (t.dependenciesState_ = v.POSSIBLY_STALE_, t.onBecomeStale_());
991
- }));
992
- }
993
- var ot = /* @__PURE__ */ function() {
994
- function e(i, n, r, a) {
995
- i === void 0 && (i = "Reaction"), this.name_ = void 0, this.onInvalidate_ = void 0, this.errorHandler_ = void 0, this.requiresObservable_ = void 0, this.observing_ = [], this.newObserving_ = [], this.dependenciesState_ = v.NOT_TRACKING_, this.diffValue_ = 0, this.runId_ = 0, this.unboundDepsCount_ = 0, this.isDisposed_ = !1, this.isScheduled_ = !1, this.isTrackPending_ = !1, this.isRunning_ = !1, this.isTracing_ = G.NONE, this.name_ = i, this.onInvalidate_ = n, this.errorHandler_ = r, this.requiresObservable_ = a;
996
- }
997
- var t = e.prototype;
998
- return t.onBecomeStale_ = function() {
999
- this.schedule_();
1000
- }, t.schedule_ = function() {
1001
- this.isScheduled_ || (this.isScheduled_ = !0, d.pendingReactions.push(this), gn());
1002
- }, t.isScheduled = function() {
1003
- return this.isScheduled_;
1004
- }, t.runReaction_ = function() {
1005
- if (!this.isDisposed_) {
1006
- y(), this.isScheduled_ = !1;
1007
- var n = d.trackingContext;
1008
- if (d.trackingContext = this, rt(this)) {
1009
- this.isTrackPending_ = !0;
1010
- try {
1011
- this.onInvalidate_();
1012
- } catch (r) {
1013
- this.reportExceptionInDerivation_(r);
1014
- }
1015
- }
1016
- d.trackingContext = n, S();
1017
- }
1018
- }, t.track = function(n) {
1019
- if (!this.isDisposed_) {
1020
- y(), this.isRunning_ = !0;
1021
- var r = d.trackingContext;
1022
- d.trackingContext = this;
1023
- var a = cn(this, n, void 0);
1024
- d.trackingContext = r, this.isRunning_ = !1, this.isTrackPending_ = !1, this.isDisposed_ && at(this), Fe(a) && this.reportExceptionInDerivation_(a.cause), S();
1025
- }
1026
- }, t.reportExceptionInDerivation_ = function(n) {
1027
- var r = this;
1028
- if (this.errorHandler_) {
1029
- this.errorHandler_(n, this);
1030
- return;
1031
- }
1032
- if (d.disableErrorBoundaries)
1033
- throw n;
1034
- var a = "[mobx] uncaught error in '" + this + "'";
1035
- d.suppressReactionErrors || console.error(a, n), d.globalReactionErrorHandlers.forEach(function(o) {
1036
- return o(n, r);
1037
- });
1038
- }, t.dispose = function() {
1039
- this.isDisposed_ || (this.isDisposed_ = !0, this.isRunning_ || (y(), at(this), S()));
1040
- }, t.getDisposer_ = function() {
1041
- var n = this.dispose.bind(this);
1042
- return n[f] = this, n;
1043
- }, t.toString = function() {
1044
- return "Reaction[" + this.name_ + "]";
1045
- }, t.trace = function(n) {
1046
- n === void 0 && (n = !1), fr(this, n);
1047
- }, e;
1048
- }(), Hi = 100, Xi = function(t) {
1049
- return t();
1050
- };
1051
- function gn() {
1052
- d.inBatch > 0 || d.isRunningReactions || Xi(Ji);
1053
- }
1054
- function Ji() {
1055
- d.isRunningReactions = !0;
1056
- for (var e = d.pendingReactions, t = 0; e.length > 0; ) {
1057
- ++t === Hi && (console.error("[mobx] cycle in reaction: " + e[0]), e.splice(0));
1058
- for (var i = e.splice(0), n = 0, r = i.length; n < r; n++)
1059
- i[n].runReaction_();
1060
- }
1061
- d.isRunningReactions = !1;
1062
- }
1063
- var Re = /* @__PURE__ */ q("Reaction", ot);
1064
- function ue() {
1065
- return !1;
1066
- }
1067
- function Yi(e) {
1068
- return console.warn("[mobx.spy] Is a no-op in production builds"), function() {
1069
- };
1070
- }
1071
- var bn = "action", Qi = "action.bound", kn = "autoAction", Zi = "autoAction.bound", er = "<unnamed action>", yn = /* @__PURE__ */ be(bn), tr = /* @__PURE__ */ be(Qi, {
1072
- bound: !0
1073
- }), Sn = /* @__PURE__ */ be(kn, {
1074
- autoAction: !0
1075
- }), nr = /* @__PURE__ */ be(Zi, {
1076
- autoAction: !0,
1077
- bound: !0
1078
- });
1079
- function Nn(e) {
1080
- var t = function(n, r) {
1081
- if (C(n))
1082
- return ne(n.name || er, n, e);
1083
- if (C(r))
1084
- return ne(n, r, e);
1085
- if (K(r))
1086
- return pe(n, r, e ? Sn : yn);
1087
- if (K(n))
1088
- return T(be(e ? kn : bn, {
1089
- name: n,
1090
- autoAction: e
1091
- }));
1092
- };
1093
- return t;
1094
- }
1095
- var Z = /* @__PURE__ */ Nn(!1);
1096
- Object.assign(Z, yn);
1097
- var fe = /* @__PURE__ */ Nn(!0);
1098
- Object.assign(fe, Sn);
1099
- Z.bound = /* @__PURE__ */ T(tr);
1100
- fe.bound = /* @__PURE__ */ T(nr);
1101
- function _t(e) {
1102
- return C(e) && e.isMobxAction === !0;
1103
- }
1104
- function ir(e, t) {
1105
- var i, n;
1106
- t === void 0 && (t = Gt);
1107
- var r = (i = (n = t) == null ? void 0 : n.name) != null ? i : "Autorun", a = !t.scheduler && !t.delay, o;
1108
- if (a)
1109
- o = new ot(r, function() {
1110
- this.track(l);
1111
- }, t.onError, t.requiresObservable);
1112
- else {
1113
- var s = ar(t), u = !1;
1114
- o = new ot(r, function() {
1115
- u || (u = !0, s(function() {
1116
- u = !1, o.isDisposed_ || o.track(l);
1117
- }));
1118
- }, t.onError, t.requiresObservable);
1119
- }
1120
- function l() {
1121
- e(o);
1122
- }
1123
- return o.schedule_(), o.getDisposer_();
1124
- }
1125
- var rr = function(t) {
1126
- return t();
1127
- };
1128
- function ar(e) {
1129
- return e.scheduler ? e.scheduler : e.delay ? function(t) {
1130
- return setTimeout(t, e.delay);
1131
- } : rr;
1132
- }
1133
- var or = "onBO", sr = "onBUO";
1134
- function ur(e, t, i) {
1135
- return An(or, e, t, i);
1136
- }
1137
- function On(e, t, i) {
1138
- return An(sr, e, t, i);
1139
- }
1140
- function An(e, t, i, n) {
1141
- var r = typeof n == "function" ? z(t, i) : z(t), a = C(n) ? n : i, o = e + "L";
1142
- return r[o] ? r[o].add(a) : r[o] = /* @__PURE__ */ new Set([a]), function() {
1143
- var s = r[o];
1144
- s && (s.delete(a), s.size === 0 && delete r[o]);
1145
- };
1146
- }
1147
- function wn(e, t, i, n) {
1148
- var r = ei(t), a = We(e, n)[f];
1149
- y();
1150
- try {
1151
- le(r).forEach(function(o) {
1152
- a.extend_(
1153
- o,
1154
- r[o],
1155
- // must pass "undefined" for { key: undefined }
1156
- i && o in i ? i[o] : !0
1157
- );
1158
- });
1159
- } finally {
1160
- S();
1161
- }
1162
- return e;
1163
- }
1164
- var lr = 0;
1165
- function Cn() {
1166
- this.message = "FLOW_CANCELLED";
1167
- }
1168
- Cn.prototype = /* @__PURE__ */ Object.create(Error.prototype);
1169
- var Ct = /* @__PURE__ */ Zt("flow"), dr = /* @__PURE__ */ Zt("flow.bound", {
1170
- bound: !0
1171
- }), ve = /* @__PURE__ */ Object.assign(function(t, i) {
1172
- if (K(i))
1173
- return pe(t, i, Ct);
1174
- var n = t, r = n.name || "<unnamed flow>", a = function() {
1175
- var s = this, u = arguments, l = ++lr, c = Z(r + " - runid: " + l + " - init", n).apply(s, u), h, _ = void 0, P = new Promise(function(H, E) {
1176
- var F = 0;
1177
- h = E;
1178
- function Oe(k) {
1179
- _ = void 0;
1180
- var I;
1181
- try {
1182
- I = Z(r + " - runid: " + l + " - yield " + F++, c.next).call(c, k);
1183
- } catch ($) {
1184
- return E($);
1185
- }
1186
- oe(I);
1187
- }
1188
- function He(k) {
1189
- _ = void 0;
1190
- var I;
1191
- try {
1192
- I = Z(r + " - runid: " + l + " - yield " + F++, c.throw).call(c, k);
1193
- } catch ($) {
1194
- return E($);
1195
- }
1196
- oe(I);
1197
- }
1198
- function oe(k) {
1199
- if (C(k?.then)) {
1200
- k.then(oe, E);
1201
- return;
1202
- }
1203
- return k.done ? H(k.value) : (_ = Promise.resolve(k.value), _.then(Oe, He));
1204
- }
1205
- Oe(void 0);
1206
- });
1207
- return P.cancel = Z(r + " - runid: " + l + " - cancel", function() {
1208
- try {
1209
- _ && Et(_);
1210
- var H = c.return(void 0), E = Promise.resolve(H.value);
1211
- E.then(J, J), Et(E), h(new Cn());
1212
- } catch (F) {
1213
- h(F);
1214
- }
1215
- }), P;
1216
- };
1217
- return a.isMobXFlow = !0, a;
1218
- }, Ct);
1219
- ve.bound = /* @__PURE__ */ T(dr);
1220
- function Et(e) {
1221
- C(e.cancel) && e.cancel();
1222
- }
1223
- function Ve(e) {
1224
- return e?.isMobXFlow === !0;
1225
- }
1226
- function cr(e, t) {
1227
- return e ? t !== void 0 ? me(e) ? e[f].values_.has(t) : !1 : me(e) || !!e[f] || vt(e) || Re(e) || ze(e) : !1;
1228
- }
1229
- function En(e) {
1230
- return cr(e);
1231
- }
1232
- function fr() {
1233
- m("trace() is not available in production builds");
1234
- for (var e = !1, t = arguments.length, i = new Array(t), n = 0; n < t; n++)
1235
- i[n] = arguments[n];
1236
- typeof i[i.length - 1] == "boolean" && (e = i.pop());
1237
- var r = vr(i);
1238
- if (!r)
1239
- return m("'trace(break?)' can only be used inside a tracked computed value or a Reaction. Consider passing in the computed value or reaction explicitly");
1240
- r.isTracing_ === G.NONE && console.log("[mobx.trace] '" + r.name_ + "' tracing enabled"), r.isTracing_ = e ? G.BREAK : G.LOG;
1241
- }
1242
- function vr(e) {
1243
- switch (e.length) {
1244
- case 0:
1245
- return d.trackingDerivation;
1246
- case 1:
1247
- return z(e[0]);
1248
- case 2:
1249
- return z(e[0], e[1]);
1250
- }
1251
- }
1252
- function j(e, t) {
1253
- t === void 0 && (t = void 0), y();
1254
- try {
1255
- return e.apply(t);
1256
- } finally {
1257
- S();
1258
- }
1259
- }
1260
- function X(e) {
1261
- return e[f];
1262
- }
1263
- var mr = {
1264
- has: function(t, i) {
1265
- return X(t).has_(i);
1266
- },
1267
- get: function(t, i) {
1268
- return X(t).get_(i);
1269
- },
1270
- set: function(t, i, n) {
1271
- var r;
1272
- return K(i) ? (r = X(t).set_(i, n, !0)) != null ? r : !0 : !1;
1273
- },
1274
- deleteProperty: function(t, i) {
1275
- var n;
1276
- return K(i) ? (n = X(t).delete_(i, !0)) != null ? n : !0 : !1;
1277
- },
1278
- defineProperty: function(t, i, n) {
1279
- var r;
1280
- return (r = X(t).defineProperty_(i, n)) != null ? r : !0;
1281
- },
1282
- ownKeys: function(t) {
1283
- return X(t).ownKeys_();
1284
- },
1285
- preventExtensions: function(t) {
1286
- m(13);
1287
- }
1288
- };
1289
- function hr(e, t) {
1290
- var i, n;
1291
- return Kt(), e = We(e, t), (n = (i = e[f]).proxy_) != null ? n : i.proxy_ = new Proxy(e, mr);
1292
- }
1293
- function N(e) {
1294
- return e.interceptors_ !== void 0 && e.interceptors_.length > 0;
1295
- }
1296
- function Se(e, t) {
1297
- var i = e.interceptors_ || (e.interceptors_ = []);
1298
- return i.push(t), zt(function() {
1299
- var n = i.indexOf(t);
1300
- n !== -1 && i.splice(n, 1);
1301
- });
1302
- }
1303
- function O(e, t) {
1304
- var i = re();
1305
- try {
1306
- for (var n = [].concat(e.interceptors_ || []), r = 0, a = n.length; r < a && (t = n[r](t), t && !t.type && m(14), !!t); r++)
1307
- ;
1308
- return t;
1309
- } finally {
1310
- U(i);
1311
- }
1312
- }
1313
- function A(e) {
1314
- return e.changeListeners_ !== void 0 && e.changeListeners_.length > 0;
1315
- }
1316
- function Ne(e, t) {
1317
- var i = e.changeListeners_ || (e.changeListeners_ = []);
1318
- return i.push(t), zt(function() {
1319
- var n = i.indexOf(t);
1320
- n !== -1 && i.splice(n, 1);
1321
- });
1322
- }
1323
- function w(e, t) {
1324
- var i = re(), n = e.changeListeners_;
1325
- if (n) {
1326
- n = n.slice();
1327
- for (var r = 0, a = n.length; r < a; r++)
1328
- n[r](t);
1329
- U(i);
1330
- }
1331
- }
1332
- var Ye = /* @__PURE__ */ Symbol("mobx-keys");
1333
- function _r(e, t, i) {
1334
- if (R(e))
1335
- return wn(e, e, t, i);
1336
- var n = We(e, i)[f];
1337
- if (!e[Ye]) {
1338
- var r = Object.getPrototypeOf(e), a = new Set([].concat(le(e), le(r)));
1339
- a.delete("constructor"), a.delete(f), Me(r, Ye, a);
1340
- }
1341
- y();
1342
- try {
1343
- e[Ye].forEach(function(o) {
1344
- return n.make_(
1345
- o,
1346
- // must pass "undefined" for { key: undefined }
1347
- t && o in t ? t[o] : !0
1348
- );
1349
- });
1350
- } finally {
1351
- S();
1352
- }
1353
- return e;
1354
- }
1355
- var Ft = "splice", D = "update", pr = 1e4, gr = {
1356
- get: function(t, i) {
1357
- var n = t[f];
1358
- return i === f ? n : i === "length" ? n.getArrayLength_() : typeof i == "string" && !isNaN(i) ? n.get_(parseInt(i)) : L(Ie, i) ? Ie[i] : t[i];
1359
- },
1360
- set: function(t, i, n) {
1361
- var r = t[f];
1362
- return i === "length" && r.setArrayLength_(n), typeof i == "symbol" || isNaN(i) ? t[i] = n : r.set_(parseInt(i), n), !0;
1363
- },
1364
- preventExtensions: function() {
1365
- m(15);
1366
- }
1367
- }, pt = /* @__PURE__ */ function() {
1368
- function e(i, n, r, a) {
1369
- i === void 0 && (i = "ObservableArray"), this.owned_ = void 0, this.legacyMode_ = void 0, this.atom_ = void 0, this.values_ = [], this.interceptors_ = void 0, this.changeListeners_ = void 0, this.enhancer_ = void 0, this.dehancer = void 0, this.proxy_ = void 0, this.lastKnownLength_ = 0, this.owned_ = r, this.legacyMode_ = a, this.atom_ = new ge(i), this.enhancer_ = function(o, s) {
1370
- return n(o, s, "ObservableArray[..]");
1371
- };
1372
- }
1373
- var t = e.prototype;
1374
- return t.dehanceValue_ = function(n) {
1375
- return this.dehancer !== void 0 ? this.dehancer(n) : n;
1376
- }, t.dehanceValues_ = function(n) {
1377
- return this.dehancer !== void 0 && n.length > 0 ? n.map(this.dehancer) : n;
1378
- }, t.intercept_ = function(n) {
1379
- return Se(this, n);
1380
- }, t.observe_ = function(n, r) {
1381
- return r === void 0 && (r = !1), r && n({
1382
- observableKind: "array",
1383
- object: this.proxy_,
1384
- debugObjectName: this.atom_.name_,
1385
- type: "splice",
1386
- index: 0,
1387
- added: this.values_.slice(),
1388
- addedCount: this.values_.length,
1389
- removed: [],
1390
- removedCount: 0
1391
- }), Ne(this, n);
1392
- }, t.getArrayLength_ = function() {
1393
- return this.atom_.reportObserved(), this.values_.length;
1394
- }, t.setArrayLength_ = function(n) {
1395
- (typeof n != "number" || isNaN(n) || n < 0) && m("Out of range: " + n);
1396
- var r = this.values_.length;
1397
- if (n !== r)
1398
- if (n > r) {
1399
- for (var a = new Array(n - r), o = 0; o < n - r; o++)
1400
- a[o] = void 0;
1401
- this.spliceWithArray_(r, 0, a);
1402
- } else
1403
- this.spliceWithArray_(n, r - n);
1404
- }, t.updateArrayLength_ = function(n, r) {
1405
- n !== this.lastKnownLength_ && m(16), this.lastKnownLength_ += r, this.legacyMode_ && r > 0 && Bn(n + r + 1);
1406
- }, t.spliceWithArray_ = function(n, r, a) {
1407
- var o = this;
1408
- this.atom_;
1409
- var s = this.values_.length;
1410
- if (n === void 0 ? n = 0 : n > s ? n = s : n < 0 && (n = Math.max(0, s + n)), arguments.length === 1 ? r = s - n : r == null ? r = 0 : r = Math.max(0, Math.min(r, s - n)), a === void 0 && (a = nt), N(this)) {
1411
- var u = O(this, {
1412
- object: this.proxy_,
1413
- type: Ft,
1414
- index: n,
1415
- removedCount: r,
1416
- added: a
1417
- });
1418
- if (!u)
1419
- return nt;
1420
- r = u.removedCount, a = u.added;
1421
- }
1422
- if (a = a.length === 0 ? a : a.map(function(h) {
1423
- return o.enhancer_(h, void 0);
1424
- }), this.legacyMode_) {
1425
- var l = a.length - r;
1426
- this.updateArrayLength_(s, l);
1427
- }
1428
- var c = this.spliceItemsIntoValues_(n, r, a);
1429
- return (r !== 0 || a.length !== 0) && this.notifyArraySplice_(n, a, c), this.dehanceValues_(c);
1430
- }, t.spliceItemsIntoValues_ = function(n, r, a) {
1431
- if (a.length < pr) {
1432
- var o;
1433
- return (o = this.values_).splice.apply(o, [n, r].concat(a));
1434
- } else {
1435
- var s = this.values_.slice(n, n + r), u = this.values_.slice(n + r);
1436
- this.values_.length += a.length - r;
1437
- for (var l = 0; l < a.length; l++)
1438
- this.values_[n + l] = a[l];
1439
- for (var c = 0; c < u.length; c++)
1440
- this.values_[n + a.length + c] = u[c];
1441
- return s;
1442
- }
1443
- }, t.notifyArrayChildUpdate_ = function(n, r, a) {
1444
- var o = !this.owned_ && ue(), s = A(this), u = s || o ? {
1445
- observableKind: "array",
1446
- object: this.proxy_,
1447
- type: D,
1448
- debugObjectName: this.atom_.name_,
1449
- index: n,
1450
- newValue: r,
1451
- oldValue: a
1452
- } : null;
1453
- this.atom_.reportChanged(), s && w(this, u);
1454
- }, t.notifyArraySplice_ = function(n, r, a) {
1455
- var o = !this.owned_ && ue(), s = A(this), u = s || o ? {
1456
- observableKind: "array",
1457
- object: this.proxy_,
1458
- debugObjectName: this.atom_.name_,
1459
- type: Ft,
1460
- index: n,
1461
- removed: a,
1462
- added: r,
1463
- removedCount: a.length,
1464
- addedCount: r.length
1465
- } : null;
1466
- this.atom_.reportChanged(), s && w(this, u);
1467
- }, t.get_ = function(n) {
1468
- if (n < this.values_.length)
1469
- return this.atom_.reportObserved(), this.dehanceValue_(this.values_[n]);
1470
- console.warn("[mobx.array] Attempt to read an array index (" + n + ") that is out of bounds (" + this.values_.length + "). Please check length first. Out of bound indices will not be tracked by MobX");
1471
- }, t.set_ = function(n, r) {
1472
- var a = this.values_;
1473
- if (n < a.length) {
1474
- this.atom_;
1475
- var o = a[n];
1476
- if (N(this)) {
1477
- var s = O(this, {
1478
- type: D,
1479
- object: this.proxy_,
1480
- index: n,
1481
- newValue: r
1482
- });
1483
- if (!s)
1484
- return;
1485
- r = s.newValue;
1486
- }
1487
- r = this.enhancer_(r, o);
1488
- var u = r !== o;
1489
- u && (a[n] = r, this.notifyArrayChildUpdate_(n, r, o));
1490
- } else
1491
- n === a.length ? this.spliceWithArray_(n, 0, [r]) : m(17, n, a.length);
1492
- }, e;
1493
- }();
1494
- function br(e, t, i, n) {
1495
- i === void 0 && (i = "ObservableArray"), n === void 0 && (n = !1), Kt();
1496
- var r = new pt(i, t, n, !1);
1497
- Wt(r.values_, f, r);
1498
- var a = new Proxy(r.values_, gr);
1499
- if (r.proxy_ = a, e && e.length) {
1500
- var o = ke(!0);
1501
- r.spliceWithArray_(0, 0, e), ye(o);
1502
- }
1503
- return a;
1504
- }
1505
- var Ie = {
1506
- clear: function() {
1507
- return this.splice(0);
1508
- },
1509
- replace: function(t) {
1510
- var i = this[f];
1511
- return i.spliceWithArray_(0, i.values_.length, t);
1512
- },
1513
- // Used by JSON.stringify
1514
- toJSON: function() {
1515
- return this.slice();
1516
- },
1517
- /*
1518
- * functions that do alter the internal structure of the array, (based on lib.es6.d.ts)
1519
- * since these functions alter the inner structure of the array, the have side effects.
1520
- * Because the have side effects, they should not be used in computed function,
1521
- * and for that reason the do not call dependencyState.notifyObserved
1522
- */
1523
- splice: function(t, i) {
1524
- for (var n = arguments.length, r = new Array(n > 2 ? n - 2 : 0), a = 2; a < n; a++)
1525
- r[a - 2] = arguments[a];
1526
- var o = this[f];
1527
- switch (arguments.length) {
1528
- case 0:
1529
- return [];
1530
- case 1:
1531
- return o.spliceWithArray_(t);
1532
- case 2:
1533
- return o.spliceWithArray_(t, i);
1534
- }
1535
- return o.spliceWithArray_(t, i, r);
1536
- },
1537
- spliceWithArray: function(t, i, n) {
1538
- return this[f].spliceWithArray_(t, i, n);
1539
- },
1540
- push: function() {
1541
- for (var t = this[f], i = arguments.length, n = new Array(i), r = 0; r < i; r++)
1542
- n[r] = arguments[r];
1543
- return t.spliceWithArray_(t.values_.length, 0, n), t.values_.length;
1544
- },
1545
- pop: function() {
1546
- return this.splice(Math.max(this[f].values_.length - 1, 0), 1)[0];
1547
- },
1548
- shift: function() {
1549
- return this.splice(0, 1)[0];
1550
- },
1551
- unshift: function() {
1552
- for (var t = this[f], i = arguments.length, n = new Array(i), r = 0; r < i; r++)
1553
- n[r] = arguments[r];
1554
- return t.spliceWithArray_(0, 0, n), t.values_.length;
1555
- },
1556
- reverse: function() {
1557
- return d.trackingDerivation && m(37, "reverse"), this.replace(this.slice().reverse()), this;
1558
- },
1559
- sort: function() {
1560
- d.trackingDerivation && m(37, "sort");
1561
- var t = this.slice();
1562
- return t.sort.apply(t, arguments), this.replace(t), this;
1563
- },
1564
- remove: function(t) {
1565
- var i = this[f], n = i.dehanceValues_(i.values_).indexOf(t);
1566
- return n > -1 ? (this.splice(n, 1), !0) : !1;
1567
- }
1568
- };
1569
- p("concat", V);
1570
- p("flat", V);
1571
- p("includes", V);
1572
- p("indexOf", V);
1573
- p("join", V);
1574
- p("lastIndexOf", V);
1575
- p("slice", V);
1576
- p("toString", V);
1577
- p("toLocaleString", V);
1578
- p("every", M);
1579
- p("filter", M);
1580
- p("find", M);
1581
- p("findIndex", M);
1582
- p("flatMap", M);
1583
- p("forEach", M);
1584
- p("map", M);
1585
- p("some", M);
1586
- p("reduce", Fn);
1587
- p("reduceRight", Fn);
1588
- function p(e, t) {
1589
- typeof Array.prototype[e] == "function" && (Ie[e] = t(e));
1590
- }
1591
- function V(e) {
1592
- return function() {
1593
- var t = this[f];
1594
- t.atom_.reportObserved();
1595
- var i = t.dehanceValues_(t.values_);
1596
- return i[e].apply(i, arguments);
1597
- };
1598
- }
1599
- function M(e) {
1600
- return function(t, i) {
1601
- var n = this, r = this[f];
1602
- r.atom_.reportObserved();
1603
- var a = r.dehanceValues_(r.values_);
1604
- return a[e](function(o, s) {
1605
- return t.call(i, o, s, n);
1606
- });
1607
- };
1608
- }
1609
- function Fn(e) {
1610
- return function() {
1611
- var t = this, i = this[f];
1612
- i.atom_.reportObserved();
1613
- var n = i.dehanceValues_(i.values_), r = arguments[0];
1614
- return arguments[0] = function(a, o, s) {
1615
- return r(a, o, s, t);
1616
- }, n[e].apply(n, arguments);
1617
- };
1618
- }
1619
- var kr = /* @__PURE__ */ q("ObservableArrayAdministration", pt);
1620
- function qe(e) {
1621
- return Ue(e) && kr(e[f]);
1622
- }
1623
- var Tn, Dn, yr = {}, B = "add", Be = "delete";
1624
- Tn = Symbol.iterator;
1625
- Dn = Symbol.toStringTag;
1626
- var Pn = /* @__PURE__ */ function() {
1627
- function e(i, n, r) {
1628
- var a = this;
1629
- n === void 0 && (n = te), r === void 0 && (r = "ObservableMap"), this.enhancer_ = void 0, this.name_ = void 0, this[f] = yr, this.data_ = void 0, this.hasMap_ = void 0, this.keysAtom_ = void 0, this.interceptors_ = void 0, this.changeListeners_ = void 0, this.dehancer = void 0, this.enhancer_ = n, this.name_ = r, C(Map) || m(18), this.keysAtom_ = Yt("ObservableMap.keys()"), this.data_ = /* @__PURE__ */ new Map(), this.hasMap_ = /* @__PURE__ */ new Map(), Gi(!0, function() {
1630
- a.merge(i);
1631
- });
1632
- }
1633
- var t = e.prototype;
1634
- return t.has_ = function(n) {
1635
- return this.data_.has(n);
1636
- }, t.has = function(n) {
1637
- var r = this;
1638
- if (!d.trackingDerivation)
1639
- return this.has_(n);
1640
- var a = this.hasMap_.get(n);
1641
- if (!a) {
1642
- var o = a = new ee(this.has_(n), $e, "ObservableMap.key?", !1);
1643
- this.hasMap_.set(n, o), On(o, function() {
1644
- return r.hasMap_.delete(n);
1645
- });
1646
- }
1647
- return a.get();
1648
- }, t.set = function(n, r) {
1649
- var a = this.has_(n);
1650
- if (N(this)) {
1651
- var o = O(this, {
1652
- type: a ? D : B,
1653
- object: this,
1654
- newValue: r,
1655
- name: n
1656
- });
1657
- if (!o)
1658
- return this;
1659
- r = o.newValue;
1660
- }
1661
- return a ? this.updateValue_(n, r) : this.addValue_(n, r), this;
1662
- }, t.delete = function(n) {
1663
- var r = this;
1664
- if (this.keysAtom_, N(this)) {
1665
- var a = O(this, {
1666
- type: Be,
1667
- object: this,
1668
- name: n
1669
- });
1670
- if (!a)
1671
- return !1;
1672
- }
1673
- if (this.has_(n)) {
1674
- var o = ue(), s = A(this), u = s || o ? {
1675
- observableKind: "map",
1676
- debugObjectName: this.name_,
1677
- type: Be,
1678
- object: this,
1679
- oldValue: this.data_.get(n).value_,
1680
- name: n
1681
- } : null;
1682
- return j(function() {
1683
- var l;
1684
- r.keysAtom_.reportChanged(), (l = r.hasMap_.get(n)) == null || l.setNewValue_(!1);
1685
- var c = r.data_.get(n);
1686
- c.setNewValue_(void 0), r.data_.delete(n);
1687
- }), s && w(this, u), !0;
1688
- }
1689
- return !1;
1690
- }, t.updateValue_ = function(n, r) {
1691
- var a = this.data_.get(n);
1692
- if (r = a.prepareNewValue_(r), r !== d.UNCHANGED) {
1693
- var o = ue(), s = A(this), u = s || o ? {
1694
- observableKind: "map",
1695
- debugObjectName: this.name_,
1696
- type: D,
1697
- object: this,
1698
- oldValue: a.value_,
1699
- name: n,
1700
- newValue: r
1701
- } : null;
1702
- a.setNewValue_(r), s && w(this, u);
1703
- }
1704
- }, t.addValue_ = function(n, r) {
1705
- var a = this;
1706
- this.keysAtom_, j(function() {
1707
- var l, c = new ee(r, a.enhancer_, "ObservableMap.key", !1);
1708
- a.data_.set(n, c), r = c.value_, (l = a.hasMap_.get(n)) == null || l.setNewValue_(!0), a.keysAtom_.reportChanged();
1709
- });
1710
- var o = ue(), s = A(this), u = s || o ? {
1711
- observableKind: "map",
1712
- debugObjectName: this.name_,
1713
- type: B,
1714
- object: this,
1715
- name: n,
1716
- newValue: r
1717
- } : null;
1718
- s && w(this, u);
1719
- }, t.get = function(n) {
1720
- return this.has(n) ? this.dehanceValue_(this.data_.get(n).get()) : this.dehanceValue_(void 0);
1721
- }, t.dehanceValue_ = function(n) {
1722
- return this.dehancer !== void 0 ? this.dehancer(n) : n;
1723
- }, t.keys = function() {
1724
- return this.keysAtom_.reportObserved(), this.data_.keys();
1725
- }, t.values = function() {
1726
- var n = this, r = this.keys();
1727
- return he({
1728
- next: function() {
1729
- var o = r.next(), s = o.done, u = o.value;
1730
- return {
1731
- done: s,
1732
- value: s ? void 0 : n.get(u)
1733
- };
1734
- }
1735
- });
1736
- }, t.entries = function() {
1737
- var n = this, r = this.keys();
1738
- return he({
1739
- next: function() {
1740
- var o = r.next(), s = o.done, u = o.value;
1741
- return {
1742
- done: s,
1743
- value: s ? void 0 : [u, n.get(u)]
1744
- };
1745
- }
1746
- });
1747
- }, t[Tn] = function() {
1748
- return this.entries();
1749
- }, t.forEach = function(n, r) {
1750
- for (var a = Y(this), o; !(o = a()).done; ) {
1751
- var s = o.value, u = s[0], l = s[1];
1752
- n.call(r, l, u, this);
1753
- }
1754
- }, t.merge = function(n) {
1755
- var r = this;
1756
- return W(n) && (n = new Map(n)), j(function() {
1757
- R(n) ? Zn(n).forEach(function(a) {
1758
- return r.set(a, n[a]);
1759
- }) : Array.isArray(n) ? n.forEach(function(a) {
1760
- var o = a[0], s = a[1];
1761
- return r.set(o, s);
1762
- }) : ie(n) ? (n.constructor !== Map && m(19, n), n.forEach(function(a, o) {
1763
- return r.set(o, a);
1764
- })) : n != null && m(20, n);
1765
- }), this;
1766
- }, t.clear = function() {
1767
- var n = this;
1768
- j(function() {
1769
- fn(function() {
1770
- for (var r = Y(n.keys()), a; !(a = r()).done; ) {
1771
- var o = a.value;
1772
- n.delete(o);
1773
- }
1774
- });
1775
- });
1776
- }, t.replace = function(n) {
1777
- var r = this;
1778
- return j(function() {
1779
- for (var a = Sr(n), o = /* @__PURE__ */ new Map(), s = !1, u = Y(r.data_.keys()), l; !(l = u()).done; ) {
1780
- var c = l.value;
1781
- if (!a.has(c)) {
1782
- var h = r.delete(c);
1783
- if (h)
1784
- s = !0;
1785
- else {
1786
- var _ = r.data_.get(c);
1787
- o.set(c, _);
1788
- }
1789
- }
1790
- }
1791
- for (var P = Y(a.entries()), H; !(H = P()).done; ) {
1792
- var E = H.value, F = E[0], Oe = E[1], He = r.data_.has(F);
1793
- if (r.set(F, Oe), r.data_.has(F)) {
1794
- var oe = r.data_.get(F);
1795
- o.set(F, oe), He || (s = !0);
1796
- }
1797
- }
1798
- if (!s)
1799
- if (r.data_.size !== o.size)
1800
- r.keysAtom_.reportChanged();
1801
- else
1802
- for (var k = r.data_.keys(), I = o.keys(), $ = k.next(), kt = I.next(); !$.done; ) {
1803
- if ($.value !== kt.value) {
1804
- r.keysAtom_.reportChanged();
1805
- break;
1806
- }
1807
- $ = k.next(), kt = I.next();
1808
- }
1809
- r.data_ = o;
1810
- }), this;
1811
- }, t.toString = function() {
1812
- return "[object ObservableMap]";
1813
- }, t.toJSON = function() {
1814
- return Array.from(this);
1815
- }, t.observe_ = function(n, r) {
1816
- return Ne(this, n);
1817
- }, t.intercept_ = function(n) {
1818
- return Se(this, n);
1819
- }, ft(e, [{
1820
- key: "size",
1821
- get: function() {
1822
- return this.keysAtom_.reportObserved(), this.data_.size;
1823
- }
1824
- }, {
1825
- key: Dn,
1826
- get: function() {
1827
- return "Map";
1828
- }
1829
- }]), e;
1830
- }(), W = /* @__PURE__ */ q("ObservableMap", Pn);
1831
- function Sr(e) {
1832
- if (ie(e) || W(e))
1833
- return e;
1834
- if (Array.isArray(e))
1835
- return new Map(e);
1836
- if (R(e)) {
1837
- var t = /* @__PURE__ */ new Map();
1838
- for (var i in e)
1839
- t.set(i, e[i]);
1840
- return t;
1841
- } else
1842
- return m(21, e);
1843
- }
1844
- var jn, xn, Nr = {};
1845
- jn = Symbol.iterator;
1846
- xn = Symbol.toStringTag;
1847
- var Rn = /* @__PURE__ */ function() {
1848
- function e(i, n, r) {
1849
- n === void 0 && (n = te), r === void 0 && (r = "ObservableSet"), this.name_ = void 0, this[f] = Nr, this.data_ = /* @__PURE__ */ new Set(), this.atom_ = void 0, this.changeListeners_ = void 0, this.interceptors_ = void 0, this.dehancer = void 0, this.enhancer_ = void 0, this.name_ = r, C(Set) || m(22), this.atom_ = Yt(this.name_), this.enhancer_ = function(a, o) {
1850
- return n(a, o, r);
1851
- }, i && this.replace(i);
1852
- }
1853
- var t = e.prototype;
1854
- return t.dehanceValue_ = function(n) {
1855
- return this.dehancer !== void 0 ? this.dehancer(n) : n;
1856
- }, t.clear = function() {
1857
- var n = this;
1858
- j(function() {
1859
- fn(function() {
1860
- for (var r = Y(n.data_.values()), a; !(a = r()).done; ) {
1861
- var o = a.value;
1862
- n.delete(o);
1863
- }
1864
- });
1865
- });
1866
- }, t.forEach = function(n, r) {
1867
- for (var a = Y(this), o; !(o = a()).done; ) {
1868
- var s = o.value;
1869
- n.call(r, s, s, this);
1870
- }
1871
- }, t.add = function(n) {
1872
- var r = this;
1873
- if (this.atom_, N(this)) {
1874
- var a = O(this, {
1875
- type: B,
1876
- object: this,
1877
- newValue: n
1878
- });
1879
- if (!a)
1880
- return this;
1881
- }
1882
- if (!this.has(n)) {
1883
- j(function() {
1884
- r.data_.add(r.enhancer_(n, void 0)), r.atom_.reportChanged();
1885
- });
1886
- var o = !1, s = A(this), u = s || o ? {
1887
- observableKind: "set",
1888
- debugObjectName: this.name_,
1889
- type: B,
1890
- object: this,
1891
- newValue: n
1892
- } : null;
1893
- s && w(this, u);
1894
- }
1895
- return this;
1896
- }, t.delete = function(n) {
1897
- var r = this;
1898
- if (N(this)) {
1899
- var a = O(this, {
1900
- type: Be,
1901
- object: this,
1902
- oldValue: n
1903
- });
1904
- if (!a)
1905
- return !1;
1906
- }
1907
- if (this.has(n)) {
1908
- var o = !1, s = A(this), u = s || o ? {
1909
- observableKind: "set",
1910
- debugObjectName: this.name_,
1911
- type: Be,
1912
- object: this,
1913
- oldValue: n
1914
- } : null;
1915
- return j(function() {
1916
- r.atom_.reportChanged(), r.data_.delete(n);
1917
- }), s && w(this, u), !0;
1918
- }
1919
- return !1;
1920
- }, t.has = function(n) {
1921
- return this.atom_.reportObserved(), this.data_.has(this.dehanceValue_(n));
1922
- }, t.entries = function() {
1923
- var n = 0, r = Array.from(this.keys()), a = Array.from(this.values());
1924
- return he({
1925
- next: function() {
1926
- var s = n;
1927
- return n += 1, s < a.length ? {
1928
- value: [r[s], a[s]],
1929
- done: !1
1930
- } : {
1931
- done: !0
1932
- };
1933
- }
1934
- });
1935
- }, t.keys = function() {
1936
- return this.values();
1937
- }, t.values = function() {
1938
- this.atom_.reportObserved();
1939
- var n = this, r = 0, a = Array.from(this.data_.values());
1940
- return he({
1941
- next: function() {
1942
- return r < a.length ? {
1943
- value: n.dehanceValue_(a[r++]),
1944
- done: !1
1945
- } : {
1946
- done: !0
1947
- };
1948
- }
1949
- });
1950
- }, t.replace = function(n) {
1951
- var r = this;
1952
- return ae(n) && (n = new Set(n)), j(function() {
1953
- Array.isArray(n) ? (r.clear(), n.forEach(function(a) {
1954
- return r.add(a);
1955
- })) : _e(n) ? (r.clear(), n.forEach(function(a) {
1956
- return r.add(a);
1957
- })) : n != null && m("Cannot initialize set from " + n);
1958
- }), this;
1959
- }, t.observe_ = function(n, r) {
1960
- return Ne(this, n);
1961
- }, t.intercept_ = function(n) {
1962
- return Se(this, n);
1963
- }, t.toJSON = function() {
1964
- return Array.from(this);
1965
- }, t.toString = function() {
1966
- return "[object ObservableSet]";
1967
- }, t[jn] = function() {
1968
- return this.values();
1969
- }, ft(e, [{
1970
- key: "size",
1971
- get: function() {
1972
- return this.atom_.reportObserved(), this.data_.size;
1973
- }
1974
- }, {
1975
- key: xn,
1976
- get: function() {
1977
- return "Set";
1978
- }
1979
- }]), e;
1980
- }(), ae = /* @__PURE__ */ q("ObservableSet", Rn), Tt = /* @__PURE__ */ Object.create(null), Dt = "remove", Vn = /* @__PURE__ */ function() {
1981
- function e(i, n, r, a) {
1982
- n === void 0 && (n = /* @__PURE__ */ new Map()), a === void 0 && (a = Ni), this.target_ = void 0, this.values_ = void 0, this.name_ = void 0, this.defaultAnnotation_ = void 0, this.keysAtom_ = void 0, this.changeListeners_ = void 0, this.interceptors_ = void 0, this.proxy_ = void 0, this.isPlainObject_ = void 0, this.appliedAnnotations_ = void 0, this.pendingKeys_ = void 0, this.target_ = i, this.values_ = n, this.name_ = r, this.defaultAnnotation_ = a, this.keysAtom_ = new ge("ObservableObject.keys"), this.isPlainObject_ = R(this.target_);
1983
- }
1984
- var t = e.prototype;
1985
- return t.getObservablePropValue_ = function(n) {
1986
- return this.values_.get(n).get();
1987
- }, t.setObservablePropValue_ = function(n, r) {
1988
- var a = this.values_.get(n);
1989
- if (a instanceof ce)
1990
- return a.set(r), !0;
1991
- if (N(this)) {
1992
- var o = O(this, {
1993
- type: D,
1994
- object: this.proxy_ || this.target_,
1995
- name: n,
1996
- newValue: r
1997
- });
1998
- if (!o)
1999
- return null;
2000
- r = o.newValue;
2001
- }
2002
- if (r = a.prepareNewValue_(r), r !== d.UNCHANGED) {
2003
- var s = A(this), u = !1, l = s || u ? {
2004
- type: D,
2005
- observableKind: "object",
2006
- debugObjectName: this.name_,
2007
- object: this.proxy_ || this.target_,
2008
- oldValue: a.value_,
2009
- name: n,
2010
- newValue: r
2011
- } : null;
2012
- a.setNewValue_(r), s && w(this, l);
2013
- }
2014
- return !0;
2015
- }, t.get_ = function(n) {
2016
- return d.trackingDerivation && !L(this.target_, n) && this.has_(n), this.target_[n];
2017
- }, t.set_ = function(n, r, a) {
2018
- return a === void 0 && (a = !1), L(this.target_, n) ? this.values_.has(n) ? this.setObservablePropValue_(n, r) : a ? Reflect.set(this.target_, n, r) : (this.target_[n] = r, !0) : this.extend_(n, {
2019
- value: r,
2020
- enumerable: !0,
2021
- writable: !0,
2022
- configurable: !0
2023
- }, this.defaultAnnotation_, a);
2024
- }, t.has_ = function(n) {
2025
- if (!d.trackingDerivation)
2026
- return n in this.target_;
2027
- this.pendingKeys_ || (this.pendingKeys_ = /* @__PURE__ */ new Map());
2028
- var r = this.pendingKeys_.get(n);
2029
- return r || (r = new ee(n in this.target_, $e, "ObservableObject.key?", !1), this.pendingKeys_.set(n, r)), r.get();
2030
- }, t.make_ = function(n, r) {
2031
- if (r === !0 && (r = this.defaultAnnotation_), r !== !1) {
2032
- if (!(n in this.target_)) {
2033
- var a;
2034
- if ((a = this.target_[Q]) != null && a[n])
2035
- return;
2036
- m(1, r.annotationType_, this.name_ + "." + n.toString());
2037
- }
2038
- for (var o = this.target_; o && o !== Le; ) {
2039
- var s = De(o, n);
2040
- if (s) {
2041
- var u = r.make_(this, n, s, o);
2042
- if (u === 0)
2043
- return;
2044
- if (u === 1)
2045
- break;
2046
- }
2047
- o = Object.getPrototypeOf(o);
2048
- }
2049
- jt(this, r, n);
2050
- }
2051
- }, t.extend_ = function(n, r, a, o) {
2052
- if (o === void 0 && (o = !1), a === !0 && (a = this.defaultAnnotation_), a === !1)
2053
- return this.defineProperty_(n, r, o);
2054
- var s = a.extend_(this, n, r, o);
2055
- return s && jt(this, a, n), s;
2056
- }, t.defineProperty_ = function(n, r, a) {
2057
- a === void 0 && (a = !1);
2058
- try {
2059
- y();
2060
- var o = this.delete_(n);
2061
- if (!o)
2062
- return o;
2063
- if (N(this)) {
2064
- var s = O(this, {
2065
- object: this.proxy_ || this.target_,
2066
- name: n,
2067
- type: B,
2068
- newValue: r.value
2069
- });
2070
- if (!s)
2071
- return null;
2072
- var u = s.newValue;
2073
- r.value !== u && (r = de({}, r, {
2074
- value: u
2075
- }));
2076
- }
2077
- if (a) {
2078
- if (!Reflect.defineProperty(this.target_, n, r))
2079
- return !1;
2080
- } else
2081
- x(this.target_, n, r);
2082
- this.notifyPropertyAddition_(n, r.value);
2083
- } finally {
2084
- S();
2085
- }
2086
- return !0;
2087
- }, t.defineObservableProperty_ = function(n, r, a, o) {
2088
- o === void 0 && (o = !1);
2089
- try {
2090
- y();
2091
- var s = this.delete_(n);
2092
- if (!s)
2093
- return s;
2094
- if (N(this)) {
2095
- var u = O(this, {
2096
- object: this.proxy_ || this.target_,
2097
- name: n,
2098
- type: B,
2099
- newValue: r
2100
- });
2101
- if (!u)
2102
- return null;
2103
- r = u.newValue;
2104
- }
2105
- var l = Pt(n), c = {
2106
- configurable: d.safeDescriptors ? this.isPlainObject_ : !0,
2107
- enumerable: !0,
2108
- get: l.get,
2109
- set: l.set
2110
- };
2111
- if (o) {
2112
- if (!Reflect.defineProperty(this.target_, n, c))
2113
- return !1;
2114
- } else
2115
- x(this.target_, n, c);
2116
- var h = new ee(r, a, "ObservableObject.key", !1);
2117
- this.values_.set(n, h), this.notifyPropertyAddition_(n, h.value_);
2118
- } finally {
2119
- S();
2120
- }
2121
- return !0;
2122
- }, t.defineComputedProperty_ = function(n, r, a) {
2123
- a === void 0 && (a = !1);
2124
- try {
2125
- y();
2126
- var o = this.delete_(n);
2127
- if (!o)
2128
- return o;
2129
- if (N(this)) {
2130
- var s = O(this, {
2131
- object: this.proxy_ || this.target_,
2132
- name: n,
2133
- type: B,
2134
- newValue: void 0
2135
- });
2136
- if (!s)
2137
- return null;
2138
- }
2139
- r.name || (r.name = "ObservableObject.key"), r.context = this.proxy_ || this.target_;
2140
- var u = Pt(n), l = {
2141
- configurable: d.safeDescriptors ? this.isPlainObject_ : !0,
2142
- enumerable: !1,
2143
- get: u.get,
2144
- set: u.set
2145
- };
2146
- if (a) {
2147
- if (!Reflect.defineProperty(this.target_, n, l))
2148
- return !1;
2149
- } else
2150
- x(this.target_, n, l);
2151
- this.values_.set(n, new ce(r)), this.notifyPropertyAddition_(n, void 0);
2152
- } finally {
2153
- S();
2154
- }
2155
- return !0;
2156
- }, t.delete_ = function(n, r) {
2157
- if (r === void 0 && (r = !1), !L(this.target_, n))
2158
- return !0;
2159
- if (N(this)) {
2160
- var a = O(this, {
2161
- object: this.proxy_ || this.target_,
2162
- name: n,
2163
- type: Dt
2164
- });
2165
- if (!a)
2166
- return null;
2167
- }
2168
- try {
2169
- var o, s;
2170
- y();
2171
- var u = A(this), l = !1, c = this.values_.get(n), h = void 0;
2172
- if (!c && (u || l)) {
2173
- var _;
2174
- h = (_ = De(this.target_, n)) == null ? void 0 : _.value;
2175
- }
2176
- if (r) {
2177
- if (!Reflect.deleteProperty(this.target_, n))
2178
- return !1;
2179
- } else
2180
- delete this.target_[n];
2181
- if (c && (this.values_.delete(n), c instanceof ee && (h = c.value_), pn(c)), this.keysAtom_.reportChanged(), (o = this.pendingKeys_) == null || (s = o.get(n)) == null || s.set(n in this.target_), u || l) {
2182
- var P = {
2183
- type: Dt,
2184
- observableKind: "object",
2185
- object: this.proxy_ || this.target_,
2186
- debugObjectName: this.name_,
2187
- oldValue: h,
2188
- name: n
2189
- };
2190
- u && w(this, P);
2191
- }
2192
- } finally {
2193
- S();
2194
- }
2195
- return !0;
2196
- }, t.observe_ = function(n, r) {
2197
- return Ne(this, n);
2198
- }, t.intercept_ = function(n) {
2199
- return Se(this, n);
2200
- }, t.notifyPropertyAddition_ = function(n, r) {
2201
- var a, o, s = A(this), u = !1;
2202
- if (s || u) {
2203
- var l = s || u ? {
2204
- type: B,
2205
- observableKind: "object",
2206
- debugObjectName: this.name_,
2207
- object: this.proxy_ || this.target_,
2208
- name: n,
2209
- newValue: r
2210
- } : null;
2211
- s && w(this, l);
2212
- }
2213
- (a = this.pendingKeys_) == null || (o = a.get(n)) == null || o.set(!0), this.keysAtom_.reportChanged();
2214
- }, t.ownKeys_ = function() {
2215
- return this.keysAtom_.reportObserved(), le(this.target_);
2216
- }, t.keys_ = function() {
2217
- return this.keysAtom_.reportObserved(), Object.keys(this.target_);
2218
- }, e;
2219
- }();
2220
- function We(e, t) {
2221
- var i;
2222
- if (L(e, f))
2223
- return e;
2224
- var n = (i = t?.name) != null ? i : "ObservableObject", r = new Vn(e, /* @__PURE__ */ new Map(), String(n), ji(t));
2225
- return Me(e, f, r), e;
2226
- }
2227
- var Or = /* @__PURE__ */ q("ObservableObjectAdministration", Vn);
2228
- function Pt(e) {
2229
- return Tt[e] || (Tt[e] = {
2230
- get: function() {
2231
- return this[f].getObservablePropValue_(e);
2232
- },
2233
- set: function(i) {
2234
- return this[f].setObservablePropValue_(e, i);
2235
- }
2236
- });
2237
- }
2238
- function me(e) {
2239
- return Ue(e) ? Or(e[f]) : !1;
2240
- }
2241
- function jt(e, t, i) {
2242
- var n;
2243
- (n = e.target_[Q]) == null || delete n[i];
2244
- }
2245
- var Qe = 0, In = function() {
2246
- };
2247
- function Ar(e, t) {
2248
- Object.setPrototypeOf ? Object.setPrototypeOf(e.prototype, t) : e.prototype.__proto__ !== void 0 ? e.prototype.__proto__ = t : e.prototype = t;
2249
- }
2250
- Ar(In, Array.prototype);
2251
- var gt = /* @__PURE__ */ function(e, t, i) {
2252
- Jt(n, e);
2253
- function n(a, o, s, u) {
2254
- var l;
2255
- s === void 0 && (s = "ObservableArray"), u === void 0 && (u = !1), l = e.call(this) || this;
2256
- var c = new pt(s, o, u, !0);
2257
- if (c.proxy_ = St(l), Wt(St(l), f, c), a && a.length) {
2258
- var h = ke(!0);
2259
- l.spliceWithArray(0, 0, a), ye(h);
2260
- }
2261
- return l;
2262
- }
2263
- var r = n.prototype;
2264
- return r.concat = function() {
2265
- this[f].atom_.reportObserved();
2266
- for (var o = arguments.length, s = new Array(o), u = 0; u < o; u++)
2267
- s[u] = arguments[u];
2268
- return Array.prototype.concat.apply(
2269
- this.slice(),
2270
- //@ts-ignore
2271
- s.map(function(l) {
2272
- return qe(l) ? l.slice() : l;
2273
- })
2274
- );
2275
- }, r[i] = function() {
2276
- var a = this, o = 0;
2277
- return he({
2278
- next: function() {
2279
- return o < a.length ? {
2280
- value: a[o++],
2281
- done: !1
2282
- } : {
2283
- done: !0,
2284
- value: void 0
2285
- };
2286
- }
2287
- });
2288
- }, ft(n, [{
2289
- key: "length",
2290
- get: function() {
2291
- return this[f].getArrayLength_();
2292
- },
2293
- set: function(o) {
2294
- this[f].setArrayLength_(o);
2295
- }
2296
- }, {
2297
- key: t,
2298
- get: function() {
2299
- return "Array";
2300
- }
2301
- }]), n;
2302
- }(In, Symbol.toStringTag, Symbol.iterator);
2303
- Object.entries(Ie).forEach(function(e) {
2304
- var t = e[0], i = e[1];
2305
- t !== "concat" && Me(gt.prototype, t, i);
2306
- });
2307
- function wr(e) {
2308
- return {
2309
- enumerable: !1,
2310
- configurable: !0,
2311
- get: function() {
2312
- return this[f].get_(e);
2313
- },
2314
- set: function(i) {
2315
- this[f].set_(e, i);
2316
- }
2317
- };
2318
- }
2319
- function Cr(e) {
2320
- x(gt.prototype, "" + e, wr(e));
2321
- }
2322
- function Bn(e) {
2323
- if (e > Qe) {
2324
- for (var t = Qe; t < e + 100; t++)
2325
- Cr(t);
2326
- Qe = e;
2327
- }
2328
- }
2329
- Bn(1e3);
2330
- function Er(e, t, i) {
2331
- return new gt(e, t, i);
2332
- }
2333
- function z(e, t) {
2334
- if (typeof e == "object" && e !== null) {
2335
- if (qe(e))
2336
- return t !== void 0 && m(23), e[f].atom_;
2337
- if (ae(e))
2338
- return e[f];
2339
- if (W(e)) {
2340
- if (t === void 0)
2341
- return e.keysAtom_;
2342
- var i = e.data_.get(t) || e.hasMap_.get(t);
2343
- return i || m(25, t, st(e)), i;
2344
- }
2345
- if (me(e)) {
2346
- if (!t)
2347
- return m(26);
2348
- var n = e[f].values_.get(t);
2349
- return n || m(27, t, st(e)), n;
2350
- }
2351
- if (vt(e) || ze(e) || Re(e))
2352
- return e;
2353
- } else if (C(e) && Re(e[f]))
2354
- return e[f];
2355
- m(28);
2356
- }
2357
- function Ln(e, t) {
2358
- if (e || m(29), t !== void 0)
2359
- return Ln(z(e, t));
2360
- if (vt(e) || ze(e) || Re(e) || W(e) || ae(e))
2361
- return e;
2362
- if (e[f])
2363
- return e[f];
2364
- m(24, e);
2365
- }
2366
- function st(e, t) {
2367
- var i;
2368
- if (t !== void 0)
2369
- i = z(e, t);
2370
- else {
2371
- if (_t(e))
2372
- return e.name;
2373
- me(e) || W(e) || ae(e) ? i = Ln(e) : i = z(e);
2374
- }
2375
- return i.name_;
2376
- }
2377
- var xt = Le.toString;
2378
- function bt(e, t, i) {
2379
- return i === void 0 && (i = -1), ut(e, t, i);
2380
- }
2381
- function ut(e, t, i, n, r) {
2382
- if (e === t)
2383
- return e !== 0 || 1 / e === 1 / t;
2384
- if (e == null || t == null)
2385
- return !1;
2386
- if (e !== e)
2387
- return t !== t;
2388
- var a = typeof e;
2389
- if (a !== "function" && a !== "object" && typeof t != "object")
2390
- return !1;
2391
- var o = xt.call(e);
2392
- if (o !== xt.call(t))
2393
- return !1;
2394
- switch (o) {
2395
- case "[object RegExp]":
2396
- case "[object String]":
2397
- return "" + e == "" + t;
2398
- case "[object Number]":
2399
- return +e != +e ? +t != +t : +e == 0 ? 1 / +e === 1 / t : +e == +t;
2400
- case "[object Date]":
2401
- case "[object Boolean]":
2402
- return +e == +t;
2403
- case "[object Symbol]":
2404
- return typeof Symbol < "u" && Symbol.valueOf.call(e) === Symbol.valueOf.call(t);
2405
- case "[object Map]":
2406
- case "[object Set]":
2407
- i >= 0 && i++;
2408
- break;
2409
- }
2410
- e = Rt(e), t = Rt(t);
2411
- var s = o === "[object Array]";
2412
- if (!s) {
2413
- if (typeof e != "object" || typeof t != "object")
2414
- return !1;
2415
- var u = e.constructor, l = t.constructor;
2416
- if (u !== l && !(C(u) && u instanceof u && C(l) && l instanceof l) && "constructor" in e && "constructor" in t)
2417
- return !1;
2418
- }
2419
- if (i === 0)
2420
- return !1;
2421
- i < 0 && (i = -1), n = n || [], r = r || [];
2422
- for (var c = n.length; c--; )
2423
- if (n[c] === e)
2424
- return r[c] === t;
2425
- if (n.push(e), r.push(t), s) {
2426
- if (c = e.length, c !== t.length)
2427
- return !1;
2428
- for (; c--; )
2429
- if (!ut(e[c], t[c], i - 1, n, r))
2430
- return !1;
2431
- } else {
2432
- var h = Object.keys(e), _;
2433
- if (c = h.length, Object.keys(t).length !== c)
2434
- return !1;
2435
- for (; c--; )
2436
- if (_ = h[c], !(L(t, _) && ut(e[_], t[_], i - 1, n, r)))
2437
- return !1;
2438
- }
2439
- return n.pop(), r.pop(), !0;
2440
- }
2441
- function Rt(e) {
2442
- return qe(e) ? e.slice() : ie(e) || W(e) || _e(e) || ae(e) ? Array.from(e.entries()) : e;
2443
- }
2444
- function he(e) {
2445
- return e[Symbol.iterator] = Fr, e;
2446
- }
2447
- function Fr() {
2448
- return this;
2449
- }
2450
- ["Symbol", "Map", "Set"].forEach(function(e) {
2451
- var t = $t();
2452
- typeof t[e] > "u" && m("MobX requires global '" + e + "' to be available or polyfilled");
2453
- });
2454
- typeof __MOBX_DEVTOOLS_GLOBAL_HOOK__ == "object" && __MOBX_DEVTOOLS_GLOBAL_HOOK__.injectMobx({
2455
- spy: Yi,
2456
- extras: {
2457
- getDebugName: st
2458
- },
2459
- $mobx: f
2460
- });
2461
- class Tr {
2462
- _config;
2463
- constructor() {
2464
- _r(this, {}, { name: "NizzaStore", autoBind: !0 });
2465
- }
2466
- configure(t) {
2467
- this._config = t;
2468
- }
2469
- get config() {
2470
- return this._config;
2471
- }
2472
- }
2473
- const ua = new Tr();
2474
- var Un = /* @__PURE__ */ ((e) => (e.Add = "add", e.Remove = "remove", e))(Un || {}), Mn = /* @__PURE__ */ ((e) => (e.Active = "active", e.Inactive = "inactive", e))(Mn || {});
2475
- const Dr = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "mutation", name: { kind: "Name", value: "deleteAllCustomization" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "data" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "CustomPlayerInputAccount" } } } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "deleteAllCustomPlayer" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "data" }, value: { kind: "Variable", name: { kind: "Name", value: "data" } } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "__typename" } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "Error" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "message" } }, { kind: "Field", name: { kind: "Name", value: "statusCode" } }, { kind: "Field", name: { kind: "Name", value: "timestamp" } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "ErrorGeneral" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "message" } }, { kind: "Field", name: { kind: "Name", value: "statusCode" } }, { kind: "Field", name: { kind: "Name", value: "timestamp" } }] } }] } }] } }] }, Pr = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "getAllCustomization" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "data" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "QueryInput" } } } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "getAllCustomPlayer" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "data" }, value: { kind: "Variable", name: { kind: "Name", value: "data" } } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "__typename" } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "CustomPlayerSuccessArray" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "data" }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "account" } }, { kind: "Field", name: { kind: "Name", value: "data" } }, { kind: "Field", name: { kind: "Name", value: "section" } }, { kind: "Field", name: { kind: "Name", value: "id" } }] } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "Error" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "message" } }, { kind: "Field", name: { kind: "Name", value: "statusCode" } }, { kind: "Field", name: { kind: "Name", value: "timestamp" } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "ErrorGeneral" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "message" } }, { kind: "Field", name: { kind: "Name", value: "statusCode" } }, { kind: "Field", name: { kind: "Name", value: "timestamp" } }] } }] } }] } }] }, jr = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "mutation", name: { kind: "Name", value: "updateCustomization" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "data" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "CustomPlayerInput" } } } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "updateCustomPlayer" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "data" }, value: { kind: "Variable", name: { kind: "Name", value: "data" } } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "__typename" } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "Error" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "message" } }, { kind: "Field", name: { kind: "Name", value: "statusCode" } }, { kind: "Field", name: { kind: "Name", value: "timestamp" } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "ErrorGeneral" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "message" } }, { kind: "Field", name: { kind: "Name", value: "statusCode" } }, { kind: "Field", name: { kind: "Name", value: "timestamp" } }] } }] } }] } }] }, xr = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "mutation", name: { kind: "Name", value: "AddCollection" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "data" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "CreateCollectionInput" } } } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "createCollection" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "data" }, value: { kind: "Variable", name: { kind: "Name", value: "data" } } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "__typename" } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "CollectionSuccess" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "data" }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" } }] } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "Error" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "message" } }, { kind: "Field", name: { kind: "Name", value: "statusCode" } }, { kind: "Field", name: { kind: "Name", value: "timestamp" } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "ErrorGeneral" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "message" } }, { kind: "Field", name: { kind: "Name", value: "statusCode" } }, { kind: "Field", name: { kind: "Name", value: "timestamp" } }] } }] } }] } }] }, Rr = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "mutation", name: { kind: "Name", value: "DeleteCollection" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "data" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "QueryInput" } } } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "deleteCollection" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "data" }, value: { kind: "Variable", name: { kind: "Name", value: "data" } } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "__typename" } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "Error" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "message" } }, { kind: "Field", name: { kind: "Name", value: "statusCode" } }, { kind: "Field", name: { kind: "Name", value: "timestamp" } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "ErrorGeneral" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "message" } }, { kind: "Field", name: { kind: "Name", value: "statusCode" } }, { kind: "Field", name: { kind: "Name", value: "timestamp" } }] } }] } }] } }] }, Vr = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "FindCollection" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "data" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "QueryInput" } } } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "findCollection" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "data" }, value: { kind: "Variable", name: { kind: "Name", value: "data" } } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "__typename" } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "CollectionSuccess" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "data" }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" } }, { kind: "Field", name: { kind: "Name", value: "account" } }, { kind: "Field", name: { kind: "Name", value: "name" } }, { kind: "Field", name: { kind: "Name", value: "description" } }, { kind: "Field", name: { kind: "Name", value: "status" } }, { kind: "Field", name: { kind: "Name", value: "createdat" } }, { kind: "Field", name: { kind: "Name", value: "products" }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" } }, { kind: "Field", name: { kind: "Name", value: "account" } }, { kind: "Field", name: { kind: "Name", value: "title" } }, { kind: "Field", name: { kind: "Name", value: "link" } }, { kind: "Field", name: { kind: "Name", value: "pictures" } }, { kind: "Field", name: { kind: "Name", value: "price" } }, { kind: "Field", name: { kind: "Name", value: "salesprice" } }, { kind: "Field", name: { kind: "Name", value: "status" } }, { kind: "Field", name: { kind: "Name", value: "createdat" } }] } }] } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "Error" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "message" } }, { kind: "Field", name: { kind: "Name", value: "statusCode" } }, { kind: "Field", name: { kind: "Name", value: "timestamp" } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "ErrorGeneral" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "message" } }, { kind: "Field", name: { kind: "Name", value: "statusCode" } }, { kind: "Field", name: { kind: "Name", value: "timestamp" } }] } }] } }] } }] }, Ir = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "GetAllCollections" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "data" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "QueryInput" } } } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "getAllCollection" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "data" }, value: { kind: "Variable", name: { kind: "Name", value: "data" } } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "__typename" } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "CollectionSuccessArray" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "data" }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" } }, { kind: "Field", name: { kind: "Name", value: "account" } }, { kind: "Field", name: { kind: "Name", value: "name" } }, { kind: "Field", name: { kind: "Name", value: "description" } }, { kind: "Field", name: { kind: "Name", value: "status" } }, { kind: "Field", name: { kind: "Name", value: "createdat" } }, { kind: "Field", name: { kind: "Name", value: "products" }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" } }, { kind: "Field", name: { kind: "Name", value: "account" } }, { kind: "Field", name: { kind: "Name", value: "title" } }, { kind: "Field", name: { kind: "Name", value: "link" } }, { kind: "Field", name: { kind: "Name", value: "pictures" } }, { kind: "Field", name: { kind: "Name", value: "price" } }, { kind: "Field", name: { kind: "Name", value: "salesprice" } }, { kind: "Field", name: { kind: "Name", value: "status" } }, { kind: "Field", name: { kind: "Name", value: "createdat" } }] } }] } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "Error" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "message" } }, { kind: "Field", name: { kind: "Name", value: "statusCode" } }, { kind: "Field", name: { kind: "Name", value: "timestamp" } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "ErrorGeneral" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "message" } }, { kind: "Field", name: { kind: "Name", value: "statusCode" } }, { kind: "Field", name: { kind: "Name", value: "timestamp" } }] } }] } }] } }] }, Br = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "mutation", name: { kind: "Name", value: "ManageCollectionProduct" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "data" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "ManageCollectionProductInInput" } } } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "manageCollectionProduct" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "data" }, value: { kind: "Variable", name: { kind: "Name", value: "data" } } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "__typename" } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "Error" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "message" } }, { kind: "Field", name: { kind: "Name", value: "statusCode" } }, { kind: "Field", name: { kind: "Name", value: "timestamp" } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "ErrorGeneral" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "message" } }, { kind: "Field", name: { kind: "Name", value: "statusCode" } }, { kind: "Field", name: { kind: "Name", value: "timestamp" } }] } }] } }] } }] }, Lr = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "query", name: { kind: "Name", value: "SearchCollections" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "data" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "QueryInput" } } } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "searchCollection" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "data" }, value: { kind: "Variable", name: { kind: "Name", value: "data" } } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "__typename" } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "CollectionSuccessArray" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "data" }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" } }, { kind: "Field", name: { kind: "Name", value: "account" } }, { kind: "Field", name: { kind: "Name", value: "name" } }, { kind: "Field", name: { kind: "Name", value: "description" } }, { kind: "Field", name: { kind: "Name", value: "status" } }, { kind: "Field", name: { kind: "Name", value: "createdat" } }, { kind: "Field", name: { kind: "Name", value: "products" }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "id" } }, { kind: "Field", name: { kind: "Name", value: "account" } }, { kind: "Field", name: { kind: "Name", value: "title" } }, { kind: "Field", name: { kind: "Name", value: "link" } }, { kind: "Field", name: { kind: "Name", value: "pictures" } }, { kind: "Field", name: { kind: "Name", value: "price" } }, { kind: "Field", name: { kind: "Name", value: "salesprice" } }, { kind: "Field", name: { kind: "Name", value: "status" } }, { kind: "Field", name: { kind: "Name", value: "createdat" } }] } }] } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "Error" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "message" } }, { kind: "Field", name: { kind: "Name", value: "statusCode" } }, { kind: "Field", name: { kind: "Name", value: "timestamp" } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "ErrorGeneral" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "message" } }, { kind: "Field", name: { kind: "Name", value: "statusCode" } }, { kind: "Field", name: { kind: "Name", value: "timestamp" } }] } }] } }] } }] }, Ur = { kind: "Document", definitions: [{ kind: "OperationDefinition", operation: "mutation", name: { kind: "Name", value: "UpdateCollection" }, variableDefinitions: [{ kind: "VariableDefinition", variable: { kind: "Variable", name: { kind: "Name", value: "data" } }, type: { kind: "NonNullType", type: { kind: "NamedType", name: { kind: "Name", value: "UpdateCollectionInput" } } } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "updateCollection" }, arguments: [{ kind: "Argument", name: { kind: "Name", value: "data" }, value: { kind: "Variable", name: { kind: "Name", value: "data" } } }], selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "__typename" } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "Error" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "message" } }, { kind: "Field", name: { kind: "Name", value: "statusCode" } }, { kind: "Field", name: { kind: "Name", value: "timestamp" } }] } }, { kind: "InlineFragment", typeCondition: { kind: "NamedType", name: { kind: "Name", value: "ErrorGeneral" } }, selectionSet: { kind: "SelectionSet", selections: [{ kind: "Field", name: { kind: "Name", value: "message" } }, { kind: "Field", name: { kind: "Name", value: "statusCode" } }, { kind: "Field", name: { kind: "Name", value: "timestamp" } }] } }] } }] } }] }, la = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
2476
- __proto__: null,
2477
- AddCollectionDocument: xr,
2478
- DeleteAllCustomizationDocument: Dr,
2479
- DeleteCollectionDocument: Rr,
2480
- FindCollectionDocument: Vr,
2481
- GetAllCollectionsDocument: Ir,
2482
- GetAllCustomizationDocument: Pr,
2483
- ManageCollectionProductDocument: Br,
2484
- Methods: Un,
2485
- SearchCollectionsDocument: Lr,
2486
- Status: Mn,
2487
- UpdateCollectionDocument: Ur,
2488
- UpdateCustomizationDocument: jr
2489
- }, Symbol.toStringTag, { value: "Module" }));
2490
- class da {
2491
- }
2492
- async function ca({
2493
- url: e,
2494
- method: t = "GET",
2495
- raw: i = !1,
2496
- ...n
2497
- }) {
2498
- const r = {
2499
- "Content-Type": "application/json",
2500
- ...n.headers
2501
- }, a = await fetch(e, { method: t, ...n, headers: r });
2502
- if (i)
2503
- return a;
2504
- const o = await a.json();
2505
- if (!a.ok) {
2506
- const s = o?.message ?? a.statusText;
2507
- throw new Error(s);
2508
- }
2509
- return o;
2510
- }
2511
- class Vt {
2512
- store;
2513
- constructor() {
2514
- this.store = this.getStoreFromWindow();
2515
- }
2516
- getStoreFromWindow() {
2517
- let t = {};
2518
- try {
2519
- t = JSON.parse(window.self.name);
2520
- } catch {
2521
- return {};
2522
- }
2523
- return t && typeof t == "object" ? t : {};
2524
- }
2525
- setStoreToWindow(t) {
2526
- const i = JSON.stringify(t);
2527
- window.self.name = i;
2528
- }
2529
- setItem(t, i) {
2530
- this.store[t] = i, this.setStoreToWindow(this.store);
2531
- }
2532
- getItem(t) {
2533
- return this.store[t] ?? null;
2534
- }
2535
- removeItem(t) {
2536
- delete this.store[t], this.setStoreToWindow(this.store);
2537
- }
2538
- clear() {
2539
- this.setStoreToWindow({});
2540
- }
2541
- key(t) {
2542
- return Object.keys(this.store)[t] ?? null;
2543
- }
2544
- get length() {
2545
- return Object.keys(this.store).length;
2546
- }
2547
- }
2548
- function It(e) {
2549
- try {
2550
- const t = window[e], i = "__custom-storage__";
2551
- return t.setItem(i, i), t.removeItem(i), !0;
2552
- } catch {
2553
- return !1;
2554
- }
2555
- }
2556
- function Bt(e, t, i) {
2557
- const n = {
2558
- configurable: !1,
2559
- enumerable: !1,
2560
- writable: !1
2561
- };
2562
- typeof i < "u" && (n.value = i), Object.defineProperty(e, t, n);
2563
- }
2564
- class $n {
2565
- static init() {
2566
- return new $n();
2567
- }
2568
- constructor() {
2569
- window.top === window.self ? console.log("[CustomStorage] This is the main window") : console.log("[CustomStorage] This is NOT the main window"), this.replaceStorages();
2570
- }
2571
- replaceStorages() {
2572
- if (!this.isAvailable.localStorage) {
2573
- const t = new Vt();
2574
- Bt(window, "localStorage", t), console.log(
2575
- "[CustomStorage] LocalStorage is not available, custom implementation is defined"
2576
- );
2577
- }
2578
- if (!this.isAvailable.sessionStorage) {
2579
- const t = new Vt();
2580
- Bt(window, "sessionStorage", t), console.log(
2581
- "[CustomStorage] SessionStorage is not available, custom implementation is defined"
2582
- );
2583
- }
2584
- }
2585
- get isAvailable() {
2586
- return {
2587
- localStorage: It("localStorage"),
2588
- sessionStorage: It("sessionStorage")
2589
- };
2590
- }
2591
- }
2592
- /*! js-cookie v3.0.1 | MIT */
2593
- function Ce(e) {
2594
- for (var t = 1; t < arguments.length; t++) {
2595
- var i = arguments[t];
2596
- for (var n in i)
2597
- e[n] = i[n];
2598
- }
2599
- return e;
2600
- }
2601
- var Mr = {
2602
- read: function(e) {
2603
- return e[0] === '"' && (e = e.slice(1, -1)), e.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent);
2604
- },
2605
- write: function(e) {
2606
- return encodeURIComponent(e).replace(
2607
- /%(2[346BF]|3[AC-F]|40|5[BDE]|60|7[BCD])/g,
2608
- decodeURIComponent
2609
- );
2610
- }
2611
- };
2612
- function lt(e, t) {
2613
- function i(r, a, o) {
2614
- if (!(typeof document > "u")) {
2615
- o = Ce({}, t, o), typeof o.expires == "number" && (o.expires = new Date(Date.now() + o.expires * 864e5)), o.expires && (o.expires = o.expires.toUTCString()), r = encodeURIComponent(r).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape);
2616
- var s = "";
2617
- for (var u in o)
2618
- o[u] && (s += "; " + u, o[u] !== !0 && (s += "=" + o[u].split(";")[0]));
2619
- return document.cookie = r + "=" + e.write(a, r) + s;
2620
- }
2621
- }
2622
- function n(r) {
2623
- if (!(typeof document > "u" || arguments.length && !r)) {
2624
- for (var a = document.cookie ? document.cookie.split("; ") : [], o = {}, s = 0; s < a.length; s++) {
2625
- var u = a[s].split("="), l = u.slice(1).join("=");
2626
- try {
2627
- var c = decodeURIComponent(u[0]);
2628
- if (o[c] = e.read(l, c), r === c)
2629
- break;
2630
- } catch {
2631
- }
2632
- }
2633
- return r ? o[r] : o;
2634
- }
2635
- }
2636
- return Object.create(
2637
- {
2638
- set: i,
2639
- get: n,
2640
- remove: function(r, a) {
2641
- i(
2642
- r,
2643
- "",
2644
- Ce({}, a, {
2645
- expires: -1
2646
- })
2647
- );
2648
- },
2649
- withAttributes: function(r) {
2650
- return lt(this.converter, Ce({}, this.attributes, r));
2651
- },
2652
- withConverter: function(r) {
2653
- return lt(Ce({}, this.converter, r), this.attributes);
2654
- }
2655
- },
2656
- {
2657
- attributes: { value: Object.freeze(t) },
2658
- converter: { value: Object.freeze(e) }
2659
- }
2660
- );
2661
- }
2662
- var Lt = lt(Mr, { path: "/" }), Ee, $r = new Uint8Array(16);
2663
- function Gr() {
2664
- if (!Ee && (Ee = typeof crypto < "u" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto < "u" && typeof msCrypto.getRandomValues == "function" && msCrypto.getRandomValues.bind(msCrypto), !Ee))
2665
- throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
2666
- return Ee($r);
2667
- }
2668
- const Kr = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
2669
- function zr(e) {
2670
- return typeof e == "string" && Kr.test(e);
2671
- }
2672
- var g = [];
2673
- for (var Ze = 0; Ze < 256; ++Ze)
2674
- g.push((Ze + 256).toString(16).substr(1));
2675
- function qr(e) {
2676
- var t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0, i = (g[e[t + 0]] + g[e[t + 1]] + g[e[t + 2]] + g[e[t + 3]] + "-" + g[e[t + 4]] + g[e[t + 5]] + "-" + g[e[t + 6]] + g[e[t + 7]] + "-" + g[e[t + 8]] + g[e[t + 9]] + "-" + g[e[t + 10]] + g[e[t + 11]] + g[e[t + 12]] + g[e[t + 13]] + g[e[t + 14]] + g[e[t + 15]]).toLowerCase();
2677
- if (!zr(i))
2678
- throw TypeError("Stringified UUID is invalid");
2679
- return i;
2680
- }
2681
- function Wr(e, t, i) {
2682
- e = e || {};
2683
- var n = e.random || (e.rng || Gr)();
2684
- if (n[6] = n[6] & 15 | 64, n[8] = n[8] & 63 | 128, t) {
2685
- i = i || 0;
2686
- for (var r = 0; r < 16; ++r)
2687
- t[i + r] = n[r];
2688
- return t;
2689
- }
2690
- return qr(n);
2691
- }
2692
- const Ut = "FINGERPRINT_LIVE_SHOPPING", fa = () => {
2693
- let e = Lt.get(Ut);
2694
- return e || (e = Wr(), Lt.set(Ut, e, { expires: 1 }), e);
2695
- };
2696
- let Hr = (e = 21) => crypto.getRandomValues(new Uint8Array(e)).reduce((t, i) => (i &= 63, i < 36 ? t += i.toString(36) : i < 62 ? t += (i - 26).toString(36).toUpperCase() : i > 62 ? t += "-" : t += "_", t), "");
2697
- const va = (e = 8) => Hr(e), ma = (e) => {
2698
- const t = Object.entries(e).map(([i, n]) => `${i}=${n}`).join("&");
2699
- return t ? `?${t}` : "";
2700
- }, ha = (e, t, i = { fallback: null }) => {
2701
- let n = e;
2702
- t && (n = () => e().then((a) => ({ default: t(a) })));
2703
- const r = zn(n);
2704
- return (a) => /* @__PURE__ */ et(qn, { fallback: i.fallback, children: /* @__PURE__ */ et(r, { ...a }) });
2705
- };
2706
- class Te {
2707
- isOk;
2708
- isErr;
2709
- error;
2710
- _value;
2711
- constructor(t, i, n) {
2712
- if (t && i)
2713
- throw new Error(
2714
- "InvalidOperation: A result cannot be successful and contain an error"
2715
- );
2716
- if (!t && !i)
2717
- throw new Error(
2718
- "InvalidOperation: A failing result needs to contain an error message"
2719
- );
2720
- this.isOk = t, this.isErr = !t, this.error = i, this._value = n, Object.freeze(this);
2721
- }
2722
- get value() {
2723
- if (this.isErr)
2724
- throw new Error(
2725
- "Can't get the value of an error result. Use 'errorValue' instead."
2726
- );
2727
- return this._value;
2728
- }
2729
- static ok(t) {
2730
- return new Te(!0, void 0, t);
2731
- }
2732
- static fail(t) {
2733
- return new Te(!1, t);
2734
- }
2735
- static combine(t) {
2736
- for (const i of t)
2737
- if (i.isErr)
2738
- return i;
2739
- return Te.ok();
2740
- }
2741
- }
2742
- class Xr {
2743
- value;
2744
- constructor(t) {
2745
- this.value = t;
2746
- }
2747
- isErr() {
2748
- return !0;
2749
- }
2750
- isOk() {
2751
- return !1;
2752
- }
2753
- }
2754
- class Jr {
2755
- value;
2756
- constructor(t) {
2757
- this.value = t;
2758
- }
2759
- isErr() {
2760
- return !1;
2761
- }
2762
- isOk() {
2763
- return !0;
2764
- }
2765
- }
2766
- const _a = (e) => new Xr(e), pa = (e) => new Jr(e);
2767
- export {
2768
- ia as AccountInvalidError,
2769
- Hn as AggregateRoot,
2770
- la as ApiGraphqlTypes,
2771
- ea as BaseMobxStore,
2772
- da as BaseStore,
2773
- $n as CustomStorage,
2774
- dt as DomainError,
2775
- Xr as Err,
2776
- Tr as NizzaStore,
2777
- Wn as NizzaVariationTypes,
2778
- Jr as Ok,
2779
- ta as ResourceNotFoundError,
2780
- Te as Result,
2781
- aa as StoreProvider,
2782
- na as UnexpectedError,
2783
- ra as ValueObject,
2784
- ca as apiCall,
2785
- Zr as createAggregateRoot,
2786
- pa as err,
2787
- fa as getFingerprint,
2788
- sa as getStore,
2789
- ha as lazyLoad,
2790
- ua as nizza,
2791
- _a as ok,
2792
- ma as searchParams,
2793
- va as shortId,
2794
- oa as useStore
2795
- };