@opengeoweb/shared 6.0.4 → 6.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.esm.js +1953 -75
- package/package.json +5 -3
- package/src/lib/utils/dateUtils/dateUtils.d.ts +23 -1
- package/src/lib/utils/index.d.ts +1 -0
- package/src/lib/utils/reduxTestUtils/createMockStoreWithEggs.d.ts +21 -0
- package/src/lib/utils/reduxTestUtils/createMockStoreWithEggs.spec.d.ts +1 -0
- package/src/lib/utils/reduxTestUtils/index.d.ts +1 -0
package/index.esm.js
CHANGED
|
@@ -3,7 +3,7 @@ import React__default, { useRef, useContext } from 'react';
|
|
|
3
3
|
import { Box, Typography, Tooltip, IconButton, Dialog, DialogTitle, DialogContent, DialogActions, Button, CircularProgress, Alert, AlertTitle, useTheme, Drawer, Link, Avatar as Avatar$1, Paper, ClickAwayListener, MenuList, MenuItem, Grid, RadioGroup, FormControlLabel, Radio, List, ListItem, Tabs, Tab, Backdrop, Slider, ToggleButton, Menu, ListSubheader, ListItemIcon, Select, Accordion, AccordionSummary, AccordionDetails } from '@mui/material';
|
|
4
4
|
import { Close, Exclamation, Success, Info, ChevronRight, GeoWebLogo, HamburgerMenu, Resize, useThemeContext, DragHandle, ArrowLeft, ArrowRight, KeyOption, ArrowUp, ArrowDown, KeyCommand, Options, ChevronDown } from '@opengeoweb/theme';
|
|
5
5
|
import require$$2, { flushSync } from 'react-dom';
|
|
6
|
-
import { parseISO, parse, format, isEqual, add as add$1, sub as sub$1, differenceInMinutes as differenceInMinutes$1, differenceInHours as differenceInHours$1, isBefore as isBefore$1, isAfter as isAfter$1, isValid as isValid$1 } from 'date-fns';
|
|
6
|
+
import { parseISO, parse, format, isEqual, add as add$1, sub as sub$1, differenceInMinutes as differenceInMinutes$1, differenceInHours as differenceInHours$1, isBefore as isBefore$1, isAfter as isAfter$1, isValid as isValid$1, getUnixTime, set as set$1 } from 'date-fns';
|
|
7
7
|
|
|
8
8
|
/******************************************************************************
|
|
9
9
|
Copyright (c) Microsoft Corporation.
|
|
@@ -124,7 +124,7 @@ function _defineProperties$1(target, props) {
|
|
|
124
124
|
descriptor.enumerable = descriptor.enumerable || false;
|
|
125
125
|
descriptor.configurable = true;
|
|
126
126
|
if ("value" in descriptor) descriptor.writable = true;
|
|
127
|
-
Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor);
|
|
127
|
+
Object.defineProperty(target, _toPropertyKey$1(descriptor.key), descriptor);
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
130
|
function _createClass$1(Constructor, protoProps, staticProps) {
|
|
@@ -135,8 +135,8 @@ function _createClass$1(Constructor, protoProps, staticProps) {
|
|
|
135
135
|
});
|
|
136
136
|
return Constructor;
|
|
137
137
|
}
|
|
138
|
-
function _defineProperty$
|
|
139
|
-
key = _toPropertyKey(key);
|
|
138
|
+
function _defineProperty$3(obj, key, value) {
|
|
139
|
+
key = _toPropertyKey$1(key);
|
|
140
140
|
if (key in obj) {
|
|
141
141
|
Object.defineProperty(obj, key, {
|
|
142
142
|
value: value,
|
|
@@ -223,7 +223,7 @@ function _slicedToArray$1(arr, i) {
|
|
|
223
223
|
function _toArray(arr) {
|
|
224
224
|
return _arrayWithHoles$1(arr) || _iterableToArray(arr) || _unsupportedIterableToArray$1(arr) || _nonIterableRest$1();
|
|
225
225
|
}
|
|
226
|
-
function _toConsumableArray(arr) {
|
|
226
|
+
function _toConsumableArray$1(arr) {
|
|
227
227
|
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray$1(arr) || _nonIterableSpread();
|
|
228
228
|
}
|
|
229
229
|
function _arrayWithoutHoles(arr) {
|
|
@@ -254,7 +254,7 @@ function _nonIterableSpread() {
|
|
|
254
254
|
function _nonIterableRest$1() {
|
|
255
255
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
256
256
|
}
|
|
257
|
-
function _toPrimitive(input, hint) {
|
|
257
|
+
function _toPrimitive$1(input, hint) {
|
|
258
258
|
if (typeof input !== "object" || input === null) return input;
|
|
259
259
|
var prim = input[Symbol.toPrimitive];
|
|
260
260
|
if (prim !== undefined) {
|
|
@@ -264,8 +264,8 @@ function _toPrimitive(input, hint) {
|
|
|
264
264
|
}
|
|
265
265
|
return (hint === "string" ? String : Number)(input);
|
|
266
266
|
}
|
|
267
|
-
function _toPropertyKey(arg) {
|
|
268
|
-
var key = _toPrimitive(arg, "string");
|
|
267
|
+
function _toPropertyKey$1(arg) {
|
|
268
|
+
var key = _toPrimitive$1(arg, "string");
|
|
269
269
|
return typeof key === "symbol" ? key : String(key);
|
|
270
270
|
}
|
|
271
271
|
|
|
@@ -316,7 +316,7 @@ var CustomIconButton = /*#__PURE__*/React$1.forwardRef(function (_a, ref) {
|
|
|
316
316
|
className = _a.className,
|
|
317
317
|
defaultTooltipProps = _a.tooltipProps,
|
|
318
318
|
props = __rest(_a, ["tooltipTitle", "variant", "isSelected", "shouldShowAsDisabled", "size", "children", "className", "tooltipProps"]);
|
|
319
|
-
var classNames = [].concat(_toConsumableArray(className ? [className] : []), _toConsumableArray(isSelected ? ['Mui-selected'] : []), [variant]).join(' ');
|
|
319
|
+
var classNames = [].concat(_toConsumableArray$1(className ? [className] : []), _toConsumableArray$1(isSelected ? ['Mui-selected'] : []), [variant]).join(' ');
|
|
320
320
|
var tooltipTitle = (defaultTooltipProps === null || defaultTooltipProps === void 0 ? void 0 : defaultTooltipProps.title) || defaultTooltipTitle;
|
|
321
321
|
var tooltipProps = Object.assign(Object.assign({}, defaultTooltipProps), {
|
|
322
322
|
title: tooltipTitle,
|
|
@@ -18220,9 +18220,9 @@ var AppHeader = function AppHeader(_ref) {
|
|
|
18220
18220
|
zIndex: 1000,
|
|
18221
18221
|
display: 'flex',
|
|
18222
18222
|
padding: '0 16px'
|
|
18223
|
-
}, _defineProperty$
|
|
18223
|
+
}, _defineProperty$3(_sx, theme.breakpoints.up('md'), {
|
|
18224
18224
|
padding: '0 24px'
|
|
18225
|
-
}), _defineProperty$
|
|
18225
|
+
}), _defineProperty$3(_sx, theme.breakpoints.up('sm'), {
|
|
18226
18226
|
'.workspace-topbar': {
|
|
18227
18227
|
marginLeft: 3,
|
|
18228
18228
|
maxWidth: 260
|
|
@@ -18337,12 +18337,12 @@ var reactIs_production_min$2 = {};
|
|
|
18337
18337
|
* This source code is licensed under the MIT license found in the
|
|
18338
18338
|
* LICENSE file in the root directory of this source tree.
|
|
18339
18339
|
*/
|
|
18340
|
-
var b$
|
|
18341
|
-
Symbol.for("react.suspense_list"):60120,r$
|
|
18342
|
-
function z$
|
|
18343
|
-
reactIs_production_min$2.Profiler=g$
|
|
18344
|
-
reactIs_production_min$2.isMemo=function(a){return z$
|
|
18345
|
-
reactIs_production_min$2.isValidElementType=function(a){return "string"===typeof a||"function"===typeof a||a===e$3||a===m$
|
|
18340
|
+
var b$3="function"===typeof Symbol&&Symbol.for,c$3=b$3?Symbol.for("react.element"):60103,d$3=b$3?Symbol.for("react.portal"):60106,e$3=b$3?Symbol.for("react.fragment"):60107,f$3=b$3?Symbol.for("react.strict_mode"):60108,g$3=b$3?Symbol.for("react.profiler"):60114,h$5=b$3?Symbol.for("react.provider"):60109,k$4=b$3?Symbol.for("react.context"):60110,l$4=b$3?Symbol.for("react.async_mode"):60111,m$4=b$3?Symbol.for("react.concurrent_mode"):60111,n$5=b$3?Symbol.for("react.forward_ref"):60112,p$5=b$3?Symbol.for("react.suspense"):60113,q$5=b$3?
|
|
18341
|
+
Symbol.for("react.suspense_list"):60120,r$5=b$3?Symbol.for("react.memo"):60115,t$5=b$3?Symbol.for("react.lazy"):60116,v$4=b$3?Symbol.for("react.block"):60121,w$3=b$3?Symbol.for("react.fundamental"):60117,x$2=b$3?Symbol.for("react.responder"):60118,y$2=b$3?Symbol.for("react.scope"):60119;
|
|
18342
|
+
function z$2(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c$3:switch(a=a.type,a){case l$4:case m$4:case e$3:case g$3:case f$3:case p$5:return a;default:switch(a=a&&a.$$typeof,a){case k$4:case n$5:case t$5:case r$5:case h$5:return a;default:return u}}case d$3:return u}}}function A$2(a){return z$2(a)===m$4}reactIs_production_min$2.AsyncMode=l$4;reactIs_production_min$2.ConcurrentMode=m$4;reactIs_production_min$2.ContextConsumer=k$4;reactIs_production_min$2.ContextProvider=h$5;reactIs_production_min$2.Element=c$3;reactIs_production_min$2.ForwardRef=n$5;reactIs_production_min$2.Fragment=e$3;reactIs_production_min$2.Lazy=t$5;reactIs_production_min$2.Memo=r$5;reactIs_production_min$2.Portal=d$3;
|
|
18343
|
+
reactIs_production_min$2.Profiler=g$3;reactIs_production_min$2.StrictMode=f$3;reactIs_production_min$2.Suspense=p$5;reactIs_production_min$2.isAsyncMode=function(a){return A$2(a)||z$2(a)===l$4};reactIs_production_min$2.isConcurrentMode=A$2;reactIs_production_min$2.isContextConsumer=function(a){return z$2(a)===k$4};reactIs_production_min$2.isContextProvider=function(a){return z$2(a)===h$5};reactIs_production_min$2.isElement=function(a){return "object"===typeof a&&null!==a&&a.$$typeof===c$3};reactIs_production_min$2.isForwardRef=function(a){return z$2(a)===n$5};reactIs_production_min$2.isFragment=function(a){return z$2(a)===e$3};reactIs_production_min$2.isLazy=function(a){return z$2(a)===t$5};
|
|
18344
|
+
reactIs_production_min$2.isMemo=function(a){return z$2(a)===r$5};reactIs_production_min$2.isPortal=function(a){return z$2(a)===d$3};reactIs_production_min$2.isProfiler=function(a){return z$2(a)===g$3};reactIs_production_min$2.isStrictMode=function(a){return z$2(a)===f$3};reactIs_production_min$2.isSuspense=function(a){return z$2(a)===p$5};
|
|
18345
|
+
reactIs_production_min$2.isValidElementType=function(a){return "string"===typeof a||"function"===typeof a||a===e$3||a===m$4||a===g$3||a===f$3||a===p$5||a===q$5||"object"===typeof a&&null!==a&&(a.$$typeof===t$5||a.$$typeof===r$5||a.$$typeof===h$5||a.$$typeof===k$4||a.$$typeof===n$5||a.$$typeof===w$3||a.$$typeof===x$2||a.$$typeof===y$2||a.$$typeof===v$4)};reactIs_production_min$2.typeOf=z$2;
|
|
18346
18346
|
|
|
18347
18347
|
var reactIs_development$2 = {};
|
|
18348
18348
|
|
|
@@ -18538,7 +18538,7 @@ object-assign
|
|
|
18538
18538
|
*/
|
|
18539
18539
|
/* eslint-disable no-unused-vars */
|
|
18540
18540
|
var getOwnPropertySymbols = Object.getOwnPropertySymbols;
|
|
18541
|
-
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
18541
|
+
var hasOwnProperty$1 = Object.prototype.hasOwnProperty;
|
|
18542
18542
|
var propIsEnumerable = Object.prototype.propertyIsEnumerable;
|
|
18543
18543
|
|
|
18544
18544
|
function toObject(val) {
|
|
@@ -18602,7 +18602,7 @@ var objectAssign = shouldUseNative() ? Object.assign : function (target, source)
|
|
|
18602
18602
|
from = Object(arguments[s]);
|
|
18603
18603
|
|
|
18604
18604
|
for (var key in from) {
|
|
18605
|
-
if (hasOwnProperty.call(from, key)) {
|
|
18605
|
+
if (hasOwnProperty$1.call(from, key)) {
|
|
18606
18606
|
to[key] = from[key];
|
|
18607
18607
|
}
|
|
18608
18608
|
}
|
|
@@ -19426,7 +19426,7 @@ if (process.env.NODE_ENV !== 'production') {
|
|
|
19426
19426
|
propTypes.exports = factoryWithThrowingShims();
|
|
19427
19427
|
}
|
|
19428
19428
|
|
|
19429
|
-
function r$
|
|
19429
|
+
function r$4(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(f=r$4(e[t]))&&(n&&(n+=" "),n+=f);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function clsx(){for(var e,t,f=0,n="";f<arguments.length;)(e=arguments[f++])&&(t=r$4(e))&&(n&&(n+=" "),n+=t);return n}
|
|
19430
19430
|
|
|
19431
19431
|
var clsx_m = /*#__PURE__*/Object.freeze({
|
|
19432
19432
|
__proto__: null,
|
|
@@ -19446,7 +19446,7 @@ Object.defineProperty(shims, "__esModule", {
|
|
|
19446
19446
|
shims.dontSetMe = dontSetMe;
|
|
19447
19447
|
shims.findInArray = findInArray;
|
|
19448
19448
|
shims.int = int;
|
|
19449
|
-
shims.isFunction = isFunction;
|
|
19449
|
+
shims.isFunction = isFunction$1;
|
|
19450
19450
|
shims.isNum = isNum;
|
|
19451
19451
|
|
|
19452
19452
|
// @credits https://gist.github.com/rogozhnikoff/a43cfed27c41e4e68cdc
|
|
@@ -19462,7 +19462,7 @@ function findInArray(array
|
|
|
19462
19462
|
}
|
|
19463
19463
|
}
|
|
19464
19464
|
|
|
19465
|
-
function isFunction(func
|
|
19465
|
+
function isFunction$1(func
|
|
19466
19466
|
/*: any*/
|
|
19467
19467
|
)
|
|
19468
19468
|
/*: boolean %checks*/
|
|
@@ -19581,13 +19581,13 @@ function kebabToTitleCase(str
|
|
|
19581
19581
|
// can handle unprefixed `transform`, but not unprefixed `user-select`
|
|
19582
19582
|
|
|
19583
19583
|
|
|
19584
|
-
var _default = (getPrefix()
|
|
19584
|
+
var _default$1 = (getPrefix()
|
|
19585
19585
|
/*: string*/
|
|
19586
19586
|
);
|
|
19587
19587
|
|
|
19588
|
-
getPrefix$1.default = _default;
|
|
19588
|
+
getPrefix$1.default = _default$1;
|
|
19589
19589
|
|
|
19590
|
-
function _typeof$
|
|
19590
|
+
function _typeof$2(obj) { "@babel/helpers - typeof"; return _typeof$2 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof$2(obj); }
|
|
19591
19591
|
|
|
19592
19592
|
Object.defineProperty(domFns, "__esModule", {
|
|
19593
19593
|
value: true
|
|
@@ -19617,13 +19617,13 @@ var _getPrefix = _interopRequireWildcard$1(getPrefix$1);
|
|
|
19617
19617
|
|
|
19618
19618
|
function _getRequireWildcardCache$1(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache$1 = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
19619
19619
|
|
|
19620
|
-
function _interopRequireWildcard$1(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof$
|
|
19620
|
+
function _interopRequireWildcard$1(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof$2(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache$1(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
19621
19621
|
|
|
19622
|
-
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
19622
|
+
function ownKeys$1(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
19623
19623
|
|
|
19624
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty$
|
|
19624
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$1(Object(source), !0).forEach(function (key) { _defineProperty$2(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$1(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
19625
19625
|
|
|
19626
|
-
function _defineProperty$
|
|
19626
|
+
function _defineProperty$2(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
19627
19627
|
|
|
19628
19628
|
var matchesSelectorFunc = '';
|
|
19629
19629
|
|
|
@@ -19812,7 +19812,7 @@ function createCSSTransform(controlPos
|
|
|
19812
19812
|
/*: Object*/
|
|
19813
19813
|
{
|
|
19814
19814
|
var translation = getTranslation(controlPos, positionOffset, 'px');
|
|
19815
|
-
return _defineProperty$
|
|
19815
|
+
return _defineProperty$2({}, (0, _getPrefix.browserPrefixToKey)('transform', _getPrefix.default), translation);
|
|
19816
19816
|
}
|
|
19817
19817
|
|
|
19818
19818
|
function createSVGTransform(controlPos
|
|
@@ -20163,7 +20163,7 @@ log$1.default = log;
|
|
|
20163
20163
|
function log() {
|
|
20164
20164
|
}
|
|
20165
20165
|
|
|
20166
|
-
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
20166
|
+
function _typeof$1(obj) { "@babel/helpers - typeof"; return _typeof$1 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof$1(obj); }
|
|
20167
20167
|
|
|
20168
20168
|
Object.defineProperty(DraggableCore$2, "__esModule", {
|
|
20169
20169
|
value: true
|
|
@@ -20172,9 +20172,9 @@ DraggableCore$2.default = void 0;
|
|
|
20172
20172
|
|
|
20173
20173
|
var React = _interopRequireWildcard(React__default);
|
|
20174
20174
|
|
|
20175
|
-
var _propTypes = _interopRequireDefault(propTypes.exports);
|
|
20175
|
+
var _propTypes = _interopRequireDefault$1(propTypes.exports);
|
|
20176
20176
|
|
|
20177
|
-
var _reactDom = _interopRequireDefault(require$$2);
|
|
20177
|
+
var _reactDom = _interopRequireDefault$1(require$$2);
|
|
20178
20178
|
|
|
20179
20179
|
var _domFns = domFns;
|
|
20180
20180
|
|
|
@@ -20182,13 +20182,13 @@ var _positionFns = positionFns;
|
|
|
20182
20182
|
|
|
20183
20183
|
var _shims = shims;
|
|
20184
20184
|
|
|
20185
|
-
var _log = _interopRequireDefault(log$1);
|
|
20185
|
+
var _log = _interopRequireDefault$1(log$1);
|
|
20186
20186
|
|
|
20187
|
-
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
20187
|
+
function _interopRequireDefault$1(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
20188
20188
|
|
|
20189
20189
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
20190
20190
|
|
|
20191
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
20191
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof$1(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
20192
20192
|
|
|
20193
20193
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
20194
20194
|
|
|
@@ -20214,7 +20214,7 @@ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || func
|
|
|
20214
20214
|
|
|
20215
20215
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
20216
20216
|
|
|
20217
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
20217
|
+
function _possibleConstructorReturn(self, call) { if (call && (_typeof$1(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); }
|
|
20218
20218
|
|
|
20219
20219
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
20220
20220
|
|
|
@@ -20222,7 +20222,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
20222
20222
|
|
|
20223
20223
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
20224
20224
|
|
|
20225
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
20225
|
+
function _defineProperty$1(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
20226
20226
|
|
|
20227
20227
|
// Simple abstraction for dragging events names.
|
|
20228
20228
|
var eventsFor = {
|
|
@@ -20302,7 +20302,7 @@ var DraggableCore$1 = /*#__PURE__*/function (_React$Component) {
|
|
|
20302
20302
|
|
|
20303
20303
|
_this = _super.call.apply(_super, [this].concat(args));
|
|
20304
20304
|
|
|
20305
|
-
_defineProperty(_assertThisInitialized(_this), "state", {
|
|
20305
|
+
_defineProperty$1(_assertThisInitialized(_this), "state", {
|
|
20306
20306
|
dragging: false,
|
|
20307
20307
|
// Used while dragging to determine deltas.
|
|
20308
20308
|
lastX: NaN,
|
|
@@ -20310,9 +20310,9 @@ var DraggableCore$1 = /*#__PURE__*/function (_React$Component) {
|
|
|
20310
20310
|
touchIdentifier: null
|
|
20311
20311
|
});
|
|
20312
20312
|
|
|
20313
|
-
_defineProperty(_assertThisInitialized(_this), "mounted", false);
|
|
20313
|
+
_defineProperty$1(_assertThisInitialized(_this), "mounted", false);
|
|
20314
20314
|
|
|
20315
|
-
_defineProperty(_assertThisInitialized(_this), "handleDragStart", function (e) {
|
|
20315
|
+
_defineProperty$1(_assertThisInitialized(_this), "handleDragStart", function (e) {
|
|
20316
20316
|
// Make it possible to attach event handlers on top of this one.
|
|
20317
20317
|
_this.props.onMouseDown(e); // Only accept left-clicks.
|
|
20318
20318
|
|
|
@@ -20377,7 +20377,7 @@ var DraggableCore$1 = /*#__PURE__*/function (_React$Component) {
|
|
|
20377
20377
|
(0, _domFns.addEvent)(ownerDocument, dragEventFor.stop, _this.handleDragStop);
|
|
20378
20378
|
});
|
|
20379
20379
|
|
|
20380
|
-
_defineProperty(_assertThisInitialized(_this), "handleDrag", function (e) {
|
|
20380
|
+
_defineProperty$1(_assertThisInitialized(_this), "handleDrag", function (e) {
|
|
20381
20381
|
// Get the current drag point from the event. This is used as the offset.
|
|
20382
20382
|
var position = (0, _positionFns.getControlPosition)(e, _this.state.touchIdentifier, _assertThisInitialized(_this));
|
|
20383
20383
|
if (position == null) return;
|
|
@@ -20431,7 +20431,7 @@ var DraggableCore$1 = /*#__PURE__*/function (_React$Component) {
|
|
|
20431
20431
|
});
|
|
20432
20432
|
});
|
|
20433
20433
|
|
|
20434
|
-
_defineProperty(_assertThisInitialized(_this), "handleDragStop", function (e) {
|
|
20434
|
+
_defineProperty$1(_assertThisInitialized(_this), "handleDragStop", function (e) {
|
|
20435
20435
|
if (!_this.state.dragging) return;
|
|
20436
20436
|
var position = (0, _positionFns.getControlPosition)(e, _this.state.touchIdentifier, _assertThisInitialized(_this));
|
|
20437
20437
|
if (position == null) return;
|
|
@@ -20480,24 +20480,24 @@ var DraggableCore$1 = /*#__PURE__*/function (_React$Component) {
|
|
|
20480
20480
|
}
|
|
20481
20481
|
});
|
|
20482
20482
|
|
|
20483
|
-
_defineProperty(_assertThisInitialized(_this), "onMouseDown", function (e) {
|
|
20483
|
+
_defineProperty$1(_assertThisInitialized(_this), "onMouseDown", function (e) {
|
|
20484
20484
|
dragEventFor = eventsFor.mouse; // on touchscreen laptops we could switch back to mouse
|
|
20485
20485
|
|
|
20486
20486
|
return _this.handleDragStart(e);
|
|
20487
20487
|
});
|
|
20488
20488
|
|
|
20489
|
-
_defineProperty(_assertThisInitialized(_this), "onMouseUp", function (e) {
|
|
20489
|
+
_defineProperty$1(_assertThisInitialized(_this), "onMouseUp", function (e) {
|
|
20490
20490
|
dragEventFor = eventsFor.mouse;
|
|
20491
20491
|
return _this.handleDragStop(e);
|
|
20492
20492
|
});
|
|
20493
20493
|
|
|
20494
|
-
_defineProperty(_assertThisInitialized(_this), "onTouchStart", function (e) {
|
|
20494
|
+
_defineProperty$1(_assertThisInitialized(_this), "onTouchStart", function (e) {
|
|
20495
20495
|
// We're on a touch device now, so change the event handlers
|
|
20496
20496
|
dragEventFor = eventsFor.touch;
|
|
20497
20497
|
return _this.handleDragStart(e);
|
|
20498
20498
|
});
|
|
20499
20499
|
|
|
20500
|
-
_defineProperty(_assertThisInitialized(_this), "onTouchEnd", function (e) {
|
|
20500
|
+
_defineProperty$1(_assertThisInitialized(_this), "onTouchEnd", function (e) {
|
|
20501
20501
|
// We're on a touch device now, so change the event handlers
|
|
20502
20502
|
dragEventFor = eventsFor.touch;
|
|
20503
20503
|
return _this.handleDragStop(e);
|
|
@@ -20576,9 +20576,9 @@ var DraggableCore$1 = /*#__PURE__*/function (_React$Component) {
|
|
|
20576
20576
|
|
|
20577
20577
|
DraggableCore$2.default = DraggableCore$1;
|
|
20578
20578
|
|
|
20579
|
-
_defineProperty(DraggableCore$1, "displayName", 'DraggableCore');
|
|
20579
|
+
_defineProperty$1(DraggableCore$1, "displayName", 'DraggableCore');
|
|
20580
20580
|
|
|
20581
|
-
_defineProperty(DraggableCore$1, "propTypes", {
|
|
20581
|
+
_defineProperty$1(DraggableCore$1, "propTypes", {
|
|
20582
20582
|
/**
|
|
20583
20583
|
* `allowAnyClick` allows dragging using any mouse button.
|
|
20584
20584
|
* By default, we only accept the left button.
|
|
@@ -20719,7 +20719,7 @@ _defineProperty(DraggableCore$1, "propTypes", {
|
|
|
20719
20719
|
transform: _shims.dontSetMe
|
|
20720
20720
|
});
|
|
20721
20721
|
|
|
20722
|
-
_defineProperty(DraggableCore$1, "defaultProps", {
|
|
20722
|
+
_defineProperty$1(DraggableCore$1, "defaultProps", {
|
|
20723
20723
|
allowAnyClick: false,
|
|
20724
20724
|
// by default only accept left click
|
|
20725
20725
|
disabled: false,
|
|
@@ -21229,7 +21229,7 @@ var DraggableComponent$1 = function DraggableComponent(_a) {
|
|
|
21229
21229
|
}, props), children);
|
|
21230
21230
|
};
|
|
21231
21231
|
|
|
21232
|
-
var __extends$
|
|
21232
|
+
var __extends$2 = (undefined && undefined.__extends) || (function () {
|
|
21233
21233
|
var extendStatics = function (d, b) {
|
|
21234
21234
|
extendStatics = Object.setPrototypeOf ||
|
|
21235
21235
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
@@ -21283,7 +21283,7 @@ var styles$5 = {
|
|
|
21283
21283
|
topLeft: __assign$1(__assign$1({}, edgeBase), { left: '-10px', top: '-10px', cursor: 'nw-resize' }),
|
|
21284
21284
|
};
|
|
21285
21285
|
var Resizer = /** @class */ (function (_super) {
|
|
21286
|
-
__extends$
|
|
21286
|
+
__extends$2(Resizer, _super);
|
|
21287
21287
|
function Resizer() {
|
|
21288
21288
|
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
21289
21289
|
_this.onMouseDown = function (e) {
|
|
@@ -21300,7 +21300,7 @@ var Resizer = /** @class */ (function (_super) {
|
|
|
21300
21300
|
return Resizer;
|
|
21301
21301
|
}(React$1.PureComponent));
|
|
21302
21302
|
|
|
21303
|
-
var __extends = (undefined && undefined.__extends) || (function () {
|
|
21303
|
+
var __extends$1 = (undefined && undefined.__extends) || (function () {
|
|
21304
21304
|
var extendStatics = function (d, b) {
|
|
21305
21305
|
extendStatics = Object.setPrototypeOf ||
|
|
21306
21306
|
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
@@ -21438,7 +21438,7 @@ var definedProps = [
|
|
|
21438
21438
|
// HACK: This class is used to calculate % size.
|
|
21439
21439
|
var baseClassName = '__resizable_base__';
|
|
21440
21440
|
var Resizable = /** @class */ (function (_super) {
|
|
21441
|
-
__extends(Resizable, _super);
|
|
21441
|
+
__extends$1(Resizable, _super);
|
|
21442
21442
|
function Resizable(props) {
|
|
21443
21443
|
var _this = _super.call(this, props) || this;
|
|
21444
21444
|
_this.ratio = 1;
|
|
@@ -23887,8 +23887,8 @@ var useSyncExternalStoreShim_production_min = {};
|
|
|
23887
23887
|
* This source code is licensed under the MIT license found in the
|
|
23888
23888
|
* LICENSE file in the root directory of this source tree.
|
|
23889
23889
|
*/
|
|
23890
|
-
var e$2=React__default;function h$
|
|
23891
|
-
function r$
|
|
23890
|
+
var e$2=React__default;function h$4(a,b){return a===b&&(0!==a||1/a===1/b)||a!==a&&b!==b}var k$3="function"===typeof Object.is?Object.is:h$4,l$3=e$2.useState,m$3=e$2.useEffect,n$4=e$2.useLayoutEffect,p$4=e$2.useDebugValue;function q$4(a,b){var d=b(),f=l$3({inst:{value:d,getSnapshot:b}}),c=f[0].inst,g=f[1];n$4(function(){c.value=d;c.getSnapshot=b;r$3(c)&&g({inst:c});},[a,d,b]);m$3(function(){r$3(c)&&g({inst:c});return a(function(){r$3(c)&&g({inst:c});})},[a]);p$4(d);return d}
|
|
23891
|
+
function r$3(a){var b=a.getSnapshot;a=a.value;try{var d=b();return !k$3(a,d)}catch(f){return !0}}function t$4(a,b){return b()}var u$3="undefined"===typeof window||"undefined"===typeof window.document||"undefined"===typeof window.document.createElement?t$4:q$4;useSyncExternalStoreShim_production_min.useSyncExternalStore=void 0!==e$2.useSyncExternalStore?e$2.useSyncExternalStore:u$3;
|
|
23892
23892
|
|
|
23893
23893
|
var useSyncExternalStoreShim_development = {};
|
|
23894
23894
|
|
|
@@ -24145,9 +24145,9 @@ var withSelector_production_min = {};
|
|
|
24145
24145
|
* This source code is licensed under the MIT license found in the
|
|
24146
24146
|
* LICENSE file in the root directory of this source tree.
|
|
24147
24147
|
*/
|
|
24148
|
-
var h$
|
|
24149
|
-
withSelector_production_min.useSyncExternalStoreWithSelector=function(a,b,e,l,g){var c=t$
|
|
24150
|
-
u$
|
|
24148
|
+
var h$3=React__default,n$3=shim.exports;function p$3(a,b){return a===b&&(0!==a||1/a===1/b)||a!==a&&b!==b}var q$3="function"===typeof Object.is?Object.is:p$3,r$2=n$3.useSyncExternalStore,t$3=h$3.useRef,u$2=h$3.useEffect,v$3=h$3.useMemo,w$2=h$3.useDebugValue;
|
|
24149
|
+
withSelector_production_min.useSyncExternalStoreWithSelector=function(a,b,e,l,g){var c=t$3(null);if(null===c.current){var f={hasValue:!1,value:null};c.current=f;}else f=c.current;c=v$3(function(){function a(a){if(!c){c=!0;d=a;a=l(a);if(void 0!==g&&f.hasValue){var b=f.value;if(g(b,a))return k=b}return k=a}b=k;if(q$3(d,a))return b;var e=l(a);if(void 0!==g&&g(b,e))return b;d=a;return k=e}var c=!1,d,k,m=void 0===e?null:e;return [function(){return a(b())},null===m?void 0:function(){return a(m())}]},[b,e,l,g]);var d=r$2(a,c[0],c[1]);
|
|
24150
|
+
u$2(function(){f.hasValue=!0;f.value=d;},[d]);w$2(d);return d};
|
|
24151
24151
|
|
|
24152
24152
|
var withSelector_development = {};
|
|
24153
24153
|
|
|
@@ -24391,12 +24391,12 @@ var reactIs_production_min$1 = {};
|
|
|
24391
24391
|
* This source code is licensed under the MIT license found in the
|
|
24392
24392
|
* LICENSE file in the root directory of this source tree.
|
|
24393
24393
|
*/
|
|
24394
|
-
var b$
|
|
24395
|
-
Symbol.for("react.suspense_list"):60120,r=b$
|
|
24396
|
-
function z(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c$
|
|
24397
|
-
reactIs_production_min$1.Profiler=g$
|
|
24398
|
-
reactIs_production_min$1.isMemo=function(a){return z(a)===r};reactIs_production_min$1.isPortal=function(a){return z(a)===d$
|
|
24399
|
-
reactIs_production_min$1.isValidElementType=function(a){return "string"===typeof a||"function"===typeof a||a===e$1||a===m$
|
|
24394
|
+
var b$2="function"===typeof Symbol&&Symbol.for,c$2=b$2?Symbol.for("react.element"):60103,d$2=b$2?Symbol.for("react.portal"):60106,e$1=b$2?Symbol.for("react.fragment"):60107,f$2=b$2?Symbol.for("react.strict_mode"):60108,g$2=b$2?Symbol.for("react.profiler"):60114,h$2=b$2?Symbol.for("react.provider"):60109,k$2=b$2?Symbol.for("react.context"):60110,l$2=b$2?Symbol.for("react.async_mode"):60111,m$2=b$2?Symbol.for("react.concurrent_mode"):60111,n$2=b$2?Symbol.for("react.forward_ref"):60112,p$2=b$2?Symbol.for("react.suspense"):60113,q$2=b$2?
|
|
24395
|
+
Symbol.for("react.suspense_list"):60120,r$1=b$2?Symbol.for("react.memo"):60115,t$2=b$2?Symbol.for("react.lazy"):60116,v$2=b$2?Symbol.for("react.block"):60121,w$1=b$2?Symbol.for("react.fundamental"):60117,x$1=b$2?Symbol.for("react.responder"):60118,y$1=b$2?Symbol.for("react.scope"):60119;
|
|
24396
|
+
function z$1(a){if("object"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c$2:switch(a=a.type,a){case l$2:case m$2:case e$1:case g$2:case f$2:case p$2:return a;default:switch(a=a&&a.$$typeof,a){case k$2:case n$2:case t$2:case r$1:case h$2:return a;default:return u}}case d$2:return u}}}function A$1(a){return z$1(a)===m$2}reactIs_production_min$1.AsyncMode=l$2;reactIs_production_min$1.ConcurrentMode=m$2;reactIs_production_min$1.ContextConsumer=k$2;reactIs_production_min$1.ContextProvider=h$2;reactIs_production_min$1.Element=c$2;reactIs_production_min$1.ForwardRef=n$2;reactIs_production_min$1.Fragment=e$1;reactIs_production_min$1.Lazy=t$2;reactIs_production_min$1.Memo=r$1;reactIs_production_min$1.Portal=d$2;
|
|
24397
|
+
reactIs_production_min$1.Profiler=g$2;reactIs_production_min$1.StrictMode=f$2;reactIs_production_min$1.Suspense=p$2;reactIs_production_min$1.isAsyncMode=function(a){return A$1(a)||z$1(a)===l$2};reactIs_production_min$1.isConcurrentMode=A$1;reactIs_production_min$1.isContextConsumer=function(a){return z$1(a)===k$2};reactIs_production_min$1.isContextProvider=function(a){return z$1(a)===h$2};reactIs_production_min$1.isElement=function(a){return "object"===typeof a&&null!==a&&a.$$typeof===c$2};reactIs_production_min$1.isForwardRef=function(a){return z$1(a)===n$2};reactIs_production_min$1.isFragment=function(a){return z$1(a)===e$1};reactIs_production_min$1.isLazy=function(a){return z$1(a)===t$2};
|
|
24398
|
+
reactIs_production_min$1.isMemo=function(a){return z$1(a)===r$1};reactIs_production_min$1.isPortal=function(a){return z$1(a)===d$2};reactIs_production_min$1.isProfiler=function(a){return z$1(a)===g$2};reactIs_production_min$1.isStrictMode=function(a){return z$1(a)===f$2};reactIs_production_min$1.isSuspense=function(a){return z$1(a)===p$2};
|
|
24399
|
+
reactIs_production_min$1.isValidElementType=function(a){return "string"===typeof a||"function"===typeof a||a===e$1||a===m$2||a===g$2||a===f$2||a===p$2||a===q$2||"object"===typeof a&&null!==a&&(a.$$typeof===t$2||a.$$typeof===r$1||a.$$typeof===h$2||a.$$typeof===k$2||a.$$typeof===n$2||a.$$typeof===w$1||a.$$typeof===x$1||a.$$typeof===y$1||a.$$typeof===v$2)};reactIs_production_min$1.typeOf=z$1;
|
|
24400
24400
|
|
|
24401
24401
|
var reactIs_development$1 = {};
|
|
24402
24402
|
|
|
@@ -24616,11 +24616,11 @@ var reactIs_production_min = {};
|
|
|
24616
24616
|
* This source code is licensed under the MIT license found in the
|
|
24617
24617
|
* LICENSE file in the root directory of this source tree.
|
|
24618
24618
|
*/
|
|
24619
|
-
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");
|
|
24620
|
-
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;
|
|
24621
|
-
reactIs_production_min.SuspenseList=n;reactIs_production_min.isAsyncMode=function(){return !1};reactIs_production_min.isConcurrentMode=function(){return !1};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};
|
|
24622
|
-
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};
|
|
24623
|
-
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)?!0:!1};reactIs_production_min.typeOf=v;
|
|
24619
|
+
var b$1=Symbol.for("react.element"),c$1=Symbol.for("react.portal"),d$1=Symbol.for("react.fragment"),e=Symbol.for("react.strict_mode"),f$1=Symbol.for("react.profiler"),g$1=Symbol.for("react.provider"),h$1=Symbol.for("react.context"),k$1=Symbol.for("react.server_context"),l$1=Symbol.for("react.forward_ref"),m$1=Symbol.for("react.suspense"),n$1=Symbol.for("react.suspense_list"),p$1=Symbol.for("react.memo"),q$1=Symbol.for("react.lazy"),t$1=Symbol.for("react.offscreen"),u$1;u$1=Symbol.for("react.module.reference");
|
|
24620
|
+
function v$1(a){if("object"===typeof a&&null!==a){var r=a.$$typeof;switch(r){case b$1:switch(a=a.type,a){case d$1:case f$1:case e:case m$1:case n$1:return a;default:switch(a=a&&a.$$typeof,a){case k$1:case h$1:case l$1:case q$1:case p$1:case g$1:return a;default:return r}}case c$1:return r}}}reactIs_production_min.ContextConsumer=h$1;reactIs_production_min.ContextProvider=g$1;reactIs_production_min.Element=b$1;reactIs_production_min.ForwardRef=l$1;reactIs_production_min.Fragment=d$1;reactIs_production_min.Lazy=q$1;reactIs_production_min.Memo=p$1;reactIs_production_min.Portal=c$1;reactIs_production_min.Profiler=f$1;reactIs_production_min.StrictMode=e;reactIs_production_min.Suspense=m$1;
|
|
24621
|
+
reactIs_production_min.SuspenseList=n$1;reactIs_production_min.isAsyncMode=function(){return !1};reactIs_production_min.isConcurrentMode=function(){return !1};reactIs_production_min.isContextConsumer=function(a){return v$1(a)===h$1};reactIs_production_min.isContextProvider=function(a){return v$1(a)===g$1};reactIs_production_min.isElement=function(a){return "object"===typeof a&&null!==a&&a.$$typeof===b$1};reactIs_production_min.isForwardRef=function(a){return v$1(a)===l$1};reactIs_production_min.isFragment=function(a){return v$1(a)===d$1};reactIs_production_min.isLazy=function(a){return v$1(a)===q$1};reactIs_production_min.isMemo=function(a){return v$1(a)===p$1};
|
|
24622
|
+
reactIs_production_min.isPortal=function(a){return v$1(a)===c$1};reactIs_production_min.isProfiler=function(a){return v$1(a)===f$1};reactIs_production_min.isStrictMode=function(a){return v$1(a)===e};reactIs_production_min.isSuspense=function(a){return v$1(a)===m$1};reactIs_production_min.isSuspenseList=function(a){return v$1(a)===n$1};
|
|
24623
|
+
reactIs_production_min.isValidElementType=function(a){return "string"===typeof a||"function"===typeof a||a===d$1||a===f$1||a===e||a===m$1||a===n$1||a===t$1||"object"===typeof a&&null!==a&&(a.$$typeof===q$1||a.$$typeof===p$1||a.$$typeof===g$1||a.$$typeof===h$1||a.$$typeof===l$1||a.$$typeof===u$1||void 0!==a.getModuleId)?!0:!1};reactIs_production_min.typeOf=v$1;
|
|
24624
24624
|
|
|
24625
24625
|
var reactIs_development = {};
|
|
24626
24626
|
|
|
@@ -24948,7 +24948,7 @@ var SearchHighlight = function SearchHighlight(_ref) {
|
|
|
24948
24948
|
return /*#__PURE__*/React__default.createElement("span", null, text);
|
|
24949
24949
|
}
|
|
24950
24950
|
var searchWords = search.split(' ').reduce(function (words, word) {
|
|
24951
|
-
return word ? [].concat(_toConsumableArray(words), [word.toLocaleLowerCase()]) : words;
|
|
24951
|
+
return word ? [].concat(_toConsumableArray$1(words), [word.toLocaleLowerCase()]) : words;
|
|
24952
24952
|
}, []);
|
|
24953
24953
|
var searchRegex = searchWords.map(function (word) {
|
|
24954
24954
|
return lodash.exports.escapeRegExp(word);
|
|
@@ -25305,8 +25305,25 @@ var getOffsetStr = function getOffsetStr(input) {
|
|
|
25305
25305
|
* @param {Date} date - date to be checked
|
|
25306
25306
|
* @returns {boolean} - True if valid
|
|
25307
25307
|
*/
|
|
25308
|
-
var isValid = function isValid(
|
|
25309
|
-
return isValid$1(
|
|
25308
|
+
var isValid = function isValid(date) {
|
|
25309
|
+
return isValid$1(date);
|
|
25310
|
+
};
|
|
25311
|
+
/**
|
|
25312
|
+
* Get the seconds timestamp of the given date
|
|
25313
|
+
* @param {Date} date - the given date
|
|
25314
|
+
* @returns the timestamp
|
|
25315
|
+
*/
|
|
25316
|
+
var unix = function unix(date) {
|
|
25317
|
+
return getUnixTime(date);
|
|
25318
|
+
};
|
|
25319
|
+
/**
|
|
25320
|
+
* Set date values to a given date.
|
|
25321
|
+
* @param date - the dater to be changed
|
|
25322
|
+
* @param values - an object with options
|
|
25323
|
+
* @returns the new date with options set
|
|
25324
|
+
*/
|
|
25325
|
+
var set = function set(date, values) {
|
|
25326
|
+
return set$1(date, values);
|
|
25310
25327
|
};
|
|
25311
25328
|
|
|
25312
25329
|
/* *
|
|
@@ -25341,7 +25358,1868 @@ var index = /*#__PURE__*/Object.freeze({
|
|
|
25341
25358
|
isBefore: isBefore,
|
|
25342
25359
|
isAfter: isAfter,
|
|
25343
25360
|
utc: utc,
|
|
25344
|
-
isValid: isValid
|
|
25361
|
+
isValid: isValid,
|
|
25362
|
+
unix: unix,
|
|
25363
|
+
set: set
|
|
25345
25364
|
});
|
|
25346
25365
|
|
|
25347
|
-
|
|
25366
|
+
var lib = {};
|
|
25367
|
+
|
|
25368
|
+
function _typeof(obj) {
|
|
25369
|
+
"@babel/helpers - typeof";
|
|
25370
|
+
|
|
25371
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
|
25372
|
+
return typeof obj;
|
|
25373
|
+
} : function (obj) {
|
|
25374
|
+
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
|
25375
|
+
}, _typeof(obj);
|
|
25376
|
+
}
|
|
25377
|
+
|
|
25378
|
+
function _toPrimitive(input, hint) {
|
|
25379
|
+
if (_typeof(input) !== "object" || input === null) return input;
|
|
25380
|
+
var prim = input[Symbol.toPrimitive];
|
|
25381
|
+
if (prim !== undefined) {
|
|
25382
|
+
var res = prim.call(input, hint || "default");
|
|
25383
|
+
if (_typeof(res) !== "object") return res;
|
|
25384
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
25385
|
+
}
|
|
25386
|
+
return (hint === "string" ? String : Number)(input);
|
|
25387
|
+
}
|
|
25388
|
+
|
|
25389
|
+
function _toPropertyKey(arg) {
|
|
25390
|
+
var key = _toPrimitive(arg, "string");
|
|
25391
|
+
return _typeof(key) === "symbol" ? key : String(key);
|
|
25392
|
+
}
|
|
25393
|
+
|
|
25394
|
+
function _defineProperty(obj, key, value) {
|
|
25395
|
+
key = _toPropertyKey(key);
|
|
25396
|
+
if (key in obj) {
|
|
25397
|
+
Object.defineProperty(obj, key, {
|
|
25398
|
+
value: value,
|
|
25399
|
+
enumerable: true,
|
|
25400
|
+
configurable: true,
|
|
25401
|
+
writable: true
|
|
25402
|
+
});
|
|
25403
|
+
} else {
|
|
25404
|
+
obj[key] = value;
|
|
25405
|
+
}
|
|
25406
|
+
return obj;
|
|
25407
|
+
}
|
|
25408
|
+
|
|
25409
|
+
function ownKeys(object, enumerableOnly) {
|
|
25410
|
+
var keys = Object.keys(object);
|
|
25411
|
+
if (Object.getOwnPropertySymbols) {
|
|
25412
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
25413
|
+
enumerableOnly && (symbols = symbols.filter(function (sym) {
|
|
25414
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
25415
|
+
})), keys.push.apply(keys, symbols);
|
|
25416
|
+
}
|
|
25417
|
+
return keys;
|
|
25418
|
+
}
|
|
25419
|
+
function _objectSpread2(target) {
|
|
25420
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
25421
|
+
var source = null != arguments[i] ? arguments[i] : {};
|
|
25422
|
+
i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
|
|
25423
|
+
_defineProperty(target, key, source[key]);
|
|
25424
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
|
|
25425
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
25426
|
+
});
|
|
25427
|
+
}
|
|
25428
|
+
return target;
|
|
25429
|
+
}
|
|
25430
|
+
|
|
25431
|
+
/**
|
|
25432
|
+
* Adapted from React: https://github.com/facebook/react/blob/master/packages/shared/formatProdErrorMessage.js
|
|
25433
|
+
*
|
|
25434
|
+
* Do not require this module directly! Use normal throw error calls. These messages will be replaced with error codes
|
|
25435
|
+
* during build.
|
|
25436
|
+
* @param {number} code
|
|
25437
|
+
*/
|
|
25438
|
+
function formatProdErrorMessage(code) {
|
|
25439
|
+
return "Minified Redux error #" + code + "; visit https://redux.js.org/Errors?code=" + code + " for the full message or " + 'use the non-minified dev environment for full errors. ';
|
|
25440
|
+
}
|
|
25441
|
+
|
|
25442
|
+
// Inlined version of the `symbol-observable` polyfill
|
|
25443
|
+
var $$observable = (function () {
|
|
25444
|
+
return typeof Symbol === 'function' && Symbol.observable || '@@observable';
|
|
25445
|
+
})();
|
|
25446
|
+
|
|
25447
|
+
/**
|
|
25448
|
+
* These are private action types reserved by Redux.
|
|
25449
|
+
* For any unknown actions, you must return the current state.
|
|
25450
|
+
* If the current state is undefined, you must return the initial state.
|
|
25451
|
+
* Do not reference these action types directly in your code.
|
|
25452
|
+
*/
|
|
25453
|
+
var randomString = function randomString() {
|
|
25454
|
+
return Math.random().toString(36).substring(7).split('').join('.');
|
|
25455
|
+
};
|
|
25456
|
+
|
|
25457
|
+
var ActionTypes = {
|
|
25458
|
+
INIT: "@@redux/INIT" + randomString(),
|
|
25459
|
+
REPLACE: "@@redux/REPLACE" + randomString(),
|
|
25460
|
+
PROBE_UNKNOWN_ACTION: function PROBE_UNKNOWN_ACTION() {
|
|
25461
|
+
return "@@redux/PROBE_UNKNOWN_ACTION" + randomString();
|
|
25462
|
+
}
|
|
25463
|
+
};
|
|
25464
|
+
|
|
25465
|
+
/**
|
|
25466
|
+
* @param {any} obj The object to inspect.
|
|
25467
|
+
* @returns {boolean} True if the argument appears to be a plain object.
|
|
25468
|
+
*/
|
|
25469
|
+
function isPlainObject$2(obj) {
|
|
25470
|
+
if (typeof obj !== 'object' || obj === null) return false;
|
|
25471
|
+
var proto = obj;
|
|
25472
|
+
|
|
25473
|
+
while (Object.getPrototypeOf(proto) !== null) {
|
|
25474
|
+
proto = Object.getPrototypeOf(proto);
|
|
25475
|
+
}
|
|
25476
|
+
|
|
25477
|
+
return Object.getPrototypeOf(obj) === proto;
|
|
25478
|
+
}
|
|
25479
|
+
|
|
25480
|
+
// Inlined / shortened version of `kindOf` from https://github.com/jonschlinkert/kind-of
|
|
25481
|
+
function miniKindOf(val) {
|
|
25482
|
+
if (val === void 0) return 'undefined';
|
|
25483
|
+
if (val === null) return 'null';
|
|
25484
|
+
var type = typeof val;
|
|
25485
|
+
|
|
25486
|
+
switch (type) {
|
|
25487
|
+
case 'boolean':
|
|
25488
|
+
case 'string':
|
|
25489
|
+
case 'number':
|
|
25490
|
+
case 'symbol':
|
|
25491
|
+
case 'function':
|
|
25492
|
+
{
|
|
25493
|
+
return type;
|
|
25494
|
+
}
|
|
25495
|
+
}
|
|
25496
|
+
|
|
25497
|
+
if (Array.isArray(val)) return 'array';
|
|
25498
|
+
if (isDate(val)) return 'date';
|
|
25499
|
+
if (isError(val)) return 'error';
|
|
25500
|
+
var constructorName = ctorName(val);
|
|
25501
|
+
|
|
25502
|
+
switch (constructorName) {
|
|
25503
|
+
case 'Symbol':
|
|
25504
|
+
case 'Promise':
|
|
25505
|
+
case 'WeakMap':
|
|
25506
|
+
case 'WeakSet':
|
|
25507
|
+
case 'Map':
|
|
25508
|
+
case 'Set':
|
|
25509
|
+
return constructorName;
|
|
25510
|
+
} // other
|
|
25511
|
+
|
|
25512
|
+
|
|
25513
|
+
return type.slice(8, -1).toLowerCase().replace(/\s/g, '');
|
|
25514
|
+
}
|
|
25515
|
+
|
|
25516
|
+
function ctorName(val) {
|
|
25517
|
+
return typeof val.constructor === 'function' ? val.constructor.name : null;
|
|
25518
|
+
}
|
|
25519
|
+
|
|
25520
|
+
function isError(val) {
|
|
25521
|
+
return val instanceof Error || typeof val.message === 'string' && val.constructor && typeof val.constructor.stackTraceLimit === 'number';
|
|
25522
|
+
}
|
|
25523
|
+
|
|
25524
|
+
function isDate(val) {
|
|
25525
|
+
if (val instanceof Date) return true;
|
|
25526
|
+
return typeof val.toDateString === 'function' && typeof val.getDate === 'function' && typeof val.setDate === 'function';
|
|
25527
|
+
}
|
|
25528
|
+
|
|
25529
|
+
function kindOf(val) {
|
|
25530
|
+
var typeOfVal = typeof val;
|
|
25531
|
+
|
|
25532
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
25533
|
+
typeOfVal = miniKindOf(val);
|
|
25534
|
+
}
|
|
25535
|
+
|
|
25536
|
+
return typeOfVal;
|
|
25537
|
+
}
|
|
25538
|
+
|
|
25539
|
+
/**
|
|
25540
|
+
* @deprecated
|
|
25541
|
+
*
|
|
25542
|
+
* **We recommend using the `configureStore` method
|
|
25543
|
+
* of the `@reduxjs/toolkit` package**, which replaces `createStore`.
|
|
25544
|
+
*
|
|
25545
|
+
* Redux Toolkit is our recommended approach for writing Redux logic today,
|
|
25546
|
+
* including store setup, reducers, data fetching, and more.
|
|
25547
|
+
*
|
|
25548
|
+
* **For more details, please read this Redux docs page:**
|
|
25549
|
+
* **https://redux.js.org/introduction/why-rtk-is-redux-today**
|
|
25550
|
+
*
|
|
25551
|
+
* `configureStore` from Redux Toolkit is an improved version of `createStore` that
|
|
25552
|
+
* simplifies setup and helps avoid common bugs.
|
|
25553
|
+
*
|
|
25554
|
+
* You should not be using the `redux` core package by itself today, except for learning purposes.
|
|
25555
|
+
* The `createStore` method from the core `redux` package will not be removed, but we encourage
|
|
25556
|
+
* all users to migrate to using Redux Toolkit for all Redux code.
|
|
25557
|
+
*
|
|
25558
|
+
* If you want to use `createStore` without this visual deprecation warning, use
|
|
25559
|
+
* the `legacy_createStore` import instead:
|
|
25560
|
+
*
|
|
25561
|
+
* `import { legacy_createStore as createStore} from 'redux'`
|
|
25562
|
+
*
|
|
25563
|
+
*/
|
|
25564
|
+
|
|
25565
|
+
function createStore(reducer, preloadedState, enhancer) {
|
|
25566
|
+
var _ref2;
|
|
25567
|
+
|
|
25568
|
+
if (typeof preloadedState === 'function' && typeof enhancer === 'function' || typeof enhancer === 'function' && typeof arguments[3] === 'function') {
|
|
25569
|
+
throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(0) : 'It looks like you are passing several store enhancers to ' + 'createStore(). This is not supported. Instead, compose them ' + 'together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.');
|
|
25570
|
+
}
|
|
25571
|
+
|
|
25572
|
+
if (typeof preloadedState === 'function' && typeof enhancer === 'undefined') {
|
|
25573
|
+
enhancer = preloadedState;
|
|
25574
|
+
preloadedState = undefined;
|
|
25575
|
+
}
|
|
25576
|
+
|
|
25577
|
+
if (typeof enhancer !== 'undefined') {
|
|
25578
|
+
if (typeof enhancer !== 'function') {
|
|
25579
|
+
throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(1) : "Expected the enhancer to be a function. Instead, received: '" + kindOf(enhancer) + "'");
|
|
25580
|
+
}
|
|
25581
|
+
|
|
25582
|
+
return enhancer(createStore)(reducer, preloadedState);
|
|
25583
|
+
}
|
|
25584
|
+
|
|
25585
|
+
if (typeof reducer !== 'function') {
|
|
25586
|
+
throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(2) : "Expected the root reducer to be a function. Instead, received: '" + kindOf(reducer) + "'");
|
|
25587
|
+
}
|
|
25588
|
+
|
|
25589
|
+
var currentReducer = reducer;
|
|
25590
|
+
var currentState = preloadedState;
|
|
25591
|
+
var currentListeners = [];
|
|
25592
|
+
var nextListeners = currentListeners;
|
|
25593
|
+
var isDispatching = false;
|
|
25594
|
+
/**
|
|
25595
|
+
* This makes a shallow copy of currentListeners so we can use
|
|
25596
|
+
* nextListeners as a temporary list while dispatching.
|
|
25597
|
+
*
|
|
25598
|
+
* This prevents any bugs around consumers calling
|
|
25599
|
+
* subscribe/unsubscribe in the middle of a dispatch.
|
|
25600
|
+
*/
|
|
25601
|
+
|
|
25602
|
+
function ensureCanMutateNextListeners() {
|
|
25603
|
+
if (nextListeners === currentListeners) {
|
|
25604
|
+
nextListeners = currentListeners.slice();
|
|
25605
|
+
}
|
|
25606
|
+
}
|
|
25607
|
+
/**
|
|
25608
|
+
* Reads the state tree managed by the store.
|
|
25609
|
+
*
|
|
25610
|
+
* @returns {any} The current state tree of your application.
|
|
25611
|
+
*/
|
|
25612
|
+
|
|
25613
|
+
|
|
25614
|
+
function getState() {
|
|
25615
|
+
if (isDispatching) {
|
|
25616
|
+
throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(3) : 'You may not call store.getState() while the reducer is executing. ' + 'The reducer has already received the state as an argument. ' + 'Pass it down from the top reducer instead of reading it from the store.');
|
|
25617
|
+
}
|
|
25618
|
+
|
|
25619
|
+
return currentState;
|
|
25620
|
+
}
|
|
25621
|
+
/**
|
|
25622
|
+
* Adds a change listener. It will be called any time an action is dispatched,
|
|
25623
|
+
* and some part of the state tree may potentially have changed. You may then
|
|
25624
|
+
* call `getState()` to read the current state tree inside the callback.
|
|
25625
|
+
*
|
|
25626
|
+
* You may call `dispatch()` from a change listener, with the following
|
|
25627
|
+
* caveats:
|
|
25628
|
+
*
|
|
25629
|
+
* 1. The subscriptions are snapshotted just before every `dispatch()` call.
|
|
25630
|
+
* If you subscribe or unsubscribe while the listeners are being invoked, this
|
|
25631
|
+
* will not have any effect on the `dispatch()` that is currently in progress.
|
|
25632
|
+
* However, the next `dispatch()` call, whether nested or not, will use a more
|
|
25633
|
+
* recent snapshot of the subscription list.
|
|
25634
|
+
*
|
|
25635
|
+
* 2. The listener should not expect to see all state changes, as the state
|
|
25636
|
+
* might have been updated multiple times during a nested `dispatch()` before
|
|
25637
|
+
* the listener is called. It is, however, guaranteed that all subscribers
|
|
25638
|
+
* registered before the `dispatch()` started will be called with the latest
|
|
25639
|
+
* state by the time it exits.
|
|
25640
|
+
*
|
|
25641
|
+
* @param {Function} listener A callback to be invoked on every dispatch.
|
|
25642
|
+
* @returns {Function} A function to remove this change listener.
|
|
25643
|
+
*/
|
|
25644
|
+
|
|
25645
|
+
|
|
25646
|
+
function subscribe(listener) {
|
|
25647
|
+
if (typeof listener !== 'function') {
|
|
25648
|
+
throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(4) : "Expected the listener to be a function. Instead, received: '" + kindOf(listener) + "'");
|
|
25649
|
+
}
|
|
25650
|
+
|
|
25651
|
+
if (isDispatching) {
|
|
25652
|
+
throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(5) : 'You may not call store.subscribe() while the reducer is executing. ' + 'If you would like to be notified after the store has been updated, subscribe from a ' + 'component and invoke store.getState() in the callback to access the latest state. ' + 'See https://redux.js.org/api/store#subscribelistener for more details.');
|
|
25653
|
+
}
|
|
25654
|
+
|
|
25655
|
+
var isSubscribed = true;
|
|
25656
|
+
ensureCanMutateNextListeners();
|
|
25657
|
+
nextListeners.push(listener);
|
|
25658
|
+
return function unsubscribe() {
|
|
25659
|
+
if (!isSubscribed) {
|
|
25660
|
+
return;
|
|
25661
|
+
}
|
|
25662
|
+
|
|
25663
|
+
if (isDispatching) {
|
|
25664
|
+
throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(6) : 'You may not unsubscribe from a store listener while the reducer is executing. ' + 'See https://redux.js.org/api/store#subscribelistener for more details.');
|
|
25665
|
+
}
|
|
25666
|
+
|
|
25667
|
+
isSubscribed = false;
|
|
25668
|
+
ensureCanMutateNextListeners();
|
|
25669
|
+
var index = nextListeners.indexOf(listener);
|
|
25670
|
+
nextListeners.splice(index, 1);
|
|
25671
|
+
currentListeners = null;
|
|
25672
|
+
};
|
|
25673
|
+
}
|
|
25674
|
+
/**
|
|
25675
|
+
* Dispatches an action. It is the only way to trigger a state change.
|
|
25676
|
+
*
|
|
25677
|
+
* The `reducer` function, used to create the store, will be called with the
|
|
25678
|
+
* current state tree and the given `action`. Its return value will
|
|
25679
|
+
* be considered the **next** state of the tree, and the change listeners
|
|
25680
|
+
* will be notified.
|
|
25681
|
+
*
|
|
25682
|
+
* The base implementation only supports plain object actions. If you want to
|
|
25683
|
+
* dispatch a Promise, an Observable, a thunk, or something else, you need to
|
|
25684
|
+
* wrap your store creating function into the corresponding middleware. For
|
|
25685
|
+
* example, see the documentation for the `redux-thunk` package. Even the
|
|
25686
|
+
* middleware will eventually dispatch plain object actions using this method.
|
|
25687
|
+
*
|
|
25688
|
+
* @param {Object} action A plain object representing “what changed”. It is
|
|
25689
|
+
* a good idea to keep actions serializable so you can record and replay user
|
|
25690
|
+
* sessions, or use the time travelling `redux-devtools`. An action must have
|
|
25691
|
+
* a `type` property which may not be `undefined`. It is a good idea to use
|
|
25692
|
+
* string constants for action types.
|
|
25693
|
+
*
|
|
25694
|
+
* @returns {Object} For convenience, the same action object you dispatched.
|
|
25695
|
+
*
|
|
25696
|
+
* Note that, if you use a custom middleware, it may wrap `dispatch()` to
|
|
25697
|
+
* return something else (for example, a Promise you can await).
|
|
25698
|
+
*/
|
|
25699
|
+
|
|
25700
|
+
|
|
25701
|
+
function dispatch(action) {
|
|
25702
|
+
if (!isPlainObject$2(action)) {
|
|
25703
|
+
throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(7) : "Actions must be plain objects. Instead, the actual type was: '" + kindOf(action) + "'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.");
|
|
25704
|
+
}
|
|
25705
|
+
|
|
25706
|
+
if (typeof action.type === 'undefined') {
|
|
25707
|
+
throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(8) : 'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');
|
|
25708
|
+
}
|
|
25709
|
+
|
|
25710
|
+
if (isDispatching) {
|
|
25711
|
+
throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(9) : 'Reducers may not dispatch actions.');
|
|
25712
|
+
}
|
|
25713
|
+
|
|
25714
|
+
try {
|
|
25715
|
+
isDispatching = true;
|
|
25716
|
+
currentState = currentReducer(currentState, action);
|
|
25717
|
+
} finally {
|
|
25718
|
+
isDispatching = false;
|
|
25719
|
+
}
|
|
25720
|
+
|
|
25721
|
+
var listeners = currentListeners = nextListeners;
|
|
25722
|
+
|
|
25723
|
+
for (var i = 0; i < listeners.length; i++) {
|
|
25724
|
+
var listener = listeners[i];
|
|
25725
|
+
listener();
|
|
25726
|
+
}
|
|
25727
|
+
|
|
25728
|
+
return action;
|
|
25729
|
+
}
|
|
25730
|
+
/**
|
|
25731
|
+
* Replaces the reducer currently used by the store to calculate the state.
|
|
25732
|
+
*
|
|
25733
|
+
* You might need this if your app implements code splitting and you want to
|
|
25734
|
+
* load some of the reducers dynamically. You might also need this if you
|
|
25735
|
+
* implement a hot reloading mechanism for Redux.
|
|
25736
|
+
*
|
|
25737
|
+
* @param {Function} nextReducer The reducer for the store to use instead.
|
|
25738
|
+
* @returns {void}
|
|
25739
|
+
*/
|
|
25740
|
+
|
|
25741
|
+
|
|
25742
|
+
function replaceReducer(nextReducer) {
|
|
25743
|
+
if (typeof nextReducer !== 'function') {
|
|
25744
|
+
throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(10) : "Expected the nextReducer to be a function. Instead, received: '" + kindOf(nextReducer));
|
|
25745
|
+
}
|
|
25746
|
+
|
|
25747
|
+
currentReducer = nextReducer; // This action has a similiar effect to ActionTypes.INIT.
|
|
25748
|
+
// Any reducers that existed in both the new and old rootReducer
|
|
25749
|
+
// will receive the previous state. This effectively populates
|
|
25750
|
+
// the new state tree with any relevant data from the old one.
|
|
25751
|
+
|
|
25752
|
+
dispatch({
|
|
25753
|
+
type: ActionTypes.REPLACE
|
|
25754
|
+
});
|
|
25755
|
+
}
|
|
25756
|
+
/**
|
|
25757
|
+
* Interoperability point for observable/reactive libraries.
|
|
25758
|
+
* @returns {observable} A minimal observable of state changes.
|
|
25759
|
+
* For more information, see the observable proposal:
|
|
25760
|
+
* https://github.com/tc39/proposal-observable
|
|
25761
|
+
*/
|
|
25762
|
+
|
|
25763
|
+
|
|
25764
|
+
function observable() {
|
|
25765
|
+
var _ref;
|
|
25766
|
+
|
|
25767
|
+
var outerSubscribe = subscribe;
|
|
25768
|
+
return _ref = {
|
|
25769
|
+
/**
|
|
25770
|
+
* The minimal observable subscription method.
|
|
25771
|
+
* @param {Object} observer Any object that can be used as an observer.
|
|
25772
|
+
* The observer object should have a `next` method.
|
|
25773
|
+
* @returns {subscription} An object with an `unsubscribe` method that can
|
|
25774
|
+
* be used to unsubscribe the observable from the store, and prevent further
|
|
25775
|
+
* emission of values from the observable.
|
|
25776
|
+
*/
|
|
25777
|
+
subscribe: function subscribe(observer) {
|
|
25778
|
+
if (typeof observer !== 'object' || observer === null) {
|
|
25779
|
+
throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(11) : "Expected the observer to be an object. Instead, received: '" + kindOf(observer) + "'");
|
|
25780
|
+
}
|
|
25781
|
+
|
|
25782
|
+
function observeState() {
|
|
25783
|
+
if (observer.next) {
|
|
25784
|
+
observer.next(getState());
|
|
25785
|
+
}
|
|
25786
|
+
}
|
|
25787
|
+
|
|
25788
|
+
observeState();
|
|
25789
|
+
var unsubscribe = outerSubscribe(observeState);
|
|
25790
|
+
return {
|
|
25791
|
+
unsubscribe: unsubscribe
|
|
25792
|
+
};
|
|
25793
|
+
}
|
|
25794
|
+
}, _ref[$$observable] = function () {
|
|
25795
|
+
return this;
|
|
25796
|
+
}, _ref;
|
|
25797
|
+
} // When a store is created, an "INIT" action is dispatched so that every
|
|
25798
|
+
// reducer returns their initial state. This effectively populates
|
|
25799
|
+
// the initial state tree.
|
|
25800
|
+
|
|
25801
|
+
|
|
25802
|
+
dispatch({
|
|
25803
|
+
type: ActionTypes.INIT
|
|
25804
|
+
});
|
|
25805
|
+
return _ref2 = {
|
|
25806
|
+
dispatch: dispatch,
|
|
25807
|
+
subscribe: subscribe,
|
|
25808
|
+
getState: getState,
|
|
25809
|
+
replaceReducer: replaceReducer
|
|
25810
|
+
}, _ref2[$$observable] = observable, _ref2;
|
|
25811
|
+
}
|
|
25812
|
+
/**
|
|
25813
|
+
* Creates a Redux store that holds the state tree.
|
|
25814
|
+
*
|
|
25815
|
+
* **We recommend using `configureStore` from the
|
|
25816
|
+
* `@reduxjs/toolkit` package**, which replaces `createStore`:
|
|
25817
|
+
* **https://redux.js.org/introduction/why-rtk-is-redux-today**
|
|
25818
|
+
*
|
|
25819
|
+
* The only way to change the data in the store is to call `dispatch()` on it.
|
|
25820
|
+
*
|
|
25821
|
+
* There should only be a single store in your app. To specify how different
|
|
25822
|
+
* parts of the state tree respond to actions, you may combine several reducers
|
|
25823
|
+
* into a single reducer function by using `combineReducers`.
|
|
25824
|
+
*
|
|
25825
|
+
* @param {Function} reducer A function that returns the next state tree, given
|
|
25826
|
+
* the current state tree and the action to handle.
|
|
25827
|
+
*
|
|
25828
|
+
* @param {any} [preloadedState] The initial state. You may optionally specify it
|
|
25829
|
+
* to hydrate the state from the server in universal apps, or to restore a
|
|
25830
|
+
* previously serialized user session.
|
|
25831
|
+
* If you use `combineReducers` to produce the root reducer function, this must be
|
|
25832
|
+
* an object with the same shape as `combineReducers` keys.
|
|
25833
|
+
*
|
|
25834
|
+
* @param {Function} [enhancer] The store enhancer. You may optionally specify it
|
|
25835
|
+
* to enhance the store with third-party capabilities such as middleware,
|
|
25836
|
+
* time travel, persistence, etc. The only store enhancer that ships with Redux
|
|
25837
|
+
* is `applyMiddleware()`.
|
|
25838
|
+
*
|
|
25839
|
+
* @returns {Store} A Redux store that lets you read the state, dispatch actions
|
|
25840
|
+
* and subscribe to changes.
|
|
25841
|
+
*/
|
|
25842
|
+
|
|
25843
|
+
var legacy_createStore = createStore;
|
|
25844
|
+
|
|
25845
|
+
/**
|
|
25846
|
+
* Prints a warning in the console if it exists.
|
|
25847
|
+
*
|
|
25848
|
+
* @param {String} message The warning message.
|
|
25849
|
+
* @returns {void}
|
|
25850
|
+
*/
|
|
25851
|
+
function warning(message) {
|
|
25852
|
+
/* eslint-disable no-console */
|
|
25853
|
+
if (typeof console !== 'undefined' && typeof console.error === 'function') {
|
|
25854
|
+
console.error(message);
|
|
25855
|
+
}
|
|
25856
|
+
/* eslint-enable no-console */
|
|
25857
|
+
|
|
25858
|
+
|
|
25859
|
+
try {
|
|
25860
|
+
// This error was thrown as a convenience so that if you enable
|
|
25861
|
+
// "break on all exceptions" in your console,
|
|
25862
|
+
// it would pause the execution at this line.
|
|
25863
|
+
throw new Error(message);
|
|
25864
|
+
} catch (e) {} // eslint-disable-line no-empty
|
|
25865
|
+
|
|
25866
|
+
}
|
|
25867
|
+
|
|
25868
|
+
function getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) {
|
|
25869
|
+
var reducerKeys = Object.keys(reducers);
|
|
25870
|
+
var argumentName = action && action.type === ActionTypes.INIT ? 'preloadedState argument passed to createStore' : 'previous state received by the reducer';
|
|
25871
|
+
|
|
25872
|
+
if (reducerKeys.length === 0) {
|
|
25873
|
+
return 'Store does not have a valid reducer. Make sure the argument passed ' + 'to combineReducers is an object whose values are reducers.';
|
|
25874
|
+
}
|
|
25875
|
+
|
|
25876
|
+
if (!isPlainObject$2(inputState)) {
|
|
25877
|
+
return "The " + argumentName + " has unexpected type of \"" + kindOf(inputState) + "\". Expected argument to be an object with the following " + ("keys: \"" + reducerKeys.join('", "') + "\"");
|
|
25878
|
+
}
|
|
25879
|
+
|
|
25880
|
+
var unexpectedKeys = Object.keys(inputState).filter(function (key) {
|
|
25881
|
+
return !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key];
|
|
25882
|
+
});
|
|
25883
|
+
unexpectedKeys.forEach(function (key) {
|
|
25884
|
+
unexpectedKeyCache[key] = true;
|
|
25885
|
+
});
|
|
25886
|
+
if (action && action.type === ActionTypes.REPLACE) return;
|
|
25887
|
+
|
|
25888
|
+
if (unexpectedKeys.length > 0) {
|
|
25889
|
+
return "Unexpected " + (unexpectedKeys.length > 1 ? 'keys' : 'key') + " " + ("\"" + unexpectedKeys.join('", "') + "\" found in " + argumentName + ". ") + "Expected to find one of the known reducer keys instead: " + ("\"" + reducerKeys.join('", "') + "\". Unexpected keys will be ignored.");
|
|
25890
|
+
}
|
|
25891
|
+
}
|
|
25892
|
+
|
|
25893
|
+
function assertReducerShape(reducers) {
|
|
25894
|
+
Object.keys(reducers).forEach(function (key) {
|
|
25895
|
+
var reducer = reducers[key];
|
|
25896
|
+
var initialState = reducer(undefined, {
|
|
25897
|
+
type: ActionTypes.INIT
|
|
25898
|
+
});
|
|
25899
|
+
|
|
25900
|
+
if (typeof initialState === 'undefined') {
|
|
25901
|
+
throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(12) : "The slice reducer for key \"" + key + "\" returned undefined during initialization. " + "If the state passed to the reducer is undefined, you must " + "explicitly return the initial state. The initial state may " + "not be undefined. If you don't want to set a value for this reducer, " + "you can use null instead of undefined.");
|
|
25902
|
+
}
|
|
25903
|
+
|
|
25904
|
+
if (typeof reducer(undefined, {
|
|
25905
|
+
type: ActionTypes.PROBE_UNKNOWN_ACTION()
|
|
25906
|
+
}) === 'undefined') {
|
|
25907
|
+
throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(13) : "The slice reducer for key \"" + key + "\" returned undefined when probed with a random type. " + ("Don't try to handle '" + ActionTypes.INIT + "' or other actions in \"redux/*\" ") + "namespace. They are considered private. Instead, you must return the " + "current state for any unknown actions, unless it is undefined, " + "in which case you must return the initial state, regardless of the " + "action type. The initial state may not be undefined, but can be null.");
|
|
25908
|
+
}
|
|
25909
|
+
});
|
|
25910
|
+
}
|
|
25911
|
+
/**
|
|
25912
|
+
* Turns an object whose values are different reducer functions, into a single
|
|
25913
|
+
* reducer function. It will call every child reducer, and gather their results
|
|
25914
|
+
* into a single state object, whose keys correspond to the keys of the passed
|
|
25915
|
+
* reducer functions.
|
|
25916
|
+
*
|
|
25917
|
+
* @param {Object} reducers An object whose values correspond to different
|
|
25918
|
+
* reducer functions that need to be combined into one. One handy way to obtain
|
|
25919
|
+
* it is to use ES6 `import * as reducers` syntax. The reducers may never return
|
|
25920
|
+
* undefined for any action. Instead, they should return their initial state
|
|
25921
|
+
* if the state passed to them was undefined, and the current state for any
|
|
25922
|
+
* unrecognized action.
|
|
25923
|
+
*
|
|
25924
|
+
* @returns {Function} A reducer function that invokes every reducer inside the
|
|
25925
|
+
* passed object, and builds a state object with the same shape.
|
|
25926
|
+
*/
|
|
25927
|
+
|
|
25928
|
+
|
|
25929
|
+
function combineReducers(reducers) {
|
|
25930
|
+
var reducerKeys = Object.keys(reducers);
|
|
25931
|
+
var finalReducers = {};
|
|
25932
|
+
|
|
25933
|
+
for (var i = 0; i < reducerKeys.length; i++) {
|
|
25934
|
+
var key = reducerKeys[i];
|
|
25935
|
+
|
|
25936
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
25937
|
+
if (typeof reducers[key] === 'undefined') {
|
|
25938
|
+
warning("No reducer provided for key \"" + key + "\"");
|
|
25939
|
+
}
|
|
25940
|
+
}
|
|
25941
|
+
|
|
25942
|
+
if (typeof reducers[key] === 'function') {
|
|
25943
|
+
finalReducers[key] = reducers[key];
|
|
25944
|
+
}
|
|
25945
|
+
}
|
|
25946
|
+
|
|
25947
|
+
var finalReducerKeys = Object.keys(finalReducers); // This is used to make sure we don't warn about the same
|
|
25948
|
+
// keys multiple times.
|
|
25949
|
+
|
|
25950
|
+
var unexpectedKeyCache;
|
|
25951
|
+
|
|
25952
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
25953
|
+
unexpectedKeyCache = {};
|
|
25954
|
+
}
|
|
25955
|
+
|
|
25956
|
+
var shapeAssertionError;
|
|
25957
|
+
|
|
25958
|
+
try {
|
|
25959
|
+
assertReducerShape(finalReducers);
|
|
25960
|
+
} catch (e) {
|
|
25961
|
+
shapeAssertionError = e;
|
|
25962
|
+
}
|
|
25963
|
+
|
|
25964
|
+
return function combination(state, action) {
|
|
25965
|
+
if (state === void 0) {
|
|
25966
|
+
state = {};
|
|
25967
|
+
}
|
|
25968
|
+
|
|
25969
|
+
if (shapeAssertionError) {
|
|
25970
|
+
throw shapeAssertionError;
|
|
25971
|
+
}
|
|
25972
|
+
|
|
25973
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
25974
|
+
var warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action, unexpectedKeyCache);
|
|
25975
|
+
|
|
25976
|
+
if (warningMessage) {
|
|
25977
|
+
warning(warningMessage);
|
|
25978
|
+
}
|
|
25979
|
+
}
|
|
25980
|
+
|
|
25981
|
+
var hasChanged = false;
|
|
25982
|
+
var nextState = {};
|
|
25983
|
+
|
|
25984
|
+
for (var _i = 0; _i < finalReducerKeys.length; _i++) {
|
|
25985
|
+
var _key = finalReducerKeys[_i];
|
|
25986
|
+
var reducer = finalReducers[_key];
|
|
25987
|
+
var previousStateForKey = state[_key];
|
|
25988
|
+
var nextStateForKey = reducer(previousStateForKey, action);
|
|
25989
|
+
|
|
25990
|
+
if (typeof nextStateForKey === 'undefined') {
|
|
25991
|
+
var actionType = action && action.type;
|
|
25992
|
+
throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(14) : "When called with an action of type " + (actionType ? "\"" + String(actionType) + "\"" : '(unknown type)') + ", the slice reducer for key \"" + _key + "\" returned undefined. " + "To ignore an action, you must explicitly return the previous state. " + "If you want this reducer to hold no value, you can return null instead of undefined.");
|
|
25993
|
+
}
|
|
25994
|
+
|
|
25995
|
+
nextState[_key] = nextStateForKey;
|
|
25996
|
+
hasChanged = hasChanged || nextStateForKey !== previousStateForKey;
|
|
25997
|
+
}
|
|
25998
|
+
|
|
25999
|
+
hasChanged = hasChanged || finalReducerKeys.length !== Object.keys(state).length;
|
|
26000
|
+
return hasChanged ? nextState : state;
|
|
26001
|
+
};
|
|
26002
|
+
}
|
|
26003
|
+
|
|
26004
|
+
function bindActionCreator(actionCreator, dispatch) {
|
|
26005
|
+
return function () {
|
|
26006
|
+
return dispatch(actionCreator.apply(this, arguments));
|
|
26007
|
+
};
|
|
26008
|
+
}
|
|
26009
|
+
/**
|
|
26010
|
+
* Turns an object whose values are action creators, into an object with the
|
|
26011
|
+
* same keys, but with every function wrapped into a `dispatch` call so they
|
|
26012
|
+
* may be invoked directly. This is just a convenience method, as you can call
|
|
26013
|
+
* `store.dispatch(MyActionCreators.doSomething())` yourself just fine.
|
|
26014
|
+
*
|
|
26015
|
+
* For convenience, you can also pass an action creator as the first argument,
|
|
26016
|
+
* and get a dispatch wrapped function in return.
|
|
26017
|
+
*
|
|
26018
|
+
* @param {Function|Object} actionCreators An object whose values are action
|
|
26019
|
+
* creator functions. One handy way to obtain it is to use ES6 `import * as`
|
|
26020
|
+
* syntax. You may also pass a single function.
|
|
26021
|
+
*
|
|
26022
|
+
* @param {Function} dispatch The `dispatch` function available on your Redux
|
|
26023
|
+
* store.
|
|
26024
|
+
*
|
|
26025
|
+
* @returns {Function|Object} The object mimicking the original object, but with
|
|
26026
|
+
* every action creator wrapped into the `dispatch` call. If you passed a
|
|
26027
|
+
* function as `actionCreators`, the return value will also be a single
|
|
26028
|
+
* function.
|
|
26029
|
+
*/
|
|
26030
|
+
|
|
26031
|
+
|
|
26032
|
+
function bindActionCreators(actionCreators, dispatch) {
|
|
26033
|
+
if (typeof actionCreators === 'function') {
|
|
26034
|
+
return bindActionCreator(actionCreators, dispatch);
|
|
26035
|
+
}
|
|
26036
|
+
|
|
26037
|
+
if (typeof actionCreators !== 'object' || actionCreators === null) {
|
|
26038
|
+
throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(16) : "bindActionCreators expected an object or a function, but instead received: '" + kindOf(actionCreators) + "'. " + "Did you write \"import ActionCreators from\" instead of \"import * as ActionCreators from\"?");
|
|
26039
|
+
}
|
|
26040
|
+
|
|
26041
|
+
var boundActionCreators = {};
|
|
26042
|
+
|
|
26043
|
+
for (var key in actionCreators) {
|
|
26044
|
+
var actionCreator = actionCreators[key];
|
|
26045
|
+
|
|
26046
|
+
if (typeof actionCreator === 'function') {
|
|
26047
|
+
boundActionCreators[key] = bindActionCreator(actionCreator, dispatch);
|
|
26048
|
+
}
|
|
26049
|
+
}
|
|
26050
|
+
|
|
26051
|
+
return boundActionCreators;
|
|
26052
|
+
}
|
|
26053
|
+
|
|
26054
|
+
/**
|
|
26055
|
+
* Composes single-argument functions from right to left. The rightmost
|
|
26056
|
+
* function can take multiple arguments as it provides the signature for
|
|
26057
|
+
* the resulting composite function.
|
|
26058
|
+
*
|
|
26059
|
+
* @param {...Function} funcs The functions to compose.
|
|
26060
|
+
* @returns {Function} A function obtained by composing the argument functions
|
|
26061
|
+
* from right to left. For example, compose(f, g, h) is identical to doing
|
|
26062
|
+
* (...args) => f(g(h(...args))).
|
|
26063
|
+
*/
|
|
26064
|
+
function compose() {
|
|
26065
|
+
for (var _len = arguments.length, funcs = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
26066
|
+
funcs[_key] = arguments[_key];
|
|
26067
|
+
}
|
|
26068
|
+
|
|
26069
|
+
if (funcs.length === 0) {
|
|
26070
|
+
return function (arg) {
|
|
26071
|
+
return arg;
|
|
26072
|
+
};
|
|
26073
|
+
}
|
|
26074
|
+
|
|
26075
|
+
if (funcs.length === 1) {
|
|
26076
|
+
return funcs[0];
|
|
26077
|
+
}
|
|
26078
|
+
|
|
26079
|
+
return funcs.reduce(function (a, b) {
|
|
26080
|
+
return function () {
|
|
26081
|
+
return a(b.apply(void 0, arguments));
|
|
26082
|
+
};
|
|
26083
|
+
});
|
|
26084
|
+
}
|
|
26085
|
+
|
|
26086
|
+
/**
|
|
26087
|
+
* Creates a store enhancer that applies middleware to the dispatch method
|
|
26088
|
+
* of the Redux store. This is handy for a variety of tasks, such as expressing
|
|
26089
|
+
* asynchronous actions in a concise manner, or logging every action payload.
|
|
26090
|
+
*
|
|
26091
|
+
* See `redux-thunk` package as an example of the Redux middleware.
|
|
26092
|
+
*
|
|
26093
|
+
* Because middleware is potentially asynchronous, this should be the first
|
|
26094
|
+
* store enhancer in the composition chain.
|
|
26095
|
+
*
|
|
26096
|
+
* Note that each middleware will be given the `dispatch` and `getState` functions
|
|
26097
|
+
* as named arguments.
|
|
26098
|
+
*
|
|
26099
|
+
* @param {...Function} middlewares The middleware chain to be applied.
|
|
26100
|
+
* @returns {Function} A store enhancer applying the middleware.
|
|
26101
|
+
*/
|
|
26102
|
+
|
|
26103
|
+
function applyMiddleware() {
|
|
26104
|
+
for (var _len = arguments.length, middlewares = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
26105
|
+
middlewares[_key] = arguments[_key];
|
|
26106
|
+
}
|
|
26107
|
+
|
|
26108
|
+
return function (createStore) {
|
|
26109
|
+
return function () {
|
|
26110
|
+
var store = createStore.apply(void 0, arguments);
|
|
26111
|
+
|
|
26112
|
+
var _dispatch = function dispatch() {
|
|
26113
|
+
throw new Error(process.env.NODE_ENV === "production" ? formatProdErrorMessage(15) : 'Dispatching while constructing your middleware is not allowed. ' + 'Other middleware would not be applied to this dispatch.');
|
|
26114
|
+
};
|
|
26115
|
+
|
|
26116
|
+
var middlewareAPI = {
|
|
26117
|
+
getState: store.getState,
|
|
26118
|
+
dispatch: function dispatch() {
|
|
26119
|
+
return _dispatch.apply(void 0, arguments);
|
|
26120
|
+
}
|
|
26121
|
+
};
|
|
26122
|
+
var chain = middlewares.map(function (middleware) {
|
|
26123
|
+
return middleware(middlewareAPI);
|
|
26124
|
+
});
|
|
26125
|
+
_dispatch = compose.apply(void 0, chain)(store.dispatch);
|
|
26126
|
+
return _objectSpread2(_objectSpread2({}, store), {}, {
|
|
26127
|
+
dispatch: _dispatch
|
|
26128
|
+
});
|
|
26129
|
+
};
|
|
26130
|
+
};
|
|
26131
|
+
}
|
|
26132
|
+
|
|
26133
|
+
var redux = /*#__PURE__*/Object.freeze({
|
|
26134
|
+
__proto__: null,
|
|
26135
|
+
__DO_NOT_USE__ActionTypes: ActionTypes,
|
|
26136
|
+
applyMiddleware: applyMiddleware,
|
|
26137
|
+
bindActionCreators: bindActionCreators,
|
|
26138
|
+
combineReducers: combineReducers,
|
|
26139
|
+
compose: compose,
|
|
26140
|
+
createStore: createStore,
|
|
26141
|
+
legacy_createStore: legacy_createStore
|
|
26142
|
+
});
|
|
26143
|
+
|
|
26144
|
+
var require$$0 = /*@__PURE__*/getAugmentedNamespace(redux);
|
|
26145
|
+
|
|
26146
|
+
/**
|
|
26147
|
+
* lodash (Custom Build) <https://lodash.com/>
|
|
26148
|
+
* Build: `lodash modularize exports="npm" -o ./`
|
|
26149
|
+
* Copyright jQuery Foundation and other contributors <https://jquery.org/>
|
|
26150
|
+
* Released under MIT license <https://lodash.com/license>
|
|
26151
|
+
* Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
|
|
26152
|
+
* Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
|
|
26153
|
+
*/
|
|
26154
|
+
|
|
26155
|
+
/** `Object#toString` result references. */
|
|
26156
|
+
var objectTag = '[object Object]';
|
|
26157
|
+
|
|
26158
|
+
/**
|
|
26159
|
+
* Checks if `value` is a host object in IE < 9.
|
|
26160
|
+
*
|
|
26161
|
+
* @private
|
|
26162
|
+
* @param {*} value The value to check.
|
|
26163
|
+
* @returns {boolean} Returns `true` if `value` is a host object, else `false`.
|
|
26164
|
+
*/
|
|
26165
|
+
function isHostObject(value) {
|
|
26166
|
+
// Many host objects are `Object` objects that can coerce to strings
|
|
26167
|
+
// despite having improperly defined `toString` methods.
|
|
26168
|
+
var result = false;
|
|
26169
|
+
if (value != null && typeof value.toString != 'function') {
|
|
26170
|
+
try {
|
|
26171
|
+
result = !!(value + '');
|
|
26172
|
+
} catch (e) {}
|
|
26173
|
+
}
|
|
26174
|
+
return result;
|
|
26175
|
+
}
|
|
26176
|
+
|
|
26177
|
+
/**
|
|
26178
|
+
* Creates a unary function that invokes `func` with its argument transformed.
|
|
26179
|
+
*
|
|
26180
|
+
* @private
|
|
26181
|
+
* @param {Function} func The function to wrap.
|
|
26182
|
+
* @param {Function} transform The argument transform.
|
|
26183
|
+
* @returns {Function} Returns the new function.
|
|
26184
|
+
*/
|
|
26185
|
+
function overArg(func, transform) {
|
|
26186
|
+
return function(arg) {
|
|
26187
|
+
return func(transform(arg));
|
|
26188
|
+
};
|
|
26189
|
+
}
|
|
26190
|
+
|
|
26191
|
+
/** Used for built-in method references. */
|
|
26192
|
+
var funcProto = Function.prototype,
|
|
26193
|
+
objectProto = Object.prototype;
|
|
26194
|
+
|
|
26195
|
+
/** Used to resolve the decompiled source of functions. */
|
|
26196
|
+
var funcToString = funcProto.toString;
|
|
26197
|
+
|
|
26198
|
+
/** Used to check objects for own properties. */
|
|
26199
|
+
var hasOwnProperty = objectProto.hasOwnProperty;
|
|
26200
|
+
|
|
26201
|
+
/** Used to infer the `Object` constructor. */
|
|
26202
|
+
var objectCtorString = funcToString.call(Object);
|
|
26203
|
+
|
|
26204
|
+
/**
|
|
26205
|
+
* Used to resolve the
|
|
26206
|
+
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
|
|
26207
|
+
* of values.
|
|
26208
|
+
*/
|
|
26209
|
+
var objectToString = objectProto.toString;
|
|
26210
|
+
|
|
26211
|
+
/** Built-in value references. */
|
|
26212
|
+
var getPrototype = overArg(Object.getPrototypeOf, Object);
|
|
26213
|
+
|
|
26214
|
+
/**
|
|
26215
|
+
* Checks if `value` is object-like. A value is object-like if it's not `null`
|
|
26216
|
+
* and has a `typeof` result of "object".
|
|
26217
|
+
*
|
|
26218
|
+
* @static
|
|
26219
|
+
* @memberOf _
|
|
26220
|
+
* @since 4.0.0
|
|
26221
|
+
* @category Lang
|
|
26222
|
+
* @param {*} value The value to check.
|
|
26223
|
+
* @returns {boolean} Returns `true` if `value` is object-like, else `false`.
|
|
26224
|
+
* @example
|
|
26225
|
+
*
|
|
26226
|
+
* _.isObjectLike({});
|
|
26227
|
+
* // => true
|
|
26228
|
+
*
|
|
26229
|
+
* _.isObjectLike([1, 2, 3]);
|
|
26230
|
+
* // => true
|
|
26231
|
+
*
|
|
26232
|
+
* _.isObjectLike(_.noop);
|
|
26233
|
+
* // => false
|
|
26234
|
+
*
|
|
26235
|
+
* _.isObjectLike(null);
|
|
26236
|
+
* // => false
|
|
26237
|
+
*/
|
|
26238
|
+
function isObjectLike(value) {
|
|
26239
|
+
return !!value && typeof value == 'object';
|
|
26240
|
+
}
|
|
26241
|
+
|
|
26242
|
+
/**
|
|
26243
|
+
* Checks if `value` is a plain object, that is, an object created by the
|
|
26244
|
+
* `Object` constructor or one with a `[[Prototype]]` of `null`.
|
|
26245
|
+
*
|
|
26246
|
+
* @static
|
|
26247
|
+
* @memberOf _
|
|
26248
|
+
* @since 0.8.0
|
|
26249
|
+
* @category Lang
|
|
26250
|
+
* @param {*} value The value to check.
|
|
26251
|
+
* @returns {boolean} Returns `true` if `value` is a plain object, else `false`.
|
|
26252
|
+
* @example
|
|
26253
|
+
*
|
|
26254
|
+
* function Foo() {
|
|
26255
|
+
* this.a = 1;
|
|
26256
|
+
* }
|
|
26257
|
+
*
|
|
26258
|
+
* _.isPlainObject(new Foo);
|
|
26259
|
+
* // => false
|
|
26260
|
+
*
|
|
26261
|
+
* _.isPlainObject([1, 2, 3]);
|
|
26262
|
+
* // => false
|
|
26263
|
+
*
|
|
26264
|
+
* _.isPlainObject({ 'x': 0, 'y': 0 });
|
|
26265
|
+
* // => true
|
|
26266
|
+
*
|
|
26267
|
+
* _.isPlainObject(Object.create(null));
|
|
26268
|
+
* // => true
|
|
26269
|
+
*/
|
|
26270
|
+
function isPlainObject$1(value) {
|
|
26271
|
+
if (!isObjectLike(value) ||
|
|
26272
|
+
objectToString.call(value) != objectTag || isHostObject(value)) {
|
|
26273
|
+
return false;
|
|
26274
|
+
}
|
|
26275
|
+
var proto = getPrototype(value);
|
|
26276
|
+
if (proto === null) {
|
|
26277
|
+
return true;
|
|
26278
|
+
}
|
|
26279
|
+
var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;
|
|
26280
|
+
return (typeof Ctor == 'function' &&
|
|
26281
|
+
Ctor instanceof Ctor && funcToString.call(Ctor) == objectCtorString);
|
|
26282
|
+
}
|
|
26283
|
+
|
|
26284
|
+
var lodash_isplainobject = isPlainObject$1;
|
|
26285
|
+
|
|
26286
|
+
Object.defineProperty(lib, "__esModule", {
|
|
26287
|
+
value: true
|
|
26288
|
+
});
|
|
26289
|
+
var _default = lib.default = configureStore$1;
|
|
26290
|
+
|
|
26291
|
+
var _redux = require$$0;
|
|
26292
|
+
|
|
26293
|
+
var _lodash = lodash_isplainobject;
|
|
26294
|
+
|
|
26295
|
+
var _lodash2 = _interopRequireDefault(_lodash);
|
|
26296
|
+
|
|
26297
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
26298
|
+
|
|
26299
|
+
function _toConsumableArray(arr) { if (Array.isArray(arr)) { for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) { arr2[i] = arr[i]; } return arr2; } else { return Array.from(arr); } }
|
|
26300
|
+
|
|
26301
|
+
var isFunction = function isFunction(arg) {
|
|
26302
|
+
return typeof arg === 'function';
|
|
26303
|
+
};
|
|
26304
|
+
|
|
26305
|
+
function configureStore$1() {
|
|
26306
|
+
var middlewares = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
26307
|
+
|
|
26308
|
+
return function mockStore() {
|
|
26309
|
+
var _getState = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
26310
|
+
|
|
26311
|
+
function mockStoreWithoutMiddleware() {
|
|
26312
|
+
var actions = [];
|
|
26313
|
+
var listeners = [];
|
|
26314
|
+
|
|
26315
|
+
var self = {
|
|
26316
|
+
getState: function getState() {
|
|
26317
|
+
return isFunction(_getState) ? _getState(actions) : _getState;
|
|
26318
|
+
},
|
|
26319
|
+
getActions: function getActions() {
|
|
26320
|
+
return actions;
|
|
26321
|
+
},
|
|
26322
|
+
dispatch: function dispatch(action) {
|
|
26323
|
+
if (!(0, _lodash2.default)(action)) {
|
|
26324
|
+
throw new Error('Actions must be plain objects. ' + 'Use custom middleware for async actions.');
|
|
26325
|
+
}
|
|
26326
|
+
|
|
26327
|
+
if (typeof action.type === 'undefined') {
|
|
26328
|
+
throw new Error('Actions may not have an undefined "type" property. ' + 'Have you misspelled a constant? ' + 'Action: ' + JSON.stringify(action));
|
|
26329
|
+
}
|
|
26330
|
+
|
|
26331
|
+
actions.push(action);
|
|
26332
|
+
|
|
26333
|
+
for (var i = 0; i < listeners.length; i++) {
|
|
26334
|
+
listeners[i]();
|
|
26335
|
+
}
|
|
26336
|
+
|
|
26337
|
+
return action;
|
|
26338
|
+
},
|
|
26339
|
+
clearActions: function clearActions() {
|
|
26340
|
+
actions = [];
|
|
26341
|
+
},
|
|
26342
|
+
subscribe: function subscribe(cb) {
|
|
26343
|
+
if (isFunction(cb)) {
|
|
26344
|
+
listeners.push(cb);
|
|
26345
|
+
}
|
|
26346
|
+
|
|
26347
|
+
return function () {
|
|
26348
|
+
var index = listeners.indexOf(cb);
|
|
26349
|
+
|
|
26350
|
+
if (index < 0) {
|
|
26351
|
+
return;
|
|
26352
|
+
}
|
|
26353
|
+
listeners.splice(index, 1);
|
|
26354
|
+
};
|
|
26355
|
+
},
|
|
26356
|
+
replaceReducer: function replaceReducer(nextReducer) {
|
|
26357
|
+
if (!isFunction(nextReducer)) {
|
|
26358
|
+
throw new Error('Expected the nextReducer to be a function.');
|
|
26359
|
+
}
|
|
26360
|
+
}
|
|
26361
|
+
};
|
|
26362
|
+
|
|
26363
|
+
return self;
|
|
26364
|
+
}
|
|
26365
|
+
|
|
26366
|
+
var mockStoreWithMiddleware = _redux.applyMiddleware.apply(undefined, _toConsumableArray(middlewares))(mockStoreWithoutMiddleware);
|
|
26367
|
+
|
|
26368
|
+
return mockStoreWithMiddleware();
|
|
26369
|
+
};
|
|
26370
|
+
}
|
|
26371
|
+
|
|
26372
|
+
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(n){return !!n&&!!n[Q]}function t(n){var r;return !!n&&(function(n){if(!n||"object"!=typeof n)return !1;var r=Object.getPrototypeOf(n);if(null===r)return !0;var t=Object.hasOwnProperty.call(r,"constructor")&&r.constructor;return t===Object||"function"==typeof t&&Function.toString.call(t)===Z}(n)||Array.isArray(n)||!!n[L]||!!(null===(r=n.constructor)||void 0===r?void 0:r[L])||s(n)||v(n))}function i(n,r,t){void 0===t&&(t=!1),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];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&&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];for(var t=nn(r),e=0;e<t.length;e++){var i=t[e],o=r[i];!1===o.writable&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(r[i]={configurable:!0,writable:!0,enumerable:o.enumerable,value:n[i]});}return Object.create(Object.getPrototypeOf(n),r)}function d(n,e){return void 0===e&&(e=!1),y(n)||r(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,!0)}),!0)),n}function h(){n(2);}function y(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||n(0),U}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&&(U=n.l);}function w(n){return U={p:[],l:U,h:n,m:!0,_:0}}function S(n){var r=n[Q];0===r.i||1===r.i?r.j():r.g=!0;}function P(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].P&&(g(e),n(4)),t(r)&&(r=M(e,r),e.l||x(e,r)),e.u&&b("Patches").M(i[Q].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(r))return r;var e=r[Q];if(!e)return i(r,(function(i,o){return A(n,e,r,i,o,t)}),!0),r;if(e.A!==n)return r;if(!e.P)return x(n,e.t,!0),e.t;if(!e.I){e.I=!0,e.A._--;var o=4===e.i||5===e.i?e.o=l(e.k):e.o,u=o,a=!1;3===e.i&&(u=new Set(o),o.clear(),a=!0),i(u,(function(r,i){return A(n,e,o,r,i,t,a)})),x(n,o,!1),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(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(p))return;e.m=!1;}else v&&o.add(c);if(t(c)&&!y(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=!1),!n.l&&n.h.D&&n.m&&d(r,t);}function z(n,r){var t=n[Q];return (t?p(t):n)[r]}function I(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=!0,n.l&&k(n.l));}function E(n){n.o||(n.o=l(n.t));}function N(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:!1,I:!1,R:{},l:r,t:n,k:null,o:null,j:null,C:!1},i=e,o=en;t&&(i=[e],o=on);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(e)||n(22,e),function n(r){if(!t(r))return r;var e,u=r[Q],c=o(r);if(u){if(!u.P&&(u.i<4||!b("ES5").K(u)))return u.t;u.I=!0,e=D(r,c),u.I=!1;}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(){function t(n,r){var t=s[n];return t?t.enumerable=r:s[n]=t={configurable:!0,enumerable:r,get:function(){var r=this[Q];return "production"!==process.env.NODE_ENV&&f(r),en.get(r,n)},set:function(r){var t=this[Q];"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];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){var a=r[o];if(void 0===a&&!u(r,o))return !0;var f=t[o],s=f&&f[Q];if(s?s.t!==a:!c(f,a))return !0}}var v=!!r[Q];return e.length!==nn(r).length+(v?0:1)}function a(n){var r=n.k;if(r.length!==n.t.length)return !0;var t=Object.getOwnPropertyDescriptor(r,r.length-1);if(t&&!t.get)return !0;for(var e=0;e<r.length;e++)if(!r.hasOwnProperty(e))return !0;return !1}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,!0));return e}var o=rn(r);delete o[Q];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:!1,I:!1,R:{},l:r,t:n,k:i,o:null,g:!1,C:!1};return Object.defineProperty(i,Q,{value:o,writable:!0}),i},S:function(n,t,o){o?r(t)&&t[Q].A===n&&e(n.p):(n.u&&function n(r){if(r&&"object"==typeof r){var t=r[Q];if(t){var e=t.t,o=t.k,f=t.R,c=t.i;if(4===c)i(o,(function(r){r!==Q&&(void 0!==e[r]||u(e,r)?f[r]||n(o[r]):(f[r]=!0,k(t)));})),i(e,(function(n){void 0!==o[n]||u(o,n)||(f[n]=!1,k(t));}));else if(5===c){if(a(t)&&(k(t),f.length=!0),o.length<e.length)for(var s=o.length;s<e.length;s++)f[s]=!1;else for(var v=e.length;v<o.length;v++)f[v]=!0;for(var p=Math.min(o.length,e.length),l=0;l<p;l++)o.hasOwnProperty(l)||(f[l]=!0),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,U,W="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),X="undefined"!=typeof Map,q="undefined"!=typeof Set,B="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,H=W?Symbol.for("immer-nothing"):((G={})["immer-nothing"]=!0,G),L=W?Symbol.for("immer-draftable"):"__$immer_draftable",Q=W?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=""+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)return n;var e=p(n);if(!u(e,r))return function(n,r,t){var e,i=I(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(n.t,r)?(E(n),n.o[r]=N(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(p(n),r);if(null==e?void 0:e.set)return e.set.call(n.k,t),!0;if(!n.P){var i=z(p(n),r),o=null==i?void 0:i[Q];if(o&&o.t===t)return n.o[r]=t,n.R[r]=!1,!0;if(c(t,i)&&(void 0!==t||u(n.t,r)))return !0;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]=!0),!0},deleteProperty:function(n,r){return void 0!==z(n.t,r)||r in n.t?(n.R[r]=!1,E(n),k(n)):delete n.R[r],n.o&&delete n.o[r],!0},getOwnPropertyDescriptor:function(n,r){var t=p(n),e=Reflect.getOwnPropertyDescriptor(t,r);return e?{writable:!0,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={};i(en,(function(n,r){on[n]=function(){return arguments[0]=arguments[0][0],r.apply(this,arguments)};})),on.deleteProperty=function(r,t){return "production"!==process.env.NODE_ENV&&isNaN(parseInt(t))&&n(13),on.set.call(this,r,t,void 0)},on.set=function(r,t,e){return "production"!==process.env.NODE_ENV&&"length"!==t&&isNaN(parseInt(t))&&n(14),en.set.call(this,r[0],t,e,r[0])};var un=function(){function e(r){var e=this;this.O=B,this.D=!0,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=this;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(e,r,void 0),v=!0;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(n,c)}),(function(n){throw g(c),n})):(j(c,o),P(f,c))}if(!r||"object"!=typeof r){if(void 0===(f=i(r))&&(f=r),f===H&&(f=void 0),e.D&&d(f,!0),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(e)&&(e=R(e));var i=w(this),o=N(this,e,void 0);return o[Q].C=!0,O(i),o},i.finishDraft=function(r,t){var e=r&&r[Q];"production"!==process.env.NODE_ENV&&(e&&e.C||n(9),e.I&&n(10));var i=e.A;return j(i,t),P(void 0,i)},i.setAutoFreeze=function(n){this.D=n;},i.setUseProxies=function(r){r&&!B&&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(n)?o(n,t):this.produce(n,(function(n){return o(n,t)}))},e}(),an=new un;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);
|
|
26373
|
+
|
|
26374
|
+
/** A function that accepts a potential "extra argument" value to be injected later,
|
|
26375
|
+
* and returns an instance of the thunk middleware that uses that value
|
|
26376
|
+
*/
|
|
26377
|
+
function createThunkMiddleware(extraArgument) {
|
|
26378
|
+
// Standard Redux middleware definition pattern:
|
|
26379
|
+
// See: https://redux.js.org/tutorials/fundamentals/part-4-store#writing-custom-middleware
|
|
26380
|
+
var middleware = function middleware(_ref) {
|
|
26381
|
+
var dispatch = _ref.dispatch,
|
|
26382
|
+
getState = _ref.getState;
|
|
26383
|
+
return function (next) {
|
|
26384
|
+
return function (action) {
|
|
26385
|
+
// The thunk middleware looks for any functions that were passed to `store.dispatch`.
|
|
26386
|
+
// If this "action" is really a function, call it and return the result.
|
|
26387
|
+
if (typeof action === 'function') {
|
|
26388
|
+
// Inject the store's `dispatch` and `getState` methods, as well as any "extra arg"
|
|
26389
|
+
return action(dispatch, getState, extraArgument);
|
|
26390
|
+
} // Otherwise, pass the action down the middleware chain as usual
|
|
26391
|
+
|
|
26392
|
+
|
|
26393
|
+
return next(action);
|
|
26394
|
+
};
|
|
26395
|
+
};
|
|
26396
|
+
};
|
|
26397
|
+
|
|
26398
|
+
return middleware;
|
|
26399
|
+
}
|
|
26400
|
+
|
|
26401
|
+
var thunk = createThunkMiddleware(); // Attach the factory function so users can create a customized version
|
|
26402
|
+
// with whatever "extra arg" they want to inject into their thunks
|
|
26403
|
+
|
|
26404
|
+
thunk.withExtraArgument = createThunkMiddleware;
|
|
26405
|
+
var thunkMiddleware = thunk;
|
|
26406
|
+
|
|
26407
|
+
var __extends = (undefined && undefined.__extends) || (function () {
|
|
26408
|
+
var extendStatics = function (d, b) {
|
|
26409
|
+
extendStatics = Object.setPrototypeOf ||
|
|
26410
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
26411
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
26412
|
+
return extendStatics(d, b);
|
|
26413
|
+
};
|
|
26414
|
+
return function (d, b) {
|
|
26415
|
+
if (typeof b !== "function" && b !== null)
|
|
26416
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
26417
|
+
extendStatics(d, b);
|
|
26418
|
+
function __() { this.constructor = d; }
|
|
26419
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
26420
|
+
};
|
|
26421
|
+
})();
|
|
26422
|
+
var __generator = (undefined && undefined.__generator) || function (thisArg, body) {
|
|
26423
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
26424
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
26425
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
26426
|
+
function step(op) {
|
|
26427
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
26428
|
+
while (_) try {
|
|
26429
|
+
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;
|
|
26430
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
26431
|
+
switch (op[0]) {
|
|
26432
|
+
case 0: case 1: t = op; break;
|
|
26433
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
26434
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
26435
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
26436
|
+
default:
|
|
26437
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
26438
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
26439
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
26440
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
26441
|
+
if (t[2]) _.ops.pop();
|
|
26442
|
+
_.trys.pop(); continue;
|
|
26443
|
+
}
|
|
26444
|
+
op = body.call(thisArg, _);
|
|
26445
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
26446
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
26447
|
+
}
|
|
26448
|
+
};
|
|
26449
|
+
var __spreadArray = (undefined && undefined.__spreadArray) || function (to, from) {
|
|
26450
|
+
for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
|
|
26451
|
+
to[j] = from[i];
|
|
26452
|
+
return to;
|
|
26453
|
+
};
|
|
26454
|
+
var __defProp = Object.defineProperty;
|
|
26455
|
+
var __defProps = Object.defineProperties;
|
|
26456
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
26457
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
26458
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
26459
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
26460
|
+
var __defNormalProp = function (obj, key, value) { return key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value: value }) : obj[key] = value; };
|
|
26461
|
+
var __spreadValues = function (a, b) {
|
|
26462
|
+
for (var prop in b || (b = {}))
|
|
26463
|
+
if (__hasOwnProp.call(b, prop))
|
|
26464
|
+
__defNormalProp(a, prop, b[prop]);
|
|
26465
|
+
if (__getOwnPropSymbols)
|
|
26466
|
+
for (var _i = 0, _c = __getOwnPropSymbols(b); _i < _c.length; _i++) {
|
|
26467
|
+
var prop = _c[_i];
|
|
26468
|
+
if (__propIsEnum.call(b, prop))
|
|
26469
|
+
__defNormalProp(a, prop, b[prop]);
|
|
26470
|
+
}
|
|
26471
|
+
return a;
|
|
26472
|
+
};
|
|
26473
|
+
var __spreadProps = function (a, b) { return __defProps(a, __getOwnPropDescs(b)); };
|
|
26474
|
+
var __async = function (__this, __arguments, generator) {
|
|
26475
|
+
return new Promise(function (resolve, reject) {
|
|
26476
|
+
var fulfilled = function (value) {
|
|
26477
|
+
try {
|
|
26478
|
+
step(generator.next(value));
|
|
26479
|
+
}
|
|
26480
|
+
catch (e) {
|
|
26481
|
+
reject(e);
|
|
26482
|
+
}
|
|
26483
|
+
};
|
|
26484
|
+
var rejected = function (value) {
|
|
26485
|
+
try {
|
|
26486
|
+
step(generator.throw(value));
|
|
26487
|
+
}
|
|
26488
|
+
catch (e) {
|
|
26489
|
+
reject(e);
|
|
26490
|
+
}
|
|
26491
|
+
};
|
|
26492
|
+
var step = function (x) { return x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected); };
|
|
26493
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
26494
|
+
});
|
|
26495
|
+
};
|
|
26496
|
+
var composeWithDevTools = typeof window !== "undefined" && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ ? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ : function () {
|
|
26497
|
+
if (arguments.length === 0)
|
|
26498
|
+
return void 0;
|
|
26499
|
+
if (typeof arguments[0] === "object")
|
|
26500
|
+
return compose;
|
|
26501
|
+
return compose.apply(null, arguments);
|
|
26502
|
+
};
|
|
26503
|
+
// src/isPlainObject.ts
|
|
26504
|
+
function isPlainObject(value) {
|
|
26505
|
+
if (typeof value !== "object" || value === null)
|
|
26506
|
+
return false;
|
|
26507
|
+
var proto = Object.getPrototypeOf(value);
|
|
26508
|
+
if (proto === null)
|
|
26509
|
+
return true;
|
|
26510
|
+
var baseProto = proto;
|
|
26511
|
+
while (Object.getPrototypeOf(baseProto) !== null) {
|
|
26512
|
+
baseProto = Object.getPrototypeOf(baseProto);
|
|
26513
|
+
}
|
|
26514
|
+
return proto === baseProto;
|
|
26515
|
+
}
|
|
26516
|
+
function getTimeMeasureUtils(maxDelay, fnName) {
|
|
26517
|
+
var elapsed = 0;
|
|
26518
|
+
return {
|
|
26519
|
+
measureTime: function (fn) {
|
|
26520
|
+
var started = Date.now();
|
|
26521
|
+
try {
|
|
26522
|
+
return fn();
|
|
26523
|
+
}
|
|
26524
|
+
finally {
|
|
26525
|
+
var finished = Date.now();
|
|
26526
|
+
elapsed += finished - started;
|
|
26527
|
+
}
|
|
26528
|
+
},
|
|
26529
|
+
warnIfExceeded: function () {
|
|
26530
|
+
if (elapsed > maxDelay) {
|
|
26531
|
+
console.warn(fnName + " took " + elapsed + "ms, which is more than the warning threshold of " + maxDelay + "ms. \nIf your state or actions are very large, you may want to disable the middleware as it might cause too much of a slowdown in development mode. See https://redux-toolkit.js.org/api/getDefaultMiddleware for instructions.\nIt is disabled in production builds, so you don't need to worry about that.");
|
|
26532
|
+
}
|
|
26533
|
+
}
|
|
26534
|
+
};
|
|
26535
|
+
}
|
|
26536
|
+
var MiddlewareArray = /** @class */ (function (_super) {
|
|
26537
|
+
__extends(MiddlewareArray, _super);
|
|
26538
|
+
function MiddlewareArray() {
|
|
26539
|
+
var args = [];
|
|
26540
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
26541
|
+
args[_i] = arguments[_i];
|
|
26542
|
+
}
|
|
26543
|
+
var _this = _super.apply(this, args) || this;
|
|
26544
|
+
Object.setPrototypeOf(_this, MiddlewareArray.prototype);
|
|
26545
|
+
return _this;
|
|
26546
|
+
}
|
|
26547
|
+
Object.defineProperty(MiddlewareArray, Symbol.species, {
|
|
26548
|
+
get: function () {
|
|
26549
|
+
return MiddlewareArray;
|
|
26550
|
+
},
|
|
26551
|
+
enumerable: false,
|
|
26552
|
+
configurable: true
|
|
26553
|
+
});
|
|
26554
|
+
MiddlewareArray.prototype.concat = function () {
|
|
26555
|
+
var arr = [];
|
|
26556
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
26557
|
+
arr[_i] = arguments[_i];
|
|
26558
|
+
}
|
|
26559
|
+
return _super.prototype.concat.apply(this, arr);
|
|
26560
|
+
};
|
|
26561
|
+
MiddlewareArray.prototype.prepend = function () {
|
|
26562
|
+
var arr = [];
|
|
26563
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
26564
|
+
arr[_i] = arguments[_i];
|
|
26565
|
+
}
|
|
26566
|
+
if (arr.length === 1 && Array.isArray(arr[0])) {
|
|
26567
|
+
return new (MiddlewareArray.bind.apply(MiddlewareArray, __spreadArray([void 0], arr[0].concat(this))))();
|
|
26568
|
+
}
|
|
26569
|
+
return new (MiddlewareArray.bind.apply(MiddlewareArray, __spreadArray([void 0], arr.concat(this))))();
|
|
26570
|
+
};
|
|
26571
|
+
return MiddlewareArray;
|
|
26572
|
+
}(Array));
|
|
26573
|
+
var EnhancerArray = /** @class */ (function (_super) {
|
|
26574
|
+
__extends(EnhancerArray, _super);
|
|
26575
|
+
function EnhancerArray() {
|
|
26576
|
+
var args = [];
|
|
26577
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
26578
|
+
args[_i] = arguments[_i];
|
|
26579
|
+
}
|
|
26580
|
+
var _this = _super.apply(this, args) || this;
|
|
26581
|
+
Object.setPrototypeOf(_this, EnhancerArray.prototype);
|
|
26582
|
+
return _this;
|
|
26583
|
+
}
|
|
26584
|
+
Object.defineProperty(EnhancerArray, Symbol.species, {
|
|
26585
|
+
get: function () {
|
|
26586
|
+
return EnhancerArray;
|
|
26587
|
+
},
|
|
26588
|
+
enumerable: false,
|
|
26589
|
+
configurable: true
|
|
26590
|
+
});
|
|
26591
|
+
EnhancerArray.prototype.concat = function () {
|
|
26592
|
+
var arr = [];
|
|
26593
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
26594
|
+
arr[_i] = arguments[_i];
|
|
26595
|
+
}
|
|
26596
|
+
return _super.prototype.concat.apply(this, arr);
|
|
26597
|
+
};
|
|
26598
|
+
EnhancerArray.prototype.prepend = function () {
|
|
26599
|
+
var arr = [];
|
|
26600
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
26601
|
+
arr[_i] = arguments[_i];
|
|
26602
|
+
}
|
|
26603
|
+
if (arr.length === 1 && Array.isArray(arr[0])) {
|
|
26604
|
+
return new (EnhancerArray.bind.apply(EnhancerArray, __spreadArray([void 0], arr[0].concat(this))))();
|
|
26605
|
+
}
|
|
26606
|
+
return new (EnhancerArray.bind.apply(EnhancerArray, __spreadArray([void 0], arr.concat(this))))();
|
|
26607
|
+
};
|
|
26608
|
+
return EnhancerArray;
|
|
26609
|
+
}(Array));
|
|
26610
|
+
// src/immutableStateInvariantMiddleware.ts
|
|
26611
|
+
var isProduction = process.env.NODE_ENV === "production";
|
|
26612
|
+
var prefix = "Invariant failed";
|
|
26613
|
+
function invariant(condition, message) {
|
|
26614
|
+
if (condition) {
|
|
26615
|
+
return;
|
|
26616
|
+
}
|
|
26617
|
+
if (isProduction) {
|
|
26618
|
+
throw new Error(prefix);
|
|
26619
|
+
}
|
|
26620
|
+
throw new Error(prefix + ": " + (message || ""));
|
|
26621
|
+
}
|
|
26622
|
+
function stringify(obj, serializer, indent, decycler) {
|
|
26623
|
+
return JSON.stringify(obj, getSerialize(serializer, decycler), indent);
|
|
26624
|
+
}
|
|
26625
|
+
function getSerialize(serializer, decycler) {
|
|
26626
|
+
var stack = [], keys = [];
|
|
26627
|
+
if (!decycler)
|
|
26628
|
+
decycler = function (_, value) {
|
|
26629
|
+
if (stack[0] === value)
|
|
26630
|
+
return "[Circular ~]";
|
|
26631
|
+
return "[Circular ~." + keys.slice(0, stack.indexOf(value)).join(".") + "]";
|
|
26632
|
+
};
|
|
26633
|
+
return function (key, value) {
|
|
26634
|
+
if (stack.length > 0) {
|
|
26635
|
+
var thisPos = stack.indexOf(this);
|
|
26636
|
+
~thisPos ? stack.splice(thisPos + 1) : stack.push(this);
|
|
26637
|
+
~thisPos ? keys.splice(thisPos, Infinity, key) : keys.push(key);
|
|
26638
|
+
if (~stack.indexOf(value))
|
|
26639
|
+
value = decycler.call(this, key, value);
|
|
26640
|
+
}
|
|
26641
|
+
else
|
|
26642
|
+
stack.push(value);
|
|
26643
|
+
return serializer == null ? value : serializer.call(this, key, value);
|
|
26644
|
+
};
|
|
26645
|
+
}
|
|
26646
|
+
function isImmutableDefault(value) {
|
|
26647
|
+
return typeof value !== "object" || value == null || Object.isFrozen(value);
|
|
26648
|
+
}
|
|
26649
|
+
function trackForMutations(isImmutable, ignorePaths, obj) {
|
|
26650
|
+
var trackedProperties = trackProperties(isImmutable, ignorePaths, obj);
|
|
26651
|
+
return {
|
|
26652
|
+
detectMutations: function () {
|
|
26653
|
+
return detectMutations(isImmutable, ignorePaths, trackedProperties, obj);
|
|
26654
|
+
}
|
|
26655
|
+
};
|
|
26656
|
+
}
|
|
26657
|
+
function trackProperties(isImmutable, ignorePaths, obj, path) {
|
|
26658
|
+
if (ignorePaths === void 0) { ignorePaths = []; }
|
|
26659
|
+
if (path === void 0) { path = ""; }
|
|
26660
|
+
var tracked = { value: obj };
|
|
26661
|
+
if (!isImmutable(obj)) {
|
|
26662
|
+
tracked.children = {};
|
|
26663
|
+
for (var key in obj) {
|
|
26664
|
+
var childPath = path ? path + "." + key : key;
|
|
26665
|
+
if (ignorePaths.length && ignorePaths.indexOf(childPath) !== -1) {
|
|
26666
|
+
continue;
|
|
26667
|
+
}
|
|
26668
|
+
tracked.children[key] = trackProperties(isImmutable, ignorePaths, obj[key], childPath);
|
|
26669
|
+
}
|
|
26670
|
+
}
|
|
26671
|
+
return tracked;
|
|
26672
|
+
}
|
|
26673
|
+
function detectMutations(isImmutable, ignoredPaths, trackedProperty, obj, sameParentRef, path) {
|
|
26674
|
+
if (ignoredPaths === void 0) { ignoredPaths = []; }
|
|
26675
|
+
if (sameParentRef === void 0) { sameParentRef = false; }
|
|
26676
|
+
if (path === void 0) { path = ""; }
|
|
26677
|
+
var prevObj = trackedProperty ? trackedProperty.value : void 0;
|
|
26678
|
+
var sameRef = prevObj === obj;
|
|
26679
|
+
if (sameParentRef && !sameRef && !Number.isNaN(obj)) {
|
|
26680
|
+
return { wasMutated: true, path: path };
|
|
26681
|
+
}
|
|
26682
|
+
if (isImmutable(prevObj) || isImmutable(obj)) {
|
|
26683
|
+
return { wasMutated: false };
|
|
26684
|
+
}
|
|
26685
|
+
var keysToDetect = {};
|
|
26686
|
+
for (var key in trackedProperty.children) {
|
|
26687
|
+
keysToDetect[key] = true;
|
|
26688
|
+
}
|
|
26689
|
+
for (var key in obj) {
|
|
26690
|
+
keysToDetect[key] = true;
|
|
26691
|
+
}
|
|
26692
|
+
var hasIgnoredPaths = ignoredPaths.length > 0;
|
|
26693
|
+
var _loop_1 = function (key) {
|
|
26694
|
+
var nestedPath = path ? path + "." + key : key;
|
|
26695
|
+
if (hasIgnoredPaths) {
|
|
26696
|
+
var hasMatches = ignoredPaths.some(function (ignored) {
|
|
26697
|
+
if (ignored instanceof RegExp) {
|
|
26698
|
+
return ignored.test(nestedPath);
|
|
26699
|
+
}
|
|
26700
|
+
return nestedPath === ignored;
|
|
26701
|
+
});
|
|
26702
|
+
if (hasMatches) {
|
|
26703
|
+
return "continue";
|
|
26704
|
+
}
|
|
26705
|
+
}
|
|
26706
|
+
var result = detectMutations(isImmutable, ignoredPaths, trackedProperty.children[key], obj[key], sameRef, nestedPath);
|
|
26707
|
+
if (result.wasMutated) {
|
|
26708
|
+
return { value: result };
|
|
26709
|
+
}
|
|
26710
|
+
};
|
|
26711
|
+
for (var key in keysToDetect) {
|
|
26712
|
+
var state_1 = _loop_1(key);
|
|
26713
|
+
if (typeof state_1 === "object")
|
|
26714
|
+
return state_1.value;
|
|
26715
|
+
}
|
|
26716
|
+
return { wasMutated: false };
|
|
26717
|
+
}
|
|
26718
|
+
function createImmutableStateInvariantMiddleware(options) {
|
|
26719
|
+
if (options === void 0) { options = {}; }
|
|
26720
|
+
if (process.env.NODE_ENV === "production") {
|
|
26721
|
+
return function () { return function (next) { return function (action) { return next(action); }; }; };
|
|
26722
|
+
}
|
|
26723
|
+
var _c = options.isImmutable, isImmutable = _c === void 0 ? isImmutableDefault : _c, ignoredPaths = options.ignoredPaths, _d = options.warnAfter, warnAfter = _d === void 0 ? 32 : _d, ignore = options.ignore;
|
|
26724
|
+
ignoredPaths = ignoredPaths || ignore;
|
|
26725
|
+
var track = trackForMutations.bind(null, isImmutable, ignoredPaths);
|
|
26726
|
+
return function (_c) {
|
|
26727
|
+
var getState = _c.getState;
|
|
26728
|
+
var state = getState();
|
|
26729
|
+
var tracker = track(state);
|
|
26730
|
+
var result;
|
|
26731
|
+
return function (next) { return function (action) {
|
|
26732
|
+
var measureUtils = getTimeMeasureUtils(warnAfter, "ImmutableStateInvariantMiddleware");
|
|
26733
|
+
measureUtils.measureTime(function () {
|
|
26734
|
+
state = getState();
|
|
26735
|
+
result = tracker.detectMutations();
|
|
26736
|
+
tracker = track(state);
|
|
26737
|
+
invariant(!result.wasMutated, "A state mutation was detected between dispatches, in the path '" + (result.path || "") + "'. This may cause incorrect behavior. (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)");
|
|
26738
|
+
});
|
|
26739
|
+
var dispatchedAction = next(action);
|
|
26740
|
+
measureUtils.measureTime(function () {
|
|
26741
|
+
state = getState();
|
|
26742
|
+
result = tracker.detectMutations();
|
|
26743
|
+
tracker = track(state);
|
|
26744
|
+
result.wasMutated && invariant(!result.wasMutated, "A state mutation was detected inside a dispatch, in the path: " + (result.path || "") + ". Take a look at the reducer(s) handling the action " + stringify(action) + ". (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)");
|
|
26745
|
+
});
|
|
26746
|
+
measureUtils.warnIfExceeded();
|
|
26747
|
+
return dispatchedAction;
|
|
26748
|
+
}; };
|
|
26749
|
+
};
|
|
26750
|
+
}
|
|
26751
|
+
// src/serializableStateInvariantMiddleware.ts
|
|
26752
|
+
function isPlain(val) {
|
|
26753
|
+
var type = typeof val;
|
|
26754
|
+
return val == null || type === "string" || type === "boolean" || type === "number" || Array.isArray(val) || isPlainObject(val);
|
|
26755
|
+
}
|
|
26756
|
+
function findNonSerializableValue(value, path, isSerializable, getEntries, ignoredPaths, cache) {
|
|
26757
|
+
if (path === void 0) { path = ""; }
|
|
26758
|
+
if (isSerializable === void 0) { isSerializable = isPlain; }
|
|
26759
|
+
if (ignoredPaths === void 0) { ignoredPaths = []; }
|
|
26760
|
+
var foundNestedSerializable;
|
|
26761
|
+
if (!isSerializable(value)) {
|
|
26762
|
+
return {
|
|
26763
|
+
keyPath: path || "<root>",
|
|
26764
|
+
value: value
|
|
26765
|
+
};
|
|
26766
|
+
}
|
|
26767
|
+
if (typeof value !== "object" || value === null) {
|
|
26768
|
+
return false;
|
|
26769
|
+
}
|
|
26770
|
+
if (cache == null ? void 0 : cache.has(value))
|
|
26771
|
+
return false;
|
|
26772
|
+
var entries = getEntries != null ? getEntries(value) : Object.entries(value);
|
|
26773
|
+
var hasIgnoredPaths = ignoredPaths.length > 0;
|
|
26774
|
+
var _loop_2 = function (key, nestedValue) {
|
|
26775
|
+
var nestedPath = path ? path + "." + key : key;
|
|
26776
|
+
if (hasIgnoredPaths) {
|
|
26777
|
+
var hasMatches = ignoredPaths.some(function (ignored) {
|
|
26778
|
+
if (ignored instanceof RegExp) {
|
|
26779
|
+
return ignored.test(nestedPath);
|
|
26780
|
+
}
|
|
26781
|
+
return nestedPath === ignored;
|
|
26782
|
+
});
|
|
26783
|
+
if (hasMatches) {
|
|
26784
|
+
return "continue";
|
|
26785
|
+
}
|
|
26786
|
+
}
|
|
26787
|
+
if (!isSerializable(nestedValue)) {
|
|
26788
|
+
return { value: {
|
|
26789
|
+
keyPath: nestedPath,
|
|
26790
|
+
value: nestedValue
|
|
26791
|
+
} };
|
|
26792
|
+
}
|
|
26793
|
+
if (typeof nestedValue === "object") {
|
|
26794
|
+
foundNestedSerializable = findNonSerializableValue(nestedValue, nestedPath, isSerializable, getEntries, ignoredPaths, cache);
|
|
26795
|
+
if (foundNestedSerializable) {
|
|
26796
|
+
return { value: foundNestedSerializable };
|
|
26797
|
+
}
|
|
26798
|
+
}
|
|
26799
|
+
};
|
|
26800
|
+
for (var _i = 0, entries_1 = entries; _i < entries_1.length; _i++) {
|
|
26801
|
+
var _c = entries_1[_i], key = _c[0], nestedValue = _c[1];
|
|
26802
|
+
var state_2 = _loop_2(key, nestedValue);
|
|
26803
|
+
if (typeof state_2 === "object")
|
|
26804
|
+
return state_2.value;
|
|
26805
|
+
}
|
|
26806
|
+
if (cache && isNestedFrozen(value))
|
|
26807
|
+
cache.add(value);
|
|
26808
|
+
return false;
|
|
26809
|
+
}
|
|
26810
|
+
function isNestedFrozen(value) {
|
|
26811
|
+
if (!Object.isFrozen(value))
|
|
26812
|
+
return false;
|
|
26813
|
+
for (var _i = 0, _c = Object.values(value); _i < _c.length; _i++) {
|
|
26814
|
+
var nestedValue = _c[_i];
|
|
26815
|
+
if (typeof nestedValue !== "object" || nestedValue === null)
|
|
26816
|
+
continue;
|
|
26817
|
+
if (!isNestedFrozen(nestedValue))
|
|
26818
|
+
return false;
|
|
26819
|
+
}
|
|
26820
|
+
return true;
|
|
26821
|
+
}
|
|
26822
|
+
function createSerializableStateInvariantMiddleware(options) {
|
|
26823
|
+
if (options === void 0) { options = {}; }
|
|
26824
|
+
if (process.env.NODE_ENV === "production") {
|
|
26825
|
+
return function () { return function (next) { return function (action) { return next(action); }; }; };
|
|
26826
|
+
}
|
|
26827
|
+
var _c = options.isSerializable, isSerializable = _c === void 0 ? isPlain : _c, getEntries = options.getEntries, _d = options.ignoredActions, ignoredActions = _d === void 0 ? [] : _d, _e = options.ignoredActionPaths, ignoredActionPaths = _e === void 0 ? ["meta.arg", "meta.baseQueryMeta"] : _e, _f = options.ignoredPaths, ignoredPaths = _f === void 0 ? [] : _f, _g = options.warnAfter, warnAfter = _g === void 0 ? 32 : _g, _h = options.ignoreState, ignoreState = _h === void 0 ? false : _h, _j = options.ignoreActions, ignoreActions = _j === void 0 ? false : _j, _k = options.disableCache, disableCache = _k === void 0 ? false : _k;
|
|
26828
|
+
var cache = !disableCache && WeakSet ? new WeakSet() : void 0;
|
|
26829
|
+
return function (storeAPI) { return function (next) { return function (action) {
|
|
26830
|
+
var result = next(action);
|
|
26831
|
+
var measureUtils = getTimeMeasureUtils(warnAfter, "SerializableStateInvariantMiddleware");
|
|
26832
|
+
if (!ignoreActions && !(ignoredActions.length && ignoredActions.indexOf(action.type) !== -1)) {
|
|
26833
|
+
measureUtils.measureTime(function () {
|
|
26834
|
+
var foundActionNonSerializableValue = findNonSerializableValue(action, "", isSerializable, getEntries, ignoredActionPaths, cache);
|
|
26835
|
+
if (foundActionNonSerializableValue) {
|
|
26836
|
+
var keyPath = foundActionNonSerializableValue.keyPath, value = foundActionNonSerializableValue.value;
|
|
26837
|
+
console.error("A non-serializable value was detected in an action, in the path: `" + keyPath + "`. Value:", value, "\nTake a look at the logic that dispatched this action: ", action, "\n(See https://redux.js.org/faq/actions#why-should-type-be-a-string-or-at-least-serializable-why-should-my-action-types-be-constants)", "\n(To allow non-serializable values see: https://redux-toolkit.js.org/usage/usage-guide#working-with-non-serializable-data)");
|
|
26838
|
+
}
|
|
26839
|
+
});
|
|
26840
|
+
}
|
|
26841
|
+
if (!ignoreState) {
|
|
26842
|
+
measureUtils.measureTime(function () {
|
|
26843
|
+
var state = storeAPI.getState();
|
|
26844
|
+
var foundStateNonSerializableValue = findNonSerializableValue(state, "", isSerializable, getEntries, ignoredPaths, cache);
|
|
26845
|
+
if (foundStateNonSerializableValue) {
|
|
26846
|
+
var keyPath = foundStateNonSerializableValue.keyPath, value = foundStateNonSerializableValue.value;
|
|
26847
|
+
console.error("A non-serializable value was detected in the state, in the path: `" + keyPath + "`. Value:", value, "\nTake a look at the reducer(s) handling this action type: " + action.type + ".\n(See https://redux.js.org/faq/organizing-state#can-i-put-functions-promises-or-other-non-serializable-items-in-my-store-state)");
|
|
26848
|
+
}
|
|
26849
|
+
});
|
|
26850
|
+
measureUtils.warnIfExceeded();
|
|
26851
|
+
}
|
|
26852
|
+
return result;
|
|
26853
|
+
}; }; };
|
|
26854
|
+
}
|
|
26855
|
+
// src/getDefaultMiddleware.ts
|
|
26856
|
+
function isBoolean(x) {
|
|
26857
|
+
return typeof x === "boolean";
|
|
26858
|
+
}
|
|
26859
|
+
function curryGetDefaultMiddleware() {
|
|
26860
|
+
return function curriedGetDefaultMiddleware(options) {
|
|
26861
|
+
return getDefaultMiddleware(options);
|
|
26862
|
+
};
|
|
26863
|
+
}
|
|
26864
|
+
function getDefaultMiddleware(options) {
|
|
26865
|
+
if (options === void 0) { options = {}; }
|
|
26866
|
+
var _c = options.thunk, thunk = _c === void 0 ? true : _c, _d = options.immutableCheck, immutableCheck = _d === void 0 ? true : _d, _e = options.serializableCheck, serializableCheck = _e === void 0 ? true : _e;
|
|
26867
|
+
var middlewareArray = new MiddlewareArray();
|
|
26868
|
+
if (thunk) {
|
|
26869
|
+
if (isBoolean(thunk)) {
|
|
26870
|
+
middlewareArray.push(thunkMiddleware);
|
|
26871
|
+
}
|
|
26872
|
+
else {
|
|
26873
|
+
middlewareArray.push(thunkMiddleware.withExtraArgument(thunk.extraArgument));
|
|
26874
|
+
}
|
|
26875
|
+
}
|
|
26876
|
+
if (process.env.NODE_ENV !== "production") {
|
|
26877
|
+
if (immutableCheck) {
|
|
26878
|
+
var immutableOptions = {};
|
|
26879
|
+
if (!isBoolean(immutableCheck)) {
|
|
26880
|
+
immutableOptions = immutableCheck;
|
|
26881
|
+
}
|
|
26882
|
+
middlewareArray.unshift(createImmutableStateInvariantMiddleware(immutableOptions));
|
|
26883
|
+
}
|
|
26884
|
+
if (serializableCheck) {
|
|
26885
|
+
var serializableOptions = {};
|
|
26886
|
+
if (!isBoolean(serializableCheck)) {
|
|
26887
|
+
serializableOptions = serializableCheck;
|
|
26888
|
+
}
|
|
26889
|
+
middlewareArray.push(createSerializableStateInvariantMiddleware(serializableOptions));
|
|
26890
|
+
}
|
|
26891
|
+
}
|
|
26892
|
+
return middlewareArray;
|
|
26893
|
+
}
|
|
26894
|
+
// src/configureStore.ts
|
|
26895
|
+
var IS_PRODUCTION = process.env.NODE_ENV === "production";
|
|
26896
|
+
function configureStore(options) {
|
|
26897
|
+
var curriedGetDefaultMiddleware = curryGetDefaultMiddleware();
|
|
26898
|
+
var _c = options || {}, _d = _c.reducer, reducer = _d === void 0 ? void 0 : _d, _e = _c.middleware, middleware = _e === void 0 ? curriedGetDefaultMiddleware() : _e, _f = _c.devTools, devTools = _f === void 0 ? true : _f, _g = _c.preloadedState, preloadedState = _g === void 0 ? void 0 : _g, _h = _c.enhancers, enhancers = _h === void 0 ? void 0 : _h;
|
|
26899
|
+
var rootReducer;
|
|
26900
|
+
if (typeof reducer === "function") {
|
|
26901
|
+
rootReducer = reducer;
|
|
26902
|
+
}
|
|
26903
|
+
else if (isPlainObject(reducer)) {
|
|
26904
|
+
rootReducer = combineReducers(reducer);
|
|
26905
|
+
}
|
|
26906
|
+
else {
|
|
26907
|
+
throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');
|
|
26908
|
+
}
|
|
26909
|
+
var finalMiddleware = middleware;
|
|
26910
|
+
if (typeof finalMiddleware === "function") {
|
|
26911
|
+
finalMiddleware = finalMiddleware(curriedGetDefaultMiddleware);
|
|
26912
|
+
if (!IS_PRODUCTION && !Array.isArray(finalMiddleware)) {
|
|
26913
|
+
throw new Error("when using a middleware builder function, an array of middleware must be returned");
|
|
26914
|
+
}
|
|
26915
|
+
}
|
|
26916
|
+
if (!IS_PRODUCTION && finalMiddleware.some(function (item) { return typeof item !== "function"; })) {
|
|
26917
|
+
throw new Error("each middleware provided to configureStore must be a function");
|
|
26918
|
+
}
|
|
26919
|
+
var middlewareEnhancer = applyMiddleware.apply(void 0, finalMiddleware);
|
|
26920
|
+
var finalCompose = compose;
|
|
26921
|
+
if (devTools) {
|
|
26922
|
+
finalCompose = composeWithDevTools(__spreadValues({
|
|
26923
|
+
trace: !IS_PRODUCTION
|
|
26924
|
+
}, typeof devTools === "object" && devTools));
|
|
26925
|
+
}
|
|
26926
|
+
var defaultEnhancers = new EnhancerArray(middlewareEnhancer);
|
|
26927
|
+
var storeEnhancers = defaultEnhancers;
|
|
26928
|
+
if (Array.isArray(enhancers)) {
|
|
26929
|
+
storeEnhancers = __spreadArray([middlewareEnhancer], enhancers);
|
|
26930
|
+
}
|
|
26931
|
+
else if (typeof enhancers === "function") {
|
|
26932
|
+
storeEnhancers = enhancers(defaultEnhancers);
|
|
26933
|
+
}
|
|
26934
|
+
var composedEnhancer = finalCompose.apply(void 0, storeEnhancers);
|
|
26935
|
+
return createStore(rootReducer, preloadedState, composedEnhancer);
|
|
26936
|
+
}
|
|
26937
|
+
// src/createAction.ts
|
|
26938
|
+
function createAction(type, prepareAction) {
|
|
26939
|
+
function actionCreator() {
|
|
26940
|
+
var args = [];
|
|
26941
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
26942
|
+
args[_i] = arguments[_i];
|
|
26943
|
+
}
|
|
26944
|
+
if (prepareAction) {
|
|
26945
|
+
var prepared = prepareAction.apply(void 0, args);
|
|
26946
|
+
if (!prepared) {
|
|
26947
|
+
throw new Error("prepareAction did not return an object");
|
|
26948
|
+
}
|
|
26949
|
+
return __spreadValues(__spreadValues({
|
|
26950
|
+
type: type,
|
|
26951
|
+
payload: prepared.payload
|
|
26952
|
+
}, "meta" in prepared && { meta: prepared.meta }), "error" in prepared && { error: prepared.error });
|
|
26953
|
+
}
|
|
26954
|
+
return { type: type, payload: args[0] };
|
|
26955
|
+
}
|
|
26956
|
+
actionCreator.toString = function () { return "" + type; };
|
|
26957
|
+
actionCreator.type = type;
|
|
26958
|
+
actionCreator.match = function (action) { return action.type === type; };
|
|
26959
|
+
return actionCreator;
|
|
26960
|
+
}
|
|
26961
|
+
// src/nanoid.ts
|
|
26962
|
+
var urlAlphabet = "ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW";
|
|
26963
|
+
var nanoid = function (size) {
|
|
26964
|
+
if (size === void 0) { size = 21; }
|
|
26965
|
+
var id = "";
|
|
26966
|
+
var i = size;
|
|
26967
|
+
while (i--) {
|
|
26968
|
+
id += urlAlphabet[Math.random() * 64 | 0];
|
|
26969
|
+
}
|
|
26970
|
+
return id;
|
|
26971
|
+
};
|
|
26972
|
+
// src/createAsyncThunk.ts
|
|
26973
|
+
var commonProperties = [
|
|
26974
|
+
"name",
|
|
26975
|
+
"message",
|
|
26976
|
+
"stack",
|
|
26977
|
+
"code"
|
|
26978
|
+
];
|
|
26979
|
+
var RejectWithValue = /** @class */ (function () {
|
|
26980
|
+
function RejectWithValue(payload, meta) {
|
|
26981
|
+
this.payload = payload;
|
|
26982
|
+
this.meta = meta;
|
|
26983
|
+
}
|
|
26984
|
+
return RejectWithValue;
|
|
26985
|
+
}());
|
|
26986
|
+
var FulfillWithMeta = /** @class */ (function () {
|
|
26987
|
+
function FulfillWithMeta(payload, meta) {
|
|
26988
|
+
this.payload = payload;
|
|
26989
|
+
this.meta = meta;
|
|
26990
|
+
}
|
|
26991
|
+
return FulfillWithMeta;
|
|
26992
|
+
}());
|
|
26993
|
+
var miniSerializeError = function (value) {
|
|
26994
|
+
if (typeof value === "object" && value !== null) {
|
|
26995
|
+
var simpleError = {};
|
|
26996
|
+
for (var _i = 0, commonProperties_1 = commonProperties; _i < commonProperties_1.length; _i++) {
|
|
26997
|
+
var property = commonProperties_1[_i];
|
|
26998
|
+
if (typeof value[property] === "string") {
|
|
26999
|
+
simpleError[property] = value[property];
|
|
27000
|
+
}
|
|
27001
|
+
}
|
|
27002
|
+
return simpleError;
|
|
27003
|
+
}
|
|
27004
|
+
return { message: String(value) };
|
|
27005
|
+
};
|
|
27006
|
+
((function () {
|
|
27007
|
+
function createAsyncThunk2(typePrefix, payloadCreator, options) {
|
|
27008
|
+
var fulfilled = createAction(typePrefix + "/fulfilled", function (payload, requestId, arg, meta) { return ({
|
|
27009
|
+
payload: payload,
|
|
27010
|
+
meta: __spreadProps(__spreadValues({}, meta || {}), {
|
|
27011
|
+
arg: arg,
|
|
27012
|
+
requestId: requestId,
|
|
27013
|
+
requestStatus: "fulfilled"
|
|
27014
|
+
})
|
|
27015
|
+
}); });
|
|
27016
|
+
var pending = createAction(typePrefix + "/pending", function (requestId, arg, meta) { return ({
|
|
27017
|
+
payload: void 0,
|
|
27018
|
+
meta: __spreadProps(__spreadValues({}, meta || {}), {
|
|
27019
|
+
arg: arg,
|
|
27020
|
+
requestId: requestId,
|
|
27021
|
+
requestStatus: "pending"
|
|
27022
|
+
})
|
|
27023
|
+
}); });
|
|
27024
|
+
var rejected = createAction(typePrefix + "/rejected", function (error, requestId, arg, payload, meta) { return ({
|
|
27025
|
+
payload: payload,
|
|
27026
|
+
error: (options && options.serializeError || miniSerializeError)(error || "Rejected"),
|
|
27027
|
+
meta: __spreadProps(__spreadValues({}, meta || {}), {
|
|
27028
|
+
arg: arg,
|
|
27029
|
+
requestId: requestId,
|
|
27030
|
+
rejectedWithValue: !!payload,
|
|
27031
|
+
requestStatus: "rejected",
|
|
27032
|
+
aborted: (error == null ? void 0 : error.name) === "AbortError",
|
|
27033
|
+
condition: (error == null ? void 0 : error.name) === "ConditionError"
|
|
27034
|
+
})
|
|
27035
|
+
}); });
|
|
27036
|
+
var displayedWarning = false;
|
|
27037
|
+
var AC = typeof AbortController !== "undefined" ? AbortController : /** @class */ (function () {
|
|
27038
|
+
function class_1() {
|
|
27039
|
+
this.signal = {
|
|
27040
|
+
aborted: false,
|
|
27041
|
+
addEventListener: function () {
|
|
27042
|
+
},
|
|
27043
|
+
dispatchEvent: function () {
|
|
27044
|
+
return false;
|
|
27045
|
+
},
|
|
27046
|
+
onabort: function () {
|
|
27047
|
+
},
|
|
27048
|
+
removeEventListener: function () {
|
|
27049
|
+
},
|
|
27050
|
+
reason: void 0,
|
|
27051
|
+
throwIfAborted: function () {
|
|
27052
|
+
}
|
|
27053
|
+
};
|
|
27054
|
+
}
|
|
27055
|
+
class_1.prototype.abort = function () {
|
|
27056
|
+
if (process.env.NODE_ENV !== "production") {
|
|
27057
|
+
if (!displayedWarning) {
|
|
27058
|
+
displayedWarning = true;
|
|
27059
|
+
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'.");
|
|
27060
|
+
}
|
|
27061
|
+
}
|
|
27062
|
+
};
|
|
27063
|
+
return class_1;
|
|
27064
|
+
}());
|
|
27065
|
+
function actionCreator(arg) {
|
|
27066
|
+
return function (dispatch, getState, extra) {
|
|
27067
|
+
var requestId = (options == null ? void 0 : options.idGenerator) ? options.idGenerator(arg) : nanoid();
|
|
27068
|
+
var abortController = new AC();
|
|
27069
|
+
var abortReason;
|
|
27070
|
+
function abort(reason) {
|
|
27071
|
+
abortReason = reason;
|
|
27072
|
+
abortController.abort();
|
|
27073
|
+
}
|
|
27074
|
+
var promise2 = function () {
|
|
27075
|
+
return __async(this, null, function () {
|
|
27076
|
+
var _a, _b, finalAction, conditionResult, abortedPromise, err_1, skipDispatch;
|
|
27077
|
+
return __generator(this, function (_c) {
|
|
27078
|
+
switch (_c.label) {
|
|
27079
|
+
case 0:
|
|
27080
|
+
_c.trys.push([0, 4, , 5]);
|
|
27081
|
+
conditionResult = (_a = options == null ? void 0 : options.condition) == null ? void 0 : _a.call(options, arg, { getState: getState, extra: extra });
|
|
27082
|
+
if (!isThenable(conditionResult)) return [3 /*break*/, 2];
|
|
27083
|
+
return [4 /*yield*/, conditionResult];
|
|
27084
|
+
case 1:
|
|
27085
|
+
conditionResult = _c.sent();
|
|
27086
|
+
_c.label = 2;
|
|
27087
|
+
case 2:
|
|
27088
|
+
if (conditionResult === false || abortController.signal.aborted) {
|
|
27089
|
+
throw {
|
|
27090
|
+
name: "ConditionError",
|
|
27091
|
+
message: "Aborted due to condition callback returning false."
|
|
27092
|
+
};
|
|
27093
|
+
}
|
|
27094
|
+
abortedPromise = new Promise(function (_, reject) { return abortController.signal.addEventListener("abort", function () { return reject({
|
|
27095
|
+
name: "AbortError",
|
|
27096
|
+
message: abortReason || "Aborted"
|
|
27097
|
+
}); }); });
|
|
27098
|
+
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 })));
|
|
27099
|
+
return [4 /*yield*/, Promise.race([
|
|
27100
|
+
abortedPromise,
|
|
27101
|
+
Promise.resolve(payloadCreator(arg, {
|
|
27102
|
+
dispatch: dispatch,
|
|
27103
|
+
getState: getState,
|
|
27104
|
+
extra: extra,
|
|
27105
|
+
requestId: requestId,
|
|
27106
|
+
signal: abortController.signal,
|
|
27107
|
+
abort: abort,
|
|
27108
|
+
rejectWithValue: function (value, meta) {
|
|
27109
|
+
return new RejectWithValue(value, meta);
|
|
27110
|
+
},
|
|
27111
|
+
fulfillWithValue: function (value, meta) {
|
|
27112
|
+
return new FulfillWithMeta(value, meta);
|
|
27113
|
+
}
|
|
27114
|
+
})).then(function (result) {
|
|
27115
|
+
if (result instanceof RejectWithValue) {
|
|
27116
|
+
throw result;
|
|
27117
|
+
}
|
|
27118
|
+
if (result instanceof FulfillWithMeta) {
|
|
27119
|
+
return fulfilled(result.payload, requestId, arg, result.meta);
|
|
27120
|
+
}
|
|
27121
|
+
return fulfilled(result, requestId, arg);
|
|
27122
|
+
})
|
|
27123
|
+
])];
|
|
27124
|
+
case 3:
|
|
27125
|
+
finalAction = _c.sent();
|
|
27126
|
+
return [3 /*break*/, 5];
|
|
27127
|
+
case 4:
|
|
27128
|
+
err_1 = _c.sent();
|
|
27129
|
+
finalAction = err_1 instanceof RejectWithValue ? rejected(null, requestId, arg, err_1.payload, err_1.meta) : rejected(err_1, requestId, arg);
|
|
27130
|
+
return [3 /*break*/, 5];
|
|
27131
|
+
case 5:
|
|
27132
|
+
skipDispatch = options && !options.dispatchConditionRejection && rejected.match(finalAction) && finalAction.meta.condition;
|
|
27133
|
+
if (!skipDispatch) {
|
|
27134
|
+
dispatch(finalAction);
|
|
27135
|
+
}
|
|
27136
|
+
return [2 /*return*/, finalAction];
|
|
27137
|
+
}
|
|
27138
|
+
});
|
|
27139
|
+
});
|
|
27140
|
+
}();
|
|
27141
|
+
return Object.assign(promise2, {
|
|
27142
|
+
abort: abort,
|
|
27143
|
+
requestId: requestId,
|
|
27144
|
+
arg: arg,
|
|
27145
|
+
unwrap: function () {
|
|
27146
|
+
return promise2.then(unwrapResult);
|
|
27147
|
+
}
|
|
27148
|
+
});
|
|
27149
|
+
};
|
|
27150
|
+
}
|
|
27151
|
+
return Object.assign(actionCreator, {
|
|
27152
|
+
pending: pending,
|
|
27153
|
+
rejected: rejected,
|
|
27154
|
+
fulfilled: fulfilled,
|
|
27155
|
+
typePrefix: typePrefix
|
|
27156
|
+
});
|
|
27157
|
+
}
|
|
27158
|
+
createAsyncThunk2.withTypes = function () { return createAsyncThunk2; };
|
|
27159
|
+
return createAsyncThunk2;
|
|
27160
|
+
}))();
|
|
27161
|
+
function unwrapResult(action) {
|
|
27162
|
+
if (action.meta && action.meta.rejectedWithValue) {
|
|
27163
|
+
throw action.payload;
|
|
27164
|
+
}
|
|
27165
|
+
if (action.error) {
|
|
27166
|
+
throw action.error;
|
|
27167
|
+
}
|
|
27168
|
+
return action.payload;
|
|
27169
|
+
}
|
|
27170
|
+
function isThenable(value) {
|
|
27171
|
+
return value !== null && typeof value === "object" && typeof value.then === "function";
|
|
27172
|
+
}
|
|
27173
|
+
var alm = "listenerMiddleware";
|
|
27174
|
+
createAction(alm + "/add");
|
|
27175
|
+
createAction(alm + "/removeAll");
|
|
27176
|
+
createAction(alm + "/remove");
|
|
27177
|
+
var promise;
|
|
27178
|
+
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 () {
|
|
27179
|
+
throw err;
|
|
27180
|
+
}, 0); }); };
|
|
27181
|
+
// src/index.ts
|
|
27182
|
+
F();
|
|
27183
|
+
|
|
27184
|
+
/* *
|
|
27185
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
27186
|
+
* you may not use this file except in compliance with the License.
|
|
27187
|
+
* You may obtain a copy of the License at
|
|
27188
|
+
*
|
|
27189
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
27190
|
+
*
|
|
27191
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
27192
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
27193
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
27194
|
+
* See the License for the specific language governing permissions and
|
|
27195
|
+
* limitations under the License.
|
|
27196
|
+
*
|
|
27197
|
+
* Copyright 2023 - Koninklijk Nederlands Meteorologisch Instituut (KNMI)
|
|
27198
|
+
* Copyright 2023 - Finnish Meteorological Institute (FMI)
|
|
27199
|
+
* */
|
|
27200
|
+
var createMockStoreWithEggs = function createMockStoreWithEggs(mockState) {
|
|
27201
|
+
var mockStore = _default();
|
|
27202
|
+
var store = mockStore(mockState);
|
|
27203
|
+
store.addEggs = typeof jest !== 'undefined' ? jest.fn() : function () {}; // mocking the dynamic module loader
|
|
27204
|
+
return store;
|
|
27205
|
+
};
|
|
27206
|
+
var createMockStoreWithEggsAndMiddleware = function createMockStoreWithEggsAndMiddleware(mockState,
|
|
27207
|
+
// eslint-disable-next-line @typescript-eslint/ban-types, @typescript-eslint/no-explicit-any
|
|
27208
|
+
middleware) {
|
|
27209
|
+
var mockStore = _default([middleware]);
|
|
27210
|
+
var store = mockStore(mockState);
|
|
27211
|
+
store.addEggs = typeof jest !== 'undefined' ? jest.fn() : function () {}; // mocking the dynamic module loader
|
|
27212
|
+
return store;
|
|
27213
|
+
};
|
|
27214
|
+
var createToolkitMockStoreWithEggs = function createToolkitMockStoreWithEggs(storeConfig) {
|
|
27215
|
+
var reducer = storeConfig.reducer,
|
|
27216
|
+
preloadedState = storeConfig.preloadedState;
|
|
27217
|
+
var store = configureStore({
|
|
27218
|
+
reducer: reducer,
|
|
27219
|
+
preloadedState: preloadedState
|
|
27220
|
+
});
|
|
27221
|
+
store.addEggs = typeof jest !== 'undefined' ? jest.fn() : function () {}; // mocking the dynamic module loader
|
|
27222
|
+
return store;
|
|
27223
|
+
};
|
|
27224
|
+
|
|
27225
|
+
export { AlertBanner, AlertIcon, AppHeader, AppLayout, Avatar, ConfirmationDialog, ConfirmationServiceProvider, CustomAccordion, CustomDialog, CustomIconButton, CustomSlider, CustomToggleButton, CustomTooltip, DEFAULT_ERROR_MESSAGE, DraggableComponent$1 as Draggable, ErrorBoundary, ResizeComponent as Resizable, SearchHighlight, StatusTag, ToggleMenu, ToolContainer, DraggableComponent as ToolContainerDraggable, ToolFooter, ToolHeader, TooltipSelect, UserMenu, UserMenuItemCheatSheet, MenuItemTheme as UserMenuItemTheme, adjustPosition, calculateDialogSizeAndPosition, createMockStoreWithEggs, createMockStoreWithEggsAndMiddleware, createToolkitMockStoreWithEggs, index as dateUtils, defaultDelay, getAxiosErrorMessage, getAxiosWarningMessage, getErrorMessage, getInitials, getPosition, getWarningMessage, isAxiosError, showPrompt, sliderHeaderStyle, tooltipContainerStyles, useConfirmationDialog, useControlledTooltip, useDialogActions, useIsMounted, useMakeSureContainerStaysInsideWindow, usePoller, usePreventBrowserClose, usePrevious, useUserMenu, withEggs };
|