| @@ -1,7 +1,168 @@ | ||
| 1 | +/*! elementor - v3.32.0 - 03-09-2025 */ | |
| 1 | 2 | /******/ (() => { // webpackBootstrap |
| 2 | 3 | /******/ var __webpack_modules__ = ({ |
| 3 | 4 | |
| 5 | +/***/ "../app/assets/js/event-track/apps-event-tracking.js": | |
| 6 | +/*!***********************************************************!*\ | |
| 7 | + !*** ../app/assets/js/event-track/apps-event-tracking.js ***! | |
| 8 | + \***********************************************************/ | |
| 9 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 10 | + | |
| 11 | +"use strict"; | |
| 12 | + | |
| 13 | + | |
| 14 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 15 | +Object.defineProperty(exports, "__esModule", ({ | |
| 16 | + value: true | |
| 17 | +})); | |
| 18 | +exports.appsEventTrackingDispatch = exports.AppsEventTracking = void 0; | |
| 19 | +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js")); | |
| 20 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 21 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 22 | +var _eventsConfig = _interopRequireDefault(__webpack_require__(/*! ../../../../core/common/modules/events-manager/assets/js/events-config */ "../core/common/modules/events-manager/assets/js/events-config.js")); | |
| 23 | +function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } | |
| 24 | +function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } | |
| 25 | +function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; } | |
| 26 | +function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } } | |
| 27 | +function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } | |
| 28 | +var EVENTS_MAP = { | |
| 29 | + PAGE_VIEWS_WEBSITE_TEMPLATES: 'page_views_website_templates', | |
| 30 | + KITS_CLOUD_UPGRADE_CLICKED: 'kits_cloud_upgrade_clicked', | |
| 31 | + EXPORT_KIT_CUSTOMIZATION: 'export_kit_customization', | |
| 32 | + IMPORT_KIT_CUSTOMIZATION: 'import_kit_customization', | |
| 33 | + KIT_IMPORT_STATUS: 'kit_import_status', | |
| 34 | + KIT_CLOUD_LIBRARY_APPLY: 'kit_cloud_library_apply', | |
| 35 | + KIT_CLOUD_LIBRARY_DELETE: 'kit_cloud_library_delete', | |
| 36 | + IMPORT_EXPORT_ADMIN_ACTION: 'ie_admin_action', | |
| 37 | + KIT_IMPORT_UPLOAD_FILE: 'kit_import_upload_file' | |
| 38 | +}; | |
| 39 | +var appsEventTrackingDispatch = exports.appsEventTrackingDispatch = function appsEventTrackingDispatch(command, eventParams) { | |
| 40 | + // Add existing eventParams key value pair to the data/details object. | |
| 41 | + var objectCreator = function objectCreator(array, obj) { | |
| 42 | + var _iterator = _createForOfIteratorHelper(array), | |
| 43 | + _step; | |
| 44 | + try { | |
| 45 | + for (_iterator.s(); !(_step = _iterator.n()).done;) { | |
| 46 | + var key = _step.value; | |
| 47 | + if (eventParams.hasOwnProperty(key) && eventParams[key] !== null) { | |
| 48 | + obj[key] = eventParams[key]; | |
| 49 | + } | |
| 50 | + } | |
| 51 | + } catch (err) { | |
| 52 | + _iterator.e(err); | |
| 53 | + } finally { | |
| 54 | + _iterator.f(); | |
| 55 | + } | |
| 56 | + return obj; | |
| 57 | + }; | |
| 58 | + var dataKeys = []; | |
| 59 | + var detailsKeys = ['layout', 'site_part', 'error', 'document_name', 'document_type', 'view_type_clicked', 'tag', 'sort_direction', 'sort_type', 'action', 'grid_location', 'kit_name', 'page_source', 'element_position', 'element', 'event_type', 'modal_type', 'method', 'status', 'step', 'item', 'category', 'element_location', 'search_term', 'section', 'site_area']; | |
| 60 | + var data = {}; | |
| 61 | + var details = {}; | |
| 62 | + var init = function init() { | |
| 63 | + objectCreator(detailsKeys, details); | |
| 64 | + objectCreator(dataKeys, data); | |
| 65 | + var commandSplit = command.split('/'); | |
| 66 | + data.placement = commandSplit[0]; | |
| 67 | + data.event = commandSplit[1]; | |
| 68 | + | |
| 69 | + // If 'details' is not empty, add the details object to the data object. | |
| 70 | + if (Object.keys(details).length) { | |
| 71 | + data.details = details; | |
| 72 | + } | |
| 73 | + }; | |
| 74 | + init(); | |
| 75 | + $e.run(command, data); | |
| 76 | +}; | |
| 77 | +var AppsEventTracking = exports.AppsEventTracking = /*#__PURE__*/function () { | |
| 78 | + function AppsEventTracking() { | |
| 79 | + (0, _classCallCheck2.default)(this, AppsEventTracking); | |
| 80 | + } | |
| 81 | + return (0, _createClass2.default)(AppsEventTracking, null, [{ | |
| 82 | + key: "dispatchEvent", | |
| 83 | + value: function dispatchEvent(eventName, payload) { | |
| 84 | + return elementorCommon.eventsManager.dispatchEvent(eventName, payload); | |
| 85 | + } | |
| 86 | + }, { | |
| 87 | + key: "sendPageViewsWebsiteTemplates", | |
| 88 | + value: function sendPageViewsWebsiteTemplates(page) { | |
| 89 | + return this.dispatchEvent(EVENTS_MAP.PAGE_VIEWS_WEBSITE_TEMPLATES, { | |
| 90 | + trigger: _eventsConfig.default.triggers.pageLoaded, | |
| 91 | + page_loaded: page, | |
| 92 | + secondary_location: page | |
| 93 | + }); | |
| 94 | + } | |
| 95 | + }, { | |
| 96 | + key: "sendKitsCloudUpgradeClicked", | |
| 97 | + value: function sendKitsCloudUpgradeClicked(upgradeLocation) { | |
| 98 | + return this.dispatchEvent(EVENTS_MAP.KITS_CLOUD_UPGRADE_CLICKED, { | |
| 99 | + trigger: _eventsConfig.default.triggers.click, | |
| 100 | + secondary_location: upgradeLocation, | |
| 101 | + upgrade_location: upgradeLocation | |
| 102 | + }); | |
| 103 | + } | |
| 104 | + }, { | |
| 105 | + key: "sendExportKitCustomization", | |
| 106 | + value: function sendExportKitCustomization(payload) { | |
| 107 | + return this.dispatchEvent(EVENTS_MAP.EXPORT_KIT_CUSTOMIZATION, _objectSpread({ | |
| 108 | + trigger: _eventsConfig.default.triggers.click | |
| 109 | + }, payload)); | |
| 110 | + } | |
| 111 | + }, { | |
| 112 | + key: "sendImportKitCustomization", | |
| 113 | + value: function sendImportKitCustomization(payload) { | |
| 114 | + return this.dispatchEvent(EVENTS_MAP.IMPORT_KIT_CUSTOMIZATION, _objectSpread({ | |
| 115 | + trigger: _eventsConfig.default.triggers.click | |
| 116 | + }, payload)); | |
| 117 | + } | |
| 118 | + }, { | |
| 119 | + key: "sendKitImportStatus", | |
| 120 | + value: function sendKitImportStatus() { | |
| 121 | + var error = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; | |
| 122 | + return this.dispatchEvent(EVENTS_MAP.KIT_IMPORT_STATUS, _objectSpread({ | |
| 123 | + kit_import_status: !error | |
| 124 | + }, error && { | |
| 125 | + kit_import_error: error.message | |
| 126 | + })); | |
| 127 | + } | |
| 128 | + }, { | |
| 129 | + key: "sendKitCloudLibraryApply", | |
| 130 | + value: function sendKitCloudLibraryApply(kitId, kitApplyUrl) { | |
| 131 | + return this.dispatchEvent(EVENTS_MAP.KIT_CLOUD_LIBRARY_APPLY, _objectSpread({ | |
| 132 | + trigger: _eventsConfig.default.triggers.click, | |
| 133 | + kit_cloud_id: kitId | |
| 134 | + }, kitApplyUrl && { | |
| 135 | + kit_apply_url: kitApplyUrl | |
| 136 | + })); | |
| 137 | + } | |
| 138 | + }, { | |
| 139 | + key: "sendKitCloudLibraryDelete", | |
| 140 | + value: function sendKitCloudLibraryDelete() { | |
| 141 | + return this.dispatchEvent(EVENTS_MAP.KIT_CLOUD_LIBRARY_DELETE, { | |
| 142 | + trigger: _eventsConfig.default.triggers.click | |
| 143 | + }); | |
| 144 | + } | |
| 145 | + }, { | |
| 146 | + key: "sendImportExportAdminAction", | |
| 147 | + value: function sendImportExportAdminAction(actionType) { | |
| 148 | + return this.dispatchEvent(EVENTS_MAP.IMPORT_EXPORT_ADMIN_ACTION, { | |
| 149 | + trigger: _eventsConfig.default.triggers.click, | |
| 150 | + action_type: actionType | |
| 151 | + }); | |
| 152 | + } | |
| 153 | + }, { | |
| 154 | + key: "sendKitImportUploadFile", | |
| 155 | + value: function sendKitImportUploadFile(status) { | |
| 156 | + return this.dispatchEvent(EVENTS_MAP.KIT_IMPORT_UPLOAD_FILE, { | |
| 157 | + kit_import_upload_file_status: status | |
| 158 | + }); | |
| 159 | + } | |
| 160 | + }]); | |
| 161 | +}(); | |
| 162 | + | |
| 163 | +/***/ }), | |
| 164 | + | |
| 4 | 165 | /***/ "../app/modules/import-export-customization/assets/js/shared/registry/base.js": |
| 5 | 166 | /*!************************************************************************************!*\ |
| 6 | 167 | !*** ../app/modules/import-export-customization/assets/js/shared/registry/base.js ***! |
| 7 | 168 | \************************************************************************************/ |
| @@ -121,8 +282,63 @@ | ||
| 121 | 282 | var customizationDialogsRegistry = exports.customizationDialogsRegistry = new _base.BaseRegistry(); |
| 122 | 283 | |
| 123 | 284 | /***/ }), |
| 124 | 285 | |
| 286 | +/***/ "../app/modules/import-export-customization/assets/js/shared/registry/templates.js": | |
| 287 | +/*!*****************************************************************************************!*\ | |
| 288 | + !*** ../app/modules/import-export-customization/assets/js/shared/registry/templates.js ***! | |
| 289 | + \*****************************************************************************************/ | |
| 290 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 291 | + | |
| 292 | +"use strict"; | |
| 293 | + | |
| 294 | + | |
| 295 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 296 | +Object.defineProperty(exports, "__esModule", ({ | |
| 297 | + value: true | |
| 298 | +})); | |
| 299 | +exports.templateRegistry = void 0; | |
| 300 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 301 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 302 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 303 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 304 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 305 | +var _base = __webpack_require__(/*! ./base */ "../app/modules/import-export-customization/assets/js/shared/registry/base.js"); | |
| 306 | +function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); } | |
| 307 | +function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } | |
| 308 | +var TemplateRegistry = /*#__PURE__*/function (_BaseRegistry) { | |
| 309 | + function TemplateRegistry() { | |
| 310 | + (0, _classCallCheck2.default)(this, TemplateRegistry); | |
| 311 | + return _callSuper(this, TemplateRegistry, arguments); | |
| 312 | + } | |
| 313 | + (0, _inherits2.default)(TemplateRegistry, _BaseRegistry); | |
| 314 | + return (0, _createClass2.default)(TemplateRegistry, [{ | |
| 315 | + key: "getState", | |
| 316 | + value: function getState(data, parentInitialState) { | |
| 317 | + var state = {}; | |
| 318 | + this.getAll().forEach(function (templateType) { | |
| 319 | + var _data$customization; | |
| 320 | + if ((data === null || data === void 0 || (_data$customization = data.customization) === null || _data$customization === void 0 || (_data$customization = _data$customization.templates) === null || _data$customization === void 0 ? void 0 : _data$customization[templateType.key]) !== undefined) { | |
| 321 | + state[templateType.key] = data.customization.templates[templateType.key]; | |
| 322 | + return; | |
| 323 | + } | |
| 324 | + if (templateType.getInitialState) { | |
| 325 | + state[templateType.key] = templateType.getInitialState(data, parentInitialState); | |
| 326 | + return; | |
| 327 | + } | |
| 328 | + var enabled = templateType.useParentDefault ? parentInitialState : false; | |
| 329 | + state[templateType.key] = { | |
| 330 | + enabled: enabled | |
| 331 | + }; | |
| 332 | + }); | |
| 333 | + return state; | |
| 334 | + } | |
| 335 | + }]); | |
| 336 | +}(_base.BaseRegistry); | |
| 337 | +var templateRegistry = exports.templateRegistry = new TemplateRegistry(); | |
| 338 | + | |
| 339 | +/***/ }), | |
| 340 | + | |
| 125 | 341 | /***/ "../app/modules/import-export-customization/assets/js/shared/utils/template-registry-helpers.js": |
| 126 | 342 | /*!******************************************************************************************************!*\ |
| 127 | 343 | !*** ../app/modules/import-export-customization/assets/js/shared/utils/template-registry-helpers.js ***! |
| 128 | 344 | \******************************************************************************************************/ |
| @@ -196,10 +412,10 @@ | ||
| 196 | 412 | var _iterator = _createForOfIteratorHelper(constructors), |
| 197 | 413 | _step; |
| 198 | 414 | try { |
| 199 | 415 | for (_iterator.s(); !(_step = _iterator.n()).done;) { |
| 200 | - var constructor = _step.value; | |
| 201 | - if (object.constructor.name === constructor.prototype[Symbol.toStringTag]) { | |
| 416 | + var _constructor = _step.value; | |
| 417 | + if (object.constructor.name === _constructor.prototype[Symbol.toStringTag]) { | |
| 202 | 418 | return true; |
| 203 | 419 | } |
| 204 | 420 | } |
| 205 | 421 | } catch (err) { |
| @@ -881,11 +1097,13 @@ | ||
| 881 | 1097 | var _argsObject = _interopRequireDefault(__webpack_require__(/*! ./imports/args-object */ "../assets/dev/js/modules/imports/args-object.js")); |
| 882 | 1098 | var _masonry = _interopRequireDefault(__webpack_require__(/*! ./imports/utils/masonry */ "../assets/dev/js/modules/imports/utils/masonry.js")); |
| 883 | 1099 | var _scroll = _interopRequireDefault(__webpack_require__(/*! ./imports/utils/scroll */ "../assets/dev/js/modules/imports/utils/scroll.js")); |
| 884 | 1100 | var _forceMethodImplementation = _interopRequireDefault(__webpack_require__(/*! ./imports/force-method-implementation */ "../assets/dev/js/modules/imports/force-method-implementation.js")); |
| 1101 | +var _templates = __webpack_require__(/*! ../../../../app/modules/import-export-customization/assets/js/shared/registry/templates */ "../app/modules/import-export-customization/assets/js/shared/registry/templates.js"); | |
| 885 | 1102 | var _templateRegistryHelpers = __webpack_require__(/*! ../../../../app/modules/import-export-customization/assets/js/shared/utils/template-registry-helpers */ "../app/modules/import-export-customization/assets/js/shared/utils/template-registry-helpers.js"); |
| 886 | 1103 | var _customizationDialogs = __webpack_require__(/*! ../../../../app/modules/import-export-customization/assets/js/shared/registry/customization-dialogs */ "../app/modules/import-export-customization/assets/js/shared/registry/customization-dialogs.js"); |
| 887 | -var baseModules = { | |
| 1104 | +var _appsEventTracking = __webpack_require__(/*! elementor-app/event-track/apps-event-tracking */ "../app/assets/js/event-track/apps-event-tracking.js"); | |
| 1105 | +var _default = exports["default"] = window.elementorModules = { | |
| 888 | 1106 | Module: _module.default, |
| 889 | 1107 | ViewModule: _viewModule.default, |
| 890 | 1108 | ArgsObject: _argsObject.default, |
| 891 | 1109 | ForceMethodImplementation: _forceMethodImplementation.default, |
| @@ -893,18 +1111,16 @@ | ||
| 893 | 1111 | Masonry: _masonry.default, |
| 894 | 1112 | Scroll: _scroll.default |
| 895 | 1113 | }, |
| 896 | 1114 | importExport: { |
| 1115 | + templateRegistry: _templates.templateRegistry, | |
| 897 | 1116 | createGetInitialState: _templateRegistryHelpers.createGetInitialState, |
| 898 | 1117 | customizationDialogsRegistry: _customizationDialogs.customizationDialogsRegistry |
| 1118 | + }, | |
| 1119 | + appsEventTracking: { | |
| 1120 | + AppsEventTracking: _appsEventTracking.AppsEventTracking | |
| 899 | 1121 | } |
| 900 | 1122 | }; |
| 901 | -if (!window.elementorModules) { | |
| 902 | - window.elementorModules = baseModules; | |
| 903 | -} else { | |
| 904 | - Object.assign(window.elementorModules, baseModules); | |
| 905 | -} | |
| 906 | -var _default = exports["default"] = window.elementorModules; | |
| 907 | 1123 | |
| 908 | 1124 | /***/ }), |
| 909 | 1125 | |
| 910 | 1126 | /***/ "../core/common/assets/js/views/modal/header.js": |
| @@ -934,13 +1150,8 @@ | ||
| 934 | 1150 | return _callSuper(this, _default, arguments); |
| 935 | 1151 | } |
| 936 | 1152 | (0, _inherits2.default)(_default, _Marionette$LayoutVie); |
| 937 | 1153 | return (0, _createClass2.default)(_default, [{ |
| 938 | - key: "tagName", | |
| 939 | - value: function tagName() { | |
| 940 | - return 'header'; | |
| 941 | - } | |
| 942 | - }, { | |
| 943 | 1154 | key: "className", |
| 944 | 1155 | value: function className() { |
| 945 | 1156 | return 'elementor-templates-modal__header'; |
| 946 | 1157 | } |
| @@ -972,31 +1183,8 @@ | ||
| 972 | 1183 | 'click @ui.closeModal': 'onCloseModalClick' |
| 973 | 1184 | }; |
| 974 | 1185 | } |
| 975 | 1186 | }, { |
| 976 | - key: "onRender", | |
| 977 | - value: function onRender() { | |
| 978 | - this.bindEscapeKey(); | |
| 979 | - } | |
| 980 | - }, { | |
| 981 | - key: "bindEscapeKey", | |
| 982 | - value: function bindEscapeKey() { | |
| 983 | - var _this = this; | |
| 984 | - this.onDocumentKeyDown = function (event) { | |
| 985 | - if ('Escape' === event.key) { | |
| 986 | - _this.onCloseModalClick(); | |
| 987 | - } | |
| 988 | - }; | |
| 989 | - document.addEventListener('keydown', this.onDocumentKeyDown); | |
| 990 | - } | |
| 991 | - }, { | |
| 992 | - key: "onDestroy", | |
| 993 | - value: function onDestroy() { | |
| 994 | - if (this.onDocumentKeyDown) { | |
| 995 | - document.removeEventListener('keydown', this.onDocumentKeyDown); | |
| 996 | - } | |
| 997 | - } | |
| 998 | - }, { | |
| 999 | 1187 | key: "templateHelpers", |
| 1000 | 1188 | value: function templateHelpers() { |
| 1001 | 1189 | return { |
| 1002 | 1190 | closeType: this.getOption('closeType') |
| @@ -1004,11 +1192,12 @@ | ||
| 1004 | 1192 | } |
| 1005 | 1193 | }, { |
| 1006 | 1194 | key: "onCloseModalClick", |
| 1007 | 1195 | value: function onCloseModalClick() { |
| 1196 | + var _elementor$config$doc, _elementor$config; | |
| 1008 | 1197 | this._parent._parent._parent.hideModal(); |
| 1009 | - var documentType = this.getDocumentType(); | |
| 1010 | - var customEvent = new CustomEvent("core/modal/close/".concat(documentType)); | |
| 1198 | + var type = (_elementor$config$doc = (_elementor$config = elementor.config) === null || _elementor$config === void 0 || (_elementor$config = _elementor$config.document) === null || _elementor$config === void 0 ? void 0 : _elementor$config.type) !== null && _elementor$config$doc !== void 0 ? _elementor$config$doc : 'default'; | |
| 1199 | + var customEvent = new CustomEvent("core/modal/close/".concat(type)); | |
| 1011 | 1200 | window.dispatchEvent(customEvent); |
| 1012 | 1201 | if (this.isFloatingButtonLibraryClose()) { |
| 1013 | 1202 | $e.internal('document/save/set-is-modified', { |
| 1014 | 1203 | status: false |
| @@ -1016,22 +1205,12 @@ | ||
| 1016 | 1205 | window.location.href = elementor.config.admin_floating_button_admin_url; |
| 1017 | 1206 | } |
| 1018 | 1207 | } |
| 1019 | 1208 | }, { |
| 1020 | - key: "getDocumentType", | |
| 1021 | - value: function getDocumentType() { | |
| 1022 | - var _elementor$config$doc, _elementor; | |
| 1023 | - var DEFAULT_TYPE = 'default'; | |
| 1024 | - if ('undefined' === typeof window.elementor) { | |
| 1025 | - return DEFAULT_TYPE; | |
| 1026 | - } | |
| 1027 | - return (_elementor$config$doc = (_elementor = elementor) === null || _elementor === void 0 || (_elementor = _elementor.config) === null || _elementor === void 0 || (_elementor = _elementor.document) === null || _elementor === void 0 ? void 0 : _elementor.type) !== null && _elementor$config$doc !== void 0 ? _elementor$config$doc : DEFAULT_TYPE; | |
| 1028 | - } | |
| 1029 | - }, { | |
| 1030 | 1209 | key: "isFloatingButtonLibraryClose", |
| 1031 | 1210 | value: function isFloatingButtonLibraryClose() { |
| 1032 | - var _elementor$config, _elementor$config2; | |
| 1033 | - return window.elementor && ((_elementor$config = elementor.config) === null || _elementor$config === void 0 ? void 0 : _elementor$config.admin_floating_button_admin_url) && 'floating-buttons' === ((_elementor$config2 = elementor.config) === null || _elementor$config2 === void 0 || (_elementor$config2 = _elementor$config2.document) === null || _elementor$config2 === void 0 ? void 0 : _elementor$config2.type) && (this.$el.closest('.dialog-lightbox-widget-content').find('.elementor-template-library-template-floating_button').length || this.$el.closest('.dialog-lightbox-widget-content').find('#elementor-template-library-preview').length || this.$el.closest('.dialog-lightbox-widget-content').find('#elementor-template-library-templates-empty').length); | |
| 1211 | + var _elementor$config2, _elementor$config3; | |
| 1212 | + return window.elementor && ((_elementor$config2 = elementor.config) === null || _elementor$config2 === void 0 ? void 0 : _elementor$config2.admin_floating_button_admin_url) && 'floating-buttons' === ((_elementor$config3 = elementor.config) === null || _elementor$config3 === void 0 || (_elementor$config3 = _elementor$config3.document) === null || _elementor$config3 === void 0 ? void 0 : _elementor$config3.type) && (this.$el.closest('.dialog-lightbox-widget-content').find('.elementor-template-library-template-floating_button').length || this.$el.closest('.dialog-lightbox-widget-content').find('#elementor-template-library-preview').length || this.$el.closest('.dialog-lightbox-widget-content').find('#elementor-template-library-templates-empty').length); | |
| 1034 | 1213 | } |
| 1035 | 1214 | }]); |
| 1036 | 1215 | }(Marionette.LayoutView); |
| 1037 | 1216 | |
| @@ -1285,8 +1464,190 @@ | ||
| 1285 | 1464 | }(Marionette.ItemView); |
| 1286 | 1465 | |
| 1287 | 1466 | /***/ }), |
| 1288 | 1467 | |
| 1468 | +/***/ "../core/common/modules/events-manager/assets/js/events-config.js": | |
| 1469 | +/*!************************************************************************!*\ | |
| 1470 | + !*** ../core/common/modules/events-manager/assets/js/events-config.js ***! | |
| 1471 | + \************************************************************************/ | |
| 1472 | +/***/ ((__unused_webpack_module, exports) => { | |
| 1473 | + | |
| 1474 | +"use strict"; | |
| 1475 | + | |
| 1476 | + | |
| 1477 | +Object.defineProperty(exports, "__esModule", ({ | |
| 1478 | + value: true | |
| 1479 | +})); | |
| 1480 | +exports["default"] = void 0; | |
| 1481 | +var eventsConfig = { | |
| 1482 | + triggers: { | |
| 1483 | + click: 'Click', | |
| 1484 | + accordionClick: 'Accordion Click', | |
| 1485 | + toggleClick: 'Toggle Click', | |
| 1486 | + dropdownClick: 'Click Dropdown', | |
| 1487 | + editorLoaded: 'Editor Loaded', | |
| 1488 | + visible: 'Visible', | |
| 1489 | + pageLoaded: 'Page Loaded' | |
| 1490 | + }, | |
| 1491 | + locations: { | |
| 1492 | + widgetPanel: 'Widget Panel', | |
| 1493 | + topBar: 'Top Bar', | |
| 1494 | + elementorEditor: 'Elementor Editor', | |
| 1495 | + templatesLibrary: { | |
| 1496 | + library: 'Templates Library' | |
| 1497 | + }, | |
| 1498 | + app: { | |
| 1499 | + import: 'Import Kit', | |
| 1500 | + export: 'Export Kit', | |
| 1501 | + kitLibrary: 'Kit Library', | |
| 1502 | + cloudKitLibrary: 'Cloud Kit Library' | |
| 1503 | + }, | |
| 1504 | + variables: 'Variables Panel', | |
| 1505 | + admin: 'WP admin' | |
| 1506 | + }, | |
| 1507 | + secondaryLocations: { | |
| 1508 | + layout: 'Layout Section', | |
| 1509 | + basic: 'Basic Section', | |
| 1510 | + 'pro-elements': 'Pro Section', | |
| 1511 | + general: 'General Section', | |
| 1512 | + 'theme-elements': 'Site Section', | |
| 1513 | + 'theme-elements-single': 'Single Section', | |
| 1514 | + 'woocommerce-elements': 'WooCommerce Section', | |
| 1515 | + wordpress: 'WordPress Section', | |
| 1516 | + categories: 'Widgets Tab', | |
| 1517 | + global: 'Globals Tab', | |
| 1518 | + 'whats-new': 'What\'s New', | |
| 1519 | + 'document-settings': 'Document Settings icon', | |
| 1520 | + 'preview-page': 'Preview Page', | |
| 1521 | + 'publish-button': 'Publish Button', | |
| 1522 | + 'widget-panel': 'Widget Panel Icon', | |
| 1523 | + finder: 'Finder', | |
| 1524 | + help: 'Help', | |
| 1525 | + elementorLogoDropdown: 'top_bar_elementor_logo_dropdown', | |
| 1526 | + elementorLogo: 'Elementor Logo', | |
| 1527 | + eLogoMenu: 'E-logo Menu', | |
| 1528 | + notes: 'Notes', | |
| 1529 | + siteSettings: 'Site Settings', | |
| 1530 | + structure: 'Structure', | |
| 1531 | + documentNameDropdown: 'Document Name dropdown', | |
| 1532 | + responsiveControls: 'Responsive controls', | |
| 1533 | + launchpad: 'launchpad', | |
| 1534 | + checklistHeader: 'Checklist Header', | |
| 1535 | + checklistSteps: 'Checklist Steps', | |
| 1536 | + userPreferences: 'User Preferences', | |
| 1537 | + contextMenu: 'Context Menu', | |
| 1538 | + templateLibrary: { | |
| 1539 | + saveModal: 'Save to Modal', | |
| 1540 | + moveModal: 'Move to Modal', | |
| 1541 | + bulkMoveModal: 'Bulk Move to Modal', | |
| 1542 | + copyModal: 'Copy to Modal', | |
| 1543 | + bulkCopyModal: 'Bulk Copy to Modal', | |
| 1544 | + saveModalSelectFolder: 'Save to Modal - select folder', | |
| 1545 | + saveModalSelectConnect: 'Save to Modal - connect', | |
| 1546 | + saveModalSelectUpgrade: 'Save to Modal - upgrade', | |
| 1547 | + importModal: 'Import Modal', | |
| 1548 | + newFolderModal: 'New Folder Modal', | |
| 1549 | + deleteDialog: 'Delete Dialog', | |
| 1550 | + deleteFolderDialog: 'Delete Folder Dialog', | |
| 1551 | + renameDialog: 'Rename Dialog', | |
| 1552 | + createFolderDialog: 'Create Folder Dialog', | |
| 1553 | + applySettingsDialog: 'Apply Settings Dialog', | |
| 1554 | + cloudTab: 'Cloud Tab', | |
| 1555 | + siteTab: 'Site Tab', | |
| 1556 | + cloudTabFolder: 'Cloud Tab - Folder', | |
| 1557 | + cloudTabConnect: 'Cloud Tab - Connect', | |
| 1558 | + cloudTabUpgrade: 'Cloud Tab - Upgrade', | |
| 1559 | + morePopup: 'Context Menu', | |
| 1560 | + quotaBar: 'Quota Bar' | |
| 1561 | + }, | |
| 1562 | + kitLibrary: { | |
| 1563 | + cloudKitLibrary: 'kits_cloud_library', | |
| 1564 | + cloudKitLibraryConnect: 'kits_cloud_library_connect', | |
| 1565 | + cloudKitLibraryUpgrade: 'kits_cloud_library_upgrade', | |
| 1566 | + kitExportCustomization: 'kit_export_customization', | |
| 1567 | + kitExport: 'kit_export', | |
| 1568 | + kitExportCustomizationEdit: 'kit_export_customization_edit', | |
| 1569 | + kitExportSummary: 'kit_export_summary', | |
| 1570 | + kitImportUploadBox: 'kit_import_upload_box', | |
| 1571 | + kitImportCustomization: 'kit_import_customization', | |
| 1572 | + kitImportSummary: 'kit_import_summary' | |
| 1573 | + }, | |
| 1574 | + variablesPopover: 'Variables Popover', | |
| 1575 | + admin: { | |
| 1576 | + pluginToolsTab: 'plugin_tools_tab', | |
| 1577 | + pluginWebsiteTemplatesTab: 'plugin_website_templates_tab' | |
| 1578 | + } | |
| 1579 | + }, | |
| 1580 | + elements: { | |
| 1581 | + accordionSection: 'Accordion section', | |
| 1582 | + buttonIcon: 'Button Icon', | |
| 1583 | + mainCta: 'Main CTA', | |
| 1584 | + button: 'Button', | |
| 1585 | + link: 'Link', | |
| 1586 | + dropdown: 'Dropdown', | |
| 1587 | + toggle: 'Toggle', | |
| 1588 | + launchpadChecklist: 'Checklist popup' | |
| 1589 | + }, | |
| 1590 | + names: { | |
| 1591 | + v1: { | |
| 1592 | + layout: 'v1_widgets_tab_layout_section', | |
| 1593 | + basic: 'v1_widgets_tab_basic_section', | |
| 1594 | + 'pro-elements': 'v1_widgets_tab_pro_section', | |
| 1595 | + general: 'v1_widgets_tab_general_section', | |
| 1596 | + 'theme-elements': 'v1_widgets_tab_site_section', | |
| 1597 | + 'theme-elements-single': 'v1_widgets_tab_single_section', | |
| 1598 | + 'woocommerce-elements': 'v1_widgets_tab_woocommerce_section', | |
| 1599 | + wordpress: 'v1_widgets_tab_wordpress_section', | |
| 1600 | + categories: 'v1_widgets_tab', | |
| 1601 | + global: 'v1_globals_tab' | |
| 1602 | + }, | |
| 1603 | + topBar: { | |
| 1604 | + whatsNew: 'top_bar_whats_new', | |
| 1605 | + documentSettings: 'top_bar_document_settings_icon', | |
| 1606 | + previewPage: 'top_bar_preview_page', | |
| 1607 | + publishButton: 'top_bar_publish_button', | |
| 1608 | + widgetPanel: 'top_bar_widget_panel_icon', | |
| 1609 | + finder: 'top_bar_finder', | |
| 1610 | + help: 'top_bar_help', | |
| 1611 | + history: 'top_bar_elementor_logo_dropdown_history', | |
| 1612 | + userPreferences: 'top_bar_elementor_logo_dropdown_user_preferences', | |
| 1613 | + keyboardShortcuts: 'top_bar_elementor_logo_dropdown_keyboard_shortcuts', | |
| 1614 | + exitToWordpress: 'top_bar_elementor_logo_dropdown_exit_to_wordpress', | |
| 1615 | + themeBuilder: 'top_bar_elementor_logo_dropdown_theme_builder', | |
| 1616 | + notes: 'top_bar_notes', | |
| 1617 | + siteSettings: 'top_bar_site_setting', | |
| 1618 | + structure: 'top_bar_structure', | |
| 1619 | + documentNameDropdown: 'top_bar_document_name_dropdown', | |
| 1620 | + responsiveControls: 'top_bar_responsive_controls', | |
| 1621 | + launchpadOn: 'top_bar_checklist_icon_show', | |
| 1622 | + launchpadOff: 'top_bar_checklist_icon_hide', | |
| 1623 | + elementorLogoDropdown: 'open_e_menu', | |
| 1624 | + connectAccount: 'connect_account', | |
| 1625 | + accountConnected: 'account_connected' | |
| 1626 | + }, | |
| 1627 | + // ChecklistSteps event names are generated dynamically, based on stepId and action type taken: title, action, done, undone, upgrade | |
| 1628 | + elementorEditor: { | |
| 1629 | + checklist: { | |
| 1630 | + checklistHeaderClose: 'checklist_header_close_icon', | |
| 1631 | + checklistFirstPopup: 'checklist popup triggered' | |
| 1632 | + }, | |
| 1633 | + userPreferences: { | |
| 1634 | + checklistShow: 'checklist_userpreferences_toggle_show', | |
| 1635 | + checklistHide: 'checklist_userpreferences_toggle_hide' | |
| 1636 | + } | |
| 1637 | + }, | |
| 1638 | + variables: { | |
| 1639 | + open: 'open_variables_popover', | |
| 1640 | + add: 'add_new_variable', | |
| 1641 | + connect: 'connect_variable', | |
| 1642 | + save: 'save_new_variable' | |
| 1643 | + } | |
| 1644 | + } | |
| 1645 | +}; | |
| 1646 | +var _default = exports["default"] = eventsConfig; | |
| 1647 | + | |
| 1648 | +/***/ }), | |
| 1649 | + | |
| 1289 | 1650 | /***/ "../modules/web-cli/assets/js/modules/command-base.js": |
| 1290 | 1651 | /*!************************************************************!*\ |
| 1291 | 1652 | !*** ../modules/web-cli/assets/js/modules/command-base.js ***! |
| 1292 | 1653 | \************************************************************/ |
| @@ -1884,9 +2245,9 @@ | ||
| 1884 | 2245 | var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); |
| 1885 | 2246 | var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); |
| 1886 | 2247 | var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); |
| 1887 | 2248 | var _commandCallbackBase = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/command-callback-base */ "../modules/web-cli/assets/js/modules/command-callback-base.js")); |
| 1888 | -var _toolkit = __webpack_require__(/*! @reduxjs/toolkit */ "@reduxjs/toolkit"); | |
| 2249 | +var _toolkit = __webpack_require__(/*! @reduxjs/toolkit */ "../node_modules/@reduxjs/toolkit/dist/redux-toolkit.esm.js"); | |
| 1889 | 2250 | var _module = _interopRequireDefault(__webpack_require__(/*! elementor/assets/dev/js/modules/imports/module.js */ "../assets/dev/js/modules/imports/module.js")); |
| 1890 | 2251 | var _forceMethodImplementation = _interopRequireDefault(__webpack_require__(/*! ../utils/force-method-implementation */ "../modules/web-cli/assets/js/utils/force-method-implementation.js")); |
| 1891 | 2252 | var _deprecation = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/deprecation */ "../modules/web-cli/assets/js/utils/deprecation.js")); |
| 1892 | 2253 | function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } |
| @@ -2964,8 +3325,145 @@ | ||
| 2964 | 3325 | module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 2965 | 3326 | |
| 2966 | 3327 | /***/ }), |
| 2967 | 3328 | |
| 3329 | +/***/ "../node_modules/@babel/runtime/helpers/esm/defineProperty.js": | |
| 3330 | +/*!********************************************************************!*\ | |
| 3331 | + !*** ../node_modules/@babel/runtime/helpers/esm/defineProperty.js ***! | |
| 3332 | + \********************************************************************/ | |
| 3333 | +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { | |
| 3334 | + | |
| 3335 | +"use strict"; | |
| 3336 | +__webpack_require__.r(__webpack_exports__); | |
| 3337 | +/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 3338 | +/* harmony export */ "default": () => (/* binding */ _defineProperty) | |
| 3339 | +/* harmony export */ }); | |
| 3340 | +/* harmony import */ var _toPropertyKey_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toPropertyKey.js */ "../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js"); | |
| 3341 | + | |
| 3342 | +function _defineProperty(e, r, t) { | |
| 3343 | + return (r = (0,_toPropertyKey_js__WEBPACK_IMPORTED_MODULE_0__["default"])(r)) in e ? Object.defineProperty(e, r, { | |
| 3344 | + value: t, | |
| 3345 | + enumerable: !0, | |
| 3346 | + configurable: !0, | |
| 3347 | + writable: !0 | |
| 3348 | + }) : e[r] = t, e; | |
| 3349 | +} | |
| 3350 | + | |
| 3351 | + | |
| 3352 | +/***/ }), | |
| 3353 | + | |
| 3354 | +/***/ "../node_modules/@babel/runtime/helpers/esm/objectSpread2.js": | |
| 3355 | +/*!*******************************************************************!*\ | |
| 3356 | + !*** ../node_modules/@babel/runtime/helpers/esm/objectSpread2.js ***! | |
| 3357 | + \*******************************************************************/ | |
| 3358 | +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { | |
| 3359 | + | |
| 3360 | +"use strict"; | |
| 3361 | +__webpack_require__.r(__webpack_exports__); | |
| 3362 | +/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 3363 | +/* harmony export */ "default": () => (/* binding */ _objectSpread2) | |
| 3364 | +/* harmony export */ }); | |
| 3365 | +/* harmony import */ var _defineProperty_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./defineProperty.js */ "../node_modules/@babel/runtime/helpers/esm/defineProperty.js"); | |
| 3366 | + | |
| 3367 | +function ownKeys(e, r) { | |
| 3368 | + var t = Object.keys(e); | |
| 3369 | + if (Object.getOwnPropertySymbols) { | |
| 3370 | + var o = Object.getOwnPropertySymbols(e); | |
| 3371 | + r && (o = o.filter(function (r) { | |
| 3372 | + return Object.getOwnPropertyDescriptor(e, r).enumerable; | |
| 3373 | + })), t.push.apply(t, o); | |
| 3374 | + } | |
| 3375 | + return t; | |
| 3376 | +} | |
| 3377 | +function _objectSpread2(e) { | |
| 3378 | + for (var r = 1; r < arguments.length; r++) { | |
| 3379 | + var t = null != arguments[r] ? arguments[r] : {}; | |
| 3380 | + r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { | |
| 3381 | + (0,_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(e, r, t[r]); | |
| 3382 | + }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { | |
| 3383 | + Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); | |
| 3384 | + }); | |
| 3385 | + } | |
| 3386 | + return e; | |
| 3387 | +} | |
| 3388 | + | |
| 3389 | + | |
| 3390 | +/***/ }), | |
| 3391 | + | |
| 3392 | +/***/ "../node_modules/@babel/runtime/helpers/esm/toPrimitive.js": | |
| 3393 | +/*!*****************************************************************!*\ | |
| 3394 | + !*** ../node_modules/@babel/runtime/helpers/esm/toPrimitive.js ***! | |
| 3395 | + \*****************************************************************/ | |
| 3396 | +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { | |
| 3397 | + | |
| 3398 | +"use strict"; | |
| 3399 | +__webpack_require__.r(__webpack_exports__); | |
| 3400 | +/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 3401 | +/* harmony export */ "default": () => (/* binding */ toPrimitive) | |
| 3402 | +/* harmony export */ }); | |
| 3403 | +/* harmony import */ var _typeof_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/esm/typeof.js"); | |
| 3404 | + | |
| 3405 | +function toPrimitive(t, r) { | |
| 3406 | + if ("object" != (0,_typeof_js__WEBPACK_IMPORTED_MODULE_0__["default"])(t) || !t) return t; | |
| 3407 | + var e = t[Symbol.toPrimitive]; | |
| 3408 | + if (void 0 !== e) { | |
| 3409 | + var i = e.call(t, r || "default"); | |
| 3410 | + if ("object" != (0,_typeof_js__WEBPACK_IMPORTED_MODULE_0__["default"])(i)) return i; | |
| 3411 | + throw new TypeError("@@toPrimitive must return a primitive value."); | |
| 3412 | + } | |
| 3413 | + return ("string" === r ? String : Number)(t); | |
| 3414 | +} | |
| 3415 | + | |
| 3416 | + | |
| 3417 | +/***/ }), | |
| 3418 | + | |
| 3419 | +/***/ "../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js": | |
| 3420 | +/*!*******************************************************************!*\ | |
| 3421 | + !*** ../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js ***! | |
| 3422 | + \*******************************************************************/ | |
| 3423 | +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { | |
| 3424 | + | |
| 3425 | +"use strict"; | |
| 3426 | +__webpack_require__.r(__webpack_exports__); | |
| 3427 | +/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 3428 | +/* harmony export */ "default": () => (/* binding */ toPropertyKey) | |
| 3429 | +/* harmony export */ }); | |
| 3430 | +/* harmony import */ var _typeof_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/esm/typeof.js"); | |
| 3431 | +/* harmony import */ var _toPrimitive_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toPrimitive.js */ "../node_modules/@babel/runtime/helpers/esm/toPrimitive.js"); | |
| 3432 | + | |
| 3433 | + | |
| 3434 | +function toPropertyKey(t) { | |
| 3435 | + var i = (0,_toPrimitive_js__WEBPACK_IMPORTED_MODULE_1__["default"])(t, "string"); | |
| 3436 | + return "symbol" == (0,_typeof_js__WEBPACK_IMPORTED_MODULE_0__["default"])(i) ? i : i + ""; | |
| 3437 | +} | |
| 3438 | + | |
| 3439 | + | |
| 3440 | +/***/ }), | |
| 3441 | + | |
| 3442 | +/***/ "../node_modules/@babel/runtime/helpers/esm/typeof.js": | |
| 3443 | +/*!************************************************************!*\ | |
| 3444 | + !*** ../node_modules/@babel/runtime/helpers/esm/typeof.js ***! | |
| 3445 | + \************************************************************/ | |
| 3446 | +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { | |
| 3447 | + | |
| 3448 | +"use strict"; | |
| 3449 | +__webpack_require__.r(__webpack_exports__); | |
| 3450 | +/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 3451 | +/* harmony export */ "default": () => (/* binding */ _typeof) | |
| 3452 | +/* harmony export */ }); | |
| 3453 | +function _typeof(o) { | |
| 3454 | + "@babel/helpers - typeof"; | |
| 3455 | + | |
| 3456 | + return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { | |
| 3457 | + return typeof o; | |
| 3458 | + } : function (o) { | |
| 3459 | + return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; | |
| 3460 | + }, _typeof(o); | |
| 3461 | +} | |
| 3462 | + | |
| 3463 | + | |
| 3464 | +/***/ }), | |
| 3465 | + | |
| 2968 | 3466 | /***/ "../node_modules/@babel/runtime/helpers/get.js": |
| 2969 | 3467 | /*!*****************************************************!*\ |
| 2970 | 3468 | !*** ../node_modules/@babel/runtime/helpers/get.js ***! |
| 2971 | 3469 | \*****************************************************/ |
| @@ -3393,17 +3891,3215 @@ | ||
| 3393 | 3891 | module.exports = _wrapNativeSuper, module.exports.__esModule = true, module.exports["default"] = module.exports; |
| 3394 | 3892 | |
| 3395 | 3893 | /***/ }), |
| 3396 | 3894 | |
| 3397 | -/***/ "@reduxjs/toolkit": | |
| 3895 | +/***/ "../node_modules/@reduxjs/toolkit/dist/redux-toolkit.esm.js": | |
| 3896 | +/*!******************************************************************!*\ | |
| 3897 | + !*** ../node_modules/@reduxjs/toolkit/dist/redux-toolkit.esm.js ***! | |
| 3898 | + \******************************************************************/ | |
| 3899 | +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { | |
| 3900 | + | |
| 3901 | +"use strict"; | |
| 3902 | +__webpack_require__.r(__webpack_exports__); | |
| 3903 | +/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 3904 | +/* harmony export */ EnhancerArray: () => (/* binding */ EnhancerArray), | |
| 3905 | +/* harmony export */ MiddlewareArray: () => (/* binding */ MiddlewareArray), | |
| 3906 | +/* harmony export */ SHOULD_AUTOBATCH: () => (/* binding */ SHOULD_AUTOBATCH), | |
| 3907 | +/* harmony export */ TaskAbortError: () => (/* binding */ TaskAbortError), | |
| 3908 | +/* harmony export */ __DO_NOT_USE__ActionTypes: () => (/* reexport safe */ redux__WEBPACK_IMPORTED_MODULE_0__.__DO_NOT_USE__ActionTypes), | |
| 3909 | +/* harmony export */ addListener: () => (/* binding */ addListener), | |
| 3910 | +/* harmony export */ applyMiddleware: () => (/* reexport safe */ redux__WEBPACK_IMPORTED_MODULE_0__.applyMiddleware), | |
| 3911 | +/* harmony export */ autoBatchEnhancer: () => (/* binding */ autoBatchEnhancer), | |
| 3912 | +/* harmony export */ bindActionCreators: () => (/* reexport safe */ redux__WEBPACK_IMPORTED_MODULE_0__.bindActionCreators), | |
| 3913 | +/* harmony export */ clearAllListeners: () => (/* binding */ clearAllListeners), | |
| 3914 | +/* harmony export */ combineReducers: () => (/* reexport safe */ redux__WEBPACK_IMPORTED_MODULE_0__.combineReducers), | |
| 3915 | +/* harmony export */ compose: () => (/* reexport safe */ redux__WEBPACK_IMPORTED_MODULE_0__.compose), | |
| 3916 | +/* harmony export */ configureStore: () => (/* binding */ configureStore), | |
| 3917 | +/* harmony export */ createAction: () => (/* binding */ createAction), | |
| 3918 | +/* harmony export */ createActionCreatorInvariantMiddleware: () => (/* binding */ createActionCreatorInvariantMiddleware), | |
| 3919 | +/* harmony export */ createAsyncThunk: () => (/* binding */ createAsyncThunk), | |
| 3920 | +/* harmony export */ createDraftSafeSelector: () => (/* binding */ createDraftSafeSelector), | |
| 3921 | +/* harmony export */ createEntityAdapter: () => (/* binding */ createEntityAdapter), | |
| 3922 | +/* harmony export */ createImmutableStateInvariantMiddleware: () => (/* binding */ createImmutableStateInvariantMiddleware), | |
| 3923 | +/* harmony export */ createListenerMiddleware: () => (/* binding */ createListenerMiddleware), | |
| 3924 | +/* harmony export */ createNextState: () => (/* reexport safe */ immer__WEBPACK_IMPORTED_MODULE_2__["default"]), | |
| 3925 | +/* harmony export */ createReducer: () => (/* binding */ createReducer), | |
| 3926 | +/* harmony export */ createSelector: () => (/* reexport safe */ reselect__WEBPACK_IMPORTED_MODULE_1__.createSelector), | |
| 3927 | +/* harmony export */ createSerializableStateInvariantMiddleware: () => (/* binding */ createSerializableStateInvariantMiddleware), | |
| 3928 | +/* harmony export */ createSlice: () => (/* binding */ createSlice), | |
| 3929 | +/* harmony export */ createStore: () => (/* reexport safe */ redux__WEBPACK_IMPORTED_MODULE_0__.createStore), | |
| 3930 | +/* harmony export */ current: () => (/* reexport safe */ immer__WEBPACK_IMPORTED_MODULE_2__.current), | |
| 3931 | +/* harmony export */ findNonSerializableValue: () => (/* binding */ findNonSerializableValue), | |
| 3932 | +/* harmony export */ freeze: () => (/* reexport safe */ immer__WEBPACK_IMPORTED_MODULE_2__.freeze), | |
| 3933 | +/* harmony export */ getDefaultMiddleware: () => (/* binding */ getDefaultMiddleware), | |
| 3934 | +/* harmony export */ getType: () => (/* binding */ getType), | |
| 3935 | +/* harmony export */ isAction: () => (/* binding */ isAction), | |
| 3936 | +/* harmony export */ isActionCreator: () => (/* binding */ isActionCreator), | |
| 3937 | +/* harmony export */ isAllOf: () => (/* binding */ isAllOf), | |
| 3938 | +/* harmony export */ isAnyOf: () => (/* binding */ isAnyOf), | |
| 3939 | +/* harmony export */ isAsyncThunkAction: () => (/* binding */ isAsyncThunkAction), | |
| 3940 | +/* harmony export */ isDraft: () => (/* reexport safe */ immer__WEBPACK_IMPORTED_MODULE_2__.isDraft), | |
| 3941 | +/* harmony export */ isFluxStandardAction: () => (/* binding */ isFSA), | |
| 3942 | +/* harmony export */ isFulfilled: () => (/* binding */ isFulfilled), | |
| 3943 | +/* harmony export */ isImmutableDefault: () => (/* binding */ isImmutableDefault), | |
| 3944 | +/* harmony export */ isPending: () => (/* binding */ isPending), | |
| 3945 | +/* harmony export */ isPlain: () => (/* binding */ isPlain), | |
| 3946 | +/* harmony export */ isPlainObject: () => (/* binding */ isPlainObject), | |
| 3947 | +/* harmony export */ isRejected: () => (/* binding */ isRejected), | |
| 3948 | +/* harmony export */ isRejectedWithValue: () => (/* binding */ isRejectedWithValue), | |
| 3949 | +/* harmony export */ legacy_createStore: () => (/* reexport safe */ redux__WEBPACK_IMPORTED_MODULE_0__.legacy_createStore), | |
| 3950 | +/* harmony export */ miniSerializeError: () => (/* binding */ miniSerializeError), | |
| 3951 | +/* harmony export */ nanoid: () => (/* binding */ nanoid), | |
| 3952 | +/* harmony export */ original: () => (/* reexport safe */ immer__WEBPACK_IMPORTED_MODULE_2__.original), | |
| 3953 | +/* harmony export */ prepareAutoBatched: () => (/* binding */ prepareAutoBatched), | |
| 3954 | +/* harmony export */ removeListener: () => (/* binding */ removeListener), | |
| 3955 | +/* harmony export */ unwrapResult: () => (/* binding */ unwrapResult) | |
| 3956 | +/* harmony export */ }); | |
| 3957 | +/* harmony import */ var immer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! immer */ "../node_modules/immer/dist/immer.esm.mjs"); | |
| 3958 | +/* harmony import */ var redux__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! redux */ "../node_modules/redux/es/redux.js"); | |
| 3959 | +/* harmony import */ var reselect__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! reselect */ "../node_modules/reselect/es/index.js"); | |
| 3960 | +/* harmony import */ var redux_thunk__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! redux-thunk */ "../node_modules/redux-thunk/es/index.js"); | |
| 3961 | +var __extends = (undefined && undefined.__extends) || (function () { | |
| 3962 | + var extendStatics = function (d, b) { | |
| 3963 | + extendStatics = Object.setPrototypeOf || | |
| 3964 | + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | |
| 3965 | + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; | |
| 3966 | + return extendStatics(d, b); | |
| 3967 | + }; | |
| 3968 | + return function (d, b) { | |
| 3969 | + if (typeof b !== "function" && b !== null) | |
| 3970 | + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); | |
| 3971 | + extendStatics(d, b); | |
| 3972 | + function __() { this.constructor = d; } | |
| 3973 | + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | |
| 3974 | + }; | |
| 3975 | +})(); | |
| 3976 | +var __generator = (undefined && undefined.__generator) || function (thisArg, body) { | |
| 3977 | + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; | |
| 3978 | + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; | |
| 3979 | + function verb(n) { return function (v) { return step([n, v]); }; } | |
| 3980 | + function step(op) { | |
| 3981 | + if (f) throw new TypeError("Generator is already executing."); | |
| 3982 | + while (_) try { | |
| 3983 | + 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; | |
| 3984 | + if (y = 0, t) op = [op[0] & 2, t.value]; | |
| 3985 | + switch (op[0]) { | |
| 3986 | + case 0: case 1: t = op; break; | |
| 3987 | + case 4: _.label++; return { value: op[1], done: false }; | |
| 3988 | + case 5: _.label++; y = op[1]; op = [0]; continue; | |
| 3989 | + case 7: op = _.ops.pop(); _.trys.pop(); continue; | |
| 3990 | + default: | |
| 3991 | + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } | |
| 3992 | + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } | |
| 3993 | + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } | |
| 3994 | + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } | |
| 3995 | + if (t[2]) _.ops.pop(); | |
| 3996 | + _.trys.pop(); continue; | |
| 3997 | + } | |
| 3998 | + op = body.call(thisArg, _); | |
| 3999 | + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } | |
| 4000 | + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; | |
| 4001 | + } | |
| 4002 | +}; | |
| 4003 | +var __spreadArray = (undefined && undefined.__spreadArray) || function (to, from) { | |
| 4004 | + for (var i = 0, il = from.length, j = to.length; i < il; i++, j++) | |
| 4005 | + to[j] = from[i]; | |
| 4006 | + return to; | |
| 4007 | +}; | |
| 4008 | +var __defProp = Object.defineProperty; | |
| 4009 | +var __defProps = Object.defineProperties; | |
| 4010 | +var __getOwnPropDescs = Object.getOwnPropertyDescriptors; | |
| 4011 | +var __getOwnPropSymbols = Object.getOwnPropertySymbols; | |
| 4012 | +var __hasOwnProp = Object.prototype.hasOwnProperty; | |
| 4013 | +var __propIsEnum = Object.prototype.propertyIsEnumerable; | |
| 4014 | +var __defNormalProp = function (obj, key, value) { return key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value: value }) : obj[key] = value; }; | |
| 4015 | +var __spreadValues = function (a, b) { | |
| 4016 | + for (var prop in b || (b = {})) | |
| 4017 | + if (__hasOwnProp.call(b, prop)) | |
| 4018 | + __defNormalProp(a, prop, b[prop]); | |
| 4019 | + if (__getOwnPropSymbols) | |
| 4020 | + for (var _i = 0, _c = __getOwnPropSymbols(b); _i < _c.length; _i++) { | |
| 4021 | + var prop = _c[_i]; | |
| 4022 | + if (__propIsEnum.call(b, prop)) | |
| 4023 | + __defNormalProp(a, prop, b[prop]); | |
| 4024 | + } | |
| 4025 | + return a; | |
| 4026 | +}; | |
| 4027 | +var __spreadProps = function (a, b) { return __defProps(a, __getOwnPropDescs(b)); }; | |
| 4028 | +var __async = function (__this, __arguments, generator) { | |
| 4029 | + return new Promise(function (resolve, reject) { | |
| 4030 | + var fulfilled = function (value) { | |
| 4031 | + try { | |
| 4032 | + step(generator.next(value)); | |
| 4033 | + } | |
| 4034 | + catch (e) { | |
| 4035 | + reject(e); | |
| 4036 | + } | |
| 4037 | + }; | |
| 4038 | + var rejected = function (value) { | |
| 4039 | + try { | |
| 4040 | + step(generator.throw(value)); | |
| 4041 | + } | |
| 4042 | + catch (e) { | |
| 4043 | + reject(e); | |
| 4044 | + } | |
| 4045 | + }; | |
| 4046 | + var step = function (x) { return x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected); }; | |
| 4047 | + step((generator = generator.apply(__this, __arguments)).next()); | |
| 4048 | + }); | |
| 4049 | +}; | |
| 4050 | +// src/index.ts | |
| 4051 | + | |
| 4052 | + | |
| 4053 | + | |
| 4054 | + | |
| 4055 | +// src/createDraftSafeSelector.ts | |
| 4056 | + | |
| 4057 | + | |
| 4058 | +var createDraftSafeSelector = function () { | |
| 4059 | + var args = []; | |
| 4060 | + for (var _i = 0; _i < arguments.length; _i++) { | |
| 4061 | + args[_i] = arguments[_i]; | |
| 4062 | + } | |
| 4063 | + var selector = reselect__WEBPACK_IMPORTED_MODULE_1__.createSelector.apply(void 0, args); | |
| 4064 | + var wrappedSelector = function (value) { | |
| 4065 | + var rest = []; | |
| 4066 | + for (var _i = 1; _i < arguments.length; _i++) { | |
| 4067 | + rest[_i - 1] = arguments[_i]; | |
| 4068 | + } | |
| 4069 | + return selector.apply(void 0, __spreadArray([(0,immer__WEBPACK_IMPORTED_MODULE_2__.isDraft)(value) ? (0,immer__WEBPACK_IMPORTED_MODULE_2__.current)(value) : value], rest)); | |
| 4070 | + }; | |
| 4071 | + return wrappedSelector; | |
| 4072 | +}; | |
| 4073 | +// src/configureStore.ts | |
| 4074 | + | |
| 4075 | +// src/devtoolsExtension.ts | |
| 4076 | + | |
| 4077 | +var composeWithDevTools = typeof window !== "undefined" && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ ? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ : function () { | |
| 4078 | + if (arguments.length === 0) | |
| 4079 | + return void 0; | |
| 4080 | + if (typeof arguments[0] === "object") | |
| 4081 | + return redux__WEBPACK_IMPORTED_MODULE_0__.compose; | |
| 4082 | + return redux__WEBPACK_IMPORTED_MODULE_0__.compose.apply(null, arguments); | |
| 4083 | +}; | |
| 4084 | +var devToolsEnhancer = typeof window !== "undefined" && window.__REDUX_DEVTOOLS_EXTENSION__ ? window.__REDUX_DEVTOOLS_EXTENSION__ : function () { | |
| 4085 | + return function (noop2) { | |
| 4086 | + return noop2; | |
| 4087 | + }; | |
| 4088 | +}; | |
| 4089 | +// src/isPlainObject.ts | |
| 4090 | +function isPlainObject(value) { | |
| 4091 | + if (typeof value !== "object" || value === null) | |
| 4092 | + return false; | |
| 4093 | + var proto = Object.getPrototypeOf(value); | |
| 4094 | + if (proto === null) | |
| 4095 | + return true; | |
| 4096 | + var baseProto = proto; | |
| 4097 | + while (Object.getPrototypeOf(baseProto) !== null) { | |
| 4098 | + baseProto = Object.getPrototypeOf(baseProto); | |
| 4099 | + } | |
| 4100 | + return proto === baseProto; | |
| 4101 | +} | |
| 4102 | +// src/getDefaultMiddleware.ts | |
| 4103 | + | |
| 4104 | +// src/tsHelpers.ts | |
| 4105 | +var hasMatchFunction = function (v) { | |
| 4106 | + return v && typeof v.match === "function"; | |
| 4107 | +}; | |
| 4108 | +// src/createAction.ts | |
| 4109 | +function createAction(type, prepareAction) { | |
| 4110 | + function actionCreator() { | |
| 4111 | + var args = []; | |
| 4112 | + for (var _i = 0; _i < arguments.length; _i++) { | |
| 4113 | + args[_i] = arguments[_i]; | |
| 4114 | + } | |
| 4115 | + if (prepareAction) { | |
| 4116 | + var prepared = prepareAction.apply(void 0, args); | |
| 4117 | + if (!prepared) { | |
| 4118 | + throw new Error("prepareAction did not return an object"); | |
| 4119 | + } | |
| 4120 | + return __spreadValues(__spreadValues({ | |
| 4121 | + type: type, | |
| 4122 | + payload: prepared.payload | |
| 4123 | + }, "meta" in prepared && { meta: prepared.meta }), "error" in prepared && { error: prepared.error }); | |
| 4124 | + } | |
| 4125 | + return { type: type, payload: args[0] }; | |
| 4126 | + } | |
| 4127 | + actionCreator.toString = function () { return "" + type; }; | |
| 4128 | + actionCreator.type = type; | |
| 4129 | + actionCreator.match = function (action) { return action.type === type; }; | |
| 4130 | + return actionCreator; | |
| 4131 | +} | |
| 4132 | +function isAction(action) { | |
| 4133 | + return isPlainObject(action) && "type" in action; | |
| 4134 | +} | |
| 4135 | +function isActionCreator(action) { | |
| 4136 | + return typeof action === "function" && "type" in action && hasMatchFunction(action); | |
| 4137 | +} | |
| 4138 | +function isFSA(action) { | |
| 4139 | + return isAction(action) && typeof action.type === "string" && Object.keys(action).every(isValidKey); | |
| 4140 | +} | |
| 4141 | +function isValidKey(key) { | |
| 4142 | + return ["type", "payload", "error", "meta"].indexOf(key) > -1; | |
| 4143 | +} | |
| 4144 | +function getType(actionCreator) { | |
| 4145 | + return "" + actionCreator; | |
| 4146 | +} | |
| 4147 | +// src/actionCreatorInvariantMiddleware.ts | |
| 4148 | +function getMessage(type) { | |
| 4149 | + var splitType = type ? ("" + type).split("/") : []; | |
| 4150 | + var actionName = splitType[splitType.length - 1] || "actionCreator"; | |
| 4151 | + return "Detected an action creator with type \"" + (type || "unknown") + "\" being dispatched. \nMake sure you're calling the action creator before dispatching, i.e. `dispatch(" + actionName + "())` instead of `dispatch(" + actionName + ")`. This is necessary even if the action has no payload."; | |
| 4152 | +} | |
| 4153 | +function createActionCreatorInvariantMiddleware(options) { | |
| 4154 | + if (options === void 0) { options = {}; } | |
| 4155 | + if (false) // removed by dead control flow | |
| 4156 | +{} | |
| 4157 | + var _c = options.isActionCreator, isActionCreator2 = _c === void 0 ? isActionCreator : _c; | |
| 4158 | + return function () { return function (next) { return function (action) { | |
| 4159 | + if (isActionCreator2(action)) { | |
| 4160 | + console.warn(getMessage(action.type)); | |
| 4161 | + } | |
| 4162 | + return next(action); | |
| 4163 | + }; }; }; | |
| 4164 | +} | |
| 4165 | +// src/utils.ts | |
| 4166 | + | |
| 4167 | +function getTimeMeasureUtils(maxDelay, fnName) { | |
| 4168 | + var elapsed = 0; | |
| 4169 | + return { | |
| 4170 | + measureTime: function (fn) { | |
| 4171 | + var started = Date.now(); | |
| 4172 | + try { | |
| 4173 | + return fn(); | |
| 4174 | + } | |
| 4175 | + finally { | |
| 4176 | + var finished = Date.now(); | |
| 4177 | + elapsed += finished - started; | |
| 4178 | + } | |
| 4179 | + }, | |
| 4180 | + warnIfExceeded: function () { | |
| 4181 | + if (elapsed > maxDelay) { | |
| 4182 | + 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."); | |
| 4183 | + } | |
| 4184 | + } | |
| 4185 | + }; | |
| 4186 | +} | |
| 4187 | +var MiddlewareArray = /** @class */ (function (_super) { | |
| 4188 | + __extends(MiddlewareArray, _super); | |
| 4189 | + function MiddlewareArray() { | |
| 4190 | + var args = []; | |
| 4191 | + for (var _i = 0; _i < arguments.length; _i++) { | |
| 4192 | + args[_i] = arguments[_i]; | |
| 4193 | + } | |
| 4194 | + var _this = _super.apply(this, args) || this; | |
| 4195 | + Object.setPrototypeOf(_this, MiddlewareArray.prototype); | |
| 4196 | + return _this; | |
| 4197 | + } | |
| 4198 | + Object.defineProperty(MiddlewareArray, Symbol.species, { | |
| 4199 | + get: function () { | |
| 4200 | + return MiddlewareArray; | |
| 4201 | + }, | |
| 4202 | + enumerable: false, | |
| 4203 | + configurable: true | |
| 4204 | + }); | |
| 4205 | + MiddlewareArray.prototype.concat = function () { | |
| 4206 | + var arr = []; | |
| 4207 | + for (var _i = 0; _i < arguments.length; _i++) { | |
| 4208 | + arr[_i] = arguments[_i]; | |
| 4209 | + } | |
| 4210 | + return _super.prototype.concat.apply(this, arr); | |
| 4211 | + }; | |
| 4212 | + MiddlewareArray.prototype.prepend = function () { | |
| 4213 | + var arr = []; | |
| 4214 | + for (var _i = 0; _i < arguments.length; _i++) { | |
| 4215 | + arr[_i] = arguments[_i]; | |
| 4216 | + } | |
| 4217 | + if (arr.length === 1 && Array.isArray(arr[0])) { | |
| 4218 | + return new (MiddlewareArray.bind.apply(MiddlewareArray, __spreadArray([void 0], arr[0].concat(this))))(); | |
| 4219 | + } | |
| 4220 | + return new (MiddlewareArray.bind.apply(MiddlewareArray, __spreadArray([void 0], arr.concat(this))))(); | |
| 4221 | + }; | |
| 4222 | + return MiddlewareArray; | |
| 4223 | +}(Array)); | |
| 4224 | +var EnhancerArray = /** @class */ (function (_super) { | |
| 4225 | + __extends(EnhancerArray, _super); | |
| 4226 | + function EnhancerArray() { | |
| 4227 | + var args = []; | |
| 4228 | + for (var _i = 0; _i < arguments.length; _i++) { | |
| 4229 | + args[_i] = arguments[_i]; | |
| 4230 | + } | |
| 4231 | + var _this = _super.apply(this, args) || this; | |
| 4232 | + Object.setPrototypeOf(_this, EnhancerArray.prototype); | |
| 4233 | + return _this; | |
| 4234 | + } | |
| 4235 | + Object.defineProperty(EnhancerArray, Symbol.species, { | |
| 4236 | + get: function () { | |
| 4237 | + return EnhancerArray; | |
| 4238 | + }, | |
| 4239 | + enumerable: false, | |
| 4240 | + configurable: true | |
| 4241 | + }); | |
| 4242 | + EnhancerArray.prototype.concat = function () { | |
| 4243 | + var arr = []; | |
| 4244 | + for (var _i = 0; _i < arguments.length; _i++) { | |
| 4245 | + arr[_i] = arguments[_i]; | |
| 4246 | + } | |
| 4247 | + return _super.prototype.concat.apply(this, arr); | |
| 4248 | + }; | |
| 4249 | + EnhancerArray.prototype.prepend = function () { | |
| 4250 | + var arr = []; | |
| 4251 | + for (var _i = 0; _i < arguments.length; _i++) { | |
| 4252 | + arr[_i] = arguments[_i]; | |
| 4253 | + } | |
| 4254 | + if (arr.length === 1 && Array.isArray(arr[0])) { | |
| 4255 | + return new (EnhancerArray.bind.apply(EnhancerArray, __spreadArray([void 0], arr[0].concat(this))))(); | |
| 4256 | + } | |
| 4257 | + return new (EnhancerArray.bind.apply(EnhancerArray, __spreadArray([void 0], arr.concat(this))))(); | |
| 4258 | + }; | |
| 4259 | + return EnhancerArray; | |
| 4260 | +}(Array)); | |
| 4261 | +function freezeDraftable(val) { | |
| 4262 | + return (0,immer__WEBPACK_IMPORTED_MODULE_2__.isDraftable)(val) ? (0,immer__WEBPACK_IMPORTED_MODULE_2__["default"])(val, function () { | |
| 4263 | + }) : val; | |
| 4264 | +} | |
| 4265 | +// src/immutableStateInvariantMiddleware.ts | |
| 4266 | +var isProduction = "development" === "production"; | |
| 4267 | +var prefix = "Invariant failed"; | |
| 4268 | +function invariant(condition, message) { | |
| 4269 | + if (condition) { | |
| 4270 | + return; | |
| 4271 | + } | |
| 4272 | + if (isProduction) { | |
| 4273 | + throw new Error(prefix); | |
| 4274 | + } | |
| 4275 | + throw new Error(prefix + ": " + (message || "")); | |
| 4276 | +} | |
| 4277 | +function stringify(obj, serializer, indent, decycler) { | |
| 4278 | + return JSON.stringify(obj, getSerialize(serializer, decycler), indent); | |
| 4279 | +} | |
| 4280 | +function getSerialize(serializer, decycler) { | |
| 4281 | + var stack = [], keys = []; | |
| 4282 | + if (!decycler) | |
| 4283 | + decycler = function (_, value) { | |
| 4284 | + if (stack[0] === value) | |
| 4285 | + return "[Circular ~]"; | |
| 4286 | + return "[Circular ~." + keys.slice(0, stack.indexOf(value)).join(".") + "]"; | |
| 4287 | + }; | |
| 4288 | + return function (key, value) { | |
| 4289 | + if (stack.length > 0) { | |
| 4290 | + var thisPos = stack.indexOf(this); | |
| 4291 | + ~thisPos ? stack.splice(thisPos + 1) : stack.push(this); | |
| 4292 | + ~thisPos ? keys.splice(thisPos, Infinity, key) : keys.push(key); | |
| 4293 | + if (~stack.indexOf(value)) | |
| 4294 | + value = decycler.call(this, key, value); | |
| 4295 | + } | |
| 4296 | + else | |
| 4297 | + stack.push(value); | |
| 4298 | + return serializer == null ? value : serializer.call(this, key, value); | |
| 4299 | + }; | |
| 4300 | +} | |
| 4301 | +function isImmutableDefault(value) { | |
| 4302 | + return typeof value !== "object" || value == null || Object.isFrozen(value); | |
| 4303 | +} | |
| 4304 | +function trackForMutations(isImmutable, ignorePaths, obj) { | |
| 4305 | + var trackedProperties = trackProperties(isImmutable, ignorePaths, obj); | |
| 4306 | + return { | |
| 4307 | + detectMutations: function () { | |
| 4308 | + return detectMutations(isImmutable, ignorePaths, trackedProperties, obj); | |
| 4309 | + } | |
| 4310 | + }; | |
| 4311 | +} | |
| 4312 | +function trackProperties(isImmutable, ignorePaths, obj, path, checkedObjects) { | |
| 4313 | + if (ignorePaths === void 0) { ignorePaths = []; } | |
| 4314 | + if (path === void 0) { path = ""; } | |
| 4315 | + if (checkedObjects === void 0) { checkedObjects = new Set(); } | |
| 4316 | + var tracked = { value: obj }; | |
| 4317 | + if (!isImmutable(obj) && !checkedObjects.has(obj)) { | |
| 4318 | + checkedObjects.add(obj); | |
| 4319 | + tracked.children = {}; | |
| 4320 | + for (var key in obj) { | |
| 4321 | + var childPath = path ? path + "." + key : key; | |
| 4322 | + if (ignorePaths.length && ignorePaths.indexOf(childPath) !== -1) { | |
| 4323 | + continue; | |
| 4324 | + } | |
| 4325 | + tracked.children[key] = trackProperties(isImmutable, ignorePaths, obj[key], childPath); | |
| 4326 | + } | |
| 4327 | + } | |
| 4328 | + return tracked; | |
| 4329 | +} | |
| 4330 | +function detectMutations(isImmutable, ignoredPaths, trackedProperty, obj, sameParentRef, path) { | |
| 4331 | + if (ignoredPaths === void 0) { ignoredPaths = []; } | |
| 4332 | + if (sameParentRef === void 0) { sameParentRef = false; } | |
| 4333 | + if (path === void 0) { path = ""; } | |
| 4334 | + var prevObj = trackedProperty ? trackedProperty.value : void 0; | |
| 4335 | + var sameRef = prevObj === obj; | |
| 4336 | + if (sameParentRef && !sameRef && !Number.isNaN(obj)) { | |
| 4337 | + return { wasMutated: true, path: path }; | |
| 4338 | + } | |
| 4339 | + if (isImmutable(prevObj) || isImmutable(obj)) { | |
| 4340 | + return { wasMutated: false }; | |
| 4341 | + } | |
| 4342 | + var keysToDetect = {}; | |
| 4343 | + for (var key in trackedProperty.children) { | |
| 4344 | + keysToDetect[key] = true; | |
| 4345 | + } | |
| 4346 | + for (var key in obj) { | |
| 4347 | + keysToDetect[key] = true; | |
| 4348 | + } | |
| 4349 | + var hasIgnoredPaths = ignoredPaths.length > 0; | |
| 4350 | + var _loop_1 = function (key) { | |
| 4351 | + var nestedPath = path ? path + "." + key : key; | |
| 4352 | + if (hasIgnoredPaths) { | |
| 4353 | + var hasMatches = ignoredPaths.some(function (ignored) { | |
| 4354 | + if (ignored instanceof RegExp) { | |
| 4355 | + return ignored.test(nestedPath); | |
| 4356 | + } | |
| 4357 | + return nestedPath === ignored; | |
| 4358 | + }); | |
| 4359 | + if (hasMatches) { | |
| 4360 | + return "continue"; | |
| 4361 | + } | |
| 4362 | + } | |
| 4363 | + var result = detectMutations(isImmutable, ignoredPaths, trackedProperty.children[key], obj[key], sameRef, nestedPath); | |
| 4364 | + if (result.wasMutated) { | |
| 4365 | + return { value: result }; | |
| 4366 | + } | |
| 4367 | + }; | |
| 4368 | + for (var key in keysToDetect) { | |
| 4369 | + var state_1 = _loop_1(key); | |
| 4370 | + if (typeof state_1 === "object") | |
| 4371 | + return state_1.value; | |
| 4372 | + } | |
| 4373 | + return { wasMutated: false }; | |
| 4374 | +} | |
| 4375 | +function createImmutableStateInvariantMiddleware(options) { | |
| 4376 | + if (options === void 0) { options = {}; } | |
| 4377 | + if (false) // removed by dead control flow | |
| 4378 | +{} | |
| 4379 | + 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; | |
| 4380 | + ignoredPaths = ignoredPaths || ignore; | |
| 4381 | + var track = trackForMutations.bind(null, isImmutable, ignoredPaths); | |
| 4382 | + return function (_c) { | |
| 4383 | + var getState = _c.getState; | |
| 4384 | + var state = getState(); | |
| 4385 | + var tracker = track(state); | |
| 4386 | + var result; | |
| 4387 | + return function (next) { return function (action) { | |
| 4388 | + var measureUtils = getTimeMeasureUtils(warnAfter, "ImmutableStateInvariantMiddleware"); | |
| 4389 | + measureUtils.measureTime(function () { | |
| 4390 | + state = getState(); | |
| 4391 | + result = tracker.detectMutations(); | |
| 4392 | + tracker = track(state); | |
| 4393 | + 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)"); | |
| 4394 | + }); | |
| 4395 | + var dispatchedAction = next(action); | |
| 4396 | + measureUtils.measureTime(function () { | |
| 4397 | + state = getState(); | |
| 4398 | + result = tracker.detectMutations(); | |
| 4399 | + tracker = track(state); | |
| 4400 | + 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)"); | |
| 4401 | + }); | |
| 4402 | + measureUtils.warnIfExceeded(); | |
| 4403 | + return dispatchedAction; | |
| 4404 | + }; }; | |
| 4405 | + }; | |
| 4406 | +} | |
| 4407 | +// src/serializableStateInvariantMiddleware.ts | |
| 4408 | +function isPlain(val) { | |
| 4409 | + var type = typeof val; | |
| 4410 | + return val == null || type === "string" || type === "boolean" || type === "number" || Array.isArray(val) || isPlainObject(val); | |
| 4411 | +} | |
| 4412 | +function findNonSerializableValue(value, path, isSerializable, getEntries, ignoredPaths, cache) { | |
| 4413 | + if (path === void 0) { path = ""; } | |
| 4414 | + if (isSerializable === void 0) { isSerializable = isPlain; } | |
| 4415 | + if (ignoredPaths === void 0) { ignoredPaths = []; } | |
| 4416 | + var foundNestedSerializable; | |
| 4417 | + if (!isSerializable(value)) { | |
| 4418 | + return { | |
| 4419 | + keyPath: path || "<root>", | |
| 4420 | + value: value | |
| 4421 | + }; | |
| 4422 | + } | |
| 4423 | + if (typeof value !== "object" || value === null) { | |
| 4424 | + return false; | |
| 4425 | + } | |
| 4426 | + if (cache == null ? void 0 : cache.has(value)) | |
| 4427 | + return false; | |
| 4428 | + var entries = getEntries != null ? getEntries(value) : Object.entries(value); | |
| 4429 | + var hasIgnoredPaths = ignoredPaths.length > 0; | |
| 4430 | + var _loop_2 = function (key, nestedValue) { | |
| 4431 | + var nestedPath = path ? path + "." + key : key; | |
| 4432 | + if (hasIgnoredPaths) { | |
| 4433 | + var hasMatches = ignoredPaths.some(function (ignored) { | |
| 4434 | + if (ignored instanceof RegExp) { | |
| 4435 | + return ignored.test(nestedPath); | |
| 4436 | + } | |
| 4437 | + return nestedPath === ignored; | |
| 4438 | + }); | |
| 4439 | + if (hasMatches) { | |
| 4440 | + return "continue"; | |
| 4441 | + } | |
| 4442 | + } | |
| 4443 | + if (!isSerializable(nestedValue)) { | |
| 4444 | + return { value: { | |
| 4445 | + keyPath: nestedPath, | |
| 4446 | + value: nestedValue | |
| 4447 | + } }; | |
| 4448 | + } | |
| 4449 | + if (typeof nestedValue === "object") { | |
| 4450 | + foundNestedSerializable = findNonSerializableValue(nestedValue, nestedPath, isSerializable, getEntries, ignoredPaths, cache); | |
| 4451 | + if (foundNestedSerializable) { | |
| 4452 | + return { value: foundNestedSerializable }; | |
| 4453 | + } | |
| 4454 | + } | |
| 4455 | + }; | |
| 4456 | + for (var _i = 0, entries_1 = entries; _i < entries_1.length; _i++) { | |
| 4457 | + var _c = entries_1[_i], key = _c[0], nestedValue = _c[1]; | |
| 4458 | + var state_2 = _loop_2(key, nestedValue); | |
| 4459 | + if (typeof state_2 === "object") | |
| 4460 | + return state_2.value; | |
| 4461 | + } | |
| 4462 | + if (cache && isNestedFrozen(value)) | |
| 4463 | + cache.add(value); | |
| 4464 | + return false; | |
| 4465 | +} | |
| 4466 | +function isNestedFrozen(value) { | |
| 4467 | + if (!Object.isFrozen(value)) | |
| 4468 | + return false; | |
| 4469 | + for (var _i = 0, _c = Object.values(value); _i < _c.length; _i++) { | |
| 4470 | + var nestedValue = _c[_i]; | |
| 4471 | + if (typeof nestedValue !== "object" || nestedValue === null) | |
| 4472 | + continue; | |
| 4473 | + if (!isNestedFrozen(nestedValue)) | |
| 4474 | + return false; | |
| 4475 | + } | |
| 4476 | + return true; | |
| 4477 | +} | |
| 4478 | +function createSerializableStateInvariantMiddleware(options) { | |
| 4479 | + if (options === void 0) { options = {}; } | |
| 4480 | + if (false) // removed by dead control flow | |
| 4481 | +{} | |
| 4482 | + 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; | |
| 4483 | + var cache = !disableCache && WeakSet ? new WeakSet() : void 0; | |
| 4484 | + return function (storeAPI) { return function (next) { return function (action) { | |
| 4485 | + var result = next(action); | |
| 4486 | + var measureUtils = getTimeMeasureUtils(warnAfter, "SerializableStateInvariantMiddleware"); | |
| 4487 | + if (!ignoreActions && !(ignoredActions.length && ignoredActions.indexOf(action.type) !== -1)) { | |
| 4488 | + measureUtils.measureTime(function () { | |
| 4489 | + var foundActionNonSerializableValue = findNonSerializableValue(action, "", isSerializable, getEntries, ignoredActionPaths, cache); | |
| 4490 | + if (foundActionNonSerializableValue) { | |
| 4491 | + var keyPath = foundActionNonSerializableValue.keyPath, value = foundActionNonSerializableValue.value; | |
| 4492 | + 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)"); | |
| 4493 | + } | |
| 4494 | + }); | |
| 4495 | + } | |
| 4496 | + if (!ignoreState) { | |
| 4497 | + measureUtils.measureTime(function () { | |
| 4498 | + var state = storeAPI.getState(); | |
| 4499 | + var foundStateNonSerializableValue = findNonSerializableValue(state, "", isSerializable, getEntries, ignoredPaths, cache); | |
| 4500 | + if (foundStateNonSerializableValue) { | |
| 4501 | + var keyPath = foundStateNonSerializableValue.keyPath, value = foundStateNonSerializableValue.value; | |
| 4502 | + 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)"); | |
| 4503 | + } | |
| 4504 | + }); | |
| 4505 | + measureUtils.warnIfExceeded(); | |
| 4506 | + } | |
| 4507 | + return result; | |
| 4508 | + }; }; }; | |
| 4509 | +} | |
| 4510 | +// src/getDefaultMiddleware.ts | |
| 4511 | +function isBoolean(x) { | |
| 4512 | + return typeof x === "boolean"; | |
| 4513 | +} | |
| 4514 | +function curryGetDefaultMiddleware() { | |
| 4515 | + return function curriedGetDefaultMiddleware(options) { | |
| 4516 | + return getDefaultMiddleware(options); | |
| 4517 | + }; | |
| 4518 | +} | |
| 4519 | +function getDefaultMiddleware(options) { | |
| 4520 | + if (options === void 0) { options = {}; } | |
| 4521 | + 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, _f = options.actionCreatorCheck, actionCreatorCheck = _f === void 0 ? true : _f; | |
| 4522 | + var middlewareArray = new MiddlewareArray(); | |
| 4523 | + if (thunk) { | |
| 4524 | + if (isBoolean(thunk)) { | |
| 4525 | + middlewareArray.push(redux_thunk__WEBPACK_IMPORTED_MODULE_3__["default"]); | |
| 4526 | + } | |
| 4527 | + else { | |
| 4528 | + middlewareArray.push(redux_thunk__WEBPACK_IMPORTED_MODULE_3__["default"].withExtraArgument(thunk.extraArgument)); | |
| 4529 | + } | |
| 4530 | + } | |
| 4531 | + if (true) { | |
| 4532 | + if (immutableCheck) { | |
| 4533 | + var immutableOptions = {}; | |
| 4534 | + if (!isBoolean(immutableCheck)) { | |
| 4535 | + immutableOptions = immutableCheck; | |
| 4536 | + } | |
| 4537 | + middlewareArray.unshift(createImmutableStateInvariantMiddleware(immutableOptions)); | |
| 4538 | + } | |
| 4539 | + if (serializableCheck) { | |
| 4540 | + var serializableOptions = {}; | |
| 4541 | + if (!isBoolean(serializableCheck)) { | |
| 4542 | + serializableOptions = serializableCheck; | |
| 4543 | + } | |
| 4544 | + middlewareArray.push(createSerializableStateInvariantMiddleware(serializableOptions)); | |
| 4545 | + } | |
| 4546 | + if (actionCreatorCheck) { | |
| 4547 | + var actionCreatorOptions = {}; | |
| 4548 | + if (!isBoolean(actionCreatorCheck)) { | |
| 4549 | + actionCreatorOptions = actionCreatorCheck; | |
| 4550 | + } | |
| 4551 | + middlewareArray.unshift(createActionCreatorInvariantMiddleware(actionCreatorOptions)); | |
| 4552 | + } | |
| 4553 | + } | |
| 4554 | + return middlewareArray; | |
| 4555 | +} | |
| 4556 | +// src/configureStore.ts | |
| 4557 | +var IS_PRODUCTION = "development" === "production"; | |
| 4558 | +function configureStore(options) { | |
| 4559 | + var curriedGetDefaultMiddleware = curryGetDefaultMiddleware(); | |
| 4560 | + 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; | |
| 4561 | + var rootReducer; | |
| 4562 | + if (typeof reducer === "function") { | |
| 4563 | + rootReducer = reducer; | |
| 4564 | + } | |
| 4565 | + else if (isPlainObject(reducer)) { | |
| 4566 | + rootReducer = (0,redux__WEBPACK_IMPORTED_MODULE_0__.combineReducers)(reducer); | |
| 4567 | + } | |
| 4568 | + else { | |
| 4569 | + throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers'); | |
| 4570 | + } | |
| 4571 | + var finalMiddleware = middleware; | |
| 4572 | + if (typeof finalMiddleware === "function") { | |
| 4573 | + finalMiddleware = finalMiddleware(curriedGetDefaultMiddleware); | |
| 4574 | + if (!IS_PRODUCTION && !Array.isArray(finalMiddleware)) { | |
| 4575 | + throw new Error("when using a middleware builder function, an array of middleware must be returned"); | |
| 4576 | + } | |
| 4577 | + } | |
| 4578 | + if (!IS_PRODUCTION && finalMiddleware.some(function (item) { return typeof item !== "function"; })) { | |
| 4579 | + throw new Error("each middleware provided to configureStore must be a function"); | |
| 4580 | + } | |
| 4581 | + var middlewareEnhancer = redux__WEBPACK_IMPORTED_MODULE_0__.applyMiddleware.apply(void 0, finalMiddleware); | |
| 4582 | + var finalCompose = redux__WEBPACK_IMPORTED_MODULE_0__.compose; | |
| 4583 | + if (devTools) { | |
| 4584 | + finalCompose = composeWithDevTools(__spreadValues({ | |
| 4585 | + trace: !IS_PRODUCTION | |
| 4586 | + }, typeof devTools === "object" && devTools)); | |
| 4587 | + } | |
| 4588 | + var defaultEnhancers = new EnhancerArray(middlewareEnhancer); | |
| 4589 | + var storeEnhancers = defaultEnhancers; | |
| 4590 | + if (Array.isArray(enhancers)) { | |
| 4591 | + storeEnhancers = __spreadArray([middlewareEnhancer], enhancers); | |
| 4592 | + } | |
| 4593 | + else if (typeof enhancers === "function") { | |
| 4594 | + storeEnhancers = enhancers(defaultEnhancers); | |
| 4595 | + } | |
| 4596 | + var composedEnhancer = finalCompose.apply(void 0, storeEnhancers); | |
| 4597 | + return (0,redux__WEBPACK_IMPORTED_MODULE_0__.createStore)(rootReducer, preloadedState, composedEnhancer); | |
| 4598 | +} | |
| 4599 | +// src/createReducer.ts | |
| 4600 | + | |
| 4601 | +// src/mapBuilders.ts | |
| 4602 | +function executeReducerBuilderCallback(builderCallback) { | |
| 4603 | + var actionsMap = {}; | |
| 4604 | + var actionMatchers = []; | |
| 4605 | + var defaultCaseReducer; | |
| 4606 | + var builder = { | |
| 4607 | + addCase: function (typeOrActionCreator, reducer) { | |
| 4608 | + if (true) { | |
| 4609 | + if (actionMatchers.length > 0) { | |
| 4610 | + throw new Error("`builder.addCase` should only be called before calling `builder.addMatcher`"); | |
| 4611 | + } | |
| 4612 | + if (defaultCaseReducer) { | |
| 4613 | + throw new Error("`builder.addCase` should only be called before calling `builder.addDefaultCase`"); | |
| 4614 | + } | |
| 4615 | + } | |
| 4616 | + var type = typeof typeOrActionCreator === "string" ? typeOrActionCreator : typeOrActionCreator.type; | |
| 4617 | + if (!type) { | |
| 4618 | + throw new Error("`builder.addCase` cannot be called with an empty action type"); | |
| 4619 | + } | |
| 4620 | + if (type in actionsMap) { | |
| 4621 | + throw new Error("`builder.addCase` cannot be called with two reducers for the same action type"); | |
| 4622 | + } | |
| 4623 | + actionsMap[type] = reducer; | |
| 4624 | + return builder; | |
| 4625 | + }, | |
| 4626 | + addMatcher: function (matcher, reducer) { | |
| 4627 | + if (true) { | |
| 4628 | + if (defaultCaseReducer) { | |
| 4629 | + throw new Error("`builder.addMatcher` should only be called before calling `builder.addDefaultCase`"); | |
| 4630 | + } | |
| 4631 | + } | |
| 4632 | + actionMatchers.push({ matcher: matcher, reducer: reducer }); | |
| 4633 | + return builder; | |
| 4634 | + }, | |
| 4635 | + addDefaultCase: function (reducer) { | |
| 4636 | + if (true) { | |
| 4637 | + if (defaultCaseReducer) { | |
| 4638 | + throw new Error("`builder.addDefaultCase` can only be called once"); | |
| 4639 | + } | |
| 4640 | + } | |
| 4641 | + defaultCaseReducer = reducer; | |
| 4642 | + return builder; | |
| 4643 | + } | |
| 4644 | + }; | |
| 4645 | + builderCallback(builder); | |
| 4646 | + return [actionsMap, actionMatchers, defaultCaseReducer]; | |
| 4647 | +} | |
| 4648 | +// src/createReducer.ts | |
| 4649 | +function isStateFunction(x) { | |
| 4650 | + return typeof x === "function"; | |
| 4651 | +} | |
| 4652 | +var hasWarnedAboutObjectNotation = false; | |
| 4653 | +function createReducer(initialState, mapOrBuilderCallback, actionMatchers, defaultCaseReducer) { | |
| 4654 | + if (actionMatchers === void 0) { actionMatchers = []; } | |
| 4655 | + if (true) { | |
| 4656 | + if (typeof mapOrBuilderCallback === "object") { | |
| 4657 | + if (!hasWarnedAboutObjectNotation) { | |
| 4658 | + hasWarnedAboutObjectNotation = true; | |
| 4659 | + console.warn("The object notation for `createReducer` is deprecated, and will be removed in RTK 2.0. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createReducer"); | |
| 4660 | + } | |
| 4661 | + } | |
| 4662 | + } | |
| 4663 | + var _c = typeof mapOrBuilderCallback === "function" ? executeReducerBuilderCallback(mapOrBuilderCallback) : [mapOrBuilderCallback, actionMatchers, defaultCaseReducer], actionsMap = _c[0], finalActionMatchers = _c[1], finalDefaultCaseReducer = _c[2]; | |
| 4664 | + var getInitialState; | |
| 4665 | + if (isStateFunction(initialState)) { | |
| 4666 | + getInitialState = function () { return freezeDraftable(initialState()); }; | |
| 4667 | + } | |
| 4668 | + else { | |
| 4669 | + var frozenInitialState_1 = freezeDraftable(initialState); | |
| 4670 | + getInitialState = function () { return frozenInitialState_1; }; | |
| 4671 | + } | |
| 4672 | + function reducer(state, action) { | |
| 4673 | + if (state === void 0) { state = getInitialState(); } | |
| 4674 | + var caseReducers = __spreadArray([ | |
| 4675 | + actionsMap[action.type] | |
| 4676 | + ], finalActionMatchers.filter(function (_c) { | |
| 4677 | + var matcher = _c.matcher; | |
| 4678 | + return matcher(action); | |
| 4679 | + }).map(function (_c) { | |
| 4680 | + var reducer2 = _c.reducer; | |
| 4681 | + return reducer2; | |
| 4682 | + })); | |
| 4683 | + if (caseReducers.filter(function (cr) { return !!cr; }).length === 0) { | |
| 4684 | + caseReducers = [finalDefaultCaseReducer]; | |
| 4685 | + } | |
| 4686 | + return caseReducers.reduce(function (previousState, caseReducer) { | |
| 4687 | + if (caseReducer) { | |
| 4688 | + if ((0,immer__WEBPACK_IMPORTED_MODULE_2__.isDraft)(previousState)) { | |
| 4689 | + var draft = previousState; | |
| 4690 | + var result = caseReducer(draft, action); | |
| 4691 | + if (result === void 0) { | |
| 4692 | + return previousState; | |
| 4693 | + } | |
| 4694 | + return result; | |
| 4695 | + } | |
| 4696 | + else if (!(0,immer__WEBPACK_IMPORTED_MODULE_2__.isDraftable)(previousState)) { | |
| 4697 | + var result = caseReducer(previousState, action); | |
| 4698 | + if (result === void 0) { | |
| 4699 | + if (previousState === null) { | |
| 4700 | + return previousState; | |
| 4701 | + } | |
| 4702 | + throw Error("A case reducer on a non-draftable value must not return undefined"); | |
| 4703 | + } | |
| 4704 | + return result; | |
| 4705 | + } | |
| 4706 | + else { | |
| 4707 | + return (0,immer__WEBPACK_IMPORTED_MODULE_2__["default"])(previousState, function (draft) { | |
| 4708 | + return caseReducer(draft, action); | |
| 4709 | + }); | |
| 4710 | + } | |
| 4711 | + } | |
| 4712 | + return previousState; | |
| 4713 | + }, state); | |
| 4714 | + } | |
| 4715 | + reducer.getInitialState = getInitialState; | |
| 4716 | + return reducer; | |
| 4717 | +} | |
| 4718 | +// src/createSlice.ts | |
| 4719 | +var hasWarnedAboutObjectNotation2 = false; | |
| 4720 | +function getType2(slice, actionKey) { | |
| 4721 | + return slice + "/" + actionKey; | |
| 4722 | +} | |
| 4723 | +function createSlice(options) { | |
| 4724 | + var name = options.name; | |
| 4725 | + if (!name) { | |
| 4726 | + throw new Error("`name` is a required option for createSlice"); | |
| 4727 | + } | |
| 4728 | + if (typeof process !== "undefined" && "development" === "development") { | |
| 4729 | + if (options.initialState === void 0) { | |
| 4730 | + console.error("You must provide an `initialState` value that is not `undefined`. You may have misspelled `initialState`"); | |
| 4731 | + } | |
| 4732 | + } | |
| 4733 | + var initialState = typeof options.initialState == "function" ? options.initialState : freezeDraftable(options.initialState); | |
| 4734 | + var reducers = options.reducers || {}; | |
| 4735 | + var reducerNames = Object.keys(reducers); | |
| 4736 | + var sliceCaseReducersByName = {}; | |
| 4737 | + var sliceCaseReducersByType = {}; | |
| 4738 | + var actionCreators = {}; | |
| 4739 | + reducerNames.forEach(function (reducerName) { | |
| 4740 | + var maybeReducerWithPrepare = reducers[reducerName]; | |
| 4741 | + var type = getType2(name, reducerName); | |
| 4742 | + var caseReducer; | |
| 4743 | + var prepareCallback; | |
| 4744 | + if ("reducer" in maybeReducerWithPrepare) { | |
| 4745 | + caseReducer = maybeReducerWithPrepare.reducer; | |
| 4746 | + prepareCallback = maybeReducerWithPrepare.prepare; | |
| 4747 | + } | |
| 4748 | + else { | |
| 4749 | + caseReducer = maybeReducerWithPrepare; | |
| 4750 | + } | |
| 4751 | + sliceCaseReducersByName[reducerName] = caseReducer; | |
| 4752 | + sliceCaseReducersByType[type] = caseReducer; | |
| 4753 | + actionCreators[reducerName] = prepareCallback ? createAction(type, prepareCallback) : createAction(type); | |
| 4754 | + }); | |
| 4755 | + function buildReducer() { | |
| 4756 | + if (true) { | |
| 4757 | + if (typeof options.extraReducers === "object") { | |
| 4758 | + if (!hasWarnedAboutObjectNotation2) { | |
| 4759 | + hasWarnedAboutObjectNotation2 = true; | |
| 4760 | + console.warn("The object notation for `createSlice.extraReducers` is deprecated, and will be removed in RTK 2.0. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createSlice"); | |
| 4761 | + } | |
| 4762 | + } | |
| 4763 | + } | |
| 4764 | + var _c = typeof options.extraReducers === "function" ? executeReducerBuilderCallback(options.extraReducers) : [options.extraReducers], _d = _c[0], extraReducers = _d === void 0 ? {} : _d, _e = _c[1], actionMatchers = _e === void 0 ? [] : _e, _f = _c[2], defaultCaseReducer = _f === void 0 ? void 0 : _f; | |
| 4765 | + var finalCaseReducers = __spreadValues(__spreadValues({}, extraReducers), sliceCaseReducersByType); | |
| 4766 | + return createReducer(initialState, function (builder) { | |
| 4767 | + for (var key in finalCaseReducers) { | |
| 4768 | + builder.addCase(key, finalCaseReducers[key]); | |
| 4769 | + } | |
| 4770 | + for (var _i = 0, actionMatchers_1 = actionMatchers; _i < actionMatchers_1.length; _i++) { | |
| 4771 | + var m = actionMatchers_1[_i]; | |
| 4772 | + builder.addMatcher(m.matcher, m.reducer); | |
| 4773 | + } | |
| 4774 | + if (defaultCaseReducer) { | |
| 4775 | + builder.addDefaultCase(defaultCaseReducer); | |
| 4776 | + } | |
| 4777 | + }); | |
| 4778 | + } | |
| 4779 | + var _reducer; | |
| 4780 | + return { | |
| 4781 | + name: name, | |
| 4782 | + reducer: function (state, action) { | |
| 4783 | + if (!_reducer) | |
| 4784 | + _reducer = buildReducer(); | |
| 4785 | + return _reducer(state, action); | |
| 4786 | + }, | |
| 4787 | + actions: actionCreators, | |
| 4788 | + caseReducers: sliceCaseReducersByName, | |
| 4789 | + getInitialState: function () { | |
| 4790 | + if (!_reducer) | |
| 4791 | + _reducer = buildReducer(); | |
| 4792 | + return _reducer.getInitialState(); | |
| 4793 | + } | |
| 4794 | + }; | |
| 4795 | +} | |
| 4796 | +// src/entities/entity_state.ts | |
| 4797 | +function getInitialEntityState() { | |
| 4798 | + return { | |
| 4799 | + ids: [], | |
| 4800 | + entities: {} | |
| 4801 | + }; | |
| 4802 | +} | |
| 4803 | +function createInitialStateFactory() { | |
| 4804 | + function getInitialState(additionalState) { | |
| 4805 | + if (additionalState === void 0) { additionalState = {}; } | |
| 4806 | + return Object.assign(getInitialEntityState(), additionalState); | |
| 4807 | + } | |
| 4808 | + return { getInitialState: getInitialState }; | |
| 4809 | +} | |
| 4810 | +// src/entities/state_selectors.ts | |
| 4811 | +function createSelectorsFactory() { | |
| 4812 | + function getSelectors(selectState) { | |
| 4813 | + var selectIds = function (state) { return state.ids; }; | |
| 4814 | + var selectEntities = function (state) { return state.entities; }; | |
| 4815 | + var selectAll = createDraftSafeSelector(selectIds, selectEntities, function (ids, entities) { return ids.map(function (id) { return entities[id]; }); }); | |
| 4816 | + var selectId = function (_, id) { return id; }; | |
| 4817 | + var selectById = function (entities, id) { return entities[id]; }; | |
| 4818 | + var selectTotal = createDraftSafeSelector(selectIds, function (ids) { return ids.length; }); | |
| 4819 | + if (!selectState) { | |
| 4820 | + return { | |
| 4821 | + selectIds: selectIds, | |
| 4822 | + selectEntities: selectEntities, | |
| 4823 | + selectAll: selectAll, | |
| 4824 | + selectTotal: selectTotal, | |
| 4825 | + selectById: createDraftSafeSelector(selectEntities, selectId, selectById) | |
| 4826 | + }; | |
| 4827 | + } | |
| 4828 | + var selectGlobalizedEntities = createDraftSafeSelector(selectState, selectEntities); | |
| 4829 | + return { | |
| 4830 | + selectIds: createDraftSafeSelector(selectState, selectIds), | |
| 4831 | + selectEntities: selectGlobalizedEntities, | |
| 4832 | + selectAll: createDraftSafeSelector(selectState, selectAll), | |
| 4833 | + selectTotal: createDraftSafeSelector(selectState, selectTotal), | |
| 4834 | + selectById: createDraftSafeSelector(selectGlobalizedEntities, selectId, selectById) | |
| 4835 | + }; | |
| 4836 | + } | |
| 4837 | + return { getSelectors: getSelectors }; | |
| 4838 | +} | |
| 4839 | +// src/entities/state_adapter.ts | |
| 4840 | + | |
| 4841 | +function createSingleArgumentStateOperator(mutator) { | |
| 4842 | + var operator = createStateOperator(function (_, state) { return mutator(state); }); | |
| 4843 | + return function operation(state) { | |
| 4844 | + return operator(state, void 0); | |
| 4845 | + }; | |
| 4846 | +} | |
| 4847 | +function createStateOperator(mutator) { | |
| 4848 | + return function operation(state, arg) { | |
| 4849 | + function isPayloadActionArgument(arg2) { | |
| 4850 | + return isFSA(arg2); | |
| 4851 | + } | |
| 4852 | + var runMutator = function (draft) { | |
| 4853 | + if (isPayloadActionArgument(arg)) { | |
| 4854 | + mutator(arg.payload, draft); | |
| 4855 | + } | |
| 4856 | + else { | |
| 4857 | + mutator(arg, draft); | |
| 4858 | + } | |
| 4859 | + }; | |
| 4860 | + if ((0,immer__WEBPACK_IMPORTED_MODULE_2__.isDraft)(state)) { | |
| 4861 | + runMutator(state); | |
| 4862 | + return state; | |
| 4863 | + } | |
| 4864 | + else { | |
| 4865 | + return (0,immer__WEBPACK_IMPORTED_MODULE_2__["default"])(state, runMutator); | |
| 4866 | + } | |
| 4867 | + }; | |
| 4868 | +} | |
| 4869 | +// src/entities/utils.ts | |
| 4870 | +function selectIdValue(entity, selectId) { | |
| 4871 | + var key = selectId(entity); | |
| 4872 | + if ( true && key === void 0) { | |
| 4873 | + console.warn("The entity passed to the `selectId` implementation returned undefined.", "You should probably provide your own `selectId` implementation.", "The entity that was passed:", entity, "The `selectId` implementation:", selectId.toString()); | |
| 4874 | + } | |
| 4875 | + return key; | |
| 4876 | +} | |
| 4877 | +function ensureEntitiesArray(entities) { | |
| 4878 | + if (!Array.isArray(entities)) { | |
| 4879 | + entities = Object.values(entities); | |
| 4880 | + } | |
| 4881 | + return entities; | |
| 4882 | +} | |
| 4883 | +function splitAddedUpdatedEntities(newEntities, selectId, state) { | |
| 4884 | + newEntities = ensureEntitiesArray(newEntities); | |
| 4885 | + var added = []; | |
| 4886 | + var updated = []; | |
| 4887 | + for (var _i = 0, newEntities_1 = newEntities; _i < newEntities_1.length; _i++) { | |
| 4888 | + var entity = newEntities_1[_i]; | |
| 4889 | + var id = selectIdValue(entity, selectId); | |
| 4890 | + if (id in state.entities) { | |
| 4891 | + updated.push({ id: id, changes: entity }); | |
| 4892 | + } | |
| 4893 | + else { | |
| 4894 | + added.push(entity); | |
| 4895 | + } | |
| 4896 | + } | |
| 4897 | + return [added, updated]; | |
| 4898 | +} | |
| 4899 | +// src/entities/unsorted_state_adapter.ts | |
| 4900 | +function createUnsortedStateAdapter(selectId) { | |
| 4901 | + function addOneMutably(entity, state) { | |
| 4902 | + var key = selectIdValue(entity, selectId); | |
| 4903 | + if (key in state.entities) { | |
| 4904 | + return; | |
| 4905 | + } | |
| 4906 | + state.ids.push(key); | |
| 4907 | + state.entities[key] = entity; | |
| 4908 | + } | |
| 4909 | + function addManyMutably(newEntities, state) { | |
| 4910 | + newEntities = ensureEntitiesArray(newEntities); | |
| 4911 | + for (var _i = 0, newEntities_2 = newEntities; _i < newEntities_2.length; _i++) { | |
| 4912 | + var entity = newEntities_2[_i]; | |
| 4913 | + addOneMutably(entity, state); | |
| 4914 | + } | |
| 4915 | + } | |
| 4916 | + function setOneMutably(entity, state) { | |
| 4917 | + var key = selectIdValue(entity, selectId); | |
| 4918 | + if (!(key in state.entities)) { | |
| 4919 | + state.ids.push(key); | |
| 4920 | + } | |
| 4921 | + state.entities[key] = entity; | |
| 4922 | + } | |
| 4923 | + function setManyMutably(newEntities, state) { | |
| 4924 | + newEntities = ensureEntitiesArray(newEntities); | |
| 4925 | + for (var _i = 0, newEntities_3 = newEntities; _i < newEntities_3.length; _i++) { | |
| 4926 | + var entity = newEntities_3[_i]; | |
| 4927 | + setOneMutably(entity, state); | |
| 4928 | + } | |
| 4929 | + } | |
| 4930 | + function setAllMutably(newEntities, state) { | |
| 4931 | + newEntities = ensureEntitiesArray(newEntities); | |
| 4932 | + state.ids = []; | |
| 4933 | + state.entities = {}; | |
| 4934 | + addManyMutably(newEntities, state); | |
| 4935 | + } | |
| 4936 | + function removeOneMutably(key, state) { | |
| 4937 | + return removeManyMutably([key], state); | |
| 4938 | + } | |
| 4939 | + function removeManyMutably(keys, state) { | |
| 4940 | + var didMutate = false; | |
| 4941 | + keys.forEach(function (key) { | |
| 4942 | + if (key in state.entities) { | |
| 4943 | + delete state.entities[key]; | |
| 4944 | + didMutate = true; | |
| 4945 | + } | |
| 4946 | + }); | |
| 4947 | + if (didMutate) { | |
| 4948 | + state.ids = state.ids.filter(function (id) { return id in state.entities; }); | |
| 4949 | + } | |
| 4950 | + } | |
| 4951 | + function removeAllMutably(state) { | |
| 4952 | + Object.assign(state, { | |
| 4953 | + ids: [], | |
| 4954 | + entities: {} | |
| 4955 | + }); | |
| 4956 | + } | |
| 4957 | + function takeNewKey(keys, update, state) { | |
| 4958 | + var original2 = state.entities[update.id]; | |
| 4959 | + var updated = Object.assign({}, original2, update.changes); | |
| 4960 | + var newKey = selectIdValue(updated, selectId); | |
| 4961 | + var hasNewKey = newKey !== update.id; | |
| 4962 | + if (hasNewKey) { | |
| 4963 | + keys[update.id] = newKey; | |
| 4964 | + delete state.entities[update.id]; | |
| 4965 | + } | |
| 4966 | + state.entities[newKey] = updated; | |
| 4967 | + return hasNewKey; | |
| 4968 | + } | |
| 4969 | + function updateOneMutably(update, state) { | |
| 4970 | + return updateManyMutably([update], state); | |
| 4971 | + } | |
| 4972 | + function updateManyMutably(updates, state) { | |
| 4973 | + var newKeys = {}; | |
| 4974 | + var updatesPerEntity = {}; | |
| 4975 | + updates.forEach(function (update) { | |
| 4976 | + if (update.id in state.entities) { | |
| 4977 | + updatesPerEntity[update.id] = { | |
| 4978 | + id: update.id, | |
| 4979 | + changes: __spreadValues(__spreadValues({}, updatesPerEntity[update.id] ? updatesPerEntity[update.id].changes : null), update.changes) | |
| 4980 | + }; | |
| 4981 | + } | |
| 4982 | + }); | |
| 4983 | + updates = Object.values(updatesPerEntity); | |
| 4984 | + var didMutateEntities = updates.length > 0; | |
| 4985 | + if (didMutateEntities) { | |
| 4986 | + var didMutateIds = updates.filter(function (update) { return takeNewKey(newKeys, update, state); }).length > 0; | |
| 4987 | + if (didMutateIds) { | |
| 4988 | + state.ids = Object.keys(state.entities); | |
| 4989 | + } | |
| 4990 | + } | |
| 4991 | + } | |
| 4992 | + function upsertOneMutably(entity, state) { | |
| 4993 | + return upsertManyMutably([entity], state); | |
| 4994 | + } | |
| 4995 | + function upsertManyMutably(newEntities, state) { | |
| 4996 | + var _c = splitAddedUpdatedEntities(newEntities, selectId, state), added = _c[0], updated = _c[1]; | |
| 4997 | + updateManyMutably(updated, state); | |
| 4998 | + addManyMutably(added, state); | |
| 4999 | + } | |
| 5000 | + return { | |
| 5001 | + removeAll: createSingleArgumentStateOperator(removeAllMutably), | |
| 5002 | + addOne: createStateOperator(addOneMutably), | |
| 5003 | + addMany: createStateOperator(addManyMutably), | |
| 5004 | + setOne: createStateOperator(setOneMutably), | |
| 5005 | + setMany: createStateOperator(setManyMutably), | |
| 5006 | + setAll: createStateOperator(setAllMutably), | |
| 5007 | + updateOne: createStateOperator(updateOneMutably), | |
| 5008 | + updateMany: createStateOperator(updateManyMutably), | |
| 5009 | + upsertOne: createStateOperator(upsertOneMutably), | |
| 5010 | + upsertMany: createStateOperator(upsertManyMutably), | |
| 5011 | + removeOne: createStateOperator(removeOneMutably), | |
| 5012 | + removeMany: createStateOperator(removeManyMutably) | |
| 5013 | + }; | |
| 5014 | +} | |
| 5015 | +// src/entities/sorted_state_adapter.ts | |
| 5016 | +function createSortedStateAdapter(selectId, sort) { | |
| 5017 | + var _c = createUnsortedStateAdapter(selectId), removeOne = _c.removeOne, removeMany = _c.removeMany, removeAll = _c.removeAll; | |
| 5018 | + function addOneMutably(entity, state) { | |
| 5019 | + return addManyMutably([entity], state); | |
| 5020 | + } | |
| 5021 | + function addManyMutably(newEntities, state) { | |
| 5022 | + newEntities = ensureEntitiesArray(newEntities); | |
| 5023 | + var models = newEntities.filter(function (model) { return !(selectIdValue(model, selectId) in state.entities); }); | |
| 5024 | + if (models.length !== 0) { | |
| 5025 | + merge(models, state); | |
| 5026 | + } | |
| 5027 | + } | |
| 5028 | + function setOneMutably(entity, state) { | |
| 5029 | + return setManyMutably([entity], state); | |
| 5030 | + } | |
| 5031 | + function setManyMutably(newEntities, state) { | |
| 5032 | + newEntities = ensureEntitiesArray(newEntities); | |
| 5033 | + if (newEntities.length !== 0) { | |
| 5034 | + merge(newEntities, state); | |
| 5035 | + } | |
| 5036 | + } | |
| 5037 | + function setAllMutably(newEntities, state) { | |
| 5038 | + newEntities = ensureEntitiesArray(newEntities); | |
| 5039 | + state.entities = {}; | |
| 5040 | + state.ids = []; | |
| 5041 | + addManyMutably(newEntities, state); | |
| 5042 | + } | |
| 5043 | + function updateOneMutably(update, state) { | |
| 5044 | + return updateManyMutably([update], state); | |
| 5045 | + } | |
| 5046 | + function updateManyMutably(updates, state) { | |
| 5047 | + var appliedUpdates = false; | |
| 5048 | + for (var _i = 0, updates_1 = updates; _i < updates_1.length; _i++) { | |
| 5049 | + var update = updates_1[_i]; | |
| 5050 | + var entity = state.entities[update.id]; | |
| 5051 | + if (!entity) { | |
| 5052 | + continue; | |
| 5053 | + } | |
| 5054 | + appliedUpdates = true; | |
| 5055 | + Object.assign(entity, update.changes); | |
| 5056 | + var newId = selectId(entity); | |
| 5057 | + if (update.id !== newId) { | |
| 5058 | + delete state.entities[update.id]; | |
| 5059 | + state.entities[newId] = entity; | |
| 5060 | + } | |
| 5061 | + } | |
| 5062 | + if (appliedUpdates) { | |
| 5063 | + resortEntities(state); | |
| 5064 | + } | |
| 5065 | + } | |
| 5066 | + function upsertOneMutably(entity, state) { | |
| 5067 | + return upsertManyMutably([entity], state); | |
| 5068 | + } | |
| 5069 | + function upsertManyMutably(newEntities, state) { | |
| 5070 | + var _c = splitAddedUpdatedEntities(newEntities, selectId, state), added = _c[0], updated = _c[1]; | |
| 5071 | + updateManyMutably(updated, state); | |
| 5072 | + addManyMutably(added, state); | |
| 5073 | + } | |
| 5074 | + function areArraysEqual(a, b) { | |
| 5075 | + if (a.length !== b.length) { | |
| 5076 | + return false; | |
| 5077 | + } | |
| 5078 | + for (var i = 0; i < a.length && i < b.length; i++) { | |
| 5079 | + if (a[i] === b[i]) { | |
| 5080 | + continue; | |
| 5081 | + } | |
| 5082 | + return false; | |
| 5083 | + } | |
| 5084 | + return true; | |
| 5085 | + } | |
| 5086 | + function merge(models, state) { | |
| 5087 | + models.forEach(function (model) { | |
| 5088 | + state.entities[selectId(model)] = model; | |
| 5089 | + }); | |
| 5090 | + resortEntities(state); | |
| 5091 | + } | |
| 5092 | + function resortEntities(state) { | |
| 5093 | + var allEntities = Object.values(state.entities); | |
| 5094 | + allEntities.sort(sort); | |
| 5095 | + var newSortedIds = allEntities.map(selectId); | |
| 5096 | + var ids = state.ids; | |
| 5097 | + if (!areArraysEqual(ids, newSortedIds)) { | |
| 5098 | + state.ids = newSortedIds; | |
| 5099 | + } | |
| 5100 | + } | |
| 5101 | + return { | |
| 5102 | + removeOne: removeOne, | |
| 5103 | + removeMany: removeMany, | |
| 5104 | + removeAll: removeAll, | |
| 5105 | + addOne: createStateOperator(addOneMutably), | |
| 5106 | + updateOne: createStateOperator(updateOneMutably), | |
| 5107 | + upsertOne: createStateOperator(upsertOneMutably), | |
| 5108 | + setOne: createStateOperator(setOneMutably), | |
| 5109 | + setMany: createStateOperator(setManyMutably), | |
| 5110 | + setAll: createStateOperator(setAllMutably), | |
| 5111 | + addMany: createStateOperator(addManyMutably), | |
| 5112 | + updateMany: createStateOperator(updateManyMutably), | |
| 5113 | + upsertMany: createStateOperator(upsertManyMutably) | |
| 5114 | + }; | |
| 5115 | +} | |
| 5116 | +// src/entities/create_adapter.ts | |
| 5117 | +function createEntityAdapter(options) { | |
| 5118 | + if (options === void 0) { options = {}; } | |
| 5119 | + var _c = __spreadValues({ | |
| 5120 | + sortComparer: false, | |
| 5121 | + selectId: function (instance) { return instance.id; } | |
| 5122 | + }, options), selectId = _c.selectId, sortComparer = _c.sortComparer; | |
| 5123 | + var stateFactory = createInitialStateFactory(); | |
| 5124 | + var selectorsFactory = createSelectorsFactory(); | |
| 5125 | + var stateAdapter = sortComparer ? createSortedStateAdapter(selectId, sortComparer) : createUnsortedStateAdapter(selectId); | |
| 5126 | + return __spreadValues(__spreadValues(__spreadValues({ | |
| 5127 | + selectId: selectId, | |
| 5128 | + sortComparer: sortComparer | |
| 5129 | + }, stateFactory), selectorsFactory), stateAdapter); | |
| 5130 | +} | |
| 5131 | +// src/nanoid.ts | |
| 5132 | +var urlAlphabet = "ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW"; | |
| 5133 | +var nanoid = function (size) { | |
| 5134 | + if (size === void 0) { size = 21; } | |
| 5135 | + var id = ""; | |
| 5136 | + var i = size; | |
| 5137 | + while (i--) { | |
| 5138 | + id += urlAlphabet[Math.random() * 64 | 0]; | |
| 5139 | + } | |
| 5140 | + return id; | |
| 5141 | +}; | |
| 5142 | +// src/createAsyncThunk.ts | |
| 5143 | +var commonProperties = [ | |
| 5144 | + "name", | |
| 5145 | + "message", | |
| 5146 | + "stack", | |
| 5147 | + "code" | |
| 5148 | +]; | |
| 5149 | +var RejectWithValue = /** @class */ (function () { | |
| 5150 | + function RejectWithValue(payload, meta) { | |
| 5151 | + this.payload = payload; | |
| 5152 | + this.meta = meta; | |
| 5153 | + } | |
| 5154 | + return RejectWithValue; | |
| 5155 | +}()); | |
| 5156 | +var FulfillWithMeta = /** @class */ (function () { | |
| 5157 | + function FulfillWithMeta(payload, meta) { | |
| 5158 | + this.payload = payload; | |
| 5159 | + this.meta = meta; | |
| 5160 | + } | |
| 5161 | + return FulfillWithMeta; | |
| 5162 | +}()); | |
| 5163 | +var miniSerializeError = function (value) { | |
| 5164 | + if (typeof value === "object" && value !== null) { | |
| 5165 | + var simpleError = {}; | |
| 5166 | + for (var _i = 0, commonProperties_1 = commonProperties; _i < commonProperties_1.length; _i++) { | |
| 5167 | + var property = commonProperties_1[_i]; | |
| 5168 | + if (typeof value[property] === "string") { | |
| 5169 | + simpleError[property] = value[property]; | |
| 5170 | + } | |
| 5171 | + } | |
| 5172 | + return simpleError; | |
| 5173 | + } | |
| 5174 | + return { message: String(value) }; | |
| 5175 | +}; | |
| 5176 | +var createAsyncThunk = (function () { | |
| 5177 | + function createAsyncThunk2(typePrefix, payloadCreator, options) { | |
| 5178 | + var fulfilled = createAction(typePrefix + "/fulfilled", function (payload, requestId, arg, meta) { return ({ | |
| 5179 | + payload: payload, | |
| 5180 | + meta: __spreadProps(__spreadValues({}, meta || {}), { | |
| 5181 | + arg: arg, | |
| 5182 | + requestId: requestId, | |
| 5183 | + requestStatus: "fulfilled" | |
| 5184 | + }) | |
| 5185 | + }); }); | |
| 5186 | + var pending = createAction(typePrefix + "/pending", function (requestId, arg, meta) { return ({ | |
| 5187 | + payload: void 0, | |
| 5188 | + meta: __spreadProps(__spreadValues({}, meta || {}), { | |
| 5189 | + arg: arg, | |
| 5190 | + requestId: requestId, | |
| 5191 | + requestStatus: "pending" | |
| 5192 | + }) | |
| 5193 | + }); }); | |
| 5194 | + var rejected = createAction(typePrefix + "/rejected", function (error, requestId, arg, payload, meta) { return ({ | |
| 5195 | + payload: payload, | |
| 5196 | + error: (options && options.serializeError || miniSerializeError)(error || "Rejected"), | |
| 5197 | + meta: __spreadProps(__spreadValues({}, meta || {}), { | |
| 5198 | + arg: arg, | |
| 5199 | + requestId: requestId, | |
| 5200 | + rejectedWithValue: !!payload, | |
| 5201 | + requestStatus: "rejected", | |
| 5202 | + aborted: (error == null ? void 0 : error.name) === "AbortError", | |
| 5203 | + condition: (error == null ? void 0 : error.name) === "ConditionError" | |
| 5204 | + }) | |
| 5205 | + }); }); | |
| 5206 | + var displayedWarning = false; | |
| 5207 | + var AC = typeof AbortController !== "undefined" ? AbortController : /** @class */ (function () { | |
| 5208 | + function class_1() { | |
| 5209 | + this.signal = { | |
| 5210 | + aborted: false, | |
| 5211 | + addEventListener: function () { | |
| 5212 | + }, | |
| 5213 | + dispatchEvent: function () { | |
| 5214 | + return false; | |
| 5215 | + }, | |
| 5216 | + onabort: function () { | |
| 5217 | + }, | |
| 5218 | + removeEventListener: function () { | |
| 5219 | + }, | |
| 5220 | + reason: void 0, | |
| 5221 | + throwIfAborted: function () { | |
| 5222 | + } | |
| 5223 | + }; | |
| 5224 | + } | |
| 5225 | + class_1.prototype.abort = function () { | |
| 5226 | + if (true) { | |
| 5227 | + if (!displayedWarning) { | |
| 5228 | + displayedWarning = true; | |
| 5229 | + 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'."); | |
| 5230 | + } | |
| 5231 | + } | |
| 5232 | + }; | |
| 5233 | + return class_1; | |
| 5234 | + }()); | |
| 5235 | + function actionCreator(arg) { | |
| 5236 | + return function (dispatch, getState, extra) { | |
| 5237 | + var requestId = (options == null ? void 0 : options.idGenerator) ? options.idGenerator(arg) : nanoid(); | |
| 5238 | + var abortController = new AC(); | |
| 5239 | + var abortReason; | |
| 5240 | + var started = false; | |
| 5241 | + function abort(reason) { | |
| 5242 | + abortReason = reason; | |
| 5243 | + abortController.abort(); | |
| 5244 | + } | |
| 5245 | + var promise2 = function () { | |
| 5246 | + return __async(this, null, function () { | |
| 5247 | + var _a, _b, finalAction, conditionResult, abortedPromise, err_1, skipDispatch; | |
| 5248 | + return __generator(this, function (_c) { | |
| 5249 | + switch (_c.label) { | |
| 5250 | + case 0: | |
| 5251 | + _c.trys.push([0, 4, , 5]); | |
| 5252 | + conditionResult = (_a = options == null ? void 0 : options.condition) == null ? void 0 : _a.call(options, arg, { getState: getState, extra: extra }); | |
| 5253 | + if (!isThenable(conditionResult)) return [3 /*break*/, 2]; | |
| 5254 | + return [4 /*yield*/, conditionResult]; | |
| 5255 | + case 1: | |
| 5256 | + conditionResult = _c.sent(); | |
| 5257 | + _c.label = 2; | |
| 5258 | + case 2: | |
| 5259 | + if (conditionResult === false || abortController.signal.aborted) { | |
| 5260 | + throw { | |
| 5261 | + name: "ConditionError", | |
| 5262 | + message: "Aborted due to condition callback returning false." | |
| 5263 | + }; | |
| 5264 | + } | |
| 5265 | + started = true; | |
| 5266 | + abortedPromise = new Promise(function (_, reject) { return abortController.signal.addEventListener("abort", function () { return reject({ | |
| 5267 | + name: "AbortError", | |
| 5268 | + message: abortReason || "Aborted" | |
| 5269 | + }); }); }); | |
| 5270 | + 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 }))); | |
| 5271 | + return [4 /*yield*/, Promise.race([ | |
| 5272 | + abortedPromise, | |
| 5273 | + Promise.resolve(payloadCreator(arg, { | |
| 5274 | + dispatch: dispatch, | |
| 5275 | + getState: getState, | |
| 5276 | + extra: extra, | |
| 5277 | + requestId: requestId, | |
| 5278 | + signal: abortController.signal, | |
| 5279 | + abort: abort, | |
| 5280 | + rejectWithValue: function (value, meta) { | |
| 5281 | + return new RejectWithValue(value, meta); | |
| 5282 | + }, | |
| 5283 | + fulfillWithValue: function (value, meta) { | |
| 5284 | + return new FulfillWithMeta(value, meta); | |
| 5285 | + } | |
| 5286 | + })).then(function (result) { | |
| 5287 | + if (result instanceof RejectWithValue) { | |
| 5288 | + throw result; | |
| 5289 | + } | |
| 5290 | + if (result instanceof FulfillWithMeta) { | |
| 5291 | + return fulfilled(result.payload, requestId, arg, result.meta); | |
| 5292 | + } | |
| 5293 | + return fulfilled(result, requestId, arg); | |
| 5294 | + }) | |
| 5295 | + ])]; | |
| 5296 | + case 3: | |
| 5297 | + finalAction = _c.sent(); | |
| 5298 | + return [3 /*break*/, 5]; | |
| 5299 | + case 4: | |
| 5300 | + err_1 = _c.sent(); | |
| 5301 | + finalAction = err_1 instanceof RejectWithValue ? rejected(null, requestId, arg, err_1.payload, err_1.meta) : rejected(err_1, requestId, arg); | |
| 5302 | + return [3 /*break*/, 5]; | |
| 5303 | + case 5: | |
| 5304 | + skipDispatch = options && !options.dispatchConditionRejection && rejected.match(finalAction) && finalAction.meta.condition; | |
| 5305 | + if (!skipDispatch) { | |
| 5306 | + dispatch(finalAction); | |
| 5307 | + } | |
| 5308 | + return [2 /*return*/, finalAction]; | |
| 5309 | + } | |
| 5310 | + }); | |
| 5311 | + }); | |
| 5312 | + }(); | |
| 5313 | + return Object.assign(promise2, { | |
| 5314 | + abort: abort, | |
| 5315 | + requestId: requestId, | |
| 5316 | + arg: arg, | |
| 5317 | + unwrap: function () { | |
| 5318 | + return promise2.then(unwrapResult); | |
| 5319 | + } | |
| 5320 | + }); | |
| 5321 | + }; | |
| 5322 | + } | |
| 5323 | + return Object.assign(actionCreator, { | |
| 5324 | + pending: pending, | |
| 5325 | + rejected: rejected, | |
| 5326 | + fulfilled: fulfilled, | |
| 5327 | + typePrefix: typePrefix | |
| 5328 | + }); | |
| 5329 | + } | |
| 5330 | + createAsyncThunk2.withTypes = function () { return createAsyncThunk2; }; | |
| 5331 | + return createAsyncThunk2; | |
| 5332 | +})(); | |
| 5333 | +function unwrapResult(action) { | |
| 5334 | + if (action.meta && action.meta.rejectedWithValue) { | |
| 5335 | + throw action.payload; | |
| 5336 | + } | |
| 5337 | + if (action.error) { | |
| 5338 | + throw action.error; | |
| 5339 | + } | |
| 5340 | + return action.payload; | |
| 5341 | +} | |
| 5342 | +function isThenable(value) { | |
| 5343 | + return value !== null && typeof value === "object" && typeof value.then === "function"; | |
| 5344 | +} | |
| 5345 | +// src/matchers.ts | |
| 5346 | +var matches = function (matcher, action) { | |
| 5347 | + if (hasMatchFunction(matcher)) { | |
| 5348 | + return matcher.match(action); | |
| 5349 | + } | |
| 5350 | + else { | |
| 5351 | + return matcher(action); | |
| 5352 | + } | |
| 5353 | +}; | |
| 5354 | +function isAnyOf() { | |
| 5355 | + var matchers = []; | |
| 5356 | + for (var _i = 0; _i < arguments.length; _i++) { | |
| 5357 | + matchers[_i] = arguments[_i]; | |
| 5358 | + } | |
| 5359 | + return function (action) { | |
| 5360 | + return matchers.some(function (matcher) { return matches(matcher, action); }); | |
| 5361 | + }; | |
| 5362 | +} | |
| 5363 | +function isAllOf() { | |
| 5364 | + var matchers = []; | |
| 5365 | + for (var _i = 0; _i < arguments.length; _i++) { | |
| 5366 | + matchers[_i] = arguments[_i]; | |
| 5367 | + } | |
| 5368 | + return function (action) { | |
| 5369 | + return matchers.every(function (matcher) { return matches(matcher, action); }); | |
| 5370 | + }; | |
| 5371 | +} | |
| 5372 | +function hasExpectedRequestMetadata(action, validStatus) { | |
| 5373 | + if (!action || !action.meta) | |
| 5374 | + return false; | |
| 5375 | + var hasValidRequestId = typeof action.meta.requestId === "string"; | |
| 5376 | + var hasValidRequestStatus = validStatus.indexOf(action.meta.requestStatus) > -1; | |
| 5377 | + return hasValidRequestId && hasValidRequestStatus; | |
| 5378 | +} | |
| 5379 | +function isAsyncThunkArray(a) { | |
| 5380 | + return typeof a[0] === "function" && "pending" in a[0] && "fulfilled" in a[0] && "rejected" in a[0]; | |
| 5381 | +} | |
| 5382 | +function isPending() { | |
| 5383 | + var asyncThunks = []; | |
| 5384 | + for (var _i = 0; _i < arguments.length; _i++) { | |
| 5385 | + asyncThunks[_i] = arguments[_i]; | |
| 5386 | + } | |
| 5387 | + if (asyncThunks.length === 0) { | |
| 5388 | + return function (action) { return hasExpectedRequestMetadata(action, ["pending"]); }; | |
| 5389 | + } | |
| 5390 | + if (!isAsyncThunkArray(asyncThunks)) { | |
| 5391 | + return isPending()(asyncThunks[0]); | |
| 5392 | + } | |
| 5393 | + return function (action) { | |
| 5394 | + var matchers = asyncThunks.map(function (asyncThunk) { return asyncThunk.pending; }); | |
| 5395 | + var combinedMatcher = isAnyOf.apply(void 0, matchers); | |
| 5396 | + return combinedMatcher(action); | |
| 5397 | + }; | |
| 5398 | +} | |
| 5399 | +function isRejected() { | |
| 5400 | + var asyncThunks = []; | |
| 5401 | + for (var _i = 0; _i < arguments.length; _i++) { | |
| 5402 | + asyncThunks[_i] = arguments[_i]; | |
| 5403 | + } | |
| 5404 | + if (asyncThunks.length === 0) { | |
| 5405 | + return function (action) { return hasExpectedRequestMetadata(action, ["rejected"]); }; | |
| 5406 | + } | |
| 5407 | + if (!isAsyncThunkArray(asyncThunks)) { | |
| 5408 | + return isRejected()(asyncThunks[0]); | |
| 5409 | + } | |
| 5410 | + return function (action) { | |
| 5411 | + var matchers = asyncThunks.map(function (asyncThunk) { return asyncThunk.rejected; }); | |
| 5412 | + var combinedMatcher = isAnyOf.apply(void 0, matchers); | |
| 5413 | + return combinedMatcher(action); | |
| 5414 | + }; | |
| 5415 | +} | |
| 5416 | +function isRejectedWithValue() { | |
| 5417 | + var asyncThunks = []; | |
| 5418 | + for (var _i = 0; _i < arguments.length; _i++) { | |
| 5419 | + asyncThunks[_i] = arguments[_i]; | |
| 5420 | + } | |
| 5421 | + var hasFlag = function (action) { | |
| 5422 | + return action && action.meta && action.meta.rejectedWithValue; | |
| 5423 | + }; | |
| 5424 | + if (asyncThunks.length === 0) { | |
| 5425 | + return function (action) { | |
| 5426 | + var combinedMatcher = isAllOf(isRejected.apply(void 0, asyncThunks), hasFlag); | |
| 5427 | + return combinedMatcher(action); | |
| 5428 | + }; | |
| 5429 | + } | |
| 5430 | + if (!isAsyncThunkArray(asyncThunks)) { | |
| 5431 | + return isRejectedWithValue()(asyncThunks[0]); | |
| 5432 | + } | |
| 5433 | + return function (action) { | |
| 5434 | + var combinedMatcher = isAllOf(isRejected.apply(void 0, asyncThunks), hasFlag); | |
| 5435 | + return combinedMatcher(action); | |
| 5436 | + }; | |
| 5437 | +} | |
| 5438 | +function isFulfilled() { | |
| 5439 | + var asyncThunks = []; | |
| 5440 | + for (var _i = 0; _i < arguments.length; _i++) { | |
| 5441 | + asyncThunks[_i] = arguments[_i]; | |
| 5442 | + } | |
| 5443 | + if (asyncThunks.length === 0) { | |
| 5444 | + return function (action) { return hasExpectedRequestMetadata(action, ["fulfilled"]); }; | |
| 5445 | + } | |
| 5446 | + if (!isAsyncThunkArray(asyncThunks)) { | |
| 5447 | + return isFulfilled()(asyncThunks[0]); | |
| 5448 | + } | |
| 5449 | + return function (action) { | |
| 5450 | + var matchers = asyncThunks.map(function (asyncThunk) { return asyncThunk.fulfilled; }); | |
| 5451 | + var combinedMatcher = isAnyOf.apply(void 0, matchers); | |
| 5452 | + return combinedMatcher(action); | |
| 5453 | + }; | |
| 5454 | +} | |
| 5455 | +function isAsyncThunkAction() { | |
| 5456 | + var asyncThunks = []; | |
| 5457 | + for (var _i = 0; _i < arguments.length; _i++) { | |
| 5458 | + asyncThunks[_i] = arguments[_i]; | |
| 5459 | + } | |
| 5460 | + if (asyncThunks.length === 0) { | |
| 5461 | + return function (action) { return hasExpectedRequestMetadata(action, ["pending", "fulfilled", "rejected"]); }; | |
| 5462 | + } | |
| 5463 | + if (!isAsyncThunkArray(asyncThunks)) { | |
| 5464 | + return isAsyncThunkAction()(asyncThunks[0]); | |
| 5465 | + } | |
| 5466 | + return function (action) { | |
| 5467 | + var matchers = []; | |
| 5468 | + for (var _i = 0, asyncThunks_1 = asyncThunks; _i < asyncThunks_1.length; _i++) { | |
| 5469 | + var asyncThunk = asyncThunks_1[_i]; | |
| 5470 | + matchers.push(asyncThunk.pending, asyncThunk.rejected, asyncThunk.fulfilled); | |
| 5471 | + } | |
| 5472 | + var combinedMatcher = isAnyOf.apply(void 0, matchers); | |
| 5473 | + return combinedMatcher(action); | |
| 5474 | + }; | |
| 5475 | +} | |
| 5476 | +// src/listenerMiddleware/utils.ts | |
| 5477 | +var assertFunction = function (func, expected) { | |
| 5478 | + if (typeof func !== "function") { | |
| 5479 | + throw new TypeError(expected + " is not a function"); | |
| 5480 | + } | |
| 5481 | +}; | |
| 5482 | +var noop = function () { | |
| 5483 | +}; | |
| 5484 | +var catchRejection = function (promise2, onError) { | |
| 5485 | + if (onError === void 0) { onError = noop; } | |
| 5486 | + promise2.catch(onError); | |
| 5487 | + return promise2; | |
| 5488 | +}; | |
| 5489 | +var addAbortSignalListener = function (abortSignal, callback) { | |
| 5490 | + abortSignal.addEventListener("abort", callback, { once: true }); | |
| 5491 | + return function () { return abortSignal.removeEventListener("abort", callback); }; | |
| 5492 | +}; | |
| 5493 | +var abortControllerWithReason = function (abortController, reason) { | |
| 5494 | + var signal = abortController.signal; | |
| 5495 | + if (signal.aborted) { | |
| 5496 | + return; | |
| 5497 | + } | |
| 5498 | + if (!("reason" in signal)) { | |
| 5499 | + Object.defineProperty(signal, "reason", { | |
| 5500 | + enumerable: true, | |
| 5501 | + value: reason, | |
| 5502 | + configurable: true, | |
| 5503 | + writable: true | |
| 5504 | + }); | |
| 5505 | + } | |
| 5506 | + ; | |
| 5507 | + abortController.abort(reason); | |
| 5508 | +}; | |
| 5509 | +// src/listenerMiddleware/exceptions.ts | |
| 5510 | +var task = "task"; | |
| 5511 | +var listener = "listener"; | |
| 5512 | +var completed = "completed"; | |
| 5513 | +var cancelled = "cancelled"; | |
| 5514 | +var taskCancelled = "task-" + cancelled; | |
| 5515 | +var taskCompleted = "task-" + completed; | |
| 5516 | +var listenerCancelled = listener + "-" + cancelled; | |
| 5517 | +var listenerCompleted = listener + "-" + completed; | |
| 5518 | +var TaskAbortError = /** @class */ (function () { | |
| 5519 | + function TaskAbortError(code) { | |
| 5520 | + this.code = code; | |
| 5521 | + this.name = "TaskAbortError"; | |
| 5522 | + this.message = task + " " + cancelled + " (reason: " + code + ")"; | |
| 5523 | + } | |
| 5524 | + return TaskAbortError; | |
| 5525 | +}()); | |
| 5526 | +// src/listenerMiddleware/task.ts | |
| 5527 | +var validateActive = function (signal) { | |
| 5528 | + if (signal.aborted) { | |
| 5529 | + throw new TaskAbortError(signal.reason); | |
| 5530 | + } | |
| 5531 | +}; | |
| 5532 | +function raceWithSignal(signal, promise2) { | |
| 5533 | + var cleanup = noop; | |
| 5534 | + return new Promise(function (resolve, reject) { | |
| 5535 | + var notifyRejection = function () { return reject(new TaskAbortError(signal.reason)); }; | |
| 5536 | + if (signal.aborted) { | |
| 5537 | + notifyRejection(); | |
| 5538 | + return; | |
| 5539 | + } | |
| 5540 | + cleanup = addAbortSignalListener(signal, notifyRejection); | |
| 5541 | + promise2.finally(function () { return cleanup(); }).then(resolve, reject); | |
| 5542 | + }).finally(function () { | |
| 5543 | + cleanup = noop; | |
| 5544 | + }); | |
| 5545 | +} | |
| 5546 | +var runTask = function (task2, cleanUp) { return __async(void 0, null, function () { | |
| 5547 | + var value, error_1; | |
| 5548 | + return __generator(this, function (_c) { | |
| 5549 | + switch (_c.label) { | |
| 5550 | + case 0: | |
| 5551 | + _c.trys.push([0, 3, 4, 5]); | |
| 5552 | + return [4 /*yield*/, Promise.resolve()]; | |
| 5553 | + case 1: | |
| 5554 | + _c.sent(); | |
| 5555 | + return [4 /*yield*/, task2()]; | |
| 5556 | + case 2: | |
| 5557 | + value = _c.sent(); | |
| 5558 | + return [2 /*return*/, { | |
| 5559 | + status: "ok", | |
| 5560 | + value: value | |
| 5561 | + }]; | |
| 5562 | + case 3: | |
| 5563 | + error_1 = _c.sent(); | |
| 5564 | + return [2 /*return*/, { | |
| 5565 | + status: error_1 instanceof TaskAbortError ? "cancelled" : "rejected", | |
| 5566 | + error: error_1 | |
| 5567 | + }]; | |
| 5568 | + case 4: | |
| 5569 | + cleanUp == null ? void 0 : cleanUp(); | |
| 5570 | + return [7 /*endfinally*/]; | |
| 5571 | + case 5: return [2 /*return*/]; | |
| 5572 | + } | |
| 5573 | + }); | |
| 5574 | +}); }; | |
| 5575 | +var createPause = function (signal) { | |
| 5576 | + return function (promise2) { | |
| 5577 | + return catchRejection(raceWithSignal(signal, promise2).then(function (output) { | |
| 5578 | + validateActive(signal); | |
| 5579 | + return output; | |
| 5580 | + })); | |
| 5581 | + }; | |
| 5582 | +}; | |
| 5583 | +var createDelay = function (signal) { | |
| 5584 | + var pause = createPause(signal); | |
| 5585 | + return function (timeoutMs) { | |
| 5586 | + return pause(new Promise(function (resolve) { return setTimeout(resolve, timeoutMs); })); | |
| 5587 | + }; | |
| 5588 | +}; | |
| 5589 | +// src/listenerMiddleware/index.ts | |
| 5590 | +var assign = Object.assign; | |
| 5591 | +var INTERNAL_NIL_TOKEN = {}; | |
| 5592 | +var alm = "listenerMiddleware"; | |
| 5593 | +var createFork = function (parentAbortSignal, parentBlockingPromises) { | |
| 5594 | + var linkControllers = function (controller) { return addAbortSignalListener(parentAbortSignal, function () { return abortControllerWithReason(controller, parentAbortSignal.reason); }); }; | |
| 5595 | + return function (taskExecutor, opts) { | |
| 5596 | + assertFunction(taskExecutor, "taskExecutor"); | |
| 5597 | + var childAbortController = new AbortController(); | |
| 5598 | + linkControllers(childAbortController); | |
| 5599 | + var result = runTask(function () { return __async(void 0, null, function () { | |
| 5600 | + var result2; | |
| 5601 | + return __generator(this, function (_c) { | |
| 5602 | + switch (_c.label) { | |
| 5603 | + case 0: | |
| 5604 | + validateActive(parentAbortSignal); | |
| 5605 | + validateActive(childAbortController.signal); | |
| 5606 | + return [4 /*yield*/, taskExecutor({ | |
| 5607 | + pause: createPause(childAbortController.signal), | |
| 5608 | + delay: createDelay(childAbortController.signal), | |
| 5609 | + signal: childAbortController.signal | |
| 5610 | + })]; | |
| 5611 | + case 1: | |
| 5612 | + result2 = _c.sent(); | |
| 5613 | + validateActive(childAbortController.signal); | |
| 5614 | + return [2 /*return*/, result2]; | |
| 5615 | + } | |
| 5616 | + }); | |
| 5617 | + }); }, function () { return abortControllerWithReason(childAbortController, taskCompleted); }); | |
| 5618 | + if (opts == null ? void 0 : opts.autoJoin) { | |
| 5619 | + parentBlockingPromises.push(result); | |
| 5620 | + } | |
| 5621 | + return { | |
| 5622 | + result: createPause(parentAbortSignal)(result), | |
| 5623 | + cancel: function () { | |
| 5624 | + abortControllerWithReason(childAbortController, taskCancelled); | |
| 5625 | + } | |
| 5626 | + }; | |
| 5627 | + }; | |
| 5628 | +}; | |
| 5629 | +var createTakePattern = function (startListening, signal) { | |
| 5630 | + var take = function (predicate, timeout) { return __async(void 0, null, function () { | |
| 5631 | + var unsubscribe, tuplePromise, promises, output; | |
| 5632 | + return __generator(this, function (_c) { | |
| 5633 | + switch (_c.label) { | |
| 5634 | + case 0: | |
| 5635 | + validateActive(signal); | |
| 5636 | + unsubscribe = function () { | |
| 5637 | + }; | |
| 5638 | + tuplePromise = new Promise(function (resolve, reject) { | |
| 5639 | + var stopListening = startListening({ | |
| 5640 | + predicate: predicate, | |
| 5641 | + effect: function (action, listenerApi) { | |
| 5642 | + listenerApi.unsubscribe(); | |
| 5643 | + resolve([ | |
| 5644 | + action, | |
| 5645 | + listenerApi.getState(), | |
| 5646 | + listenerApi.getOriginalState() | |
| 5647 | + ]); | |
| 5648 | + } | |
| 5649 | + }); | |
| 5650 | + unsubscribe = function () { | |
| 5651 | + stopListening(); | |
| 5652 | + reject(); | |
| 5653 | + }; | |
| 5654 | + }); | |
| 5655 | + promises = [ | |
| 5656 | + tuplePromise | |
| 5657 | + ]; | |
| 5658 | + if (timeout != null) { | |
| 5659 | + promises.push(new Promise(function (resolve) { return setTimeout(resolve, timeout, null); })); | |
| 5660 | + } | |
| 5661 | + _c.label = 1; | |
| 5662 | + case 1: | |
| 5663 | + _c.trys.push([1, , 3, 4]); | |
| 5664 | + return [4 /*yield*/, raceWithSignal(signal, Promise.race(promises))]; | |
| 5665 | + case 2: | |
| 5666 | + output = _c.sent(); | |
| 5667 | + validateActive(signal); | |
| 5668 | + return [2 /*return*/, output]; | |
| 5669 | + case 3: | |
| 5670 | + unsubscribe(); | |
| 5671 | + return [7 /*endfinally*/]; | |
| 5672 | + case 4: return [2 /*return*/]; | |
| 5673 | + } | |
| 5674 | + }); | |
| 5675 | + }); }; | |
| 5676 | + return function (predicate, timeout) { return catchRejection(take(predicate, timeout)); }; | |
| 5677 | +}; | |
| 5678 | +var getListenerEntryPropsFrom = function (options) { | |
| 5679 | + var type = options.type, actionCreator = options.actionCreator, matcher = options.matcher, predicate = options.predicate, effect = options.effect; | |
| 5680 | + if (type) { | |
| 5681 | + predicate = createAction(type).match; | |
| 5682 | + } | |
| 5683 | + else if (actionCreator) { | |
| 5684 | + type = actionCreator.type; | |
| 5685 | + predicate = actionCreator.match; | |
| 5686 | + } | |
| 5687 | + else if (matcher) { | |
| 5688 | + predicate = matcher; | |
| 5689 | + } | |
| 5690 | + else if (predicate) { | |
| 5691 | + } | |
| 5692 | + else { | |
| 5693 | + throw new Error("Creating or removing a listener requires one of the known fields for matching an action"); | |
| 5694 | + } | |
| 5695 | + assertFunction(effect, "options.listener"); | |
| 5696 | + return { predicate: predicate, type: type, effect: effect }; | |
| 5697 | +}; | |
| 5698 | +var createListenerEntry = function (options) { | |
| 5699 | + var _c = getListenerEntryPropsFrom(options), type = _c.type, predicate = _c.predicate, effect = _c.effect; | |
| 5700 | + var id = nanoid(); | |
| 5701 | + var entry = { | |
| 5702 | + id: id, | |
| 5703 | + effect: effect, | |
| 5704 | + type: type, | |
| 5705 | + predicate: predicate, | |
| 5706 | + pending: new Set(), | |
| 5707 | + unsubscribe: function () { | |
| 5708 | + throw new Error("Unsubscribe not initialized"); | |
| 5709 | + } | |
| 5710 | + }; | |
| 5711 | + return entry; | |
| 5712 | +}; | |
| 5713 | +var cancelActiveListeners = function (entry) { | |
| 5714 | + entry.pending.forEach(function (controller) { | |
| 5715 | + abortControllerWithReason(controller, listenerCancelled); | |
| 5716 | + }); | |
| 5717 | +}; | |
| 5718 | +var createClearListenerMiddleware = function (listenerMap) { | |
| 5719 | + return function () { | |
| 5720 | + listenerMap.forEach(cancelActiveListeners); | |
| 5721 | + listenerMap.clear(); | |
| 5722 | + }; | |
| 5723 | +}; | |
| 5724 | +var safelyNotifyError = function (errorHandler, errorToNotify, errorInfo) { | |
| 5725 | + try { | |
| 5726 | + errorHandler(errorToNotify, errorInfo); | |
| 5727 | + } | |
| 5728 | + catch (errorHandlerError) { | |
| 5729 | + setTimeout(function () { | |
| 5730 | + throw errorHandlerError; | |
| 5731 | + }, 0); | |
| 5732 | + } | |
| 5733 | +}; | |
| 5734 | +var addListener = createAction(alm + "/add"); | |
| 5735 | +var clearAllListeners = createAction(alm + "/removeAll"); | |
| 5736 | +var removeListener = createAction(alm + "/remove"); | |
| 5737 | +var defaultErrorHandler = function () { | |
| 5738 | + var args = []; | |
| 5739 | + for (var _i = 0; _i < arguments.length; _i++) { | |
| 5740 | + args[_i] = arguments[_i]; | |
| 5741 | + } | |
| 5742 | + console.error.apply(console, __spreadArray([alm + "/error"], args)); | |
| 5743 | +}; | |
| 5744 | +function createListenerMiddleware(middlewareOptions) { | |
| 5745 | + var _this = this; | |
| 5746 | + if (middlewareOptions === void 0) { middlewareOptions = {}; } | |
| 5747 | + var listenerMap = new Map(); | |
| 5748 | + var extra = middlewareOptions.extra, _c = middlewareOptions.onError, onError = _c === void 0 ? defaultErrorHandler : _c; | |
| 5749 | + assertFunction(onError, "onError"); | |
| 5750 | + var insertEntry = function (entry) { | |
| 5751 | + entry.unsubscribe = function () { return listenerMap.delete(entry.id); }; | |
| 5752 | + listenerMap.set(entry.id, entry); | |
| 5753 | + return function (cancelOptions) { | |
| 5754 | + entry.unsubscribe(); | |
| 5755 | + if (cancelOptions == null ? void 0 : cancelOptions.cancelActive) { | |
| 5756 | + cancelActiveListeners(entry); | |
| 5757 | + } | |
| 5758 | + }; | |
| 5759 | + }; | |
| 5760 | + var findListenerEntry = function (comparator) { | |
| 5761 | + for (var _i = 0, _c = Array.from(listenerMap.values()); _i < _c.length; _i++) { | |
| 5762 | + var entry = _c[_i]; | |
| 5763 | + if (comparator(entry)) { | |
| 5764 | + return entry; | |
| 5765 | + } | |
| 5766 | + } | |
| 5767 | + return void 0; | |
| 5768 | + }; | |
| 5769 | + var startListening = function (options) { | |
| 5770 | + var entry = findListenerEntry(function (existingEntry) { return existingEntry.effect === options.effect; }); | |
| 5771 | + if (!entry) { | |
| 5772 | + entry = createListenerEntry(options); | |
| 5773 | + } | |
| 5774 | + return insertEntry(entry); | |
| 5775 | + }; | |
| 5776 | + var stopListening = function (options) { | |
| 5777 | + var _c = getListenerEntryPropsFrom(options), type = _c.type, effect = _c.effect, predicate = _c.predicate; | |
| 5778 | + var entry = findListenerEntry(function (entry2) { | |
| 5779 | + var matchPredicateOrType = typeof type === "string" ? entry2.type === type : entry2.predicate === predicate; | |
| 5780 | + return matchPredicateOrType && entry2.effect === effect; | |
| 5781 | + }); | |
| 5782 | + if (entry) { | |
| 5783 | + entry.unsubscribe(); | |
| 5784 | + if (options.cancelActive) { | |
| 5785 | + cancelActiveListeners(entry); | |
| 5786 | + } | |
| 5787 | + } | |
| 5788 | + return !!entry; | |
| 5789 | + }; | |
| 5790 | + var notifyListener = function (entry, action, api, getOriginalState) { return __async(_this, null, function () { | |
| 5791 | + var internalTaskController, take, autoJoinPromises, listenerError_1; | |
| 5792 | + return __generator(this, function (_c) { | |
| 5793 | + switch (_c.label) { | |
| 5794 | + case 0: | |
| 5795 | + internalTaskController = new AbortController(); | |
| 5796 | + take = createTakePattern(startListening, internalTaskController.signal); | |
| 5797 | + autoJoinPromises = []; | |
| 5798 | + _c.label = 1; | |
| 5799 | + case 1: | |
| 5800 | + _c.trys.push([1, 3, 4, 6]); | |
| 5801 | + entry.pending.add(internalTaskController); | |
| 5802 | + return [4 /*yield*/, Promise.resolve(entry.effect(action, assign({}, api, { | |
| 5803 | + getOriginalState: getOriginalState, | |
| 5804 | + condition: function (predicate, timeout) { return take(predicate, timeout).then(Boolean); }, | |
| 5805 | + take: take, | |
| 5806 | + delay: createDelay(internalTaskController.signal), | |
| 5807 | + pause: createPause(internalTaskController.signal), | |
| 5808 | + extra: extra, | |
| 5809 | + signal: internalTaskController.signal, | |
| 5810 | + fork: createFork(internalTaskController.signal, autoJoinPromises), | |
| 5811 | + unsubscribe: entry.unsubscribe, | |
| 5812 | + subscribe: function () { | |
| 5813 | + listenerMap.set(entry.id, entry); | |
| 5814 | + }, | |
| 5815 | + cancelActiveListeners: function () { | |
| 5816 | + entry.pending.forEach(function (controller, _, set) { | |
| 5817 | + if (controller !== internalTaskController) { | |
| 5818 | + abortControllerWithReason(controller, listenerCancelled); | |
| 5819 | + set.delete(controller); | |
| 5820 | + } | |
| 5821 | + }); | |
| 5822 | + } | |
| 5823 | + })))]; | |
| 5824 | + case 2: | |
| 5825 | + _c.sent(); | |
| 5826 | + return [3 /*break*/, 6]; | |
| 5827 | + case 3: | |
| 5828 | + listenerError_1 = _c.sent(); | |
| 5829 | + if (!(listenerError_1 instanceof TaskAbortError)) { | |
| 5830 | + safelyNotifyError(onError, listenerError_1, { | |
| 5831 | + raisedBy: "effect" | |
| 5832 | + }); | |
| 5833 | + } | |
| 5834 | + return [3 /*break*/, 6]; | |
| 5835 | + case 4: return [4 /*yield*/, Promise.allSettled(autoJoinPromises)]; | |
| 5836 | + case 5: | |
| 5837 | + _c.sent(); | |
| 5838 | + abortControllerWithReason(internalTaskController, listenerCompleted); | |
| 5839 | + entry.pending.delete(internalTaskController); | |
| 5840 | + return [7 /*endfinally*/]; | |
| 5841 | + case 6: return [2 /*return*/]; | |
| 5842 | + } | |
| 5843 | + }); | |
| 5844 | + }); }; | |
| 5845 | + var clearListenerMiddleware = createClearListenerMiddleware(listenerMap); | |
| 5846 | + var middleware = function (api) { return function (next) { return function (action) { | |
| 5847 | + if (!isAction(action)) { | |
| 5848 | + return next(action); | |
| 5849 | + } | |
| 5850 | + if (addListener.match(action)) { | |
| 5851 | + return startListening(action.payload); | |
| 5852 | + } | |
| 5853 | + if (clearAllListeners.match(action)) { | |
| 5854 | + clearListenerMiddleware(); | |
| 5855 | + return; | |
| 5856 | + } | |
| 5857 | + if (removeListener.match(action)) { | |
| 5858 | + return stopListening(action.payload); | |
| 5859 | + } | |
| 5860 | + var originalState = api.getState(); | |
| 5861 | + var getOriginalState = function () { | |
| 5862 | + if (originalState === INTERNAL_NIL_TOKEN) { | |
| 5863 | + throw new Error(alm + ": getOriginalState can only be called synchronously"); | |
| 5864 | + } | |
| 5865 | + return originalState; | |
| 5866 | + }; | |
| 5867 | + var result; | |
| 5868 | + try { | |
| 5869 | + result = next(action); | |
| 5870 | + if (listenerMap.size > 0) { | |
| 5871 | + var currentState = api.getState(); | |
| 5872 | + var listenerEntries = Array.from(listenerMap.values()); | |
| 5873 | + for (var _i = 0, listenerEntries_1 = listenerEntries; _i < listenerEntries_1.length; _i++) { | |
| 5874 | + var entry = listenerEntries_1[_i]; | |
| 5875 | + var runListener = false; | |
| 5876 | + try { | |
| 5877 | + runListener = entry.predicate(action, currentState, originalState); | |
| 5878 | + } | |
| 5879 | + catch (predicateError) { | |
| 5880 | + runListener = false; | |
| 5881 | + safelyNotifyError(onError, predicateError, { | |
| 5882 | + raisedBy: "predicate" | |
| 5883 | + }); | |
| 5884 | + } | |
| 5885 | + if (!runListener) { | |
| 5886 | + continue; | |
| 5887 | + } | |
| 5888 | + notifyListener(entry, action, api, getOriginalState); | |
| 5889 | + } | |
| 5890 | + } | |
| 5891 | + } | |
| 5892 | + finally { | |
| 5893 | + originalState = INTERNAL_NIL_TOKEN; | |
| 5894 | + } | |
| 5895 | + return result; | |
| 5896 | + }; }; }; | |
| 5897 | + return { | |
| 5898 | + middleware: middleware, | |
| 5899 | + startListening: startListening, | |
| 5900 | + stopListening: stopListening, | |
| 5901 | + clearListeners: clearListenerMiddleware | |
| 5902 | + }; | |
| 5903 | +} | |
| 5904 | +// src/autoBatchEnhancer.ts | |
| 5905 | +var SHOULD_AUTOBATCH = "RTK_autoBatch"; | |
| 5906 | +var prepareAutoBatched = function () { return function (payload) { | |
| 5907 | + var _c; | |
| 5908 | + return ({ | |
| 5909 | + payload: payload, | |
| 5910 | + meta: (_c = {}, _c[SHOULD_AUTOBATCH] = true, _c) | |
| 5911 | + }); | |
| 5912 | +}; }; | |
| 5913 | +var promise; | |
| 5914 | +var queueMicrotaskShim = typeof queueMicrotask === "function" ? queueMicrotask.bind(typeof window !== "undefined" ? window : typeof __webpack_require__.g !== "undefined" ? __webpack_require__.g : globalThis) : function (cb) { return (promise || (promise = Promise.resolve())).then(cb).catch(function (err) { return setTimeout(function () { | |
| 5915 | + throw err; | |
| 5916 | +}, 0); }); }; | |
| 5917 | +var createQueueWithTimer = function (timeout) { | |
| 5918 | + return function (notify) { | |
| 5919 | + setTimeout(notify, timeout); | |
| 5920 | + }; | |
| 5921 | +}; | |
| 5922 | +var rAF = typeof window !== "undefined" && window.requestAnimationFrame ? window.requestAnimationFrame : createQueueWithTimer(10); | |
| 5923 | +var autoBatchEnhancer = function (options) { | |
| 5924 | + if (options === void 0) { options = { type: "raf" }; } | |
| 5925 | + return function (next) { return function () { | |
| 5926 | + var args = []; | |
| 5927 | + for (var _i = 0; _i < arguments.length; _i++) { | |
| 5928 | + args[_i] = arguments[_i]; | |
| 5929 | + } | |
| 5930 | + var store = next.apply(void 0, args); | |
| 5931 | + var notifying = true; | |
| 5932 | + var shouldNotifyAtEndOfTick = false; | |
| 5933 | + var notificationQueued = false; | |
| 5934 | + var listeners = new Set(); | |
| 5935 | + var queueCallback = options.type === "tick" ? queueMicrotaskShim : options.type === "raf" ? rAF : options.type === "callback" ? options.queueNotification : createQueueWithTimer(options.timeout); | |
| 5936 | + var notifyListeners = function () { | |
| 5937 | + notificationQueued = false; | |
| 5938 | + if (shouldNotifyAtEndOfTick) { | |
| 5939 | + shouldNotifyAtEndOfTick = false; | |
| 5940 | + listeners.forEach(function (l) { return l(); }); | |
| 5941 | + } | |
| 5942 | + }; | |
| 5943 | + return Object.assign({}, store, { | |
| 5944 | + subscribe: function (listener2) { | |
| 5945 | + var wrappedListener = function () { return notifying && listener2(); }; | |
| 5946 | + var unsubscribe = store.subscribe(wrappedListener); | |
| 5947 | + listeners.add(listener2); | |
| 5948 | + return function () { | |
| 5949 | + unsubscribe(); | |
| 5950 | + listeners.delete(listener2); | |
| 5951 | + }; | |
| 5952 | + }, | |
| 5953 | + dispatch: function (action) { | |
| 5954 | + var _a; | |
| 5955 | + try { | |
| 5956 | + notifying = !((_a = action == null ? void 0 : action.meta) == null ? void 0 : _a[SHOULD_AUTOBATCH]); | |
| 5957 | + shouldNotifyAtEndOfTick = !notifying; | |
| 5958 | + if (shouldNotifyAtEndOfTick) { | |
| 5959 | + if (!notificationQueued) { | |
| 5960 | + notificationQueued = true; | |
| 5961 | + queueCallback(notifyListeners); | |
| 5962 | + } | |
| 5963 | + } | |
| 5964 | + return store.dispatch(action); | |
| 5965 | + } | |
| 5966 | + finally { | |
| 5967 | + notifying = true; | |
| 5968 | + } | |
| 5969 | + } | |
| 5970 | + }); | |
| 5971 | + }; }; | |
| 5972 | +}; | |
| 5973 | +// src/index.ts | |
| 5974 | +(0,immer__WEBPACK_IMPORTED_MODULE_2__.enableES5)(); | |
| 5975 | + | |
| 5976 | +//# sourceMappingURL=redux-toolkit.esm.js.map | |
| 5977 | + | |
| 5978 | +/***/ }), | |
| 5979 | + | |
| 5980 | +/***/ "../node_modules/immer/dist/immer.esm.mjs": | |
| 3398 | 5981 | /*!************************************************!*\ |
| 3399 | - !*** external "elementorVendors.reduxToolkit" ***! | |
| 5982 | + !*** ../node_modules/immer/dist/immer.esm.mjs ***! | |
| 3400 | 5983 | \************************************************/ |
| 3401 | -/***/ ((module) => { | |
| 5984 | +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { | |
| 3402 | 5985 | |
| 3403 | 5986 | "use strict"; |
| 3404 | -module.exports = elementorVendors.reduxToolkit; | |
| 5987 | +__webpack_require__.r(__webpack_exports__); | |
| 5988 | +/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 5989 | +/* harmony export */ Immer: () => (/* binding */ un), | |
| 5990 | +/* harmony export */ applyPatches: () => (/* binding */ pn), | |
| 5991 | +/* harmony export */ castDraft: () => (/* binding */ K), | |
| 5992 | +/* harmony export */ castImmutable: () => (/* binding */ $), | |
| 5993 | +/* harmony export */ createDraft: () => (/* binding */ ln), | |
| 5994 | +/* harmony export */ current: () => (/* binding */ R), | |
| 5995 | +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__), | |
| 5996 | +/* harmony export */ enableAllPlugins: () => (/* binding */ J), | |
| 5997 | +/* harmony export */ enableES5: () => (/* binding */ F), | |
| 5998 | +/* harmony export */ enableMapSet: () => (/* binding */ C), | |
| 5999 | +/* harmony export */ enablePatches: () => (/* binding */ T), | |
| 6000 | +/* harmony export */ finishDraft: () => (/* binding */ dn), | |
| 6001 | +/* harmony export */ freeze: () => (/* binding */ d), | |
| 6002 | +/* harmony export */ immerable: () => (/* binding */ L), | |
| 6003 | +/* harmony export */ isDraft: () => (/* binding */ r), | |
| 6004 | +/* harmony export */ isDraftable: () => (/* binding */ t), | |
| 6005 | +/* harmony export */ nothing: () => (/* binding */ H), | |
| 6006 | +/* harmony export */ original: () => (/* binding */ e), | |
| 6007 | +/* harmony export */ produce: () => (/* binding */ fn), | |
| 6008 | +/* harmony export */ produceWithPatches: () => (/* binding */ cn), | |
| 6009 | +/* harmony export */ setAutoFreeze: () => (/* binding */ sn), | |
| 6010 | +/* harmony export */ setUseProxies: () => (/* binding */ vn) | |
| 6011 | +/* harmony export */ }); | |
| 6012 | +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(true){var i=Y[n],o=i?"function"==typeof i?i.apply(null,t):i:"unknown error nr: "+n;throw Error("[Immer] "+o)}// removed by dead control flow | |
| 6013 | +{}}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 e(t){return r(t)||n(23,t),t[Q].t}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 false||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( true&&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 true&&f(r),en.get(r,n)},set:function(r){var t=this[Q]; true&&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)}})}function T(){function e(n){if(!t(n))return n;if(Array.isArray(n))return n.map(e);if(s(n))return new Map(Array.from(n.entries()).map((function(n){return[n[0],e(n[1])]})));if(v(n))return new Set(Array.from(n).map(e));var r=Object.create(Object.getPrototypeOf(n));for(var i in n)r[i]=e(n[i]);return u(n,L)&&(r[L]=n[L]),r}function f(n){return r(n)?e(n):n}var c="add";m("Patches",{$:function(r,t){return t.forEach((function(t){for(var i=t.path,u=t.op,f=r,s=0;s<i.length-1;s++){var v=o(f),p=i[s];"string"!=typeof p&&"number"!=typeof p&&(p=""+p),0!==v&&1!==v||"__proto__"!==p&&"constructor"!==p||n(24),"function"==typeof f&&"prototype"===p&&n(24),"object"!=typeof(f=a(f,p))&&n(15,i.join("/"))}var l=o(f),d=e(t.value),h=i[i.length-1];switch(u){case"replace":switch(l){case 2:return f.set(h,d);case 3:n(16);default:return f[h]=d}case c:switch(l){case 1:return"-"===h?f.push(d):f.splice(h,0,d);case 2:return f.set(h,d);case 3:return f.add(d);default:return f[h]=d}case"remove":switch(l){case 1:return f.splice(h,1);case 2:return f.delete(h);case 3:return f.delete(t.value);default:return delete f[h]}default:n(17,u)}})),r},N:function(n,r,t,e){switch(n.i){case 0:case 4:case 2:return function(n,r,t,e){var o=n.t,s=n.o;i(n.R,(function(n,i){var v=a(o,n),p=a(s,n),l=i?u(o,n)?"replace":c:"remove";if(v!==p||"replace"!==l){var d=r.concat(n);t.push("remove"===l?{op:l,path:d}:{op:l,path:d,value:p}),e.push(l===c?{op:"remove",path:d}:"remove"===l?{op:c,path:d,value:f(v)}:{op:"replace",path:d,value:f(v)})}}))}(n,r,t,e);case 5:case 1:return function(n,r,t,e){var i=n.t,o=n.R,u=n.o;if(u.length<i.length){var a=[u,i];i=a[0],u=a[1];var s=[e,t];t=s[0],e=s[1]}for(var v=0;v<i.length;v++)if(o[v]&&u[v]!==i[v]){var p=r.concat([v]);t.push({op:"replace",path:p,value:f(u[v])}),e.push({op:"replace",path:p,value:f(i[v])})}for(var l=i.length;l<u.length;l++){var d=r.concat([l]);t.push({op:c,path:d,value:f(u[l])})}i.length<u.length&&e.push({op:"replace",path:r.concat(["length"]),value:i.length})}(n,r,t,e);case 3:return function(n,r,t,e){var i=n.t,o=n.o,u=0;i.forEach((function(n){if(!o.has(n)){var i=r.concat([u]);t.push({op:"remove",path:i,value:n}),e.unshift({op:c,path:i,value:n})}u++})),u=0,o.forEach((function(n){if(!i.has(n)){var o=r.concat([u]);t.push({op:c,path:o,value:n}),e.unshift({op:"remove",path:o,value:n})}u++}))}(n,r,t,e)}},M:function(n,r,t,e){t.push({op:"replace",path:[],value:r===H?void 0:r}),e.push({op:"replace",path:[],value:n})}})}function C(){function r(n,r){function t(){this.constructor=n}a(n,r),n.prototype=(t.prototype=r.prototype,new t)}function e(n){n.o||(n.R=new Map,n.o=new Map(n.t))}function o(n){n.o||(n.o=new Set,n.t.forEach((function(r){if(t(r)){var e=N(n.A.h,r,n);n.p.set(r,e),n.o.add(e)}else n.o.add(r)})))}function u(r){r.g&&n(3,JSON.stringify(p(r)))}var a=function(n,r){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var t in r)r.hasOwnProperty(t)&&(n[t]=r[t])})(n,r)},f=function(){function n(n,r){return this[Q]={i:2,l:r,A:r?r.A:_(),P:!1,I:!1,o:void 0,R:void 0,t:n,k:this,C:!1,g:!1},this}r(n,Map);var o=n.prototype;return Object.defineProperty(o,"size",{get:function(){return p(this[Q]).size}}),o.has=function(n){return p(this[Q]).has(n)},o.set=function(n,r){var t=this[Q];return u(t),p(t).has(n)&&p(t).get(n)===r||(e(t),k(t),t.R.set(n,!0),t.o.set(n,r),t.R.set(n,!0)),this},o.delete=function(n){if(!this.has(n))return!1;var r=this[Q];return u(r),e(r),k(r),r.t.has(n)?r.R.set(n,!1):r.R.delete(n),r.o.delete(n),!0},o.clear=function(){var n=this[Q];u(n),p(n).size&&(e(n),k(n),n.R=new Map,i(n.t,(function(r){n.R.set(r,!1)})),n.o.clear())},o.forEach=function(n,r){var t=this;p(this[Q]).forEach((function(e,i){n.call(r,t.get(i),i,t)}))},o.get=function(n){var r=this[Q];u(r);var i=p(r).get(n);if(r.I||!t(i))return i;if(i!==r.t.get(n))return i;var o=N(r.A.h,i,r);return e(r),r.o.set(n,o),o},o.keys=function(){return p(this[Q]).keys()},o.values=function(){var n,r=this,t=this.keys();return(n={})[V]=function(){return r.values()},n.next=function(){var n=t.next();return n.done?n:{done:!1,value:r.get(n.value)}},n},o.entries=function(){var n,r=this,t=this.keys();return(n={})[V]=function(){return r.entries()},n.next=function(){var n=t.next();if(n.done)return n;var e=r.get(n.value);return{done:!1,value:[n.value,e]}},n},o[V]=function(){return this.entries()},n}(),c=function(){function n(n,r){return this[Q]={i:3,l:r,A:r?r.A:_(),P:!1,I:!1,o:void 0,t:n,k:this,p:new Map,g:!1,C:!1},this}r(n,Set);var t=n.prototype;return Object.defineProperty(t,"size",{get:function(){return p(this[Q]).size}}),t.has=function(n){var r=this[Q];return u(r),r.o?!!r.o.has(n)||!(!r.p.has(n)||!r.o.has(r.p.get(n))):r.t.has(n)},t.add=function(n){var r=this[Q];return u(r),this.has(n)||(o(r),k(r),r.o.add(n)),this},t.delete=function(n){if(!this.has(n))return!1;var r=this[Q];return u(r),o(r),k(r),r.o.delete(n)||!!r.p.has(n)&&r.o.delete(r.p.get(n))},t.clear=function(){var n=this[Q];u(n),p(n).size&&(o(n),k(n),n.o.clear())},t.values=function(){var n=this[Q];return u(n),o(n),n.o.values()},t.entries=function(){var n=this[Q];return u(n),o(n),n.o.entries()},t.keys=function(){return this.values()},t[V]=function(){return this.values()},t.forEach=function(n,r){for(var t=this.values(),e=t.next();!e.done;)n.call(r,e.value,e.value,this),e=t.next()},n}();m("MapSet",{F:function(n,r){return new f(n,r)},T:function(n,r){return new c(n,r)}})}function J(){F(),C(),T()}function K(n){return n}function $(n){return 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",V="undefined"!=typeof Symbol&&Symbol.iterator||"@@iterator",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 true&&isNaN(parseInt(t))&&n(13),on.set.call(this,r,t,void 0)},on.set=function(r,t,e){return true&&"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]; true&&(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,fn=an.produce,cn=an.produceWithPatches.bind(an),sn=an.setAutoFreeze.bind(an),vn=an.setUseProxies.bind(an),pn=an.applyPatches.bind(an),ln=an.createDraft.bind(an),dn=an.finishDraft.bind(an);/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (fn); | |
| 6014 | +//# sourceMappingURL=immer.esm.js.map | |
| 3405 | 6015 | |
| 6016 | + | |
| 6017 | +/***/ }), | |
| 6018 | + | |
| 6019 | +/***/ "../node_modules/redux-thunk/es/index.js": | |
| 6020 | +/*!***********************************************!*\ | |
| 6021 | + !*** ../node_modules/redux-thunk/es/index.js ***! | |
| 6022 | + \***********************************************/ | |
| 6023 | +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { | |
| 6024 | + | |
| 6025 | +"use strict"; | |
| 6026 | +__webpack_require__.r(__webpack_exports__); | |
| 6027 | +/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 6028 | +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) | |
| 6029 | +/* harmony export */ }); | |
| 6030 | +/** A function that accepts a potential "extra argument" value to be injected later, | |
| 6031 | + * and returns an instance of the thunk middleware that uses that value | |
| 6032 | + */ | |
| 6033 | +function createThunkMiddleware(extraArgument) { | |
| 6034 | + // Standard Redux middleware definition pattern: | |
| 6035 | + // See: https://redux.js.org/tutorials/fundamentals/part-4-store#writing-custom-middleware | |
| 6036 | + var middleware = function middleware(_ref) { | |
| 6037 | + var dispatch = _ref.dispatch, | |
| 6038 | + getState = _ref.getState; | |
| 6039 | + return function (next) { | |
| 6040 | + return function (action) { | |
| 6041 | + // The thunk middleware looks for any functions that were passed to `store.dispatch`. | |
| 6042 | + // If this "action" is really a function, call it and return the result. | |
| 6043 | + if (typeof action === 'function') { | |
| 6044 | + // Inject the store's `dispatch` and `getState` methods, as well as any "extra arg" | |
| 6045 | + return action(dispatch, getState, extraArgument); | |
| 6046 | + } // Otherwise, pass the action down the middleware chain as usual | |
| 6047 | + | |
| 6048 | + | |
| 6049 | + return next(action); | |
| 6050 | + }; | |
| 6051 | + }; | |
| 6052 | + }; | |
| 6053 | + | |
| 6054 | + return middleware; | |
| 6055 | +} | |
| 6056 | + | |
| 6057 | +var thunk = createThunkMiddleware(); // Attach the factory function so users can create a customized version | |
| 6058 | +// with whatever "extra arg" they want to inject into their thunks | |
| 6059 | + | |
| 6060 | +thunk.withExtraArgument = createThunkMiddleware; | |
| 6061 | +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (thunk); | |
| 6062 | + | |
| 6063 | +/***/ }), | |
| 6064 | + | |
| 6065 | +/***/ "../node_modules/redux/es/redux.js": | |
| 6066 | +/*!*****************************************!*\ | |
| 6067 | + !*** ../node_modules/redux/es/redux.js ***! | |
| 6068 | + \*****************************************/ | |
| 6069 | +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { | |
| 6070 | + | |
| 6071 | +"use strict"; | |
| 6072 | +__webpack_require__.r(__webpack_exports__); | |
| 6073 | +/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 6074 | +/* harmony export */ __DO_NOT_USE__ActionTypes: () => (/* binding */ ActionTypes), | |
| 6075 | +/* harmony export */ applyMiddleware: () => (/* binding */ applyMiddleware), | |
| 6076 | +/* harmony export */ bindActionCreators: () => (/* binding */ bindActionCreators), | |
| 6077 | +/* harmony export */ combineReducers: () => (/* binding */ combineReducers), | |
| 6078 | +/* harmony export */ compose: () => (/* binding */ compose), | |
| 6079 | +/* harmony export */ createStore: () => (/* binding */ createStore), | |
| 6080 | +/* harmony export */ legacy_createStore: () => (/* binding */ legacy_createStore) | |
| 6081 | +/* harmony export */ }); | |
| 6082 | +/* harmony import */ var _babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/esm/objectSpread2 */ "../node_modules/@babel/runtime/helpers/esm/objectSpread2.js"); | |
| 6083 | + | |
| 6084 | + | |
| 6085 | +/** | |
| 6086 | + * Adapted from React: https://github.com/facebook/react/blob/master/packages/shared/formatProdErrorMessage.js | |
| 6087 | + * | |
| 6088 | + * Do not require this module directly! Use normal throw error calls. These messages will be replaced with error codes | |
| 6089 | + * during build. | |
| 6090 | + * @param {number} code | |
| 6091 | + */ | |
| 6092 | +function formatProdErrorMessage(code) { | |
| 6093 | + 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. '; | |
| 6094 | +} | |
| 6095 | + | |
| 6096 | +// Inlined version of the `symbol-observable` polyfill | |
| 6097 | +var $$observable = (function () { | |
| 6098 | + return typeof Symbol === 'function' && Symbol.observable || '@@observable'; | |
| 6099 | +})(); | |
| 6100 | + | |
| 6101 | +/** | |
| 6102 | + * These are private action types reserved by Redux. | |
| 6103 | + * For any unknown actions, you must return the current state. | |
| 6104 | + * If the current state is undefined, you must return the initial state. | |
| 6105 | + * Do not reference these action types directly in your code. | |
| 6106 | + */ | |
| 6107 | +var randomString = function randomString() { | |
| 6108 | + return Math.random().toString(36).substring(7).split('').join('.'); | |
| 6109 | +}; | |
| 6110 | + | |
| 6111 | +var ActionTypes = { | |
| 6112 | + INIT: "@@redux/INIT" + randomString(), | |
| 6113 | + REPLACE: "@@redux/REPLACE" + randomString(), | |
| 6114 | + PROBE_UNKNOWN_ACTION: function PROBE_UNKNOWN_ACTION() { | |
| 6115 | + return "@@redux/PROBE_UNKNOWN_ACTION" + randomString(); | |
| 6116 | + } | |
| 6117 | +}; | |
| 6118 | + | |
| 6119 | +/** | |
| 6120 | + * @param {any} obj The object to inspect. | |
| 6121 | + * @returns {boolean} True if the argument appears to be a plain object. | |
| 6122 | + */ | |
| 6123 | +function isPlainObject(obj) { | |
| 6124 | + if (typeof obj !== 'object' || obj === null) return false; | |
| 6125 | + var proto = obj; | |
| 6126 | + | |
| 6127 | + while (Object.getPrototypeOf(proto) !== null) { | |
| 6128 | + proto = Object.getPrototypeOf(proto); | |
| 6129 | + } | |
| 6130 | + | |
| 6131 | + return Object.getPrototypeOf(obj) === proto; | |
| 6132 | +} | |
| 6133 | + | |
| 6134 | +// Inlined / shortened version of `kindOf` from https://github.com/jonschlinkert/kind-of | |
| 6135 | +function miniKindOf(val) { | |
| 6136 | + if (val === void 0) return 'undefined'; | |
| 6137 | + if (val === null) return 'null'; | |
| 6138 | + var type = typeof val; | |
| 6139 | + | |
| 6140 | + switch (type) { | |
| 6141 | + case 'boolean': | |
| 6142 | + case 'string': | |
| 6143 | + case 'number': | |
| 6144 | + case 'symbol': | |
| 6145 | + case 'function': | |
| 6146 | + { | |
| 6147 | + return type; | |
| 6148 | + } | |
| 6149 | + } | |
| 6150 | + | |
| 6151 | + if (Array.isArray(val)) return 'array'; | |
| 6152 | + if (isDate(val)) return 'date'; | |
| 6153 | + if (isError(val)) return 'error'; | |
| 6154 | + var constructorName = ctorName(val); | |
| 6155 | + | |
| 6156 | + switch (constructorName) { | |
| 6157 | + case 'Symbol': | |
| 6158 | + case 'Promise': | |
| 6159 | + case 'WeakMap': | |
| 6160 | + case 'WeakSet': | |
| 6161 | + case 'Map': | |
| 6162 | + case 'Set': | |
| 6163 | + return constructorName; | |
| 6164 | + } // other | |
| 6165 | + | |
| 6166 | + | |
| 6167 | + return type.slice(8, -1).toLowerCase().replace(/\s/g, ''); | |
| 6168 | +} | |
| 6169 | + | |
| 6170 | +function ctorName(val) { | |
| 6171 | + return typeof val.constructor === 'function' ? val.constructor.name : null; | |
| 6172 | +} | |
| 6173 | + | |
| 6174 | +function isError(val) { | |
| 6175 | + return val instanceof Error || typeof val.message === 'string' && val.constructor && typeof val.constructor.stackTraceLimit === 'number'; | |
| 6176 | +} | |
| 6177 | + | |
| 6178 | +function isDate(val) { | |
| 6179 | + if (val instanceof Date) return true; | |
| 6180 | + return typeof val.toDateString === 'function' && typeof val.getDate === 'function' && typeof val.setDate === 'function'; | |
| 6181 | +} | |
| 6182 | + | |
| 6183 | +function kindOf(val) { | |
| 6184 | + var typeOfVal = typeof val; | |
| 6185 | + | |
| 6186 | + if (true) { | |
| 6187 | + typeOfVal = miniKindOf(val); | |
| 6188 | + } | |
| 6189 | + | |
| 6190 | + return typeOfVal; | |
| 6191 | +} | |
| 6192 | + | |
| 6193 | +/** | |
| 6194 | + * @deprecated | |
| 6195 | + * | |
| 6196 | + * **We recommend using the `configureStore` method | |
| 6197 | + * of the `@reduxjs/toolkit` package**, which replaces `createStore`. | |
| 6198 | + * | |
| 6199 | + * Redux Toolkit is our recommended approach for writing Redux logic today, | |
| 6200 | + * including store setup, reducers, data fetching, and more. | |
| 6201 | + * | |
| 6202 | + * **For more details, please read this Redux docs page:** | |
| 6203 | + * **https://redux.js.org/introduction/why-rtk-is-redux-today** | |
| 6204 | + * | |
| 6205 | + * `configureStore` from Redux Toolkit is an improved version of `createStore` that | |
| 6206 | + * simplifies setup and helps avoid common bugs. | |
| 6207 | + * | |
| 6208 | + * You should not be using the `redux` core package by itself today, except for learning purposes. | |
| 6209 | + * The `createStore` method from the core `redux` package will not be removed, but we encourage | |
| 6210 | + * all users to migrate to using Redux Toolkit for all Redux code. | |
| 6211 | + * | |
| 6212 | + * If you want to use `createStore` without this visual deprecation warning, use | |
| 6213 | + * the `legacy_createStore` import instead: | |
| 6214 | + * | |
| 6215 | + * `import { legacy_createStore as createStore} from 'redux'` | |
| 6216 | + * | |
| 6217 | + */ | |
| 6218 | + | |
| 6219 | +function createStore(reducer, preloadedState, enhancer) { | |
| 6220 | + var _ref2; | |
| 6221 | + | |
| 6222 | + if (typeof preloadedState === 'function' && typeof enhancer === 'function' || typeof enhancer === 'function' && typeof arguments[3] === 'function') { | |
| 6223 | + throw new Error( false ? 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.'); | |
| 6224 | + } | |
| 6225 | + | |
| 6226 | + if (typeof preloadedState === 'function' && typeof enhancer === 'undefined') { | |
| 6227 | + enhancer = preloadedState; | |
| 6228 | + preloadedState = undefined; | |
| 6229 | + } | |
| 6230 | + | |
| 6231 | + if (typeof enhancer !== 'undefined') { | |
| 6232 | + if (typeof enhancer !== 'function') { | |
| 6233 | + throw new Error( false ? 0 : "Expected the enhancer to be a function. Instead, received: '" + kindOf(enhancer) + "'"); | |
| 6234 | + } | |
| 6235 | + | |
| 6236 | + return enhancer(createStore)(reducer, preloadedState); | |
| 6237 | + } | |
| 6238 | + | |
| 6239 | + if (typeof reducer !== 'function') { | |
| 6240 | + throw new Error( false ? 0 : "Expected the root reducer to be a function. Instead, received: '" + kindOf(reducer) + "'"); | |
| 6241 | + } | |
| 6242 | + | |
| 6243 | + var currentReducer = reducer; | |
| 6244 | + var currentState = preloadedState; | |
| 6245 | + var currentListeners = []; | |
| 6246 | + var nextListeners = currentListeners; | |
| 6247 | + var isDispatching = false; | |
| 6248 | + /** | |
| 6249 | + * This makes a shallow copy of currentListeners so we can use | |
| 6250 | + * nextListeners as a temporary list while dispatching. | |
| 6251 | + * | |
| 6252 | + * This prevents any bugs around consumers calling | |
| 6253 | + * subscribe/unsubscribe in the middle of a dispatch. | |
| 6254 | + */ | |
| 6255 | + | |
| 6256 | + function ensureCanMutateNextListeners() { | |
| 6257 | + if (nextListeners === currentListeners) { | |
| 6258 | + nextListeners = currentListeners.slice(); | |
| 6259 | + } | |
| 6260 | + } | |
| 6261 | + /** | |
| 6262 | + * Reads the state tree managed by the store. | |
| 6263 | + * | |
| 6264 | + * @returns {any} The current state tree of your application. | |
| 6265 | + */ | |
| 6266 | + | |
| 6267 | + | |
| 6268 | + function getState() { | |
| 6269 | + if (isDispatching) { | |
| 6270 | + throw new Error( false ? 0 : '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.'); | |
| 6271 | + } | |
| 6272 | + | |
| 6273 | + return currentState; | |
| 6274 | + } | |
| 6275 | + /** | |
| 6276 | + * Adds a change listener. It will be called any time an action is dispatched, | |
| 6277 | + * and some part of the state tree may potentially have changed. You may then | |
| 6278 | + * call `getState()` to read the current state tree inside the callback. | |
| 6279 | + * | |
| 6280 | + * You may call `dispatch()` from a change listener, with the following | |
| 6281 | + * caveats: | |
| 6282 | + * | |
| 6283 | + * 1. The subscriptions are snapshotted just before every `dispatch()` call. | |
| 6284 | + * If you subscribe or unsubscribe while the listeners are being invoked, this | |
| 6285 | + * will not have any effect on the `dispatch()` that is currently in progress. | |
| 6286 | + * However, the next `dispatch()` call, whether nested or not, will use a more | |
| 6287 | + * recent snapshot of the subscription list. | |
| 6288 | + * | |
| 6289 | + * 2. The listener should not expect to see all state changes, as the state | |
| 6290 | + * might have been updated multiple times during a nested `dispatch()` before | |
| 6291 | + * the listener is called. It is, however, guaranteed that all subscribers | |
| 6292 | + * registered before the `dispatch()` started will be called with the latest | |
| 6293 | + * state by the time it exits. | |
| 6294 | + * | |
| 6295 | + * @param {Function} listener A callback to be invoked on every dispatch. | |
| 6296 | + * @returns {Function} A function to remove this change listener. | |
| 6297 | + */ | |
| 6298 | + | |
| 6299 | + | |
| 6300 | + function subscribe(listener) { | |
| 6301 | + if (typeof listener !== 'function') { | |
| 6302 | + throw new Error( false ? 0 : "Expected the listener to be a function. Instead, received: '" + kindOf(listener) + "'"); | |
| 6303 | + } | |
| 6304 | + | |
| 6305 | + if (isDispatching) { | |
| 6306 | + throw new Error( false ? 0 : '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.'); | |
| 6307 | + } | |
| 6308 | + | |
| 6309 | + var isSubscribed = true; | |
| 6310 | + ensureCanMutateNextListeners(); | |
| 6311 | + nextListeners.push(listener); | |
| 6312 | + return function unsubscribe() { | |
| 6313 | + if (!isSubscribed) { | |
| 6314 | + return; | |
| 6315 | + } | |
| 6316 | + | |
| 6317 | + if (isDispatching) { | |
| 6318 | + throw new Error( false ? 0 : 'You may not unsubscribe from a store listener while the reducer is executing. ' + 'See https://redux.js.org/api/store#subscribelistener for more details.'); | |
| 6319 | + } | |
| 6320 | + | |
| 6321 | + isSubscribed = false; | |
| 6322 | + ensureCanMutateNextListeners(); | |
| 6323 | + var index = nextListeners.indexOf(listener); | |
| 6324 | + nextListeners.splice(index, 1); | |
| 6325 | + currentListeners = null; | |
| 6326 | + }; | |
| 6327 | + } | |
| 6328 | + /** | |
| 6329 | + * Dispatches an action. It is the only way to trigger a state change. | |
| 6330 | + * | |
| 6331 | + * The `reducer` function, used to create the store, will be called with the | |
| 6332 | + * current state tree and the given `action`. Its return value will | |
| 6333 | + * be considered the **next** state of the tree, and the change listeners | |
| 6334 | + * will be notified. | |
| 6335 | + * | |
| 6336 | + * The base implementation only supports plain object actions. If you want to | |
| 6337 | + * dispatch a Promise, an Observable, a thunk, or something else, you need to | |
| 6338 | + * wrap your store creating function into the corresponding middleware. For | |
| 6339 | + * example, see the documentation for the `redux-thunk` package. Even the | |
| 6340 | + * middleware will eventually dispatch plain object actions using this method. | |
| 6341 | + * | |
| 6342 | + * @param {Object} action A plain object representing “what changed”. It is | |
| 6343 | + * a good idea to keep actions serializable so you can record and replay user | |
| 6344 | + * sessions, or use the time travelling `redux-devtools`. An action must have | |
| 6345 | + * a `type` property which may not be `undefined`. It is a good idea to use | |
| 6346 | + * string constants for action types. | |
| 6347 | + * | |
| 6348 | + * @returns {Object} For convenience, the same action object you dispatched. | |
| 6349 | + * | |
| 6350 | + * Note that, if you use a custom middleware, it may wrap `dispatch()` to | |
| 6351 | + * return something else (for example, a Promise you can await). | |
| 6352 | + */ | |
| 6353 | + | |
| 6354 | + | |
| 6355 | + function dispatch(action) { | |
| 6356 | + if (!isPlainObject(action)) { | |
| 6357 | + throw new Error( false ? 0 : "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."); | |
| 6358 | + } | |
| 6359 | + | |
| 6360 | + if (typeof action.type === 'undefined') { | |
| 6361 | + throw new Error( false ? 0 : 'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.'); | |
| 6362 | + } | |
| 6363 | + | |
| 6364 | + if (isDispatching) { | |
| 6365 | + throw new Error( false ? 0 : 'Reducers may not dispatch actions.'); | |
| 6366 | + } | |
| 6367 | + | |
| 6368 | + try { | |
| 6369 | + isDispatching = true; | |
| 6370 | + currentState = currentReducer(currentState, action); | |
| 6371 | + } finally { | |
| 6372 | + isDispatching = false; | |
| 6373 | + } | |
| 6374 | + | |
| 6375 | + var listeners = currentListeners = nextListeners; | |
| 6376 | + | |
| 6377 | + for (var i = 0; i < listeners.length; i++) { | |
| 6378 | + var listener = listeners[i]; | |
| 6379 | + listener(); | |
| 6380 | + } | |
| 6381 | + | |
| 6382 | + return action; | |
| 6383 | + } | |
| 6384 | + /** | |
| 6385 | + * Replaces the reducer currently used by the store to calculate the state. | |
| 6386 | + * | |
| 6387 | + * You might need this if your app implements code splitting and you want to | |
| 6388 | + * load some of the reducers dynamically. You might also need this if you | |
| 6389 | + * implement a hot reloading mechanism for Redux. | |
| 6390 | + * | |
| 6391 | + * @param {Function} nextReducer The reducer for the store to use instead. | |
| 6392 | + * @returns {void} | |
| 6393 | + */ | |
| 6394 | + | |
| 6395 | + | |
| 6396 | + function replaceReducer(nextReducer) { | |
| 6397 | + if (typeof nextReducer !== 'function') { | |
| 6398 | + throw new Error( false ? 0 : "Expected the nextReducer to be a function. Instead, received: '" + kindOf(nextReducer)); | |
| 6399 | + } | |
| 6400 | + | |
| 6401 | + currentReducer = nextReducer; // This action has a similiar effect to ActionTypes.INIT. | |
| 6402 | + // Any reducers that existed in both the new and old rootReducer | |
| 6403 | + // will receive the previous state. This effectively populates | |
| 6404 | + // the new state tree with any relevant data from the old one. | |
| 6405 | + | |
| 6406 | + dispatch({ | |
| 6407 | + type: ActionTypes.REPLACE | |
| 6408 | + }); | |
| 6409 | + } | |
| 6410 | + /** | |
| 6411 | + * Interoperability point for observable/reactive libraries. | |
| 6412 | + * @returns {observable} A minimal observable of state changes. | |
| 6413 | + * For more information, see the observable proposal: | |
| 6414 | + * https://github.com/tc39/proposal-observable | |
| 6415 | + */ | |
| 6416 | + | |
| 6417 | + | |
| 6418 | + function observable() { | |
| 6419 | + var _ref; | |
| 6420 | + | |
| 6421 | + var outerSubscribe = subscribe; | |
| 6422 | + return _ref = { | |
| 6423 | + /** | |
| 6424 | + * The minimal observable subscription method. | |
| 6425 | + * @param {Object} observer Any object that can be used as an observer. | |
| 6426 | + * The observer object should have a `next` method. | |
| 6427 | + * @returns {subscription} An object with an `unsubscribe` method that can | |
| 6428 | + * be used to unsubscribe the observable from the store, and prevent further | |
| 6429 | + * emission of values from the observable. | |
| 6430 | + */ | |
| 6431 | + subscribe: function subscribe(observer) { | |
| 6432 | + if (typeof observer !== 'object' || observer === null) { | |
| 6433 | + throw new Error( false ? 0 : "Expected the observer to be an object. Instead, received: '" + kindOf(observer) + "'"); | |
| 6434 | + } | |
| 6435 | + | |
| 6436 | + function observeState() { | |
| 6437 | + if (observer.next) { | |
| 6438 | + observer.next(getState()); | |
| 6439 | + } | |
| 6440 | + } | |
| 6441 | + | |
| 6442 | + observeState(); | |
| 6443 | + var unsubscribe = outerSubscribe(observeState); | |
| 6444 | + return { | |
| 6445 | + unsubscribe: unsubscribe | |
| 6446 | + }; | |
| 6447 | + } | |
| 6448 | + }, _ref[$$observable] = function () { | |
| 6449 | + return this; | |
| 6450 | + }, _ref; | |
| 6451 | + } // When a store is created, an "INIT" action is dispatched so that every | |
| 6452 | + // reducer returns their initial state. This effectively populates | |
| 6453 | + // the initial state tree. | |
| 6454 | + | |
| 6455 | + | |
| 6456 | + dispatch({ | |
| 6457 | + type: ActionTypes.INIT | |
| 6458 | + }); | |
| 6459 | + return _ref2 = { | |
| 6460 | + dispatch: dispatch, | |
| 6461 | + subscribe: subscribe, | |
| 6462 | + getState: getState, | |
| 6463 | + replaceReducer: replaceReducer | |
| 6464 | + }, _ref2[$$observable] = observable, _ref2; | |
| 6465 | +} | |
| 6466 | +/** | |
| 6467 | + * Creates a Redux store that holds the state tree. | |
| 6468 | + * | |
| 6469 | + * **We recommend using `configureStore` from the | |
| 6470 | + * `@reduxjs/toolkit` package**, which replaces `createStore`: | |
| 6471 | + * **https://redux.js.org/introduction/why-rtk-is-redux-today** | |
| 6472 | + * | |
| 6473 | + * The only way to change the data in the store is to call `dispatch()` on it. | |
| 6474 | + * | |
| 6475 | + * There should only be a single store in your app. To specify how different | |
| 6476 | + * parts of the state tree respond to actions, you may combine several reducers | |
| 6477 | + * into a single reducer function by using `combineReducers`. | |
| 6478 | + * | |
| 6479 | + * @param {Function} reducer A function that returns the next state tree, given | |
| 6480 | + * the current state tree and the action to handle. | |
| 6481 | + * | |
| 6482 | + * @param {any} [preloadedState] The initial state. You may optionally specify it | |
| 6483 | + * to hydrate the state from the server in universal apps, or to restore a | |
| 6484 | + * previously serialized user session. | |
| 6485 | + * If you use `combineReducers` to produce the root reducer function, this must be | |
| 6486 | + * an object with the same shape as `combineReducers` keys. | |
| 6487 | + * | |
| 6488 | + * @param {Function} [enhancer] The store enhancer. You may optionally specify it | |
| 6489 | + * to enhance the store with third-party capabilities such as middleware, | |
| 6490 | + * time travel, persistence, etc. The only store enhancer that ships with Redux | |
| 6491 | + * is `applyMiddleware()`. | |
| 6492 | + * | |
| 6493 | + * @returns {Store} A Redux store that lets you read the state, dispatch actions | |
| 6494 | + * and subscribe to changes. | |
| 6495 | + */ | |
| 6496 | + | |
| 6497 | +var legacy_createStore = createStore; | |
| 6498 | + | |
| 6499 | +/** | |
| 6500 | + * Prints a warning in the console if it exists. | |
| 6501 | + * | |
| 6502 | + * @param {String} message The warning message. | |
| 6503 | + * @returns {void} | |
| 6504 | + */ | |
| 6505 | +function warning(message) { | |
| 6506 | + /* eslint-disable no-console */ | |
| 6507 | + if (typeof console !== 'undefined' && typeof console.error === 'function') { | |
| 6508 | + console.error(message); | |
| 6509 | + } | |
| 6510 | + /* eslint-enable no-console */ | |
| 6511 | + | |
| 6512 | + | |
| 6513 | + try { | |
| 6514 | + // This error was thrown as a convenience so that if you enable | |
| 6515 | + // "break on all exceptions" in your console, | |
| 6516 | + // it would pause the execution at this line. | |
| 6517 | + throw new Error(message); | |
| 6518 | + } catch (e) {} // eslint-disable-line no-empty | |
| 6519 | + | |
| 6520 | +} | |
| 6521 | + | |
| 6522 | +function getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) { | |
| 6523 | + var reducerKeys = Object.keys(reducers); | |
| 6524 | + var argumentName = action && action.type === ActionTypes.INIT ? 'preloadedState argument passed to createStore' : 'previous state received by the reducer'; | |
| 6525 | + | |
| 6526 | + if (reducerKeys.length === 0) { | |
| 6527 | + return 'Store does not have a valid reducer. Make sure the argument passed ' + 'to combineReducers is an object whose values are reducers.'; | |
| 6528 | + } | |
| 6529 | + | |
| 6530 | + if (!isPlainObject(inputState)) { | |
| 6531 | + return "The " + argumentName + " has unexpected type of \"" + kindOf(inputState) + "\". Expected argument to be an object with the following " + ("keys: \"" + reducerKeys.join('", "') + "\""); | |
| 6532 | + } | |
| 6533 | + | |
| 6534 | + var unexpectedKeys = Object.keys(inputState).filter(function (key) { | |
| 6535 | + return !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key]; | |
| 6536 | + }); | |
| 6537 | + unexpectedKeys.forEach(function (key) { | |
| 6538 | + unexpectedKeyCache[key] = true; | |
| 6539 | + }); | |
| 6540 | + if (action && action.type === ActionTypes.REPLACE) return; | |
| 6541 | + | |
| 6542 | + if (unexpectedKeys.length > 0) { | |
| 6543 | + 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."); | |
| 6544 | + } | |
| 6545 | +} | |
| 6546 | + | |
| 6547 | +function assertReducerShape(reducers) { | |
| 6548 | + Object.keys(reducers).forEach(function (key) { | |
| 6549 | + var reducer = reducers[key]; | |
| 6550 | + var initialState = reducer(undefined, { | |
| 6551 | + type: ActionTypes.INIT | |
| 6552 | + }); | |
| 6553 | + | |
| 6554 | + if (typeof initialState === 'undefined') { | |
| 6555 | + throw new Error( false ? 0 : "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."); | |
| 6556 | + } | |
| 6557 | + | |
| 6558 | + if (typeof reducer(undefined, { | |
| 6559 | + type: ActionTypes.PROBE_UNKNOWN_ACTION() | |
| 6560 | + }) === 'undefined') { | |
| 6561 | + throw new Error( false ? 0 : "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."); | |
| 6562 | + } | |
| 6563 | + }); | |
| 6564 | +} | |
| 6565 | +/** | |
| 6566 | + * Turns an object whose values are different reducer functions, into a single | |
| 6567 | + * reducer function. It will call every child reducer, and gather their results | |
| 6568 | + * into a single state object, whose keys correspond to the keys of the passed | |
| 6569 | + * reducer functions. | |
| 6570 | + * | |
| 6571 | + * @param {Object} reducers An object whose values correspond to different | |
| 6572 | + * reducer functions that need to be combined into one. One handy way to obtain | |
| 6573 | + * it is to use ES6 `import * as reducers` syntax. The reducers may never return | |
| 6574 | + * undefined for any action. Instead, they should return their initial state | |
| 6575 | + * if the state passed to them was undefined, and the current state for any | |
| 6576 | + * unrecognized action. | |
| 6577 | + * | |
| 6578 | + * @returns {Function} A reducer function that invokes every reducer inside the | |
| 6579 | + * passed object, and builds a state object with the same shape. | |
| 6580 | + */ | |
| 6581 | + | |
| 6582 | + | |
| 6583 | +function combineReducers(reducers) { | |
| 6584 | + var reducerKeys = Object.keys(reducers); | |
| 6585 | + var finalReducers = {}; | |
| 6586 | + | |
| 6587 | + for (var i = 0; i < reducerKeys.length; i++) { | |
| 6588 | + var key = reducerKeys[i]; | |
| 6589 | + | |
| 6590 | + if (true) { | |
| 6591 | + if (typeof reducers[key] === 'undefined') { | |
| 6592 | + warning("No reducer provided for key \"" + key + "\""); | |
| 6593 | + } | |
| 6594 | + } | |
| 6595 | + | |
| 6596 | + if (typeof reducers[key] === 'function') { | |
| 6597 | + finalReducers[key] = reducers[key]; | |
| 6598 | + } | |
| 6599 | + } | |
| 6600 | + | |
| 6601 | + var finalReducerKeys = Object.keys(finalReducers); // This is used to make sure we don't warn about the same | |
| 6602 | + // keys multiple times. | |
| 6603 | + | |
| 6604 | + var unexpectedKeyCache; | |
| 6605 | + | |
| 6606 | + if (true) { | |
| 6607 | + unexpectedKeyCache = {}; | |
| 6608 | + } | |
| 6609 | + | |
| 6610 | + var shapeAssertionError; | |
| 6611 | + | |
| 6612 | + try { | |
| 6613 | + assertReducerShape(finalReducers); | |
| 6614 | + } catch (e) { | |
| 6615 | + shapeAssertionError = e; | |
| 6616 | + } | |
| 6617 | + | |
| 6618 | + return function combination(state, action) { | |
| 6619 | + if (state === void 0) { | |
| 6620 | + state = {}; | |
| 6621 | + } | |
| 6622 | + | |
| 6623 | + if (shapeAssertionError) { | |
| 6624 | + throw shapeAssertionError; | |
| 6625 | + } | |
| 6626 | + | |
| 6627 | + if (true) { | |
| 6628 | + var warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action, unexpectedKeyCache); | |
| 6629 | + | |
| 6630 | + if (warningMessage) { | |
| 6631 | + warning(warningMessage); | |
| 6632 | + } | |
| 6633 | + } | |
| 6634 | + | |
| 6635 | + var hasChanged = false; | |
| 6636 | + var nextState = {}; | |
| 6637 | + | |
| 6638 | + for (var _i = 0; _i < finalReducerKeys.length; _i++) { | |
| 6639 | + var _key = finalReducerKeys[_i]; | |
| 6640 | + var reducer = finalReducers[_key]; | |
| 6641 | + var previousStateForKey = state[_key]; | |
| 6642 | + var nextStateForKey = reducer(previousStateForKey, action); | |
| 6643 | + | |
| 6644 | + if (typeof nextStateForKey === 'undefined') { | |
| 6645 | + var actionType = action && action.type; | |
| 6646 | + throw new Error( false ? 0 : "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."); | |
| 6647 | + } | |
| 6648 | + | |
| 6649 | + nextState[_key] = nextStateForKey; | |
| 6650 | + hasChanged = hasChanged || nextStateForKey !== previousStateForKey; | |
| 6651 | + } | |
| 6652 | + | |
| 6653 | + hasChanged = hasChanged || finalReducerKeys.length !== Object.keys(state).length; | |
| 6654 | + return hasChanged ? nextState : state; | |
| 6655 | + }; | |
| 6656 | +} | |
| 6657 | + | |
| 6658 | +function bindActionCreator(actionCreator, dispatch) { | |
| 6659 | + return function () { | |
| 6660 | + return dispatch(actionCreator.apply(this, arguments)); | |
| 6661 | + }; | |
| 6662 | +} | |
| 6663 | +/** | |
| 6664 | + * Turns an object whose values are action creators, into an object with the | |
| 6665 | + * same keys, but with every function wrapped into a `dispatch` call so they | |
| 6666 | + * may be invoked directly. This is just a convenience method, as you can call | |
| 6667 | + * `store.dispatch(MyActionCreators.doSomething())` yourself just fine. | |
| 6668 | + * | |
| 6669 | + * For convenience, you can also pass an action creator as the first argument, | |
| 6670 | + * and get a dispatch wrapped function in return. | |
| 6671 | + * | |
| 6672 | + * @param {Function|Object} actionCreators An object whose values are action | |
| 6673 | + * creator functions. One handy way to obtain it is to use ES6 `import * as` | |
| 6674 | + * syntax. You may also pass a single function. | |
| 6675 | + * | |
| 6676 | + * @param {Function} dispatch The `dispatch` function available on your Redux | |
| 6677 | + * store. | |
| 6678 | + * | |
| 6679 | + * @returns {Function|Object} The object mimicking the original object, but with | |
| 6680 | + * every action creator wrapped into the `dispatch` call. If you passed a | |
| 6681 | + * function as `actionCreators`, the return value will also be a single | |
| 6682 | + * function. | |
| 6683 | + */ | |
| 6684 | + | |
| 6685 | + | |
| 6686 | +function bindActionCreators(actionCreators, dispatch) { | |
| 6687 | + if (typeof actionCreators === 'function') { | |
| 6688 | + return bindActionCreator(actionCreators, dispatch); | |
| 6689 | + } | |
| 6690 | + | |
| 6691 | + if (typeof actionCreators !== 'object' || actionCreators === null) { | |
| 6692 | + throw new Error( false ? 0 : "bindActionCreators expected an object or a function, but instead received: '" + kindOf(actionCreators) + "'. " + "Did you write \"import ActionCreators from\" instead of \"import * as ActionCreators from\"?"); | |
| 6693 | + } | |
| 6694 | + | |
| 6695 | + var boundActionCreators = {}; | |
| 6696 | + | |
| 6697 | + for (var key in actionCreators) { | |
| 6698 | + var actionCreator = actionCreators[key]; | |
| 6699 | + | |
| 6700 | + if (typeof actionCreator === 'function') { | |
| 6701 | + boundActionCreators[key] = bindActionCreator(actionCreator, dispatch); | |
| 6702 | + } | |
| 6703 | + } | |
| 6704 | + | |
| 6705 | + return boundActionCreators; | |
| 6706 | +} | |
| 6707 | + | |
| 6708 | +/** | |
| 6709 | + * Composes single-argument functions from right to left. The rightmost | |
| 6710 | + * function can take multiple arguments as it provides the signature for | |
| 6711 | + * the resulting composite function. | |
| 6712 | + * | |
| 6713 | + * @param {...Function} funcs The functions to compose. | |
| 6714 | + * @returns {Function} A function obtained by composing the argument functions | |
| 6715 | + * from right to left. For example, compose(f, g, h) is identical to doing | |
| 6716 | + * (...args) => f(g(h(...args))). | |
| 6717 | + */ | |
| 6718 | +function compose() { | |
| 6719 | + for (var _len = arguments.length, funcs = new Array(_len), _key = 0; _key < _len; _key++) { | |
| 6720 | + funcs[_key] = arguments[_key]; | |
| 6721 | + } | |
| 6722 | + | |
| 6723 | + if (funcs.length === 0) { | |
| 6724 | + return function (arg) { | |
| 6725 | + return arg; | |
| 6726 | + }; | |
| 6727 | + } | |
| 6728 | + | |
| 6729 | + if (funcs.length === 1) { | |
| 6730 | + return funcs[0]; | |
| 6731 | + } | |
| 6732 | + | |
| 6733 | + return funcs.reduce(function (a, b) { | |
| 6734 | + return function () { | |
| 6735 | + return a(b.apply(void 0, arguments)); | |
| 6736 | + }; | |
| 6737 | + }); | |
| 6738 | +} | |
| 6739 | + | |
| 6740 | +/** | |
| 6741 | + * Creates a store enhancer that applies middleware to the dispatch method | |
| 6742 | + * of the Redux store. This is handy for a variety of tasks, such as expressing | |
| 6743 | + * asynchronous actions in a concise manner, or logging every action payload. | |
| 6744 | + * | |
| 6745 | + * See `redux-thunk` package as an example of the Redux middleware. | |
| 6746 | + * | |
| 6747 | + * Because middleware is potentially asynchronous, this should be the first | |
| 6748 | + * store enhancer in the composition chain. | |
| 6749 | + * | |
| 6750 | + * Note that each middleware will be given the `dispatch` and `getState` functions | |
| 6751 | + * as named arguments. | |
| 6752 | + * | |
| 6753 | + * @param {...Function} middlewares The middleware chain to be applied. | |
| 6754 | + * @returns {Function} A store enhancer applying the middleware. | |
| 6755 | + */ | |
| 6756 | + | |
| 6757 | +function applyMiddleware() { | |
| 6758 | + for (var _len = arguments.length, middlewares = new Array(_len), _key = 0; _key < _len; _key++) { | |
| 6759 | + middlewares[_key] = arguments[_key]; | |
| 6760 | + } | |
| 6761 | + | |
| 6762 | + return function (createStore) { | |
| 6763 | + return function () { | |
| 6764 | + var store = createStore.apply(void 0, arguments); | |
| 6765 | + | |
| 6766 | + var _dispatch = function dispatch() { | |
| 6767 | + throw new Error( false ? 0 : 'Dispatching while constructing your middleware is not allowed. ' + 'Other middleware would not be applied to this dispatch.'); | |
| 6768 | + }; | |
| 6769 | + | |
| 6770 | + var middlewareAPI = { | |
| 6771 | + getState: store.getState, | |
| 6772 | + dispatch: function dispatch() { | |
| 6773 | + return _dispatch.apply(void 0, arguments); | |
| 6774 | + } | |
| 6775 | + }; | |
| 6776 | + var chain = middlewares.map(function (middleware) { | |
| 6777 | + return middleware(middlewareAPI); | |
| 6778 | + }); | |
| 6779 | + _dispatch = compose.apply(void 0, chain)(store.dispatch); | |
| 6780 | + return (0,_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_0__["default"])((0,_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_0__["default"])({}, store), {}, { | |
| 6781 | + dispatch: _dispatch | |
| 6782 | + }); | |
| 6783 | + }; | |
| 6784 | + }; | |
| 6785 | +} | |
| 6786 | + | |
| 6787 | + | |
| 6788 | + | |
| 6789 | + | |
| 6790 | +/***/ }), | |
| 6791 | + | |
| 6792 | +/***/ "../node_modules/reselect/es/defaultMemoize.js": | |
| 6793 | +/*!*****************************************************!*\ | |
| 6794 | + !*** ../node_modules/reselect/es/defaultMemoize.js ***! | |
| 6795 | + \*****************************************************/ | |
| 6796 | +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { | |
| 6797 | + | |
| 6798 | +"use strict"; | |
| 6799 | +__webpack_require__.r(__webpack_exports__); | |
| 6800 | +/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 6801 | +/* harmony export */ createCacheKeyComparator: () => (/* binding */ createCacheKeyComparator), | |
| 6802 | +/* harmony export */ defaultEqualityCheck: () => (/* binding */ defaultEqualityCheck), | |
| 6803 | +/* harmony export */ defaultMemoize: () => (/* binding */ defaultMemoize) | |
| 6804 | +/* harmony export */ }); | |
| 6805 | +// Cache implementation based on Erik Rasmussen's `lru-memoize`: | |
| 6806 | +// https://github.com/erikras/lru-memoize | |
| 6807 | +var NOT_FOUND = 'NOT_FOUND'; | |
| 6808 | + | |
| 6809 | +function createSingletonCache(equals) { | |
| 6810 | + var entry; | |
| 6811 | + return { | |
| 6812 | + get: function get(key) { | |
| 6813 | + if (entry && equals(entry.key, key)) { | |
| 6814 | + return entry.value; | |
| 6815 | + } | |
| 6816 | + | |
| 6817 | + return NOT_FOUND; | |
| 6818 | + }, | |
| 6819 | + put: function put(key, value) { | |
| 6820 | + entry = { | |
| 6821 | + key: key, | |
| 6822 | + value: value | |
| 6823 | + }; | |
| 6824 | + }, | |
| 6825 | + getEntries: function getEntries() { | |
| 6826 | + return entry ? [entry] : []; | |
| 6827 | + }, | |
| 6828 | + clear: function clear() { | |
| 6829 | + entry = undefined; | |
| 6830 | + } | |
| 6831 | + }; | |
| 6832 | +} | |
| 6833 | + | |
| 6834 | +function createLruCache(maxSize, equals) { | |
| 6835 | + var entries = []; | |
| 6836 | + | |
| 6837 | + function get(key) { | |
| 6838 | + var cacheIndex = entries.findIndex(function (entry) { | |
| 6839 | + return equals(key, entry.key); | |
| 6840 | + }); // We found a cached entry | |
| 6841 | + | |
| 6842 | + if (cacheIndex > -1) { | |
| 6843 | + var entry = entries[cacheIndex]; // Cached entry not at top of cache, move it to the top | |
| 6844 | + | |
| 6845 | + if (cacheIndex > 0) { | |
| 6846 | + entries.splice(cacheIndex, 1); | |
| 6847 | + entries.unshift(entry); | |
| 6848 | + } | |
| 6849 | + | |
| 6850 | + return entry.value; | |
| 6851 | + } // No entry found in cache, return sentinel | |
| 6852 | + | |
| 6853 | + | |
| 6854 | + return NOT_FOUND; | |
| 6855 | + } | |
| 6856 | + | |
| 6857 | + function put(key, value) { | |
| 6858 | + if (get(key) === NOT_FOUND) { | |
| 6859 | + // TODO Is unshift slow? | |
| 6860 | + entries.unshift({ | |
| 6861 | + key: key, | |
| 6862 | + value: value | |
| 6863 | + }); | |
| 6864 | + | |
| 6865 | + if (entries.length > maxSize) { | |
| 6866 | + entries.pop(); | |
| 6867 | + } | |
| 6868 | + } | |
| 6869 | + } | |
| 6870 | + | |
| 6871 | + function getEntries() { | |
| 6872 | + return entries; | |
| 6873 | + } | |
| 6874 | + | |
| 6875 | + function clear() { | |
| 6876 | + entries = []; | |
| 6877 | + } | |
| 6878 | + | |
| 6879 | + return { | |
| 6880 | + get: get, | |
| 6881 | + put: put, | |
| 6882 | + getEntries: getEntries, | |
| 6883 | + clear: clear | |
| 6884 | + }; | |
| 6885 | +} | |
| 6886 | + | |
| 6887 | +var defaultEqualityCheck = function defaultEqualityCheck(a, b) { | |
| 6888 | + return a === b; | |
| 6889 | +}; | |
| 6890 | +function createCacheKeyComparator(equalityCheck) { | |
| 6891 | + return function areArgumentsShallowlyEqual(prev, next) { | |
| 6892 | + if (prev === null || next === null || prev.length !== next.length) { | |
| 6893 | + return false; | |
| 6894 | + } // Do this in a for loop (and not a `forEach` or an `every`) so we can determine equality as fast as possible. | |
| 6895 | + | |
| 6896 | + | |
| 6897 | + var length = prev.length; | |
| 6898 | + | |
| 6899 | + for (var i = 0; i < length; i++) { | |
| 6900 | + if (!equalityCheck(prev[i], next[i])) { | |
| 6901 | + return false; | |
| 6902 | + } | |
| 6903 | + } | |
| 6904 | + | |
| 6905 | + return true; | |
| 6906 | + }; | |
| 6907 | +} | |
| 6908 | +// defaultMemoize now supports a configurable cache size with LRU behavior, | |
| 6909 | +// and optional comparison of the result value with existing values | |
| 6910 | +function defaultMemoize(func, equalityCheckOrOptions) { | |
| 6911 | + var providedOptions = typeof equalityCheckOrOptions === 'object' ? equalityCheckOrOptions : { | |
| 6912 | + equalityCheck: equalityCheckOrOptions | |
| 6913 | + }; | |
| 6914 | + var _providedOptions$equa = providedOptions.equalityCheck, | |
| 6915 | + equalityCheck = _providedOptions$equa === void 0 ? defaultEqualityCheck : _providedOptions$equa, | |
| 6916 | + _providedOptions$maxS = providedOptions.maxSize, | |
| 6917 | + maxSize = _providedOptions$maxS === void 0 ? 1 : _providedOptions$maxS, | |
| 6918 | + resultEqualityCheck = providedOptions.resultEqualityCheck; | |
| 6919 | + var comparator = createCacheKeyComparator(equalityCheck); | |
| 6920 | + var cache = maxSize === 1 ? createSingletonCache(comparator) : createLruCache(maxSize, comparator); // we reference arguments instead of spreading them for performance reasons | |
| 6921 | + | |
| 6922 | + function memoized() { | |
| 6923 | + var value = cache.get(arguments); | |
| 6924 | + | |
| 6925 | + if (value === NOT_FOUND) { | |
| 6926 | + // @ts-ignore | |
| 6927 | + value = func.apply(null, arguments); | |
| 6928 | + | |
| 6929 | + if (resultEqualityCheck) { | |
| 6930 | + var entries = cache.getEntries(); | |
| 6931 | + var matchingEntry = entries.find(function (entry) { | |
| 6932 | + return resultEqualityCheck(entry.value, value); | |
| 6933 | + }); | |
| 6934 | + | |
| 6935 | + if (matchingEntry) { | |
| 6936 | + value = matchingEntry.value; | |
| 6937 | + } | |
| 6938 | + } | |
| 6939 | + | |
| 6940 | + cache.put(arguments, value); | |
| 6941 | + } | |
| 6942 | + | |
| 6943 | + return value; | |
| 6944 | + } | |
| 6945 | + | |
| 6946 | + memoized.clearCache = function () { | |
| 6947 | + return cache.clear(); | |
| 6948 | + }; | |
| 6949 | + | |
| 6950 | + return memoized; | |
| 6951 | +} | |
| 6952 | + | |
| 6953 | +/***/ }), | |
| 6954 | + | |
| 6955 | +/***/ "../node_modules/reselect/es/index.js": | |
| 6956 | +/*!********************************************!*\ | |
| 6957 | + !*** ../node_modules/reselect/es/index.js ***! | |
| 6958 | + \********************************************/ | |
| 6959 | +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { | |
| 6960 | + | |
| 6961 | +"use strict"; | |
| 6962 | +__webpack_require__.r(__webpack_exports__); | |
| 6963 | +/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 6964 | +/* harmony export */ createSelector: () => (/* binding */ createSelector), | |
| 6965 | +/* harmony export */ createSelectorCreator: () => (/* binding */ createSelectorCreator), | |
| 6966 | +/* harmony export */ createStructuredSelector: () => (/* binding */ createStructuredSelector), | |
| 6967 | +/* harmony export */ defaultEqualityCheck: () => (/* reexport safe */ _defaultMemoize__WEBPACK_IMPORTED_MODULE_0__.defaultEqualityCheck), | |
| 6968 | +/* harmony export */ defaultMemoize: () => (/* reexport safe */ _defaultMemoize__WEBPACK_IMPORTED_MODULE_0__.defaultMemoize) | |
| 6969 | +/* harmony export */ }); | |
| 6970 | +/* harmony import */ var _defaultMemoize__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./defaultMemoize */ "../node_modules/reselect/es/defaultMemoize.js"); | |
| 6971 | + | |
| 6972 | + | |
| 6973 | + | |
| 6974 | +function getDependencies(funcs) { | |
| 6975 | + var dependencies = Array.isArray(funcs[0]) ? funcs[0] : funcs; | |
| 6976 | + | |
| 6977 | + if (!dependencies.every(function (dep) { | |
| 6978 | + return typeof dep === 'function'; | |
| 6979 | + })) { | |
| 6980 | + var dependencyTypes = dependencies.map(function (dep) { | |
| 6981 | + return typeof dep === 'function' ? "function " + (dep.name || 'unnamed') + "()" : typeof dep; | |
| 6982 | + }).join(', '); | |
| 6983 | + throw new Error("createSelector expects all input-selectors to be functions, but received the following types: [" + dependencyTypes + "]"); | |
| 6984 | + } | |
| 6985 | + | |
| 6986 | + return dependencies; | |
| 6987 | +} | |
| 6988 | + | |
| 6989 | +function createSelectorCreator(memoize) { | |
| 6990 | + for (var _len = arguments.length, memoizeOptionsFromArgs = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { | |
| 6991 | + memoizeOptionsFromArgs[_key - 1] = arguments[_key]; | |
| 6992 | + } | |
| 6993 | + | |
| 6994 | + var createSelector = function createSelector() { | |
| 6995 | + for (var _len2 = arguments.length, funcs = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) { | |
| 6996 | + funcs[_key2] = arguments[_key2]; | |
| 6997 | + } | |
| 6998 | + | |
| 6999 | + var _recomputations = 0; | |
| 7000 | + | |
| 7001 | + var _lastResult; // Due to the intricacies of rest params, we can't do an optional arg after `...funcs`. | |
| 7002 | + // So, start by declaring the default value here. | |
| 7003 | + // (And yes, the words 'memoize' and 'options' appear too many times in this next sequence.) | |
| 7004 | + | |
| 7005 | + | |
| 7006 | + var directlyPassedOptions = { | |
| 7007 | + memoizeOptions: undefined | |
| 7008 | + }; // Normally, the result func or "output selector" is the last arg | |
| 7009 | + | |
| 7010 | + var resultFunc = funcs.pop(); // If the result func is actually an _object_, assume it's our options object | |
| 7011 | + | |
| 7012 | + if (typeof resultFunc === 'object') { | |
| 7013 | + directlyPassedOptions = resultFunc; // and pop the real result func off | |
| 7014 | + | |
| 7015 | + resultFunc = funcs.pop(); | |
| 7016 | + } | |
| 7017 | + | |
| 7018 | + if (typeof resultFunc !== 'function') { | |
| 7019 | + throw new Error("createSelector expects an output function after the inputs, but received: [" + typeof resultFunc + "]"); | |
| 7020 | + } // Determine which set of options we're using. Prefer options passed directly, | |
| 7021 | + // but fall back to options given to createSelectorCreator. | |
| 7022 | + | |
| 7023 | + | |
| 7024 | + var _directlyPassedOption = directlyPassedOptions, | |
| 7025 | + _directlyPassedOption2 = _directlyPassedOption.memoizeOptions, | |
| 7026 | + memoizeOptions = _directlyPassedOption2 === void 0 ? memoizeOptionsFromArgs : _directlyPassedOption2; // Simplifying assumption: it's unlikely that the first options arg of the provided memoizer | |
| 7027 | + // is an array. In most libs I've looked at, it's an equality function or options object. | |
| 7028 | + // Based on that, if `memoizeOptions` _is_ an array, we assume it's a full | |
| 7029 | + // user-provided array of options. Otherwise, it must be just the _first_ arg, and so | |
| 7030 | + // we wrap it in an array so we can apply it. | |
| 7031 | + | |
| 7032 | + var finalMemoizeOptions = Array.isArray(memoizeOptions) ? memoizeOptions : [memoizeOptions]; | |
| 7033 | + var dependencies = getDependencies(funcs); | |
| 7034 | + var memoizedResultFunc = memoize.apply(void 0, [function recomputationWrapper() { | |
| 7035 | + _recomputations++; // apply arguments instead of spreading for performance. | |
| 7036 | + | |
| 7037 | + return resultFunc.apply(null, arguments); | |
| 7038 | + }].concat(finalMemoizeOptions)); // If a selector is called with the exact same arguments we don't need to traverse our dependencies again. | |
| 7039 | + | |
| 7040 | + var selector = memoize(function dependenciesChecker() { | |
| 7041 | + var params = []; | |
| 7042 | + var length = dependencies.length; | |
| 7043 | + | |
| 7044 | + for (var i = 0; i < length; i++) { | |
| 7045 | + // apply arguments instead of spreading and mutate a local list of params for performance. | |
| 7046 | + // @ts-ignore | |
| 7047 | + params.push(dependencies[i].apply(null, arguments)); | |
| 7048 | + } // apply arguments instead of spreading for performance. | |
| 7049 | + | |
| 7050 | + | |
| 7051 | + _lastResult = memoizedResultFunc.apply(null, params); | |
| 7052 | + return _lastResult; | |
| 7053 | + }); | |
| 7054 | + Object.assign(selector, { | |
| 7055 | + resultFunc: resultFunc, | |
| 7056 | + memoizedResultFunc: memoizedResultFunc, | |
| 7057 | + dependencies: dependencies, | |
| 7058 | + lastResult: function lastResult() { | |
| 7059 | + return _lastResult; | |
| 7060 | + }, | |
| 7061 | + recomputations: function recomputations() { | |
| 7062 | + return _recomputations; | |
| 7063 | + }, | |
| 7064 | + resetRecomputations: function resetRecomputations() { | |
| 7065 | + return _recomputations = 0; | |
| 7066 | + } | |
| 7067 | + }); | |
| 7068 | + return selector; | |
| 7069 | + }; // @ts-ignore | |
| 7070 | + | |
| 7071 | + | |
| 7072 | + return createSelector; | |
| 7073 | +} | |
| 7074 | +var createSelector = /* #__PURE__ */createSelectorCreator(_defaultMemoize__WEBPACK_IMPORTED_MODULE_0__.defaultMemoize); | |
| 7075 | +// Manual definition of state and output arguments | |
| 7076 | +var createStructuredSelector = function createStructuredSelector(selectors, selectorCreator) { | |
| 7077 | + if (selectorCreator === void 0) { | |
| 7078 | + selectorCreator = createSelector; | |
| 7079 | + } | |
| 7080 | + | |
| 7081 | + if (typeof selectors !== 'object') { | |
| 7082 | + throw new Error('createStructuredSelector expects first argument to be an object ' + ("where each property is a selector, instead received a " + typeof selectors)); | |
| 7083 | + } | |
| 7084 | + | |
| 7085 | + var objectKeys = Object.keys(selectors); | |
| 7086 | + var resultSelector = selectorCreator( // @ts-ignore | |
| 7087 | + objectKeys.map(function (key) { | |
| 7088 | + return selectors[key]; | |
| 7089 | + }), function () { | |
| 7090 | + for (var _len3 = arguments.length, values = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) { | |
| 7091 | + values[_key3] = arguments[_key3]; | |
| 7092 | + } | |
| 7093 | + | |
| 7094 | + return values.reduce(function (composition, value, index) { | |
| 7095 | + composition[objectKeys[index]] = value; | |
| 7096 | + return composition; | |
| 7097 | + }, {}); | |
| 7098 | + }); | |
| 7099 | + return resultSelector; | |
| 7100 | +}; | |
| 7101 | + | |
| 3406 | 7102 | /***/ }) |
| 3407 | 7103 | |
| 3408 | 7104 | /******/ }); |
| 3409 | 7105 | /************************************************************************/ |
| @@ -3429,8 +7125,49 @@ | ||
| 3429 | 7125 | /******/ |
| 3430 | 7126 | /******/ // Return the exports of the module |
| 3431 | 7127 | /******/ return module.exports; |
| 3432 | 7128 | /******/ } |
| 7129 | +/******/ | |
| 7130 | +/************************************************************************/ | |
| 7131 | +/******/ /* webpack/runtime/define property getters */ | |
| 7132 | +/******/ (() => { | |
| 7133 | +/******/ // define getter functions for harmony exports | |
| 7134 | +/******/ __webpack_require__.d = (exports, definition) => { | |
| 7135 | +/******/ for(var key in definition) { | |
| 7136 | +/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { | |
| 7137 | +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); | |
| 7138 | +/******/ } | |
| 7139 | +/******/ } | |
| 7140 | +/******/ }; | |
| 7141 | +/******/ })(); | |
| 7142 | +/******/ | |
| 7143 | +/******/ /* webpack/runtime/global */ | |
| 7144 | +/******/ (() => { | |
| 7145 | +/******/ __webpack_require__.g = (function() { | |
| 7146 | +/******/ if (typeof globalThis === 'object') return globalThis; | |
| 7147 | +/******/ try { | |
| 7148 | +/******/ return this || new Function('return this')(); | |
| 7149 | +/******/ } catch (e) { | |
| 7150 | +/******/ if (typeof window === 'object') return window; | |
| 7151 | +/******/ } | |
| 7152 | +/******/ })(); | |
| 7153 | +/******/ })(); | |
| 7154 | +/******/ | |
| 7155 | +/******/ /* webpack/runtime/hasOwnProperty shorthand */ | |
| 7156 | +/******/ (() => { | |
| 7157 | +/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) | |
| 7158 | +/******/ })(); | |
| 7159 | +/******/ | |
| 7160 | +/******/ /* webpack/runtime/make namespace object */ | |
| 7161 | +/******/ (() => { | |
| 7162 | +/******/ // define __esModule on exports | |
| 7163 | +/******/ __webpack_require__.r = (exports) => { | |
| 7164 | +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { | |
| 7165 | +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); | |
| 7166 | +/******/ } | |
| 7167 | +/******/ Object.defineProperty(exports, '__esModule', { value: true }); | |
| 7168 | +/******/ }; | |
| 7169 | +/******/ })(); | |
| 3433 | 7170 | /******/ |
| 3434 | 7171 | /************************************************************************/ |
| 3435 | 7172 | var __webpack_exports__ = {}; |
| 3436 | 7173 | // This entry needs to be wrapped in an IIFE because it needs to be in strict mode. |