react-achievements 3.5.0 → 3.6.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.
- package/README.md +1127 -27
- package/dist/index.d.ts +197 -8
- package/dist/index.js +764 -32
- package/dist/index.js.map +1 -1
- package/dist/types/core/components/BadgesButton.d.ts +18 -3
- package/dist/types/core/hooks/useWindowSize.d.ts +16 -0
- package/dist/types/core/types.d.ts +2 -6
- package/dist/types/core/ui/BuiltInConfetti.d.ts +7 -0
- package/dist/types/core/ui/BuiltInModal.d.ts +7 -0
- package/dist/types/core/ui/BuiltInNotification.d.ts +7 -0
- package/dist/types/core/ui/LegacyWrappers.d.ts +21 -0
- package/dist/types/core/ui/interfaces.d.ts +131 -0
- package/dist/types/core/ui/legacyDetector.d.ts +40 -0
- package/dist/types/core/ui/themes.d.ts +14 -0
- package/dist/types/index.d.ts +5 -0
- package/dist/types/providers/AchievementProvider.d.ts +14 -2
- package/package.json +15 -1
- package/dist/assets/defaultIcons.d.ts +0 -81
- package/dist/badges.d.ts +0 -8
- package/dist/components/Achievement.d.ts +0 -10
- package/dist/components/AchievementModal.d.ts +0 -12
- package/dist/components/Badge.d.ts +0 -9
- package/dist/components/BadgesButton.d.ts +0 -14
- package/dist/components/BadgesModal.d.ts +0 -12
- package/dist/components/ConfettiWrapper.d.ts +0 -6
- package/dist/components/Progress.d.ts +0 -6
- package/dist/context/AchievementContext.d.ts +0 -21
- package/dist/defaultStyles.d.ts +0 -19
- package/dist/hooks/useAchievement.d.ts +0 -8
- package/dist/hooks/useAchievementState.d.ts +0 -4
- package/dist/index.cjs.js +0 -2428
- package/dist/index.esm.js +0 -2403
- package/dist/levels.d.ts +0 -7
- package/dist/providers/AchievementProvider.d.ts +0 -12
- package/dist/redux/achievementSlice.d.ts +0 -30
- package/dist/redux/notificationSlice.d.ts +0 -7
- package/dist/redux/store.d.ts +0 -15
- package/dist/stories/Button.d.ts +0 -28
- package/dist/stories/Button.stories.d.ts +0 -23
- package/dist/stories/Header.d.ts +0 -13
- package/dist/stories/Header.stories.d.ts +0 -18
- package/dist/stories/Page.d.ts +0 -3
- package/dist/stories/Page.stories.d.ts +0 -12
- package/dist/types/core/context/AchievementContext.d.ts +0 -5
- package/dist/types/stories/Button.d.ts +0 -16
- package/dist/types/stories/Button.stories.d.ts +0 -23
- package/dist/types/stories/Header.d.ts +0 -13
- package/dist/types/stories/Header.stories.d.ts +0 -18
- package/dist/types/stories/Page.d.ts +0 -3
- package/dist/types/stories/Page.stories.d.ts +0 -12
- package/dist/types.d.ts +0 -37
- package/dist/utils/EventEmitter.d.ts +0 -6
package/dist/index.cjs.js
DELETED
|
@@ -1,2428 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var React = require('react');
|
|
4
|
-
require('react-dom');
|
|
5
|
-
|
|
6
|
-
function _interopNamespaceDefault(e) {
|
|
7
|
-
var n = Object.create(null);
|
|
8
|
-
if (e) {
|
|
9
|
-
Object.keys(e).forEach(function (k) {
|
|
10
|
-
if (k !== 'default') {
|
|
11
|
-
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
12
|
-
Object.defineProperty(n, k, d.get ? d : {
|
|
13
|
-
enumerable: true,
|
|
14
|
-
get: function () { return e[k]; }
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
n.default = e;
|
|
20
|
-
return Object.freeze(n);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
|
|
24
|
-
|
|
25
|
-
function getDefaultExportFromCjs (x) {
|
|
26
|
-
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
var shim = {exports: {}};
|
|
30
|
-
|
|
31
|
-
var useSyncExternalStoreShim_production = {};
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* @license React
|
|
35
|
-
* use-sync-external-store-shim.production.js
|
|
36
|
-
*
|
|
37
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
38
|
-
*
|
|
39
|
-
* This source code is licensed under the MIT license found in the
|
|
40
|
-
* LICENSE file in the root directory of undefined source tree.
|
|
41
|
-
*/
|
|
42
|
-
|
|
43
|
-
var hasRequiredUseSyncExternalStoreShim_production;
|
|
44
|
-
|
|
45
|
-
function requireUseSyncExternalStoreShim_production () {
|
|
46
|
-
if (hasRequiredUseSyncExternalStoreShim_production) return useSyncExternalStoreShim_production;
|
|
47
|
-
hasRequiredUseSyncExternalStoreShim_production = 1;
|
|
48
|
-
var React$1 = React;
|
|
49
|
-
function is(x, y) {
|
|
50
|
-
return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);
|
|
51
|
-
}
|
|
52
|
-
var objectIs = "function" === typeof Object.is ? Object.is : is,
|
|
53
|
-
useState = React$1.useState,
|
|
54
|
-
useEffect = React$1.useEffect,
|
|
55
|
-
useLayoutEffect = React$1.useLayoutEffect,
|
|
56
|
-
useDebugValue = React$1.useDebugValue;
|
|
57
|
-
function useSyncExternalStore$2(subscribe, getSnapshot) {
|
|
58
|
-
var value = getSnapshot(),
|
|
59
|
-
_useState = useState({ inst: { value: value, getSnapshot: getSnapshot } }),
|
|
60
|
-
inst = _useState[0].inst,
|
|
61
|
-
forceUpdate = _useState[1];
|
|
62
|
-
useLayoutEffect(
|
|
63
|
-
function () {
|
|
64
|
-
inst.value = value;
|
|
65
|
-
inst.getSnapshot = getSnapshot;
|
|
66
|
-
checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });
|
|
67
|
-
},
|
|
68
|
-
[subscribe, value, getSnapshot]
|
|
69
|
-
);
|
|
70
|
-
useEffect(
|
|
71
|
-
function () {
|
|
72
|
-
checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });
|
|
73
|
-
return subscribe(function () {
|
|
74
|
-
checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });
|
|
75
|
-
});
|
|
76
|
-
},
|
|
77
|
-
[subscribe]
|
|
78
|
-
);
|
|
79
|
-
useDebugValue(value);
|
|
80
|
-
return value;
|
|
81
|
-
}
|
|
82
|
-
function checkIfSnapshotChanged(inst) {
|
|
83
|
-
var latestGetSnapshot = inst.getSnapshot;
|
|
84
|
-
inst = inst.value;
|
|
85
|
-
try {
|
|
86
|
-
var nextValue = latestGetSnapshot();
|
|
87
|
-
return !objectIs(inst, nextValue);
|
|
88
|
-
} catch (error) {
|
|
89
|
-
return true;
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
function useSyncExternalStore$1(subscribe, getSnapshot) {
|
|
93
|
-
return getSnapshot();
|
|
94
|
-
}
|
|
95
|
-
var shim =
|
|
96
|
-
"undefined" === typeof window ||
|
|
97
|
-
"undefined" === typeof window.document ||
|
|
98
|
-
"undefined" === typeof window.document.createElement
|
|
99
|
-
? useSyncExternalStore$1
|
|
100
|
-
: useSyncExternalStore$2;
|
|
101
|
-
useSyncExternalStoreShim_production.useSyncExternalStore =
|
|
102
|
-
void 0 !== React$1.useSyncExternalStore ? React$1.useSyncExternalStore : shim;
|
|
103
|
-
return useSyncExternalStoreShim_production;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
var useSyncExternalStoreShim_development = {};
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* @license React
|
|
110
|
-
* use-sync-external-store-shim.development.js
|
|
111
|
-
*
|
|
112
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
113
|
-
*
|
|
114
|
-
* This source code is licensed under the MIT license found in the
|
|
115
|
-
* LICENSE file in the root directory of undefined source tree.
|
|
116
|
-
*/
|
|
117
|
-
|
|
118
|
-
var hasRequiredUseSyncExternalStoreShim_development;
|
|
119
|
-
|
|
120
|
-
function requireUseSyncExternalStoreShim_development () {
|
|
121
|
-
if (hasRequiredUseSyncExternalStoreShim_development) return useSyncExternalStoreShim_development;
|
|
122
|
-
hasRequiredUseSyncExternalStoreShim_development = 1;
|
|
123
|
-
"production" !== process.env.NODE_ENV &&
|
|
124
|
-
(function () {
|
|
125
|
-
function is(x, y) {
|
|
126
|
-
return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);
|
|
127
|
-
}
|
|
128
|
-
function useSyncExternalStore$2(subscribe, getSnapshot) {
|
|
129
|
-
didWarnOld18Alpha ||
|
|
130
|
-
void 0 === React$1.startTransition ||
|
|
131
|
-
((didWarnOld18Alpha = true),
|
|
132
|
-
console.error(
|
|
133
|
-
"You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."
|
|
134
|
-
));
|
|
135
|
-
var value = getSnapshot();
|
|
136
|
-
if (!didWarnUncachedGetSnapshot) {
|
|
137
|
-
var cachedValue = getSnapshot();
|
|
138
|
-
objectIs(value, cachedValue) ||
|
|
139
|
-
(console.error(
|
|
140
|
-
"The result of getSnapshot should be cached to avoid an infinite loop"
|
|
141
|
-
),
|
|
142
|
-
(didWarnUncachedGetSnapshot = true));
|
|
143
|
-
}
|
|
144
|
-
cachedValue = useState({
|
|
145
|
-
inst: { value: value, getSnapshot: getSnapshot }
|
|
146
|
-
});
|
|
147
|
-
var inst = cachedValue[0].inst,
|
|
148
|
-
forceUpdate = cachedValue[1];
|
|
149
|
-
useLayoutEffect(
|
|
150
|
-
function () {
|
|
151
|
-
inst.value = value;
|
|
152
|
-
inst.getSnapshot = getSnapshot;
|
|
153
|
-
checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });
|
|
154
|
-
},
|
|
155
|
-
[subscribe, value, getSnapshot]
|
|
156
|
-
);
|
|
157
|
-
useEffect(
|
|
158
|
-
function () {
|
|
159
|
-
checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });
|
|
160
|
-
return subscribe(function () {
|
|
161
|
-
checkIfSnapshotChanged(inst) && forceUpdate({ inst: inst });
|
|
162
|
-
});
|
|
163
|
-
},
|
|
164
|
-
[subscribe]
|
|
165
|
-
);
|
|
166
|
-
useDebugValue(value);
|
|
167
|
-
return value;
|
|
168
|
-
}
|
|
169
|
-
function checkIfSnapshotChanged(inst) {
|
|
170
|
-
var latestGetSnapshot = inst.getSnapshot;
|
|
171
|
-
inst = inst.value;
|
|
172
|
-
try {
|
|
173
|
-
var nextValue = latestGetSnapshot();
|
|
174
|
-
return !objectIs(inst, nextValue);
|
|
175
|
-
} catch (error) {
|
|
176
|
-
return true;
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
function useSyncExternalStore$1(subscribe, getSnapshot) {
|
|
180
|
-
return getSnapshot();
|
|
181
|
-
}
|
|
182
|
-
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
|
|
183
|
-
"function" ===
|
|
184
|
-
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart &&
|
|
185
|
-
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
186
|
-
var React$1 = React,
|
|
187
|
-
objectIs = "function" === typeof Object.is ? Object.is : is,
|
|
188
|
-
useState = React$1.useState,
|
|
189
|
-
useEffect = React$1.useEffect,
|
|
190
|
-
useLayoutEffect = React$1.useLayoutEffect,
|
|
191
|
-
useDebugValue = React$1.useDebugValue,
|
|
192
|
-
didWarnOld18Alpha = false,
|
|
193
|
-
didWarnUncachedGetSnapshot = false,
|
|
194
|
-
shim =
|
|
195
|
-
"undefined" === typeof window ||
|
|
196
|
-
"undefined" === typeof window.document ||
|
|
197
|
-
"undefined" === typeof window.document.createElement
|
|
198
|
-
? useSyncExternalStore$1
|
|
199
|
-
: useSyncExternalStore$2;
|
|
200
|
-
useSyncExternalStoreShim_development.useSyncExternalStore =
|
|
201
|
-
void 0 !== React$1.useSyncExternalStore ? React$1.useSyncExternalStore : shim;
|
|
202
|
-
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
|
|
203
|
-
"function" ===
|
|
204
|
-
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
|
|
205
|
-
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
206
|
-
})();
|
|
207
|
-
return useSyncExternalStoreShim_development;
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
if (process.env.NODE_ENV === 'production') {
|
|
211
|
-
shim.exports = requireUseSyncExternalStoreShim_production();
|
|
212
|
-
} else {
|
|
213
|
-
shim.exports = requireUseSyncExternalStoreShim_development();
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
var shimExports = shim.exports;
|
|
217
|
-
|
|
218
|
-
var withSelector = {exports: {}};
|
|
219
|
-
|
|
220
|
-
var withSelector_production = {};
|
|
221
|
-
|
|
222
|
-
/**
|
|
223
|
-
* @license React
|
|
224
|
-
* use-sync-external-store-shim/with-selector.production.js
|
|
225
|
-
*
|
|
226
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
227
|
-
*
|
|
228
|
-
* This source code is licensed under the MIT license found in the
|
|
229
|
-
* LICENSE file in the root directory of undefined source tree.
|
|
230
|
-
*/
|
|
231
|
-
|
|
232
|
-
var hasRequiredWithSelector_production;
|
|
233
|
-
|
|
234
|
-
function requireWithSelector_production () {
|
|
235
|
-
if (hasRequiredWithSelector_production) return withSelector_production;
|
|
236
|
-
hasRequiredWithSelector_production = 1;
|
|
237
|
-
var React$1 = React,
|
|
238
|
-
shim = shimExports;
|
|
239
|
-
function is(x, y) {
|
|
240
|
-
return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);
|
|
241
|
-
}
|
|
242
|
-
var objectIs = "function" === typeof Object.is ? Object.is : is,
|
|
243
|
-
useSyncExternalStore = shim.useSyncExternalStore,
|
|
244
|
-
useRef = React$1.useRef,
|
|
245
|
-
useEffect = React$1.useEffect,
|
|
246
|
-
useMemo = React$1.useMemo,
|
|
247
|
-
useDebugValue = React$1.useDebugValue;
|
|
248
|
-
withSelector_production.useSyncExternalStoreWithSelector = function (
|
|
249
|
-
subscribe,
|
|
250
|
-
getSnapshot,
|
|
251
|
-
getServerSnapshot,
|
|
252
|
-
selector,
|
|
253
|
-
isEqual
|
|
254
|
-
) {
|
|
255
|
-
var instRef = useRef(null);
|
|
256
|
-
if (null === instRef.current) {
|
|
257
|
-
var inst = { hasValue: false, value: null };
|
|
258
|
-
instRef.current = inst;
|
|
259
|
-
} else inst = instRef.current;
|
|
260
|
-
instRef = useMemo(
|
|
261
|
-
function () {
|
|
262
|
-
function memoizedSelector(nextSnapshot) {
|
|
263
|
-
if (!hasMemo) {
|
|
264
|
-
hasMemo = true;
|
|
265
|
-
memoizedSnapshot = nextSnapshot;
|
|
266
|
-
nextSnapshot = selector(nextSnapshot);
|
|
267
|
-
if (void 0 !== isEqual && inst.hasValue) {
|
|
268
|
-
var currentSelection = inst.value;
|
|
269
|
-
if (isEqual(currentSelection, nextSnapshot))
|
|
270
|
-
return (memoizedSelection = currentSelection);
|
|
271
|
-
}
|
|
272
|
-
return (memoizedSelection = nextSnapshot);
|
|
273
|
-
}
|
|
274
|
-
currentSelection = memoizedSelection;
|
|
275
|
-
if (objectIs(memoizedSnapshot, nextSnapshot)) return currentSelection;
|
|
276
|
-
var nextSelection = selector(nextSnapshot);
|
|
277
|
-
if (void 0 !== isEqual && isEqual(currentSelection, nextSelection))
|
|
278
|
-
return (memoizedSnapshot = nextSnapshot), currentSelection;
|
|
279
|
-
memoizedSnapshot = nextSnapshot;
|
|
280
|
-
return (memoizedSelection = nextSelection);
|
|
281
|
-
}
|
|
282
|
-
var hasMemo = false,
|
|
283
|
-
memoizedSnapshot,
|
|
284
|
-
memoizedSelection,
|
|
285
|
-
maybeGetServerSnapshot =
|
|
286
|
-
void 0 === getServerSnapshot ? null : getServerSnapshot;
|
|
287
|
-
return [
|
|
288
|
-
function () {
|
|
289
|
-
return memoizedSelector(getSnapshot());
|
|
290
|
-
},
|
|
291
|
-
null === maybeGetServerSnapshot
|
|
292
|
-
? void 0
|
|
293
|
-
: function () {
|
|
294
|
-
return memoizedSelector(maybeGetServerSnapshot());
|
|
295
|
-
}
|
|
296
|
-
];
|
|
297
|
-
},
|
|
298
|
-
[getSnapshot, getServerSnapshot, selector, isEqual]
|
|
299
|
-
);
|
|
300
|
-
var value = useSyncExternalStore(subscribe, instRef[0], instRef[1]);
|
|
301
|
-
useEffect(
|
|
302
|
-
function () {
|
|
303
|
-
inst.hasValue = true;
|
|
304
|
-
inst.value = value;
|
|
305
|
-
},
|
|
306
|
-
[value]
|
|
307
|
-
);
|
|
308
|
-
useDebugValue(value);
|
|
309
|
-
return value;
|
|
310
|
-
};
|
|
311
|
-
return withSelector_production;
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
var withSelector_development = {};
|
|
315
|
-
|
|
316
|
-
/**
|
|
317
|
-
* @license React
|
|
318
|
-
* use-sync-external-store-shim/with-selector.development.js
|
|
319
|
-
*
|
|
320
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
321
|
-
*
|
|
322
|
-
* This source code is licensed under the MIT license found in the
|
|
323
|
-
* LICENSE file in the root directory of undefined source tree.
|
|
324
|
-
*/
|
|
325
|
-
|
|
326
|
-
var hasRequiredWithSelector_development;
|
|
327
|
-
|
|
328
|
-
function requireWithSelector_development () {
|
|
329
|
-
if (hasRequiredWithSelector_development) return withSelector_development;
|
|
330
|
-
hasRequiredWithSelector_development = 1;
|
|
331
|
-
"production" !== process.env.NODE_ENV &&
|
|
332
|
-
(function () {
|
|
333
|
-
function is(x, y) {
|
|
334
|
-
return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);
|
|
335
|
-
}
|
|
336
|
-
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
|
|
337
|
-
"function" ===
|
|
338
|
-
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart &&
|
|
339
|
-
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
340
|
-
var React$1 = React,
|
|
341
|
-
shim = shimExports,
|
|
342
|
-
objectIs = "function" === typeof Object.is ? Object.is : is,
|
|
343
|
-
useSyncExternalStore = shim.useSyncExternalStore,
|
|
344
|
-
useRef = React$1.useRef,
|
|
345
|
-
useEffect = React$1.useEffect,
|
|
346
|
-
useMemo = React$1.useMemo,
|
|
347
|
-
useDebugValue = React$1.useDebugValue;
|
|
348
|
-
withSelector_development.useSyncExternalStoreWithSelector = function (
|
|
349
|
-
subscribe,
|
|
350
|
-
getSnapshot,
|
|
351
|
-
getServerSnapshot,
|
|
352
|
-
selector,
|
|
353
|
-
isEqual
|
|
354
|
-
) {
|
|
355
|
-
var instRef = useRef(null);
|
|
356
|
-
if (null === instRef.current) {
|
|
357
|
-
var inst = { hasValue: false, value: null };
|
|
358
|
-
instRef.current = inst;
|
|
359
|
-
} else inst = instRef.current;
|
|
360
|
-
instRef = useMemo(
|
|
361
|
-
function () {
|
|
362
|
-
function memoizedSelector(nextSnapshot) {
|
|
363
|
-
if (!hasMemo) {
|
|
364
|
-
hasMemo = true;
|
|
365
|
-
memoizedSnapshot = nextSnapshot;
|
|
366
|
-
nextSnapshot = selector(nextSnapshot);
|
|
367
|
-
if (void 0 !== isEqual && inst.hasValue) {
|
|
368
|
-
var currentSelection = inst.value;
|
|
369
|
-
if (isEqual(currentSelection, nextSnapshot))
|
|
370
|
-
return (memoizedSelection = currentSelection);
|
|
371
|
-
}
|
|
372
|
-
return (memoizedSelection = nextSnapshot);
|
|
373
|
-
}
|
|
374
|
-
currentSelection = memoizedSelection;
|
|
375
|
-
if (objectIs(memoizedSnapshot, nextSnapshot))
|
|
376
|
-
return currentSelection;
|
|
377
|
-
var nextSelection = selector(nextSnapshot);
|
|
378
|
-
if (void 0 !== isEqual && isEqual(currentSelection, nextSelection))
|
|
379
|
-
return (memoizedSnapshot = nextSnapshot), currentSelection;
|
|
380
|
-
memoizedSnapshot = nextSnapshot;
|
|
381
|
-
return (memoizedSelection = nextSelection);
|
|
382
|
-
}
|
|
383
|
-
var hasMemo = false,
|
|
384
|
-
memoizedSnapshot,
|
|
385
|
-
memoizedSelection,
|
|
386
|
-
maybeGetServerSnapshot =
|
|
387
|
-
void 0 === getServerSnapshot ? null : getServerSnapshot;
|
|
388
|
-
return [
|
|
389
|
-
function () {
|
|
390
|
-
return memoizedSelector(getSnapshot());
|
|
391
|
-
},
|
|
392
|
-
null === maybeGetServerSnapshot
|
|
393
|
-
? void 0
|
|
394
|
-
: function () {
|
|
395
|
-
return memoizedSelector(maybeGetServerSnapshot());
|
|
396
|
-
}
|
|
397
|
-
];
|
|
398
|
-
},
|
|
399
|
-
[getSnapshot, getServerSnapshot, selector, isEqual]
|
|
400
|
-
);
|
|
401
|
-
var value = useSyncExternalStore(subscribe, instRef[0], instRef[1]);
|
|
402
|
-
useEffect(
|
|
403
|
-
function () {
|
|
404
|
-
inst.hasValue = true;
|
|
405
|
-
inst.value = value;
|
|
406
|
-
},
|
|
407
|
-
[value]
|
|
408
|
-
);
|
|
409
|
-
useDebugValue(value);
|
|
410
|
-
return value;
|
|
411
|
-
};
|
|
412
|
-
"undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&
|
|
413
|
-
"function" ===
|
|
414
|
-
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&
|
|
415
|
-
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
416
|
-
})();
|
|
417
|
-
return withSelector_development;
|
|
418
|
-
}
|
|
419
|
-
|
|
420
|
-
if (process.env.NODE_ENV === 'production') {
|
|
421
|
-
withSelector.exports = requireWithSelector_production();
|
|
422
|
-
} else {
|
|
423
|
-
withSelector.exports = requireWithSelector_development();
|
|
424
|
-
}
|
|
425
|
-
|
|
426
|
-
var withSelectorExports = withSelector.exports;
|
|
427
|
-
|
|
428
|
-
const ContextKey = Symbol.for(`react-redux-context`);
|
|
429
|
-
const gT = typeof globalThis !== "undefined" ? globalThis :
|
|
430
|
-
/* fall back to a per-module scope (pre-8.1 behaviour) if `globalThis` is not available */
|
|
431
|
-
{};
|
|
432
|
-
|
|
433
|
-
function getContext() {
|
|
434
|
-
var _gT$ContextKey;
|
|
435
|
-
|
|
436
|
-
if (!React__namespace.createContext) return {};
|
|
437
|
-
const contextMap = (_gT$ContextKey = gT[ContextKey]) != null ? _gT$ContextKey : gT[ContextKey] = new Map();
|
|
438
|
-
let realContext = contextMap.get(React__namespace.createContext);
|
|
439
|
-
|
|
440
|
-
if (!realContext) {
|
|
441
|
-
realContext = React__namespace.createContext(null);
|
|
442
|
-
|
|
443
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
444
|
-
realContext.displayName = 'ReactRedux';
|
|
445
|
-
}
|
|
446
|
-
|
|
447
|
-
contextMap.set(React__namespace.createContext, realContext);
|
|
448
|
-
}
|
|
449
|
-
|
|
450
|
-
return realContext;
|
|
451
|
-
}
|
|
452
|
-
|
|
453
|
-
const ReactReduxContext = /*#__PURE__*/getContext();
|
|
454
|
-
|
|
455
|
-
/**
|
|
456
|
-
* Hook factory, which creates a `useReduxContext` hook bound to a given context. This is a low-level
|
|
457
|
-
* hook that you should usually not need to call directly.
|
|
458
|
-
*
|
|
459
|
-
* @param {React.Context} [context=ReactReduxContext] Context passed to your `<Provider>`.
|
|
460
|
-
* @returns {Function} A `useReduxContext` hook bound to the specified context.
|
|
461
|
-
*/
|
|
462
|
-
function createReduxContextHook(context = ReactReduxContext) {
|
|
463
|
-
return function useReduxContext() {
|
|
464
|
-
const contextValue = React.useContext(context);
|
|
465
|
-
|
|
466
|
-
if (process.env.NODE_ENV !== 'production' && !contextValue) {
|
|
467
|
-
throw new Error('could not find react-redux context value; please ensure the component is wrapped in a <Provider>');
|
|
468
|
-
}
|
|
469
|
-
|
|
470
|
-
return contextValue;
|
|
471
|
-
};
|
|
472
|
-
}
|
|
473
|
-
/**
|
|
474
|
-
* A hook to access the value of the `ReactReduxContext`. This is a low-level
|
|
475
|
-
* hook that you should usually not need to call directly.
|
|
476
|
-
*
|
|
477
|
-
* @returns {any} the value of the `ReactReduxContext`
|
|
478
|
-
*
|
|
479
|
-
* @example
|
|
480
|
-
*
|
|
481
|
-
* import React from 'react'
|
|
482
|
-
* import { useReduxContext } from 'react-redux'
|
|
483
|
-
*
|
|
484
|
-
* export const CounterComponent = () => {
|
|
485
|
-
* const { store } = useReduxContext()
|
|
486
|
-
* return <div>{store.getState()}</div>
|
|
487
|
-
* }
|
|
488
|
-
*/
|
|
489
|
-
|
|
490
|
-
const useReduxContext = /*#__PURE__*/createReduxContextHook();
|
|
491
|
-
|
|
492
|
-
const notInitialized = () => {
|
|
493
|
-
throw new Error('uSES not initialized!');
|
|
494
|
-
};
|
|
495
|
-
|
|
496
|
-
let useSyncExternalStoreWithSelector = notInitialized;
|
|
497
|
-
const initializeUseSelector = fn => {
|
|
498
|
-
useSyncExternalStoreWithSelector = fn;
|
|
499
|
-
};
|
|
500
|
-
|
|
501
|
-
const refEquality = (a, b) => a === b;
|
|
502
|
-
/**
|
|
503
|
-
* Hook factory, which creates a `useSelector` hook bound to a given context.
|
|
504
|
-
*
|
|
505
|
-
* @param {React.Context} [context=ReactReduxContext] Context passed to your `<Provider>`.
|
|
506
|
-
* @returns {Function} A `useSelector` hook bound to the specified context.
|
|
507
|
-
*/
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
function createSelectorHook(context = ReactReduxContext) {
|
|
511
|
-
const useReduxContext$1 = context === ReactReduxContext ? useReduxContext : createReduxContextHook(context);
|
|
512
|
-
return function useSelector(selector, equalityFnOrOptions = {}) {
|
|
513
|
-
const {
|
|
514
|
-
equalityFn = refEquality,
|
|
515
|
-
stabilityCheck = undefined,
|
|
516
|
-
noopCheck = undefined
|
|
517
|
-
} = typeof equalityFnOrOptions === 'function' ? {
|
|
518
|
-
equalityFn: equalityFnOrOptions
|
|
519
|
-
} : equalityFnOrOptions;
|
|
520
|
-
|
|
521
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
522
|
-
if (!selector) {
|
|
523
|
-
throw new Error(`You must pass a selector to useSelector`);
|
|
524
|
-
}
|
|
525
|
-
|
|
526
|
-
if (typeof selector !== 'function') {
|
|
527
|
-
throw new Error(`You must pass a function as a selector to useSelector`);
|
|
528
|
-
}
|
|
529
|
-
|
|
530
|
-
if (typeof equalityFn !== 'function') {
|
|
531
|
-
throw new Error(`You must pass a function as an equality function to useSelector`);
|
|
532
|
-
}
|
|
533
|
-
}
|
|
534
|
-
|
|
535
|
-
const {
|
|
536
|
-
store,
|
|
537
|
-
subscription,
|
|
538
|
-
getServerState,
|
|
539
|
-
stabilityCheck: globalStabilityCheck,
|
|
540
|
-
noopCheck: globalNoopCheck
|
|
541
|
-
} = useReduxContext$1();
|
|
542
|
-
const firstRun = React.useRef(true);
|
|
543
|
-
const wrappedSelector = React.useCallback({
|
|
544
|
-
[selector.name](state) {
|
|
545
|
-
const selected = selector(state);
|
|
546
|
-
|
|
547
|
-
if (process.env.NODE_ENV !== 'production') {
|
|
548
|
-
const finalStabilityCheck = typeof stabilityCheck === 'undefined' ? globalStabilityCheck : stabilityCheck;
|
|
549
|
-
|
|
550
|
-
if (finalStabilityCheck === 'always' || finalStabilityCheck === 'once' && firstRun.current) {
|
|
551
|
-
const toCompare = selector(state);
|
|
552
|
-
|
|
553
|
-
if (!equalityFn(selected, toCompare)) {
|
|
554
|
-
let stack = undefined;
|
|
555
|
-
|
|
556
|
-
try {
|
|
557
|
-
throw new Error();
|
|
558
|
-
} catch (e) {
|
|
559
|
-
({
|
|
560
|
-
stack
|
|
561
|
-
} = e);
|
|
562
|
-
}
|
|
563
|
-
|
|
564
|
-
console.warn('Selector ' + (selector.name || 'unknown') + ' returned a different result when called with the same parameters. This can lead to unnecessary rerenders.' + '\nSelectors that return a new reference (such as an object or an array) should be memoized: https://redux.js.org/usage/deriving-data-selectors#optimizing-selectors-with-memoization', {
|
|
565
|
-
state,
|
|
566
|
-
selected,
|
|
567
|
-
selected2: toCompare,
|
|
568
|
-
stack
|
|
569
|
-
});
|
|
570
|
-
}
|
|
571
|
-
}
|
|
572
|
-
|
|
573
|
-
const finalNoopCheck = typeof noopCheck === 'undefined' ? globalNoopCheck : noopCheck;
|
|
574
|
-
|
|
575
|
-
if (finalNoopCheck === 'always' || finalNoopCheck === 'once' && firstRun.current) {
|
|
576
|
-
// @ts-ignore
|
|
577
|
-
if (selected === state) {
|
|
578
|
-
let stack = undefined;
|
|
579
|
-
|
|
580
|
-
try {
|
|
581
|
-
throw new Error();
|
|
582
|
-
} catch (e) {
|
|
583
|
-
({
|
|
584
|
-
stack
|
|
585
|
-
} = e);
|
|
586
|
-
}
|
|
587
|
-
|
|
588
|
-
console.warn('Selector ' + (selector.name || 'unknown') + ' returned the root state when called. This can lead to unnecessary rerenders.' + '\nSelectors that return the entire state are almost certainly a mistake, as they will cause a rerender whenever *anything* in state changes.', {
|
|
589
|
-
stack
|
|
590
|
-
});
|
|
591
|
-
}
|
|
592
|
-
}
|
|
593
|
-
|
|
594
|
-
if (firstRun.current) firstRun.current = false;
|
|
595
|
-
}
|
|
596
|
-
|
|
597
|
-
return selected;
|
|
598
|
-
}
|
|
599
|
-
|
|
600
|
-
}[selector.name], [selector, globalStabilityCheck, stabilityCheck]);
|
|
601
|
-
const selectedState = useSyncExternalStoreWithSelector(subscription.addNestedSub, store.getState, getServerState || store.getState, wrappedSelector, equalityFn);
|
|
602
|
-
React.useDebugValue(selectedState);
|
|
603
|
-
return selectedState;
|
|
604
|
-
};
|
|
605
|
-
}
|
|
606
|
-
/**
|
|
607
|
-
* A hook to access the redux store's state. This hook takes a selector function
|
|
608
|
-
* as an argument. The selector is called with the store state.
|
|
609
|
-
*
|
|
610
|
-
* This hook takes an optional equality comparison function as the second parameter
|
|
611
|
-
* that allows you to customize the way the selected state is compared to determine
|
|
612
|
-
* whether the component needs to be re-rendered.
|
|
613
|
-
*
|
|
614
|
-
* @param {Function} selector the selector function
|
|
615
|
-
* @param {Function=} equalityFn the function that will be used to determine equality
|
|
616
|
-
*
|
|
617
|
-
* @returns {any} the selected state
|
|
618
|
-
*
|
|
619
|
-
* @example
|
|
620
|
-
*
|
|
621
|
-
* import React from 'react'
|
|
622
|
-
* import { useSelector } from 'react-redux'
|
|
623
|
-
*
|
|
624
|
-
* export const CounterComponent = () => {
|
|
625
|
-
* const counter = useSelector(state => state.counter)
|
|
626
|
-
* return <div>{counter}</div>
|
|
627
|
-
* }
|
|
628
|
-
*/
|
|
629
|
-
|
|
630
|
-
const useSelector = /*#__PURE__*/createSelectorHook();
|
|
631
|
-
|
|
632
|
-
var reactIs$1 = {exports: {}};
|
|
633
|
-
|
|
634
|
-
var reactIs_production_min$1 = {};
|
|
635
|
-
|
|
636
|
-
/** @license React v16.13.1
|
|
637
|
-
* react-is.production.min.js
|
|
638
|
-
*
|
|
639
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
640
|
-
*
|
|
641
|
-
* This source code is licensed under the MIT license found in the
|
|
642
|
-
* LICENSE file in the root directory of undefined source tree.
|
|
643
|
-
*/
|
|
644
|
-
|
|
645
|
-
var hasRequiredReactIs_production_min$1;
|
|
646
|
-
|
|
647
|
-
function requireReactIs_production_min$1 () {
|
|
648
|
-
if (hasRequiredReactIs_production_min$1) return reactIs_production_min$1;
|
|
649
|
-
hasRequiredReactIs_production_min$1 = 1;
|
|
650
|
-
var b="function"===typeof Symbol&&Symbol.for,c=b?Symbol.for("react.element"):60103,d=b?Symbol.for("react.portal"):60106,e=b?Symbol.for("react.fragment"):60107,f=b?Symbol.for("react.strict_mode"):60108,g=b?Symbol.for("react.profiler"):60114,h=b?Symbol.for("react.provider"):60109,k=b?Symbol.for("react.context"):60110,l=b?Symbol.for("react.async_mode"):60111,m=b?Symbol.for("react.concurrent_mode"):60111,n=b?Symbol.for("react.forward_ref"):60112,p=b?Symbol.for("react.suspense"):60113,q=b?
|
|
651
|
-
Symbol.for("react.suspense_list"):60120,r=b?Symbol.for("react.memo"):60115,t=b?Symbol.for("react.lazy"):60116,v=b?Symbol.for("react.block"):60121,w=b?Symbol.for("react.fundamental"):60117,x=b?Symbol.for("react.responder"):60118,y=b?Symbol.for("react.scope"):60119;
|
|
652
|
-
function z(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}reactIs_production_min$1.AsyncMode=l;reactIs_production_min$1.ConcurrentMode=m;reactIs_production_min$1.ContextConsumer=k;reactIs_production_min$1.ContextProvider=h;reactIs_production_min$1.Element=c;reactIs_production_min$1.ForwardRef=n;reactIs_production_min$1.Fragment=e;reactIs_production_min$1.Lazy=t;reactIs_production_min$1.Memo=r;reactIs_production_min$1.Portal=d;
|
|
653
|
-
reactIs_production_min$1.Profiler=g;reactIs_production_min$1.StrictMode=f;reactIs_production_min$1.Suspense=p;reactIs_production_min$1.isAsyncMode=function(a){return A(a)||z(a)===l};reactIs_production_min$1.isConcurrentMode=A;reactIs_production_min$1.isContextConsumer=function(a){return z(a)===k};reactIs_production_min$1.isContextProvider=function(a){return z(a)===h};reactIs_production_min$1.isElement=function(a){return "object"===typeof a&&null!==a&&a.$$typeof===c};reactIs_production_min$1.isForwardRef=function(a){return z(a)===n};reactIs_production_min$1.isFragment=function(a){return z(a)===e};reactIs_production_min$1.isLazy=function(a){return z(a)===t};
|
|
654
|
-
reactIs_production_min$1.isMemo=function(a){return z(a)===r};reactIs_production_min$1.isPortal=function(a){return z(a)===d};reactIs_production_min$1.isProfiler=function(a){return z(a)===g};reactIs_production_min$1.isStrictMode=function(a){return z(a)===f};reactIs_production_min$1.isSuspense=function(a){return z(a)===p};
|
|
655
|
-
reactIs_production_min$1.isValidElementType=function(a){return "string"===typeof a||"function"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||"object"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};reactIs_production_min$1.typeOf=z;
|
|
656
|
-
return reactIs_production_min$1;
|
|
657
|
-
}
|
|
658
|
-
|
|
659
|
-
var reactIs_development$1 = {};
|
|
660
|
-
|
|
661
|
-
/** @license React v16.13.1
|
|
662
|
-
* react-is.development.js
|
|
663
|
-
*
|
|
664
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
665
|
-
*
|
|
666
|
-
* This source code is licensed under the MIT license found in the
|
|
667
|
-
* LICENSE file in the root directory of undefined source tree.
|
|
668
|
-
*/
|
|
669
|
-
|
|
670
|
-
var hasRequiredReactIs_development$1;
|
|
671
|
-
|
|
672
|
-
function requireReactIs_development$1 () {
|
|
673
|
-
if (hasRequiredReactIs_development$1) return reactIs_development$1;
|
|
674
|
-
hasRequiredReactIs_development$1 = 1;
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
if (process.env.NODE_ENV !== "production") {
|
|
679
|
-
(function() {
|
|
680
|
-
|
|
681
|
-
// The Symbol used to tag the ReactElement-like types. If there is no native Symbol
|
|
682
|
-
// nor polyfill, then a plain number is used for performance.
|
|
683
|
-
var hasSymbol = typeof Symbol === 'function' && Symbol.for;
|
|
684
|
-
var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;
|
|
685
|
-
var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;
|
|
686
|
-
var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;
|
|
687
|
-
var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;
|
|
688
|
-
var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;
|
|
689
|
-
var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;
|
|
690
|
-
var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary
|
|
691
|
-
// (unstable) APIs that have been removed. Can we remove the symbols?
|
|
692
|
-
|
|
693
|
-
var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;
|
|
694
|
-
var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;
|
|
695
|
-
var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;
|
|
696
|
-
var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;
|
|
697
|
-
var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;
|
|
698
|
-
var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;
|
|
699
|
-
var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;
|
|
700
|
-
var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;
|
|
701
|
-
var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;
|
|
702
|
-
var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;
|
|
703
|
-
var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;
|
|
704
|
-
|
|
705
|
-
function isValidElementType(type) {
|
|
706
|
-
return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.
|
|
707
|
-
type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);
|
|
708
|
-
}
|
|
709
|
-
|
|
710
|
-
function typeOf(object) {
|
|
711
|
-
if (typeof object === 'object' && object !== null) {
|
|
712
|
-
var $$typeof = object.$$typeof;
|
|
713
|
-
|
|
714
|
-
switch ($$typeof) {
|
|
715
|
-
case REACT_ELEMENT_TYPE:
|
|
716
|
-
var type = object.type;
|
|
717
|
-
|
|
718
|
-
switch (type) {
|
|
719
|
-
case REACT_ASYNC_MODE_TYPE:
|
|
720
|
-
case REACT_CONCURRENT_MODE_TYPE:
|
|
721
|
-
case REACT_FRAGMENT_TYPE:
|
|
722
|
-
case REACT_PROFILER_TYPE:
|
|
723
|
-
case REACT_STRICT_MODE_TYPE:
|
|
724
|
-
case REACT_SUSPENSE_TYPE:
|
|
725
|
-
return type;
|
|
726
|
-
|
|
727
|
-
default:
|
|
728
|
-
var $$typeofType = type && type.$$typeof;
|
|
729
|
-
|
|
730
|
-
switch ($$typeofType) {
|
|
731
|
-
case REACT_CONTEXT_TYPE:
|
|
732
|
-
case REACT_FORWARD_REF_TYPE:
|
|
733
|
-
case REACT_LAZY_TYPE:
|
|
734
|
-
case REACT_MEMO_TYPE:
|
|
735
|
-
case REACT_PROVIDER_TYPE:
|
|
736
|
-
return $$typeofType;
|
|
737
|
-
|
|
738
|
-
default:
|
|
739
|
-
return $$typeof;
|
|
740
|
-
}
|
|
741
|
-
|
|
742
|
-
}
|
|
743
|
-
|
|
744
|
-
case REACT_PORTAL_TYPE:
|
|
745
|
-
return $$typeof;
|
|
746
|
-
}
|
|
747
|
-
}
|
|
748
|
-
|
|
749
|
-
return undefined;
|
|
750
|
-
} // AsyncMode is deprecated along with isAsyncMode
|
|
751
|
-
|
|
752
|
-
var AsyncMode = REACT_ASYNC_MODE_TYPE;
|
|
753
|
-
var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;
|
|
754
|
-
var ContextConsumer = REACT_CONTEXT_TYPE;
|
|
755
|
-
var ContextProvider = REACT_PROVIDER_TYPE;
|
|
756
|
-
var Element = REACT_ELEMENT_TYPE;
|
|
757
|
-
var ForwardRef = REACT_FORWARD_REF_TYPE;
|
|
758
|
-
var Fragment = REACT_FRAGMENT_TYPE;
|
|
759
|
-
var Lazy = REACT_LAZY_TYPE;
|
|
760
|
-
var Memo = REACT_MEMO_TYPE;
|
|
761
|
-
var Portal = REACT_PORTAL_TYPE;
|
|
762
|
-
var Profiler = REACT_PROFILER_TYPE;
|
|
763
|
-
var StrictMode = REACT_STRICT_MODE_TYPE;
|
|
764
|
-
var Suspense = REACT_SUSPENSE_TYPE;
|
|
765
|
-
var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated
|
|
766
|
-
|
|
767
|
-
function isAsyncMode(object) {
|
|
768
|
-
{
|
|
769
|
-
if (!hasWarnedAboutDeprecatedIsAsyncMode) {
|
|
770
|
-
hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint
|
|
771
|
-
|
|
772
|
-
console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');
|
|
773
|
-
}
|
|
774
|
-
}
|
|
775
|
-
|
|
776
|
-
return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;
|
|
777
|
-
}
|
|
778
|
-
function isConcurrentMode(object) {
|
|
779
|
-
return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;
|
|
780
|
-
}
|
|
781
|
-
function isContextConsumer(object) {
|
|
782
|
-
return typeOf(object) === REACT_CONTEXT_TYPE;
|
|
783
|
-
}
|
|
784
|
-
function isContextProvider(object) {
|
|
785
|
-
return typeOf(object) === REACT_PROVIDER_TYPE;
|
|
786
|
-
}
|
|
787
|
-
function isElement(object) {
|
|
788
|
-
return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
789
|
-
}
|
|
790
|
-
function isForwardRef(object) {
|
|
791
|
-
return typeOf(object) === REACT_FORWARD_REF_TYPE;
|
|
792
|
-
}
|
|
793
|
-
function isFragment(object) {
|
|
794
|
-
return typeOf(object) === REACT_FRAGMENT_TYPE;
|
|
795
|
-
}
|
|
796
|
-
function isLazy(object) {
|
|
797
|
-
return typeOf(object) === REACT_LAZY_TYPE;
|
|
798
|
-
}
|
|
799
|
-
function isMemo(object) {
|
|
800
|
-
return typeOf(object) === REACT_MEMO_TYPE;
|
|
801
|
-
}
|
|
802
|
-
function isPortal(object) {
|
|
803
|
-
return typeOf(object) === REACT_PORTAL_TYPE;
|
|
804
|
-
}
|
|
805
|
-
function isProfiler(object) {
|
|
806
|
-
return typeOf(object) === REACT_PROFILER_TYPE;
|
|
807
|
-
}
|
|
808
|
-
function isStrictMode(object) {
|
|
809
|
-
return typeOf(object) === REACT_STRICT_MODE_TYPE;
|
|
810
|
-
}
|
|
811
|
-
function isSuspense(object) {
|
|
812
|
-
return typeOf(object) === REACT_SUSPENSE_TYPE;
|
|
813
|
-
}
|
|
814
|
-
|
|
815
|
-
reactIs_development$1.AsyncMode = AsyncMode;
|
|
816
|
-
reactIs_development$1.ConcurrentMode = ConcurrentMode;
|
|
817
|
-
reactIs_development$1.ContextConsumer = ContextConsumer;
|
|
818
|
-
reactIs_development$1.ContextProvider = ContextProvider;
|
|
819
|
-
reactIs_development$1.Element = Element;
|
|
820
|
-
reactIs_development$1.ForwardRef = ForwardRef;
|
|
821
|
-
reactIs_development$1.Fragment = Fragment;
|
|
822
|
-
reactIs_development$1.Lazy = Lazy;
|
|
823
|
-
reactIs_development$1.Memo = Memo;
|
|
824
|
-
reactIs_development$1.Portal = Portal;
|
|
825
|
-
reactIs_development$1.Profiler = Profiler;
|
|
826
|
-
reactIs_development$1.StrictMode = StrictMode;
|
|
827
|
-
reactIs_development$1.Suspense = Suspense;
|
|
828
|
-
reactIs_development$1.isAsyncMode = isAsyncMode;
|
|
829
|
-
reactIs_development$1.isConcurrentMode = isConcurrentMode;
|
|
830
|
-
reactIs_development$1.isContextConsumer = isContextConsumer;
|
|
831
|
-
reactIs_development$1.isContextProvider = isContextProvider;
|
|
832
|
-
reactIs_development$1.isElement = isElement;
|
|
833
|
-
reactIs_development$1.isForwardRef = isForwardRef;
|
|
834
|
-
reactIs_development$1.isFragment = isFragment;
|
|
835
|
-
reactIs_development$1.isLazy = isLazy;
|
|
836
|
-
reactIs_development$1.isMemo = isMemo;
|
|
837
|
-
reactIs_development$1.isPortal = isPortal;
|
|
838
|
-
reactIs_development$1.isProfiler = isProfiler;
|
|
839
|
-
reactIs_development$1.isStrictMode = isStrictMode;
|
|
840
|
-
reactIs_development$1.isSuspense = isSuspense;
|
|
841
|
-
reactIs_development$1.isValidElementType = isValidElementType;
|
|
842
|
-
reactIs_development$1.typeOf = typeOf;
|
|
843
|
-
})();
|
|
844
|
-
}
|
|
845
|
-
return reactIs_development$1;
|
|
846
|
-
}
|
|
847
|
-
|
|
848
|
-
if (process.env.NODE_ENV === 'production') {
|
|
849
|
-
reactIs$1.exports = requireReactIs_production_min$1();
|
|
850
|
-
} else {
|
|
851
|
-
reactIs$1.exports = requireReactIs_development$1();
|
|
852
|
-
}
|
|
853
|
-
|
|
854
|
-
var reactIsExports = reactIs$1.exports;
|
|
855
|
-
|
|
856
|
-
var reactIs = reactIsExports;
|
|
857
|
-
var FORWARD_REF_STATICS = {
|
|
858
|
-
'$$typeof': true,
|
|
859
|
-
render: true,
|
|
860
|
-
defaultProps: true,
|
|
861
|
-
displayName: true,
|
|
862
|
-
propTypes: true
|
|
863
|
-
};
|
|
864
|
-
var MEMO_STATICS = {
|
|
865
|
-
'$$typeof': true,
|
|
866
|
-
compare: true,
|
|
867
|
-
defaultProps: true,
|
|
868
|
-
displayName: true,
|
|
869
|
-
propTypes: true,
|
|
870
|
-
type: true
|
|
871
|
-
};
|
|
872
|
-
var TYPE_STATICS = {};
|
|
873
|
-
TYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS;
|
|
874
|
-
TYPE_STATICS[reactIs.Memo] = MEMO_STATICS;
|
|
875
|
-
|
|
876
|
-
var reactIs_production_min = {};
|
|
877
|
-
|
|
878
|
-
/**
|
|
879
|
-
* @license React
|
|
880
|
-
* react-is.production.min.js
|
|
881
|
-
*
|
|
882
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
883
|
-
*
|
|
884
|
-
* This source code is licensed under the MIT license found in the
|
|
885
|
-
* LICENSE file in the root directory of undefined source tree.
|
|
886
|
-
*/
|
|
887
|
-
|
|
888
|
-
var hasRequiredReactIs_production_min;
|
|
889
|
-
|
|
890
|
-
function requireReactIs_production_min () {
|
|
891
|
-
if (hasRequiredReactIs_production_min) return reactIs_production_min;
|
|
892
|
-
hasRequiredReactIs_production_min = 1;
|
|
893
|
-
var b=Symbol.for("react.element"),c=Symbol.for("react.portal"),d=Symbol.for("react.fragment"),e=Symbol.for("react.strict_mode"),f=Symbol.for("react.profiler"),g=Symbol.for("react.provider"),h=Symbol.for("react.context"),k=Symbol.for("react.server_context"),l=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),n=Symbol.for("react.suspense_list"),p=Symbol.for("react.memo"),q=Symbol.for("react.lazy"),t=Symbol.for("react.offscreen"),u;u=Symbol.for("react.module.reference");
|
|
894
|
-
function v(a){if("object"===typeof a&&null!==a){var r=a.$$typeof;switch(r){case b:switch(a=a.type,a){case d:case f:case e:case m:case n:return a;default:switch(a=a&&a.$$typeof,a){case k:case h:case l:case q:case p:case g:return a;default:return r}}case c:return r}}}reactIs_production_min.ContextConsumer=h;reactIs_production_min.ContextProvider=g;reactIs_production_min.Element=b;reactIs_production_min.ForwardRef=l;reactIs_production_min.Fragment=d;reactIs_production_min.Lazy=q;reactIs_production_min.Memo=p;reactIs_production_min.Portal=c;reactIs_production_min.Profiler=f;reactIs_production_min.StrictMode=e;reactIs_production_min.Suspense=m;
|
|
895
|
-
reactIs_production_min.SuspenseList=n;reactIs_production_min.isAsyncMode=function(){return false};reactIs_production_min.isConcurrentMode=function(){return false};reactIs_production_min.isContextConsumer=function(a){return v(a)===h};reactIs_production_min.isContextProvider=function(a){return v(a)===g};reactIs_production_min.isElement=function(a){return "object"===typeof a&&null!==a&&a.$$typeof===b};reactIs_production_min.isForwardRef=function(a){return v(a)===l};reactIs_production_min.isFragment=function(a){return v(a)===d};reactIs_production_min.isLazy=function(a){return v(a)===q};reactIs_production_min.isMemo=function(a){return v(a)===p};
|
|
896
|
-
reactIs_production_min.isPortal=function(a){return v(a)===c};reactIs_production_min.isProfiler=function(a){return v(a)===f};reactIs_production_min.isStrictMode=function(a){return v(a)===e};reactIs_production_min.isSuspense=function(a){return v(a)===m};reactIs_production_min.isSuspenseList=function(a){return v(a)===n};
|
|
897
|
-
reactIs_production_min.isValidElementType=function(a){return "string"===typeof a||"function"===typeof a||a===d||a===f||a===e||a===m||a===n||a===t||"object"===typeof a&&null!==a&&(a.$$typeof===q||a.$$typeof===p||a.$$typeof===g||a.$$typeof===h||a.$$typeof===l||a.$$typeof===u||void 0!==a.getModuleId)?true:false};reactIs_production_min.typeOf=v;
|
|
898
|
-
return reactIs_production_min;
|
|
899
|
-
}
|
|
900
|
-
|
|
901
|
-
var reactIs_development = {};
|
|
902
|
-
|
|
903
|
-
/**
|
|
904
|
-
* @license React
|
|
905
|
-
* react-is.development.js
|
|
906
|
-
*
|
|
907
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
908
|
-
*
|
|
909
|
-
* This source code is licensed under the MIT license found in the
|
|
910
|
-
* LICENSE file in the root directory of undefined source tree.
|
|
911
|
-
*/
|
|
912
|
-
|
|
913
|
-
var hasRequiredReactIs_development;
|
|
914
|
-
|
|
915
|
-
function requireReactIs_development () {
|
|
916
|
-
if (hasRequiredReactIs_development) return reactIs_development;
|
|
917
|
-
hasRequiredReactIs_development = 1;
|
|
918
|
-
|
|
919
|
-
if (process.env.NODE_ENV !== "production") {
|
|
920
|
-
(function() {
|
|
921
|
-
|
|
922
|
-
// ATTENTION
|
|
923
|
-
// When adding new symbols to undefined file,
|
|
924
|
-
// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
|
|
925
|
-
// The Symbol used to tag the ReactElement-like types.
|
|
926
|
-
var REACT_ELEMENT_TYPE = Symbol.for('react.element');
|
|
927
|
-
var REACT_PORTAL_TYPE = Symbol.for('react.portal');
|
|
928
|
-
var REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');
|
|
929
|
-
var REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');
|
|
930
|
-
var REACT_PROFILER_TYPE = Symbol.for('react.profiler');
|
|
931
|
-
var REACT_PROVIDER_TYPE = Symbol.for('react.provider');
|
|
932
|
-
var REACT_CONTEXT_TYPE = Symbol.for('react.context');
|
|
933
|
-
var REACT_SERVER_CONTEXT_TYPE = Symbol.for('react.server_context');
|
|
934
|
-
var REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');
|
|
935
|
-
var REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');
|
|
936
|
-
var REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');
|
|
937
|
-
var REACT_MEMO_TYPE = Symbol.for('react.memo');
|
|
938
|
-
var REACT_LAZY_TYPE = Symbol.for('react.lazy');
|
|
939
|
-
var REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');
|
|
940
|
-
|
|
941
|
-
// -----------------------------------------------------------------------------
|
|
942
|
-
|
|
943
|
-
var enableScopeAPI = false; // Experimental Create Event Handle API.
|
|
944
|
-
var enableCacheElement = false;
|
|
945
|
-
var enableTransitionTracing = false; // No known bugs, but needs performance testing
|
|
946
|
-
|
|
947
|
-
var enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber
|
|
948
|
-
// stuff. Intended to enable React core members to more easily debug scheduling
|
|
949
|
-
// issues in DEV builds.
|
|
950
|
-
|
|
951
|
-
var enableDebugTracing = false; // Track which Fiber(s) schedule render work.
|
|
952
|
-
|
|
953
|
-
var REACT_MODULE_REFERENCE;
|
|
954
|
-
|
|
955
|
-
{
|
|
956
|
-
REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');
|
|
957
|
-
}
|
|
958
|
-
|
|
959
|
-
function isValidElementType(type) {
|
|
960
|
-
if (typeof type === 'string' || typeof type === 'function') {
|
|
961
|
-
return true;
|
|
962
|
-
} // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
if (type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing ) {
|
|
966
|
-
return true;
|
|
967
|
-
}
|
|
968
|
-
|
|
969
|
-
if (typeof type === 'object' && type !== null) {
|
|
970
|
-
if (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object
|
|
971
|
-
// types supported by any Flight configuration anywhere since
|
|
972
|
-
// we don't know which Flight build undefined will end up being used
|
|
973
|
-
// with.
|
|
974
|
-
type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {
|
|
975
|
-
return true;
|
|
976
|
-
}
|
|
977
|
-
}
|
|
978
|
-
|
|
979
|
-
return false;
|
|
980
|
-
}
|
|
981
|
-
|
|
982
|
-
function typeOf(object) {
|
|
983
|
-
if (typeof object === 'object' && object !== null) {
|
|
984
|
-
var $$typeof = object.$$typeof;
|
|
985
|
-
|
|
986
|
-
switch ($$typeof) {
|
|
987
|
-
case REACT_ELEMENT_TYPE:
|
|
988
|
-
var type = object.type;
|
|
989
|
-
|
|
990
|
-
switch (type) {
|
|
991
|
-
case REACT_FRAGMENT_TYPE:
|
|
992
|
-
case REACT_PROFILER_TYPE:
|
|
993
|
-
case REACT_STRICT_MODE_TYPE:
|
|
994
|
-
case REACT_SUSPENSE_TYPE:
|
|
995
|
-
case REACT_SUSPENSE_LIST_TYPE:
|
|
996
|
-
return type;
|
|
997
|
-
|
|
998
|
-
default:
|
|
999
|
-
var $$typeofType = type && type.$$typeof;
|
|
1000
|
-
|
|
1001
|
-
switch ($$typeofType) {
|
|
1002
|
-
case REACT_SERVER_CONTEXT_TYPE:
|
|
1003
|
-
case REACT_CONTEXT_TYPE:
|
|
1004
|
-
case REACT_FORWARD_REF_TYPE:
|
|
1005
|
-
case REACT_LAZY_TYPE:
|
|
1006
|
-
case REACT_MEMO_TYPE:
|
|
1007
|
-
case REACT_PROVIDER_TYPE:
|
|
1008
|
-
return $$typeofType;
|
|
1009
|
-
|
|
1010
|
-
default:
|
|
1011
|
-
return $$typeof;
|
|
1012
|
-
}
|
|
1013
|
-
|
|
1014
|
-
}
|
|
1015
|
-
|
|
1016
|
-
case REACT_PORTAL_TYPE:
|
|
1017
|
-
return $$typeof;
|
|
1018
|
-
}
|
|
1019
|
-
}
|
|
1020
|
-
|
|
1021
|
-
return undefined;
|
|
1022
|
-
}
|
|
1023
|
-
var ContextConsumer = REACT_CONTEXT_TYPE;
|
|
1024
|
-
var ContextProvider = REACT_PROVIDER_TYPE;
|
|
1025
|
-
var Element = REACT_ELEMENT_TYPE;
|
|
1026
|
-
var ForwardRef = REACT_FORWARD_REF_TYPE;
|
|
1027
|
-
var Fragment = REACT_FRAGMENT_TYPE;
|
|
1028
|
-
var Lazy = REACT_LAZY_TYPE;
|
|
1029
|
-
var Memo = REACT_MEMO_TYPE;
|
|
1030
|
-
var Portal = REACT_PORTAL_TYPE;
|
|
1031
|
-
var Profiler = REACT_PROFILER_TYPE;
|
|
1032
|
-
var StrictMode = REACT_STRICT_MODE_TYPE;
|
|
1033
|
-
var Suspense = REACT_SUSPENSE_TYPE;
|
|
1034
|
-
var SuspenseList = REACT_SUSPENSE_LIST_TYPE;
|
|
1035
|
-
var hasWarnedAboutDeprecatedIsAsyncMode = false;
|
|
1036
|
-
var hasWarnedAboutDeprecatedIsConcurrentMode = false; // AsyncMode should be deprecated
|
|
1037
|
-
|
|
1038
|
-
function isAsyncMode(object) {
|
|
1039
|
-
{
|
|
1040
|
-
if (!hasWarnedAboutDeprecatedIsAsyncMode) {
|
|
1041
|
-
hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint
|
|
1042
|
-
|
|
1043
|
-
console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 18+.');
|
|
1044
|
-
}
|
|
1045
|
-
}
|
|
1046
|
-
|
|
1047
|
-
return false;
|
|
1048
|
-
}
|
|
1049
|
-
function isConcurrentMode(object) {
|
|
1050
|
-
{
|
|
1051
|
-
if (!hasWarnedAboutDeprecatedIsConcurrentMode) {
|
|
1052
|
-
hasWarnedAboutDeprecatedIsConcurrentMode = true; // Using console['warn'] to evade Babel and ESLint
|
|
1053
|
-
|
|
1054
|
-
console['warn']('The ReactIs.isConcurrentMode() alias has been deprecated, ' + 'and will be removed in React 18+.');
|
|
1055
|
-
}
|
|
1056
|
-
}
|
|
1057
|
-
|
|
1058
|
-
return false;
|
|
1059
|
-
}
|
|
1060
|
-
function isContextConsumer(object) {
|
|
1061
|
-
return typeOf(object) === REACT_CONTEXT_TYPE;
|
|
1062
|
-
}
|
|
1063
|
-
function isContextProvider(object) {
|
|
1064
|
-
return typeOf(object) === REACT_PROVIDER_TYPE;
|
|
1065
|
-
}
|
|
1066
|
-
function isElement(object) {
|
|
1067
|
-
return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
1068
|
-
}
|
|
1069
|
-
function isForwardRef(object) {
|
|
1070
|
-
return typeOf(object) === REACT_FORWARD_REF_TYPE;
|
|
1071
|
-
}
|
|
1072
|
-
function isFragment(object) {
|
|
1073
|
-
return typeOf(object) === REACT_FRAGMENT_TYPE;
|
|
1074
|
-
}
|
|
1075
|
-
function isLazy(object) {
|
|
1076
|
-
return typeOf(object) === REACT_LAZY_TYPE;
|
|
1077
|
-
}
|
|
1078
|
-
function isMemo(object) {
|
|
1079
|
-
return typeOf(object) === REACT_MEMO_TYPE;
|
|
1080
|
-
}
|
|
1081
|
-
function isPortal(object) {
|
|
1082
|
-
return typeOf(object) === REACT_PORTAL_TYPE;
|
|
1083
|
-
}
|
|
1084
|
-
function isProfiler(object) {
|
|
1085
|
-
return typeOf(object) === REACT_PROFILER_TYPE;
|
|
1086
|
-
}
|
|
1087
|
-
function isStrictMode(object) {
|
|
1088
|
-
return typeOf(object) === REACT_STRICT_MODE_TYPE;
|
|
1089
|
-
}
|
|
1090
|
-
function isSuspense(object) {
|
|
1091
|
-
return typeOf(object) === REACT_SUSPENSE_TYPE;
|
|
1092
|
-
}
|
|
1093
|
-
function isSuspenseList(object) {
|
|
1094
|
-
return typeOf(object) === REACT_SUSPENSE_LIST_TYPE;
|
|
1095
|
-
}
|
|
1096
|
-
|
|
1097
|
-
reactIs_development.ContextConsumer = ContextConsumer;
|
|
1098
|
-
reactIs_development.ContextProvider = ContextProvider;
|
|
1099
|
-
reactIs_development.Element = Element;
|
|
1100
|
-
reactIs_development.ForwardRef = ForwardRef;
|
|
1101
|
-
reactIs_development.Fragment = Fragment;
|
|
1102
|
-
reactIs_development.Lazy = Lazy;
|
|
1103
|
-
reactIs_development.Memo = Memo;
|
|
1104
|
-
reactIs_development.Portal = Portal;
|
|
1105
|
-
reactIs_development.Profiler = Profiler;
|
|
1106
|
-
reactIs_development.StrictMode = StrictMode;
|
|
1107
|
-
reactIs_development.Suspense = Suspense;
|
|
1108
|
-
reactIs_development.SuspenseList = SuspenseList;
|
|
1109
|
-
reactIs_development.isAsyncMode = isAsyncMode;
|
|
1110
|
-
reactIs_development.isConcurrentMode = isConcurrentMode;
|
|
1111
|
-
reactIs_development.isContextConsumer = isContextConsumer;
|
|
1112
|
-
reactIs_development.isContextProvider = isContextProvider;
|
|
1113
|
-
reactIs_development.isElement = isElement;
|
|
1114
|
-
reactIs_development.isForwardRef = isForwardRef;
|
|
1115
|
-
reactIs_development.isFragment = isFragment;
|
|
1116
|
-
reactIs_development.isLazy = isLazy;
|
|
1117
|
-
reactIs_development.isMemo = isMemo;
|
|
1118
|
-
reactIs_development.isPortal = isPortal;
|
|
1119
|
-
reactIs_development.isProfiler = isProfiler;
|
|
1120
|
-
reactIs_development.isStrictMode = isStrictMode;
|
|
1121
|
-
reactIs_development.isSuspense = isSuspense;
|
|
1122
|
-
reactIs_development.isSuspenseList = isSuspenseList;
|
|
1123
|
-
reactIs_development.isValidElementType = isValidElementType;
|
|
1124
|
-
reactIs_development.typeOf = typeOf;
|
|
1125
|
-
})();
|
|
1126
|
-
}
|
|
1127
|
-
return reactIs_development;
|
|
1128
|
-
}
|
|
1129
|
-
|
|
1130
|
-
if (process.env.NODE_ENV === 'production') {
|
|
1131
|
-
requireReactIs_production_min();
|
|
1132
|
-
} else {
|
|
1133
|
-
requireReactIs_development();
|
|
1134
|
-
}
|
|
1135
|
-
|
|
1136
|
-
/**
|
|
1137
|
-
* Hook factory, which creates a `useStore` hook bound to a given context.
|
|
1138
|
-
*
|
|
1139
|
-
* @param {React.Context} [context=ReactReduxContext] Context passed to your `<Provider>`.
|
|
1140
|
-
* @returns {Function} A `useStore` hook bound to the specified context.
|
|
1141
|
-
*/
|
|
1142
|
-
|
|
1143
|
-
function createStoreHook(context = ReactReduxContext) {
|
|
1144
|
-
const useReduxContext$1 = // @ts-ignore
|
|
1145
|
-
context === ReactReduxContext ? useReduxContext : // @ts-ignore
|
|
1146
|
-
createReduxContextHook(context);
|
|
1147
|
-
return function useStore() {
|
|
1148
|
-
const {
|
|
1149
|
-
store
|
|
1150
|
-
} = useReduxContext$1(); // @ts-ignore
|
|
1151
|
-
|
|
1152
|
-
return store;
|
|
1153
|
-
};
|
|
1154
|
-
}
|
|
1155
|
-
/**
|
|
1156
|
-
* A hook to access the redux store.
|
|
1157
|
-
*
|
|
1158
|
-
* @returns {any} the redux store
|
|
1159
|
-
*
|
|
1160
|
-
* @example
|
|
1161
|
-
*
|
|
1162
|
-
* import React from 'react'
|
|
1163
|
-
* import { useStore } from 'react-redux'
|
|
1164
|
-
*
|
|
1165
|
-
* export const ExampleComponent = () => {
|
|
1166
|
-
* const store = useStore()
|
|
1167
|
-
* return <div>{store.getState()}</div>
|
|
1168
|
-
* }
|
|
1169
|
-
*/
|
|
1170
|
-
|
|
1171
|
-
const useStore = /*#__PURE__*/createStoreHook();
|
|
1172
|
-
|
|
1173
|
-
/**
|
|
1174
|
-
* Hook factory, which creates a `useDispatch` hook bound to a given context.
|
|
1175
|
-
*
|
|
1176
|
-
* @param {React.Context} [context=ReactReduxContext] Context passed to your `<Provider>`.
|
|
1177
|
-
* @returns {Function} A `useDispatch` hook bound to the specified context.
|
|
1178
|
-
*/
|
|
1179
|
-
|
|
1180
|
-
function createDispatchHook(context = ReactReduxContext) {
|
|
1181
|
-
const useStore$1 = // @ts-ignore
|
|
1182
|
-
context === ReactReduxContext ? useStore : createStoreHook(context);
|
|
1183
|
-
return function useDispatch() {
|
|
1184
|
-
const store = useStore$1(); // @ts-ignore
|
|
1185
|
-
|
|
1186
|
-
return store.dispatch;
|
|
1187
|
-
};
|
|
1188
|
-
}
|
|
1189
|
-
/**
|
|
1190
|
-
* A hook to access the redux `dispatch` function.
|
|
1191
|
-
*
|
|
1192
|
-
* @returns {any|function} redux store's `dispatch` function
|
|
1193
|
-
*
|
|
1194
|
-
* @example
|
|
1195
|
-
*
|
|
1196
|
-
* import React, { useCallback } from 'react'
|
|
1197
|
-
* import { useDispatch } from 'react-redux'
|
|
1198
|
-
*
|
|
1199
|
-
* export const CounterComponent = ({ value }) => {
|
|
1200
|
-
* const dispatch = useDispatch()
|
|
1201
|
-
* const increaseCounter = useCallback(() => dispatch({ type: 'increase-counter' }), [])
|
|
1202
|
-
* return (
|
|
1203
|
-
* <div>
|
|
1204
|
-
* <span>{value}</span>
|
|
1205
|
-
* <button onClick={increaseCounter}>Increase counter</button>
|
|
1206
|
-
* </div>
|
|
1207
|
-
* )
|
|
1208
|
-
* }
|
|
1209
|
-
*/
|
|
1210
|
-
|
|
1211
|
-
const useDispatch = /*#__PURE__*/createDispatchHook();
|
|
1212
|
-
|
|
1213
|
-
// The primary entry point assumes we're working with standard ReactDOM/RN, but
|
|
1214
|
-
// older versions that do not include `useSyncExternalStore` (React 16.9 - 17.x).
|
|
1215
|
-
// Because of that, the useSyncExternalStore compat shim is needed.
|
|
1216
|
-
initializeUseSelector(withSelectorExports.useSyncExternalStoreWithSelector);
|
|
1217
|
-
|
|
1218
|
-
function n(n){for(var r=arguments.length,t=Array(r>1?r-1:0),e=1;e<r;e++)t[e-1]=arguments[e];if("production"!==process.env.NODE_ENV){var i=Y[n],o=i?"function"==typeof i?i.apply(null,t):i:"unknown error nr: "+n;throw Error("[Immer] "+o)}throw Error("[Immer] minified error nr: "+n+(t.length?" "+t.map((function(n){return "'"+n+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function r$1(n){return !!n&&!!n[Q$1]}function t(n){var r;return !!n&&(function(n){if(!n||"object"!=typeof n)return false;var r=Object.getPrototypeOf(n);if(null===r)return true;var t=Object.hasOwnProperty.call(r,"constructor")&&r.constructor;return t===Object||"function"==typeof t&&Function.toString.call(t)===Z$1}(n)||Array.isArray(n)||!!n[L$1]||!!(null===(r=n.constructor)||void 0===r?void 0:r[L$1])||s(n)||v(n))}function i(n,r,t){ void 0===t&&(t=false),0===o(n)?(t?Object.keys:nn)(n).forEach((function(e){t&&"symbol"==typeof e||r(e,n[e],n);})):n.forEach((function(t,e){return r(e,t,n)}));}function o(n){var r=n[Q$1];return r?r.i>3?r.i-4:r.i:Array.isArray(n)?1:s(n)?2:v(n)?3:0}function u(n,r){return 2===o(n)?n.has(r):Object.prototype.hasOwnProperty.call(n,r)}function a(n,r){return 2===o(n)?n.get(r):n[r]}function f(n,r,t){var e=o(n);2===e?n.set(r,t):3===e?n.add(t):n[r]=t;}function c(n,r){return n===r?0!==n||1/n==1/r:n!=n&&r!=r}function s(n){return X$1&&n instanceof Map}function v(n){return q&&n instanceof Set}function p(n){return n.o||n.t}function l(n){if(Array.isArray(n))return Array.prototype.slice.call(n);var r=rn(n);delete r[Q$1];for(var t=nn(r),e=0;e<t.length;e++){var i=t[e],o=r[i];false===o.writable&&(o.writable=true,o.configurable=true),(o.get||o.set)&&(r[i]={configurable:true,writable:true,enumerable:o.enumerable,value:n[i]});}return Object.create(Object.getPrototypeOf(n),r)}function d(n,e){return void 0===e&&(e=false),y$1(n)||r$1(n)||!t(n)||(o(n)>1&&(n.set=n.add=n.clear=n.delete=h),Object.freeze(n),e&&i(n,(function(n,r){return d(r,true)}),true)),n}function h(){n(2);}function y$1(n){return null==n||"object"!=typeof n||Object.isFrozen(n)}function b(r){var t=tn[r];return t||n(18,r),t}function m(n,r){tn[n]||(tn[n]=r);}function _(){return "production"===process.env.NODE_ENV||U$1||n(0),U$1}function j(n,r){r&&(b("Patches"),n.u=[],n.s=[],n.v=r);}function g(n){O(n),n.p.forEach(S),n.p=null;}function O(n){n===U$1&&(U$1=n.l);}function w(n){return U$1={p:[],l:U$1,h:n,m:true,_:0}}function S(n){var r=n[Q$1];0===r.i||1===r.i?r.j():r.g=true;}function P$1(r,e){e._=e.p.length;var i=e.p[0],o=void 0!==r&&r!==i;return e.h.O||b("ES5").S(e,r,o),o?(i[Q$1].P&&(g(e),n(4)),t(r)&&(r=M(e,r),e.l||x(e,r)),e.u&&b("Patches").M(i[Q$1].t,r,e.u,e.s)):r=M(e,i,[]),g(e),e.u&&e.v(e.u,e.s),r!==H?r:void 0}function M(n,r,t){if(y$1(r))return r;var e=r[Q$1];if(!e)return i(r,(function(i,o){return A(n,e,r,i,o,t)}),true),r;if(e.A!==n)return r;if(!e.P)return x(n,e.t,true),e.t;if(!e.I){e.I=true,e.A._--;var o=4===e.i||5===e.i?e.o=l(e.k):e.o,u=o,a=false;3===e.i&&(u=new Set(o),o.clear(),a=true),i(u,(function(r,i){return A(n,e,o,r,i,t,a)})),x(n,o,false),t&&n.u&&b("Patches").N(e,t,n.u,n.s);}return e.o}function A(e,i,o,a,c,s,v){if("production"!==process.env.NODE_ENV&&c===o&&n(5),r$1(c)){var p=M(e,c,s&&i&&3!==i.i&&!u(i.R,a)?s.concat(a):void 0);if(f(o,a,p),!r$1(p))return;e.m=false;}else v&&o.add(c);if(t(c)&&!y$1(c)){if(!e.h.D&&e._<1)return;M(e,c),i&&i.A.l||x(e,c);}}function x(n,r,t){ void 0===t&&(t=false),!n.l&&n.h.D&&n.m&&d(r,t);}function z$1(n,r){var t=n[Q$1];return (t?p(t):n)[r]}function I$1(n,r){if(r in n)for(var t=Object.getPrototypeOf(n);t;){var e=Object.getOwnPropertyDescriptor(t,r);if(e)return e;t=Object.getPrototypeOf(t);}}function k(n){n.P||(n.P=true,n.l&&k(n.l));}function E(n){n.o||(n.o=l(n.t));}function N$1(n,r,t){var e=s(r)?b("MapSet").F(r,t):v(r)?b("MapSet").T(r,t):n.O?function(n,r){var t=Array.isArray(n),e={i:t?1:0,A:r?r.A:_(),P:false,I:false,R:{},l:r,t:n,k:null,o:null,j:null,C:false},i=e,o=en;t&&(i=[e],o=on$1);var u=Proxy.revocable(i,o),a=u.revoke,f=u.proxy;return e.k=f,e.j=a,f}(r,t):b("ES5").J(r,t);return (t?t.A:_()).p.push(e),e}function R(e){return r$1(e)||n(22,e),function n(r){if(!t(r))return r;var e,u=r[Q$1],c=o(r);if(u){if(!u.P&&(u.i<4||!b("ES5").K(u)))return u.t;u.I=true,e=D(r,c),u.I=false;}else e=D(r,c);return i(e,(function(r,t){u&&a(u.t,r)===t||f(e,r,n(t));})),3===c?new Set(e):e}(e)}function D(n,r){switch(r){case 2:return new Map(n);case 3:return Array.from(n)}return l(n)}function F$1(){function t(n,r){var t=s[n];return t?t.enumerable=r:s[n]=t={configurable:true,enumerable:r,get:function(){var r=undefined[Q$1];return "production"!==process.env.NODE_ENV&&f(r),en.get(r,n)},set:function(r){var t=undefined[Q$1];"production"!==process.env.NODE_ENV&&f(t),en.set(t,n,r);}},t}function e(n){for(var r=n.length-1;r>=0;r--){var t=n[r][Q$1];if(!t.P)switch(t.i){case 5:a(t)&&k(t);break;case 4:o(t)&&k(t);}}}function o(n){for(var r=n.t,t=n.k,e=nn(t),i=e.length-1;i>=0;i--){var o=e[i];if(o!==Q$1){var a=r[o];if(void 0===a&&!u(r,o))return true;var f=t[o],s=f&&f[Q$1];if(s?s.t!==a:!c(f,a))return true}}var v=!!r[Q$1];return e.length!==nn(r).length+(v?0:1)}function a(n){var r=n.k;if(r.length!==n.t.length)return true;var t=Object.getOwnPropertyDescriptor(r,r.length-1);if(t&&!t.get)return true;for(var e=0;e<r.length;e++)if(!r.hasOwnProperty(e))return true;return false}function f(r){r.g&&n(3,JSON.stringify(p(r)));}var s={};m("ES5",{J:function(n,r){var e=Array.isArray(n),i=function(n,r){if(n){for(var e=Array(r.length),i=0;i<r.length;i++)Object.defineProperty(e,""+i,t(i,true));return e}var o=rn(r);delete o[Q$1];for(var u=nn(o),a=0;a<u.length;a++){var f=u[a];o[f]=t(f,n||!!o[f].enumerable);}return Object.create(Object.getPrototypeOf(r),o)}(e,n),o={i:e?5:4,A:r?r.A:_(),P:false,I:false,R:{},l:r,t:n,k:i,o:null,g:false,C:false};return Object.defineProperty(i,Q$1,{value:o,writable:true}),i},S:function(n,t,o){o?r$1(t)&&t[Q$1].A===n&&e(n.p):(n.u&&function n(r){if(r&&"object"==typeof r){var t=r[Q$1];if(t){var e=t.t,o=t.k,f=t.R,c=t.i;if(4===c)i(o,(function(r){r!==Q$1&&(void 0!==e[r]||u(e,r)?f[r]||n(o[r]):(f[r]=true,k(t)));})),i(e,(function(n){ void 0!==o[n]||u(o,n)||(f[n]=false,k(t));}));else if(5===c){if(a(t)&&(k(t),f.length=true),o.length<e.length)for(var s=o.length;s<e.length;s++)f[s]=false;else for(var v=e.length;v<o.length;v++)f[v]=true;for(var p=Math.min(o.length,e.length),l=0;l<p;l++)o.hasOwnProperty(l)||(f[l]=true),void 0===f[l]&&n(o[l]);}}}}(n.p[0]),e(n.p));},K:function(n){return 4===n.i?o(n):a(n)}});}var G$1,U$1,W$1="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),X$1="undefined"!=typeof Map,q="undefined"!=typeof Set,B$1="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,H=W$1?Symbol.for("immer-nothing"):((G$1={})["immer-nothing"]=true,G$1),L$1=W$1?Symbol.for("immer-draftable"):"__$immer_draftable",Q$1=W$1?Symbol.for("immer-state"):"__$immer_state",Y={0:"Illegal state",1:"Immer drafts cannot have computed properties",2:"This object has been frozen and should not be mutated",3:function(n){return "Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+n},4:"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.",5:"Immer forbids circular references",6:"The first or second argument to `produce` must be a function",7:"The third argument to `produce` must be a function or undefined",8:"First argument to `createDraft` must be a plain object, an array, or an immerable object",9:"First argument to `finishDraft` must be a draft returned by `createDraft`",10:"The given draft is already finalized",11:"Object.defineProperty() cannot be used on an Immer draft",12:"Object.setPrototypeOf() cannot be used on an Immer draft",13:"Immer only supports deleting array indices",14:"Immer only supports setting array indices and the 'length' property",15:function(n){return "Cannot apply patch, path doesn't resolve: "+n},16:'Sets cannot have "replace" patches.',17:function(n){return "Unsupported patch operation: "+n},18:function(n){return "The plugin for '"+n+"' has not been loaded into Immer. To enable the plugin, import and call `enable"+n+"()` when initializing your application."},20:"Cannot use proxies if Proxy, Proxy.revocable or Reflect are not available",21:function(n){return "produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '"+n+"'"},22:function(n){return "'current' expects a draft, got: "+n},23:function(n){return "'original' expects a draft, got: "+n},24:"Patching reserved attributes like __proto__, prototype and constructor is not allowed"},Z$1=""+Object.prototype.constructor,nn="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(n){return Object.getOwnPropertyNames(n).concat(Object.getOwnPropertySymbols(n))}:Object.getOwnPropertyNames,rn=Object.getOwnPropertyDescriptors||function(n){var r={};return nn(n).forEach((function(t){r[t]=Object.getOwnPropertyDescriptor(n,t);})),r},tn={},en={get:function(n,r){if(r===Q$1)return n;var e=p(n);if(!u(e,r))return function(n,r,t){var e,i=I$1(r,t);return i?"value"in i?i.value:null===(e=i.get)||void 0===e?void 0:e.call(n.k):void 0}(n,e,r);var i=e[r];return n.I||!t(i)?i:i===z$1(n.t,r)?(E(n),n.o[r]=N$1(n.A.h,i,n)):i},has:function(n,r){return r in p(n)},ownKeys:function(n){return Reflect.ownKeys(p(n))},set:function(n,r,t){var e=I$1(p(n),r);if(null==e?void 0:e.set)return e.set.call(n.k,t),true;if(!n.P){var i=z$1(p(n),r),o=null==i?void 0:i[Q$1];if(o&&o.t===t)return n.o[r]=t,n.R[r]=false,true;if(c(t,i)&&(void 0!==t||u(n.t,r)))return true;E(n),k(n);}return n.o[r]===t&&(void 0!==t||r in n.o)||Number.isNaN(t)&&Number.isNaN(n.o[r])||(n.o[r]=t,n.R[r]=true),true},deleteProperty:function(n,r){return void 0!==z$1(n.t,r)||r in n.t?(n.R[r]=false,E(n),k(n)):delete n.R[r],n.o&&delete n.o[r],true},getOwnPropertyDescriptor:function(n,r){var t=p(n),e=Reflect.getOwnPropertyDescriptor(t,r);return e?{writable:true,configurable:1!==n.i||"length"!==r,enumerable:e.enumerable,value:t[r]}:e},defineProperty:function(){n(11);},getPrototypeOf:function(n){return Object.getPrototypeOf(n.t)},setPrototypeOf:function(){n(12);}},on$1={};i(en,(function(n,r){on$1[n]=function(){return arguments[0]=arguments[0][0],r.apply(undefined,arguments)};})),on$1.deleteProperty=function(r,t){return "production"!==process.env.NODE_ENV&&isNaN(parseInt(t))&&n(13),on$1.set.call(undefined,r,t,void 0)},on$1.set=function(r,t,e){return "production"!==process.env.NODE_ENV&&"length"!==t&&isNaN(parseInt(t))&&n(14),en.set.call(undefined,r[0],t,e,r[0])};var un=function(){function e(r){var e=undefined;this.O=B$1,this.D=true,this.produce=function(r,i,o){if("function"==typeof r&&"function"!=typeof i){var u=i;i=r;var a=e;return function(n){var r=undefined;void 0===n&&(n=u);for(var t=arguments.length,e=Array(t>1?t-1:0),o=1;o<t;o++)e[o-1]=arguments[o];return a.produce(n,(function(n){var t;return (t=i).call.apply(t,[r,n].concat(e))}))}}var f;if("function"!=typeof i&&n(6),void 0!==o&&"function"!=typeof o&&n(7),t(r)){var c=w(e),s=N$1(e,r,void 0),v=true;try{f=i(s),v=!1;}finally{v?g(c):O(c);}return "undefined"!=typeof Promise&&f instanceof Promise?f.then((function(n){return j(c,o),P$1(n,c)}),(function(n){throw g(c),n})):(j(c,o),P$1(f,c))}if(!r||"object"!=typeof r){if(void 0===(f=i(r))&&(f=r),f===H&&(f=void 0),e.D,o){var p=[],l=[];b("Patches").M(r,f,p,l),o(p,l);}return f}n(21,r);},this.produceWithPatches=function(n,r){if("function"==typeof n)return function(r){for(var t=arguments.length,i=Array(t>1?t-1:0),o=1;o<t;o++)i[o-1]=arguments[o];return e.produceWithPatches(r,(function(r){return n.apply(void 0,[r].concat(i))}))};var t,i,o=e.produce(n,r,(function(n,r){t=n,i=r;}));return "undefined"!=typeof Promise&&o instanceof Promise?o.then((function(n){return [n,t,i]})):[o,t,i]},"boolean"==typeof(null==r?void 0:r.useProxies)&&this.setUseProxies(r.useProxies),"boolean"==typeof(null==r?void 0:r.autoFreeze)&&this.setAutoFreeze(r.autoFreeze);}var i=e.prototype;return i.createDraft=function(e){t(e)||n(8),r$1(e)&&(e=R(e));var i=w(undefined),o=N$1(undefined,e,void 0);return o[Q$1].C=true,O(i),o},i.finishDraft=function(r,t){var e=r&&r[Q$1];"production"!==process.env.NODE_ENV&&(e&&e.C||n(9),e.I&&n(10));var i=e.A;return j(i,t),P$1(void 0,i)},i.setAutoFreeze=function(n){this.D=n;},i.setUseProxies=function(r){r&&!B$1&&n(20),this.O=r;},i.applyPatches=function(n,t){var e;for(e=t.length-1;e>=0;e--){var i=t[e];if(0===i.path.length&&"replace"===i.op){n=i.value;break}}e>-1&&(t=t.slice(e+1));var o=b("Patches").$;return r$1(n)?o(n,t):this.produce(n,(function(n){return o(n,t)}))},e}(),an=new un,fn=an.produce;an.produceWithPatches.bind(an);an.setAutoFreeze.bind(an);an.setUseProxies.bind(an);an.applyPatches.bind(an);an.createDraft.bind(an);an.finishDraft.bind(an);
|
|
1219
|
-
|
|
1220
|
-
var __extends = (function () {
|
|
1221
|
-
var extendStatics = function (d, b) {
|
|
1222
|
-
extendStatics = Object.setPrototypeOf ||
|
|
1223
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
1224
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
1225
|
-
return extendStatics(d, b);
|
|
1226
|
-
};
|
|
1227
|
-
return function (d, b) {
|
|
1228
|
-
if (typeof b !== "function" && b !== null)
|
|
1229
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
1230
|
-
extendStatics(d, b);
|
|
1231
|
-
function __() { this.constructor = d; }
|
|
1232
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
1233
|
-
};
|
|
1234
|
-
})();
|
|
1235
|
-
var __generator = function (thisArg, body) {
|
|
1236
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
1237
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return undefined; }), g;
|
|
1238
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
1239
|
-
function step(op) {
|
|
1240
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
1241
|
-
while (_) try {
|
|
1242
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
1243
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
1244
|
-
switch (op[0]) {
|
|
1245
|
-
case 0: case 1: t = op; break;
|
|
1246
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
1247
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
1248
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
1249
|
-
default:
|
|
1250
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
1251
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
1252
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
1253
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
1254
|
-
if (t[2]) _.ops.pop();
|
|
1255
|
-
_.trys.pop(); continue;
|
|
1256
|
-
}
|
|
1257
|
-
op = body.call(thisArg, _);
|
|
1258
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
1259
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
1260
|
-
}
|
|
1261
|
-
};
|
|
1262
|
-
var __spreadArray = function (to, from) {
|
|
1263
|
-
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
|
1264
|
-
to[j] = from[i];
|
|
1265
|
-
return to;
|
|
1266
|
-
};
|
|
1267
|
-
var __defProp = Object.defineProperty;
|
|
1268
|
-
var __defProps = Object.defineProperties;
|
|
1269
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
1270
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
1271
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
1272
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
1273
|
-
var __defNormalProp = function (obj, key, value) { return key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value: value }) : obj[key] = value; };
|
|
1274
|
-
var __spreadValues = function (a, b) {
|
|
1275
|
-
for (var prop in b || (b = {}))
|
|
1276
|
-
if (__hasOwnProp.call(b, prop))
|
|
1277
|
-
__defNormalProp(a, prop, b[prop]);
|
|
1278
|
-
if (__getOwnPropSymbols)
|
|
1279
|
-
for (var _i = 0, _c = __getOwnPropSymbols(b); _i < _c.length; _i++) {
|
|
1280
|
-
var prop = _c[_i];
|
|
1281
|
-
if (__propIsEnum.call(b, prop))
|
|
1282
|
-
__defNormalProp(a, prop, b[prop]);
|
|
1283
|
-
}
|
|
1284
|
-
return a;
|
|
1285
|
-
};
|
|
1286
|
-
var __spreadProps = function (a, b) { return __defProps(a, __getOwnPropDescs(b)); };
|
|
1287
|
-
var __async = function (__this, __arguments, generator) {
|
|
1288
|
-
return new Promise(function (resolve, reject) {
|
|
1289
|
-
var fulfilled = function (value) {
|
|
1290
|
-
try {
|
|
1291
|
-
step(generator.next(value));
|
|
1292
|
-
}
|
|
1293
|
-
catch (e) {
|
|
1294
|
-
reject(e);
|
|
1295
|
-
}
|
|
1296
|
-
};
|
|
1297
|
-
var rejected = function (value) {
|
|
1298
|
-
try {
|
|
1299
|
-
step(generator.throw(value));
|
|
1300
|
-
}
|
|
1301
|
-
catch (e) {
|
|
1302
|
-
reject(e);
|
|
1303
|
-
}
|
|
1304
|
-
};
|
|
1305
|
-
var step = function (x) { return x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected); };
|
|
1306
|
-
step((generator = generator.apply(__this, __arguments)).next());
|
|
1307
|
-
});
|
|
1308
|
-
};
|
|
1309
|
-
// src/createAction.ts
|
|
1310
|
-
function createAction(type, prepareAction) {
|
|
1311
|
-
function actionCreator() {
|
|
1312
|
-
var args = [];
|
|
1313
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
1314
|
-
args[_i] = arguments[_i];
|
|
1315
|
-
}
|
|
1316
|
-
if (prepareAction) {
|
|
1317
|
-
var prepared = prepareAction.apply(void 0, args);
|
|
1318
|
-
if (!prepared) {
|
|
1319
|
-
throw new Error("prepareAction did not return an object");
|
|
1320
|
-
}
|
|
1321
|
-
return __spreadValues(__spreadValues({
|
|
1322
|
-
type: type,
|
|
1323
|
-
payload: prepared.payload
|
|
1324
|
-
}, "meta" in prepared && { meta: prepared.meta }), "error" in prepared && { error: prepared.error });
|
|
1325
|
-
}
|
|
1326
|
-
return { type: type, payload: args[0] };
|
|
1327
|
-
}
|
|
1328
|
-
actionCreator.toString = function () { return "" + type; };
|
|
1329
|
-
actionCreator.type = type;
|
|
1330
|
-
actionCreator.match = function (action) { return action.type === type; };
|
|
1331
|
-
return actionCreator;
|
|
1332
|
-
}
|
|
1333
|
-
/** @class */ ((function (_super) {
|
|
1334
|
-
__extends(MiddlewareArray, _super);
|
|
1335
|
-
function MiddlewareArray() {
|
|
1336
|
-
var args = [];
|
|
1337
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
1338
|
-
args[_i] = arguments[_i];
|
|
1339
|
-
}
|
|
1340
|
-
var _this = _super.apply(undefined, args) || undefined;
|
|
1341
|
-
Object.setPrototypeOf(_this, MiddlewareArray.prototype);
|
|
1342
|
-
return _this;
|
|
1343
|
-
}
|
|
1344
|
-
Object.defineProperty(MiddlewareArray, Symbol.species, {
|
|
1345
|
-
get: function () {
|
|
1346
|
-
return MiddlewareArray;
|
|
1347
|
-
},
|
|
1348
|
-
enumerable: false,
|
|
1349
|
-
configurable: true
|
|
1350
|
-
});
|
|
1351
|
-
MiddlewareArray.prototype.concat = function () {
|
|
1352
|
-
var arr = [];
|
|
1353
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
1354
|
-
arr[_i] = arguments[_i];
|
|
1355
|
-
}
|
|
1356
|
-
return _super.prototype.concat.apply(undefined, arr);
|
|
1357
|
-
};
|
|
1358
|
-
MiddlewareArray.prototype.prepend = function () {
|
|
1359
|
-
var arr = [];
|
|
1360
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
1361
|
-
arr[_i] = arguments[_i];
|
|
1362
|
-
}
|
|
1363
|
-
if (arr.length === 1 && Array.isArray(arr[0])) {
|
|
1364
|
-
return new (MiddlewareArray.bind.apply(MiddlewareArray, __spreadArray([void 0], arr[0].concat(undefined))))();
|
|
1365
|
-
}
|
|
1366
|
-
return new (MiddlewareArray.bind.apply(MiddlewareArray, __spreadArray([void 0], arr.concat(undefined))))();
|
|
1367
|
-
};
|
|
1368
|
-
return MiddlewareArray;
|
|
1369
|
-
})(Array));
|
|
1370
|
-
/** @class */ ((function (_super) {
|
|
1371
|
-
__extends(EnhancerArray, _super);
|
|
1372
|
-
function EnhancerArray() {
|
|
1373
|
-
var args = [];
|
|
1374
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
1375
|
-
args[_i] = arguments[_i];
|
|
1376
|
-
}
|
|
1377
|
-
var _this = _super.apply(undefined, args) || undefined;
|
|
1378
|
-
Object.setPrototypeOf(_this, EnhancerArray.prototype);
|
|
1379
|
-
return _this;
|
|
1380
|
-
}
|
|
1381
|
-
Object.defineProperty(EnhancerArray, Symbol.species, {
|
|
1382
|
-
get: function () {
|
|
1383
|
-
return EnhancerArray;
|
|
1384
|
-
},
|
|
1385
|
-
enumerable: false,
|
|
1386
|
-
configurable: true
|
|
1387
|
-
});
|
|
1388
|
-
EnhancerArray.prototype.concat = function () {
|
|
1389
|
-
var arr = [];
|
|
1390
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
1391
|
-
arr[_i] = arguments[_i];
|
|
1392
|
-
}
|
|
1393
|
-
return _super.prototype.concat.apply(undefined, arr);
|
|
1394
|
-
};
|
|
1395
|
-
EnhancerArray.prototype.prepend = function () {
|
|
1396
|
-
var arr = [];
|
|
1397
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
1398
|
-
arr[_i] = arguments[_i];
|
|
1399
|
-
}
|
|
1400
|
-
if (arr.length === 1 && Array.isArray(arr[0])) {
|
|
1401
|
-
return new (EnhancerArray.bind.apply(EnhancerArray, __spreadArray([void 0], arr[0].concat(undefined))))();
|
|
1402
|
-
}
|
|
1403
|
-
return new (EnhancerArray.bind.apply(EnhancerArray, __spreadArray([void 0], arr.concat(undefined))))();
|
|
1404
|
-
};
|
|
1405
|
-
return EnhancerArray;
|
|
1406
|
-
})(Array));
|
|
1407
|
-
function freezeDraftable(val) {
|
|
1408
|
-
return t(val) ? fn(val, function () {
|
|
1409
|
-
}) : val;
|
|
1410
|
-
}
|
|
1411
|
-
// src/immutableStateInvariantMiddleware.ts
|
|
1412
|
-
process.env.NODE_ENV === "production";
|
|
1413
|
-
// src/configureStore.ts
|
|
1414
|
-
process.env.NODE_ENV === "production";
|
|
1415
|
-
// src/mapBuilders.ts
|
|
1416
|
-
function executeReducerBuilderCallback(builderCallback) {
|
|
1417
|
-
var actionsMap = {};
|
|
1418
|
-
var actionMatchers = [];
|
|
1419
|
-
var defaultCaseReducer;
|
|
1420
|
-
var builder = {
|
|
1421
|
-
addCase: function (typeOrActionCreator, reducer) {
|
|
1422
|
-
if (process.env.NODE_ENV !== "production") {
|
|
1423
|
-
if (actionMatchers.length > 0) {
|
|
1424
|
-
throw new Error("`builder.addCase` should only be called before calling `builder.addMatcher`");
|
|
1425
|
-
}
|
|
1426
|
-
if (defaultCaseReducer) {
|
|
1427
|
-
throw new Error("`builder.addCase` should only be called before calling `builder.addDefaultCase`");
|
|
1428
|
-
}
|
|
1429
|
-
}
|
|
1430
|
-
var type = typeof typeOrActionCreator === "string" ? typeOrActionCreator : typeOrActionCreator.type;
|
|
1431
|
-
if (!type) {
|
|
1432
|
-
throw new Error("`builder.addCase` cannot be called with an empty action type");
|
|
1433
|
-
}
|
|
1434
|
-
if (type in actionsMap) {
|
|
1435
|
-
throw new Error("`builder.addCase` cannot be called with two reducers for the same action type");
|
|
1436
|
-
}
|
|
1437
|
-
actionsMap[type] = reducer;
|
|
1438
|
-
return builder;
|
|
1439
|
-
},
|
|
1440
|
-
addMatcher: function (matcher, reducer) {
|
|
1441
|
-
if (process.env.NODE_ENV !== "production") {
|
|
1442
|
-
if (defaultCaseReducer) {
|
|
1443
|
-
throw new Error("`builder.addMatcher` should only be called before calling `builder.addDefaultCase`");
|
|
1444
|
-
}
|
|
1445
|
-
}
|
|
1446
|
-
actionMatchers.push({ matcher: matcher, reducer: reducer });
|
|
1447
|
-
return builder;
|
|
1448
|
-
},
|
|
1449
|
-
addDefaultCase: function (reducer) {
|
|
1450
|
-
if (process.env.NODE_ENV !== "production") {
|
|
1451
|
-
if (defaultCaseReducer) {
|
|
1452
|
-
throw new Error("`builder.addDefaultCase` can only be called once");
|
|
1453
|
-
}
|
|
1454
|
-
}
|
|
1455
|
-
defaultCaseReducer = reducer;
|
|
1456
|
-
return builder;
|
|
1457
|
-
}
|
|
1458
|
-
};
|
|
1459
|
-
builderCallback(builder);
|
|
1460
|
-
return [actionsMap, actionMatchers, defaultCaseReducer];
|
|
1461
|
-
}
|
|
1462
|
-
// src/createReducer.ts
|
|
1463
|
-
function isStateFunction(x) {
|
|
1464
|
-
return typeof x === "function";
|
|
1465
|
-
}
|
|
1466
|
-
var hasWarnedAboutObjectNotation = false;
|
|
1467
|
-
function createReducer(initialState, mapOrBuilderCallback, actionMatchers, defaultCaseReducer) {
|
|
1468
|
-
if (actionMatchers === void 0) { actionMatchers = []; }
|
|
1469
|
-
if (process.env.NODE_ENV !== "production") {
|
|
1470
|
-
if (typeof mapOrBuilderCallback === "object") {
|
|
1471
|
-
if (!hasWarnedAboutObjectNotation) {
|
|
1472
|
-
hasWarnedAboutObjectNotation = true;
|
|
1473
|
-
console.warn("The object notation for `createReducer` is deprecated, and will be removed in RTK 2.0. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createReducer");
|
|
1474
|
-
}
|
|
1475
|
-
}
|
|
1476
|
-
}
|
|
1477
|
-
var _c = typeof mapOrBuilderCallback === "function" ? executeReducerBuilderCallback(mapOrBuilderCallback) : [mapOrBuilderCallback, actionMatchers, defaultCaseReducer], actionsMap = _c[0], finalActionMatchers = _c[1], finalDefaultCaseReducer = _c[2];
|
|
1478
|
-
var getInitialState;
|
|
1479
|
-
if (isStateFunction(initialState)) {
|
|
1480
|
-
getInitialState = function () { return freezeDraftable(initialState()); };
|
|
1481
|
-
}
|
|
1482
|
-
else {
|
|
1483
|
-
var frozenInitialState_1 = freezeDraftable(initialState);
|
|
1484
|
-
getInitialState = function () { return frozenInitialState_1; };
|
|
1485
|
-
}
|
|
1486
|
-
function reducer(state, action) {
|
|
1487
|
-
if (state === void 0) { state = getInitialState(); }
|
|
1488
|
-
var caseReducers = __spreadArray([
|
|
1489
|
-
actionsMap[action.type]
|
|
1490
|
-
], finalActionMatchers.filter(function (_c) {
|
|
1491
|
-
var matcher = _c.matcher;
|
|
1492
|
-
return matcher(action);
|
|
1493
|
-
}).map(function (_c) {
|
|
1494
|
-
var reducer2 = _c.reducer;
|
|
1495
|
-
return reducer2;
|
|
1496
|
-
}));
|
|
1497
|
-
if (caseReducers.filter(function (cr) { return !!cr; }).length === 0) {
|
|
1498
|
-
caseReducers = [finalDefaultCaseReducer];
|
|
1499
|
-
}
|
|
1500
|
-
return caseReducers.reduce(function (previousState, caseReducer) {
|
|
1501
|
-
if (caseReducer) {
|
|
1502
|
-
if (r$1(previousState)) {
|
|
1503
|
-
var draft = previousState;
|
|
1504
|
-
var result = caseReducer(draft, action);
|
|
1505
|
-
if (result === void 0) {
|
|
1506
|
-
return previousState;
|
|
1507
|
-
}
|
|
1508
|
-
return result;
|
|
1509
|
-
}
|
|
1510
|
-
else if (!t(previousState)) {
|
|
1511
|
-
var result = caseReducer(previousState, action);
|
|
1512
|
-
if (result === void 0) {
|
|
1513
|
-
if (previousState === null) {
|
|
1514
|
-
return previousState;
|
|
1515
|
-
}
|
|
1516
|
-
throw Error("A case reducer on a non-draftable value must not return undefined");
|
|
1517
|
-
}
|
|
1518
|
-
return result;
|
|
1519
|
-
}
|
|
1520
|
-
else {
|
|
1521
|
-
return fn(previousState, function (draft) {
|
|
1522
|
-
return caseReducer(draft, action);
|
|
1523
|
-
});
|
|
1524
|
-
}
|
|
1525
|
-
}
|
|
1526
|
-
return previousState;
|
|
1527
|
-
}, state);
|
|
1528
|
-
}
|
|
1529
|
-
reducer.getInitialState = getInitialState;
|
|
1530
|
-
return reducer;
|
|
1531
|
-
}
|
|
1532
|
-
// src/createSlice.ts
|
|
1533
|
-
var hasWarnedAboutObjectNotation2 = false;
|
|
1534
|
-
function getType2(slice, actionKey) {
|
|
1535
|
-
return slice + "/" + actionKey;
|
|
1536
|
-
}
|
|
1537
|
-
function createSlice(options) {
|
|
1538
|
-
var name = options.name;
|
|
1539
|
-
if (!name) {
|
|
1540
|
-
throw new Error("`name` is a required option for createSlice");
|
|
1541
|
-
}
|
|
1542
|
-
if (typeof process !== "undefined" && process.env.NODE_ENV === "development") {
|
|
1543
|
-
if (options.initialState === void 0) {
|
|
1544
|
-
console.error("You must provide an `initialState` value that is not `undefined`. You may have misspelled `initialState`");
|
|
1545
|
-
}
|
|
1546
|
-
}
|
|
1547
|
-
var initialState = typeof options.initialState == "function" ? options.initialState : freezeDraftable(options.initialState);
|
|
1548
|
-
var reducers = options.reducers || {};
|
|
1549
|
-
var reducerNames = Object.keys(reducers);
|
|
1550
|
-
var sliceCaseReducersByName = {};
|
|
1551
|
-
var sliceCaseReducersByType = {};
|
|
1552
|
-
var actionCreators = {};
|
|
1553
|
-
reducerNames.forEach(function (reducerName) {
|
|
1554
|
-
var maybeReducerWithPrepare = reducers[reducerName];
|
|
1555
|
-
var type = getType2(name, reducerName);
|
|
1556
|
-
var caseReducer;
|
|
1557
|
-
var prepareCallback;
|
|
1558
|
-
if ("reducer" in maybeReducerWithPrepare) {
|
|
1559
|
-
caseReducer = maybeReducerWithPrepare.reducer;
|
|
1560
|
-
prepareCallback = maybeReducerWithPrepare.prepare;
|
|
1561
|
-
}
|
|
1562
|
-
else {
|
|
1563
|
-
caseReducer = maybeReducerWithPrepare;
|
|
1564
|
-
}
|
|
1565
|
-
sliceCaseReducersByName[reducerName] = caseReducer;
|
|
1566
|
-
sliceCaseReducersByType[type] = caseReducer;
|
|
1567
|
-
actionCreators[reducerName] = prepareCallback ? createAction(type, prepareCallback) : createAction(type);
|
|
1568
|
-
});
|
|
1569
|
-
function buildReducer() {
|
|
1570
|
-
if (process.env.NODE_ENV !== "production") {
|
|
1571
|
-
if (typeof options.extraReducers === "object") {
|
|
1572
|
-
if (!hasWarnedAboutObjectNotation2) {
|
|
1573
|
-
hasWarnedAboutObjectNotation2 = true;
|
|
1574
|
-
console.warn("The object notation for `createSlice.extraReducers` is deprecated, and will be removed in RTK 2.0. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createSlice");
|
|
1575
|
-
}
|
|
1576
|
-
}
|
|
1577
|
-
}
|
|
1578
|
-
var _c = typeof options.extraReducers === "function" ? executeReducerBuilderCallback(options.extraReducers) : [options.extraReducers], _d = _c[0], extraReducers = _d === void 0 ? {} : _d, _e = _c[1], actionMatchers = _e === void 0 ? [] : _e, _f = _c[2], defaultCaseReducer = _f === void 0 ? void 0 : _f;
|
|
1579
|
-
var finalCaseReducers = __spreadValues(__spreadValues({}, extraReducers), sliceCaseReducersByType);
|
|
1580
|
-
return createReducer(initialState, function (builder) {
|
|
1581
|
-
for (var key in finalCaseReducers) {
|
|
1582
|
-
builder.addCase(key, finalCaseReducers[key]);
|
|
1583
|
-
}
|
|
1584
|
-
for (var _i = 0, actionMatchers_1 = actionMatchers; _i < actionMatchers_1.length; _i++) {
|
|
1585
|
-
var m = actionMatchers_1[_i];
|
|
1586
|
-
builder.addMatcher(m.matcher, m.reducer);
|
|
1587
|
-
}
|
|
1588
|
-
if (defaultCaseReducer) {
|
|
1589
|
-
builder.addDefaultCase(defaultCaseReducer);
|
|
1590
|
-
}
|
|
1591
|
-
});
|
|
1592
|
-
}
|
|
1593
|
-
var _reducer;
|
|
1594
|
-
return {
|
|
1595
|
-
name: name,
|
|
1596
|
-
reducer: function (state, action) {
|
|
1597
|
-
if (!_reducer)
|
|
1598
|
-
_reducer = buildReducer();
|
|
1599
|
-
return _reducer(state, action);
|
|
1600
|
-
},
|
|
1601
|
-
actions: actionCreators,
|
|
1602
|
-
caseReducers: sliceCaseReducersByName,
|
|
1603
|
-
getInitialState: function () {
|
|
1604
|
-
if (!_reducer)
|
|
1605
|
-
_reducer = buildReducer();
|
|
1606
|
-
return _reducer.getInitialState();
|
|
1607
|
-
}
|
|
1608
|
-
};
|
|
1609
|
-
}
|
|
1610
|
-
// src/nanoid.ts
|
|
1611
|
-
var urlAlphabet = "ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW";
|
|
1612
|
-
var nanoid = function (size) {
|
|
1613
|
-
if (size === void 0) { size = 21; }
|
|
1614
|
-
var id = "";
|
|
1615
|
-
var i = size;
|
|
1616
|
-
while (i--) {
|
|
1617
|
-
id += urlAlphabet[Math.random() * 64 | 0];
|
|
1618
|
-
}
|
|
1619
|
-
return id;
|
|
1620
|
-
};
|
|
1621
|
-
// src/createAsyncThunk.ts
|
|
1622
|
-
var commonProperties = [
|
|
1623
|
-
"name",
|
|
1624
|
-
"message",
|
|
1625
|
-
"stack",
|
|
1626
|
-
"code"
|
|
1627
|
-
];
|
|
1628
|
-
var RejectWithValue = /** @class */ (function () {
|
|
1629
|
-
function RejectWithValue(payload, meta) {
|
|
1630
|
-
this.payload = payload;
|
|
1631
|
-
this.meta = meta;
|
|
1632
|
-
}
|
|
1633
|
-
return RejectWithValue;
|
|
1634
|
-
}());
|
|
1635
|
-
var FulfillWithMeta = /** @class */ (function () {
|
|
1636
|
-
function FulfillWithMeta(payload, meta) {
|
|
1637
|
-
this.payload = payload;
|
|
1638
|
-
this.meta = meta;
|
|
1639
|
-
}
|
|
1640
|
-
return FulfillWithMeta;
|
|
1641
|
-
}());
|
|
1642
|
-
var miniSerializeError = function (value) {
|
|
1643
|
-
if (typeof value === "object" && value !== null) {
|
|
1644
|
-
var simpleError = {};
|
|
1645
|
-
for (var _i = 0, commonProperties_1 = commonProperties; _i < commonProperties_1.length; _i++) {
|
|
1646
|
-
var property = commonProperties_1[_i];
|
|
1647
|
-
if (typeof value[property] === "string") {
|
|
1648
|
-
simpleError[property] = value[property];
|
|
1649
|
-
}
|
|
1650
|
-
}
|
|
1651
|
-
return simpleError;
|
|
1652
|
-
}
|
|
1653
|
-
return { message: String(value) };
|
|
1654
|
-
};
|
|
1655
|
-
((function () {
|
|
1656
|
-
function createAsyncThunk2(typePrefix, payloadCreator, options) {
|
|
1657
|
-
var fulfilled = createAction(typePrefix + "/fulfilled", function (payload, requestId, arg, meta) { return ({
|
|
1658
|
-
payload: payload,
|
|
1659
|
-
meta: __spreadProps(__spreadValues({}, meta || {}), {
|
|
1660
|
-
arg: arg,
|
|
1661
|
-
requestId: requestId,
|
|
1662
|
-
requestStatus: "fulfilled"
|
|
1663
|
-
})
|
|
1664
|
-
}); });
|
|
1665
|
-
var pending = createAction(typePrefix + "/pending", function (requestId, arg, meta) { return ({
|
|
1666
|
-
payload: void 0,
|
|
1667
|
-
meta: __spreadProps(__spreadValues({}, meta || {}), {
|
|
1668
|
-
arg: arg,
|
|
1669
|
-
requestId: requestId,
|
|
1670
|
-
requestStatus: "pending"
|
|
1671
|
-
})
|
|
1672
|
-
}); });
|
|
1673
|
-
var rejected = createAction(typePrefix + "/rejected", function (error, requestId, arg, payload, meta) { return ({
|
|
1674
|
-
payload: payload,
|
|
1675
|
-
error: (options && options.serializeError || miniSerializeError)(error || "Rejected"),
|
|
1676
|
-
meta: __spreadProps(__spreadValues({}, meta || {}), {
|
|
1677
|
-
arg: arg,
|
|
1678
|
-
requestId: requestId,
|
|
1679
|
-
rejectedWithValue: !!payload,
|
|
1680
|
-
requestStatus: "rejected",
|
|
1681
|
-
aborted: (error == null ? void 0 : error.name) === "AbortError",
|
|
1682
|
-
condition: (error == null ? void 0 : error.name) === "ConditionError"
|
|
1683
|
-
})
|
|
1684
|
-
}); });
|
|
1685
|
-
var displayedWarning = false;
|
|
1686
|
-
var AC = typeof AbortController !== "undefined" ? AbortController : /** @class */ (function () {
|
|
1687
|
-
function class_1() {
|
|
1688
|
-
this.signal = {
|
|
1689
|
-
aborted: false,
|
|
1690
|
-
addEventListener: function () {
|
|
1691
|
-
},
|
|
1692
|
-
dispatchEvent: function () {
|
|
1693
|
-
return false;
|
|
1694
|
-
},
|
|
1695
|
-
onabort: function () {
|
|
1696
|
-
},
|
|
1697
|
-
removeEventListener: function () {
|
|
1698
|
-
},
|
|
1699
|
-
reason: void 0,
|
|
1700
|
-
throwIfAborted: function () {
|
|
1701
|
-
}
|
|
1702
|
-
};
|
|
1703
|
-
}
|
|
1704
|
-
class_1.prototype.abort = function () {
|
|
1705
|
-
if (process.env.NODE_ENV !== "production") {
|
|
1706
|
-
if (!displayedWarning) {
|
|
1707
|
-
displayedWarning = true;
|
|
1708
|
-
console.info("This platform does not implement AbortController. \nIf you want to use the AbortController to react to `abort` events, please consider importing a polyfill like 'abortcontroller-polyfill/dist/abortcontroller-polyfill-only'.");
|
|
1709
|
-
}
|
|
1710
|
-
}
|
|
1711
|
-
};
|
|
1712
|
-
return class_1;
|
|
1713
|
-
}());
|
|
1714
|
-
function actionCreator(arg) {
|
|
1715
|
-
return function (dispatch, getState, extra) {
|
|
1716
|
-
var requestId = (options == null ? void 0 : options.idGenerator) ? options.idGenerator(arg) : nanoid();
|
|
1717
|
-
var abortController = new AC();
|
|
1718
|
-
var abortReason;
|
|
1719
|
-
function abort(reason) {
|
|
1720
|
-
abortReason = reason;
|
|
1721
|
-
abortController.abort();
|
|
1722
|
-
}
|
|
1723
|
-
var promise2 = function () {
|
|
1724
|
-
return __async(undefined, null, function () {
|
|
1725
|
-
var _a, _b, finalAction, conditionResult, abortedPromise, err_1, skipDispatch;
|
|
1726
|
-
return __generator(undefined, function (_c) {
|
|
1727
|
-
switch (_c.label) {
|
|
1728
|
-
case 0:
|
|
1729
|
-
_c.trys.push([0, 4, , 5]);
|
|
1730
|
-
conditionResult = (_a = options == null ? void 0 : options.condition) == null ? void 0 : _a.call(options, arg, { getState: getState, extra: extra });
|
|
1731
|
-
if (!isThenable(conditionResult)) return [3 /*break*/, 2];
|
|
1732
|
-
return [4 /*yield*/, conditionResult];
|
|
1733
|
-
case 1:
|
|
1734
|
-
conditionResult = _c.sent();
|
|
1735
|
-
_c.label = 2;
|
|
1736
|
-
case 2:
|
|
1737
|
-
if (conditionResult === false || abortController.signal.aborted) {
|
|
1738
|
-
throw {
|
|
1739
|
-
name: "ConditionError",
|
|
1740
|
-
message: "Aborted due to condition callback returning false."
|
|
1741
|
-
};
|
|
1742
|
-
}
|
|
1743
|
-
abortedPromise = new Promise(function (_, reject) { return abortController.signal.addEventListener("abort", function () { return reject({
|
|
1744
|
-
name: "AbortError",
|
|
1745
|
-
message: abortReason || "Aborted"
|
|
1746
|
-
}); }); });
|
|
1747
|
-
dispatch(pending(requestId, arg, (_b = options == null ? void 0 : options.getPendingMeta) == null ? void 0 : _b.call(options, { requestId: requestId, arg: arg }, { getState: getState, extra: extra })));
|
|
1748
|
-
return [4 /*yield*/, Promise.race([
|
|
1749
|
-
abortedPromise,
|
|
1750
|
-
Promise.resolve(payloadCreator(arg, {
|
|
1751
|
-
dispatch: dispatch,
|
|
1752
|
-
getState: getState,
|
|
1753
|
-
extra: extra,
|
|
1754
|
-
requestId: requestId,
|
|
1755
|
-
signal: abortController.signal,
|
|
1756
|
-
abort: abort,
|
|
1757
|
-
rejectWithValue: function (value, meta) {
|
|
1758
|
-
return new RejectWithValue(value, meta);
|
|
1759
|
-
},
|
|
1760
|
-
fulfillWithValue: function (value, meta) {
|
|
1761
|
-
return new FulfillWithMeta(value, meta);
|
|
1762
|
-
}
|
|
1763
|
-
})).then(function (result) {
|
|
1764
|
-
if (result instanceof RejectWithValue) {
|
|
1765
|
-
throw result;
|
|
1766
|
-
}
|
|
1767
|
-
if (result instanceof FulfillWithMeta) {
|
|
1768
|
-
return fulfilled(result.payload, requestId, arg, result.meta);
|
|
1769
|
-
}
|
|
1770
|
-
return fulfilled(result, requestId, arg);
|
|
1771
|
-
})
|
|
1772
|
-
])];
|
|
1773
|
-
case 3:
|
|
1774
|
-
finalAction = _c.sent();
|
|
1775
|
-
return [3 /*break*/, 5];
|
|
1776
|
-
case 4:
|
|
1777
|
-
err_1 = _c.sent();
|
|
1778
|
-
finalAction = err_1 instanceof RejectWithValue ? rejected(null, requestId, arg, err_1.payload, err_1.meta) : rejected(err_1, requestId, arg);
|
|
1779
|
-
return [3 /*break*/, 5];
|
|
1780
|
-
case 5:
|
|
1781
|
-
skipDispatch = options && !options.dispatchConditionRejection && rejected.match(finalAction) && finalAction.meta.condition;
|
|
1782
|
-
if (!skipDispatch) {
|
|
1783
|
-
dispatch(finalAction);
|
|
1784
|
-
}
|
|
1785
|
-
return [2 /*return*/, finalAction];
|
|
1786
|
-
}
|
|
1787
|
-
});
|
|
1788
|
-
});
|
|
1789
|
-
}();
|
|
1790
|
-
return Object.assign(promise2, {
|
|
1791
|
-
abort: abort,
|
|
1792
|
-
requestId: requestId,
|
|
1793
|
-
arg: arg,
|
|
1794
|
-
unwrap: function () {
|
|
1795
|
-
return promise2.then(unwrapResult);
|
|
1796
|
-
}
|
|
1797
|
-
});
|
|
1798
|
-
};
|
|
1799
|
-
}
|
|
1800
|
-
return Object.assign(actionCreator, {
|
|
1801
|
-
pending: pending,
|
|
1802
|
-
rejected: rejected,
|
|
1803
|
-
fulfilled: fulfilled,
|
|
1804
|
-
typePrefix: typePrefix
|
|
1805
|
-
});
|
|
1806
|
-
}
|
|
1807
|
-
createAsyncThunk2.withTypes = function () { return createAsyncThunk2; };
|
|
1808
|
-
return createAsyncThunk2;
|
|
1809
|
-
}))();
|
|
1810
|
-
function unwrapResult(action) {
|
|
1811
|
-
if (action.meta && action.meta.rejectedWithValue) {
|
|
1812
|
-
throw action.payload;
|
|
1813
|
-
}
|
|
1814
|
-
if (action.error) {
|
|
1815
|
-
throw action.error;
|
|
1816
|
-
}
|
|
1817
|
-
return action.payload;
|
|
1818
|
-
}
|
|
1819
|
-
function isThenable(value) {
|
|
1820
|
-
return value !== null && typeof value === "object" && typeof value.then === "function";
|
|
1821
|
-
}
|
|
1822
|
-
var alm = "listenerMiddleware";
|
|
1823
|
-
createAction(alm + "/add");
|
|
1824
|
-
createAction(alm + "/removeAll");
|
|
1825
|
-
createAction(alm + "/remove");
|
|
1826
|
-
var promise;
|
|
1827
|
-
typeof queueMicrotask === "function" ? queueMicrotask.bind(typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : globalThis) : function (cb) { return (promise || (promise = Promise.resolve())).then(cb).catch(function (err) { return setTimeout(function () {
|
|
1828
|
-
throw err;
|
|
1829
|
-
}, 0); }); };
|
|
1830
|
-
// src/index.ts
|
|
1831
|
-
F$1();
|
|
1832
|
-
|
|
1833
|
-
// src/redux/achievementSlice.ts
|
|
1834
|
-
const initialState$1 = {
|
|
1835
|
-
config: {},
|
|
1836
|
-
metrics: {},
|
|
1837
|
-
unlockedAchievements: [],
|
|
1838
|
-
previouslyAwardedAchievements: [],
|
|
1839
|
-
storageKey: null,
|
|
1840
|
-
};
|
|
1841
|
-
const achievementSlice = createSlice({
|
|
1842
|
-
name: 'achievements',
|
|
1843
|
-
initialState: initialState$1,
|
|
1844
|
-
reducers: {
|
|
1845
|
-
initialize: (state, action) => {
|
|
1846
|
-
var _a, _b, _c, _d;
|
|
1847
|
-
state.config = action.payload.config;
|
|
1848
|
-
state.storageKey = action.payload.storageKey;
|
|
1849
|
-
const storedState = action.payload.storageKey ? localStorage.getItem(action.payload.storageKey) : null;
|
|
1850
|
-
const initialMetrics = action.payload.initialState ? Object.keys(action.payload.initialState)
|
|
1851
|
-
.filter(key => key !== 'previouslyAwardedAchievements')
|
|
1852
|
-
.reduce((acc, key) => (Object.assign(Object.assign({}, acc), { [key]: Array.isArray(action.payload.initialState[key]) ? action.payload.initialState[key] : [action.payload.initialState[key]] })), {}) : {};
|
|
1853
|
-
const initialAwarded = ((_a = action.payload.initialState) === null || _a === void 0 ? void 0 : _a.previouslyAwardedAchievements) || [];
|
|
1854
|
-
if (storedState) {
|
|
1855
|
-
try {
|
|
1856
|
-
const parsedState = JSON.parse(storedState);
|
|
1857
|
-
state.metrics = ((_b = parsedState.achievements) === null || _b === void 0 ? void 0 : _b.metrics) || initialMetrics;
|
|
1858
|
-
state.unlockedAchievements = ((_c = parsedState.achievements) === null || _c === void 0 ? void 0 : _c.unlockedAchievements) || [];
|
|
1859
|
-
state.previouslyAwardedAchievements = ((_d = parsedState.achievements) === null || _d === void 0 ? void 0 : _d.previouslyAwardedAchievements) || initialAwarded;
|
|
1860
|
-
}
|
|
1861
|
-
catch (error) {
|
|
1862
|
-
console.error('Error parsing stored achievement state:', error);
|
|
1863
|
-
state.metrics = initialMetrics;
|
|
1864
|
-
state.unlockedAchievements = [];
|
|
1865
|
-
state.previouslyAwardedAchievements = initialAwarded;
|
|
1866
|
-
}
|
|
1867
|
-
}
|
|
1868
|
-
else {
|
|
1869
|
-
state.metrics = initialMetrics;
|
|
1870
|
-
state.unlockedAchievements = [];
|
|
1871
|
-
state.previouslyAwardedAchievements = initialAwarded;
|
|
1872
|
-
}
|
|
1873
|
-
},
|
|
1874
|
-
setMetrics: (state, action) => {
|
|
1875
|
-
state.metrics = action.payload;
|
|
1876
|
-
if (state.storageKey) {
|
|
1877
|
-
localStorage.setItem(state.storageKey, JSON.stringify({ achievements: { metrics: state.metrics, unlockedAchievements: state.unlockedAchievements, previouslyAwardedAchievements: state.previouslyAwardedAchievements } }));
|
|
1878
|
-
}
|
|
1879
|
-
},
|
|
1880
|
-
markAchievementAsAwarded: (state, action) => {
|
|
1881
|
-
if (!state.previouslyAwardedAchievements.includes(action.payload)) {
|
|
1882
|
-
state.previouslyAwardedAchievements.push(action.payload);
|
|
1883
|
-
state.unlockedAchievements.push(action.payload); // Also update UI state
|
|
1884
|
-
if (state.storageKey) {
|
|
1885
|
-
localStorage.setItem(state.storageKey, JSON.stringify({ achievements: { metrics: state.metrics, unlockedAchievements: state.unlockedAchievements, previouslyAwardedAchievements: state.previouslyAwardedAchievements } }));
|
|
1886
|
-
}
|
|
1887
|
-
}
|
|
1888
|
-
},
|
|
1889
|
-
resetAchievements: (state) => {
|
|
1890
|
-
state.metrics = {};
|
|
1891
|
-
state.unlockedAchievements = [];
|
|
1892
|
-
state.previouslyAwardedAchievements = [];
|
|
1893
|
-
if (state.storageKey) {
|
|
1894
|
-
localStorage.removeItem(state.storageKey);
|
|
1895
|
-
}
|
|
1896
|
-
},
|
|
1897
|
-
},
|
|
1898
|
-
});
|
|
1899
|
-
const { initialize, setMetrics, resetAchievements, markAchievementAsAwarded } = achievementSlice.actions;
|
|
1900
|
-
var achievementSlice$1 = achievementSlice.reducer;
|
|
1901
|
-
|
|
1902
|
-
const initialState = {
|
|
1903
|
-
notifications: [],
|
|
1904
|
-
};
|
|
1905
|
-
const notificationSlice = createSlice({
|
|
1906
|
-
name: 'notifications',
|
|
1907
|
-
initialState,
|
|
1908
|
-
reducers: {
|
|
1909
|
-
addNotification: (state, action) => {
|
|
1910
|
-
state.notifications.push(action.payload);
|
|
1911
|
-
},
|
|
1912
|
-
clearNotifications: (state) => {
|
|
1913
|
-
state.notifications = [];
|
|
1914
|
-
},
|
|
1915
|
-
},
|
|
1916
|
-
});
|
|
1917
|
-
const { addNotification, clearNotifications } = notificationSlice.actions;
|
|
1918
|
-
var notificationSlice$1 = notificationSlice.reducer;
|
|
1919
|
-
|
|
1920
|
-
function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f);}else for(f in e)e[f]&&(n&&(n+=" "),n+=f);return n}function clsx(){for(var e,t,f=0,n="",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}
|
|
1921
|
-
|
|
1922
|
-
function Mt(t){if(typeof document=="undefined")return;let o=document.head||document.getElementsByTagName("head")[0],e=document.createElement("style");e.type="text/css",o.firstChild?o.insertBefore(e,o.firstChild):o.appendChild(e),e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t));}Mt(`:root{--toastify-color-light: #fff;--toastify-color-dark: #121212;--toastify-color-info: #3498db;--toastify-color-success: #07bc0c;--toastify-color-warning: #f1c40f;--toastify-color-error: hsl(6, 78%, 57%);--toastify-color-transparent: rgba(255, 255, 255, .7);--toastify-icon-color-info: var(--toastify-color-info);--toastify-icon-color-success: var(--toastify-color-success);--toastify-icon-color-warning: var(--toastify-color-warning);--toastify-icon-color-error: var(--toastify-color-error);--toastify-container-width: fit-content;--toastify-toast-width: 320px;--toastify-toast-offset: 16px;--toastify-toast-top: max(var(--toastify-toast-offset), env(safe-area-inset-top));--toastify-toast-right: max(var(--toastify-toast-offset), env(safe-area-inset-right));--toastify-toast-left: max(var(--toastify-toast-offset), env(safe-area-inset-left));--toastify-toast-bottom: max(var(--toastify-toast-offset), env(safe-area-inset-bottom));--toastify-toast-background: #fff;--toastify-toast-padding: 14px;--toastify-toast-min-height: 64px;--toastify-toast-max-height: 800px;--toastify-toast-bd-radius: 6px;--toastify-toast-shadow: 0px 4px 12px rgba(0, 0, 0, .1);--toastify-font-family: sans-serif;--toastify-z-index: 9999;--toastify-text-color-light: #757575;--toastify-text-color-dark: #fff;--toastify-text-color-info: #fff;--toastify-text-color-success: #fff;--toastify-text-color-warning: #fff;--toastify-text-color-error: #fff;--toastify-spinner-color: #616161;--toastify-spinner-color-empty-area: #e0e0e0;--toastify-color-progress-light: linear-gradient(to right, #4cd964, #5ac8fa, #007aff, #34aadc, #5856d6, #ff2d55);--toastify-color-progress-dark: #bb86fc;--toastify-color-progress-info: var(--toastify-color-info);--toastify-color-progress-success: var(--toastify-color-success);--toastify-color-progress-warning: var(--toastify-color-warning);--toastify-color-progress-error: var(--toastify-color-error);--toastify-color-progress-bgo: .2}.Toastify__toast-container{z-index:var(--toastify-z-index);-webkit-transform:translate3d(0,0,var(--toastify-z-index));position:fixed;width:var(--toastify-container-width);box-sizing:border-box;color:#fff;display:flex;flex-direction:column}.Toastify__toast-container--top-left{top:var(--toastify-toast-top);left:var(--toastify-toast-left)}.Toastify__toast-container--top-center{top:var(--toastify-toast-top);left:50%;transform:translate(-50%);align-items:center}.Toastify__toast-container--top-right{top:var(--toastify-toast-top);right:var(--toastify-toast-right);align-items:end}.Toastify__toast-container--bottom-left{bottom:var(--toastify-toast-bottom);left:var(--toastify-toast-left)}.Toastify__toast-container--bottom-center{bottom:var(--toastify-toast-bottom);left:50%;transform:translate(-50%);align-items:center}.Toastify__toast-container--bottom-right{bottom:var(--toastify-toast-bottom);right:var(--toastify-toast-right);align-items:end}.Toastify__toast{--y: 0;position:relative;touch-action:none;width:var(--toastify-toast-width);min-height:var(--toastify-toast-min-height);box-sizing:border-box;margin-bottom:1rem;padding:var(--toastify-toast-padding);border-radius:var(--toastify-toast-bd-radius);box-shadow:var(--toastify-toast-shadow);max-height:var(--toastify-toast-max-height);font-family:var(--toastify-font-family);z-index:0;display:flex;flex:1 auto;align-items:center;word-break:break-word}@media only screen and (max-width: 480px){.Toastify__toast-container{width:100vw;left:env(safe-area-inset-left);margin:0}.Toastify__toast-container--top-left,.Toastify__toast-container--top-center,.Toastify__toast-container--top-right{top:env(safe-area-inset-top);transform:translate(0)}.Toastify__toast-container--bottom-left,.Toastify__toast-container--bottom-center,.Toastify__toast-container--bottom-right{bottom:env(safe-area-inset-bottom);transform:translate(0)}.Toastify__toast-container--rtl{right:env(safe-area-inset-right);left:initial}.Toastify__toast{--toastify-toast-width: 100%;margin-bottom:0;border-radius:0}}.Toastify__toast-container[data-stacked=true]{width:var(--toastify-toast-width)}.Toastify__toast--stacked{position:absolute;width:100%;transform:translate3d(0,var(--y),0) scale(var(--s));transition:transform .3s}.Toastify__toast--stacked[data-collapsed] .Toastify__toast-body,.Toastify__toast--stacked[data-collapsed] .Toastify__close-button{transition:opacity .1s}.Toastify__toast--stacked[data-collapsed=false]{overflow:visible}.Toastify__toast--stacked[data-collapsed=true]:not(:last-child)>*{opacity:0}.Toastify__toast--stacked:after{content:"";position:absolute;left:0;right:0;height:calc(var(--g) * 1px);bottom:100%}.Toastify__toast--stacked[data-pos=top]{top:0}.Toastify__toast--stacked[data-pos=bot]{bottom:0}.Toastify__toast--stacked[data-pos=bot].Toastify__toast--stacked:before{transform-origin:top}.Toastify__toast--stacked[data-pos=top].Toastify__toast--stacked:before{transform-origin:bottom}.Toastify__toast--stacked:before{content:"";position:absolute;left:0;right:0;bottom:0;height:100%;transform:scaleY(3);z-index:-1}.Toastify__toast--rtl{direction:rtl}.Toastify__toast--close-on-click{cursor:pointer}.Toastify__toast-icon{margin-inline-end:10px;width:22px;flex-shrink:0;display:flex}.Toastify--animate{animation-fill-mode:both;animation-duration:.5s}.Toastify--animate-icon{animation-fill-mode:both;animation-duration:.3s}.Toastify__toast-theme--dark{background:var(--toastify-color-dark);color:var(--toastify-text-color-dark)}.Toastify__toast-theme--light,.Toastify__toast-theme--colored.Toastify__toast--default{background:var(--toastify-color-light);color:var(--toastify-text-color-light)}.Toastify__toast-theme--colored.Toastify__toast--info{color:var(--toastify-text-color-info);background:var(--toastify-color-info)}.Toastify__toast-theme--colored.Toastify__toast--success{color:var(--toastify-text-color-success);background:var(--toastify-color-success)}.Toastify__toast-theme--colored.Toastify__toast--warning{color:var(--toastify-text-color-warning);background:var(--toastify-color-warning)}.Toastify__toast-theme--colored.Toastify__toast--error{color:var(--toastify-text-color-error);background:var(--toastify-color-error)}.Toastify__progress-bar-theme--light{background:var(--toastify-color-progress-light)}.Toastify__progress-bar-theme--dark{background:var(--toastify-color-progress-dark)}.Toastify__progress-bar--info{background:var(--toastify-color-progress-info)}.Toastify__progress-bar--success{background:var(--toastify-color-progress-success)}.Toastify__progress-bar--warning{background:var(--toastify-color-progress-warning)}.Toastify__progress-bar--error{background:var(--toastify-color-progress-error)}.Toastify__progress-bar-theme--colored.Toastify__progress-bar--info,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--success,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--warning,.Toastify__progress-bar-theme--colored.Toastify__progress-bar--error{background:var(--toastify-color-transparent)}.Toastify__close-button{color:#fff;position:absolute;top:6px;right:6px;background:transparent;outline:none;border:none;padding:0;cursor:pointer;opacity:.7;transition:.3s ease;z-index:1}.Toastify__toast--rtl .Toastify__close-button{left:6px;right:unset}.Toastify__close-button--light{color:#000;opacity:.3}.Toastify__close-button>svg{fill:currentColor;height:16px;width:14px}.Toastify__close-button:hover,.Toastify__close-button:focus{opacity:1}@keyframes Toastify__trackProgress{0%{transform:scaleX(1)}to{transform:scaleX(0)}}.Toastify__progress-bar{position:absolute;bottom:0;left:0;width:100%;height:100%;z-index:1;opacity:.7;transform-origin:left}.Toastify__progress-bar--animated{animation:Toastify__trackProgress linear 1 forwards}.Toastify__progress-bar--controlled{transition:transform .2s}.Toastify__progress-bar--rtl{right:0;left:initial;transform-origin:right;border-bottom-left-radius:initial}.Toastify__progress-bar--wrp{position:absolute;overflow:hidden;bottom:0;left:0;width:100%;height:5px;border-bottom-left-radius:var(--toastify-toast-bd-radius);border-bottom-right-radius:var(--toastify-toast-bd-radius)}.Toastify__progress-bar--wrp[data-hidden=true]{opacity:0}.Toastify__progress-bar--bg{opacity:var(--toastify-color-progress-bgo);width:100%;height:100%}.Toastify__spinner{width:20px;height:20px;box-sizing:border-box;border:2px solid;border-radius:100%;border-color:var(--toastify-spinner-color-empty-area);border-right-color:var(--toastify-spinner-color);animation:Toastify__spin .65s linear infinite}@keyframes Toastify__bounceInRight{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(3000px,0,0)}60%{opacity:1;transform:translate3d(-25px,0,0)}75%{transform:translate3d(10px,0,0)}90%{transform:translate3d(-5px,0,0)}to{transform:none}}@keyframes Toastify__bounceOutRight{20%{opacity:1;transform:translate3d(-20px,var(--y),0)}to{opacity:0;transform:translate3d(2000px,var(--y),0)}}@keyframes Toastify__bounceInLeft{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(-3000px,0,0)}60%{opacity:1;transform:translate3d(25px,0,0)}75%{transform:translate3d(-10px,0,0)}90%{transform:translate3d(5px,0,0)}to{transform:none}}@keyframes Toastify__bounceOutLeft{20%{opacity:1;transform:translate3d(20px,var(--y),0)}to{opacity:0;transform:translate3d(-2000px,var(--y),0)}}@keyframes Toastify__bounceInUp{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(0,3000px,0)}60%{opacity:1;transform:translate3d(0,-20px,0)}75%{transform:translate3d(0,10px,0)}90%{transform:translate3d(0,-5px,0)}to{transform:translateZ(0)}}@keyframes Toastify__bounceOutUp{20%{transform:translate3d(0,calc(var(--y) - 10px),0)}40%,45%{opacity:1;transform:translate3d(0,calc(var(--y) + 20px),0)}to{opacity:0;transform:translate3d(0,-2000px,0)}}@keyframes Toastify__bounceInDown{0%,60%,75%,90%,to{animation-timing-function:cubic-bezier(.215,.61,.355,1)}0%{opacity:0;transform:translate3d(0,-3000px,0)}60%{opacity:1;transform:translate3d(0,25px,0)}75%{transform:translate3d(0,-10px,0)}90%{transform:translate3d(0,5px,0)}to{transform:none}}@keyframes Toastify__bounceOutDown{20%{transform:translate3d(0,calc(var(--y) - 10px),0)}40%,45%{opacity:1;transform:translate3d(0,calc(var(--y) + 20px),0)}to{opacity:0;transform:translate3d(0,2000px,0)}}.Toastify__bounce-enter--top-left,.Toastify__bounce-enter--bottom-left{animation-name:Toastify__bounceInLeft}.Toastify__bounce-enter--top-right,.Toastify__bounce-enter--bottom-right{animation-name:Toastify__bounceInRight}.Toastify__bounce-enter--top-center{animation-name:Toastify__bounceInDown}.Toastify__bounce-enter--bottom-center{animation-name:Toastify__bounceInUp}.Toastify__bounce-exit--top-left,.Toastify__bounce-exit--bottom-left{animation-name:Toastify__bounceOutLeft}.Toastify__bounce-exit--top-right,.Toastify__bounce-exit--bottom-right{animation-name:Toastify__bounceOutRight}.Toastify__bounce-exit--top-center{animation-name:Toastify__bounceOutUp}.Toastify__bounce-exit--bottom-center{animation-name:Toastify__bounceOutDown}@keyframes Toastify__zoomIn{0%{opacity:0;transform:scale3d(.3,.3,.3)}50%{opacity:1}}@keyframes Toastify__zoomOut{0%{opacity:1}50%{opacity:0;transform:translate3d(0,var(--y),0) scale3d(.3,.3,.3)}to{opacity:0}}.Toastify__zoom-enter{animation-name:Toastify__zoomIn}.Toastify__zoom-exit{animation-name:Toastify__zoomOut}@keyframes Toastify__flipIn{0%{transform:perspective(400px) rotateX(90deg);animation-timing-function:ease-in;opacity:0}40%{transform:perspective(400px) rotateX(-20deg);animation-timing-function:ease-in}60%{transform:perspective(400px) rotateX(10deg);opacity:1}80%{transform:perspective(400px) rotateX(-5deg)}to{transform:perspective(400px)}}@keyframes Toastify__flipOut{0%{transform:translate3d(0,var(--y),0) perspective(400px)}30%{transform:translate3d(0,var(--y),0) perspective(400px) rotateX(-20deg);opacity:1}to{transform:translate3d(0,var(--y),0) perspective(400px) rotateX(90deg);opacity:0}}.Toastify__flip-enter{animation-name:Toastify__flipIn}.Toastify__flip-exit{animation-name:Toastify__flipOut}@keyframes Toastify__slideInRight{0%{transform:translate3d(110%,0,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInLeft{0%{transform:translate3d(-110%,0,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInUp{0%{transform:translate3d(0,110%,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideInDown{0%{transform:translate3d(0,-110%,0);visibility:visible}to{transform:translate3d(0,var(--y),0)}}@keyframes Toastify__slideOutRight{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(110%,var(--y),0)}}@keyframes Toastify__slideOutLeft{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(-110%,var(--y),0)}}@keyframes Toastify__slideOutDown{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(0,500px,0)}}@keyframes Toastify__slideOutUp{0%{transform:translate3d(0,var(--y),0)}to{visibility:hidden;transform:translate3d(0,-500px,0)}}.Toastify__slide-enter--top-left,.Toastify__slide-enter--bottom-left{animation-name:Toastify__slideInLeft}.Toastify__slide-enter--top-right,.Toastify__slide-enter--bottom-right{animation-name:Toastify__slideInRight}.Toastify__slide-enter--top-center{animation-name:Toastify__slideInDown}.Toastify__slide-enter--bottom-center{animation-name:Toastify__slideInUp}.Toastify__slide-exit--top-left,.Toastify__slide-exit--bottom-left{animation-name:Toastify__slideOutLeft;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--top-right,.Toastify__slide-exit--bottom-right{animation-name:Toastify__slideOutRight;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--top-center{animation-name:Toastify__slideOutUp;animation-timing-function:ease-in;animation-duration:.3s}.Toastify__slide-exit--bottom-center{animation-name:Toastify__slideOutDown;animation-timing-function:ease-in;animation-duration:.3s}@keyframes Toastify__spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}
|
|
1923
|
-
`);var L=t=>typeof t=="number"&&!isNaN(t),N=t=>typeof t=="string",P=t=>typeof t=="function",mt=t=>N(t)||L(t),B=t=>N(t)||P(t)?t:null,pt=(t,o)=>t===false||L(t)&&t>0?t:o,z=t=>React.isValidElement(t)||N(t)||P(t)||L(t);function Z(t,o,e=300){let{scrollHeight:r,style:s}=t;requestAnimationFrame(()=>{s.minHeight="initial",s.height=r+"px",s.transition=`all ${e}ms`,requestAnimationFrame(()=>{s.height="0",s.padding="0",s.margin="0",setTimeout(o,e);});});}function $({enter:t,exit:o,appendPosition:e=false,collapse:r=true,collapseDuration:s=300}){return function({children:a,position:d,preventExitTransition:c,done:T,nodeRef:g,isIn:v,playToast:x}){let C=e?`${t}--${d}`:t,S=e?`${o}--${d}`:o,E=React.useRef(0);return React.useLayoutEffect(()=>{let f=g.current,p=C.split(" "),b=n=>{n.target===g.current&&(x(),f.removeEventListener("animationend",b),f.removeEventListener("animationcancel",b),E.current===0&&n.type!=="animationcancel"&&f.classList.remove(...p));};(()=>{f.classList.add(...p),f.addEventListener("animationend",b),f.addEventListener("animationcancel",b);})();},[]),React.useEffect(()=>{let f=g.current,p=()=>{f.removeEventListener("animationend",p),r?Z(f,T,s):T();};v||(c?p():(()=>{E.current=1,f.className+=` ${S}`,f.addEventListener("animationend",p);})());},[v]),React.createElement(React.Fragment,null,a)}}function J(t,o){return {content:tt(t.content,t.props),containerId:t.props.containerId,id:t.props.toastId,theme:t.props.theme,type:t.props.type,data:t.props.data||{},isLoading:t.props.isLoading,icon:t.props.icon,reason:t.removalReason,status:o}}function tt(t,o,e=false){return React.isValidElement(t)&&!N(t.type)?React.cloneElement(t,{closeToast:o.closeToast,toastProps:o,data:o.data,isPaused:e}):P(t)?t({closeToast:o.closeToast,toastProps:o,data:o.data,isPaused:e}):t}function yt({closeToast:t,theme:o,ariaLabel:e="close"}){return React.createElement("button",{className:`Toastify__close-button Toastify__close-button--${o}`,type:"button",onClick:r=>{r.stopPropagation(),t(true);},"aria-label":e},React.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},React.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))}function gt({delay:t,isRunning:o,closeToast:e,type:r="default",hide:s,className:l,controlledProgress:a,progress:d,rtl:c,isIn:T,theme:g}){let v=s||a&&d===0,x={animationDuration:`${t}ms`,animationPlayState:o?"running":"paused"};a&&(x.transform=`scaleX(${d})`);let C=clsx("Toastify__progress-bar",a?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${g}`,`Toastify__progress-bar--${r}`,{["Toastify__progress-bar--rtl"]:c}),S=P(l)?l({rtl:c,type:r,defaultClassName:C}):clsx(C,l),E={[a&&d>=1?"onTransitionEnd":"onAnimationEnd"]:a&&d<1?null:()=>{T&&e();}};return React.createElement("div",{className:"Toastify__progress-bar--wrp","data-hidden":v},React.createElement("div",{className:`Toastify__progress-bar--bg Toastify__progress-bar-theme--${g} Toastify__progress-bar--${r}`}),React.createElement("div",{role:"progressbar","aria-hidden":v?"true":"false","aria-label":"notification timer",className:S,style:x,...E}))}var Xt=1,at=()=>`${Xt++}`;function _t(t,o,e){let r=1,s=0,l=[],a=[],d=o,c=new Map,T=new Set,g=i=>(T.add(i),()=>T.delete(i)),v=()=>{a=Array.from(c.values()),T.forEach(i=>i());},x=({containerId:i,toastId:n,updateId:u})=>{let h=i?i!==t:t!==1,m=c.has(n)&&u==null;return h||m},C=(i,n)=>{c.forEach(u=>{var h;(n==null||n===u.props.toastId)&&((h=u.toggle)==null||h.call(u,i));});},S=i=>{var n,u;(u=(n=i.props)==null?void 0:n.onClose)==null||u.call(n,i.removalReason),i.isActive=false;},E=i=>{if(i==null)c.forEach(S);else {let n=c.get(i);n&&S(n);}v();},f=()=>{s-=l.length,l=[];},p=i=>{var m,_;let{toastId:n,updateId:u}=i.props,h=u==null;i.staleId&&c.delete(i.staleId),i.isActive=true,c.set(n,i),v(),e(J(i,h?"added":"updated")),h&&((_=(m=i.props).onOpen)==null||_.call(m));};return {id:t,props:d,observe:g,toggle:C,removeToast:E,toasts:c,clearQueue:f,buildToast:(i,n)=>{if(x(n))return;let{toastId:u,updateId:h,data:m,staleId:_,delay:k}=n,M=h==null;M&&s++;let A={...d,style:d.toastStyle,key:r++,...Object.fromEntries(Object.entries(n).filter(([D,Y])=>Y!=null)),toastId:u,updateId:h,data:m,isIn:false,className:B(n.className||d.toastClassName),progressClassName:B(n.progressClassName||d.progressClassName),autoClose:n.isLoading?false:pt(n.autoClose,d.autoClose),closeToast(D){c.get(u).removalReason=D,E(u);},deleteToast(){let D=c.get(u);if(D!=null){if(e(J(D,"removed")),c.delete(u),s--,s<0&&(s=0),l.length>0){p(l.shift());return}v();}}};A.closeButton=d.closeButton,n.closeButton===false||z(n.closeButton)?A.closeButton=n.closeButton:n.closeButton===true&&(A.closeButton=z(d.closeButton)?d.closeButton:true);let R={content:i,props:A,staleId:_};d.limit&&d.limit>0&&s>d.limit&&M?l.push(R):L(k)?setTimeout(()=>{p(R);},k):p(R);},setProps(i){d=i;},setToggle:(i,n)=>{let u=c.get(i);u&&(u.toggle=n);},isToastActive:i=>{var n;return (n=c.get(i))==null?void 0:n.isActive},getSnapshot:()=>a}}var I=new Map,F=[],st=new Set,Vt=t=>st.forEach(o=>o(t)),bt=()=>I.size>0;function Qt(){F.forEach(t=>nt(t.content,t.options)),F=[];}var vt=(t,{containerId:o})=>{var e;return (e=I.get(o||1))==null?void 0:e.toasts.get(t)};function X(t,o){var r;if(o)return !!((r=I.get(o))!=null&&r.isToastActive(t));let e=false;return I.forEach(s=>{s.isToastActive(t)&&(e=true);}),e}function ht(t){if(!bt()){F=F.filter(o=>t!=null&&o.options.toastId!==t);return}if(t==null||mt(t))I.forEach(o=>{o.removeToast(t);});else if(t&&("containerId"in t||"id"in t)){let o=I.get(t.containerId);o?o.removeToast(t.id):I.forEach(e=>{e.removeToast(t.id);});}}var Ct=(t={})=>{I.forEach(o=>{o.props.limit&&(!t.containerId||o.id===t.containerId)&&o.clearQueue();});};function nt(t,o){z(t)&&(bt()||F.push({content:t,options:o}),I.forEach(e=>{e.buildToast(t,o);}));}function xt(t){var o;(o=I.get(t.containerId||1))==null||o.setToggle(t.id,t.fn);}function rt(t,o){I.forEach(e=>{(o==null||!(o!=null&&o.containerId)||(o==null?void 0:o.containerId)===e.id)&&e.toggle(t,o==null?void 0:o.id);});}function Et(t){let o=t.containerId||1;return {subscribe(e){let r=_t(o,t,Vt);I.set(o,r);let s=r.observe(e);return Qt(),()=>{s(),I.delete(o);}},setProps(e){var r;(r=I.get(o))==null||r.setProps(e);},getSnapshot(){var e;return (e=I.get(o))==null?void 0:e.getSnapshot()}}}function Pt(t){return st.add(t),()=>{st.delete(t);}}function Wt(t){return t&&(N(t.toastId)||L(t.toastId))?t.toastId:at()}function U(t,o){return nt(t,o),o.toastId}function V(t,o){return {...o,type:o&&o.type||t,toastId:Wt(o)}}function Q(t){return (o,e)=>U(o,V(t,e))}function y(t,o){return U(t,V("default",o))}y.loading=(t,o)=>U(t,V("default",{isLoading:true,autoClose:false,closeOnClick:false,closeButton:false,draggable:false,...o}));function Gt(t,{pending:o,error:e,success:r},s){let l;o&&(l=N(o)?y.loading(o,s):y.loading(o.render,{...s,...o}));let a={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},d=(T,g,v)=>{if(g==null){y.dismiss(l);return}let x={type:T,...a,...s,data:v},C=N(g)?{render:g}:g;return l?y.update(l,{...x,...C}):y(C.render,{...x,...C}),v},c=P(t)?t():t;return c.then(T=>d("success",r,T)).catch(T=>d("error",e,T)),c}y.promise=Gt;y.success=Q("success");y.info=Q("info");y.error=Q("error");y.warning=Q("warning");y.warn=y.warning;y.dark=(t,o)=>U(t,V("default",{theme:"dark",...o}));function qt(t){ht(t);}y.dismiss=qt;y.clearWaitingQueue=Ct;y.isActive=X;y.update=(t,o={})=>{let e=vt(t,o);if(e){let{props:r,content:s}=e,l={delay:100,...r,...o,toastId:o.toastId||t,updateId:at()};l.toastId!==t&&(l.staleId=t);let a=l.render||s;delete l.render,U(a,l);}};y.done=t=>{y.update(t,{progress:1});};y.onChange=Pt;y.play=t=>rt(true,t);y.pause=t=>rt(false,t);function It(t){var a;let{subscribe:o,getSnapshot:e,setProps:r}=React.useRef(Et(t)).current;r(t);let s=(a=React.useSyncExternalStore(o,e,e))==null?void 0:a.slice();function l(d){if(!s)return [];let c=new Map;return t.newestOnTop&&s.reverse(),s.forEach(T=>{let{position:g}=T.props;c.has(g)||c.set(g,[]),c.get(g).push(T);}),Array.from(c,T=>d(T[0],T[1]))}return {getToastToRender:l,isToastActive:X,count:s==null?void 0:s.length}}function At(t){let[o,e]=React.useState(false),[r,s]=React.useState(false),l=React.useRef(null),a=React.useRef({start:0,delta:0,removalDistance:0,canCloseOnClick:true,canDrag:false,didMove:false}).current,{autoClose:d,pauseOnHover:c,closeToast:T,onClick:g,closeOnClick:v}=t;xt({id:t.toastId,containerId:t.containerId,fn:e}),React.useEffect(()=>{if(t.pauseOnFocusLoss)return x(),()=>{C();}},[t.pauseOnFocusLoss]);function x(){document.hasFocus()||p(),window.addEventListener("focus",f),window.addEventListener("blur",p);}function C(){window.removeEventListener("focus",f),window.removeEventListener("blur",p);}function S(m){if(t.draggable===true||t.draggable===m.pointerType){b();let _=l.current;a.canCloseOnClick=true,a.canDrag=true,_.style.transition="none",t.draggableDirection==="x"?(a.start=m.clientX,a.removalDistance=_.offsetWidth*(t.draggablePercent/100)):(a.start=m.clientY,a.removalDistance=_.offsetHeight*(t.draggablePercent===80?t.draggablePercent*1.5:t.draggablePercent)/100);}}function E(m){let{top:_,bottom:k,left:M,right:A}=l.current.getBoundingClientRect();m.nativeEvent.type!=="touchend"&&t.pauseOnHover&&m.clientX>=M&&m.clientX<=A&&m.clientY>=_&&m.clientY<=k?p():f();}function f(){e(true);}function p(){e(false);}function b(){a.didMove=false,document.addEventListener("pointermove",n),document.addEventListener("pointerup",u);}function i(){document.removeEventListener("pointermove",n),document.removeEventListener("pointerup",u);}function n(m){let _=l.current;if(a.canDrag&&_){a.didMove=true,o&&p(),t.draggableDirection==="x"?a.delta=m.clientX-a.start:a.delta=m.clientY-a.start,a.start!==m.clientX&&(a.canCloseOnClick=false);let k=t.draggableDirection==="x"?`${a.delta}px, var(--y)`:`0, calc(${a.delta}px + var(--y))`;_.style.transform=`translate3d(${k},0)`,_.style.opacity=`${1-Math.abs(a.delta/a.removalDistance)}`;}}function u(){i();let m=l.current;if(a.canDrag&&a.didMove&&m){if(a.canDrag=false,Math.abs(a.delta)>a.removalDistance){s(true),t.closeToast(true),t.collapseAll();return}m.style.transition="transform 0.2s, opacity 0.2s",m.style.removeProperty("transform"),m.style.removeProperty("opacity");}}let h={onPointerDown:S,onPointerUp:E};return d&&c&&(h.onMouseEnter=p,t.stacked||(h.onMouseLeave=f)),v&&(h.onClick=m=>{g&&g(m),a.canCloseOnClick&&T(true);}),{playToast:f,pauseToast:p,isRunning:o,preventExitTransition:r,toastRef:l,eventHandlers:h}}var Ot=typeof window!="undefined"?React.useLayoutEffect:React.useEffect;var G=({theme:t,type:o,isLoading:e,...r})=>React.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:t==="colored"?"currentColor":`var(--toastify-icon-color-${o})`,...r});function ao(t){return React.createElement(G,{...t},React.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))}function so(t){return React.createElement(G,{...t},React.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))}function no(t){return React.createElement(G,{...t},React.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))}function ro(t){return React.createElement(G,{...t},React.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))}function io(){return React.createElement("div",{className:"Toastify__spinner"})}var W={info:so,warning:ao,success:no,error:ro,spinner:io},lo=t=>t in W;function Nt({theme:t,type:o,isLoading:e,icon:r}){let s=null,l={theme:t,type:o};return r===false||(P(r)?s=r({...l,isLoading:e}):React.isValidElement(r)?s=React.cloneElement(r,l):e?s=W.spinner():lo(o)&&(s=W[o](l))),s}var wt=t=>{let{isRunning:o,preventExitTransition:e,toastRef:r,eventHandlers:s,playToast:l}=At(t),{closeButton:a,children:d,autoClose:c,onClick:T,type:g,hideProgressBar:v,closeToast:x,transition:C,position:S,className:E,style:f,progressClassName:p,updateId:b,role:i,progress:n,rtl:u,toastId:h,deleteToast:m,isIn:_,isLoading:k,closeOnClick:M,theme:A,ariaLabel:R}=t,D=clsx("Toastify__toast",`Toastify__toast-theme--${A}`,`Toastify__toast--${g}`,{["Toastify__toast--rtl"]:u},{["Toastify__toast--close-on-click"]:M}),Y=P(E)?E({rtl:u,position:S,type:g,defaultClassName:D}):clsx(D,E),ft=Nt(t),dt=!!n||!c,j={closeToast:x,type:g,theme:A},H=null;return a===false||(P(a)?H=a(j):React.isValidElement(a)?H=React.cloneElement(a,j):H=yt(j)),React.createElement(C,{isIn:_,done:m,position:S,preventExitTransition:e,nodeRef:r,playToast:l},React.createElement("div",{id:h,tabIndex:0,onClick:T,"data-in":_,className:Y,...s,style:f,ref:r,..._&&{role:i,"aria-label":R}},ft!=null&&React.createElement("div",{className:clsx("Toastify__toast-icon",{["Toastify--animate-icon Toastify__zoom-enter"]:!k})},ft),tt(d,t,!o),H,!t.customProgressBar&&React.createElement(gt,{...b&&!dt?{key:`p-${b}`}:{},rtl:u,theme:A,delay:c,isRunning:o,isIn:_,closeToast:x,hide:v,type:g,className:p,controlledProgress:dt,progress:n||0})))};var K=(t,o=false)=>({enter:`Toastify--animate Toastify__${t}-enter`,exit:`Toastify--animate Toastify__${t}-exit`,appendPosition:o}),lt=$(K("bounce",true));var _o={position:"top-right",transition:lt,autoClose:5e3,closeButton:true,pauseOnHover:true,pauseOnFocusLoss:true,draggable:"touch",draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light","aria-label":"Notifications Alt+T",hotKeys:t=>t.altKey&&t.code==="KeyT"};function Lt(t){let o={..._o,...t},e=t.stacked,[r,s]=React.useState(true),l=React.useRef(null),{getToastToRender:a,isToastActive:d,count:c}=It(o),{className:T,style:g,rtl:v,containerId:x,hotKeys:C}=o;function S(f){let p=clsx("Toastify__toast-container",`Toastify__toast-container--${f}`,{["Toastify__toast-container--rtl"]:v});return P(T)?T({position:f,rtl:v,defaultClassName:p}):clsx(p,B(T))}function E(){e&&(s(true),y.play());}return Ot(()=>{var f;if(e){let p=l.current.querySelectorAll('[data-in="true"]'),b=12,i=(f=o.position)==null?void 0:f.includes("top"),n=0,u=0;Array.from(p).reverse().forEach((h,m)=>{let _=h;_.classList.add("Toastify__toast--stacked"),m>0&&(_.dataset.collapsed=`${r}`),_.dataset.pos||(_.dataset.pos=i?"top":"bot");let k=n*(r?.2:1)+(r?0:b*m);_.style.setProperty("--y",`${i?k:k*-1}px`),_.style.setProperty("--g",`${b}`),_.style.setProperty("--s",`${1-(r?u:0)}`),n+=_.offsetHeight,u+=.025;});}},[r,c,e]),React.useEffect(()=>{function f(p){var i;let b=l.current;C(p)&&((i=b.querySelector('[tabIndex="0"]'))==null||i.focus(),s(false),y.pause()),p.key==="Escape"&&(document.activeElement===b||b!=null&&b.contains(document.activeElement))&&(s(true),y.play());}return document.addEventListener("keydown",f),()=>{document.removeEventListener("keydown",f);}},[C]),React.createElement("section",{ref:l,className:"Toastify",id:x,onMouseEnter:()=>{e&&(s(false),y.pause());},onMouseLeave:E,"aria-live":"polite","aria-atomic":"false","aria-relevant":"additions text","aria-label":o["aria-label"]},a((f,p)=>{let b=p.length?{...g}:{...g,pointerEvents:"none"};return React.createElement("div",{tabIndex:-1,className:S(f),"data-stacked":e,style:b,key:`c-${f}`},p.map(({content:i,props:n})=>React.createElement(wt,{...n,stacked:e,collapseAll:E,isIn:d(n.toastId,n.containerId),key:`t-${n.key}`},i)))}))}
|
|
1924
|
-
|
|
1925
|
-
function styleInject(css, ref) {
|
|
1926
|
-
if ( ref === void 0 ) ref = {};
|
|
1927
|
-
var insertAt = ref.insertAt;
|
|
1928
|
-
|
|
1929
|
-
if (typeof document === 'undefined') { return; }
|
|
1930
|
-
|
|
1931
|
-
var head = document.head || document.getElementsByTagName('head')[0];
|
|
1932
|
-
var style = document.createElement('style');
|
|
1933
|
-
style.type = 'text/css';
|
|
1934
|
-
|
|
1935
|
-
if (insertAt === 'top') {
|
|
1936
|
-
if (head.firstChild) {
|
|
1937
|
-
head.insertBefore(style, head.firstChild);
|
|
1938
|
-
} else {
|
|
1939
|
-
head.appendChild(style);
|
|
1940
|
-
}
|
|
1941
|
-
} else {
|
|
1942
|
-
head.appendChild(style);
|
|
1943
|
-
}
|
|
1944
|
-
|
|
1945
|
-
if (style.styleSheet) {
|
|
1946
|
-
style.styleSheet.cssText = css;
|
|
1947
|
-
} else {
|
|
1948
|
-
style.appendChild(document.createTextNode(css));
|
|
1949
|
-
}
|
|
1950
|
-
}
|
|
1951
|
-
|
|
1952
|
-
var css_248z = ":root {\n --toastify-color-light: #fff;\n --toastify-color-dark: #121212;\n --toastify-color-info: #3498db;\n --toastify-color-success: #07bc0c;\n --toastify-color-warning: #f1c40f;\n --toastify-color-error: hsl(6, 78%, 57%);\n --toastify-color-transparent: rgba(255, 255, 255, 0.7);\n\n --toastify-icon-color-info: var(--toastify-color-info);\n --toastify-icon-color-success: var(--toastify-color-success);\n --toastify-icon-color-warning: var(--toastify-color-warning);\n --toastify-icon-color-error: var(--toastify-color-error);\n\n --toastify-container-width: fit-content;\n --toastify-toast-width: 320px;\n --toastify-toast-offset: 16px;\n --toastify-toast-top: max(var(--toastify-toast-offset), env(safe-area-inset-top));\n --toastify-toast-right: max(var(--toastify-toast-offset), env(safe-area-inset-right));\n --toastify-toast-left: max(var(--toastify-toast-offset), env(safe-area-inset-left));\n --toastify-toast-bottom: max(var(--toastify-toast-offset), env(safe-area-inset-bottom));\n --toastify-toast-background: #fff;\n --toastify-toast-padding: 14px;\n --toastify-toast-min-height: 64px;\n --toastify-toast-max-height: 800px;\n --toastify-toast-bd-radius: 6px;\n --toastify-toast-shadow: 0px 4px 12px rgba(0, 0, 0, 0.1);\n --toastify-font-family: sans-serif;\n --toastify-z-index: 9999;\n --toastify-text-color-light: #757575;\n --toastify-text-color-dark: #fff;\n\n /* Used only for colored theme */\n --toastify-text-color-info: #fff;\n --toastify-text-color-success: #fff;\n --toastify-text-color-warning: #fff;\n --toastify-text-color-error: #fff;\n\n --toastify-spinner-color: #616161;\n --toastify-spinner-color-empty-area: #e0e0e0;\n --toastify-color-progress-light: linear-gradient(to right, #4cd964, #5ac8fa, #007aff, #34aadc, #5856d6, #ff2d55);\n --toastify-color-progress-dark: #bb86fc;\n --toastify-color-progress-info: var(--toastify-color-info);\n --toastify-color-progress-success: var(--toastify-color-success);\n --toastify-color-progress-warning: var(--toastify-color-warning);\n --toastify-color-progress-error: var(--toastify-color-error);\n /* used to control the opacity of the progress trail */\n --toastify-color-progress-bgo: 0.2;\n}\n\n.Toastify__toast-container {\n z-index: var(--toastify-z-index);\n -webkit-transform: translate3d(0, 0, var(--toastify-z-index));\n position: fixed;\n width: var(--toastify-container-width);\n box-sizing: border-box;\n color: #fff;\n display: flex;\n flex-direction: column;\n}\n\n.Toastify__toast-container--top-left {\n top: var(--toastify-toast-top);\n left: var(--toastify-toast-left);\n}\n.Toastify__toast-container--top-center {\n top: var(--toastify-toast-top);\n left: 50%;\n transform: translateX(-50%);\n align-items: center;\n}\n.Toastify__toast-container--top-right {\n top: var(--toastify-toast-top);\n right: var(--toastify-toast-right);\n align-items: end;\n}\n.Toastify__toast-container--bottom-left {\n bottom: var(--toastify-toast-bottom);\n left: var(--toastify-toast-left);\n}\n.Toastify__toast-container--bottom-center {\n bottom: var(--toastify-toast-bottom);\n left: 50%;\n transform: translateX(-50%);\n align-items: center;\n}\n.Toastify__toast-container--bottom-right {\n bottom: var(--toastify-toast-bottom);\n right: var(--toastify-toast-right);\n align-items: end;\n}\n\n.Toastify__toast {\n --y: 0;\n position: relative;\n touch-action: none;\n width: var(--toastify-toast-width);\n min-height: var(--toastify-toast-min-height);\n box-sizing: border-box;\n margin-bottom: 1rem;\n padding: var(--toastify-toast-padding);\n border-radius: var(--toastify-toast-bd-radius);\n box-shadow: var(--toastify-toast-shadow);\n max-height: var(--toastify-toast-max-height);\n font-family: var(--toastify-font-family);\n /* webkit only issue #791 */\n z-index: 0;\n /* inner swag */\n display: flex;\n flex: 1 auto;\n align-items: center;\n word-break: break-word;\n}\n\n@media only screen and (max-width: 480px) {\n .Toastify__toast-container {\n width: 100vw;\n left: env(safe-area-inset-left);\n margin: 0;\n }\n .Toastify__toast-container--top-left,\n .Toastify__toast-container--top-center,\n .Toastify__toast-container--top-right {\n top: env(safe-area-inset-top);\n transform: translateX(0);\n }\n .Toastify__toast-container--bottom-left,\n .Toastify__toast-container--bottom-center,\n .Toastify__toast-container--bottom-right {\n bottom: env(safe-area-inset-bottom);\n transform: translateX(0);\n }\n .Toastify__toast-container--rtl {\n right: env(safe-area-inset-right);\n left: initial;\n }\n .Toastify__toast {\n --toastify-toast-width: 100%;\n margin-bottom: 0;\n border-radius: 0;\n }\n}\n\n.Toastify__toast-container[data-stacked='true'] {\n width: var(--toastify-toast-width);\n}\n\n.Toastify__toast--stacked {\n position: absolute;\n width: 100%;\n transform: translate3d(0, var(--y), 0) scale(var(--s));\n transition: transform 0.3s;\n}\n\n.Toastify__toast--stacked[data-collapsed] .Toastify__toast-body,\n.Toastify__toast--stacked[data-collapsed] .Toastify__close-button {\n transition: opacity 0.1s;\n}\n\n.Toastify__toast--stacked[data-collapsed='false'] {\n overflow: visible;\n}\n\n.Toastify__toast--stacked[data-collapsed='true']:not(:last-child) > * {\n opacity: 0;\n}\n\n.Toastify__toast--stacked:after {\n content: '';\n position: absolute;\n left: 0;\n right: 0;\n height: calc(var(--g) * 1px);\n bottom: 100%;\n}\n\n.Toastify__toast--stacked[data-pos='top'] {\n top: 0;\n}\n\n.Toastify__toast--stacked[data-pos='bot'] {\n bottom: 0;\n}\n\n.Toastify__toast--stacked[data-pos='bot'].Toastify__toast--stacked:before {\n transform-origin: top;\n}\n\n.Toastify__toast--stacked[data-pos='top'].Toastify__toast--stacked:before {\n transform-origin: bottom;\n}\n\n.Toastify__toast--stacked:before {\n content: '';\n position: absolute;\n left: 0;\n right: 0;\n bottom: 0;\n height: 100%;\n transform: scaleY(3);\n z-index: -1;\n}\n\n.Toastify__toast--rtl {\n direction: rtl;\n}\n\n.Toastify__toast--close-on-click {\n cursor: pointer;\n}\n\n.Toastify__toast-icon {\n margin-inline-end: 10px;\n width: 22px;\n flex-shrink: 0;\n display: flex;\n}\n\n.Toastify--animate {\n animation-fill-mode: both;\n animation-duration: 0.5s;\n}\n\n.Toastify--animate-icon {\n animation-fill-mode: both;\n animation-duration: 0.3s;\n}\n\n.Toastify__toast-theme--dark {\n background: var(--toastify-color-dark);\n color: var(--toastify-text-color-dark);\n}\n\n.Toastify__toast-theme--light {\n background: var(--toastify-color-light);\n color: var(--toastify-text-color-light);\n}\n\n.Toastify__toast-theme--colored.Toastify__toast--default {\n background: var(--toastify-color-light);\n color: var(--toastify-text-color-light);\n}\n\n.Toastify__toast-theme--colored.Toastify__toast--info {\n color: var(--toastify-text-color-info);\n background: var(--toastify-color-info);\n}\n\n.Toastify__toast-theme--colored.Toastify__toast--success {\n color: var(--toastify-text-color-success);\n background: var(--toastify-color-success);\n}\n\n.Toastify__toast-theme--colored.Toastify__toast--warning {\n color: var(--toastify-text-color-warning);\n background: var(--toastify-color-warning);\n}\n\n.Toastify__toast-theme--colored.Toastify__toast--error {\n color: var(--toastify-text-color-error);\n background: var(--toastify-color-error);\n}\n\n.Toastify__progress-bar-theme--light {\n background: var(--toastify-color-progress-light);\n}\n\n.Toastify__progress-bar-theme--dark {\n background: var(--toastify-color-progress-dark);\n}\n\n.Toastify__progress-bar--info {\n background: var(--toastify-color-progress-info);\n}\n\n.Toastify__progress-bar--success {\n background: var(--toastify-color-progress-success);\n}\n\n.Toastify__progress-bar--warning {\n background: var(--toastify-color-progress-warning);\n}\n\n.Toastify__progress-bar--error {\n background: var(--toastify-color-progress-error);\n}\n\n.Toastify__progress-bar-theme--colored.Toastify__progress-bar--info,\n.Toastify__progress-bar-theme--colored.Toastify__progress-bar--success,\n.Toastify__progress-bar-theme--colored.Toastify__progress-bar--warning,\n.Toastify__progress-bar-theme--colored.Toastify__progress-bar--error {\n background: var(--toastify-color-transparent);\n}\n\n.Toastify__close-button {\n color: #fff;\n position: absolute;\n top: 6px;\n right: 6px;\n background: transparent;\n outline: none;\n border: none;\n padding: 0;\n cursor: pointer;\n opacity: 0.7;\n transition: 0.3s ease;\n z-index: 1;\n}\n\n.Toastify__toast--rtl .Toastify__close-button {\n left: 6px;\n right: unset;\n}\n\n.Toastify__close-button--light {\n color: #000;\n opacity: 0.3;\n}\n\n.Toastify__close-button > svg {\n fill: currentColor;\n height: 16px;\n width: 14px;\n}\n\n.Toastify__close-button:hover,\n.Toastify__close-button:focus {\n opacity: 1;\n}\n\n@keyframes Toastify__trackProgress {\n 0% {\n transform: scaleX(1);\n }\n 100% {\n transform: scaleX(0);\n }\n}\n\n.Toastify__progress-bar {\n position: absolute;\n bottom: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: 1;\n opacity: 0.7;\n transform-origin: left;\n}\n\n.Toastify__progress-bar--animated {\n animation: Toastify__trackProgress linear 1 forwards;\n}\n\n.Toastify__progress-bar--controlled {\n transition: transform 0.2s;\n}\n\n.Toastify__progress-bar--rtl {\n right: 0;\n left: initial;\n transform-origin: right;\n border-bottom-left-radius: initial;\n}\n\n.Toastify__progress-bar--wrp {\n position: absolute;\n overflow: hidden;\n bottom: 0;\n left: 0;\n width: 100%;\n height: 5px;\n border-bottom-left-radius: var(--toastify-toast-bd-radius);\n border-bottom-right-radius: var(--toastify-toast-bd-radius);\n}\n\n.Toastify__progress-bar--wrp[data-hidden='true'] {\n opacity: 0;\n}\n\n.Toastify__progress-bar--bg {\n opacity: var(--toastify-color-progress-bgo);\n width: 100%;\n height: 100%;\n}\n\n.Toastify__spinner {\n width: 20px;\n height: 20px;\n box-sizing: border-box;\n border: 2px solid;\n border-radius: 100%;\n border-color: var(--toastify-spinner-color-empty-area);\n border-right-color: var(--toastify-spinner-color);\n animation: Toastify__spin 0.65s linear infinite;\n}\n\n@keyframes Toastify__bounceInRight {\n from,\n 60%,\n 75%,\n 90%,\n to {\n animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);\n }\n from {\n opacity: 0;\n transform: translate3d(3000px, 0, 0);\n }\n 60% {\n opacity: 1;\n transform: translate3d(-25px, 0, 0);\n }\n 75% {\n transform: translate3d(10px, 0, 0);\n }\n 90% {\n transform: translate3d(-5px, 0, 0);\n }\n to {\n transform: none;\n }\n}\n\n@keyframes Toastify__bounceOutRight {\n 20% {\n opacity: 1;\n transform: translate3d(-20px, var(--y), 0);\n }\n to {\n opacity: 0;\n transform: translate3d(2000px, var(--y), 0);\n }\n}\n\n@keyframes Toastify__bounceInLeft {\n from,\n 60%,\n 75%,\n 90%,\n to {\n animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);\n }\n 0% {\n opacity: 0;\n transform: translate3d(-3000px, 0, 0);\n }\n 60% {\n opacity: 1;\n transform: translate3d(25px, 0, 0);\n }\n 75% {\n transform: translate3d(-10px, 0, 0);\n }\n 90% {\n transform: translate3d(5px, 0, 0);\n }\n to {\n transform: none;\n }\n}\n\n@keyframes Toastify__bounceOutLeft {\n 20% {\n opacity: 1;\n transform: translate3d(20px, var(--y), 0);\n }\n to {\n opacity: 0;\n transform: translate3d(-2000px, var(--y), 0);\n }\n}\n\n@keyframes Toastify__bounceInUp {\n from,\n 60%,\n 75%,\n 90%,\n to {\n animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);\n }\n from {\n opacity: 0;\n transform: translate3d(0, 3000px, 0);\n }\n 60% {\n opacity: 1;\n transform: translate3d(0, -20px, 0);\n }\n 75% {\n transform: translate3d(0, 10px, 0);\n }\n 90% {\n transform: translate3d(0, -5px, 0);\n }\n to {\n transform: translate3d(0, 0, 0);\n }\n}\n\n@keyframes Toastify__bounceOutUp {\n 20% {\n transform: translate3d(0, calc(var(--y) - 10px), 0);\n }\n 40%,\n 45% {\n opacity: 1;\n transform: translate3d(0, calc(var(--y) + 20px), 0);\n }\n to {\n opacity: 0;\n transform: translate3d(0, -2000px, 0);\n }\n}\n\n@keyframes Toastify__bounceInDown {\n from,\n 60%,\n 75%,\n 90%,\n to {\n animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);\n }\n 0% {\n opacity: 0;\n transform: translate3d(0, -3000px, 0);\n }\n 60% {\n opacity: 1;\n transform: translate3d(0, 25px, 0);\n }\n 75% {\n transform: translate3d(0, -10px, 0);\n }\n 90% {\n transform: translate3d(0, 5px, 0);\n }\n to {\n transform: none;\n }\n}\n\n@keyframes Toastify__bounceOutDown {\n 20% {\n transform: translate3d(0, calc(var(--y) - 10px), 0);\n }\n 40%,\n 45% {\n opacity: 1;\n transform: translate3d(0, calc(var(--y) + 20px), 0);\n }\n to {\n opacity: 0;\n transform: translate3d(0, 2000px, 0);\n }\n}\n\n.Toastify__bounce-enter--top-left,\n.Toastify__bounce-enter--bottom-left {\n animation-name: Toastify__bounceInLeft;\n}\n\n.Toastify__bounce-enter--top-right,\n.Toastify__bounce-enter--bottom-right {\n animation-name: Toastify__bounceInRight;\n}\n\n.Toastify__bounce-enter--top-center {\n animation-name: Toastify__bounceInDown;\n}\n\n.Toastify__bounce-enter--bottom-center {\n animation-name: Toastify__bounceInUp;\n}\n\n.Toastify__bounce-exit--top-left,\n.Toastify__bounce-exit--bottom-left {\n animation-name: Toastify__bounceOutLeft;\n}\n\n.Toastify__bounce-exit--top-right,\n.Toastify__bounce-exit--bottom-right {\n animation-name: Toastify__bounceOutRight;\n}\n\n.Toastify__bounce-exit--top-center {\n animation-name: Toastify__bounceOutUp;\n}\n\n.Toastify__bounce-exit--bottom-center {\n animation-name: Toastify__bounceOutDown;\n}\n\n@keyframes Toastify__zoomIn {\n from {\n opacity: 0;\n transform: scale3d(0.3, 0.3, 0.3);\n }\n 50% {\n opacity: 1;\n }\n}\n\n@keyframes Toastify__zoomOut {\n from {\n opacity: 1;\n }\n 50% {\n opacity: 0;\n transform: translate3d(0, var(--y), 0) scale3d(0.3, 0.3, 0.3);\n }\n to {\n opacity: 0;\n }\n}\n\n.Toastify__zoom-enter {\n animation-name: Toastify__zoomIn;\n}\n\n.Toastify__zoom-exit {\n animation-name: Toastify__zoomOut;\n}\n\n@keyframes Toastify__flipIn {\n from {\n transform: perspective(400px) rotate3d(1, 0, 0, 90deg);\n animation-timing-function: ease-in;\n opacity: 0;\n }\n 40% {\n transform: perspective(400px) rotate3d(1, 0, 0, -20deg);\n animation-timing-function: ease-in;\n }\n 60% {\n transform: perspective(400px) rotate3d(1, 0, 0, 10deg);\n opacity: 1;\n }\n 80% {\n transform: perspective(400px) rotate3d(1, 0, 0, -5deg);\n }\n to {\n transform: perspective(400px);\n }\n}\n\n@keyframes Toastify__flipOut {\n from {\n transform: translate3d(0, var(--y), 0) perspective(400px);\n }\n 30% {\n transform: translate3d(0, var(--y), 0) perspective(400px) rotate3d(1, 0, 0, -20deg);\n opacity: 1;\n }\n to {\n transform: translate3d(0, var(--y), 0) perspective(400px) rotate3d(1, 0, 0, 90deg);\n opacity: 0;\n }\n}\n\n.Toastify__flip-enter {\n animation-name: Toastify__flipIn;\n}\n\n.Toastify__flip-exit {\n animation-name: Toastify__flipOut;\n}\n\n@keyframes Toastify__slideInRight {\n from {\n transform: translate3d(110%, 0, 0);\n visibility: visible;\n }\n to {\n transform: translate3d(0, var(--y), 0);\n }\n}\n\n@keyframes Toastify__slideInLeft {\n from {\n transform: translate3d(-110%, 0, 0);\n visibility: visible;\n }\n to {\n transform: translate3d(0, var(--y), 0);\n }\n}\n\n@keyframes Toastify__slideInUp {\n from {\n transform: translate3d(0, 110%, 0);\n visibility: visible;\n }\n to {\n transform: translate3d(0, var(--y), 0);\n }\n}\n\n@keyframes Toastify__slideInDown {\n from {\n transform: translate3d(0, -110%, 0);\n visibility: visible;\n }\n to {\n transform: translate3d(0, var(--y), 0);\n }\n}\n\n@keyframes Toastify__slideOutRight {\n from {\n transform: translate3d(0, var(--y), 0);\n }\n to {\n visibility: hidden;\n transform: translate3d(110%, var(--y), 0);\n }\n}\n\n@keyframes Toastify__slideOutLeft {\n from {\n transform: translate3d(0, var(--y), 0);\n }\n to {\n visibility: hidden;\n transform: translate3d(-110%, var(--y), 0);\n }\n}\n\n@keyframes Toastify__slideOutDown {\n from {\n transform: translate3d(0, var(--y), 0);\n }\n to {\n visibility: hidden;\n transform: translate3d(0, 500px, 0);\n }\n}\n\n@keyframes Toastify__slideOutUp {\n from {\n transform: translate3d(0, var(--y), 0);\n }\n to {\n visibility: hidden;\n transform: translate3d(0, -500px, 0);\n }\n}\n\n.Toastify__slide-enter--top-left,\n.Toastify__slide-enter--bottom-left {\n animation-name: Toastify__slideInLeft;\n}\n\n.Toastify__slide-enter--top-right,\n.Toastify__slide-enter--bottom-right {\n animation-name: Toastify__slideInRight;\n}\n\n.Toastify__slide-enter--top-center {\n animation-name: Toastify__slideInDown;\n}\n\n.Toastify__slide-enter--bottom-center {\n animation-name: Toastify__slideInUp;\n}\n\n.Toastify__slide-exit--top-left,\n.Toastify__slide-exit--bottom-left {\n animation-name: Toastify__slideOutLeft;\n animation-timing-function: ease-in;\n animation-duration: 0.3s;\n}\n\n.Toastify__slide-exit--top-right,\n.Toastify__slide-exit--bottom-right {\n animation-name: Toastify__slideOutRight;\n animation-timing-function: ease-in;\n animation-duration: 0.3s;\n}\n\n.Toastify__slide-exit--top-center {\n animation-name: Toastify__slideOutUp;\n animation-timing-function: ease-in;\n animation-duration: 0.3s;\n}\n\n.Toastify__slide-exit--bottom-center {\n animation-name: Toastify__slideOutDown;\n animation-timing-function: ease-in;\n animation-duration: 0.3s;\n}\n\n@keyframes Toastify__spin {\n from {\n transform: rotate(0deg);\n }\n to {\n transform: rotate(360deg);\n }\n}\n";
|
|
1953
|
-
styleInject(css_248z);
|
|
1954
|
-
|
|
1955
|
-
const BadgesButton = ({ onClick, position, styles, unlockedAchievements, icon, drawer = false, customStyles, }) => {
|
|
1956
|
-
const positionStyle = position
|
|
1957
|
-
? {
|
|
1958
|
-
[position.split('-')[0]]: '20px',
|
|
1959
|
-
[position.split('-')[1]]: '20px',
|
|
1960
|
-
}
|
|
1961
|
-
: {};
|
|
1962
|
-
const handleButtonClick = () => {
|
|
1963
|
-
onClick();
|
|
1964
|
-
};
|
|
1965
|
-
const achievementsText = 'View Achievements';
|
|
1966
|
-
const buttonContent = icon ? icon : achievementsText;
|
|
1967
|
-
return (React.createElement("button", { onClick: handleButtonClick, style: Object.assign(Object.assign(Object.assign({}, styles), positionStyle), customStyles) }, buttonContent));
|
|
1968
|
-
};
|
|
1969
|
-
var BadgesButton$1 = React.memo(BadgesButton);
|
|
1970
|
-
|
|
1971
|
-
// src/defaultIcons.ts
|
|
1972
|
-
const defaultAchievementIcons = {
|
|
1973
|
-
// General Progress & Milestones
|
|
1974
|
-
levelUp: '🏆',
|
|
1975
|
-
questComplete: '📜',
|
|
1976
|
-
monsterDefeated: '⚔️',
|
|
1977
|
-
itemCollected: '📦',
|
|
1978
|
-
challengeCompleted: '🏁',
|
|
1979
|
-
milestoneReached: '🏅',
|
|
1980
|
-
firstStep: '👣',
|
|
1981
|
-
newBeginnings: '🌱',
|
|
1982
|
-
breakthrough: '💡',
|
|
1983
|
-
growth: '📈',
|
|
1984
|
-
// Social & Engagement
|
|
1985
|
-
shared: '🔗',
|
|
1986
|
-
liked: '❤️',
|
|
1987
|
-
commented: '💬',
|
|
1988
|
-
followed: '👥',
|
|
1989
|
-
invited: '🤝',
|
|
1990
|
-
communityMember: '🏘️',
|
|
1991
|
-
supporter: '🌟',
|
|
1992
|
-
connected: '🌐',
|
|
1993
|
-
participant: '🙋',
|
|
1994
|
-
influencer: '📣',
|
|
1995
|
-
// Time & Activity
|
|
1996
|
-
activeDay: '☀️',
|
|
1997
|
-
activeWeek: '📅',
|
|
1998
|
-
activeMonth: '🗓️',
|
|
1999
|
-
earlyBird: '⏰',
|
|
2000
|
-
nightOwl: '🌙',
|
|
2001
|
-
streak: '🔥',
|
|
2002
|
-
dedicated: '⏳',
|
|
2003
|
-
punctual: '⏱️',
|
|
2004
|
-
consistent: '🔄',
|
|
2005
|
-
marathon: '🏃',
|
|
2006
|
-
// Creativity & Skill
|
|
2007
|
-
artist: '🎨',
|
|
2008
|
-
writer: '✍️',
|
|
2009
|
-
innovator: '🔬',
|
|
2010
|
-
creator: '🛠️',
|
|
2011
|
-
expert: '🎓',
|
|
2012
|
-
master: '👑',
|
|
2013
|
-
pioneer: '🚀',
|
|
2014
|
-
performer: '🎭',
|
|
2015
|
-
thinker: '🧠',
|
|
2016
|
-
explorer: '🗺️',
|
|
2017
|
-
// Achievement Types
|
|
2018
|
-
bronze: '🥉',
|
|
2019
|
-
silver: '🥈',
|
|
2020
|
-
gold: '🥇',
|
|
2021
|
-
diamond: '💎',
|
|
2022
|
-
legendary: '✨',
|
|
2023
|
-
epic: '💥',
|
|
2024
|
-
rare: '🔮',
|
|
2025
|
-
common: '🔘',
|
|
2026
|
-
special: '🎁',
|
|
2027
|
-
hidden: '❓',
|
|
2028
|
-
// Numbers & Counters
|
|
2029
|
-
one: '1️⃣',
|
|
2030
|
-
ten: '🔟',
|
|
2031
|
-
hundred: '💯',
|
|
2032
|
-
thousand: '🔢',
|
|
2033
|
-
// Actions & Interactions
|
|
2034
|
-
clicked: '🖱️',
|
|
2035
|
-
used: '🔑',
|
|
2036
|
-
found: '🔍',
|
|
2037
|
-
built: '🧱',
|
|
2038
|
-
solved: '🧩',
|
|
2039
|
-
discovered: '🔭',
|
|
2040
|
-
unlocked: '🔓',
|
|
2041
|
-
upgraded: '⬆️',
|
|
2042
|
-
repaired: '🔧',
|
|
2043
|
-
defended: '🛡️',
|
|
2044
|
-
// Placeholders
|
|
2045
|
-
default: '⭐', // A fallback icon
|
|
2046
|
-
loading: '⏳',
|
|
2047
|
-
error: '⚠️',
|
|
2048
|
-
success: '✅',
|
|
2049
|
-
failure: '❌',
|
|
2050
|
-
// Miscellaneous
|
|
2051
|
-
trophy: '🏆',
|
|
2052
|
-
star: '⭐',
|
|
2053
|
-
flag: '🚩',
|
|
2054
|
-
puzzle: '🧩',
|
|
2055
|
-
gem: '💎',
|
|
2056
|
-
crown: '👑',
|
|
2057
|
-
medal: '🏅',
|
|
2058
|
-
ribbon: '🎗️',
|
|
2059
|
-
badge: '🎖️',
|
|
2060
|
-
shield: '🛡️',
|
|
2061
|
-
};
|
|
2062
|
-
|
|
2063
|
-
const BadgesModal = ({ isOpen, achievements, onClose, styles, icons = {} }) => {
|
|
2064
|
-
if (!isOpen)
|
|
2065
|
-
return null;
|
|
2066
|
-
return (React.createElement("div", { style: styles.overlay },
|
|
2067
|
-
React.createElement("div", { style: styles.content },
|
|
2068
|
-
React.createElement("h2", { style: styles.title }, "Your Achievements"),
|
|
2069
|
-
React.createElement("div", { style: styles.badgeContainer }, achievements.map((achievement) => {
|
|
2070
|
-
const mergedIcons = Object.assign(Object.assign({}, defaultAchievementIcons), icons);
|
|
2071
|
-
let iconToDisplay = mergedIcons.default;
|
|
2072
|
-
if (achievement.achievementIconKey && mergedIcons[achievement.achievementIconKey]) {
|
|
2073
|
-
iconToDisplay = mergedIcons[achievement.achievementIconKey];
|
|
2074
|
-
}
|
|
2075
|
-
return (React.createElement("div", { key: achievement.achievementId, style: styles.badge },
|
|
2076
|
-
iconToDisplay.startsWith('http') || iconToDisplay.startsWith('data:image') ? (React.createElement("img", { src: iconToDisplay, alt: achievement.achievementTitle, style: styles.badgeIcon })) : (React.createElement("p", { style: { fontSize: '2em' } }, iconToDisplay) // Render Unicode as large text
|
|
2077
|
-
),
|
|
2078
|
-
React.createElement("span", { style: styles.badgeTitle }, achievement.achievementTitle)));
|
|
2079
|
-
})),
|
|
2080
|
-
React.createElement("button", { onClick: onClose, style: styles.button }, "Close"))));
|
|
2081
|
-
};
|
|
2082
|
-
var BadgesModal$1 = React.memo(BadgesModal);
|
|
2083
|
-
|
|
2084
|
-
var reactConfetti_min = {exports: {}};
|
|
2085
|
-
|
|
2086
|
-
(function (module, exports) {
|
|
2087
|
-
!function(t,e){module.exports=e(React);}("undefined"!=typeof self?self:undefined,(function(t){return function(t){var e={};function n(r){if(e[r])return e[r].exports;var i=e[r]={i:r,l:false,exports:{}};return t[r].call(i.exports,i,i.exports,n),i.l=true,i.exports}return n.m=t,n.c=e,n.d=function(t,e,r){n.o(t,e)||Object.defineProperty(t,e,{enumerable:true,get:r});},n.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:true});},n.t=function(t,e){if(1&e&&(t=n(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:true,value:t}),2&e&&"string"!=typeof t)for(var i in t)n.d(r,i,function(e){return t[e]}.bind(null,i));return r},n.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return n.d(e,"a",e),e},n.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},n.p="",n(n.s=2)}([function(e,n){e.exports=t;},function(t,e,n){var r={linear:function(t,e,n,r){return (n-e)*t/r+e},easeInQuad:function(t,e,n,r){return (n-e)*(t/=r)*t+e},easeOutQuad:function(t,e,n,r){return -(n-e)*(t/=r)*(t-2)+e},easeInOutQuad:function(t,e,n,r){var i=n-e;return (t/=r/2)<1?i/2*t*t+e:-i/2*(--t*(t-2)-1)+e},easeInCubic:function(t,e,n,r){return (n-e)*(t/=r)*t*t+e},easeOutCubic:function(t,e,n,r){return (n-e)*((t=t/r-1)*t*t+1)+e},easeInOutCubic:function(t,e,n,r){var i=n-e;return (t/=r/2)<1?i/2*t*t*t+e:i/2*((t-=2)*t*t+2)+e},easeInQuart:function(t,e,n,r){return (n-e)*(t/=r)*t*t*t+e},easeOutQuart:function(t,e,n,r){return -(n-e)*((t=t/r-1)*t*t*t-1)+e},easeInOutQuart:function(t,e,n,r){var i=n-e;return (t/=r/2)<1?i/2*t*t*t*t+e:-i/2*((t-=2)*t*t*t-2)+e},easeInQuint:function(t,e,n,r){return (n-e)*(t/=r)*t*t*t*t+e},easeOutQuint:function(t,e,n,r){return (n-e)*((t=t/r-1)*t*t*t*t+1)+e},easeInOutQuint:function(t,e,n,r){var i=n-e;return (t/=r/2)<1?i/2*t*t*t*t*t+e:i/2*((t-=2)*t*t*t*t+2)+e},easeInSine:function(t,e,n,r){var i=n-e;return -i*Math.cos(t/r*(Math.PI/2))+i+e},easeOutSine:function(t,e,n,r){return (n-e)*Math.sin(t/r*(Math.PI/2))+e},easeInOutSine:function(t,e,n,r){return -(n-e)/2*(Math.cos(Math.PI*t/r)-1)+e},easeInExpo:function(t,e,n,r){return 0==t?e:(n-e)*Math.pow(2,10*(t/r-1))+e},easeOutExpo:function(t,e,n,r){var i=n-e;return t==r?e+i:i*(1-Math.pow(2,-10*t/r))+e},easeInOutExpo:function(t,e,n,r){var i=n-e;return 0===t?e:t===r?e+i:(t/=r/2)<1?i/2*Math.pow(2,10*(t-1))+e:i/2*(2-Math.pow(2,-10*--t))+e},easeInCirc:function(t,e,n,r){return -(n-e)*(Math.sqrt(1-(t/=r)*t)-1)+e},easeOutCirc:function(t,e,n,r){return (n-e)*Math.sqrt(1-(t=t/r-1)*t)+e},easeInOutCirc:function(t,e,n,r){var i=n-e;return (t/=r/2)<1?-i/2*(Math.sqrt(1-t*t)-1)+e:i/2*(Math.sqrt(1-(t-=2)*t)+1)+e},easeInElastic:function(t,e,n,r){var i,o,a,c=n-e;return a=1.70158,0===t?e:1==(t/=r)?e+c:((o=0)||(o=.3*r),(i=c)<Math.abs(c)?(i=c,a=o/4):a=o/(2*Math.PI)*Math.asin(c/i),-i*Math.pow(2,10*(t-=1))*Math.sin((t*r-a)*(2*Math.PI)/o)+e)},easeOutElastic:function(t,e,n,r){var i,o,a,c=n-e;return a=1.70158,0===t?e:1==(t/=r)?e+c:((o=0)||(o=.3*r),(i=c)<Math.abs(c)?(i=c,a=o/4):a=o/(2*Math.PI)*Math.asin(c/i),i*Math.pow(2,-10*t)*Math.sin((t*r-a)*(2*Math.PI)/o)+c+e)},easeInOutElastic:function(t,e,n,r){var i,o,a,c=n-e;return a=1.70158,0===t?e:2==(t/=r/2)?e+c:((o=0)||(o=r*(.3*1.5)),(i=c)<Math.abs(c)?(i=c,a=o/4):a=o/(2*Math.PI)*Math.asin(c/i),t<1?i*Math.pow(2,10*(t-=1))*Math.sin((t*r-a)*(2*Math.PI)/o)*-0.5+e:i*Math.pow(2,-10*(t-=1))*Math.sin((t*r-a)*(2*Math.PI)/o)*.5+c+e)},easeInBack:function(t,e,n,r,i){return void 0===i&&(i=1.70158),(n-e)*(t/=r)*t*((i+1)*t-i)+e},easeOutBack:function(t,e,n,r,i){return void 0===i&&(i=1.70158),(n-e)*((t=t/r-1)*t*((i+1)*t+i)+1)+e},easeInOutBack:function(t,e,n,r,i){var o=n-e;return void 0===i&&(i=1.70158),(t/=r/2)<1?o/2*(t*t*((1+(i*=1.525))*t-i))+e:o/2*((t-=2)*t*((1+(i*=1.525))*t+i)+2)+e},easeInBounce:function(t,e,n,i){var o=n-e;return o-r.easeOutBounce(i-t,0,o,i)+e},easeOutBounce:function(t,e,n,r){var i=n-e;return (t/=r)<1/2.75?i*(7.5625*t*t)+e:t<2/2.75?i*(7.5625*(t-=1.5/2.75)*t+.75)+e:t<2.5/2.75?i*(7.5625*(t-=2.25/2.75)*t+.9375)+e:i*(7.5625*(t-=2.625/2.75)*t+.984375)+e},easeInOutBounce:function(t,e,n,i){var o=n-e;return t<i/2?.5*r.easeInBounce(2*t,0,o,i)+e:.5*r.easeOutBounce(2*t-i,0,o,i)+.5*o+e}};t.exports=r;},function(t,e,n){t.exports=n(3);},function(t,e,n){n.r(e),n.d(e,"ReactConfetti",(function(){return Q}));var r,i,o=n(0),a=n.n(o),c=n(1),s=n.n(c);function u(t,e){return t+Math.random()*(e-t)}function f(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||false,r.configurable=true,"value"in r&&(r.writable=true),Object.defineProperty(t,r.key,r);}}function h(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:true,configurable:true,writable:true}):t[e]=n,t}!function(t){t[t.Circle=0]="Circle",t[t.Square=1]="Square",t[t.Strip=2]="Strip";}(r||(r={})),function(t){t[t.Positive=1]="Positive",t[t.Negative=-1]="Negative";}(i||(i={}));var l=function(){function t(e,n,r,o){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(undefined,t),h(undefined,"context",void 0),h(undefined,"radius",void 0),h(undefined,"x",void 0),h(undefined,"y",void 0),h(undefined,"w",void 0),h(undefined,"h",void 0),h(undefined,"vx",void 0),h(undefined,"vy",void 0),h(undefined,"shape",void 0),h(undefined,"angle",void 0),h(undefined,"angularSpin",void 0),h(undefined,"color",void 0),h(undefined,"rotateY",void 0),h(undefined,"rotationDirection",void 0),h(undefined,"getOptions",void 0),this.getOptions=n;var a,c,s=this.getOptions(),f=s.colors,l=s.initialVelocityX,p=s.initialVelocityY;this.context=e,this.x=r,this.y=o,this.w=u(5,20),this.h=u(5,20),this.radius=u(5,10),this.vx="number"==typeof l?u(-l,l):u(l.min,l.max),this.vy="number"==typeof p?u(-p,0):u(p.min,p.max),this.shape=(a=0,c=2,Math.floor(a+Math.random()*(c-a+1))),this.angle=u(0,360)*Math.PI/180,this.angularSpin=u(-0.2,.2),this.color=f[Math.floor(Math.random()*f.length)],this.rotateY=u(0,1),this.rotationDirection=u(0,1)?i.Positive:i.Negative;}var e,n;return e=t,(n=[{key:"update",value:function(){var t=this.getOptions(),e=t.gravity,n=t.wind,o=t.friction,a=t.opacity,c=t.drawShape;this.x+=this.vx,this.y+=this.vy,this.vy+=e,this.vx+=n,this.vx*=o,this.vy*=o,this.rotateY>=1&&this.rotationDirection===i.Positive?this.rotationDirection=i.Negative:this.rotateY<=-1&&this.rotationDirection===i.Negative&&(this.rotationDirection=i.Positive);var s=.1*this.rotationDirection;if(this.rotateY+=s,this.angle+=this.angularSpin,this.context.save(),this.context.translate(this.x,this.y),this.context.rotate(this.angle),this.context.scale(1,this.rotateY),this.context.rotate(this.angle),this.context.beginPath(),this.context.fillStyle=this.color,this.context.strokeStyle=this.color,this.context.globalAlpha=a,this.context.lineCap="round",this.context.lineWidth=2,c&&"function"==typeof c)c.call(undefined,this.context);else switch(this.shape){case r.Circle:this.context.beginPath(),this.context.arc(0,0,this.radius,0,2*Math.PI),this.context.fill();break;case r.Square:this.context.fillRect(-this.w/2,-this.h/2,this.w,this.h);break;case r.Strip:this.context.fillRect(-this.w/6,-this.h/2,this.w/3,this.h);}this.context.closePath(),this.context.restore();}}])&&f(e.prototype,n),t}();function p(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:true,configurable:true,writable:true}):t[e]=n,t}var v=function t(e,n){var r=undefined;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(undefined,t),p(undefined,"canvas",void 0),p(undefined,"context",void 0),p(undefined,"getOptions",void 0),p(undefined,"x",0),p(undefined,"y",0),p(undefined,"w",0),p(undefined,"h",0),p(undefined,"lastNumberOfPieces",0),p(undefined,"tweenInitTime",Date.now()),p(undefined,"particles",[]),p(undefined,"particlesGenerated",0),p(undefined,"removeParticleAt",(function(t){r.particles.splice(t,1);})),p(undefined,"getParticle",(function(){var t=u(r.x,r.w+r.x),e=u(r.y,r.h+r.y);return new l(r.context,r.getOptions,t,e)})),p(undefined,"animate",(function(){var t=r.canvas,e=r.context,n=r.particlesGenerated,i=r.lastNumberOfPieces,o=r.getOptions(),a=o.run,c=o.recycle,s=o.numberOfPieces,u=o.debug,f=o.tweenFunction,h=o.tweenDuration;if(!a)return false;var l=r.particles.length,p=c?l:n,v=Date.now();if(p<s){i!==s&&(r.tweenInitTime=v,r.lastNumberOfPieces=s);for(var y=r.tweenInitTime,d=f(v-y>h?h:Math.max(0,v-y),p,s,h),b=Math.round(d-p),g=0;g<b;g++)r.particles.push(r.getParticle());r.particlesGenerated+=b;}return u&&(e.font="12px sans-serif",e.fillStyle="#333",e.textAlign="right",e.fillText("Particles: ".concat(l),t.width-10,t.height-20)),r.particles.forEach((function(e,n){e.update(),(e.y>t.height||e.y<-100||e.x>t.width+100||e.x<-100)&&(c&&p<=s?r.particles[n]=r.getParticle():r.removeParticleAt(n));})),l>0||p<s})),this.canvas=e;var i=this.canvas.getContext("2d");if(!i)throw new Error("Could not get canvas context");this.context=i,this.getOptions=n;};function y(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r);}return n}function d(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?y(Object(n),true).forEach((function(e){g(t,e,n[e]);})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):y(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e));}));}return t}function b(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||false,r.configurable=true,"value"in r&&(r.writable=true),Object.defineProperty(t,r.key,r);}}function g(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:true,configurable:true,writable:true}):t[e]=n,t}var O={width:"undefined"!=typeof window?window.innerWidth:300,height:"undefined"!=typeof window?window.innerHeight:200,numberOfPieces:200,friction:.99,wind:0,gravity:.1,initialVelocityX:4,initialVelocityY:10,colors:["#f44336","#e91e63","#9c27b0","#673ab7","#3f51b5","#2196f3","#03a9f4","#00bcd4","#009688","#4CAF50","#8BC34A","#CDDC39","#FFEB3B","#FFC107","#FF9800","#FF5722","#795548"],opacity:1,debug:false,tweenFunction:s.a.easeInOutQuad,tweenDuration:5e3,recycle:true,run:true},w=function(){function t(e,n){var r=undefined;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(undefined,t),g(undefined,"canvas",void 0),g(undefined,"context",void 0),g(undefined,"_options",void 0),g(undefined,"generator",void 0),g(undefined,"rafId",void 0),g(undefined,"setOptionsWithDefaults",(function(t){var e={confettiSource:{x:0,y:0,w:r.canvas.width,h:0}};r._options=d(d(d({},e),O),t),Object.assign(r,t.confettiSource);})),g(undefined,"update",(function(){var t=r.options;t.run;t.onConfettiComplete;r.canvas;r.context;r.generator.animate()?r.rafId=requestAnimationFrame(r.update):(r._options.run=false);})),g(undefined,"reset",(function(){r.generator;})),g(undefined,"stop",(function(){r.options={run:false},r.rafId;})),this.canvas=e;var i=this.canvas.getContext("2d");if(!i)throw new Error("Could not get canvas context");this.context=i,this.generator=new v(this.canvas,(function(){return r.options})),this.options=n,this.update();}var e,n;return e=t,(n=[{key:"options",get:function(){return this._options},set:function(t){var e=this._options&&this._options.run,n=this._options&&this._options.recycle;this.setOptionsWithDefaults(t),this.generator&&(Object.assign(this.generator,this.options.confettiSource),"boolean"==typeof t.recycle&&t.recycle&&false===n&&(this.generator.lastNumberOfPieces=this.generator.particles.length)),"boolean"==typeof t.run&&t.run&&false===e&&this.update();}}])&&b(e.prototype,n),t}();function m(t){return function(t){if(Array.isArray(t))return C(t)}(t)||function(t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||S(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function x(t){return (x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function P(){return (P=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r]);}return t}).apply(undefined,arguments)}function j(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r);}return n}function M(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?j(Object(n),true).forEach((function(e){T(t,e,n[e]);})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):j(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e));}));}return t}function I(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var n=[],r=true,i=false,o=void 0;try{for(var a,c=t[Symbol.iterator]();!(r=(a=c.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){i=true,o=t;}finally{try{r||null==c.return||c.return();}finally{if(i)throw o}}return n}(t,e)||S(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function S(t,e){if(t){if("string"==typeof t)return C(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return "Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?C(t,e):void 0}}function C(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function D(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function E(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||false,r.configurable=true,"value"in r&&(r.writable=true),Object.defineProperty(t,r.key,r);}}function _(t,e){return (_=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function R(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if("function"==typeof Proxy)return true;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(t){return false}}();return function(){var n,r=F(t);if(e){var i=F(undefined).constructor;n=Reflect.construct(r,arguments,i);}else n=r.apply(undefined,arguments);return k(undefined,n)}}function k(t,e){return !e||"object"!==x(e)&&"function"!=typeof e?A(t):e}function A(t){if(void 0===t)throw new ReferenceError("undefined hasn't been initialised - super() hasn't been called");return t}function F(t){return (F=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function T(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:true,configurable:true,writable:true}):t[e]=n,t}var B=a.a.createRef(),N=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:true,configurable:true}}),e&&_(t,e);}(o,t);var e,n,i=R(o);function o(t){var e;D(undefined,o);for(var n=arguments.length,r=new Array(n>1?n-1:0),c=1;c<n;c++)r[c-1]=arguments[c];return T(A(e=i.call.apply(i,[undefined,t].concat(r))),"canvas",a.a.createRef()),T(A(e),"confetti",void 0),e.canvas=t.canvasRef||B,e}return e=o,(n=[{key:"componentDidMount",value:function(){if(this.canvas.current){var t=q(this.props)[0];this.confetti=new w(this.canvas.current,t);}}},{key:"componentDidUpdate",value:function(){var t=q(this.props)[0];this.confetti&&(this.confetti.options=t);}},{key:"componentWillUnmount",value:function(){this.confetti&&this.confetti.stop(),this.confetti=void 0;}},{key:"render",value:function(){var t=I(q(this.props),2),e=t[0],n=t[1],r=M({zIndex:2,position:"absolute",pointerEvents:"none",top:0,left:0,bottom:0,right:0},n.style);return a.a.createElement("canvas",P({width:e.width,height:e.height,ref:this.canvas},n,{style:r}))}}])&&E(e.prototype,n),o}(o.Component);function q(t){var e={},n={},r=[].concat(m(Object.keys(O)),["confettiSource","drawShape","onConfettiComplete"]),i=["canvasRef"];for(var o in t){var a=t[o];r.includes(o)?e[o]=a:i.includes(o)?i[o]=a:n[o]=a;}return [e,n,{}]}T(N,"defaultProps",M({},O)),T(N,"displayName","ReactConfetti");var Q=a.a.forwardRef((function(t,e){return a.a.createElement(N,P({canvasRef:e},t))}));e.default=Q;}]).default}));
|
|
2088
|
-
|
|
2089
|
-
} (reactConfetti_min));
|
|
2090
|
-
|
|
2091
|
-
var reactConfetti_minExports = reactConfetti_min.exports;
|
|
2092
|
-
var Confetti = /*@__PURE__*/getDefaultExportFromCjs(reactConfetti_minExports);
|
|
2093
|
-
|
|
2094
|
-
function on(obj) {
|
|
2095
|
-
var args = [];
|
|
2096
|
-
for (var _i = 1; _i < arguments.length; _i++) {
|
|
2097
|
-
args[_i - 1] = arguments[_i];
|
|
2098
|
-
}
|
|
2099
|
-
if (obj && obj.addEventListener) {
|
|
2100
|
-
obj.addEventListener.apply(obj, args);
|
|
2101
|
-
}
|
|
2102
|
-
}
|
|
2103
|
-
function off(obj) {
|
|
2104
|
-
var args = [];
|
|
2105
|
-
for (var _i = 1; _i < arguments.length; _i++) {
|
|
2106
|
-
args[_i - 1] = arguments[_i];
|
|
2107
|
-
}
|
|
2108
|
-
if (obj && obj.removeEventListener) {
|
|
2109
|
-
obj.removeEventListener.apply(obj, args);
|
|
2110
|
-
}
|
|
2111
|
-
}
|
|
2112
|
-
var isBrowser = typeof window !== 'undefined';
|
|
2113
|
-
|
|
2114
|
-
var useEffectOnce = function (effect) {
|
|
2115
|
-
React.useEffect(effect, []);
|
|
2116
|
-
};
|
|
2117
|
-
|
|
2118
|
-
var useUnmount = function (fn) {
|
|
2119
|
-
var fnRef = React.useRef(fn);
|
|
2120
|
-
// update the ref each render so if it change the newest callback will be invoked
|
|
2121
|
-
fnRef.current = fn;
|
|
2122
|
-
useEffectOnce(function () { return function () { return fnRef.current(); }; });
|
|
2123
|
-
};
|
|
2124
|
-
|
|
2125
|
-
var useRafState = function (initialState) {
|
|
2126
|
-
var frame = React.useRef(0);
|
|
2127
|
-
var _a = React.useState(initialState), state = _a[0], setState = _a[1];
|
|
2128
|
-
var setRafState = React.useCallback(function (value) {
|
|
2129
|
-
cancelAnimationFrame(frame.current);
|
|
2130
|
-
frame.current = requestAnimationFrame(function () {
|
|
2131
|
-
setState(value);
|
|
2132
|
-
});
|
|
2133
|
-
}, []);
|
|
2134
|
-
useUnmount(function () {
|
|
2135
|
-
cancelAnimationFrame(frame.current);
|
|
2136
|
-
});
|
|
2137
|
-
return [state, setRafState];
|
|
2138
|
-
};
|
|
2139
|
-
|
|
2140
|
-
var useWindowSize = function (initialWidth, initialHeight) {
|
|
2141
|
-
if (initialWidth === void 0) { initialWidth = Infinity; }
|
|
2142
|
-
if (initialHeight === void 0) { initialHeight = Infinity; }
|
|
2143
|
-
var _a = useRafState({
|
|
2144
|
-
width: isBrowser ? window.innerWidth : initialWidth,
|
|
2145
|
-
height: isBrowser ? window.innerHeight : initialHeight,
|
|
2146
|
-
}), state = _a[0], setState = _a[1];
|
|
2147
|
-
React.useEffect(function () {
|
|
2148
|
-
if (isBrowser) {
|
|
2149
|
-
var handler_1 = function () {
|
|
2150
|
-
setState({
|
|
2151
|
-
width: window.innerWidth,
|
|
2152
|
-
height: window.innerHeight,
|
|
2153
|
-
});
|
|
2154
|
-
};
|
|
2155
|
-
on(window, 'resize', handler_1);
|
|
2156
|
-
return function () {
|
|
2157
|
-
off(window, 'resize', handler_1);
|
|
2158
|
-
};
|
|
2159
|
-
}
|
|
2160
|
-
}, []);
|
|
2161
|
-
return state;
|
|
2162
|
-
};
|
|
2163
|
-
|
|
2164
|
-
const ConfettiWrapper = ({ show }) => {
|
|
2165
|
-
const { width, height } = useWindowSize();
|
|
2166
|
-
if (!show)
|
|
2167
|
-
return null;
|
|
2168
|
-
return React.createElement(Confetti, { width: width, height: height, recycle: false });
|
|
2169
|
-
};
|
|
2170
|
-
|
|
2171
|
-
const defaultStyles = {
|
|
2172
|
-
badgesModal: {
|
|
2173
|
-
overlay: {
|
|
2174
|
-
position: 'fixed',
|
|
2175
|
-
top: 0,
|
|
2176
|
-
left: 0,
|
|
2177
|
-
right: 0,
|
|
2178
|
-
bottom: 0,
|
|
2179
|
-
backgroundColor: 'rgba(0, 0, 0, 0.5)',
|
|
2180
|
-
display: 'flex',
|
|
2181
|
-
alignItems: 'center',
|
|
2182
|
-
justifyContent: 'center',
|
|
2183
|
-
},
|
|
2184
|
-
content: {
|
|
2185
|
-
backgroundColor: '#ffffff',
|
|
2186
|
-
borderRadius: '8px',
|
|
2187
|
-
padding: '20px',
|
|
2188
|
-
maxWidth: '600px',
|
|
2189
|
-
width: '100%',
|
|
2190
|
-
maxHeight: '80vh',
|
|
2191
|
-
overflowY: 'auto',
|
|
2192
|
-
},
|
|
2193
|
-
title: {
|
|
2194
|
-
fontSize: '24px',
|
|
2195
|
-
fontWeight: 'bold',
|
|
2196
|
-
marginBottom: '20px',
|
|
2197
|
-
},
|
|
2198
|
-
badgeContainer: {
|
|
2199
|
-
display: 'flex',
|
|
2200
|
-
flexWrap: 'wrap',
|
|
2201
|
-
justifyContent: 'center',
|
|
2202
|
-
},
|
|
2203
|
-
badge: {
|
|
2204
|
-
display: 'flex',
|
|
2205
|
-
flexDirection: 'column',
|
|
2206
|
-
alignItems: 'center',
|
|
2207
|
-
margin: '10px',
|
|
2208
|
-
},
|
|
2209
|
-
badgeIcon: {
|
|
2210
|
-
width: '50px',
|
|
2211
|
-
height: '50px',
|
|
2212
|
-
marginBottom: '5px',
|
|
2213
|
-
},
|
|
2214
|
-
badgeTitle: {
|
|
2215
|
-
fontSize: '14px',
|
|
2216
|
-
textAlign: 'center',
|
|
2217
|
-
},
|
|
2218
|
-
button: {
|
|
2219
|
-
backgroundColor: '#007bff',
|
|
2220
|
-
color: '#ffffff',
|
|
2221
|
-
padding: '10px 20px',
|
|
2222
|
-
borderRadius: '4px',
|
|
2223
|
-
border: 'none',
|
|
2224
|
-
cursor: 'pointer',
|
|
2225
|
-
marginTop: '20px',
|
|
2226
|
-
},
|
|
2227
|
-
},
|
|
2228
|
-
badgesButton: {
|
|
2229
|
-
position: 'fixed',
|
|
2230
|
-
padding: '10px 20px',
|
|
2231
|
-
backgroundColor: '#007bff',
|
|
2232
|
-
color: '#ffffff',
|
|
2233
|
-
border: 'none',
|
|
2234
|
-
borderRadius: '4px',
|
|
2235
|
-
cursor: 'pointer',
|
|
2236
|
-
zIndex: 1000,
|
|
2237
|
-
},
|
|
2238
|
-
};
|
|
2239
|
-
|
|
2240
|
-
const AchievementContext = React.createContext(undefined);
|
|
2241
|
-
const useAchievementContext = () => {
|
|
2242
|
-
const context = React.useContext(AchievementContext);
|
|
2243
|
-
if (!context) {
|
|
2244
|
-
throw new Error('useAchievementContext must be used within an AchievementProvider');
|
|
2245
|
-
}
|
|
2246
|
-
return context;
|
|
2247
|
-
};
|
|
2248
|
-
const AchievementProvider = ({ children, config, initialState = {}, storageKey = 'react-achievements', badgesButtonPosition = 'top-right', styles = {}, icons = {}, }) => {
|
|
2249
|
-
const dispatch = useDispatch();
|
|
2250
|
-
const metrics = useSelector((state) => state.achievements.metrics);
|
|
2251
|
-
const unlockedAchievementIds = useSelector((state) => state.achievements.unlockedAchievements);
|
|
2252
|
-
const previouslyAwardedAchievements = useSelector((state) => state.achievements.previouslyAwardedAchievements);
|
|
2253
|
-
const notifications = useSelector((state) => state.notifications.notifications);
|
|
2254
|
-
const [showBadges, setShowBadges] = React.useState(false);
|
|
2255
|
-
const [showConfetti, setShowConfetti] = React.useState(false);
|
|
2256
|
-
const serializeConfig = (config) => {
|
|
2257
|
-
const serializedConfig = {};
|
|
2258
|
-
Object.entries(config).forEach(([metricName, conditions]) => {
|
|
2259
|
-
serializedConfig[metricName] = conditions.map((condition) => {
|
|
2260
|
-
// Analyze the isConditionMet function to determine type and value
|
|
2261
|
-
const funcString = condition.isConditionMet.toString();
|
|
2262
|
-
let conditionType;
|
|
2263
|
-
let conditionValue;
|
|
2264
|
-
if (funcString.includes('typeof value === "number"') || funcString.includes('typeof value === \'number\'')) {
|
|
2265
|
-
conditionType = 'number';
|
|
2266
|
-
const matches = funcString.match(/value\s*>=?\s*(\d+)/);
|
|
2267
|
-
conditionValue = matches ? parseInt(matches[1]) : 0;
|
|
2268
|
-
}
|
|
2269
|
-
else if (funcString.includes('typeof value === "string"') || funcString.includes('typeof value === \'string\'')) {
|
|
2270
|
-
conditionType = 'string';
|
|
2271
|
-
const matches = funcString.match(/value\s*===?\s*['"](.+)['"]/);
|
|
2272
|
-
conditionValue = matches ? matches[1] : '';
|
|
2273
|
-
}
|
|
2274
|
-
else if (funcString.includes('typeof value === "boolean"') || funcString.includes('typeof value === \'boolean\'')) {
|
|
2275
|
-
conditionType = 'boolean';
|
|
2276
|
-
conditionValue = funcString.includes('=== true');
|
|
2277
|
-
}
|
|
2278
|
-
else if (funcString.includes('instanceof Date')) {
|
|
2279
|
-
conditionType = 'date';
|
|
2280
|
-
const matches = funcString.match(/new Date\(['"](.+)['"]\)/);
|
|
2281
|
-
conditionValue = matches ? matches[1] : new Date().toISOString();
|
|
2282
|
-
}
|
|
2283
|
-
else {
|
|
2284
|
-
// Default to number type if we can't determine the type
|
|
2285
|
-
conditionType = 'number';
|
|
2286
|
-
conditionValue = 1;
|
|
2287
|
-
}
|
|
2288
|
-
return {
|
|
2289
|
-
achievementDetails: condition.achievementDetails,
|
|
2290
|
-
conditionType,
|
|
2291
|
-
conditionValue,
|
|
2292
|
-
};
|
|
2293
|
-
});
|
|
2294
|
-
});
|
|
2295
|
-
return serializedConfig;
|
|
2296
|
-
};
|
|
2297
|
-
const serializedConfig = React.useMemo(() => serializeConfig(config), [config]);
|
|
2298
|
-
const checkAchievements = React.useCallback(() => {
|
|
2299
|
-
const newAchievements = [];
|
|
2300
|
-
Object.entries(serializedConfig).forEach(([metricName, conditions]) => {
|
|
2301
|
-
const metricValues = metrics[metricName];
|
|
2302
|
-
if (!metricValues)
|
|
2303
|
-
return;
|
|
2304
|
-
conditions.forEach((condition) => {
|
|
2305
|
-
const isConditionMet = (value) => {
|
|
2306
|
-
switch (condition.conditionType) {
|
|
2307
|
-
case 'number':
|
|
2308
|
-
return typeof value === 'number' && value >= condition.conditionValue;
|
|
2309
|
-
case 'string':
|
|
2310
|
-
return typeof value === 'string' && value === condition.conditionValue;
|
|
2311
|
-
case 'boolean':
|
|
2312
|
-
return typeof value === 'boolean' && value === condition.conditionValue;
|
|
2313
|
-
case 'date':
|
|
2314
|
-
return value instanceof Date &&
|
|
2315
|
-
value.getTime() >= new Date(condition.conditionValue).getTime();
|
|
2316
|
-
default:
|
|
2317
|
-
return false;
|
|
2318
|
-
}
|
|
2319
|
-
};
|
|
2320
|
-
// Only check the most recent value and ensure achievement hasn't been awarded
|
|
2321
|
-
const latestValue = metricValues[metricValues.length - 1];
|
|
2322
|
-
if (isConditionMet(latestValue) &&
|
|
2323
|
-
!previouslyAwardedAchievements.includes(condition.achievementDetails.achievementId)) {
|
|
2324
|
-
newAchievements.push(condition.achievementDetails);
|
|
2325
|
-
}
|
|
2326
|
-
});
|
|
2327
|
-
});
|
|
2328
|
-
if (newAchievements.length > 0) {
|
|
2329
|
-
newAchievements.forEach((achievement) => {
|
|
2330
|
-
dispatch(markAchievementAsAwarded(achievement.achievementId));
|
|
2331
|
-
dispatch(addNotification(achievement));
|
|
2332
|
-
// Show toast notification
|
|
2333
|
-
y.success(React.createElement("div", null,
|
|
2334
|
-
React.createElement("h4", { style: { margin: '0 0 8px 0' } }, "Achievement Unlocked! \uD83C\uDF89"),
|
|
2335
|
-
React.createElement("strong", null, achievement.achievementTitle),
|
|
2336
|
-
React.createElement("p", { style: { margin: '4px 0 0 0' } }, achievement.achievementDescription),
|
|
2337
|
-
achievement.achievementIconKey && icons[achievement.achievementIconKey] && (React.createElement("div", { style: { fontSize: '24px', marginTop: '8px' } }, icons[achievement.achievementIconKey]))), {
|
|
2338
|
-
position: "top-right",
|
|
2339
|
-
autoClose: 5000,
|
|
2340
|
-
hideProgressBar: false,
|
|
2341
|
-
closeOnClick: true,
|
|
2342
|
-
pauseOnHover: true,
|
|
2343
|
-
draggable: true,
|
|
2344
|
-
progress: undefined,
|
|
2345
|
-
});
|
|
2346
|
-
});
|
|
2347
|
-
setShowConfetti(true);
|
|
2348
|
-
setTimeout(() => setShowConfetti(false), 5000);
|
|
2349
|
-
}
|
|
2350
|
-
}, [serializedConfig, metrics, previouslyAwardedAchievements, dispatch, icons]);
|
|
2351
|
-
React.useEffect(() => {
|
|
2352
|
-
checkAchievements();
|
|
2353
|
-
}, [metrics, checkAchievements]);
|
|
2354
|
-
React.useEffect(() => {
|
|
2355
|
-
if (notifications.length > 0) {
|
|
2356
|
-
const notification = notifications[0];
|
|
2357
|
-
y.info(React.createElement("div", null,
|
|
2358
|
-
React.createElement("strong", null, notification.achievementTitle),
|
|
2359
|
-
React.createElement("p", null, notification.achievementDescription)), {
|
|
2360
|
-
position: "top-right",
|
|
2361
|
-
autoClose: 5000,
|
|
2362
|
-
hideProgressBar: false,
|
|
2363
|
-
closeOnClick: true,
|
|
2364
|
-
pauseOnHover: true,
|
|
2365
|
-
draggable: true,
|
|
2366
|
-
progress: undefined,
|
|
2367
|
-
});
|
|
2368
|
-
dispatch(clearNotifications());
|
|
2369
|
-
}
|
|
2370
|
-
}, [notifications, dispatch]);
|
|
2371
|
-
React.useEffect(() => {
|
|
2372
|
-
dispatch(initialize({
|
|
2373
|
-
config: serializedConfig,
|
|
2374
|
-
initialState,
|
|
2375
|
-
storageKey,
|
|
2376
|
-
}));
|
|
2377
|
-
}, [dispatch, serializedConfig, initialState, storageKey]);
|
|
2378
|
-
// Create a memoized array of unique achievements
|
|
2379
|
-
const uniqueAchievements = React.useMemo(() => {
|
|
2380
|
-
const allAchievements = [...unlockedAchievementIds, ...previouslyAwardedAchievements];
|
|
2381
|
-
return [...new Set(allAchievements)]
|
|
2382
|
-
.map(id => {
|
|
2383
|
-
const achievement = Object.values(serializedConfig)
|
|
2384
|
-
.flat()
|
|
2385
|
-
.find(condition => condition.achievementDetails.achievementId === id);
|
|
2386
|
-
return achievement === null || achievement === void 0 ? void 0 : achievement.achievementDetails;
|
|
2387
|
-
})
|
|
2388
|
-
.filter((a) => !!a);
|
|
2389
|
-
}, [unlockedAchievementIds, previouslyAwardedAchievements, serializedConfig]);
|
|
2390
|
-
return (React.createElement(AchievementContext.Provider, { value: {
|
|
2391
|
-
updateMetrics: (newMetrics) => {
|
|
2392
|
-
if (typeof newMetrics === 'function') {
|
|
2393
|
-
const currentMetrics = metrics;
|
|
2394
|
-
const updatedMetrics = newMetrics(currentMetrics);
|
|
2395
|
-
dispatch(setMetrics(updatedMetrics));
|
|
2396
|
-
}
|
|
2397
|
-
else {
|
|
2398
|
-
dispatch(setMetrics(newMetrics));
|
|
2399
|
-
}
|
|
2400
|
-
},
|
|
2401
|
-
unlockedAchievements: unlockedAchievementIds,
|
|
2402
|
-
resetStorage: () => {
|
|
2403
|
-
localStorage.removeItem(storageKey);
|
|
2404
|
-
dispatch(resetAchievements());
|
|
2405
|
-
},
|
|
2406
|
-
} },
|
|
2407
|
-
children,
|
|
2408
|
-
React.createElement(Lt, null),
|
|
2409
|
-
React.createElement(ConfettiWrapper, { show: showConfetti }),
|
|
2410
|
-
React.createElement(BadgesButton$1, { onClick: () => setShowBadges(true), position: badgesButtonPosition, styles: styles.badgesButton || defaultStyles.badgesButton, unlockedAchievements: uniqueAchievements }),
|
|
2411
|
-
React.createElement(BadgesModal$1, { isOpen: showBadges, achievements: uniqueAchievements, onClose: () => setShowBadges(false), styles: styles.badgesModal || defaultStyles.badgesModal, icons: icons })));
|
|
2412
|
-
};
|
|
2413
|
-
|
|
2414
|
-
const useAchievementState = () => {
|
|
2415
|
-
const metrics = useSelector((state) => state.achievements.metrics);
|
|
2416
|
-
const previouslyAwardedAchievements = useSelector((state) => state.achievements.previouslyAwardedAchievements);
|
|
2417
|
-
return {
|
|
2418
|
-
metrics,
|
|
2419
|
-
previouslyAwardedAchievements,
|
|
2420
|
-
};
|
|
2421
|
-
};
|
|
2422
|
-
|
|
2423
|
-
exports.AchievementProvider = AchievementProvider;
|
|
2424
|
-
exports.ConfettiWrapper = ConfettiWrapper;
|
|
2425
|
-
exports.achievementReducer = achievementSlice$1;
|
|
2426
|
-
exports.notificationReducer = notificationSlice$1;
|
|
2427
|
-
exports.useAchievement = useAchievementContext;
|
|
2428
|
-
exports.useAchievementState = useAchievementState;
|