PluginProbe
Elementor Website Builder – more than just a page builder / 3.6.8
Elementor Website Builder – more than just a page builder v3.6.8
4.3.2 4.3.1 4.3.0 4.3.0-beta3 4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 All 455 releases
elementor / assets / js / web-cli.js

web-cli.js in Elementor Website Builder – more than just a page builder 3.6.8, at assets/js/web-cli.js

12,293 lines 465.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 /*! elementor - v3.6.8 - 27-07-2022 */
2 /******/ (() => { // webpackBootstrap
3 /******/ var __webpack_modules__ = ({
4
5 /***/ "../node_modules/@reduxjs/toolkit/dist/redux-toolkit.esm.js":
6 /*!******************************************************************!*\
7 !*** ../node_modules/@reduxjs/toolkit/dist/redux-toolkit.esm.js ***!
8 \******************************************************************/
9 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
10
11 "use strict";
12 __webpack_require__.r(__webpack_exports__);
13 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
14 /* harmony export */ "MiddlewareArray": () => (/* binding */ MiddlewareArray),
15 /* harmony export */ "TaskAbortError": () => (/* binding */ TaskAbortError),
16 /* harmony export */ "__DO_NOT_USE__ActionTypes": () => (/* reexport safe */ redux__WEBPACK_IMPORTED_MODULE_0__.__DO_NOT_USE__ActionTypes),
17 /* harmony export */ "addListener": () => (/* binding */ addListener),
18 /* harmony export */ "applyMiddleware": () => (/* reexport safe */ redux__WEBPACK_IMPORTED_MODULE_0__.applyMiddleware),
19 /* harmony export */ "bindActionCreators": () => (/* reexport safe */ redux__WEBPACK_IMPORTED_MODULE_0__.bindActionCreators),
20 /* harmony export */ "clearAllListeners": () => (/* binding */ clearAllListeners),
21 /* harmony export */ "combineReducers": () => (/* reexport safe */ redux__WEBPACK_IMPORTED_MODULE_0__.combineReducers),
22 /* harmony export */ "compose": () => (/* reexport safe */ redux__WEBPACK_IMPORTED_MODULE_0__.compose),
23 /* harmony export */ "configureStore": () => (/* binding */ configureStore),
24 /* harmony export */ "createAction": () => (/* binding */ createAction),
25 /* harmony export */ "createAsyncThunk": () => (/* binding */ createAsyncThunk),
26 /* harmony export */ "createDraftSafeSelector": () => (/* binding */ createDraftSafeSelector),
27 /* harmony export */ "createEntityAdapter": () => (/* binding */ createEntityAdapter),
28 /* harmony export */ "createImmutableStateInvariantMiddleware": () => (/* binding */ createImmutableStateInvariantMiddleware),
29 /* harmony export */ "createListenerMiddleware": () => (/* binding */ createListenerMiddleware),
30 /* harmony export */ "createNextState": () => (/* reexport safe */ immer__WEBPACK_IMPORTED_MODULE_2__["default"]),
31 /* harmony export */ "createReducer": () => (/* binding */ createReducer),
32 /* harmony export */ "createSelector": () => (/* reexport safe */ reselect__WEBPACK_IMPORTED_MODULE_1__.createSelector),
33 /* harmony export */ "createSerializableStateInvariantMiddleware": () => (/* binding */ createSerializableStateInvariantMiddleware),
34 /* harmony export */ "createSlice": () => (/* binding */ createSlice),
35 /* harmony export */ "createStore": () => (/* reexport safe */ redux__WEBPACK_IMPORTED_MODULE_0__.createStore),
36 /* harmony export */ "current": () => (/* reexport safe */ immer__WEBPACK_IMPORTED_MODULE_2__.current),
37 /* harmony export */ "findNonSerializableValue": () => (/* binding */ findNonSerializableValue),
38 /* harmony export */ "freeze": () => (/* reexport safe */ immer__WEBPACK_IMPORTED_MODULE_2__.freeze),
39 /* harmony export */ "getDefaultMiddleware": () => (/* binding */ getDefaultMiddleware),
40 /* harmony export */ "getType": () => (/* binding */ getType),
41 /* harmony export */ "isAllOf": () => (/* binding */ isAllOf),
42 /* harmony export */ "isAnyOf": () => (/* binding */ isAnyOf),
43 /* harmony export */ "isAsyncThunkAction": () => (/* binding */ isAsyncThunkAction),
44 /* harmony export */ "isDraft": () => (/* reexport safe */ immer__WEBPACK_IMPORTED_MODULE_2__.isDraft),
45 /* harmony export */ "isFulfilled": () => (/* binding */ isFulfilled),
46 /* harmony export */ "isImmutableDefault": () => (/* binding */ isImmutableDefault),
47 /* harmony export */ "isPending": () => (/* binding */ isPending),
48 /* harmony export */ "isPlain": () => (/* binding */ isPlain),
49 /* harmony export */ "isPlainObject": () => (/* binding */ isPlainObject),
50 /* harmony export */ "isRejected": () => (/* binding */ isRejected),
51 /* harmony export */ "isRejectedWithValue": () => (/* binding */ isRejectedWithValue),
52 /* harmony export */ "legacy_createStore": () => (/* reexport safe */ redux__WEBPACK_IMPORTED_MODULE_0__.legacy_createStore),
53 /* harmony export */ "miniSerializeError": () => (/* binding */ miniSerializeError),
54 /* harmony export */ "nanoid": () => (/* binding */ nanoid),
55 /* harmony export */ "original": () => (/* reexport safe */ immer__WEBPACK_IMPORTED_MODULE_2__.original),
56 /* harmony export */ "removeListener": () => (/* binding */ removeListener),
57 /* harmony export */ "unwrapResult": () => (/* binding */ unwrapResult)
58 /* harmony export */ });
59 /* harmony import */ var immer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! immer */ "../node_modules/immer/dist/immer.esm.mjs");
60 /* harmony import */ var redux__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! redux */ "../node_modules/redux/es/redux.js");
61 /* harmony import */ var reselect__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! reselect */ "../node_modules/reselect/es/index.js");
62 /* harmony import */ var redux_thunk__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! redux-thunk */ "../node_modules/redux-thunk/es/index.js");
63 var __extends = (undefined && undefined.__extends) || (function () {
64 var extendStatics = function (d, b) {
65 extendStatics = Object.setPrototypeOf ||
66 ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
67 function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
68 return extendStatics(d, b);
69 };
70 return function (d, b) {
71 if (typeof b !== "function" && b !== null)
72 throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
73 extendStatics(d, b);
74 function __() { this.constructor = d; }
75 d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
76 };
77 })();
78 var __generator = (undefined && undefined.__generator) || function (thisArg, body) {
79 var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
80 return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
81 function verb(n) { return function (v) { return step([n, v]); }; }
82 function step(op) {
83 if (f) throw new TypeError("Generator is already executing.");
84 while (_) try {
85 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;
86 if (y = 0, t) op = [op[0] & 2, t.value];
87 switch (op[0]) {
88 case 0: case 1: t = op; break;
89 case 4: _.label++; return { value: op[1], done: false };
90 case 5: _.label++; y = op[1]; op = [0]; continue;
91 case 7: op = _.ops.pop(); _.trys.pop(); continue;
92 default:
93 if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
94 if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
95 if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
96 if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
97 if (t[2]) _.ops.pop();
98 _.trys.pop(); continue;
99 }
100 op = body.call(thisArg, _);
101 } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
102 if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
103 }
104 };
105 var __spreadArray = (undefined && undefined.__spreadArray) || function (to, from) {
106 for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
107 to[j] = from[i];
108 return to;
109 };
110 var __defProp = Object.defineProperty;
111 var __defProps = Object.defineProperties;
112 var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
113 var __getOwnPropSymbols = Object.getOwnPropertySymbols;
114 var __hasOwnProp = Object.prototype.hasOwnProperty;
115 var __propIsEnum = Object.prototype.propertyIsEnumerable;
116 var __defNormalProp = function (obj, key, value) { return key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value: value }) : obj[key] = value; };
117 var __spreadValues = function (a, b) {
118 for (var prop in b || (b = {}))
119 if (__hasOwnProp.call(b, prop))
120 __defNormalProp(a, prop, b[prop]);
121 if (__getOwnPropSymbols)
122 for (var _i = 0, _c = __getOwnPropSymbols(b); _i < _c.length; _i++) {
123 var prop = _c[_i];
124 if (__propIsEnum.call(b, prop))
125 __defNormalProp(a, prop, b[prop]);
126 }
127 return a;
128 };
129 var __spreadProps = function (a, b) { return __defProps(a, __getOwnPropDescs(b)); };
130 var __async = function (__this, __arguments, generator) {
131 return new Promise(function (resolve, reject) {
132 var fulfilled = function (value) {
133 try {
134 step(generator.next(value));
135 }
136 catch (e) {
137 reject(e);
138 }
139 };
140 var rejected = function (value) {
141 try {
142 step(generator.throw(value));
143 }
144 catch (e) {
145 reject(e);
146 }
147 };
148 var step = function (x) { return x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected); };
149 step((generator = generator.apply(__this, __arguments)).next());
150 });
151 };
152 // src/index.ts
153
154
155
156
157 // src/createDraftSafeSelector.ts
158
159
160 var createDraftSafeSelector = function () {
161 var args = [];
162 for (var _i = 0; _i < arguments.length; _i++) {
163 args[_i] = arguments[_i];
164 }
165 var selector = reselect__WEBPACK_IMPORTED_MODULE_1__.createSelector.apply(void 0, args);
166 var wrappedSelector = function (value) {
167 var rest = [];
168 for (var _i = 1; _i < arguments.length; _i++) {
169 rest[_i - 1] = arguments[_i];
170 }
171 return selector.apply(void 0, __spreadArray([(0,immer__WEBPACK_IMPORTED_MODULE_2__.isDraft)(value) ? (0,immer__WEBPACK_IMPORTED_MODULE_2__.current)(value) : value], rest));
172 };
173 return wrappedSelector;
174 };
175 // src/configureStore.ts
176
177 // src/devtoolsExtension.ts
178
179 var composeWithDevTools = typeof window !== "undefined" && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ ? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ : function () {
180 if (arguments.length === 0)
181 return void 0;
182 if (typeof arguments[0] === "object")
183 return redux__WEBPACK_IMPORTED_MODULE_0__.compose;
184 return redux__WEBPACK_IMPORTED_MODULE_0__.compose.apply(null, arguments);
185 };
186 var devToolsEnhancer = typeof window !== "undefined" && window.__REDUX_DEVTOOLS_EXTENSION__ ? window.__REDUX_DEVTOOLS_EXTENSION__ : function () {
187 return function (noop2) {
188 return noop2;
189 };
190 };
191 // src/isPlainObject.ts
192 function isPlainObject(value) {
193 if (typeof value !== "object" || value === null)
194 return false;
195 var proto = Object.getPrototypeOf(value);
196 if (proto === null)
197 return true;
198 var baseProto = proto;
199 while (Object.getPrototypeOf(baseProto) !== null) {
200 baseProto = Object.getPrototypeOf(baseProto);
201 }
202 return proto === baseProto;
203 }
204 // src/getDefaultMiddleware.ts
205
206 // src/utils.ts
207
208 function getTimeMeasureUtils(maxDelay, fnName) {
209 var elapsed = 0;
210 return {
211 measureTime: function (fn) {
212 var started = Date.now();
213 try {
214 return fn();
215 }
216 finally {
217 var finished = Date.now();
218 elapsed += finished - started;
219 }
220 },
221 warnIfExceeded: function () {
222 if (elapsed > maxDelay) {
223 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.");
224 }
225 }
226 };
227 }
228 var MiddlewareArray = /** @class */ (function (_super) {
229 __extends(MiddlewareArray, _super);
230 function MiddlewareArray() {
231 var args = [];
232 for (var _i = 0; _i < arguments.length; _i++) {
233 args[_i] = arguments[_i];
234 }
235 var _this = _super.apply(this, args) || this;
236 Object.setPrototypeOf(_this, MiddlewareArray.prototype);
237 return _this;
238 }
239 Object.defineProperty(MiddlewareArray, Symbol.species, {
240 get: function () {
241 return MiddlewareArray;
242 },
243 enumerable: false,
244 configurable: true
245 });
246 MiddlewareArray.prototype.concat = function () {
247 var arr = [];
248 for (var _i = 0; _i < arguments.length; _i++) {
249 arr[_i] = arguments[_i];
250 }
251 return _super.prototype.concat.apply(this, arr);
252 };
253 MiddlewareArray.prototype.prepend = function () {
254 var arr = [];
255 for (var _i = 0; _i < arguments.length; _i++) {
256 arr[_i] = arguments[_i];
257 }
258 if (arr.length === 1 && Array.isArray(arr[0])) {
259 return new (MiddlewareArray.bind.apply(MiddlewareArray, __spreadArray([void 0], arr[0].concat(this))))();
260 }
261 return new (MiddlewareArray.bind.apply(MiddlewareArray, __spreadArray([void 0], arr.concat(this))))();
262 };
263 return MiddlewareArray;
264 }(Array));
265 function freezeDraftable(val) {
266 return (0,immer__WEBPACK_IMPORTED_MODULE_2__.isDraftable)(val) ? (0,immer__WEBPACK_IMPORTED_MODULE_2__["default"])(val, function () {
267 }) : val;
268 }
269 // src/immutableStateInvariantMiddleware.ts
270 var isProduction = "development" === "production";
271 var prefix = "Invariant failed";
272 function invariant(condition, message) {
273 if (condition) {
274 return;
275 }
276 if (isProduction) {
277 throw new Error(prefix);
278 }
279 throw new Error(prefix + ": " + (message || ""));
280 }
281 function stringify(obj, serializer, indent, decycler) {
282 return JSON.stringify(obj, getSerialize(serializer, decycler), indent);
283 }
284 function getSerialize(serializer, decycler) {
285 var stack = [], keys = [];
286 if (!decycler)
287 decycler = function (_, value) {
288 if (stack[0] === value)
289 return "[Circular ~]";
290 return "[Circular ~." + keys.slice(0, stack.indexOf(value)).join(".") + "]";
291 };
292 return function (key, value) {
293 if (stack.length > 0) {
294 var thisPos = stack.indexOf(this);
295 ~thisPos ? stack.splice(thisPos + 1) : stack.push(this);
296 ~thisPos ? keys.splice(thisPos, Infinity, key) : keys.push(key);
297 if (~stack.indexOf(value))
298 value = decycler.call(this, key, value);
299 }
300 else
301 stack.push(value);
302 return serializer == null ? value : serializer.call(this, key, value);
303 };
304 }
305 function isImmutableDefault(value) {
306 return typeof value !== "object" || value === null || typeof value === "undefined" || Object.isFrozen(value);
307 }
308 function trackForMutations(isImmutable, ignorePaths, obj) {
309 var trackedProperties = trackProperties(isImmutable, ignorePaths, obj);
310 return {
311 detectMutations: function () {
312 return detectMutations(isImmutable, ignorePaths, trackedProperties, obj);
313 }
314 };
315 }
316 function trackProperties(isImmutable, ignorePaths, obj, path) {
317 if (ignorePaths === void 0) { ignorePaths = []; }
318 if (path === void 0) { path = ""; }
319 var tracked = { value: obj };
320 if (!isImmutable(obj)) {
321 tracked.children = {};
322 for (var key in obj) {
323 var childPath = path ? path + "." + key : key;
324 if (ignorePaths.length && ignorePaths.indexOf(childPath) !== -1) {
325 continue;
326 }
327 tracked.children[key] = trackProperties(isImmutable, ignorePaths, obj[key], childPath);
328 }
329 }
330 return tracked;
331 }
332 function detectMutations(isImmutable, ignorePaths, trackedProperty, obj, sameParentRef, path) {
333 if (ignorePaths === void 0) { ignorePaths = []; }
334 if (sameParentRef === void 0) { sameParentRef = false; }
335 if (path === void 0) { path = ""; }
336 var prevObj = trackedProperty ? trackedProperty.value : void 0;
337 var sameRef = prevObj === obj;
338 if (sameParentRef && !sameRef && !Number.isNaN(obj)) {
339 return { wasMutated: true, path: path };
340 }
341 if (isImmutable(prevObj) || isImmutable(obj)) {
342 return { wasMutated: false };
343 }
344 var keysToDetect = {};
345 for (var key in trackedProperty.children) {
346 keysToDetect[key] = true;
347 }
348 for (var key in obj) {
349 keysToDetect[key] = true;
350 }
351 for (var key in keysToDetect) {
352 var childPath = path ? path + "." + key : key;
353 if (ignorePaths.length && ignorePaths.indexOf(childPath) !== -1) {
354 continue;
355 }
356 var result = detectMutations(isImmutable, ignorePaths, trackedProperty.children[key], obj[key], sameRef, childPath);
357 if (result.wasMutated) {
358 return result;
359 }
360 }
361 return { wasMutated: false };
362 }
363 function createImmutableStateInvariantMiddleware(options) {
364 if (options === void 0) { options = {}; }
365 if (false) {}
366 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;
367 ignoredPaths = ignoredPaths || ignore;
368 var track = trackForMutations.bind(null, isImmutable, ignoredPaths);
369 return function (_c) {
370 var getState = _c.getState;
371 var state = getState();
372 var tracker = track(state);
373 var result;
374 return function (next) { return function (action) {
375 var measureUtils = getTimeMeasureUtils(warnAfter, "ImmutableStateInvariantMiddleware");
376 measureUtils.measureTime(function () {
377 state = getState();
378 result = tracker.detectMutations();
379 tracker = track(state);
380 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)");
381 });
382 var dispatchedAction = next(action);
383 measureUtils.measureTime(function () {
384 state = getState();
385 result = tracker.detectMutations();
386 tracker = track(state);
387 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)");
388 });
389 measureUtils.warnIfExceeded();
390 return dispatchedAction;
391 }; };
392 };
393 }
394 // src/serializableStateInvariantMiddleware.ts
395 function isPlain(val) {
396 var type = typeof val;
397 return type === "undefined" || val === null || type === "string" || type === "boolean" || type === "number" || Array.isArray(val) || isPlainObject(val);
398 }
399 function findNonSerializableValue(value, path, isSerializable, getEntries, ignoredPaths) {
400 if (path === void 0) { path = ""; }
401 if (isSerializable === void 0) { isSerializable = isPlain; }
402 if (ignoredPaths === void 0) { ignoredPaths = []; }
403 var foundNestedSerializable;
404 if (!isSerializable(value)) {
405 return {
406 keyPath: path || "<root>",
407 value: value
408 };
409 }
410 if (typeof value !== "object" || value === null) {
411 return false;
412 }
413 var entries = getEntries != null ? getEntries(value) : Object.entries(value);
414 var hasIgnoredPaths = ignoredPaths.length > 0;
415 for (var _i = 0, entries_1 = entries; _i < entries_1.length; _i++) {
416 var _c = entries_1[_i], key = _c[0], nestedValue = _c[1];
417 var nestedPath = path ? path + "." + key : key;
418 if (hasIgnoredPaths && ignoredPaths.indexOf(nestedPath) >= 0) {
419 continue;
420 }
421 if (!isSerializable(nestedValue)) {
422 return {
423 keyPath: nestedPath,
424 value: nestedValue
425 };
426 }
427 if (typeof nestedValue === "object") {
428 foundNestedSerializable = findNonSerializableValue(nestedValue, nestedPath, isSerializable, getEntries, ignoredPaths);
429 if (foundNestedSerializable) {
430 return foundNestedSerializable;
431 }
432 }
433 }
434 return false;
435 }
436 function createSerializableStateInvariantMiddleware(options) {
437 if (options === void 0) { options = {}; }
438 if (false) {}
439 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;
440 return function (storeAPI) { return function (next) { return function (action) {
441 var result = next(action);
442 var measureUtils = getTimeMeasureUtils(warnAfter, "SerializableStateInvariantMiddleware");
443 if (!ignoreActions && !(ignoredActions.length && ignoredActions.indexOf(action.type) !== -1)) {
444 measureUtils.measureTime(function () {
445 var foundActionNonSerializableValue = findNonSerializableValue(action, "", isSerializable, getEntries, ignoredActionPaths);
446 if (foundActionNonSerializableValue) {
447 var keyPath = foundActionNonSerializableValue.keyPath, value = foundActionNonSerializableValue.value;
448 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)");
449 }
450 });
451 }
452 if (!ignoreState) {
453 measureUtils.measureTime(function () {
454 var state = storeAPI.getState();
455 var foundStateNonSerializableValue = findNonSerializableValue(state, "", isSerializable, getEntries, ignoredPaths);
456 if (foundStateNonSerializableValue) {
457 var keyPath = foundStateNonSerializableValue.keyPath, value = foundStateNonSerializableValue.value;
458 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)");
459 }
460 });
461 measureUtils.warnIfExceeded();
462 }
463 return result;
464 }; }; };
465 }
466 // src/getDefaultMiddleware.ts
467 function isBoolean(x) {
468 return typeof x === "boolean";
469 }
470 function curryGetDefaultMiddleware() {
471 return function curriedGetDefaultMiddleware(options) {
472 return getDefaultMiddleware(options);
473 };
474 }
475 function getDefaultMiddleware(options) {
476 if (options === void 0) { options = {}; }
477 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;
478 var middlewareArray = new MiddlewareArray();
479 if (thunk) {
480 if (isBoolean(thunk)) {
481 middlewareArray.push(redux_thunk__WEBPACK_IMPORTED_MODULE_3__["default"]);
482 }
483 else {
484 middlewareArray.push(redux_thunk__WEBPACK_IMPORTED_MODULE_3__["default"].withExtraArgument(thunk.extraArgument));
485 }
486 }
487 if (true) {
488 if (immutableCheck) {
489 var immutableOptions = {};
490 if (!isBoolean(immutableCheck)) {
491 immutableOptions = immutableCheck;
492 }
493 middlewareArray.unshift(createImmutableStateInvariantMiddleware(immutableOptions));
494 }
495 if (serializableCheck) {
496 var serializableOptions = {};
497 if (!isBoolean(serializableCheck)) {
498 serializableOptions = serializableCheck;
499 }
500 middlewareArray.push(createSerializableStateInvariantMiddleware(serializableOptions));
501 }
502 }
503 return middlewareArray;
504 }
505 // src/configureStore.ts
506 var IS_PRODUCTION = "development" === "production";
507 function configureStore(options) {
508 var curriedGetDefaultMiddleware = curryGetDefaultMiddleware();
509 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;
510 var rootReducer;
511 if (typeof reducer === "function") {
512 rootReducer = reducer;
513 }
514 else if (isPlainObject(reducer)) {
515 rootReducer = (0,redux__WEBPACK_IMPORTED_MODULE_0__.combineReducers)(reducer);
516 }
517 else {
518 throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');
519 }
520 var finalMiddleware = middleware;
521 if (typeof finalMiddleware === "function") {
522 finalMiddleware = finalMiddleware(curriedGetDefaultMiddleware);
523 if (!IS_PRODUCTION && !Array.isArray(finalMiddleware)) {
524 throw new Error("when using a middleware builder function, an array of middleware must be returned");
525 }
526 }
527 if (!IS_PRODUCTION && finalMiddleware.some(function (item) { return typeof item !== "function"; })) {
528 throw new Error("each middleware provided to configureStore must be a function");
529 }
530 var middlewareEnhancer = redux__WEBPACK_IMPORTED_MODULE_0__.applyMiddleware.apply(void 0, finalMiddleware);
531 var finalCompose = redux__WEBPACK_IMPORTED_MODULE_0__.compose;
532 if (devTools) {
533 finalCompose = composeWithDevTools(__spreadValues({
534 trace: !IS_PRODUCTION
535 }, typeof devTools === "object" && devTools));
536 }
537 var storeEnhancers = [middlewareEnhancer];
538 if (Array.isArray(enhancers)) {
539 storeEnhancers = __spreadArray([middlewareEnhancer], enhancers);
540 }
541 else if (typeof enhancers === "function") {
542 storeEnhancers = enhancers(storeEnhancers);
543 }
544 var composedEnhancer = finalCompose.apply(void 0, storeEnhancers);
545 return (0,redux__WEBPACK_IMPORTED_MODULE_0__.createStore)(rootReducer, preloadedState, composedEnhancer);
546 }
547 // src/createAction.ts
548 function createAction(type, prepareAction) {
549 function actionCreator() {
550 var args = [];
551 for (var _i = 0; _i < arguments.length; _i++) {
552 args[_i] = arguments[_i];
553 }
554 if (prepareAction) {
555 var prepared = prepareAction.apply(void 0, args);
556 if (!prepared) {
557 throw new Error("prepareAction did not return an object");
558 }
559 return __spreadValues(__spreadValues({
560 type: type,
561 payload: prepared.payload
562 }, "meta" in prepared && { meta: prepared.meta }), "error" in prepared && { error: prepared.error });
563 }
564 return { type: type, payload: args[0] };
565 }
566 actionCreator.toString = function () { return "" + type; };
567 actionCreator.type = type;
568 actionCreator.match = function (action) { return action.type === type; };
569 return actionCreator;
570 }
571 function isFSA(action) {
572 return isPlainObject(action) && typeof action.type === "string" && Object.keys(action).every(isValidKey);
573 }
574 function isValidKey(key) {
575 return ["type", "payload", "error", "meta"].indexOf(key) > -1;
576 }
577 function getType(actionCreator) {
578 return "" + actionCreator;
579 }
580 // src/createReducer.ts
581
582 // src/mapBuilders.ts
583 function executeReducerBuilderCallback(builderCallback) {
584 var actionsMap = {};
585 var actionMatchers = [];
586 var defaultCaseReducer;
587 var builder = {
588 addCase: function (typeOrActionCreator, reducer) {
589 if (true) {
590 if (actionMatchers.length > 0) {
591 throw new Error("`builder.addCase` should only be called before calling `builder.addMatcher`");
592 }
593 if (defaultCaseReducer) {
594 throw new Error("`builder.addCase` should only be called before calling `builder.addDefaultCase`");
595 }
596 }
597 var type = typeof typeOrActionCreator === "string" ? typeOrActionCreator : typeOrActionCreator.type;
598 if (type in actionsMap) {
599 throw new Error("addCase cannot be called with two reducers for the same action type");
600 }
601 actionsMap[type] = reducer;
602 return builder;
603 },
604 addMatcher: function (matcher, reducer) {
605 if (true) {
606 if (defaultCaseReducer) {
607 throw new Error("`builder.addMatcher` should only be called before calling `builder.addDefaultCase`");
608 }
609 }
610 actionMatchers.push({ matcher: matcher, reducer: reducer });
611 return builder;
612 },
613 addDefaultCase: function (reducer) {
614 if (true) {
615 if (defaultCaseReducer) {
616 throw new Error("`builder.addDefaultCase` can only be called once");
617 }
618 }
619 defaultCaseReducer = reducer;
620 return builder;
621 }
622 };
623 builderCallback(builder);
624 return [actionsMap, actionMatchers, defaultCaseReducer];
625 }
626 // src/createReducer.ts
627 function isStateFunction(x) {
628 return typeof x === "function";
629 }
630 function createReducer(initialState, mapOrBuilderCallback, actionMatchers, defaultCaseReducer) {
631 if (actionMatchers === void 0) { actionMatchers = []; }
632 var _c = typeof mapOrBuilderCallback === "function" ? executeReducerBuilderCallback(mapOrBuilderCallback) : [mapOrBuilderCallback, actionMatchers, defaultCaseReducer], actionsMap = _c[0], finalActionMatchers = _c[1], finalDefaultCaseReducer = _c[2];
633 var getInitialState;
634 if (isStateFunction(initialState)) {
635 getInitialState = function () { return freezeDraftable(initialState()); };
636 }
637 else {
638 var frozenInitialState_1 = freezeDraftable(initialState);
639 getInitialState = function () { return frozenInitialState_1; };
640 }
641 function reducer(state, action) {
642 if (state === void 0) { state = getInitialState(); }
643 var caseReducers = __spreadArray([
644 actionsMap[action.type]
645 ], finalActionMatchers.filter(function (_c) {
646 var matcher = _c.matcher;
647 return matcher(action);
648 }).map(function (_c) {
649 var reducer2 = _c.reducer;
650 return reducer2;
651 }));
652 if (caseReducers.filter(function (cr) { return !!cr; }).length === 0) {
653 caseReducers = [finalDefaultCaseReducer];
654 }
655 return caseReducers.reduce(function (previousState, caseReducer) {
656 if (caseReducer) {
657 if ((0,immer__WEBPACK_IMPORTED_MODULE_2__.isDraft)(previousState)) {
658 var draft = previousState;
659 var result = caseReducer(draft, action);
660 if (typeof result === "undefined") {
661 return previousState;
662 }
663 return result;
664 }
665 else if (!(0,immer__WEBPACK_IMPORTED_MODULE_2__.isDraftable)(previousState)) {
666 var result = caseReducer(previousState, action);
667 if (typeof result === "undefined") {
668 if (previousState === null) {
669 return previousState;
670 }
671 throw Error("A case reducer on a non-draftable value must not return undefined");
672 }
673 return result;
674 }
675 else {
676 return (0,immer__WEBPACK_IMPORTED_MODULE_2__["default"])(previousState, function (draft) {
677 return caseReducer(draft, action);
678 });
679 }
680 }
681 return previousState;
682 }, state);
683 }
684 reducer.getInitialState = getInitialState;
685 return reducer;
686 }
687 // src/createSlice.ts
688 function getType2(slice, actionKey) {
689 return slice + "/" + actionKey;
690 }
691 function createSlice(options) {
692 var name = options.name;
693 if (!name) {
694 throw new Error("`name` is a required option for createSlice");
695 }
696 if (typeof process !== "undefined" && "development" === "development") {
697 if (options.initialState === void 0) {
698 console.error("You must provide an `initialState` value that is not `undefined`. You may have misspelled `initialState`");
699 }
700 }
701 var initialState = typeof options.initialState == "function" ? options.initialState : freezeDraftable(options.initialState);
702 var reducers = options.reducers || {};
703 var reducerNames = Object.keys(reducers);
704 var sliceCaseReducersByName = {};
705 var sliceCaseReducersByType = {};
706 var actionCreators = {};
707 reducerNames.forEach(function (reducerName) {
708 var maybeReducerWithPrepare = reducers[reducerName];
709 var type = getType2(name, reducerName);
710 var caseReducer;
711 var prepareCallback;
712 if ("reducer" in maybeReducerWithPrepare) {
713 caseReducer = maybeReducerWithPrepare.reducer;
714 prepareCallback = maybeReducerWithPrepare.prepare;
715 }
716 else {
717 caseReducer = maybeReducerWithPrepare;
718 }
719 sliceCaseReducersByName[reducerName] = caseReducer;
720 sliceCaseReducersByType[type] = caseReducer;
721 actionCreators[reducerName] = prepareCallback ? createAction(type, prepareCallback) : createAction(type);
722 });
723 function buildReducer() {
724 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;
725 var finalCaseReducers = __spreadValues(__spreadValues({}, extraReducers), sliceCaseReducersByType);
726 return createReducer(initialState, finalCaseReducers, actionMatchers, defaultCaseReducer);
727 }
728 var _reducer;
729 return {
730 name: name,
731 reducer: function (state, action) {
732 if (!_reducer)
733 _reducer = buildReducer();
734 return _reducer(state, action);
735 },
736 actions: actionCreators,
737 caseReducers: sliceCaseReducersByName,
738 getInitialState: function () {
739 if (!_reducer)
740 _reducer = buildReducer();
741 return _reducer.getInitialState();
742 }
743 };
744 }
745 // src/entities/entity_state.ts
746 function getInitialEntityState() {
747 return {
748 ids: [],
749 entities: {}
750 };
751 }
752 function createInitialStateFactory() {
753 function getInitialState(additionalState) {
754 if (additionalState === void 0) { additionalState = {}; }
755 return Object.assign(getInitialEntityState(), additionalState);
756 }
757 return { getInitialState: getInitialState };
758 }
759 // src/entities/state_selectors.ts
760 function createSelectorsFactory() {
761 function getSelectors(selectState) {
762 var selectIds = function (state) { return state.ids; };
763 var selectEntities = function (state) { return state.entities; };
764 var selectAll = createDraftSafeSelector(selectIds, selectEntities, function (ids, entities) { return ids.map(function (id) { return entities[id]; }); });
765 var selectId = function (_, id) { return id; };
766 var selectById = function (entities, id) { return entities[id]; };
767 var selectTotal = createDraftSafeSelector(selectIds, function (ids) { return ids.length; });
768 if (!selectState) {
769 return {
770 selectIds: selectIds,
771 selectEntities: selectEntities,
772 selectAll: selectAll,
773 selectTotal: selectTotal,
774 selectById: createDraftSafeSelector(selectEntities, selectId, selectById)
775 };
776 }
777 var selectGlobalizedEntities = createDraftSafeSelector(selectState, selectEntities);
778 return {
779 selectIds: createDraftSafeSelector(selectState, selectIds),
780 selectEntities: selectGlobalizedEntities,
781 selectAll: createDraftSafeSelector(selectState, selectAll),
782 selectTotal: createDraftSafeSelector(selectState, selectTotal),
783 selectById: createDraftSafeSelector(selectGlobalizedEntities, selectId, selectById)
784 };
785 }
786 return { getSelectors: getSelectors };
787 }
788 // src/entities/state_adapter.ts
789
790 function createSingleArgumentStateOperator(mutator) {
791 var operator = createStateOperator(function (_, state) { return mutator(state); });
792 return function operation(state) {
793 return operator(state, void 0);
794 };
795 }
796 function createStateOperator(mutator) {
797 return function operation(state, arg) {
798 function isPayloadActionArgument(arg2) {
799 return isFSA(arg2);
800 }
801 var runMutator = function (draft) {
802 if (isPayloadActionArgument(arg)) {
803 mutator(arg.payload, draft);
804 }
805 else {
806 mutator(arg, draft);
807 }
808 };
809 if ((0,immer__WEBPACK_IMPORTED_MODULE_2__.isDraft)(state)) {
810 runMutator(state);
811 return state;
812 }
813 else {
814 return (0,immer__WEBPACK_IMPORTED_MODULE_2__["default"])(state, runMutator);
815 }
816 };
817 }
818 // src/entities/utils.ts
819 function selectIdValue(entity, selectId) {
820 var key = selectId(entity);
821 if ( true && key === void 0) {
822 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());
823 }
824 return key;
825 }
826 function ensureEntitiesArray(entities) {
827 if (!Array.isArray(entities)) {
828 entities = Object.values(entities);
829 }
830 return entities;
831 }
832 function splitAddedUpdatedEntities(newEntities, selectId, state) {
833 newEntities = ensureEntitiesArray(newEntities);
834 var added = [];
835 var updated = [];
836 for (var _i = 0, newEntities_1 = newEntities; _i < newEntities_1.length; _i++) {
837 var entity = newEntities_1[_i];
838 var id = selectIdValue(entity, selectId);
839 if (id in state.entities) {
840 updated.push({ id: id, changes: entity });
841 }
842 else {
843 added.push(entity);
844 }
845 }
846 return [added, updated];
847 }
848 // src/entities/unsorted_state_adapter.ts
849 function createUnsortedStateAdapter(selectId) {
850 function addOneMutably(entity, state) {
851 var key = selectIdValue(entity, selectId);
852 if (key in state.entities) {
853 return;
854 }
855 state.ids.push(key);
856 state.entities[key] = entity;
857 }
858 function addManyMutably(newEntities, state) {
859 newEntities = ensureEntitiesArray(newEntities);
860 for (var _i = 0, newEntities_2 = newEntities; _i < newEntities_2.length; _i++) {
861 var entity = newEntities_2[_i];
862 addOneMutably(entity, state);
863 }
864 }
865 function setOneMutably(entity, state) {
866 var key = selectIdValue(entity, selectId);
867 if (!(key in state.entities)) {
868 state.ids.push(key);
869 }
870 state.entities[key] = entity;
871 }
872 function setManyMutably(newEntities, state) {
873 newEntities = ensureEntitiesArray(newEntities);
874 for (var _i = 0, newEntities_3 = newEntities; _i < newEntities_3.length; _i++) {
875 var entity = newEntities_3[_i];
876 setOneMutably(entity, state);
877 }
878 }
879 function setAllMutably(newEntities, state) {
880 newEntities = ensureEntitiesArray(newEntities);
881 state.ids = [];
882 state.entities = {};
883 addManyMutably(newEntities, state);
884 }
885 function removeOneMutably(key, state) {
886 return removeManyMutably([key], state);
887 }
888 function removeManyMutably(keys, state) {
889 var didMutate = false;
890 keys.forEach(function (key) {
891 if (key in state.entities) {
892 delete state.entities[key];
893 didMutate = true;
894 }
895 });
896 if (didMutate) {
897 state.ids = state.ids.filter(function (id) { return id in state.entities; });
898 }
899 }
900 function removeAllMutably(state) {
901 Object.assign(state, {
902 ids: [],
903 entities: {}
904 });
905 }
906 function takeNewKey(keys, update, state) {
907 var original2 = state.entities[update.id];
908 var updated = Object.assign({}, original2, update.changes);
909 var newKey = selectIdValue(updated, selectId);
910 var hasNewKey = newKey !== update.id;
911 if (hasNewKey) {
912 keys[update.id] = newKey;
913 delete state.entities[update.id];
914 }
915 state.entities[newKey] = updated;
916 return hasNewKey;
917 }
918 function updateOneMutably(update, state) {
919 return updateManyMutably([update], state);
920 }
921 function updateManyMutably(updates, state) {
922 var newKeys = {};
923 var updatesPerEntity = {};
924 updates.forEach(function (update) {
925 if (update.id in state.entities) {
926 updatesPerEntity[update.id] = {
927 id: update.id,
928 changes: __spreadValues(__spreadValues({}, updatesPerEntity[update.id] ? updatesPerEntity[update.id].changes : null), update.changes)
929 };
930 }
931 });
932 updates = Object.values(updatesPerEntity);
933 var didMutateEntities = updates.length > 0;
934 if (didMutateEntities) {
935 var didMutateIds = updates.filter(function (update) { return takeNewKey(newKeys, update, state); }).length > 0;
936 if (didMutateIds) {
937 state.ids = state.ids.map(function (id) { return newKeys[id] || id; });
938 }
939 }
940 }
941 function upsertOneMutably(entity, state) {
942 return upsertManyMutably([entity], state);
943 }
944 function upsertManyMutably(newEntities, state) {
945 var _c = splitAddedUpdatedEntities(newEntities, selectId, state), added = _c[0], updated = _c[1];
946 updateManyMutably(updated, state);
947 addManyMutably(added, state);
948 }
949 return {
950 removeAll: createSingleArgumentStateOperator(removeAllMutably),
951 addOne: createStateOperator(addOneMutably),
952 addMany: createStateOperator(addManyMutably),
953 setOne: createStateOperator(setOneMutably),
954 setMany: createStateOperator(setManyMutably),
955 setAll: createStateOperator(setAllMutably),
956 updateOne: createStateOperator(updateOneMutably),
957 updateMany: createStateOperator(updateManyMutably),
958 upsertOne: createStateOperator(upsertOneMutably),
959 upsertMany: createStateOperator(upsertManyMutably),
960 removeOne: createStateOperator(removeOneMutably),
961 removeMany: createStateOperator(removeManyMutably)
962 };
963 }
964 // src/entities/sorted_state_adapter.ts
965 function createSortedStateAdapter(selectId, sort) {
966 var _c = createUnsortedStateAdapter(selectId), removeOne = _c.removeOne, removeMany = _c.removeMany, removeAll = _c.removeAll;
967 function addOneMutably(entity, state) {
968 return addManyMutably([entity], state);
969 }
970 function addManyMutably(newEntities, state) {
971 newEntities = ensureEntitiesArray(newEntities);
972 var models = newEntities.filter(function (model) { return !(selectIdValue(model, selectId) in state.entities); });
973 if (models.length !== 0) {
974 merge(models, state);
975 }
976 }
977 function setOneMutably(entity, state) {
978 return setManyMutably([entity], state);
979 }
980 function setManyMutably(newEntities, state) {
981 newEntities = ensureEntitiesArray(newEntities);
982 if (newEntities.length !== 0) {
983 merge(newEntities, state);
984 }
985 }
986 function setAllMutably(newEntities, state) {
987 newEntities = ensureEntitiesArray(newEntities);
988 state.entities = {};
989 state.ids = [];
990 addManyMutably(newEntities, state);
991 }
992 function updateOneMutably(update, state) {
993 return updateManyMutably([update], state);
994 }
995 function updateManyMutably(updates, state) {
996 var appliedUpdates = false;
997 for (var _i = 0, updates_1 = updates; _i < updates_1.length; _i++) {
998 var update = updates_1[_i];
999 var entity = state.entities[update.id];
1000 if (!entity) {
1001 continue;
1002 }
1003 appliedUpdates = true;
1004 Object.assign(entity, update.changes);
1005 var newId = selectId(entity);
1006 if (update.id !== newId) {
1007 delete state.entities[update.id];
1008 state.entities[newId] = entity;
1009 }
1010 }
1011 if (appliedUpdates) {
1012 resortEntities(state);
1013 }
1014 }
1015 function upsertOneMutably(entity, state) {
1016 return upsertManyMutably([entity], state);
1017 }
1018 function upsertManyMutably(newEntities, state) {
1019 var _c = splitAddedUpdatedEntities(newEntities, selectId, state), added = _c[0], updated = _c[1];
1020 updateManyMutably(updated, state);
1021 addManyMutably(added, state);
1022 }
1023 function areArraysEqual(a, b) {
1024 if (a.length !== b.length) {
1025 return false;
1026 }
1027 for (var i = 0; i < a.length && i < b.length; i++) {
1028 if (a[i] === b[i]) {
1029 continue;
1030 }
1031 return false;
1032 }
1033 return true;
1034 }
1035 function merge(models, state) {
1036 models.forEach(function (model) {
1037 state.entities[selectId(model)] = model;
1038 });
1039 resortEntities(state);
1040 }
1041 function resortEntities(state) {
1042 var allEntities = Object.values(state.entities);
1043 allEntities.sort(sort);
1044 var newSortedIds = allEntities.map(selectId);
1045 var ids = state.ids;
1046 if (!areArraysEqual(ids, newSortedIds)) {
1047 state.ids = newSortedIds;
1048 }
1049 }
1050 return {
1051 removeOne: removeOne,
1052 removeMany: removeMany,
1053 removeAll: removeAll,
1054 addOne: createStateOperator(addOneMutably),
1055 updateOne: createStateOperator(updateOneMutably),
1056 upsertOne: createStateOperator(upsertOneMutably),
1057 setOne: createStateOperator(setOneMutably),
1058 setMany: createStateOperator(setManyMutably),
1059 setAll: createStateOperator(setAllMutably),
1060 addMany: createStateOperator(addManyMutably),
1061 updateMany: createStateOperator(updateManyMutably),
1062 upsertMany: createStateOperator(upsertManyMutably)
1063 };
1064 }
1065 // src/entities/create_adapter.ts
1066 function createEntityAdapter(options) {
1067 if (options === void 0) { options = {}; }
1068 var _c = __spreadValues({
1069 sortComparer: false,
1070 selectId: function (instance) { return instance.id; }
1071 }, options), selectId = _c.selectId, sortComparer = _c.sortComparer;
1072 var stateFactory = createInitialStateFactory();
1073 var selectorsFactory = createSelectorsFactory();
1074 var stateAdapter = sortComparer ? createSortedStateAdapter(selectId, sortComparer) : createUnsortedStateAdapter(selectId);
1075 return __spreadValues(__spreadValues(__spreadValues({
1076 selectId: selectId,
1077 sortComparer: sortComparer
1078 }, stateFactory), selectorsFactory), stateAdapter);
1079 }
1080 // src/nanoid.ts
1081 var urlAlphabet = "ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW";
1082 var nanoid = function (size) {
1083 if (size === void 0) { size = 21; }
1084 var id = "";
1085 var i = size;
1086 while (i--) {
1087 id += urlAlphabet[Math.random() * 64 | 0];
1088 }
1089 return id;
1090 };
1091 // src/createAsyncThunk.ts
1092 var commonProperties = [
1093 "name",
1094 "message",
1095 "stack",
1096 "code"
1097 ];
1098 var RejectWithValue = /** @class */ (function () {
1099 function RejectWithValue(payload, meta) {
1100 this.payload = payload;
1101 this.meta = meta;
1102 }
1103 return RejectWithValue;
1104 }());
1105 var FulfillWithMeta = /** @class */ (function () {
1106 function FulfillWithMeta(payload, meta) {
1107 this.payload = payload;
1108 this.meta = meta;
1109 }
1110 return FulfillWithMeta;
1111 }());
1112 var miniSerializeError = function (value) {
1113 if (typeof value === "object" && value !== null) {
1114 var simpleError = {};
1115 for (var _i = 0, commonProperties_1 = commonProperties; _i < commonProperties_1.length; _i++) {
1116 var property = commonProperties_1[_i];
1117 if (typeof value[property] === "string") {
1118 simpleError[property] = value[property];
1119 }
1120 }
1121 return simpleError;
1122 }
1123 return { message: String(value) };
1124 };
1125 function createAsyncThunk(typePrefix, payloadCreator, options) {
1126 var fulfilled = createAction(typePrefix + "/fulfilled", function (payload, requestId, arg, meta) { return ({
1127 payload: payload,
1128 meta: __spreadProps(__spreadValues({}, meta || {}), {
1129 arg: arg,
1130 requestId: requestId,
1131 requestStatus: "fulfilled"
1132 })
1133 }); });
1134 var pending = createAction(typePrefix + "/pending", function (requestId, arg, meta) { return ({
1135 payload: void 0,
1136 meta: __spreadProps(__spreadValues({}, meta || {}), {
1137 arg: arg,
1138 requestId: requestId,
1139 requestStatus: "pending"
1140 })
1141 }); });
1142 var rejected = createAction(typePrefix + "/rejected", function (error, requestId, arg, payload, meta) { return ({
1143 payload: payload,
1144 error: (options && options.serializeError || miniSerializeError)(error || "Rejected"),
1145 meta: __spreadProps(__spreadValues({}, meta || {}), {
1146 arg: arg,
1147 requestId: requestId,
1148 rejectedWithValue: !!payload,
1149 requestStatus: "rejected",
1150 aborted: (error == null ? void 0 : error.name) === "AbortError",
1151 condition: (error == null ? void 0 : error.name) === "ConditionError"
1152 })
1153 }); });
1154 var displayedWarning = false;
1155 var AC = typeof AbortController !== "undefined" ? AbortController : /** @class */ (function () {
1156 function class_1() {
1157 this.signal = {
1158 aborted: false,
1159 addEventListener: function () {
1160 },
1161 dispatchEvent: function () {
1162 return false;
1163 },
1164 onabort: function () {
1165 },
1166 removeEventListener: function () {
1167 },
1168 reason: void 0,
1169 throwIfAborted: function () {
1170 }
1171 };
1172 }
1173 class_1.prototype.abort = function () {
1174 if (true) {
1175 if (!displayedWarning) {
1176 displayedWarning = true;
1177 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'.");
1178 }
1179 }
1180 };
1181 return class_1;
1182 }());
1183 function actionCreator(arg) {
1184 return function (dispatch, getState, extra) {
1185 var requestId = (options == null ? void 0 : options.idGenerator) ? options.idGenerator(arg) : nanoid();
1186 var abortController = new AC();
1187 var abortReason;
1188 var abortedPromise = new Promise(function (_, reject) { return abortController.signal.addEventListener("abort", function () { return reject({ name: "AbortError", message: abortReason || "Aborted" }); }); });
1189 var started = false;
1190 function abort(reason) {
1191 if (started) {
1192 abortReason = reason;
1193 abortController.abort();
1194 }
1195 }
1196 var promise = function () {
1197 return __async(this, null, function () {
1198 var _a, _b, finalAction, conditionResult, err_1, skipDispatch;
1199 return __generator(this, function (_c) {
1200 switch (_c.label) {
1201 case 0:
1202 _c.trys.push([0, 4, , 5]);
1203 conditionResult = (_a = options == null ? void 0 : options.condition) == null ? void 0 : _a.call(options, arg, { getState: getState, extra: extra });
1204 if (!isThenable(conditionResult)) return [3 /*break*/, 2];
1205 return [4 /*yield*/, conditionResult];
1206 case 1:
1207 conditionResult = _c.sent();
1208 _c.label = 2;
1209 case 2:
1210 if (conditionResult === false) {
1211 throw {
1212 name: "ConditionError",
1213 message: "Aborted due to condition callback returning false."
1214 };
1215 }
1216 started = true;
1217 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 })));
1218 return [4 /*yield*/, Promise.race([
1219 abortedPromise,
1220 Promise.resolve(payloadCreator(arg, {
1221 dispatch: dispatch,
1222 getState: getState,
1223 extra: extra,
1224 requestId: requestId,
1225 signal: abortController.signal,
1226 rejectWithValue: function (value, meta) {
1227 return new RejectWithValue(value, meta);
1228 },
1229 fulfillWithValue: function (value, meta) {
1230 return new FulfillWithMeta(value, meta);
1231 }
1232 })).then(function (result) {
1233 if (result instanceof RejectWithValue) {
1234 throw result;
1235 }
1236 if (result instanceof FulfillWithMeta) {
1237 return fulfilled(result.payload, requestId, arg, result.meta);
1238 }
1239 return fulfilled(result, requestId, arg);
1240 })
1241 ])];
1242 case 3:
1243 finalAction = _c.sent();
1244 return [3 /*break*/, 5];
1245 case 4:
1246 err_1 = _c.sent();
1247 finalAction = err_1 instanceof RejectWithValue ? rejected(null, requestId, arg, err_1.payload, err_1.meta) : rejected(err_1, requestId, arg);
1248 return [3 /*break*/, 5];
1249 case 5:
1250 skipDispatch = options && !options.dispatchConditionRejection && rejected.match(finalAction) && finalAction.meta.condition;
1251 if (!skipDispatch) {
1252 dispatch(finalAction);
1253 }
1254 return [2 /*return*/, finalAction];
1255 }
1256 });
1257 });
1258 }();
1259 return Object.assign(promise, {
1260 abort: abort,
1261 requestId: requestId,
1262 arg: arg,
1263 unwrap: function () {
1264 return promise.then(unwrapResult);
1265 }
1266 });
1267 };
1268 }
1269 return Object.assign(actionCreator, {
1270 pending: pending,
1271 rejected: rejected,
1272 fulfilled: fulfilled,
1273 typePrefix: typePrefix
1274 });
1275 }
1276 function unwrapResult(action) {
1277 if (action.meta && action.meta.rejectedWithValue) {
1278 throw action.payload;
1279 }
1280 if (action.error) {
1281 throw action.error;
1282 }
1283 return action.payload;
1284 }
1285 function isThenable(value) {
1286 return value !== null && typeof value === "object" && typeof value.then === "function";
1287 }
1288 // src/tsHelpers.ts
1289 var hasMatchFunction = function (v) {
1290 return v && typeof v.match === "function";
1291 };
1292 // src/matchers.ts
1293 var matches = function (matcher, action) {
1294 if (hasMatchFunction(matcher)) {
1295 return matcher.match(action);
1296 }
1297 else {
1298 return matcher(action);
1299 }
1300 };
1301 function isAnyOf() {
1302 var matchers = [];
1303 for (var _i = 0; _i < arguments.length; _i++) {
1304 matchers[_i] = arguments[_i];
1305 }
1306 return function (action) {
1307 return matchers.some(function (matcher) { return matches(matcher, action); });
1308 };
1309 }
1310 function isAllOf() {
1311 var matchers = [];
1312 for (var _i = 0; _i < arguments.length; _i++) {
1313 matchers[_i] = arguments[_i];
1314 }
1315 return function (action) {
1316 return matchers.every(function (matcher) { return matches(matcher, action); });
1317 };
1318 }
1319 function hasExpectedRequestMetadata(action, validStatus) {
1320 if (!action || !action.meta)
1321 return false;
1322 var hasValidRequestId = typeof action.meta.requestId === "string";
1323 var hasValidRequestStatus = validStatus.indexOf(action.meta.requestStatus) > -1;
1324 return hasValidRequestId && hasValidRequestStatus;
1325 }
1326 function isAsyncThunkArray(a) {
1327 return typeof a[0] === "function" && "pending" in a[0] && "fulfilled" in a[0] && "rejected" in a[0];
1328 }
1329 function isPending() {
1330 var asyncThunks = [];
1331 for (var _i = 0; _i < arguments.length; _i++) {
1332 asyncThunks[_i] = arguments[_i];
1333 }
1334 if (asyncThunks.length === 0) {
1335 return function (action) { return hasExpectedRequestMetadata(action, ["pending"]); };
1336 }
1337 if (!isAsyncThunkArray(asyncThunks)) {
1338 return isPending()(asyncThunks[0]);
1339 }
1340 return function (action) {
1341 var matchers = asyncThunks.map(function (asyncThunk) { return asyncThunk.pending; });
1342 var combinedMatcher = isAnyOf.apply(void 0, matchers);
1343 return combinedMatcher(action);
1344 };
1345 }
1346 function isRejected() {
1347 var asyncThunks = [];
1348 for (var _i = 0; _i < arguments.length; _i++) {
1349 asyncThunks[_i] = arguments[_i];
1350 }
1351 if (asyncThunks.length === 0) {
1352 return function (action) { return hasExpectedRequestMetadata(action, ["rejected"]); };
1353 }
1354 if (!isAsyncThunkArray(asyncThunks)) {
1355 return isRejected()(asyncThunks[0]);
1356 }
1357 return function (action) {
1358 var matchers = asyncThunks.map(function (asyncThunk) { return asyncThunk.rejected; });
1359 var combinedMatcher = isAnyOf.apply(void 0, matchers);
1360 return combinedMatcher(action);
1361 };
1362 }
1363 function isRejectedWithValue() {
1364 var asyncThunks = [];
1365 for (var _i = 0; _i < arguments.length; _i++) {
1366 asyncThunks[_i] = arguments[_i];
1367 }
1368 var hasFlag = function (action) {
1369 return action && action.meta && action.meta.rejectedWithValue;
1370 };
1371 if (asyncThunks.length === 0) {
1372 return function (action) {
1373 var combinedMatcher = isAllOf(isRejected.apply(void 0, asyncThunks), hasFlag);
1374 return combinedMatcher(action);
1375 };
1376 }
1377 if (!isAsyncThunkArray(asyncThunks)) {
1378 return isRejectedWithValue()(asyncThunks[0]);
1379 }
1380 return function (action) {
1381 var combinedMatcher = isAllOf(isRejected.apply(void 0, asyncThunks), hasFlag);
1382 return combinedMatcher(action);
1383 };
1384 }
1385 function isFulfilled() {
1386 var asyncThunks = [];
1387 for (var _i = 0; _i < arguments.length; _i++) {
1388 asyncThunks[_i] = arguments[_i];
1389 }
1390 if (asyncThunks.length === 0) {
1391 return function (action) { return hasExpectedRequestMetadata(action, ["fulfilled"]); };
1392 }
1393 if (!isAsyncThunkArray(asyncThunks)) {
1394 return isFulfilled()(asyncThunks[0]);
1395 }
1396 return function (action) {
1397 var matchers = asyncThunks.map(function (asyncThunk) { return asyncThunk.fulfilled; });
1398 var combinedMatcher = isAnyOf.apply(void 0, matchers);
1399 return combinedMatcher(action);
1400 };
1401 }
1402 function isAsyncThunkAction() {
1403 var asyncThunks = [];
1404 for (var _i = 0; _i < arguments.length; _i++) {
1405 asyncThunks[_i] = arguments[_i];
1406 }
1407 if (asyncThunks.length === 0) {
1408 return function (action) { return hasExpectedRequestMetadata(action, ["pending", "fulfilled", "rejected"]); };
1409 }
1410 if (!isAsyncThunkArray(asyncThunks)) {
1411 return isAsyncThunkAction()(asyncThunks[0]);
1412 }
1413 return function (action) {
1414 var matchers = [];
1415 for (var _i = 0, asyncThunks_1 = asyncThunks; _i < asyncThunks_1.length; _i++) {
1416 var asyncThunk = asyncThunks_1[_i];
1417 matchers.push(asyncThunk.pending, asyncThunk.rejected, asyncThunk.fulfilled);
1418 }
1419 var combinedMatcher = isAnyOf.apply(void 0, matchers);
1420 return combinedMatcher(action);
1421 };
1422 }
1423 // src/listenerMiddleware/utils.ts
1424 var assertFunction = function (func, expected) {
1425 if (typeof func !== "function") {
1426 throw new TypeError(expected + " is not a function");
1427 }
1428 };
1429 var noop = function () {
1430 };
1431 var catchRejection = function (promise, onError) {
1432 if (onError === void 0) { onError = noop; }
1433 promise.catch(onError);
1434 return promise;
1435 };
1436 var addAbortSignalListener = function (abortSignal, callback) {
1437 abortSignal.addEventListener("abort", callback, { once: true });
1438 };
1439 var abortControllerWithReason = function (abortController, reason) {
1440 var signal = abortController.signal;
1441 if (signal.aborted) {
1442 return;
1443 }
1444 if (!("reason" in signal)) {
1445 Object.defineProperty(signal, "reason", {
1446 enumerable: true,
1447 value: reason,
1448 configurable: true,
1449 writable: true
1450 });
1451 }
1452 ;
1453 abortController.abort(reason);
1454 };
1455 // src/listenerMiddleware/exceptions.ts
1456 var task = "task";
1457 var listener = "listener";
1458 var completed = "completed";
1459 var cancelled = "cancelled";
1460 var taskCancelled = "task-" + cancelled;
1461 var taskCompleted = "task-" + completed;
1462 var listenerCancelled = listener + "-" + cancelled;
1463 var listenerCompleted = listener + "-" + completed;
1464 var TaskAbortError = /** @class */ (function () {
1465 function TaskAbortError(code) {
1466 this.code = code;
1467 this.name = "TaskAbortError";
1468 this.message = task + " " + cancelled + " (reason: " + code + ")";
1469 }
1470 return TaskAbortError;
1471 }());
1472 // src/listenerMiddleware/task.ts
1473 var validateActive = function (signal) {
1474 if (signal.aborted) {
1475 throw new TaskAbortError(signal.reason);
1476 }
1477 };
1478 var promisifyAbortSignal = function (signal) {
1479 return catchRejection(new Promise(function (_, reject) {
1480 var notifyRejection = function () { return reject(new TaskAbortError(signal.reason)); };
1481 if (signal.aborted) {
1482 notifyRejection();
1483 }
1484 else {
1485 addAbortSignalListener(signal, notifyRejection);
1486 }
1487 }));
1488 };
1489 var runTask = function (task2, cleanUp) { return __async(void 0, null, function () {
1490 var value, error_1;
1491 return __generator(this, function (_c) {
1492 switch (_c.label) {
1493 case 0:
1494 _c.trys.push([0, 3, 4, 5]);
1495 return [4 /*yield*/, Promise.resolve()];
1496 case 1:
1497 _c.sent();
1498 return [4 /*yield*/, task2()];
1499 case 2:
1500 value = _c.sent();
1501 return [2 /*return*/, {
1502 status: "ok",
1503 value: value
1504 }];
1505 case 3:
1506 error_1 = _c.sent();
1507 return [2 /*return*/, {
1508 status: error_1 instanceof TaskAbortError ? "cancelled" : "rejected",
1509 error: error_1
1510 }];
1511 case 4:
1512 cleanUp == null ? void 0 : cleanUp();
1513 return [7 /*endfinally*/];
1514 case 5: return [2 /*return*/];
1515 }
1516 });
1517 }); };
1518 var createPause = function (signal) {
1519 return function (promise) {
1520 return catchRejection(Promise.race([promisifyAbortSignal(signal), promise]).then(function (output) {
1521 validateActive(signal);
1522 return output;
1523 }));
1524 };
1525 };
1526 var createDelay = function (signal) {
1527 var pause = createPause(signal);
1528 return function (timeoutMs) {
1529 return pause(new Promise(function (resolve) { return setTimeout(resolve, timeoutMs); }));
1530 };
1531 };
1532 // src/listenerMiddleware/index.ts
1533 var assign = Object.assign;
1534 var INTERNAL_NIL_TOKEN = {};
1535 var alm = "listenerMiddleware";
1536 var createFork = function (parentAbortSignal) {
1537 var linkControllers = function (controller) { return addAbortSignalListener(parentAbortSignal, function () { return abortControllerWithReason(controller, parentAbortSignal.reason); }); };
1538 return function (taskExecutor) {
1539 assertFunction(taskExecutor, "taskExecutor");
1540 var childAbortController = new AbortController();
1541 linkControllers(childAbortController);
1542 var result = runTask(function () { return __async(void 0, null, function () {
1543 var result2;
1544 return __generator(this, function (_c) {
1545 switch (_c.label) {
1546 case 0:
1547 validateActive(parentAbortSignal);
1548 validateActive(childAbortController.signal);
1549 return [4 /*yield*/, taskExecutor({
1550 pause: createPause(childAbortController.signal),
1551 delay: createDelay(childAbortController.signal),
1552 signal: childAbortController.signal
1553 })];
1554 case 1:
1555 result2 = _c.sent();
1556 validateActive(childAbortController.signal);
1557 return [2 /*return*/, result2];
1558 }
1559 });
1560 }); }, function () { return abortControllerWithReason(childAbortController, taskCompleted); });
1561 return {
1562 result: createPause(parentAbortSignal)(result),
1563 cancel: function () {
1564 abortControllerWithReason(childAbortController, taskCancelled);
1565 }
1566 };
1567 };
1568 };
1569 var createTakePattern = function (startListening, signal) {
1570 var take = function (predicate, timeout) { return __async(void 0, null, function () {
1571 var unsubscribe, tuplePromise, promises, output;
1572 return __generator(this, function (_c) {
1573 switch (_c.label) {
1574 case 0:
1575 validateActive(signal);
1576 unsubscribe = function () {
1577 };
1578 tuplePromise = new Promise(function (resolve) {
1579 unsubscribe = startListening({
1580 predicate: predicate,
1581 effect: function (action, listenerApi) {
1582 listenerApi.unsubscribe();
1583 resolve([
1584 action,
1585 listenerApi.getState(),
1586 listenerApi.getOriginalState()
1587 ]);
1588 }
1589 });
1590 });
1591 promises = [
1592 promisifyAbortSignal(signal),
1593 tuplePromise
1594 ];
1595 if (timeout != null) {
1596 promises.push(new Promise(function (resolve) { return setTimeout(resolve, timeout, null); }));
1597 }
1598 _c.label = 1;
1599 case 1:
1600 _c.trys.push([1, , 3, 4]);
1601 return [4 /*yield*/, Promise.race(promises)];
1602 case 2:
1603 output = _c.sent();
1604 validateActive(signal);
1605 return [2 /*return*/, output];
1606 case 3:
1607 unsubscribe();
1608 return [7 /*endfinally*/];
1609 case 4: return [2 /*return*/];
1610 }
1611 });
1612 }); };
1613 return function (predicate, timeout) { return catchRejection(take(predicate, timeout)); };
1614 };
1615 var getListenerEntryPropsFrom = function (options) {
1616 var type = options.type, actionCreator = options.actionCreator, matcher = options.matcher, predicate = options.predicate, effect = options.effect;
1617 if (type) {
1618 predicate = createAction(type).match;
1619 }
1620 else if (actionCreator) {
1621 type = actionCreator.type;
1622 predicate = actionCreator.match;
1623 }
1624 else if (matcher) {
1625 predicate = matcher;
1626 }
1627 else if (predicate) {
1628 }
1629 else {
1630 throw new Error("Creating or removing a listener requires one of the known fields for matching an action");
1631 }
1632 assertFunction(effect, "options.listener");
1633 return { predicate: predicate, type: type, effect: effect };
1634 };
1635 var createListenerEntry = function (options) {
1636 var _c = getListenerEntryPropsFrom(options), type = _c.type, predicate = _c.predicate, effect = _c.effect;
1637 var id = nanoid();
1638 var entry = {
1639 id: id,
1640 effect: effect,
1641 type: type,
1642 predicate: predicate,
1643 pending: new Set(),
1644 unsubscribe: function () {
1645 throw new Error("Unsubscribe not initialized");
1646 }
1647 };
1648 return entry;
1649 };
1650 var createClearListenerMiddleware = function (listenerMap) {
1651 return function () {
1652 listenerMap.forEach(cancelActiveListeners);
1653 listenerMap.clear();
1654 };
1655 };
1656 var safelyNotifyError = function (errorHandler, errorToNotify, errorInfo) {
1657 try {
1658 errorHandler(errorToNotify, errorInfo);
1659 }
1660 catch (errorHandlerError) {
1661 setTimeout(function () {
1662 throw errorHandlerError;
1663 }, 0);
1664 }
1665 };
1666 var addListener = createAction(alm + "/add");
1667 var clearAllListeners = createAction(alm + "/removeAll");
1668 var removeListener = createAction(alm + "/remove");
1669 var defaultErrorHandler = function () {
1670 var args = [];
1671 for (var _i = 0; _i < arguments.length; _i++) {
1672 args[_i] = arguments[_i];
1673 }
1674 console.error.apply(console, __spreadArray([alm + "/error"], args));
1675 };
1676 var cancelActiveListeners = function (entry) {
1677 entry.pending.forEach(function (controller) {
1678 abortControllerWithReason(controller, listenerCancelled);
1679 });
1680 };
1681 function createListenerMiddleware(middlewareOptions) {
1682 var _this = this;
1683 if (middlewareOptions === void 0) { middlewareOptions = {}; }
1684 var listenerMap = new Map();
1685 var extra = middlewareOptions.extra, _c = middlewareOptions.onError, onError = _c === void 0 ? defaultErrorHandler : _c;
1686 assertFunction(onError, "onError");
1687 var insertEntry = function (entry) {
1688 entry.unsubscribe = function () { return listenerMap.delete(entry.id); };
1689 listenerMap.set(entry.id, entry);
1690 return function (cancelOptions) {
1691 entry.unsubscribe();
1692 if (cancelOptions == null ? void 0 : cancelOptions.cancelActive) {
1693 cancelActiveListeners(entry);
1694 }
1695 };
1696 };
1697 var findListenerEntry = function (comparator) {
1698 for (var _i = 0, _c = Array.from(listenerMap.values()); _i < _c.length; _i++) {
1699 var entry = _c[_i];
1700 if (comparator(entry)) {
1701 return entry;
1702 }
1703 }
1704 return void 0;
1705 };
1706 var startListening = function (options) {
1707 var entry = findListenerEntry(function (existingEntry) { return existingEntry.effect === options.effect; });
1708 if (!entry) {
1709 entry = createListenerEntry(options);
1710 }
1711 return insertEntry(entry);
1712 };
1713 var stopListening = function (options) {
1714 var _c = getListenerEntryPropsFrom(options), type = _c.type, effect = _c.effect, predicate = _c.predicate;
1715 var entry = findListenerEntry(function (entry2) {
1716 var matchPredicateOrType = typeof type === "string" ? entry2.type === type : entry2.predicate === predicate;
1717 return matchPredicateOrType && entry2.effect === effect;
1718 });
1719 if (entry) {
1720 entry.unsubscribe();
1721 if (options.cancelActive) {
1722 cancelActiveListeners(entry);
1723 }
1724 }
1725 return !!entry;
1726 };
1727 var notifyListener = function (entry, action, api, getOriginalState) { return __async(_this, null, function () {
1728 var internalTaskController, take, listenerError_1;
1729 return __generator(this, function (_c) {
1730 switch (_c.label) {
1731 case 0:
1732 internalTaskController = new AbortController();
1733 take = createTakePattern(startListening, internalTaskController.signal);
1734 _c.label = 1;
1735 case 1:
1736 _c.trys.push([1, 3, 4, 5]);
1737 entry.pending.add(internalTaskController);
1738 return [4 /*yield*/, Promise.resolve(entry.effect(action, assign({}, api, {
1739 getOriginalState: getOriginalState,
1740 condition: function (predicate, timeout) { return take(predicate, timeout).then(Boolean); },
1741 take: take,
1742 delay: createDelay(internalTaskController.signal),
1743 pause: createPause(internalTaskController.signal),
1744 extra: extra,
1745 signal: internalTaskController.signal,
1746 fork: createFork(internalTaskController.signal),
1747 unsubscribe: entry.unsubscribe,
1748 subscribe: function () {
1749 listenerMap.set(entry.id, entry);
1750 },
1751 cancelActiveListeners: function () {
1752 entry.pending.forEach(function (controller, _, set) {
1753 if (controller !== internalTaskController) {
1754 abortControllerWithReason(controller, listenerCancelled);
1755 set.delete(controller);
1756 }
1757 });
1758 }
1759 })))];
1760 case 2:
1761 _c.sent();
1762 return [3 /*break*/, 5];
1763 case 3:
1764 listenerError_1 = _c.sent();
1765 if (!(listenerError_1 instanceof TaskAbortError)) {
1766 safelyNotifyError(onError, listenerError_1, {
1767 raisedBy: "effect"
1768 });
1769 }
1770 return [3 /*break*/, 5];
1771 case 4:
1772 abortControllerWithReason(internalTaskController, listenerCompleted);
1773 entry.pending.delete(internalTaskController);
1774 return [7 /*endfinally*/];
1775 case 5: return [2 /*return*/];
1776 }
1777 });
1778 }); };
1779 var clearListenerMiddleware = createClearListenerMiddleware(listenerMap);
1780 var middleware = function (api) { return function (next) { return function (action) {
1781 if (addListener.match(action)) {
1782 return startListening(action.payload);
1783 }
1784 if (clearAllListeners.match(action)) {
1785 clearListenerMiddleware();
1786 return;
1787 }
1788 if (removeListener.match(action)) {
1789 return stopListening(action.payload);
1790 }
1791 var originalState = api.getState();
1792 var getOriginalState = function () {
1793 if (originalState === INTERNAL_NIL_TOKEN) {
1794 throw new Error(alm + ": getOriginalState can only be called synchronously");
1795 }
1796 return originalState;
1797 };
1798 var result;
1799 try {
1800 result = next(action);
1801 if (listenerMap.size > 0) {
1802 var currentState = api.getState();
1803 var listenerEntries = Array.from(listenerMap.values());
1804 for (var _i = 0, listenerEntries_1 = listenerEntries; _i < listenerEntries_1.length; _i++) {
1805 var entry = listenerEntries_1[_i];
1806 var runListener = false;
1807 try {
1808 runListener = entry.predicate(action, currentState, originalState);
1809 }
1810 catch (predicateError) {
1811 runListener = false;
1812 safelyNotifyError(onError, predicateError, {
1813 raisedBy: "predicate"
1814 });
1815 }
1816 if (!runListener) {
1817 continue;
1818 }
1819 notifyListener(entry, action, api, getOriginalState);
1820 }
1821 }
1822 }
1823 finally {
1824 originalState = INTERNAL_NIL_TOKEN;
1825 }
1826 return result;
1827 }; }; };
1828 return {
1829 middleware: middleware,
1830 startListening: startListening,
1831 stopListening: stopListening,
1832 clearListeners: clearListenerMiddleware
1833 };
1834 }
1835 // src/index.ts
1836 (0,immer__WEBPACK_IMPORTED_MODULE_2__.enableES5)();
1837
1838 //# sourceMappingURL=redux-toolkit.esm.js.map
1839
1840 /***/ }),
1841
1842 /***/ "../assets/dev/js/editor/utils/is-instanceof.js":
1843 /*!******************************************************!*\
1844 !*** ../assets/dev/js/editor/utils/is-instanceof.js ***!
1845 \******************************************************/
1846 /***/ ((__unused_webpack_module, exports) => {
1847
1848 "use strict";
1849
1850
1851 Object.defineProperty(exports, "__esModule", ({
1852 value: true
1853 }));
1854 exports["default"] = void 0;
1855
1856 function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, 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 normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
1857
1858 function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
1859
1860 function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
1861
1862 /**
1863 * Some FileAPI objects such as FileList, DataTransferItem and DataTransferItemList has inconsistency with the retrieved
1864 * object (from events, etc.) and the actual JavaScript object so a regular instanceof doesn't work. This function can
1865 * check whether it's instanceof by using the objects constructor and prototype names.
1866 *
1867 * @param object
1868 * @param constructors
1869 * @return {boolean}
1870 */
1871 var _default = function _default(object, constructors) {
1872 constructors = Array.isArray(constructors) ? constructors : [constructors];
1873
1874 var _iterator = _createForOfIteratorHelper(constructors),
1875 _step;
1876
1877 try {
1878 for (_iterator.s(); !(_step = _iterator.n()).done;) {
1879 var _constructor = _step.value;
1880
1881 if (object.constructor.name === _constructor.prototype[Symbol.toStringTag]) {
1882 return true;
1883 }
1884 }
1885 } catch (err) {
1886 _iterator.e(err);
1887 } finally {
1888 _iterator.f();
1889 }
1890
1891 return false;
1892 };
1893
1894 exports["default"] = _default;
1895
1896 /***/ }),
1897
1898 /***/ "../assets/dev/js/modules/imports/args-object.js":
1899 /*!*******************************************************!*\
1900 !*** ../assets/dev/js/modules/imports/args-object.js ***!
1901 \*******************************************************/
1902 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1903
1904 "use strict";
1905
1906
1907 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
1908
1909 Object.defineProperty(exports, "__esModule", ({
1910 value: true
1911 }));
1912 exports["default"] = void 0;
1913
1914 var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js"));
1915
1916 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
1917
1918 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
1919
1920 var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
1921
1922 var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
1923
1924 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
1925
1926 var _instanceType = _interopRequireDefault(__webpack_require__(/*! ./instance-type */ "../assets/dev/js/modules/imports/instance-type.js"));
1927
1928 var _isInstanceof = _interopRequireDefault(__webpack_require__(/*! ../../editor/utils/is-instanceof */ "../assets/dev/js/editor/utils/is-instanceof.js"));
1929
1930 function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
1931
1932 function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
1933
1934 var ArgsObject = /*#__PURE__*/function (_InstanceType) {
1935 (0, _inherits2.default)(ArgsObject, _InstanceType);
1936
1937 var _super = _createSuper(ArgsObject);
1938
1939 /**
1940 * Function constructor().
1941 *
1942 * Create ArgsObject.
1943 *
1944 * @param {{}} args
1945 */
1946 function ArgsObject(args) {
1947 var _this;
1948
1949 (0, _classCallCheck2.default)(this, ArgsObject);
1950 _this = _super.call(this);
1951 _this.args = args;
1952 return _this;
1953 }
1954 /**
1955 * Function requireArgument().
1956 *
1957 * Validate property in args.
1958 *
1959 * @param {string} property
1960 * @param {{}} args
1961 *
1962 * @throws {Error}
1963 *
1964 */
1965
1966
1967 (0, _createClass2.default)(ArgsObject, [{
1968 key: "requireArgument",
1969 value: function requireArgument(property) {
1970 var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.args;
1971
1972 if (!args.hasOwnProperty(property)) {
1973 throw Error("".concat(property, " is required."));
1974 }
1975 }
1976 /**
1977 * Function requireArgumentType().
1978 *
1979 * Validate property in args using `type === typeof(args.whatever)`.
1980 *
1981 * @param {string} property
1982 * @param {string} type
1983 * @param {{}} args
1984 *
1985 * @throws {Error}
1986 *
1987 */
1988
1989 }, {
1990 key: "requireArgumentType",
1991 value: function requireArgumentType(property, type) {
1992 var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.args;
1993 this.requireArgument(property, args);
1994
1995 if ((0, _typeof2.default)(args[property]) !== type) {
1996 throw Error("".concat(property, " invalid type: ").concat(type, "."));
1997 }
1998 }
1999 /**
2000 * Function requireArgumentInstance().
2001 *
2002 * Validate property in args using `args.whatever instanceof instance`.
2003 *
2004 * @param {string} property
2005 * @param {*} instance
2006 * @param {{}} args
2007 *
2008 * @throws {Error}
2009 *
2010 */
2011
2012 }, {
2013 key: "requireArgumentInstance",
2014 value: function requireArgumentInstance(property, instance) {
2015 var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.args;
2016 this.requireArgument(property, args);
2017
2018 if (!(args[property] instanceof instance) && !(0, _isInstanceof.default)(args[property], instance)) {
2019 throw Error("".concat(property, " invalid instance."));
2020 }
2021 }
2022 /**
2023 * Function requireArgumentConstructor().
2024 *
2025 * Validate property in args using `type === args.whatever.constructor`.
2026 *
2027 * @param {string} property
2028 * @param {*} type
2029 * @param {{}} args
2030 *
2031 * @throws {Error}
2032 *
2033 */
2034
2035 }, {
2036 key: "requireArgumentConstructor",
2037 value: function requireArgumentConstructor(property, type) {
2038 var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.args;
2039 this.requireArgument(property, args); // Note: Converting the constructor to string in order to avoid equation issues
2040 // due to different memory addresses between iframes (window.Object !== window.top.Object).
2041
2042 if (args[property].constructor.toString() !== type.prototype.constructor.toString()) {
2043 throw Error("".concat(property, " invalid constructor type."));
2044 }
2045 }
2046 }], [{
2047 key: "getInstanceType",
2048 value: function getInstanceType() {
2049 return 'ArgsObject';
2050 }
2051 }]);
2052 return ArgsObject;
2053 }(_instanceType.default);
2054
2055 exports["default"] = ArgsObject;
2056
2057 /***/ }),
2058
2059 /***/ "../assets/dev/js/modules/imports/instance-type.js":
2060 /*!*********************************************************!*\
2061 !*** ../assets/dev/js/modules/imports/instance-type.js ***!
2062 \*********************************************************/
2063 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
2064
2065 "use strict";
2066
2067
2068 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
2069
2070 Object.defineProperty(exports, "__esModule", ({
2071 value: true
2072 }));
2073 exports["default"] = void 0;
2074
2075 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
2076
2077 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
2078
2079 var _get2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/get */ "../node_modules/@babel/runtime/helpers/get.js"));
2080
2081 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
2082
2083 var InstanceType = /*#__PURE__*/function (_Symbol$hasInstance) {
2084 function InstanceType() {
2085 var _this = this;
2086
2087 (0, _classCallCheck2.default)(this, InstanceType);
2088 // Since anonymous classes sometimes do not get validated by babel, do it manually.
2089 var target = this instanceof InstanceType ? this.constructor : void 0;
2090 var prototypes = [];
2091
2092 while (target.__proto__ && target.__proto__.name) {
2093 prototypes.push(target.__proto__);
2094 target = target.__proto__;
2095 }
2096
2097 prototypes.reverse().forEach(function (proto) {
2098 return _this instanceof proto;
2099 });
2100 }
2101
2102 (0, _createClass2.default)(InstanceType, null, [{
2103 key: _Symbol$hasInstance,
2104 value: function value(target) {
2105 /**
2106 * This is function extending being called each time JS uses instanceOf, since babel use it each time it create new class
2107 * its give's opportunity to mange capabilities of instanceOf operator.
2108 * saving current class each time will give option later to handle instanceOf manually.
2109 */
2110 var result = (0, _get2.default)((0, _getPrototypeOf2.default)(InstanceType), Symbol.hasInstance, this).call(this, target); // Act normal when validate a class, which does not have instance type.
2111
2112 if (target && !target.constructor.getInstanceType) {
2113 return result;
2114 }
2115
2116 if (target) {
2117 if (!target.instanceTypes) {
2118 target.instanceTypes = [];
2119 }
2120
2121 if (!result) {
2122 if (this.getInstanceType() === target.constructor.getInstanceType()) {
2123 result = true;
2124 }
2125 }
2126
2127 if (result) {
2128 var name = this.getInstanceType === InstanceType.getInstanceType ? 'BaseInstanceType' : this.getInstanceType();
2129
2130 if (-1 === target.instanceTypes.indexOf(name)) {
2131 target.instanceTypes.push(name);
2132 }
2133 }
2134 }
2135
2136 if (!result && target) {
2137 // Check if the given 'target', is instance of known types.
2138 result = target.instanceTypes && Array.isArray(target.instanceTypes) && -1 !== target.instanceTypes.indexOf(this.getInstanceType());
2139 }
2140
2141 return result;
2142 }
2143 }, {
2144 key: "getInstanceType",
2145 value: function getInstanceType() {
2146 elementorModules.ForceMethodImplementation();
2147 }
2148 }]);
2149 return InstanceType;
2150 }(Symbol.hasInstance);
2151
2152 exports["default"] = InstanceType;
2153
2154 /***/ }),
2155
2156 /***/ "../assets/dev/js/modules/imports/module.js":
2157 /*!**************************************************!*\
2158 !*** ../assets/dev/js/modules/imports/module.js ***!
2159 \**************************************************/
2160 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2161
2162 "use strict";
2163
2164
2165 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
2166
2167 var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js"));
2168
2169 var Module = function Module() {
2170 var $ = jQuery,
2171 instanceParams = arguments,
2172 self = this,
2173 events = {};
2174 var settings;
2175
2176 var ensureClosureMethods = function ensureClosureMethods() {
2177 $.each(self, function (methodName) {
2178 var oldMethod = self[methodName];
2179
2180 if ('function' !== typeof oldMethod) {
2181 return;
2182 }
2183
2184 self[methodName] = function () {
2185 return oldMethod.apply(self, arguments);
2186 };
2187 });
2188 };
2189
2190 var initSettings = function initSettings() {
2191 settings = self.getDefaultSettings();
2192 var instanceSettings = instanceParams[0];
2193
2194 if (instanceSettings) {
2195 $.extend(true, settings, instanceSettings);
2196 }
2197 };
2198
2199 var init = function init() {
2200 self.__construct.apply(self, instanceParams);
2201
2202 ensureClosureMethods();
2203 initSettings();
2204 self.trigger('init');
2205 };
2206
2207 this.getItems = function (items, itemKey) {
2208 if (itemKey) {
2209 var keyStack = itemKey.split('.'),
2210 currentKey = keyStack.splice(0, 1);
2211
2212 if (!keyStack.length) {
2213 return items[currentKey];
2214 }
2215
2216 if (!items[currentKey]) {
2217 return;
2218 }
2219
2220 return this.getItems(items[currentKey], keyStack.join('.'));
2221 }
2222
2223 return items;
2224 };
2225
2226 this.getSettings = function (setting) {
2227 return this.getItems(settings, setting);
2228 };
2229
2230 this.setSettings = function (settingKey, value, settingsContainer) {
2231 if (!settingsContainer) {
2232 settingsContainer = settings;
2233 }
2234
2235 if ('object' === (0, _typeof2.default)(settingKey)) {
2236 $.extend(settingsContainer, settingKey);
2237 return self;
2238 }
2239
2240 var keyStack = settingKey.split('.'),
2241 currentKey = keyStack.splice(0, 1);
2242
2243 if (!keyStack.length) {
2244 settingsContainer[currentKey] = value;
2245 return self;
2246 }
2247
2248 if (!settingsContainer[currentKey]) {
2249 settingsContainer[currentKey] = {};
2250 }
2251
2252 return self.setSettings(keyStack.join('.'), value, settingsContainer[currentKey]);
2253 };
2254
2255 this.getErrorMessage = function (type, functionName) {
2256 var message;
2257
2258 switch (type) {
2259 case 'forceMethodImplementation':
2260 message = "The method '".concat(functionName, "' must to be implemented in the inheritor child.");
2261 break;
2262
2263 default:
2264 message = 'An error occurs';
2265 }
2266
2267 return message;
2268 }; // TODO: This function should be deleted ?.
2269
2270
2271 this.forceMethodImplementation = function (functionName) {
2272 throw new Error(this.getErrorMessage('forceMethodImplementation', functionName));
2273 };
2274
2275 this.on = function (eventName, callback) {
2276 if ('object' === (0, _typeof2.default)(eventName)) {
2277 $.each(eventName, function (singleEventName) {
2278 self.on(singleEventName, this);
2279 });
2280 return self;
2281 }
2282
2283 var eventNames = eventName.split(' ');
2284 eventNames.forEach(function (singleEventName) {
2285 if (!events[singleEventName]) {
2286 events[singleEventName] = [];
2287 }
2288
2289 events[singleEventName].push(callback);
2290 });
2291 return self;
2292 };
2293
2294 this.off = function (eventName, callback) {
2295 if (!events[eventName]) {
2296 return self;
2297 }
2298
2299 if (!callback) {
2300 delete events[eventName];
2301 return self;
2302 }
2303
2304 var callbackIndex = events[eventName].indexOf(callback);
2305
2306 if (-1 !== callbackIndex) {
2307 delete events[eventName][callbackIndex]; // Reset array index (for next off on same event).
2308
2309 events[eventName] = events[eventName].filter(function (val) {
2310 return val;
2311 });
2312 }
2313
2314 return self;
2315 };
2316
2317 this.trigger = function (eventName) {
2318 var methodName = 'on' + eventName[0].toUpperCase() + eventName.slice(1),
2319 params = Array.prototype.slice.call(arguments, 1);
2320
2321 if (self[methodName]) {
2322 self[methodName].apply(self, params);
2323 }
2324
2325 var callbacks = events[eventName];
2326
2327 if (!callbacks) {
2328 return self;
2329 }
2330
2331 $.each(callbacks, function (index, callback) {
2332 callback.apply(self, params);
2333 });
2334 return self;
2335 };
2336
2337 init();
2338 };
2339
2340 Module.prototype.__construct = function () {};
2341
2342 Module.prototype.getDefaultSettings = function () {
2343 return {};
2344 };
2345
2346 Module.prototype.getConstructorID = function () {
2347 return this.constructor.name;
2348 };
2349
2350 Module.extend = function (properties) {
2351 var $ = jQuery,
2352 parent = this;
2353
2354 var child = function child() {
2355 return parent.apply(this, arguments);
2356 };
2357
2358 $.extend(child, parent);
2359 child.prototype = Object.create($.extend({}, parent.prototype, properties));
2360 child.prototype.constructor = child;
2361 child.__super__ = parent.prototype;
2362 return child;
2363 };
2364
2365 module.exports = Module;
2366
2367 /***/ }),
2368
2369 /***/ "../modules/web-cli/assets/js/api.js":
2370 /*!*******************************************!*\
2371 !*** ../modules/web-cli/assets/js/api.js ***!
2372 \*******************************************/
2373 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
2374
2375 "use strict";
2376
2377
2378 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
2379
2380 var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js");
2381
2382 Object.defineProperty(exports, "__esModule", ({
2383 value: true
2384 }));
2385 exports["default"] = void 0;
2386
2387 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
2388
2389 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
2390
2391 var _backwardsCompatibility = _interopRequireDefault(__webpack_require__(/*! ./core/backwards-compatibility */ "../modules/web-cli/assets/js/core/backwards-compatibility.js"));
2392
2393 var _commandBase = _interopRequireDefault(__webpack_require__(/*! ./modules/command-base */ "../modules/web-cli/assets/js/modules/command-base.js"));
2394
2395 var _commandInternalBase = _interopRequireDefault(__webpack_require__(/*! ./modules/command-internal-base */ "../modules/web-cli/assets/js/modules/command-internal-base.js"));
2396
2397 var _commandData = _interopRequireDefault(__webpack_require__(/*! ./modules/command-data */ "../modules/web-cli/assets/js/modules/command-data.js"));
2398
2399 var _commands = _interopRequireDefault(__webpack_require__(/*! ./core/commands */ "../modules/web-cli/assets/js/core/commands.js"));
2400
2401 var _commandsInternal = _interopRequireDefault(__webpack_require__(/*! ./core/commands-internal */ "../modules/web-cli/assets/js/core/commands-internal.js"));
2402
2403 var _componentBase = _interopRequireDefault(__webpack_require__(/*! ./modules/component-base */ "../modules/web-cli/assets/js/modules/component-base.js"));
2404
2405 var _componentModalBase = _interopRequireDefault(__webpack_require__(/*! ./modules/component-modal-base */ "../modules/web-cli/assets/js/modules/component-modal-base.js"));
2406
2407 var _components = _interopRequireDefault(__webpack_require__(/*! ./core/components */ "../modules/web-cli/assets/js/core/components.js"));
2408
2409 var _data = _interopRequireDefault(__webpack_require__(/*! ./core/data.js */ "../modules/web-cli/assets/js/core/data.js"));
2410
2411 var _hashCommands = _interopRequireDefault(__webpack_require__(/*! ./extras/hash-commands */ "../modules/web-cli/assets/js/extras/hash-commands.js"));
2412
2413 var _hookBreak = _interopRequireDefault(__webpack_require__(/*! ./modules/hook-break */ "../modules/web-cli/assets/js/modules/hook-break.js"));
2414
2415 var _hooks = _interopRequireDefault(__webpack_require__(/*! ./core/hooks */ "../modules/web-cli/assets/js/core/hooks.js"));
2416
2417 var _routes = _interopRequireDefault(__webpack_require__(/*! ./core/routes */ "../modules/web-cli/assets/js/core/routes.js"));
2418
2419 var _shortcuts = _interopRequireDefault(__webpack_require__(/*! ./core/shortcuts */ "../modules/web-cli/assets/js/core/shortcuts.js"));
2420
2421 var _store = _interopRequireDefault(__webpack_require__(/*! ./core/store */ "../modules/web-cli/assets/js/core/store.js"));
2422
2423 var _uiStates = _interopRequireDefault(__webpack_require__(/*! ./core/ui-states */ "../modules/web-cli/assets/js/core/ui-states.js"));
2424
2425 var hookData = _interopRequireWildcard(__webpack_require__(/*! ./modules/hooks/data/ */ "../modules/web-cli/assets/js/modules/hooks/data/index.js"));
2426
2427 var hookUI = _interopRequireWildcard(__webpack_require__(/*! ./modules/hooks/ui */ "../modules/web-cli/assets/js/modules/hooks/ui/index.js"));
2428
2429 function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
2430
2431 function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
2432
2433 /* Alphabetical order */
2434 var API = /*#__PURE__*/function () {
2435 /**
2436 * Function constructor().
2437 *
2438 * Create's 'elementor' api.
2439 */
2440 function API() {
2441 (0, _classCallCheck2.default)(this, API);
2442 this.components = new _components.default();
2443 this.commands = new _commands.default();
2444 this.commandsInternal = new _commandsInternal.default();
2445 this.hooks = new _hooks.default();
2446 this.routes = new _routes.default();
2447 this.shortcuts = new _shortcuts.default(jQuery(window));
2448 this.data = new _data.default();
2449 this.store = new _store.default();
2450 this.uiStates = new _uiStates.default();
2451 this.modules = {
2452 CommandBase: _commandBase.default,
2453 CommandInternalBase: _commandInternalBase.default,
2454 CommandData: _commandData.default,
2455 ComponentBase: _componentBase.default,
2456 ComponentModalBase: _componentModalBase.default,
2457 HookBreak: _hookBreak.default,
2458 hookData: hookData,
2459 hookUI: hookUI
2460 };
2461 this.extras = {
2462 hashCommands: new _hashCommands.default()
2463 }; // Backwards compatibility should be last, in order to handle others.
2464
2465 this.bc = new _backwardsCompatibility.default();
2466 }
2467 /**
2468 * Function run().
2469 *
2470 * Alias of `$e.commands.run()`.
2471 *
2472 * @param {string} command
2473 * @param {*} [args={}]
2474 *
2475 * @return {*} result
2476 */
2477
2478
2479 (0, _createClass2.default)(API, [{
2480 key: "run",
2481 value: function run(command) {
2482 var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2483 return $e.commands.run(command, args);
2484 }
2485 /**
2486 * Function internal().
2487 *
2488 * Alias of `$e.commandsInternal.run()`.
2489 *
2490 * @param {string} command
2491 * @param {*} [args={}]
2492 *
2493 * @return {boolean} result
2494 */
2495
2496 }, {
2497 key: "internal",
2498 value: function internal(command) {
2499 var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2500 return $e.commandsInternal.run(command, args);
2501 }
2502 /**
2503 * Function route().
2504 *
2505 * Alias of `$e.routes.to()`.
2506 *
2507 * @param {string} route
2508 * @param {*} [args={}]
2509 */
2510
2511 }, {
2512 key: "route",
2513 value: function route(_route) {
2514 var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2515 return $e.routes.to(_route, args);
2516 } // TODO: shortcut();
2517
2518 }]);
2519 return API;
2520 }();
2521
2522 exports["default"] = API;
2523
2524 /***/ }),
2525
2526 /***/ "../modules/web-cli/assets/js/core/backwards-compatibility.js":
2527 /*!********************************************************************!*\
2528 !*** ../modules/web-cli/assets/js/core/backwards-compatibility.js ***!
2529 \********************************************************************/
2530 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
2531
2532 "use strict";
2533
2534
2535 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
2536
2537 Object.defineProperty(exports, "__esModule", ({
2538 value: true
2539 }));
2540 exports["default"] = void 0;
2541
2542 var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
2543
2544 var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
2545
2546 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
2547
2548 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
2549
2550 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
2551
2552 var _componentBase = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/component-base */ "../modules/web-cli/assets/js/modules/component-base.js"));
2553
2554 function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
2555
2556 function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
2557
2558 var BackwardsCompatibility = /*#__PURE__*/function () {
2559 function BackwardsCompatibility() {
2560 (0, _classCallCheck2.default)(this, BackwardsCompatibility);
2561 }
2562
2563 (0, _createClass2.default)(BackwardsCompatibility, [{
2564 key: "ensureTab",
2565 value: function ensureTab(namespace, tabSlug) {
2566 var page = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
2567 var component = $e.components.get(namespace);
2568
2569 if (!component) {
2570 var Component = /*#__PURE__*/function (_ComponentBase) {
2571 (0, _inherits2.default)(Component, _ComponentBase);
2572
2573 var _super = _createSuper(Component);
2574
2575 function Component() {
2576 (0, _classCallCheck2.default)(this, Component);
2577 return _super.apply(this, arguments);
2578 }
2579
2580 (0, _createClass2.default)(Component, [{
2581 key: "getNamespace",
2582 value: function getNamespace() {
2583 return namespace;
2584 }
2585 }, {
2586 key: "renderTab",
2587 value: function renderTab(tab) {
2588 elementor.getPanelView().setPage(page).activateTab(tab);
2589 }
2590 }]);
2591 return Component;
2592 }(_componentBase.default);
2593
2594 component = $e.components.register(new Component());
2595 }
2596
2597 if (!component.hasTab(tabSlug) && elementor.config.tabs[tabSlug]) {
2598 component.addTab(tabSlug, {
2599 title: elementor.config.tabs[tabSlug]
2600 });
2601 }
2602 }
2603 }]);
2604 return BackwardsCompatibility;
2605 }();
2606
2607 exports["default"] = BackwardsCompatibility;
2608
2609 /***/ }),
2610
2611 /***/ "../modules/web-cli/assets/js/core/backwards-compatibility/commands.js":
2612 /*!*****************************************************************************!*\
2613 !*** ../modules/web-cli/assets/js/core/backwards-compatibility/commands.js ***!
2614 \*****************************************************************************/
2615 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
2616
2617 "use strict";
2618
2619
2620 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
2621
2622 Object.defineProperty(exports, "__esModule", ({
2623 value: true
2624 }));
2625 exports["default"] = void 0;
2626
2627 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
2628
2629 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
2630
2631 var _assertThisInitialized2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ "../node_modules/@babel/runtime/helpers/assertThisInitialized.js"));
2632
2633 var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
2634
2635 var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
2636
2637 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
2638
2639 var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
2640
2641 var _helpers = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/helpers */ "../modules/web-cli/assets/js/utils/helpers.js"));
2642
2643 var _module = _interopRequireDefault(__webpack_require__(/*! elementor-assets-js/modules/imports/module.js */ "../assets/dev/js/modules/imports/module.js"));
2644
2645 function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
2646
2647 function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
2648
2649 var CommandsBackwardsCompatibility = /*#__PURE__*/function (_Module) {
2650 (0, _inherits2.default)(CommandsBackwardsCompatibility, _Module);
2651
2652 var _super = _createSuper(CommandsBackwardsCompatibility);
2653
2654 function CommandsBackwardsCompatibility() {
2655 var _this;
2656
2657 (0, _classCallCheck2.default)(this, CommandsBackwardsCompatibility);
2658
2659 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
2660 args[_key] = arguments[_key];
2661 }
2662
2663 _this = _super.call.apply(_super, [this].concat(args));
2664 (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "on", function (eventName, callback) {
2665 if ('run' === eventName) {
2666 var componentName = _this.getConstructorID(); // Regex takes the first letter and convert it to lower case.
2667
2668
2669 componentName = componentName.replace(/^./, function (val) {
2670 return val.toLowerCase();
2671 });
2672
2673 _helpers.default.softDeprecated("$e.".concat(componentName, ".on( 'run', ... )"), '3.0.0', "$e.".concat(componentName, ".on( 'run:before', ... )"));
2674
2675 _this.onOrig('run:before', callback);
2676
2677 return;
2678 }
2679
2680 _this.onOrig(eventName, callback);
2681 });
2682 return _this;
2683 }
2684
2685 (0, _createClass2.default)(CommandsBackwardsCompatibility, [{
2686 key: "__construct",
2687 value: function __construct() {
2688 this.onOrig = this.on;
2689 }
2690 }]);
2691 return CommandsBackwardsCompatibility;
2692 }(_module.default);
2693
2694 exports["default"] = CommandsBackwardsCompatibility;
2695
2696 /***/ }),
2697
2698 /***/ "../modules/web-cli/assets/js/core/commands-internal.js":
2699 /*!**************************************************************!*\
2700 !*** ../modules/web-cli/assets/js/core/commands-internal.js ***!
2701 \**************************************************************/
2702 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
2703
2704 "use strict";
2705
2706
2707 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
2708
2709 Object.defineProperty(exports, "__esModule", ({
2710 value: true
2711 }));
2712 exports["default"] = void 0;
2713
2714 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
2715
2716 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
2717
2718 var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
2719
2720 var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
2721
2722 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
2723
2724 var _commands = _interopRequireDefault(__webpack_require__(/*! ./commands.js */ "../modules/web-cli/assets/js/core/commands.js"));
2725
2726 function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
2727
2728 function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
2729
2730 var CommandsInternal = /*#__PURE__*/function (_Commands) {
2731 (0, _inherits2.default)(CommandsInternal, _Commands);
2732
2733 var _super = _createSuper(CommandsInternal);
2734
2735 function CommandsInternal() {
2736 (0, _classCallCheck2.default)(this, CommandsInternal);
2737 return _super.apply(this, arguments);
2738 }
2739
2740 (0, _createClass2.default)(CommandsInternal, [{
2741 key: "error",
2742 value: function error(message) {
2743 throw Error('Commands internal: ' + message);
2744 }
2745 }]);
2746 return CommandsInternal;
2747 }(_commands.default);
2748
2749 exports["default"] = CommandsInternal;
2750
2751 /***/ }),
2752
2753 /***/ "../modules/web-cli/assets/js/core/commands.js":
2754 /*!*****************************************************!*\
2755 !*** ../modules/web-cli/assets/js/core/commands.js ***!
2756 \*****************************************************/
2757 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
2758
2759 "use strict";
2760
2761
2762 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
2763
2764 Object.defineProperty(exports, "__esModule", ({
2765 value: true
2766 }));
2767 exports["default"] = void 0;
2768
2769 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
2770
2771 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
2772
2773 var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
2774
2775 var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
2776
2777 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
2778
2779 var _commands = _interopRequireDefault(__webpack_require__(/*! ./backwards-compatibility/commands */ "../modules/web-cli/assets/js/core/backwards-compatibility/commands.js"));
2780
2781 function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
2782
2783 function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
2784
2785 /**
2786 * @typedef {import('../modules/component-base')} ComponentBase
2787 */
2788
2789 /**
2790 * @typedef {import('../modules/command-base')} CommandBase
2791 */
2792
2793 /**
2794 * @typedef {{}} Component
2795 */
2796 var Commands = /*#__PURE__*/function (_CommandsBackwardsCom) {
2797 (0, _inherits2.default)(Commands, _CommandsBackwardsCom);
2798
2799 var _super = _createSuper(Commands);
2800
2801 /**
2802 * Function constructor().
2803 *
2804 * Create `$e.commands` API.
2805 *
2806 * @param {{}} args
2807 */
2808 function Commands() {
2809 var _this;
2810
2811 (0, _classCallCheck2.default)(this, Commands);
2812
2813 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
2814 args[_key] = arguments[_key];
2815 }
2816
2817 _this = _super.call.apply(_super, [this].concat(args));
2818 _this.current = {};
2819 _this.currentArgs = {};
2820 _this.currentTrace = [];
2821 _this.commands = {};
2822 _this.components = {};
2823 _this.classes = {};
2824 return _this;
2825 }
2826 /**
2827 * @param {string} id
2828 * @return {CommandBase} command class
2829 */
2830
2831
2832 (0, _createClass2.default)(Commands, [{
2833 key: "getCommandClass",
2834 value: function getCommandClass(id) {
2835 return this.classes[id];
2836 }
2837 /**
2838 * Function getAll().
2839 *
2840 * Receive all loaded commands.
2841 *
2842 * @return {string[]} commands
2843 */
2844
2845 }, {
2846 key: "getAll",
2847 value: function getAll() {
2848 return Object.keys(this.commands).sort();
2849 }
2850 /**
2851 * Function register().
2852 *
2853 * Register new command.
2854 *
2855 * @param {ComponentBase|string} component
2856 * @param {string} command
2857 * @param {Function} callback
2858 *
2859 * @return {Commands} commands
2860 */
2861
2862 }, {
2863 key: "register",
2864 value: function register(component, command, callback) {
2865 var _this2 = this;
2866
2867 var namespace;
2868
2869 if ('string' === typeof component) {
2870 namespace = component;
2871 component = $e.components.get(namespace);
2872
2873 if (!component) {
2874 this.error("'".concat(namespace, "' component is not exist."));
2875 }
2876 } else {
2877 namespace = component.getNamespace();
2878 }
2879
2880 var fullCommand = namespace + (command ? '/' + command : '');
2881
2882 if (this.commands[fullCommand]) {
2883 this.error("`".concat(fullCommand, "` is already registered."));
2884 }
2885
2886 this.commands[fullCommand] = callback;
2887 this.components[fullCommand] = namespace;
2888 var shortcuts = component.getShortcuts(),
2889 shortcut = shortcuts[command];
2890
2891 if (shortcut) {
2892 shortcut.command = fullCommand;
2893
2894 shortcut.callback = function (event) {
2895 return _this2.runShortcut(fullCommand, event);
2896 };
2897
2898 $e.shortcuts.register(shortcut.keys, shortcut);
2899 }
2900
2901 return this;
2902 }
2903 }, {
2904 key: "unregister",
2905 value: function unregister(component, command) {
2906 var namespace;
2907
2908 if ('string' === typeof component) {
2909 namespace = component;
2910 component = $e.components.get(namespace);
2911
2912 if (!component) {
2913 this.error("'".concat(namespace, "' component is not exist."));
2914 }
2915 } else {
2916 namespace = component.getNamespace();
2917 }
2918
2919 var fullCommand = namespace + (command ? '/' + command : '');
2920
2921 if (!this.commands[fullCommand]) {
2922 this.error("`".concat(fullCommand, "` not exist."));
2923 }
2924
2925 delete this.commands[fullCommand];
2926 delete this.components[fullCommand];
2927 var shortcuts = component.getShortcuts(),
2928 shortcut = shortcuts[command];
2929
2930 if (shortcut) {
2931 $e.shortcuts.unregister(shortcut.keys, shortcut);
2932 }
2933
2934 return this;
2935 }
2936 /**
2937 * Function getComponent().
2938 *
2939 * Receive Component of the command.
2940 *
2941 * @param {string} command
2942 *
2943 * @return {Component} component
2944 */
2945
2946 }, {
2947 key: "getComponent",
2948 value: function getComponent(command) {
2949 var namespace = this.components[command];
2950 return $e.components.get(namespace);
2951 }
2952 /**
2953 * Function is().
2954 *
2955 * Checks if current running command is the same parameter command.
2956 *
2957 * @param {string} command
2958 *
2959 * @return {boolean} is this command the same as the one passed in the arguments
2960 */
2961
2962 }, {
2963 key: "is",
2964 value: function is(command) {
2965 var component = this.getComponent(command);
2966
2967 if (!component) {
2968 return false;
2969 }
2970
2971 return command === this.current[component.getRootContainer()];
2972 }
2973 /**
2974 * Function isCurrentFirstTrace().
2975 *
2976 * Checks if parameter command is the first command in trace that currently running.
2977 *
2978 * @param {string} command
2979 *
2980 * @return {boolean} is parameter command the first command in trace that currently running
2981 */
2982
2983 }, {
2984 key: "isCurrentFirstTrace",
2985 value: function isCurrentFirstTrace(command) {
2986 return command === this.getCurrentFirstTrace();
2987 }
2988 /**
2989 * Function getCurrent().
2990 *
2991 * Receive currently running components and its commands.
2992 *
2993 * @param {string} container
2994 *
2995 * @return {{}|boolean|*} currently running components
2996 */
2997
2998 }, {
2999 key: "getCurrent",
3000 value: function getCurrent() {
3001 var container = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
3002
3003 if (container) {
3004 if (!this.current[container]) {
3005 return false;
3006 }
3007
3008 return this.current[container];
3009 }
3010
3011 return this.current;
3012 }
3013 /**
3014 * Function getCurrentArgs().
3015 *
3016 * Receive currently running command args.
3017 *
3018 * @param {string} container
3019 *
3020 * @return {{}|boolean|*} current arguments
3021 */
3022
3023 }, {
3024 key: "getCurrentArgs",
3025 value: function getCurrentArgs() {
3026 var container = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
3027
3028 if (container) {
3029 if (!this.currentArgs[container]) {
3030 return false;
3031 }
3032
3033 return this.currentArgs[container];
3034 }
3035
3036 return this.currentArgs;
3037 }
3038 /**
3039 * Function getCurrentFirst().
3040 *
3041 * Receive first command that currently running.
3042 *
3043 * @return {string} first running command
3044 */
3045
3046 }, {
3047 key: "getCurrentFirst",
3048 value: function getCurrentFirst() {
3049 return Object.values(this.current)[0];
3050 }
3051 /**
3052 * Function getCurrentLast().
3053 *
3054 * Receive last command that currently running.
3055 *
3056 * @return {string} last running command
3057 */
3058
3059 }, {
3060 key: "getCurrentLast",
3061 value: function getCurrentLast() {
3062 var current = Object.values(this.current);
3063 return current[current.length - 1];
3064 }
3065 /**
3066 * Function getCurrentFirstTrace().
3067 *
3068 * Receive first command in trace that currently running
3069 *
3070 * @return {string} first command in trace
3071 */
3072
3073 }, {
3074 key: "getCurrentFirstTrace",
3075 value: function getCurrentFirstTrace() {
3076 return this.currentTrace[0];
3077 }
3078 /**
3079 * Function beforeRun().
3080 *
3081 * @param {string} command
3082 * @param {*} args
3083 *
3084 * @return {boolean} dependency result
3085 */
3086
3087 }, {
3088 key: "beforeRun",
3089 value: function beforeRun(command) {
3090 var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
3091
3092 if (!this.commands[command]) {
3093 this.error("`".concat(command, "` not found."));
3094 }
3095
3096 this.currentTrace.push(command);
3097 return this.getComponent(command).dependency(command, args);
3098 }
3099 /**
3100 * Function run().
3101 *
3102 * Runs a command.
3103 *
3104 * @param {string} command
3105 * @param {{}} args
3106 *
3107 * @return {boolean|*} results
3108 */
3109
3110 }, {
3111 key: "run",
3112 value: function run(command) {
3113 var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
3114
3115 if (!this.beforeRun(command, args)) {
3116 return false;
3117 }
3118
3119 var component = this.getComponent(command),
3120 container = component.getRootContainer();
3121 this.current[container] = command;
3122 this.currentArgs[container] = args;
3123 this.trigger('run:before', component, command, args);
3124
3125 if (args.onBefore) {
3126 args.onBefore.apply(component, [args]);
3127 }
3128
3129 var results = this.commands[command].apply(component, [args]); // TODO: Consider add results to `$e.devTools`.
3130
3131 if (args.onAfter) {
3132 args.onAfter.apply(component, [args, results]);
3133 }
3134
3135 this.trigger('run:after', component, command, args, results);
3136 this.afterRun(command);
3137
3138 if (false === args.returnValue) {
3139 return true;
3140 }
3141
3142 return results;
3143 }
3144 /**
3145 * Function runShortcut().
3146 *
3147 * Run shortcut.
3148 *
3149 * It's separated in order to allow override.
3150 *
3151 * @param {string} command
3152 * @param {*} event
3153 *
3154 * @return {boolean|*} result
3155 */
3156
3157 }, {
3158 key: "runShortcut",
3159 value: function runShortcut(command, event) {
3160 return this.run(command, event);
3161 }
3162 /**
3163 * Function afterRun().
3164 *
3165 * Method fired after the command runs.
3166 *
3167 * @param {string} command
3168 */
3169
3170 }, {
3171 key: "afterRun",
3172 value: function afterRun(command) {
3173 var component = this.getComponent(command),
3174 container = component.getRootContainer();
3175 this.currentTrace.pop();
3176 delete this.current[container];
3177 delete this.currentArgs[container];
3178 }
3179 /**
3180 * Function error().
3181 *
3182 * Throws error.
3183 *
3184 * @throws {Error}
3185 *
3186 * @param {string} message
3187 */
3188
3189 }, {
3190 key: "error",
3191 value: function error(message) {
3192 throw Error("Commands: ".concat(message));
3193 }
3194 }]);
3195 return Commands;
3196 }(_commands.default);
3197
3198 exports["default"] = Commands;
3199
3200 /***/ }),
3201
3202 /***/ "../modules/web-cli/assets/js/core/components.js":
3203 /*!*******************************************************!*\
3204 !*** ../modules/web-cli/assets/js/core/components.js ***!
3205 \*******************************************************/
3206 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
3207
3208 "use strict";
3209
3210
3211 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
3212
3213 Object.defineProperty(exports, "__esModule", ({
3214 value: true
3215 }));
3216 exports["default"] = void 0;
3217
3218 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
3219
3220 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
3221
3222 var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
3223
3224 var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
3225
3226 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
3227
3228 var _module = _interopRequireDefault(__webpack_require__(/*! elementor-assets-js/modules/imports/module.js */ "../assets/dev/js/modules/imports/module.js"));
3229
3230 function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
3231
3232 function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
3233
3234 /**
3235 * @typedef {{}} Component
3236 */
3237 var _default = /*#__PURE__*/function (_Module) {
3238 (0, _inherits2.default)(_default, _Module);
3239
3240 var _super = _createSuper(_default);
3241
3242 function _default() {
3243 var _this;
3244
3245 (0, _classCallCheck2.default)(this, _default);
3246
3247 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
3248 args[_key] = arguments[_key];
3249 }
3250
3251 _this = _super.call.apply(_super, [this].concat(args));
3252 _this.components = {};
3253 _this.activeComponents = {};
3254 return _this;
3255 }
3256
3257 (0, _createClass2.default)(_default, [{
3258 key: "getAll",
3259 value: function getAll() {
3260 return Object.keys(this.components).sort();
3261 }
3262 }, {
3263 key: "register",
3264 value: function register(component) {
3265 if (this.components[component.getNamespace()]) {
3266 return;
3267 }
3268
3269 component.registerAPI();
3270 this.components[component.getNamespace()] = component;
3271 return component;
3272 }
3273 /**
3274 * @param {string} id
3275 * @return {Component} component
3276 */
3277
3278 }, {
3279 key: "get",
3280 value: function get(id) {
3281 return this.components[id];
3282 }
3283 }, {
3284 key: "getActive",
3285 value: function getActive() {
3286 return this.activeComponents;
3287 }
3288 }, {
3289 key: "activate",
3290 value: function activate(namespace) {
3291 // Add as last.
3292 this.inactivate(namespace);
3293 this.activeComponents[namespace] = true;
3294 }
3295 }, {
3296 key: "inactivate",
3297 value: function inactivate(namespace) {
3298 delete this.activeComponents[namespace];
3299 }
3300 }, {
3301 key: "isActive",
3302 value: function isActive(namespace) {
3303 return !!this.activeComponents[namespace];
3304 }
3305 }]);
3306 return _default;
3307 }(_module.default);
3308
3309 exports["default"] = _default;
3310
3311 /***/ }),
3312
3313 /***/ "../modules/web-cli/assets/js/core/data.js":
3314 /*!*************************************************!*\
3315 !*** ../modules/web-cli/assets/js/core/data.js ***!
3316 \*************************************************/
3317 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
3318
3319 "use strict";
3320
3321
3322 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
3323
3324 Object.defineProperty(exports, "__esModule", ({
3325 value: true
3326 }));
3327 exports["default"] = exports.READABLE = exports.EDITABLE = exports.DELETABLE = exports.CREATABLE = exports.ALLMETHODS = void 0;
3328
3329 var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ "../node_modules/@babel/runtime/regenerator/index.js"));
3330
3331 var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "../node_modules/@babel/runtime/helpers/asyncToGenerator.js"));
3332
3333 var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js"));
3334
3335 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
3336
3337 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
3338
3339 var _assertThisInitialized2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ "../node_modules/@babel/runtime/helpers/assertThisInitialized.js"));
3340
3341 var _get2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/get */ "../node_modules/@babel/runtime/helpers/get.js"));
3342
3343 var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
3344
3345 var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
3346
3347 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
3348
3349 var _argsObject = _interopRequireDefault(__webpack_require__(/*! elementor-assets-js/modules/imports/args-object */ "../assets/dev/js/modules/imports/args-object.js"));
3350
3351 var _commands = _interopRequireDefault(__webpack_require__(/*! ./commands.js */ "../modules/web-cli/assets/js/core/commands.js"));
3352
3353 var _cache = _interopRequireDefault(__webpack_require__(/*! ./data/cache */ "../modules/web-cli/assets/js/core/data/cache.js"));
3354
3355 function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
3356
3357 function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
3358
3359 /**
3360 * @typedef {('create'|'delete'|'get'|'update'|'options')} DataTypes
3361 */
3362
3363 /**
3364 * @typedef {import('../modules/component-base')} ComponentBase
3365 */
3366
3367 /**
3368 * @typedef {{}} RequestInfo
3369 */
3370
3371 /**
3372 * @typedef {{}} RequestData
3373 * @property {ComponentBase} component component
3374 * @property {string} command command
3375 * @property {{}} args arguments
3376 * @property {DataTypes} type type
3377 * @property {number} timestamp timestamp
3378 * @property {string} endpoint endpoint
3379 *
3380 * @property {string} [baseEndpointURL] baseEndpointURL
3381 * @property {string} [namespace] namespace
3382 * @property {string} [version] version
3383 * @property {('hit'|'miss')} [cache] cache
3384 */
3385
3386 /**
3387 * @typedef {Object} ExtractedCommand
3388 * @property {string} command command
3389 * @property {Object} args arguments
3390 */
3391 // TODO: Return it from the server. Original at WP_REST_Server.
3392 var READABLE = ['GET'],
3393 CREATABLE = ['POST'],
3394 EDITABLE = ['POST', 'PUT', 'PATCH'],
3395 DELETABLE = ['DELETE'],
3396 ALLMETHODS = ['GET', 'POST', 'PUT', 'PATCH', 'DELETE'];
3397 exports.ALLMETHODS = ALLMETHODS;
3398 exports.DELETABLE = DELETABLE;
3399 exports.EDITABLE = EDITABLE;
3400 exports.CREATABLE = CREATABLE;
3401 exports.READABLE = READABLE;
3402
3403 var Data = /*#__PURE__*/function (_Commands) {
3404 (0, _inherits2.default)(Data, _Commands);
3405
3406 var _super = _createSuper(Data);
3407
3408 function Data() {
3409 var _this;
3410
3411 var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
3412 (0, _classCallCheck2.default)(this, Data);
3413 _this = _super.call(this, args);
3414 _this.args = Object.assign(args, {
3415 namespace: 'elementor',
3416 version: '1',
3417 baseEndpointURL: elementorWebCliConfig.urls.rest
3418 });
3419 _this.cache = new _cache.default((0, _assertThisInitialized2.default)(_this));
3420 _this.validatedRequests = {};
3421 _this.commandFormats = {};
3422 return _this;
3423 }
3424 /**
3425 * Function getHTTPMethod().
3426 *
3427 * Returns HTTP Method by type.
3428 *
3429 * @param {DataTypes} type
3430 *
3431 * @return {string|boolean} HTTP Method
3432 */
3433
3434
3435 (0, _createClass2.default)(Data, [{
3436 key: "getHTTPMethod",
3437 value: function getHTTPMethod(type) {
3438 switch (type) {
3439 case 'create':
3440 return 'POST';
3441
3442 case 'delete':
3443 return 'DELETE';
3444
3445 case 'get':
3446 return 'GET';
3447
3448 case 'update':
3449 return 'PUT';
3450
3451 case 'options':
3452 return 'OPTIONS';
3453 }
3454
3455 return false;
3456 }
3457 /**
3458 * Function getAllowedMethods().
3459 *
3460 * Returns allowed HTTP methods by type.
3461 *
3462 * @param {DataTypes} type
3463 *
3464 * @return {[string]|boolean} allowed HTTP methods
3465 */
3466
3467 }, {
3468 key: "getAllowedMethods",
3469 value: function getAllowedMethods(type) {
3470 switch (type) {
3471 case 'create':
3472 return CREATABLE;
3473
3474 case 'delete':
3475 return DELETABLE;
3476
3477 case 'get':
3478 return READABLE;
3479
3480 case 'update':
3481 return EDITABLE;
3482
3483 case 'options':
3484 return ['OPTIONS'];
3485 }
3486
3487 return false;
3488 }
3489 /**
3490 * Function getEndpointURL().
3491 *
3492 * Get remote endpoint address.
3493 *
3494 * @param {RequestData} requestData
3495 * @param {string} [endpoint=requestData.endpoint]
3496 *
3497 * @return {string} endpoint address
3498 */
3499
3500 }, {
3501 key: "getEndpointURL",
3502 value: function getEndpointURL(requestData) {
3503 var endpoint = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : requestData.endpoint;
3504 // Allow to request data override default namespace and args.
3505 var _requestData$baseEndp = requestData.baseEndpointURL,
3506 baseEndpointURL = _requestData$baseEndp === void 0 ? this.args.baseEndpointURL : _requestData$baseEndp,
3507 _requestData$namespac = requestData.namespace,
3508 namespace = _requestData$namespac === void 0 ? this.args.namespace : _requestData$namespac,
3509 _requestData$version = requestData.version,
3510 version = _requestData$version === void 0 ? this.args.version : _requestData$version;
3511 return "".concat(baseEndpointURL).concat(namespace, "/v").concat(version, "/") + endpoint;
3512 }
3513 /**
3514 * Function commandToEndpoint().
3515 *
3516 * Convert command to endpoint.
3517 *
3518 * For example `component/command/{arg}` => `controller/endpoint/8`.
3519 *
3520 * TODO: Find a better solution.
3521 *
3522 * @param {string} command
3523 * @param {{}} args
3524 * @param {string|null} [format]
3525 *
3526 * @return {string} endpoint
3527 */
3528
3529 }, {
3530 key: "commandToEndpoint",
3531 value: function commandToEndpoint(command, args) {
3532 var format = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
3533 var endpoint = command;
3534 var argsQueryLength = args !== null && args !== void 0 && args.query ? Object.values(args.query).length : 0;
3535
3536 if (argsQueryLength && format && format.includes('/{')) {
3537 // Means command includes magic query arguments ( controller/endpoint/{whatever} ).
3538 var magicParams = format.split('/').filter(function (str) {
3539 return '{' === str.charAt(0);
3540 });
3541 magicParams.forEach(function (param) {
3542 // Remove the '{', '}'.
3543 param = param.replace('{', '');
3544 param = param.replace('}', '');
3545 var formatted = Object.entries(args.query).find(function (_ref) {
3546 var _ref2 = (0, _slicedToArray2.default)(_ref, 1),
3547 key = _ref2[0];
3548
3549 return key === param;
3550 });
3551
3552 if (!formatted) {
3553 return;
3554 }
3555
3556 var key = formatted[0],
3557 value = formatted[1].toString(); // Replace magic params with values.
3558
3559 format = format.replace(new RegExp('{' + param + '}', 'g'), value);
3560 delete args.query[key];
3561 });
3562 }
3563
3564 if (format) {
3565 endpoint = format;
3566 } // If requested magic param does not exist in args, need to remove it to have fixed endpoint.
3567 // eg: 'documents/{documentId}/elements/{elementId}' and args { documentId: 4123 }.
3568 // result: 'documents/4123/elements'
3569
3570
3571 if (format && endpoint.includes('/{')) {
3572 endpoint = endpoint.substring(0, endpoint.indexOf('/{'));
3573 }
3574
3575 if (args.query && Object.values(args.query).length) {
3576 // Sorting since the endpoint later will be used as key to store the cache.
3577 var queryEntries = Object.entries(args.query).sort(function (_ref3, _ref4) {
3578 var _ref5 = (0, _slicedToArray2.default)(_ref3, 1),
3579 aKey = _ref5[0];
3580
3581 var _ref6 = (0, _slicedToArray2.default)(_ref4, 1),
3582 bKey = _ref6[0];
3583
3584 return aKey - bKey;
3585 } // Sort by param name.
3586 ); // `args.query` will become a part of GET params.
3587
3588 if (queryEntries.length) {
3589 endpoint += '?';
3590 queryEntries.forEach(function (_ref7) {
3591 var _ref8 = (0, _slicedToArray2.default)(_ref7, 2),
3592 name = _ref8[0],
3593 value = _ref8[1];
3594
3595 // Replace the character '/' with the encoded version,
3596 // mostly because when saving this endpoint value to the cache it splits the url base on the '/' character.
3597 value = "".concat(value).replace(/\//g, '%2F');
3598 endpoint += name + '=' + value + '&';
3599 });
3600 } // If last character is '&' remove it.
3601
3602
3603 endpoint = endpoint.replace(/&$/, '');
3604 }
3605
3606 return endpoint;
3607 }
3608 /**
3609 * Function commandExtractArgs().
3610 *
3611 * If the command have query convert it to args.
3612 *
3613 * @param {string} command
3614 * @param {Object} args
3615 *
3616 * @return {ExtractedCommand} command
3617 */
3618
3619 }, {
3620 key: "commandExtractArgs",
3621 value: function commandExtractArgs(command) {
3622 var _command;
3623
3624 var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
3625
3626 if ((_command = command) !== null && _command !== void 0 && _command.includes('?')) {
3627 if (!args.query) {
3628 args.query = {};
3629 }
3630
3631 var commandParts = command.split('?'),
3632 pureCommand = commandParts[0],
3633 queryString = commandParts[1],
3634 query = new URLSearchParams(queryString);
3635 Object.assign(args.query, Object.fromEntries(query));
3636 command = pureCommand;
3637 }
3638
3639 return {
3640 command: command,
3641 args: args
3642 };
3643 }
3644 /**
3645 * Function validateRequestData().
3646 *
3647 * Validate request data requirements.
3648 *
3649 * @param {RequestData} requestData
3650 * @param {boolean} [requireArgsData]
3651 */
3652
3653 }, {
3654 key: "validateRequestData",
3655 value: function validateRequestData(requestData) {
3656 var requireArgsData = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
3657
3658 // Do not validate if its already valid.
3659 if (requestData.timestamp && this.validatedRequests[requestData.timestamp]) {
3660 return;
3661 }
3662
3663 var argsObject = new _argsObject.default(requestData);
3664 argsObject.requireArgument('component');
3665 argsObject.requireArgumentType('command', 'string');
3666 argsObject.requireArgumentType('endpoint', 'string');
3667
3668 if (requireArgsData) {
3669 argsObject.requireArgumentType('data', 'object', requestData.args);
3670 } // Ensure timestamp.
3671
3672
3673 if (!requestData.timestamp) {
3674 requestData.timestamp = new Date().getTime();
3675 }
3676
3677 this.validatedRequests[requestData.timestamp] = true;
3678 }
3679 /**
3680 * Function prepareHeaders().
3681 *
3682 * Prepare the headers for each request.
3683 *
3684 * @param {RequestData} requestData
3685 *
3686 * @return {{}} params
3687 */
3688
3689 }, {
3690 key: "prepareHeaders",
3691 value: function prepareHeaders(requestData) {
3692 var _requestData$args, _requestData$args$opt;
3693
3694 var type = requestData.type,
3695 nonce = elementorWebCliConfig.nonce,
3696 params = {
3697 signal: (_requestData$args = requestData.args) === null || _requestData$args === void 0 ? void 0 : (_requestData$args$opt = _requestData$args.options) === null || _requestData$args$opt === void 0 ? void 0 : _requestData$args$opt.signal,
3698 credentials: 'include' // cookies is required for wp reset.
3699
3700 },
3701 headers = {
3702 'X-WP-Nonce': nonce
3703 };
3704 /**
3705 * Translate:
3706 * 'create, delete, get, update' to HTTP Methods:
3707 * 'GET, POST, PUT, PATCH, DELETE'
3708 */
3709
3710 var allowedMethods = this.getAllowedMethods(type),
3711 method = this.getHTTPMethod(type);
3712
3713 if ('GET' === method) {
3714 Object.assign(params, {
3715 headers: headers
3716 });
3717 } else if (allowedMethods) {
3718 var _requestData$args2, _requestData$args3;
3719
3720 if (['POST', 'PUT'].includes(method) && !((_requestData$args2 = requestData.args) !== null && _requestData$args2 !== void 0 && _requestData$args2.data)) {
3721 throw Error('Invalid requestData.args.data');
3722 }
3723
3724 Object.assign(headers, {
3725 'Content-Type': 'application/json'
3726 });
3727
3728 if ((_requestData$args3 = requestData.args) !== null && _requestData$args3 !== void 0 && _requestData$args3.headers) {
3729 Object.assign(headers, requestData.args.headers);
3730 }
3731
3732 Object.assign(params, {
3733 method: method,
3734 headers: headers,
3735 body: 'application/json' === headers['Content-Type'] ? JSON.stringify(requestData.args.data) : requestData.args.data
3736 });
3737 } else {
3738 throw Error("Invalid type: '".concat(type, "'"));
3739 }
3740
3741 return params;
3742 }
3743 /**
3744 * Function prepareEndpoint().
3745 *
3746 * This method response for building a final endpoint,
3747 * the main problem is with plain permalink mode + command with query params that creates a weird url,
3748 * the current method should fix it.
3749 *
3750 * @param {RequestData} requestData
3751 *
3752 * @return {string} Endpoint URL
3753 */
3754
3755 }, {
3756 key: "prepareEndpoint",
3757 value: function prepareEndpoint(requestData) {
3758 var splitEndpoint = requestData.endpoint.split('?'),
3759 endpoint = splitEndpoint.shift();
3760 var endpointAddress = this.getEndpointURL(requestData, endpoint);
3761
3762 if (splitEndpoint.length) {
3763 var separator = endpointAddress.includes('?') ? '&' : '?';
3764 endpointAddress += separator + splitEndpoint.pop();
3765 }
3766
3767 return endpointAddress;
3768 }
3769 /**
3770 * Function fetch().
3771 *
3772 * @param {RequestData} requestData
3773 * @param {function(RequestInfo,*) : Promise<Response> } [fetchAPI]
3774 *
3775 * @return {Promise<Response>} response
3776 */
3777
3778 }, {
3779 key: "fetch",
3780 value: function fetch(requestData) {
3781 var _requestData$args$opt2,
3782 _this2 = this;
3783
3784 var fetchAPI = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : window.fetch;
3785 requestData.cache = 'miss';
3786 var refresh = (_requestData$args$opt2 = requestData.args.options) === null || _requestData$args$opt2 === void 0 ? void 0 : _requestData$args$opt2.refresh,
3787 getCache = 'get' === requestData.type && !refresh,
3788 saveCache = ['create', 'get'].includes(requestData.type) && !refresh;
3789
3790 if (getCache) {
3791 var cachePromise = this.cache.getAsync(requestData);
3792
3793 if (cachePromise) {
3794 return cachePromise;
3795 }
3796 }
3797
3798 var params = this.prepareHeaders(requestData);
3799 return new Promise( /*#__PURE__*/function () {
3800 var _ref9 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(resolve, reject) {
3801 var endpoint, request, response;
3802 return _regenerator.default.wrap(function _callee2$(_context2) {
3803 while (1) {
3804 switch (_context2.prev = _context2.next) {
3805 case 0:
3806 _context2.prev = 0;
3807 endpoint = _this2.prepareEndpoint(requestData);
3808 request = fetchAPI(endpoint, params);
3809 _context2.next = 5;
3810 return request.then( /*#__PURE__*/function () {
3811 var _ref10 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(_response) {
3812 return _regenerator.default.wrap(function _callee$(_context) {
3813 while (1) {
3814 switch (_context.prev = _context.next) {
3815 case 0:
3816 if (_response.ok) {
3817 _context.next = 6;
3818 break;
3819 }
3820
3821 if (!_response.headers.get('content-type').includes('application/json')) {
3822 _context.next = 5;
3823 break;
3824 }
3825
3826 _context.next = 4;
3827 return _response.json();
3828
3829 case 4:
3830 _response = _context.sent;
3831
3832 case 5:
3833 throw _response;
3834
3835 case 6:
3836 return _context.abrupt("return", _response.json());
3837
3838 case 7:
3839 case "end":
3840 return _context.stop();
3841 }
3842 }
3843 }, _callee);
3844 }));
3845
3846 return function (_x3) {
3847 return _ref10.apply(this, arguments);
3848 };
3849 }());
3850
3851 case 5:
3852 response = _context2.sent;
3853
3854 // At this point, it got the resolved response from remote.
3855 // So load cache, and resolve it.
3856 if (saveCache) {
3857 _this2.cache.set(requestData, response);
3858 }
3859
3860 resolve(response);
3861 _context2.next = 13;
3862 break;
3863
3864 case 10:
3865 _context2.prev = 10;
3866 _context2.t0 = _context2["catch"](0);
3867 reject(_context2.t0);
3868
3869 case 13:
3870 case "end":
3871 return _context2.stop();
3872 }
3873 }
3874 }, _callee2, null, [[0, 10]]);
3875 }));
3876
3877 return function (_x, _x2) {
3878 return _ref9.apply(this, arguments);
3879 };
3880 }());
3881 }
3882 /**
3883 * Function getCache().
3884 *
3885 * @param {ComponentBase} component
3886 * @param {string} command
3887 * @param {{}} query
3888 *
3889 * @return {{}} cache object
3890 */
3891
3892 }, {
3893 key: "getCache",
3894 value: function getCache(component, command) {
3895 var query = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
3896 var args = {
3897 query: query
3898 };
3899 return this.cache.get({
3900 endpoint: this.commandToEndpoint(command, args, this.commandFormats[command]),
3901 component: component,
3902 command: command,
3903 args: args
3904 });
3905 }
3906 /**
3907 * Function setCache().
3908 *
3909 * @param {ComponentBase} component
3910 * @param {string} command
3911 * @param {{}} query
3912 * @param {*} data
3913 */
3914
3915 }, {
3916 key: "setCache",
3917 value: function setCache(component, command, query, data) {
3918 var args = {
3919 query: query
3920 };
3921 this.cache.set({
3922 endpoint: this.commandToEndpoint(command, args, this.commandFormats[command]),
3923 component: component,
3924 command: command,
3925 args: args
3926 }, data);
3927 }
3928 /**
3929 * Function updateCache().
3930 *
3931 * The difference between 'setCache' and 'updateCache' is update will only modify exist values.
3932 * and 'setCache' will create or update.
3933 *
3934 * @param {ComponentBase} component
3935 * @param {string} command
3936 * @param {{}} query
3937 * @param {*} data
3938 */
3939
3940 }, {
3941 key: "updateCache",
3942 value: function updateCache(component, command, query, data) {
3943 var args = {
3944 query: query,
3945 data: data
3946 };
3947 this.cache.update({
3948 endpoint: this.commandToEndpoint(command, args, this.commandFormats[command]),
3949 component: component,
3950 command: command,
3951 args: args
3952 });
3953 }
3954 /**
3955 * Function deleteCache().
3956 *
3957 * @param {ComponentBase} component
3958 * @param {string} command
3959 * @param {{}} query
3960 */
3961
3962 }, {
3963 key: "deleteCache",
3964 value: function deleteCache(component, command) {
3965 var query = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
3966 var args = {
3967 query: query
3968 };
3969 this.cache.delete({
3970 endpoint: this.commandToEndpoint(command, args, this.commandFormats[command]),
3971 component: component,
3972 command: command,
3973 args: args
3974 });
3975 }
3976 /**
3977 * Function registerFormat().
3978 *
3979 * Register's format for each command.
3980 *
3981 * @param {string} command
3982 * @param {string} format
3983 */
3984
3985 }, {
3986 key: "registerFormat",
3987 value: function registerFormat(command, format) {
3988 this.commandFormats[command] = format;
3989 }
3990 /**
3991 * Function create().
3992 *
3993 * Run a command, that will be translated as endpoint for creating new data.
3994 *
3995 * @param {string} command
3996 * @param {*} data
3997 * @param {{}} query
3998 * @param {{}} options
3999 *
4000 * @return {*} result
4001 */
4002
4003 }, {
4004 key: "create",
4005 value: function create(command, data) {
4006 var query = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
4007 var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
4008 return this.run('create', command, {
4009 query: query,
4010 options: options,
4011 data: data
4012 });
4013 }
4014 /**
4015 * Function delete().
4016 *
4017 * Run a command, that will be translated as endpoint for deleting data.
4018 *
4019 * @param {string} command
4020 * @param {{}} query
4021 * @param {{}} options
4022 *
4023 * @return {*} result
4024 */
4025
4026 }, {
4027 key: "delete",
4028 value: function _delete(command) {
4029 var query = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
4030 var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
4031 return this.run('delete', command, {
4032 query: query,
4033 options: options
4034 });
4035 }
4036 /**
4037 * Function get().
4038 *
4039 * Run a command, that will be translated as endpoint for getting data.
4040 *
4041 * @param {string} command
4042 * @param {{}} query
4043 * @param {{}} options
4044 *
4045 * @return {*} result
4046 */
4047
4048 }, {
4049 key: "get",
4050 value: function get(command) {
4051 var query = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
4052 var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
4053 return this.run('get', command, {
4054 query: query,
4055 options: options
4056 });
4057 }
4058 /**
4059 * Function update().
4060 *
4061 * Run a command, that will be translated as endpoint for updating data.
4062 *
4063 * @param {string} command
4064 * @param {*} data
4065 * @param {{}} query
4066 * @param {{}} options
4067 *
4068 * @return {*} result
4069 */
4070
4071 }, {
4072 key: "update",
4073 value: function update(command, data) {
4074 var query = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
4075 var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
4076 return this.run('update', command, {
4077 query: query,
4078 options: options,
4079 data: data
4080 });
4081 }
4082 /**
4083 * Function options().
4084 *
4085 * Run a command, that will be translated as endpoint for requesting options/information about specific endpoint.
4086 *
4087 * @param {string} command
4088 * @param {{}} query
4089 * @param {{}} options
4090 *
4091 * @return {*} result
4092 */
4093
4094 }, {
4095 key: "options",
4096 value: function options(command, query) {
4097 var _options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
4098
4099 return this.run('options', command, {
4100 query: query,
4101 options: _options
4102 });
4103 }
4104 }, {
4105 key: "register",
4106 value: function register(component, command, callback) {
4107 (0, _get2.default)((0, _getPrototypeOf2.default)(Data.prototype), "register", this).call(this, component, command, callback);
4108 var fullCommandName = component.getNamespace() + '/' + command,
4109 commandInstance = $e.commands.getCommandClass(fullCommandName),
4110 format = commandInstance !== null && commandInstance !== void 0 && commandInstance.getEndpointFormat ? commandInstance.getEndpointFormat() : false;
4111
4112 if (format) {
4113 $e.data.registerFormat(fullCommandName, format);
4114 }
4115
4116 return this;
4117 }
4118 /**
4119 * TODO: Add JSDOC typedef for args ( query and options ).
4120 *
4121 * @param {DataTypes} type
4122 * @param {string} command
4123 * @param {{}} args
4124 *
4125 * @override
4126 */
4127
4128 }, {
4129 key: "run",
4130 value: function run(type, command, args) {
4131 args.options.type = type;
4132
4133 var _this$commandExtractA = this.commandExtractArgs(command, args);
4134
4135 command = _this$commandExtractA.command;
4136 args = _this$commandExtractA.args;
4137 return (0, _get2.default)((0, _getPrototypeOf2.default)(Data.prototype), "run", this).call(this, command, args);
4138 }
4139 }, {
4140 key: "error",
4141 value: function error(message) {
4142 throw Error('Data commands: ' + message);
4143 }
4144 }]);
4145 return Data;
4146 }(_commands.default);
4147
4148 exports["default"] = Data;
4149
4150 /***/ }),
4151
4152 /***/ "../modules/web-cli/assets/js/core/data/cache.js":
4153 /*!*******************************************************!*\
4154 !*** ../modules/web-cli/assets/js/core/data/cache.js ***!
4155 \*******************************************************/
4156 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
4157
4158 "use strict";
4159
4160
4161 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
4162
4163 Object.defineProperty(exports, "__esModule", ({
4164 value: true
4165 }));
4166 exports["default"] = void 0;
4167
4168 var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ "../node_modules/@babel/runtime/regenerator/index.js"));
4169
4170 var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js"));
4171
4172 var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js"));
4173
4174 var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "../node_modules/@babel/runtime/helpers/asyncToGenerator.js"));
4175
4176 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
4177
4178 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
4179
4180 var _localStorage = _interopRequireDefault(__webpack_require__(/*! ./storages/local-storage */ "../modules/web-cli/assets/js/core/data/storages/local-storage.js"));
4181
4182 /**
4183 * @typedef {{}} RequestData
4184 */
4185
4186 /**
4187 * @typedef {import('../data')} Data
4188 */
4189
4190 /**
4191 * TODO: Search common logic, create functions to reduce code size.
4192 */
4193 var Cache = /*#__PURE__*/function () {
4194 /**
4195 * Function constructor().
4196 *
4197 * Create cache.
4198 *
4199 * @param {Data} manager
4200 */
4201 function Cache(manager) {
4202 (0, _classCallCheck2.default)(this, Cache);
4203 this.manager = manager;
4204 this.storage = new _localStorage.default();
4205 }
4206 /**
4207 * Function getAsync().
4208 *
4209 * Receive from cache. the difference between getAsync() and get() is that receive return it as promise...
4210 * to fake fetch mechanism.
4211 *
4212 * @param {RequestData} requestData
4213 *
4214 * @return {(Promise|boolean)} request data
4215 */
4216
4217
4218 (0, _createClass2.default)(Cache, [{
4219 key: "getAsync",
4220 value: function getAsync(requestData) {
4221 var data = this.get(requestData);
4222
4223 if (null !== data) {
4224 // If data comes from cache, add 'cache = hit' to requestData.
4225 requestData.cache = 'hit';
4226 return new Promise( /*#__PURE__*/function () {
4227 var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(resolve) {
4228 return _regenerator.default.wrap(function _callee$(_context) {
4229 while (1) {
4230 switch (_context.prev = _context.next) {
4231 case 0:
4232 resolve(data);
4233
4234 case 1:
4235 case "end":
4236 return _context.stop();
4237 }
4238 }
4239 }, _callee);
4240 }));
4241
4242 return function (_x) {
4243 return _ref.apply(this, arguments);
4244 };
4245 }());
4246 } // TODO: Check if possible, always return promise and reject it.
4247
4248
4249 return false;
4250 }
4251 /**
4252 * Function set().
4253 *
4254 * set data to cache.
4255 *
4256 * The difference between set() and update() is that set, will modify the data anyway...
4257 * when update() will only modify exist objects/values.
4258 *
4259 * @param {RequestData} requestData
4260 * @param {*} data
4261 */
4262
4263 }, {
4264 key: "set",
4265 value: function set(requestData, data) {
4266 $e.data.validateRequestData(requestData);
4267 var componentName = requestData.component.getNamespace(),
4268 pureEndpoint = requestData.endpoint.replace(componentName + '/', ''),
4269 pureEndpointParts = pureEndpoint.split('/');
4270 var newData = {}; // Example of working with reaming endpoint part(s) can be found at 'cache.spec.js' test: 'load(): deep'.
4271 // Analyze reaming endpoint.
4272
4273 if (pureEndpointParts.length && pureEndpoint !== componentName) {
4274 // Using reaming endpoint parts, to build new data object.
4275 var result = pureEndpointParts.reduce(function (accumulator, pureEndpointPart) {
4276 accumulator[pureEndpointPart] = {};
4277 return accumulator[pureEndpointPart];
4278 }, newData); // 'result' is equal to 'newData' with a deeper pointer, build based on 'pureEndpointParts' ( will effect newData ).
4279
4280 Object.assign(result, data);
4281 } else {
4282 newData = data;
4283 }
4284
4285 var oldData = this.storage.getItem(componentName); // When have old data, merge it recursively with newData using jQuery.extend().
4286
4287 if (oldData !== null) {
4288 newData = jQuery.extend(true, oldData, newData);
4289 }
4290
4291 this.storage.setItem(componentName, newData);
4292 }
4293 /**
4294 * Function get().
4295 *
4296 * Get from exist storage.
4297 *
4298 * @param {RequestData} requestData
4299 *
4300 * @return {{}} data
4301 */
4302
4303 }, {
4304 key: "get",
4305 value: function get(requestData) {
4306 $e.data.validateRequestData(requestData);
4307 var componentName = requestData.component.getNamespace(),
4308 componentData = this.storage.getItem(componentName);
4309
4310 if (componentData !== null) {
4311 if (componentName === requestData.endpoint) {
4312 return componentData;
4313 } // Example of working with reaming endpoint part(s) can be found at 'cache.spec.js' test: 'get(): complex'.
4314 // Analyze reaming endpoint (Using reduce over endpoint parts, build the right index).
4315
4316
4317 var pureEndpoint = requestData.endpoint.replace(requestData.component.getNamespace() + '/', ''),
4318 pureEndpointParts = pureEndpoint.split('/'),
4319 // eslint-disable-next-line array-callback-return
4320 result = pureEndpointParts.reduce(function (accumulator, endpointPart) {
4321 if (accumulator && accumulator[endpointPart]) {
4322 return accumulator[endpointPart];
4323 }
4324 }, componentData); // Since $e.data.cache.receive will reject only if null is the result.
4325
4326 return result || null;
4327 }
4328
4329 return null;
4330 }
4331 /**
4332 * Function update().
4333 *
4334 * Update only already exist storage, runs over all storage
4335 *
4336 * @param {RequestData} requestData
4337 *
4338 * @return {boolean} is updated
4339 */
4340
4341 }, {
4342 key: "update",
4343 value: function update(requestData) {
4344 $e.data.validateRequestData(requestData, true);
4345 var endpoint = requestData.endpoint;
4346 var response = {}; // Simulate response from cache.
4347
4348 Object.entries(this.storage.getAll()).forEach(function (_ref2) {
4349 var _ref3 = (0, _slicedToArray2.default)(_ref2, 2),
4350 endpointKey = _ref3[0],
4351
4352 /*string*/
4353 endpointValue = _ref3[1];
4354
4355 if (endpointValue && endpoint.includes(endpointKey)) {
4356 // Assuming it is a specific endpoint.
4357 var oldData = endpointValue,
4358 pureEndpoint = requestData.endpoint.replace(requestData.component.getNamespace() + '/', ''),
4359 pureEndpointParts = pureEndpoint.split('/'),
4360 isComponentUpdate = 1 === pureEndpointParts.length && endpointKey === requestData.endpoint && endpointKey === requestData.component.getNamespace(); // Component update or specific update?
4361
4362 if (isComponentUpdate) {
4363 response = jQuery.extend(true, oldData, requestData.args.data);
4364 } else {
4365 var oldSpecificData = pureEndpointParts.reduce(function (accumulator, pureEndpointPart) {
4366 return accumulator[pureEndpointPart];
4367 }, oldData);
4368 response = jQuery.extend(true, oldSpecificData, requestData.args.data);
4369 }
4370 }
4371 }); // If response not found.
4372
4373 if (0 === Object.values(response).length) {
4374 return false;
4375 } // Update cache.
4376
4377
4378 this.set(requestData, response);
4379 return true;
4380 }
4381 /**
4382 * Function delete().
4383 *
4384 * Delete endpoint from storage.
4385 *
4386 * @param {RequestData} requestData
4387 *
4388 * @return {boolean} is deleted
4389 */
4390
4391 }, {
4392 key: "delete",
4393 value: function _delete(requestData) {
4394 $e.data.validateRequestData(requestData);
4395 var result = false;
4396 var componentName = requestData.component.getNamespace();
4397
4398 if (componentName !== requestData.endpoint) {
4399 var oldData = this.storage.getItem(componentName),
4400 newData = {};
4401
4402 if (null === oldData) {
4403 return false;
4404 }
4405
4406 var pureEndpoint = requestData.endpoint.replace(componentName + '/', ''),
4407 pureEndpointParts = pureEndpoint.split('/'),
4408 lastEndpointPart = pureEndpointParts[pureEndpointParts.length - 1];
4409 pureEndpointParts.reduce(function (accumulator, pureEndpointPart) {
4410 if (pureEndpointPart === lastEndpointPart) {
4411 // Null, means delete.
4412 accumulator[pureEndpointPart] = null;
4413 } else {
4414 accumulator[pureEndpointPart] = {};
4415 }
4416
4417 return accumulator[pureEndpointPart];
4418 }, newData);
4419
4420 if (Object.keys(oldData).length) {
4421 var deleteKeys = function deleteKeys(target, nullsObject) {
4422 if (nullsObject) {
4423 Object.keys(nullsObject).forEach(function (key) {
4424 if (nullsObject[key] && 'object' === (0, _typeof2.default)(nullsObject[key])) {
4425 deleteKeys(target[key], nullsObject[key]);
4426 } else if (null === nullsObject[key]) {
4427 delete target[key];
4428 result = true;
4429 }
4430 });
4431 } else {
4432 // Means need to clear all the object.
4433 Object.keys(target).forEach(function (key) {
4434 return delete target[key];
4435 });
4436 }
4437
4438 return target;
4439 };
4440
4441 this.storage.setItem(componentName, deleteKeys(oldData, newData));
4442 }
4443 } else {
4444 for (var key in this.storage.getAll()) {
4445 if (key === requestData.endpoint) {
4446 this.storage.removeItem(requestData.endpoint);
4447 result = true;
4448 break;
4449 }
4450 }
4451 }
4452
4453 return result;
4454 }
4455 }]);
4456 return Cache;
4457 }();
4458
4459 exports["default"] = Cache;
4460
4461 /***/ }),
4462
4463 /***/ "../modules/web-cli/assets/js/core/data/errors/base-error.js":
4464 /*!*******************************************************************!*\
4465 !*** ../modules/web-cli/assets/js/core/data/errors/base-error.js ***!
4466 \*******************************************************************/
4467 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
4468
4469 "use strict";
4470
4471
4472 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
4473
4474 Object.defineProperty(exports, "__esModule", ({
4475 value: true
4476 }));
4477 exports["default"] = void 0;
4478
4479 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
4480
4481 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
4482
4483 var _assertThisInitialized2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ "../node_modules/@babel/runtime/helpers/assertThisInitialized.js"));
4484
4485 var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
4486
4487 var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
4488
4489 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
4490
4491 var _wrapNativeSuper2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/wrapNativeSuper */ "../node_modules/@babel/runtime/helpers/wrapNativeSuper.js"));
4492
4493 var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
4494
4495 var _helpers = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/helpers */ "../modules/web-cli/assets/js/utils/helpers.js"));
4496
4497 var _forceMethodImplementation = _interopRequireDefault(__webpack_require__(/*! ../../../utils/force-method-implementation */ "../modules/web-cli/assets/js/utils/force-method-implementation.js"));
4498
4499 function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
4500
4501 function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
4502
4503 function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
4504
4505 function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
4506
4507 var BaseError = /*#__PURE__*/function (_Error) {
4508 (0, _inherits2.default)(BaseError, _Error);
4509
4510 var _super = _createSuper(BaseError);
4511
4512 /**
4513 * Error constructor.
4514 *
4515 * @param {string} message
4516 * @param {string} code
4517 * @param {*} data
4518 */
4519 function BaseError() {
4520 var _this;
4521
4522 var message = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
4523 var code = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
4524 var data = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
4525 (0, _classCallCheck2.default)(this, BaseError);
4526 _this = _super.call(this, message);
4527 (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "code", '');
4528 (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "data", []);
4529 _this.code = code;
4530 _this.data = data;
4531 return _this;
4532 }
4533 /**
4534 * Notify a message when the error occurs.
4535 */
4536
4537
4538 (0, _createClass2.default)(BaseError, [{
4539 key: "notify",
4540 value: function notify() {
4541 _helpers.default.consoleError(_objectSpread({
4542 message: this.message
4543 }, this));
4544 }
4545 }], [{
4546 key: "create",
4547 value:
4548 /**
4549 * The server error code.
4550 *
4551 * @type {string}
4552 */
4553
4554 /**
4555 * Additional data about the current error.
4556 *
4557 * @type {*[]}
4558 */
4559
4560 /**
4561 * Static helper function to create the error.
4562 *
4563 * @param {string} message
4564 * @param {string} code
4565 * @param {*} data
4566 * @return {BaseError} error
4567 */
4568 function create(message) {
4569 var code = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
4570 var data = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
4571 return new this(message, code, data);
4572 }
4573 /**
4574 * Returns the status code of the error.
4575 */
4576
4577 }, {
4578 key: "getHTTPErrorCode",
4579 value: function getHTTPErrorCode() {
4580 (0, _forceMethodImplementation.default)();
4581 }
4582 }]);
4583 return BaseError;
4584 }( /*#__PURE__*/(0, _wrapNativeSuper2.default)(Error));
4585
4586 exports["default"] = BaseError;
4587
4588 /***/ }),
4589
4590 /***/ "../modules/web-cli/assets/js/core/data/errors/default-error.js":
4591 /*!**********************************************************************!*\
4592 !*** ../modules/web-cli/assets/js/core/data/errors/default-error.js ***!
4593 \**********************************************************************/
4594 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
4595
4596 "use strict";
4597
4598
4599 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
4600
4601 Object.defineProperty(exports, "__esModule", ({
4602 value: true
4603 }));
4604 exports["default"] = exports.DefaultError = void 0;
4605
4606 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
4607
4608 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
4609
4610 var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
4611
4612 var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
4613
4614 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
4615
4616 var _baseError = _interopRequireDefault(__webpack_require__(/*! ./base-error */ "../modules/web-cli/assets/js/core/data/errors/base-error.js"));
4617
4618 function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
4619
4620 function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
4621
4622 var DefaultError = /*#__PURE__*/function (_BaseError) {
4623 (0, _inherits2.default)(DefaultError, _BaseError);
4624
4625 var _super = _createSuper(DefaultError);
4626
4627 function DefaultError() {
4628 (0, _classCallCheck2.default)(this, DefaultError);
4629 return _super.apply(this, arguments);
4630 }
4631
4632 (0, _createClass2.default)(DefaultError, null, [{
4633 key: "getHTTPErrorCode",
4634 value: function getHTTPErrorCode() {
4635 return 501;
4636 }
4637 }]);
4638 return DefaultError;
4639 }(_baseError.default);
4640
4641 exports.DefaultError = DefaultError;
4642 var _default = DefaultError;
4643 exports["default"] = _default;
4644
4645 /***/ }),
4646
4647 /***/ "../modules/web-cli/assets/js/core/data/errors/error-404.js":
4648 /*!******************************************************************!*\
4649 !*** ../modules/web-cli/assets/js/core/data/errors/error-404.js ***!
4650 \******************************************************************/
4651 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
4652
4653 "use strict";
4654
4655
4656 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
4657
4658 Object.defineProperty(exports, "__esModule", ({
4659 value: true
4660 }));
4661 exports["default"] = exports.Error404 = void 0;
4662
4663 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
4664
4665 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
4666
4667 var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
4668
4669 var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
4670
4671 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
4672
4673 var _baseError = _interopRequireDefault(__webpack_require__(/*! ./base-error */ "../modules/web-cli/assets/js/core/data/errors/base-error.js"));
4674
4675 var _helpers = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/helpers */ "../modules/web-cli/assets/js/utils/helpers.js"));
4676
4677 function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
4678
4679 function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
4680
4681 var Error404 = /*#__PURE__*/function (_BaseError) {
4682 (0, _inherits2.default)(Error404, _BaseError);
4683
4684 var _super = _createSuper(Error404);
4685
4686 function Error404() {
4687 (0, _classCallCheck2.default)(this, Error404);
4688 return _super.apply(this, arguments);
4689 }
4690
4691 (0, _createClass2.default)(Error404, [{
4692 key: "notify",
4693 value: function notify() {
4694 _helpers.default.consoleWarn(this.message);
4695 }
4696 }], [{
4697 key: "getHTTPErrorCode",
4698 value: function getHTTPErrorCode() {
4699 return 404;
4700 }
4701 }]);
4702 return Error404;
4703 }(_baseError.default);
4704
4705 exports.Error404 = Error404;
4706 var _default = Error404;
4707 exports["default"] = _default;
4708
4709 /***/ }),
4710
4711 /***/ "../modules/web-cli/assets/js/core/data/errors/index.js":
4712 /*!**************************************************************!*\
4713 !*** ../modules/web-cli/assets/js/core/data/errors/index.js ***!
4714 \**************************************************************/
4715 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
4716
4717 "use strict";
4718
4719
4720 Object.defineProperty(exports, "__esModule", ({
4721 value: true
4722 }));
4723 Object.defineProperty(exports, "DefaultError", ({
4724 enumerable: true,
4725 get: function get() {
4726 return _defaultError.DefaultError;
4727 }
4728 }));
4729 Object.defineProperty(exports, "Error404", ({
4730 enumerable: true,
4731 get: function get() {
4732 return _error.Error404;
4733 }
4734 }));
4735
4736 var _defaultError = __webpack_require__(/*! ./default-error */ "../modules/web-cli/assets/js/core/data/errors/default-error.js");
4737
4738 var _error = __webpack_require__(/*! ./error-404 */ "../modules/web-cli/assets/js/core/data/errors/error-404.js");
4739
4740 /***/ }),
4741
4742 /***/ "../modules/web-cli/assets/js/core/data/storages/base-prefix-storage.js":
4743 /*!******************************************************************************!*\
4744 !*** ../modules/web-cli/assets/js/core/data/storages/base-prefix-storage.js ***!
4745 \******************************************************************************/
4746 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
4747
4748 "use strict";
4749
4750
4751 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
4752
4753 Object.defineProperty(exports, "__esModule", ({
4754 value: true
4755 }));
4756 exports["default"] = void 0;
4757
4758 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
4759
4760 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
4761
4762 var _get2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/get */ "../node_modules/@babel/runtime/helpers/get.js"));
4763
4764 var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
4765
4766 var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
4767
4768 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
4769
4770 var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
4771
4772 var _baseStorage = _interopRequireDefault(__webpack_require__(/*! elementor-api/core/data/storages/base-storage */ "../modules/web-cli/assets/js/core/data/storages/base-storage.js"));
4773
4774 function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
4775
4776 function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
4777
4778 var BasePrefixStorage = /*#__PURE__*/function (_BaseStorage) {
4779 (0, _inherits2.default)(BasePrefixStorage, _BaseStorage);
4780
4781 var _super = _createSuper(BasePrefixStorage);
4782
4783 function BasePrefixStorage() {
4784 (0, _classCallCheck2.default)(this, BasePrefixStorage);
4785 return _super.apply(this, arguments);
4786 }
4787
4788 (0, _createClass2.default)(BasePrefixStorage, [{
4789 key: "clear",
4790 value: function clear() {
4791 var _this = this;
4792
4793 Object.keys(this.getAll()).forEach(function (key) {
4794 return _this.removeItem(key);
4795 });
4796 }
4797 }, {
4798 key: "getItem",
4799 value: function getItem(key) {
4800 return (0, _get2.default)((0, _getPrototypeOf2.default)(BasePrefixStorage.prototype), "getItem", this).call(this, BasePrefixStorage.DEFAULT_KEY_PREFIX + key);
4801 }
4802 }, {
4803 key: "removeItem",
4804 value: function removeItem(key) {
4805 return (0, _get2.default)((0, _getPrototypeOf2.default)(BasePrefixStorage.prototype), "removeItem", this).call(this, BasePrefixStorage.DEFAULT_KEY_PREFIX + key);
4806 }
4807 }, {
4808 key: "setItem",
4809 value: function setItem(key, value) {
4810 return (0, _get2.default)((0, _getPrototypeOf2.default)(BasePrefixStorage.prototype), "setItem", this).call(this, BasePrefixStorage.DEFAULT_KEY_PREFIX + key, value);
4811 }
4812 }, {
4813 key: "getAll",
4814 value: function getAll() {
4815 var _this2 = this;
4816
4817 var DEFAULT_KEY_PREFIX = BasePrefixStorage.DEFAULT_KEY_PREFIX,
4818 keys = Object.keys(this.provider),
4819 result = {};
4820 keys.forEach(function (key) {
4821 if (key.startsWith(DEFAULT_KEY_PREFIX)) {
4822 key = key.replace(DEFAULT_KEY_PREFIX, '');
4823 result[key] = _this2.getItem(key);
4824 }
4825 });
4826 return result;
4827 }
4828 }]);
4829 return BasePrefixStorage;
4830 }(_baseStorage.default);
4831
4832 exports["default"] = BasePrefixStorage;
4833 (0, _defineProperty2.default)(BasePrefixStorage, "DEFAULT_KEY_PREFIX", 'e_');
4834
4835 /***/ }),
4836
4837 /***/ "../modules/web-cli/assets/js/core/data/storages/base-storage.js":
4838 /*!***********************************************************************!*\
4839 !*** ../modules/web-cli/assets/js/core/data/storages/base-storage.js ***!
4840 \***********************************************************************/
4841 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
4842
4843 "use strict";
4844
4845
4846 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
4847
4848 Object.defineProperty(exports, "__esModule", ({
4849 value: true
4850 }));
4851 exports["default"] = void 0;
4852
4853 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
4854
4855 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
4856
4857 /**
4858 * TODO: Merge all storage's to one.
4859 * Using this technique give's the ability to use JSDOC from 'window.storage'.
4860 *
4861 * @implements {Storage}
4862 */
4863 var BaseStorage = /*#__PURE__*/function () {
4864 /**
4865 * Create storage wrapper.
4866 *
4867 * @param {Storage} provider
4868 */
4869 function BaseStorage(provider) {
4870 (0, _classCallCheck2.default)(this, BaseStorage);
4871
4872 if (BaseStorage === (this instanceof BaseStorage ? this.constructor : void 0)) {
4873 throw new TypeError('Cannot construct BaseStorage instances directly');
4874 }
4875
4876 this.provider = provider;
4877 }
4878
4879 (0, _createClass2.default)(BaseStorage, [{
4880 key: "clear",
4881 value: function clear() {
4882 return this.provider.clear();
4883 }
4884 }, {
4885 key: "getItem",
4886 value: function getItem(key) {
4887 var result = this.provider.getItem(key);
4888
4889 if (null !== result) {
4890 return JSON.parse(result);
4891 }
4892
4893 return result;
4894 }
4895 }, {
4896 key: "key",
4897 value: function key(index) {
4898 return this.provider.key(index);
4899 }
4900 }, {
4901 key: "removeItem",
4902 value: function removeItem(key) {
4903 return this.provider.removeItem(key);
4904 }
4905 }, {
4906 key: "setItem",
4907 value: function setItem(key, value) {
4908 return this.provider.setItem(key, JSON.stringify(value));
4909 }
4910 }, {
4911 key: "getAll",
4912 value: function getAll() {
4913 var _this = this;
4914
4915 var keys = Object.keys(this.provider),
4916 result = {};
4917 keys.forEach(function (key) {
4918 result[key] = _this.getItem(key);
4919 });
4920 return result;
4921 }
4922 }]);
4923 return BaseStorage;
4924 }();
4925
4926 exports["default"] = BaseStorage;
4927
4928 /***/ }),
4929
4930 /***/ "../modules/web-cli/assets/js/core/data/storages/local-storage.js":
4931 /*!************************************************************************!*\
4932 !*** ../modules/web-cli/assets/js/core/data/storages/local-storage.js ***!
4933 \************************************************************************/
4934 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
4935
4936 "use strict";
4937
4938
4939 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
4940
4941 Object.defineProperty(exports, "__esModule", ({
4942 value: true
4943 }));
4944 exports["default"] = void 0;
4945
4946 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
4947
4948 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
4949
4950 var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
4951
4952 var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
4953
4954 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
4955
4956 var _basePrefixStorage = _interopRequireDefault(__webpack_require__(/*! ./base-prefix-storage */ "../modules/web-cli/assets/js/core/data/storages/base-prefix-storage.js"));
4957
4958 function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
4959
4960 function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
4961
4962 var LocalStorage = /*#__PURE__*/function (_BasePrefixStorage) {
4963 (0, _inherits2.default)(LocalStorage, _BasePrefixStorage);
4964
4965 var _super = _createSuper(LocalStorage);
4966
4967 function LocalStorage() {
4968 (0, _classCallCheck2.default)(this, LocalStorage);
4969 return _super.call(this, localStorage);
4970 }
4971
4972 (0, _createClass2.default)(LocalStorage, [{
4973 key: "debug",
4974 value: function debug() {
4975 var entries = this.getAll(),
4976 ordered = {};
4977 Object.keys(entries).sort().forEach(function (key) {
4978 var value = entries[key];
4979 ordered[key] = value;
4980 });
4981 return ordered;
4982 }
4983 }]);
4984 return LocalStorage;
4985 }(_basePrefixStorage.default);
4986
4987 exports["default"] = LocalStorage;
4988
4989 /***/ }),
4990
4991 /***/ "../modules/web-cli/assets/js/core/hooks.js":
4992 /*!**************************************************!*\
4993 !*** ../modules/web-cli/assets/js/core/hooks.js ***!
4994 \**************************************************/
4995 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
4996
4997 "use strict";
4998
4999
5000 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
5001
5002 Object.defineProperty(exports, "__esModule", ({
5003 value: true
5004 }));
5005 exports["default"] = void 0;
5006
5007 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
5008
5009 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
5010
5011 var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
5012
5013 var _data = _interopRequireDefault(__webpack_require__(/*! ./hooks/data.js */ "../modules/web-cli/assets/js/core/hooks/data.js"));
5014
5015 var _ui = _interopRequireDefault(__webpack_require__(/*! ./hooks/ui.js */ "../modules/web-cli/assets/js/core/hooks/ui.js"));
5016
5017 /**
5018 * @typedef {import('../modules/hook-base')} HookBase
5019 */
5020 var Hooks = /*#__PURE__*/function () {
5021 function Hooks() {
5022 (0, _classCallCheck2.default)(this, Hooks);
5023 (0, _defineProperty2.default)(this, "data", new _data.default());
5024 (0, _defineProperty2.default)(this, "ui", new _ui.default());
5025 }
5026
5027 (0, _createClass2.default)(Hooks, [{
5028 key: "activate",
5029 value:
5030 /**
5031 * Function activate().
5032 *
5033 * Activate all hooks.
5034 */
5035 function activate() {
5036 this.getTypes().forEach(function (hooksType) {
5037 hooksType.activate();
5038 });
5039 }
5040 /**
5041 * Function deactivate().
5042 *
5043 * Deactivate all hooks.
5044 */
5045
5046 }, {
5047 key: "deactivate",
5048 value: function deactivate() {
5049 this.getTypes().forEach(function (hooksType) {
5050 hooksType.deactivate();
5051 });
5052 }
5053 }, {
5054 key: "getAll",
5055 value: function getAll() {
5056 var flat = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
5057 var result = {};
5058 this.getTypes().forEach(function (hooksType) {
5059 result[hooksType.getType()] = hooksType.getAll(flat);
5060 });
5061 return result;
5062 }
5063 }, {
5064 key: "getTypes",
5065 value: function getTypes() {
5066 return [this.data, this.ui];
5067 }
5068 }, {
5069 key: "getType",
5070 value: function getType(type) {
5071 return this.getTypes().find(function (hooks) {
5072 return type === hooks.getType();
5073 });
5074 }
5075 /**
5076 * Function register().
5077 *
5078 * Register hook.
5079 *
5080 * @param {string} type
5081 * @param {string} event
5082 * @param {HookBase} instance
5083 *
5084 * @return {{}} Created callback
5085 */
5086
5087 }, {
5088 key: "register",
5089 value: function register(type, event, instance) {
5090 return this.getType(type).register(event, instance);
5091 }
5092 /**
5093 * Function run().
5094 *
5095 * Run's a hook.
5096 *
5097 * @param {string} type
5098 * @param {string} event
5099 * @param {string} command
5100 * @param {{}} args
5101 * @param {*} result
5102 *
5103 * @return {boolean} result
5104 */
5105
5106 }, {
5107 key: "run",
5108 value: function run(type, event, command, args) {
5109 var result = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : undefined;
5110 return this.getType(type).run(event, command, args, result);
5111 }
5112 /**
5113 * Function registerDataAfter().
5114 *
5115 * Register data hook that's run after the command.
5116 *
5117 * @param {HookBase} instance
5118 *
5119 * @return {{}} callback
5120 */
5121
5122 }, {
5123 key: "registerDataAfter",
5124 value: function registerDataAfter(instance) {
5125 return this.register('data', 'after', instance);
5126 }
5127 /**
5128 * Function registerDataCatch().
5129 *
5130 * Register data hook that's run when the command fails.
5131 *
5132 * @param {HookBase} instance
5133 *
5134 * @return {{}} callback
5135 */
5136
5137 }, {
5138 key: "registerDataCatch",
5139 value: function registerDataCatch(instance) {
5140 return this.register('data', 'catch', instance);
5141 }
5142 /**
5143 * Function registerDataDependency().
5144 *
5145 * Register data hook that's run before the command as dependency.
5146 *
5147 * @param {HookBase} instance
5148 *
5149 * @return {{}} callback
5150 */
5151
5152 }, {
5153 key: "registerDataDependency",
5154 value: function registerDataDependency(instance) {
5155 return this.register('data', 'dependency', instance);
5156 }
5157 /**
5158 * Function registerUIAfter().
5159 *
5160 * Register UI hook that's run after the commands run.
5161 *
5162 * @param {HookBase} instance
5163 *
5164 * @return {{}} callback
5165 */
5166
5167 }, {
5168 key: "registerUIAfter",
5169 value: function registerUIAfter(instance) {
5170 return this.register('ui', 'after', instance);
5171 }
5172 /**
5173 * Function registerUICatch().
5174 *
5175 * Register UI hook that's run when the command fails.
5176 *
5177 * @param {HookBase} instance
5178 *
5179 * @return {{}} callback
5180 */
5181
5182 }, {
5183 key: "registerUICatch",
5184 value: function registerUICatch(instance) {
5185 return this.register('ui', 'catch', instance);
5186 }
5187 /**
5188 * Function registerUIBefore().
5189 *
5190 * Register UI hook that's run before the command.
5191 *
5192 * @param {HookBase} instance
5193 *
5194 * @return {{}} callback
5195 */
5196
5197 }, {
5198 key: "registerUIBefore",
5199 value: function registerUIBefore(instance) {
5200 return this.register('ui', 'before', instance);
5201 }
5202 /**
5203 * Function runDataAfter().
5204 *
5205 * Run data hook that's run after the command.
5206 *
5207 * @param {string} command
5208 * @param {{}} args
5209 * @param {*} result
5210 *
5211 * @return {boolean} result
5212 */
5213
5214 }, {
5215 key: "runDataAfter",
5216 value: function runDataAfter(command, args, result) {
5217 return this.run('data', 'after', command, args, result);
5218 }
5219 /**
5220 * Function runDataCatch().
5221 *
5222 * Run data hook that's run when the command fails.
5223 *
5224 * @param {string} command
5225 * @param {{}} args
5226 * @param {*} error
5227 *
5228 * @return {boolean} result
5229 */
5230
5231 }, {
5232 key: "runDataCatch",
5233 value: function runDataCatch(command, args, error) {
5234 return this.run('data', 'catch', command, args, error);
5235 }
5236 /**
5237 * Function runDataDependency().
5238 *
5239 * Run data hook that's run before the command as dependency.
5240 *
5241 * @param {string} command
5242 * @param {{}} args
5243 *
5244 * @return {boolean} result
5245 */
5246
5247 }, {
5248 key: "runDataDependency",
5249 value: function runDataDependency(command, args) {
5250 return this.run('data', 'dependency', command, args);
5251 }
5252 /**
5253 * Function runUIAfter().
5254 *
5255 * Run UI hook that's run after the commands run.
5256 *
5257 * @param {string} command
5258 * @param {{}} args
5259 * @param {*} result
5260 *
5261 * @return {boolean} result
5262 */
5263
5264 }, {
5265 key: "runUIAfter",
5266 value: function runUIAfter(command, args, result) {
5267 return this.run('ui', 'after', command, args, result);
5268 }
5269 /**
5270 * Function runUICatch().
5271 *
5272 * Run UI hook that's run when the command fails.
5273 *
5274 * @param {string} command
5275 * @param {{}} args
5276 * @param {*} e
5277 *
5278 * @return {boolean} result
5279 */
5280
5281 }, {
5282 key: "runUICatch",
5283 value: function runUICatch(command, args, e) {
5284 return this.run('ui', 'catch', command, args, e);
5285 }
5286 /**
5287 * Function runUIBefore().
5288 *
5289 * Run UI hook that's run before the command.
5290 *
5291 * @param {string} command
5292 * @param {{}} args
5293 *
5294 * @return {boolean} result
5295 */
5296
5297 }, {
5298 key: "runUIBefore",
5299 value: function runUIBefore(command, args) {
5300 return this.run('ui', 'before', command, args);
5301 }
5302 }]);
5303 return Hooks;
5304 }();
5305
5306 exports["default"] = Hooks;
5307
5308 /***/ }),
5309
5310 /***/ "../modules/web-cli/assets/js/core/hooks/base.js":
5311 /*!*******************************************************!*\
5312 !*** ../modules/web-cli/assets/js/core/hooks/base.js ***!
5313 \*******************************************************/
5314 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
5315
5316 "use strict";
5317
5318
5319 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
5320
5321 Object.defineProperty(exports, "__esModule", ({
5322 value: true
5323 }));
5324 exports["default"] = void 0;
5325
5326 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
5327
5328 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
5329
5330 var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
5331
5332 var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
5333
5334 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
5335
5336 var _helpers = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/helpers */ "../modules/web-cli/assets/js/utils/helpers.js"));
5337
5338 var _module = _interopRequireDefault(__webpack_require__(/*! elementor-assets-js/modules/imports/module.js */ "../assets/dev/js/modules/imports/module.js"));
5339
5340 var _forceMethodImplementation = _interopRequireDefault(__webpack_require__(/*! ../../utils/force-method-implementation */ "../modules/web-cli/assets/js/utils/force-method-implementation.js"));
5341
5342 function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
5343
5344 function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
5345
5346 /**
5347 * @typedef {import('../../modules/hook-base')} HookBase
5348 */
5349 var HooksBase = /*#__PURE__*/function (_Module) {
5350 (0, _inherits2.default)(HooksBase, _Module);
5351
5352 var _super = _createSuper(HooksBase);
5353
5354 /**
5355 * Function constructor().
5356 *
5357 * Create hooks base.
5358 *
5359 * @param {{}} args
5360 */
5361 function HooksBase() {
5362 var _this;
5363
5364 (0, _classCallCheck2.default)(this, HooksBase);
5365
5366 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
5367 args[_key] = arguments[_key];
5368 }
5369
5370 _this = _super.call.apply(_super, [this].concat(args));
5371 /**
5372 * Current command.
5373 *
5374 * @type {string}
5375 */
5376
5377 _this.current = '';
5378 /**
5379 * Array of ids which in use.
5380 *
5381 * @type {Array}
5382 */
5383
5384 _this.usedIds = [];
5385 /**
5386 * Object of callbacks that was bound by container type.
5387 *
5388 * @type {{}}
5389 */
5390
5391 _this.callbacks = {
5392 after: {},
5393 catch: {}
5394 };
5395 /**
5396 * Object of depth.
5397 *
5398 * @type {{}}
5399 */
5400
5401 _this.depth = {
5402 after: {},
5403 catch: {}
5404 };
5405 _this.callbacksFlatList = {};
5406 return _this;
5407 }
5408
5409 (0, _createClass2.default)(HooksBase, [{
5410 key: "activate",
5411 value: function activate() {
5412 Object.values(this.getAll(true)).forEach(function (callback) {
5413 callback.activate();
5414 });
5415 }
5416 }, {
5417 key: "deactivate",
5418 value: function deactivate() {
5419 Object.values(this.getAll(true)).forEach(function (callback) {
5420 callback.deactivate();
5421 });
5422 } // eslint-disable-next-line jsdoc/require-returns-check
5423
5424 /**
5425 * Function getType().
5426 *
5427 * Returns type eg: ( event, hook, etc ... ).
5428 *
5429 * @return {string} type
5430 */
5431
5432 }, {
5433 key: "getType",
5434 value: function getType() {
5435 (0, _forceMethodImplementation.default)();
5436 }
5437 }, {
5438 key: "get",
5439 value: function get(id) {
5440 return this.callbacksFlatList[id];
5441 }
5442 /**
5443 * Function getAll().
5444 *
5445 * Return all possible callbacks.
5446 *
5447 * @param {boolean} flat
5448 *
5449 * @return {{}} all callbacks
5450 */
5451
5452 }, {
5453 key: "getAll",
5454 value: function getAll() {
5455 var _this2 = this;
5456
5457 var flat = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
5458
5459 if (flat) {
5460 return this.callbacksFlatList;
5461 }
5462
5463 var result = {};
5464 Object.keys(this.callbacks).forEach(function (event) {
5465 if (!result[event]) {
5466 result[event] = [];
5467 }
5468
5469 Object.keys(_this2.callbacks[event]).forEach(function (command) {
5470 result[event].push({
5471 command: command,
5472 callbacks: _this2.callbacks[event][command]
5473 });
5474 });
5475 });
5476 return result;
5477 }
5478 /**
5479 * Function getCurrent();
5480 *
5481 * Return current command.
5482 *
5483 * @return {string} current command
5484 */
5485
5486 }, {
5487 key: "getCurrent",
5488 value: function getCurrent() {
5489 return this.current;
5490 }
5491 /**
5492 * Function getUsedIds().
5493 *
5494 * Returns the current used ids.
5495 *
5496 * @return {Array} used IDs
5497 */
5498
5499 }, {
5500 key: "getUsedIds",
5501 value: function getUsedIds() {
5502 return this.usedIds;
5503 }
5504 /**
5505 * Function getCallbacks().
5506 *
5507 * Get available callbacks for specific event and command.
5508 *
5509 * @param {string} event
5510 * @param {string} command
5511 * @param {*} args
5512 * @return {(Array | boolean)} callbacks
5513 */
5514
5515 }, {
5516 key: "getCallbacks",
5517 value: function getCallbacks(event, command, args) {
5518 var _args$containers = args.containers,
5519 containers = _args$containers === void 0 ? [args.container] : _args$containers,
5520 containerType = containers[0] ? containers[0].type : false;
5521 var callbacks = [];
5522
5523 if (this.callbacks[event] && this.callbacks[event][command]) {
5524 if (containerType && this.callbacks[event][command][containerType]) {
5525 callbacks = callbacks.concat(this.callbacks[event][command][containerType]);
5526 }
5527
5528 if (this.callbacks[event][command].all) {
5529 callbacks = callbacks.concat(this.callbacks[event][command].all);
5530 }
5531 }
5532
5533 if (callbacks.length) {
5534 return callbacks;
5535 }
5536
5537 return false;
5538 }
5539 /**
5540 * function checkEvent().
5541 *
5542 * Validate if the event is available.
5543 *
5544 * @param {string} event
5545 */
5546
5547 }, {
5548 key: "checkEvent",
5549 value: function checkEvent(event) {
5550 if (-1 === Object.keys(this.callbacks).indexOf(event)) {
5551 throw Error("".concat(this.getType(), ": '").concat(event, "' is not available."));
5552 }
5553 }
5554 /**
5555 * Function checkInstance().
5556 *
5557 * Validate given instance.
5558 *
5559 * @param {HookBase} instance
5560 */
5561
5562 }, {
5563 key: "checkInstance",
5564 value: function checkInstance(instance) {
5565 if (instance.getType() !== this.getType()) {
5566 throw new Error("invalid instance, please use: 'elementor-api/modules/hook-base.js'. ");
5567 }
5568 }
5569 /**
5570 * Function checkId().
5571 *
5572 * Validate if the id is not used before.
5573 *
5574 * @param {string} id
5575 */
5576
5577 }, {
5578 key: "checkId",
5579 value: function checkId(id) {
5580 if (-1 !== this.usedIds.indexOf(id)) {
5581 throw Error("id: '".concat(id, "' is already in use."));
5582 }
5583 }
5584 /**
5585 * Function shouldRun().
5586 *
5587 * Determine if the event should run.
5588 *
5589 * @param {Array} callbacks
5590 *
5591 * @return {boolean} true if there are callbacks, otherwise false
5592 *
5593 * @throws {Error}
5594 */
5595
5596 }, {
5597 key: "shouldRun",
5598 value: function shouldRun(callbacks) {
5599 return !!callbacks && callbacks.length;
5600 }
5601 /**
5602 * Function register().
5603 *
5604 * Register the callback instance.
5605 *
5606 * @param {string} event
5607 * @param {HookBase} instance
5608 *
5609 * @return {{}} Created callback
5610 */
5611
5612 }, {
5613 key: "register",
5614 value: function register(event, instance) {
5615 var command = instance.getCommand(),
5616 id = instance.getId(),
5617 containerType = instance.getContainerType();
5618 this.checkEvent(event);
5619 this.checkInstance(instance);
5620 this.checkId(id);
5621 return this.registerCallback(id, event, command, instance, containerType);
5622 }
5623 /**
5624 * Function registerCallback().
5625 *
5626 * Register callback.
5627 *
5628 * @param {string} id
5629 * @param {string} event
5630 * @param {string} command
5631 * @param {HookBase} instance
5632 * @param {string} containerType
5633 *
5634 * TODO: Consider replace with typedef.
5635 * @return {{callback: *, id: *, isActive: boolean}} callback
5636 */
5637
5638 }, {
5639 key: "registerCallback",
5640 value: function registerCallback(id, event, command, instance, containerType) {
5641 if (!this.callbacks[event][command]) {
5642 this.callbacks[event][command] = [];
5643 } // Save used id(s).
5644
5645
5646 this.usedIds.push(id);
5647
5648 if (!this.callbacks[event][command]) {
5649 this.callbacks[event][command] = {};
5650 } // TODO: Create HookCallback class/type.
5651
5652
5653 var callback = {
5654 id: id,
5655 callback: instance.run.bind(instance),
5656 isActive: true,
5657 activate: function activate() {
5658 this.isActive = true;
5659 },
5660 deactivate: function deactivate() {
5661 this.isActive = false;
5662 }
5663 };
5664
5665 if (containerType) {
5666 if (!this.callbacks[event][command][containerType]) {
5667 this.callbacks[event][command][containerType] = [];
5668 }
5669
5670 this.callbacks[event][command][containerType].push(callback);
5671 } else {
5672 if (!this.callbacks[event][command].all) {
5673 this.callbacks[event][command].all = [];
5674 }
5675
5676 this.callbacks[event][command].all.push(callback);
5677 }
5678
5679 this.callbacksFlatList[callback.id] = callback;
5680 return callback;
5681 }
5682 /**
5683 * Function run().
5684 *
5685 * Run the callbacks.
5686 *
5687 * @param {string} event
5688 * @param {string} command
5689 * @param {{}} args
5690 * @param {*} result
5691 *
5692 * @return {*} results
5693 */
5694
5695 }, {
5696 key: "run",
5697 value: function run(event, command, args) {
5698 var result = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : undefined;
5699 var callbacks = this.getCallbacks(event, command, args);
5700
5701 if (this.shouldRun(callbacks)) {
5702 this.current = command;
5703 this.onRun(command, args, event);
5704 return this.runCallbacks(event, command, callbacks, args, result);
5705 }
5706
5707 return false;
5708 }
5709 /**
5710 * Function runCallbacks().
5711 *
5712 * Run's the given callbacks.
5713 *
5714 * @param {string} event
5715 * @param {string} command
5716 * @param {Array} callbacks
5717 * @param {{}} args
5718 * @param {[]} result
5719 */
5720
5721 }, {
5722 key: "runCallbacks",
5723 value: function runCallbacks(event, command, callbacks, args, result) {
5724 var callbacksResult = [];
5725
5726 for (var i in callbacks) {
5727 var callback = callbacks[i];
5728
5729 if (!callback.isActive) {
5730 continue;
5731 } // If not exist, set zero.
5732
5733
5734 if (undefined === this.depth[event][callback.id]) {
5735 this.depth[event][callback.id] = 0;
5736 }
5737
5738 this.depth[event][callback.id]++; // Prevent recursive hooks.
5739
5740 if (1 === this.depth[event][callback.id]) {
5741 this.onCallback(command, args, event, callback.id);
5742
5743 try {
5744 var callbackResult = this.runCallback(event, callback, args, result);
5745
5746 if (!callbackResult) {
5747 throw Error("Callback failed, event: '".concat(event, "'"));
5748 }
5749
5750 callbacksResult.push(callbackResult);
5751 } catch (e) {
5752 // If its 'Hook-Break' then parent `try {}` will handle it.
5753 if (e instanceof $e.modules.HookBreak) {
5754 throw e;
5755 }
5756
5757 _helpers.default.consoleError(e);
5758 }
5759 }
5760
5761 this.depth[event][callback.id]--;
5762 }
5763
5764 return callbacksResult;
5765 } // eslint-disable-next-line jsdoc/require-returns-check
5766
5767 /**
5768 * Function runCallback().
5769 *
5770 * Run's the given callback.
5771 *
5772 * @param {string} event
5773 * @param {{}} callback
5774 * @param {{}} args
5775 * @param {*} result
5776 *
5777 * @return {*} results
5778 *
5779 * @throws {Error}
5780 */
5781
5782 }, {
5783 key: "runCallback",
5784 value: function runCallback(event, callback, args, result) {
5785 // eslint-disable-line no-unused-vars
5786 (0, _forceMethodImplementation.default)();
5787 }
5788 /**
5789 * Function onRun().
5790 *
5791 * Called before run a set of callbacks.
5792 *
5793 * @param {string} command
5794 * @param {{}} args
5795 * @param {string} event
5796 *
5797 * @throws {Error}
5798 */
5799
5800 }, {
5801 key: "onRun",
5802 value: function onRun(command, args, event) {
5803 // eslint-disable-line no-unused-vars
5804 (0, _forceMethodImplementation.default)();
5805 }
5806 /**
5807 * Function onCallback().
5808 *
5809 * Called before a single callback.
5810 *
5811 * @param {string} command
5812 * @param {{}} args
5813 * @param {string} event
5814 * @param {string} id
5815 *
5816 * @throws {Error}
5817 */
5818
5819 }, {
5820 key: "onCallback",
5821 value: function onCallback(command, args, event, id) {
5822 // eslint-disable-line no-unused-vars
5823 (0, _forceMethodImplementation.default)();
5824 }
5825 }]);
5826 return HooksBase;
5827 }(_module.default);
5828
5829 exports["default"] = HooksBase;
5830
5831 /***/ }),
5832
5833 /***/ "../modules/web-cli/assets/js/core/hooks/data.js":
5834 /*!*******************************************************!*\
5835 !*** ../modules/web-cli/assets/js/core/hooks/data.js ***!
5836 \*******************************************************/
5837 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
5838
5839 "use strict";
5840
5841
5842 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
5843
5844 Object.defineProperty(exports, "__esModule", ({
5845 value: true
5846 }));
5847 exports["default"] = void 0;
5848
5849 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
5850
5851 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
5852
5853 var _get2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/get */ "../node_modules/@babel/runtime/helpers/get.js"));
5854
5855 var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
5856
5857 var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
5858
5859 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
5860
5861 var _base = _interopRequireDefault(__webpack_require__(/*! ./base.js */ "../modules/web-cli/assets/js/core/hooks/base.js"));
5862
5863 function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
5864
5865 function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
5866
5867 var Data = /*#__PURE__*/function (_HooksBase) {
5868 (0, _inherits2.default)(Data, _HooksBase);
5869
5870 var _super = _createSuper(Data);
5871
5872 function Data() {
5873 var _this;
5874
5875 (0, _classCallCheck2.default)(this, Data);
5876
5877 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
5878 args[_key] = arguments[_key];
5879 }
5880
5881 _this = _super.call.apply(_super, [this].concat(args));
5882 _this.callbacks.dependency = {};
5883 _this.depth.dependency = {};
5884 return _this;
5885 }
5886
5887 (0, _createClass2.default)(Data, [{
5888 key: "getType",
5889 value: function getType() {
5890 return 'data';
5891 }
5892 }, {
5893 key: "runCallback",
5894 value: function runCallback(event, callback, args, result) {
5895 switch (event) {
5896 case 'dependency':
5897 {
5898 // If callback returns false and its dependency, then 'Hook-Break'.
5899 if (!callback.callback(args)) {
5900 this.depth[event][callback.id]--; // Throw custom break to be catch by the base for 'Safe' exit.
5901
5902 throw new $e.modules.HookBreak();
5903 }
5904
5905 return true;
5906 }
5907
5908 case 'catch':
5909 case 'after':
5910 {
5911 /**
5912 * When handling HOOK which is data after (not breakable),
5913 * even the result of the callback is negative, it is required to return positive,
5914 * since result of runCallback determine if the callback succeeded.
5915 */
5916 return callback.callback(args, result) || 'after' === event;
5917 }
5918 }
5919
5920 return false;
5921 }
5922 }, {
5923 key: "shouldRun",
5924 value: function shouldRun(callbacks) {
5925 return (0, _get2.default)((0, _getPrototypeOf2.default)(Data.prototype), "shouldRun", this).call(this, callbacks) && elementor.documents.getCurrent().history.getActive();
5926 }
5927 }, {
5928 key: "onRun",
5929 value: function onRun(command, args, event) {
5930 if (!$e.devTools) {
5931 return;
5932 }
5933
5934 $e.devTools.log.callbacks().run(this.getType(), command, args, event);
5935 }
5936 }, {
5937 key: "onCallback",
5938 value: function onCallback(command, args, event, id) {
5939 if (!$e.devTools) {
5940 return;
5941 }
5942
5943 $e.devTools.log.callbacks().callback(this.getType(), command, args, event, id);
5944 }
5945 }]);
5946 return Data;
5947 }(_base.default);
5948
5949 exports["default"] = Data;
5950
5951 /***/ }),
5952
5953 /***/ "../modules/web-cli/assets/js/core/hooks/ui.js":
5954 /*!*****************************************************!*\
5955 !*** ../modules/web-cli/assets/js/core/hooks/ui.js ***!
5956 \*****************************************************/
5957 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
5958
5959 "use strict";
5960
5961
5962 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
5963
5964 Object.defineProperty(exports, "__esModule", ({
5965 value: true
5966 }));
5967 exports["default"] = void 0;
5968
5969 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
5970
5971 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
5972
5973 var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
5974
5975 var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
5976
5977 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
5978
5979 var _base = _interopRequireDefault(__webpack_require__(/*! ./base */ "../modules/web-cli/assets/js/core/hooks/base.js"));
5980
5981 function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
5982
5983 function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
5984
5985 var Ui = /*#__PURE__*/function (_HooksBase) {
5986 (0, _inherits2.default)(Ui, _HooksBase);
5987
5988 var _super = _createSuper(Ui);
5989
5990 function Ui() {
5991 var _this;
5992
5993 (0, _classCallCheck2.default)(this, Ui);
5994
5995 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
5996 args[_key] = arguments[_key];
5997 }
5998
5999 _this = _super.call.apply(_super, [this].concat(args));
6000 _this.callbacks.before = {};
6001 _this.depth.before = {};
6002 return _this;
6003 }
6004
6005 (0, _createClass2.default)(Ui, [{
6006 key: "getType",
6007 value: function getType() {
6008 return 'ui';
6009 }
6010 }, {
6011 key: "runCallback",
6012 value: function runCallback(event, callback, args, result) {
6013 switch (event) {
6014 case 'before':
6015 callback.callback(args);
6016 break;
6017
6018 case 'catch':
6019 case 'after':
6020 callback.callback(args, result);
6021 break;
6022
6023 default:
6024 return false;
6025 }
6026
6027 return true;
6028 }
6029 }, {
6030 key: "onRun",
6031 value: function onRun(command, args, event) {
6032 if (!$e.devTools) {
6033 return;
6034 }
6035
6036 $e.devTools.log.callbacks().run(this.getType(), command, args, event);
6037 }
6038 }, {
6039 key: "onCallback",
6040 value: function onCallback(command, args, event, id) {
6041 if (!$e.devTools) {
6042 return;
6043 }
6044
6045 $e.devTools.log.callbacks().callback(this.getType(), command, args, event, id);
6046 }
6047 }]);
6048 return Ui;
6049 }(_base.default);
6050
6051 exports["default"] = Ui;
6052
6053 /***/ }),
6054
6055 /***/ "../modules/web-cli/assets/js/core/routes.js":
6056 /*!***************************************************!*\
6057 !*** ../modules/web-cli/assets/js/core/routes.js ***!
6058 \***************************************************/
6059 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
6060
6061 "use strict";
6062
6063
6064 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
6065
6066 Object.defineProperty(exports, "__esModule", ({
6067 value: true
6068 }));
6069 exports["default"] = void 0;
6070
6071 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
6072
6073 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
6074
6075 var _get2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/get */ "../node_modules/@babel/runtime/helpers/get.js"));
6076
6077 var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
6078
6079 var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
6080
6081 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
6082
6083 var _commands = _interopRequireDefault(__webpack_require__(/*! ./commands */ "../modules/web-cli/assets/js/core/commands.js"));
6084
6085 function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
6086
6087 function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
6088
6089 var Routes = /*#__PURE__*/function (_Commands) {
6090 (0, _inherits2.default)(Routes, _Commands);
6091
6092 var _super = _createSuper(Routes);
6093
6094 function Routes() {
6095 var _this;
6096
6097 (0, _classCallCheck2.default)(this, Routes);
6098
6099 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
6100 args[_key] = arguments[_key];
6101 }
6102
6103 _this = _super.call.apply(_super, [this].concat(args));
6104 _this.savedStates = {};
6105 _this.historyPerComponent = {};
6106 return _this;
6107 }
6108
6109 (0, _createClass2.default)(Routes, [{
6110 key: "refreshContainer",
6111 value: function refreshContainer(container) {
6112 var currentRoute = this.getCurrent(container),
6113 currentArgs = this.getCurrentArgs(container);
6114 this.clearCurrent(container);
6115 this.to(currentRoute, currentArgs);
6116 }
6117 }, {
6118 key: "getHistory",
6119 value: function getHistory() {
6120 var namespaceRoot = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
6121
6122 if (namespaceRoot) {
6123 return this.historyPerComponent[namespaceRoot] || [];
6124 }
6125
6126 return this.historyPerComponent;
6127 }
6128 }, {
6129 key: "clearHistory",
6130 value: function clearHistory(namespaceRoot) {
6131 delete this.historyPerComponent[namespaceRoot];
6132 }
6133 }, {
6134 key: "clearCurrent",
6135 value: function clearCurrent(container) {
6136 var route = this.current[container];
6137
6138 if (!route) {
6139 return;
6140 }
6141
6142 delete this.current[container];
6143 delete this.currentArgs[container];
6144 this.getComponent(route).onCloseRoute(route);
6145 }
6146 }, {
6147 key: "clear",
6148 value: function clear() {
6149 var _this2 = this;
6150
6151 Object.keys(this.current).forEach(function (container) {
6152 return _this2.clearCurrent(container);
6153 });
6154 }
6155 }, {
6156 key: "saveState",
6157 value: function saveState(container) {
6158 this.savedStates[container] = {
6159 route: this.current[container],
6160 args: this.currentArgs[container]
6161 };
6162 return this;
6163 }
6164 }, {
6165 key: "restoreState",
6166 value: function restoreState(container) {
6167 if (!this.savedStates[container]) {
6168 return false;
6169 }
6170
6171 this.to(this.savedStates[container].route, this.savedStates[container].args);
6172 return true;
6173 }
6174 }, {
6175 key: "beforeRun",
6176 value: function beforeRun(route, args) {
6177 if (!(0, _get2.default)((0, _getPrototypeOf2.default)(Routes.prototype), "beforeRun", this).call(this, route, args)) {
6178 return false;
6179 }
6180
6181 if (this.is(route, args) && !args.refresh) {
6182 return false;
6183 }
6184
6185 var component = this.getComponent(route),
6186 container = component.getRootContainer(),
6187 oldRoute = this.current[container];
6188
6189 if (oldRoute) {
6190 this.getComponent(oldRoute).onCloseRoute(oldRoute);
6191 }
6192
6193 if (!component.isOpen || args.reOpen) {
6194 component.isOpen = component.open(args);
6195 }
6196
6197 return component.isOpen;
6198 }
6199 }, {
6200 key: "to",
6201 value: function to(route, args) {
6202 this.run(route, args);
6203 var namespaceRoot = this.getComponent(route).getRootContainer();
6204
6205 if (!this.historyPerComponent[namespaceRoot]) {
6206 this.historyPerComponent[namespaceRoot] = [];
6207 }
6208
6209 this.historyPerComponent[namespaceRoot].push({
6210 route: route,
6211 args: args
6212 });
6213 }
6214 }, {
6215 key: "back",
6216 value: function back(namespaceRoot) {
6217 var history = this.getHistory(namespaceRoot); // Remove current;
6218
6219 history.pop();
6220 var last = history.pop();
6221
6222 if (!last) {
6223 return;
6224 }
6225
6226 this.to(last.route, last.args);
6227 } // Don't use the event object.
6228
6229 }, {
6230 key: "runShortcut",
6231 value: function runShortcut(command) {
6232 this.to(command);
6233 } // Don't clear current route.
6234
6235 }, {
6236 key: "afterRun",
6237 value: function afterRun(route, args) {
6238 this.getComponent(route).onRoute(route, args);
6239 }
6240 }, {
6241 key: "is",
6242 value: function is(route) {
6243 var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
6244
6245 if (!(0, _get2.default)((0, _getPrototypeOf2.default)(Routes.prototype), "is", this).call(this, route)) {
6246 return false;
6247 }
6248
6249 var container = this.getComponent(route).getRootContainer();
6250 return _.isEqual(args, this.currentArgs[container]);
6251 }
6252 }, {
6253 key: "isPartOf",
6254 value: function isPartOf(route) {
6255 /**
6256 * Check against current command hierarchically.
6257 * For example `is( 'panel' )` will be true for `panel/elements`
6258 * `is( 'panel/editor' )` will be true for `panel/editor/style`
6259 */
6260 var parts = route.split('/'),
6261 container = parts[0],
6262 toCheck = [],
6263 currentParts = this.current[container] ? this.current[container].split('/') : [];
6264 var match = false;
6265 currentParts.forEach(function (part) {
6266 toCheck.push(part);
6267
6268 if (toCheck.join('/') === route) {
6269 match = true;
6270 }
6271 });
6272 return match;
6273 }
6274 }, {
6275 key: "error",
6276 value: function error(message) {
6277 throw Error('Routes: ' + message);
6278 }
6279 }]);
6280 return Routes;
6281 }(_commands.default);
6282
6283 exports["default"] = Routes;
6284
6285 /***/ }),
6286
6287 /***/ "../modules/web-cli/assets/js/core/shortcuts.js":
6288 /*!******************************************************!*\
6289 !*** ../modules/web-cli/assets/js/core/shortcuts.js ***!
6290 \******************************************************/
6291 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
6292
6293 "use strict";
6294
6295
6296 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
6297
6298 Object.defineProperty(exports, "__esModule", ({
6299 value: true
6300 }));
6301 exports["default"] = void 0;
6302
6303 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
6304
6305 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
6306
6307 var _environment = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/environment */ "../modules/web-cli/assets/js/utils/environment.js"));
6308
6309 var _helpers = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/helpers */ "../modules/web-cli/assets/js/utils/helpers.js"));
6310
6311 var Shortcuts = /*#__PURE__*/function () {
6312 function Shortcuts($window) {
6313 (0, _classCallCheck2.default)(this, Shortcuts);
6314 this.specialKeys = {
6315 13: 'enter',
6316 27: 'esc',
6317 38: 'up',
6318 40: 'down',
6319 46: 'del',
6320 191: '?'
6321 };
6322 this.component = '';
6323 this.handlers = {};
6324 this.bindListener($window);
6325 }
6326
6327 (0, _createClass2.default)(Shortcuts, [{
6328 key: "bindListener",
6329 value: function bindListener($window) {
6330 var _this = this;
6331
6332 $window.on('keydown', function (event) {
6333 return _this.handle(event);
6334 });
6335 }
6336 }, {
6337 key: "getAll",
6338 value: function getAll() {
6339 var shortcuts = {};
6340 jQuery.each(this.handlers, function (key, handler) {
6341 jQuery.each(handler, function (index, config) {
6342 shortcuts[config.command] = key;
6343 });
6344 });
6345 return shortcuts;
6346 }
6347 /**
6348 * @param {string} shortcuts
6349 * @param {Object} args
6350 * @param {Function} args.callback Required
6351 * @param {string} args.component Optional
6352 * @param {Function} args.dependency Optional
6353 * @param {Array} args.exclude Optional
6354 * @param {boolean} args.allowAltKey Optional
6355 */
6356
6357 }, {
6358 key: "register",
6359 value: function register(shortcuts, args) {
6360 var _this2 = this;
6361
6362 shortcuts.replace(' ', '').split(',').forEach(function (shortcut) {
6363 if (!_this2.handlers[shortcut]) {
6364 _this2.handlers[shortcut] = [];
6365 }
6366
6367 _this2.handlers[shortcut].push(args);
6368 });
6369 }
6370 }, {
6371 key: "unregister",
6372 value: function unregister(shortcuts, args) {
6373 var _this3 = this;
6374
6375 shortcuts.replace(' ', '').split(',').forEach(function (shortcut) {
6376 _this3.handlers[shortcut].forEach(function (index, handler) {
6377 if (args === handler) {
6378 delete _this3.handlers[shortcut][index];
6379 }
6380 });
6381 });
6382 }
6383 }, {
6384 key: "handle",
6385 value: function handle(event) {
6386 var handlers = this.getHandlersByPriority(event);
6387
6388 if (!handlers) {
6389 return;
6390 }
6391
6392 var filteredHandlers = handlers.filter(function (handler) {
6393 if (handler.exclude && -1 !== handler.exclude.indexOf('input')) {
6394 var $target = jQuery(event.target);
6395
6396 if ($target.is(':input, .elementor-input') || $target.closest('[contenteditable="true"]').length) {
6397 return false;
6398 }
6399 }
6400
6401 if (handler.dependency && !handler.dependency(event)) {
6402 return false;
6403 } // Fix for some keyboard sources that consider alt key as ctrl key
6404
6405
6406 if (!handler.allowAltKey && event.altKey) {
6407 return false;
6408 }
6409
6410 return true;
6411 });
6412
6413 if (!filteredHandlers.length) {
6414 return;
6415 }
6416
6417 if (1 < filteredHandlers.length && elementorWebCliConfig.isDebug) {
6418 _helpers.default.consoleWarn('Multiple handlers for shortcut.', filteredHandlers, event);
6419 }
6420
6421 event.preventDefault();
6422 filteredHandlers[0].callback(event);
6423 }
6424 }, {
6425 key: "isControlEvent",
6426 value: function isControlEvent(event) {
6427 return event[_environment.default.mac ? 'metaKey' : 'ctrlKey'];
6428 }
6429 }, {
6430 key: "getEventShortcut",
6431 value: function getEventShortcut(event) {
6432 var shortcut = [];
6433
6434 if (event.altKey) {
6435 shortcut.push('alt');
6436 }
6437
6438 if (this.isControlEvent(event)) {
6439 shortcut.push('ctrl');
6440 }
6441
6442 if (event.shiftKey) {
6443 shortcut.push('shift');
6444 }
6445
6446 if (this.specialKeys[event.which]) {
6447 shortcut.push(this.specialKeys[event.which]);
6448 } else {
6449 shortcut.push(String.fromCharCode(event.which).toLowerCase());
6450 }
6451
6452 return shortcut.join('+');
6453 }
6454 }, {
6455 key: "isActiveScope",
6456 value: function isActiveScope(scopes) {
6457 var activeComponents = Object.keys($e.components.activeComponents),
6458 activeComponent = activeComponents[activeComponents.length - 1],
6459 component = $e.components.get(activeComponent);
6460
6461 if (!component) {
6462 return false;
6463 }
6464
6465 var namespace = component.getNamespace();
6466 var filteredByNamespace = scopes.some(function (scope) {
6467 return namespace === scope;
6468 });
6469
6470 if (filteredByNamespace) {
6471 return true;
6472 } // Else filter by namespaceRoot.
6473
6474
6475 var namespaceRoot = component.getRootContainer();
6476 return scopes.some(function (scope) {
6477 return namespaceRoot === scope;
6478 });
6479 }
6480 }, {
6481 key: "getHandlersByPriority",
6482 value: function getHandlersByPriority(event) {
6483 var _this4 = this;
6484
6485 var handlers = this.handlers[this.getEventShortcut(event)];
6486
6487 if (!handlers) {
6488 return false;
6489 } // TODO: Prioritize current scope before roo scope.
6490
6491
6492 var inCurrentScope = handlers.filter(function (handler) {
6493 return handler.scopes && _this4.isActiveScope(handler.scopes);
6494 });
6495
6496 if (inCurrentScope.length) {
6497 return inCurrentScope;
6498 }
6499
6500 var noScope = handlers.filter(function (handler) {
6501 return !handler.scopes;
6502 });
6503
6504 if (noScope.length) {
6505 return noScope;
6506 }
6507 }
6508 }]);
6509 return Shortcuts;
6510 }();
6511
6512 exports["default"] = Shortcuts;
6513
6514 /***/ }),
6515
6516 /***/ "../modules/web-cli/assets/js/core/store.js":
6517 /*!**************************************************!*\
6518 !*** ../modules/web-cli/assets/js/core/store.js ***!
6519 \**************************************************/
6520 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
6521
6522 "use strict";
6523
6524
6525 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
6526
6527 Object.defineProperty(exports, "__esModule", ({
6528 value: true
6529 }));
6530 exports["default"] = void 0;
6531
6532 var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js"));
6533
6534 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
6535
6536 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
6537
6538 var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
6539
6540 var _toolkit = __webpack_require__(/*! @reduxjs/toolkit */ "../node_modules/@reduxjs/toolkit/dist/redux-toolkit.esm.js");
6541
6542 function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
6543
6544 function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
6545
6546 /**
6547 * @typedef {import('@reduxjs/toolkit').Slice} Slice
6548 */
6549
6550 /**
6551 * @typedef {import('@reduxjs/toolkit').EnhancedStore} EnhancedStore
6552 */
6553
6554 /**
6555 * @typedef {import('@reduxjs/toolkit').AnyAction} AnyAction
6556 */
6557
6558 /**
6559 * @typedef {import('@reduxjs/toolkit').ThunkMiddlewareFor} ThunkMiddlewareFor
6560 */
6561 var Store = /*#__PURE__*/function () {
6562 /**
6563 * @type {Object}
6564 */
6565
6566 /**
6567 * @type {EnhancedStore<{}, AnyAction, [ThunkMiddlewareFor<{}>]>}
6568 */
6569
6570 /**
6571 * Initialize the Store.
6572 *
6573 * @return {void}
6574 */
6575 function Store() {
6576 (0, _classCallCheck2.default)(this, Store);
6577 (0, _defineProperty2.default)(this, "slices", {});
6578 (0, _defineProperty2.default)(this, "reduxStore", void 0);
6579 this.slices = {};
6580 this.reduxStore = this.createStore();
6581 }
6582 /**
6583 * Create a Redux Store object.
6584 *
6585 * @return {EnhancedStore<{}, AnyAction, [ThunkMiddlewareFor<{}>]>} store
6586 */
6587
6588
6589 (0, _createClass2.default)(Store, [{
6590 key: "createStore",
6591 value: function createStore() {
6592 return (0, _toolkit.configureStore)({
6593 // Use an empty function instead of empty object since an empty object
6594 // isn't a valid reducer value.
6595 reducer: function reducer() {}
6596 });
6597 }
6598 /**
6599 * Inject a new reducer.
6600 *
6601 * See: https://redux.js.org/usage/code-splitting#defining-an-injectreducer-function
6602 *
6603 * @param {string} id - Reducer unique ID.
6604 * @param {Function} newReducer - New reducer to inject.
6605 *
6606 * @return {void}
6607 */
6608
6609 }, {
6610 key: "injectReducer",
6611 value: function injectReducer(id, newReducer) {
6612 var prevReducers = this.getReducers();
6613 this.reduxStore.replaceReducer((0, _toolkit.combineReducers)(_objectSpread(_objectSpread({}, prevReducers), {}, (0, _defineProperty2.default)({}, id, newReducer))));
6614 }
6615 /**
6616 * Register a Redux Store slice.
6617 *
6618 * @param {string} sliceId - Slice unique ID.
6619 * @param {Slice} instance - Slice object to add.
6620 *
6621 * @return {void}
6622 */
6623
6624 }, {
6625 key: "register",
6626 value: function register(sliceId, instance) {
6627 if (this.slices[sliceId]) {
6628 throw "Slice with ID '".concat(sliceId, "' already exists.");
6629 }
6630
6631 this.slices[sliceId] = instance;
6632 this.injectReducer(sliceId, instance.reducer);
6633 }
6634 /**
6635 * Get a specific slice.
6636 *
6637 * @param {string|null} sliceId - Slice ID to get.
6638 *
6639 * @return {Slice} slice
6640 */
6641
6642 }, {
6643 key: "get",
6644 value: function get(sliceId) {
6645 return this.slices[sliceId];
6646 }
6647 /**
6648 * Get all slices.
6649 *
6650 * @return {Object} slices
6651 */
6652
6653 }, {
6654 key: "getAllSlices",
6655 value: function getAllSlices() {
6656 return this.slices;
6657 }
6658 /**
6659 * Get All slices.
6660 *
6661 * @return {Object} slices
6662 */
6663
6664 }, {
6665 key: "getAll",
6666 value: function getAll() {
6667 return Object.keys(this.slices).sort();
6668 }
6669 /**
6670 * Return the current reducers.
6671 *
6672 * @return {Object} reducers
6673 */
6674
6675 }, {
6676 key: "getReducers",
6677 value: function getReducers() {
6678 return Object.entries(this.slices).reduce(function (reducers, _ref) {
6679 var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
6680 key = _ref2[0],
6681 slice = _ref2[1];
6682
6683 return _objectSpread(_objectSpread({}, reducers), {}, (0, _defineProperty2.default)({}, key, slice.reducer));
6684 }, {});
6685 }
6686 /**
6687 * Get the actual Redux store object.
6688 *
6689 * @return {Object} redux store object
6690 */
6691
6692 }, {
6693 key: "getReduxStore",
6694 value: function getReduxStore() {
6695 return this.reduxStore;
6696 }
6697 /**
6698 * Proxy to Redux's `dispatch()` function.
6699 *
6700 * @return {*} the dispatched action
6701 */
6702
6703 }, {
6704 key: "dispatch",
6705 value: function dispatch() {
6706 var _this$reduxStore;
6707
6708 return (_this$reduxStore = this.reduxStore).dispatch.apply(_this$reduxStore, arguments);
6709 }
6710 /**
6711 * Proxy to Redux's `getState()` function.
6712 *
6713 * @return {*} The current state tree of the application
6714 */
6715
6716 }, {
6717 key: "getState",
6718 value: function getState() {
6719 var _this$reduxStore2;
6720
6721 return (_this$reduxStore2 = this.reduxStore).getState.apply(_this$reduxStore2, arguments);
6722 }
6723 /**
6724 * Proxy to Redux's `replaceReducer()` function.
6725 * TODO: Do we want that?
6726 *
6727 * @return {*} undefined
6728 */
6729
6730 }, {
6731 key: "replaceReducer",
6732 value: function replaceReducer() {
6733 var _this$reduxStore3;
6734
6735 return (_this$reduxStore3 = this.reduxStore).replaceReducer.apply(_this$reduxStore3, arguments);
6736 }
6737 /**
6738 * Proxy to Redux's `subscribe()` function.
6739 *
6740 * @return {*} A function that unsubscribes the change listener
6741 */
6742
6743 }, {
6744 key: "subscribe",
6745 value: function subscribe() {
6746 var _this$reduxStore4;
6747
6748 return (_this$reduxStore4 = this.reduxStore).subscribe.apply(_this$reduxStore4, arguments);
6749 }
6750 }]);
6751 return Store;
6752 }();
6753
6754 exports["default"] = Store;
6755
6756 /***/ }),
6757
6758 /***/ "../modules/web-cli/assets/js/core/ui-states.js":
6759 /*!******************************************************!*\
6760 !*** ../modules/web-cli/assets/js/core/ui-states.js ***!
6761 \******************************************************/
6762 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
6763
6764 "use strict";
6765
6766
6767 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
6768
6769 Object.defineProperty(exports, "__esModule", ({
6770 value: true
6771 }));
6772 exports["default"] = void 0;
6773
6774 var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js"));
6775
6776 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
6777
6778 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
6779
6780 /**
6781 * @typedef {import('./states/ui-state-base')} UiStateBase
6782 */
6783 var UiStates = /*#__PURE__*/function () {
6784 /**
6785 * Initialize the State Manager.
6786 *
6787 * @return {void}
6788 */
6789 function UiStates() {
6790 (0, _classCallCheck2.default)(this, UiStates);
6791 this.states = {};
6792 }
6793 /**
6794 * Register a new state.
6795 *
6796 * @param {UiStateBase} instance - State instance.
6797 */
6798
6799
6800 (0, _createClass2.default)(UiStates, [{
6801 key: "register",
6802 value: function register(instance) {
6803 var stateId = instance.getPrefixedId();
6804
6805 if (this.states[stateId]) {
6806 throw "State '".concat(stateId, "' already exists.");
6807 }
6808
6809 this.states[stateId] = instance;
6810 }
6811 /**
6812 * Get all existing states with their options:
6813 *
6814 * {
6815 * 'state-id': [
6816 * 'option-1',
6817 * 'option-2',
6818 * 'option-3',
6819 * ],
6820 * }
6821 *
6822 * @return {Object} all existing states
6823 */
6824
6825 }, {
6826 key: "getAll",
6827 value: function getAll() {
6828 var states = {};
6829 Object.entries(this.states).forEach(function (_ref) {
6830 var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
6831 id = _ref2[0],
6832 instance = _ref2[1];
6833
6834 var options = instance.getOptions();
6835 states[id] = Object.keys(options);
6836 });
6837 return states;
6838 }
6839 /**
6840 * Get the state value, or return all of them if no `state` is set.
6841 *
6842 * @param {string} state - State ID.
6843 *
6844 * @return {UiStateBase} state value
6845 */
6846
6847 }, {
6848 key: "get",
6849 value: function get(state) {
6850 if (state) {
6851 return this.states[state];
6852 }
6853
6854 return this.states;
6855 }
6856 /**
6857 * Set the current state value and trigger its callbacks & events.
6858 * This function triggers a `e-ui-state:${ stateID }` event to the scope, with `oldValue` & `newValue`
6859 * under `e.detail`.
6860 * Additionally, it adds a `e-ui-state--${ stateID }__${ value }` class to the scope element.
6861 *
6862 * @param {string} state - State ID.
6863 * @param {string} value - New state value.
6864 *
6865 * @return {void}
6866 */
6867
6868 }, {
6869 key: "set",
6870 value: function set(state, value) {
6871 // Invalid state or option.
6872 if (!this.get(state)) {
6873 throw "State '".concat(state, "' doesn't exist.");
6874 }
6875
6876 var oldValue = this.getCurrent(state),
6877 classPrefix = "e-ui-state--".concat(state.replaceAll('/', '-')),
6878 oldStateClass = "".concat(classPrefix, "__").concat(oldValue),
6879 newStateClass = "".concat(classPrefix, "__").concat(value),
6880 scopes = this.get(state).getScopes(); // Set the current state to the new value.
6881
6882 this.get(state).set(value);
6883 scopes.forEach(function (scope) {
6884 scope.classList.remove(oldStateClass); // Set the new class only if there is a value (i.e. it's not a state removal action).
6885
6886 if (value) {
6887 scope.classList.add(newStateClass);
6888 } // Dispatch a custom state-change event to the scope.
6889
6890
6891 var event = new CustomEvent("e-ui-state:".concat(state), {
6892 detail: {
6893 oldValue: oldValue,
6894 newValue: value
6895 }
6896 });
6897 scope.dispatchEvent(event);
6898 });
6899 }
6900 /**
6901 * Remove a state.
6902 *
6903 * @param {string} state - State ID.
6904 *
6905 * @return {void}
6906 */
6907
6908 }, {
6909 key: "remove",
6910 value: function remove(state) {
6911 this.set(state, '');
6912 }
6913 /**
6914 * Get the current state value.
6915 *
6916 * @param {string} state - State ID.
6917 *
6918 * @return {string} current state value
6919 */
6920
6921 }, {
6922 key: "getCurrent",
6923 value: function getCurrent(state) {
6924 var _this$get;
6925
6926 return (_this$get = this.get(state)) === null || _this$get === void 0 ? void 0 : _this$get.getCurrent();
6927 }
6928 }]);
6929 return UiStates;
6930 }();
6931
6932 exports["default"] = UiStates;
6933
6934 /***/ }),
6935
6936 /***/ "../modules/web-cli/assets/js/extras/hash-commands.js":
6937 /*!************************************************************!*\
6938 !*** ../modules/web-cli/assets/js/extras/hash-commands.js ***!
6939 \************************************************************/
6940 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
6941
6942 "use strict";
6943
6944
6945 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
6946
6947 Object.defineProperty(exports, "__esModule", ({
6948 value: true
6949 }));
6950 exports["default"] = void 0;
6951
6952 var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ "../node_modules/@babel/runtime/regenerator/index.js"));
6953
6954 var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "../node_modules/@babel/runtime/helpers/asyncToGenerator.js"));
6955
6956 var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js"));
6957
6958 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
6959
6960 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
6961
6962 var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
6963
6964 var _helpers = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/helpers */ "../modules/web-cli/assets/js/utils/helpers.js"));
6965
6966 function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, 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 normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
6967
6968 function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
6969
6970 function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
6971
6972 var HashCommands = /*#__PURE__*/function () {
6973 /**
6974 * Cannot be static since it uses callback(s) that are available only after '$e' is initialized.
6975 */
6976
6977 /**
6978 * @typedef HashCommand
6979 * @property {string} method method
6980 * @property {string} command command
6981 * @property {Object} args arguments
6982 */
6983
6984 /**
6985 * List of current loaded hash commands.
6986 *
6987 * @type {Array.<HashCommand>}
6988 */
6989 function HashCommands() {
6990 (0, _classCallCheck2.default)(this, HashCommands);
6991 (0, _defineProperty2.default)(this, "dispatchersList", {
6992 'e:run': {
6993 runner: function runner() {
6994 return $e.run;
6995 },
6996 isSafe: function isSafe(command) {
6997 var _$e$commands$getComma;
6998
6999 return (_$e$commands$getComma = $e.commands.getCommandClass(command)) === null || _$e$commands$getComma === void 0 ? void 0 : _$e$commands$getComma.getInfo().isSafe;
7000 },
7001 isSafeWithArgs: function isSafeWithArgs(command) {
7002 var _$e$commands$getComma2;
7003
7004 return (_$e$commands$getComma2 = $e.commands.getCommandClass(command)) === null || _$e$commands$getComma2 === void 0 ? void 0 : _$e$commands$getComma2.getInfo().isSafeWithArgs;
7005 }
7006 },
7007 'e:route': {
7008 runner: function runner() {
7009 return $e.route;
7010 },
7011 isSafe: function isSafe() {
7012 return true;
7013 },
7014 isSafeWithArgs: function isSafeWithArgs() {
7015 return false;
7016 }
7017 }
7018 });
7019 (0, _defineProperty2.default)(this, "commands", []);
7020 this.commands = this.get();
7021 }
7022 /**
7023 * Function get().
7024 *
7025 * Get API requests that comes from hash ( eg #e:run ).
7026 *
7027 * @param {string} hash
7028 *
7029 * @return {Array.<HashCommand>} API requests
7030 */
7031
7032
7033 (0, _createClass2.default)(HashCommands, [{
7034 key: "get",
7035 value: function get() {
7036 var _this = this;
7037
7038 var hash = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : location.hash;
7039 var result = [];
7040
7041 if (hash) {
7042 // Remove first '#' and split each '&'.
7043 var hashList = hash.substr(1).split('&');
7044 hashList.forEach(function (hashItem) {
7045 // eslint-disable-next-line @wordpress/no-unused-vars-before-return
7046 var _hashItem$split = hashItem.split('?'),
7047 _hashItem$split2 = (0, _slicedToArray2.default)(_hashItem$split, 2),
7048 rawCommand = _hashItem$split2[0],
7049 rawArgs = _hashItem$split2[1];
7050
7051 var hashParts = rawCommand.split(':');
7052
7053 if (3 !== hashParts.length) {
7054 return;
7055 }
7056
7057 var method = hashParts[0] + ':' + hashParts[1],
7058 dispatcher = _this.dispatchersList[method];
7059
7060 if (dispatcher) {
7061 var command = hashParts[2],
7062 args = _this.parseCommandArgs(rawArgs);
7063
7064 result.push({
7065 method: method,
7066 command: command,
7067 args: args
7068 });
7069 }
7070 });
7071 }
7072
7073 return result;
7074 }
7075 /**
7076 * Function run().
7077 *
7078 * Run API requests that comes from hash ( eg #e:run ).
7079 *
7080 * @param {Array.<HashCommand>} [commands=this.commands]
7081 */
7082
7083 }, {
7084 key: "run",
7085 value: function () {
7086 var _run = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
7087 var commands,
7088 _iterator,
7089 _step,
7090 hashCommand,
7091 dispatcher,
7092 _iterator2,
7093 _step2,
7094 _hashCommand,
7095 _dispatcher,
7096 _args = arguments;
7097
7098 return _regenerator.default.wrap(function _callee$(_context) {
7099 while (1) {
7100 switch (_context.prev = _context.next) {
7101 case 0:
7102 commands = _args.length > 0 && _args[0] !== undefined ? _args[0] : this.commands;
7103 // To allow validate the run first.
7104 _iterator = _createForOfIteratorHelper(commands);
7105 _context.prev = 2;
7106
7107 _iterator.s();
7108
7109 case 4:
7110 if ((_step = _iterator.n()).done) {
7111 _context.next = 13;
7112 break;
7113 }
7114
7115 hashCommand = _step.value;
7116 dispatcher = this.dispatchersList[hashCommand.method];
7117
7118 if (dispatcher) {
7119 _context.next = 9;
7120 break;
7121 }
7122
7123 return _context.abrupt("return", Promise.reject(new Error("No dispatcher found for the command: `".concat(hashCommand.command, "`."))));
7124
7125 case 9:
7126 if (dispatcher.isSafe(hashCommand.command)) {
7127 _context.next = 11;
7128 break;
7129 }
7130
7131 return _context.abrupt("return", Promise.reject(new Error("Attempting to run unsafe or non exist command: `".concat(hashCommand.command, "`."))));
7132
7133 case 11:
7134 _context.next = 4;
7135 break;
7136
7137 case 13:
7138 _context.next = 18;
7139 break;
7140
7141 case 15:
7142 _context.prev = 15;
7143 _context.t0 = _context["catch"](2);
7144
7145 _iterator.e(_context.t0);
7146
7147 case 18:
7148 _context.prev = 18;
7149
7150 _iterator.f();
7151
7152 return _context.finish(18);
7153
7154 case 21:
7155 // This logic will run the promises by sequence (will wait for dispatcher to finish, before run again).
7156 _iterator2 = _createForOfIteratorHelper(commands);
7157 _context.prev = 22;
7158
7159 _iterator2.s();
7160
7161 case 24:
7162 if ((_step2 = _iterator2.n()).done) {
7163 _context.next = 31;
7164 break;
7165 }
7166
7167 _hashCommand = _step2.value;
7168 _dispatcher = this.dispatchersList[_hashCommand.method];
7169 _context.next = 29;
7170 return _dispatcher.runner()(_hashCommand.command, _dispatcher.isSafeWithArgs(_hashCommand.command) ? _hashCommand.args : undefined);
7171
7172 case 29:
7173 _context.next = 24;
7174 break;
7175
7176 case 31:
7177 _context.next = 36;
7178 break;
7179
7180 case 33:
7181 _context.prev = 33;
7182 _context.t1 = _context["catch"](22);
7183
7184 _iterator2.e(_context.t1);
7185
7186 case 36:
7187 _context.prev = 36;
7188
7189 _iterator2.f();
7190
7191 return _context.finish(36);
7192
7193 case 39:
7194 case "end":
7195 return _context.stop();
7196 }
7197 }
7198 }, _callee, this, [[2, 15, 18, 21], [22, 33, 36, 39]]);
7199 }));
7200
7201 function run() {
7202 return _run.apply(this, arguments);
7203 }
7204
7205 return run;
7206 }()
7207 /**
7208 * Function runOnce().
7209 *
7210 * Do same as `run` but clear `this.commands` before leaving.
7211 */
7212
7213 }, {
7214 key: "runOnce",
7215 value: function runOnce() {
7216 var _this2 = this;
7217
7218 this.run(this.commands).then(function () {
7219 _this2.commands = [];
7220 });
7221 }
7222 /**
7223 * Takes a args in form of JSON and parse it.
7224 *
7225 * @param {string} rawArgs
7226 * @return {Object} args in as an object
7227 */
7228
7229 }, {
7230 key: "parseCommandArgs",
7231 value: function parseCommandArgs(rawArgs) {
7232 try {
7233 return JSON.parse(decodeURI(rawArgs || '{}'));
7234 } catch (e) {
7235 _helpers.default.consoleWarn('Hash commands JSON args cannot be parsed. \n\n', e);
7236
7237 return {};
7238 }
7239 }
7240 }]);
7241 return HashCommands;
7242 }();
7243
7244 exports["default"] = HashCommands;
7245
7246 /***/ }),
7247
7248 /***/ "../modules/web-cli/assets/js/modules/command-base.js":
7249 /*!************************************************************!*\
7250 !*** ../modules/web-cli/assets/js/modules/command-base.js ***!
7251 \************************************************************/
7252 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
7253
7254 "use strict";
7255
7256
7257 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
7258
7259 Object.defineProperty(exports, "__esModule", ({
7260 value: true
7261 }));
7262 exports["default"] = void 0;
7263
7264 var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ "../node_modules/@babel/runtime/regenerator/index.js"));
7265
7266 var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js"));
7267
7268 var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "../node_modules/@babel/runtime/helpers/asyncToGenerator.js"));
7269
7270 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
7271
7272 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
7273
7274 var _assertThisInitialized2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ "../node_modules/@babel/runtime/helpers/assertThisInitialized.js"));
7275
7276 var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
7277
7278 var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
7279
7280 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
7281
7282 var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
7283
7284 var _argsObject = _interopRequireDefault(__webpack_require__(/*! elementor-assets-js/modules/imports/args-object */ "../assets/dev/js/modules/imports/args-object.js"));
7285
7286 var _helpers = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/helpers */ "../modules/web-cli/assets/js/utils/helpers.js"));
7287
7288 var _forceMethodImplementation = _interopRequireDefault(__webpack_require__(/*! ../utils/force-method-implementation */ "../modules/web-cli/assets/js/utils/force-method-implementation.js"));
7289
7290 function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
7291
7292 function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
7293
7294 /**
7295 * @typedef {import('../modules/component-base')} ComponentBase
7296 */
7297
7298 /**
7299 * @typedef {{}} Component
7300 */
7301 var CommandBase = /*#__PURE__*/function (_ArgsObject) {
7302 (0, _inherits2.default)(CommandBase, _ArgsObject);
7303
7304 var _super = _createSuper(CommandBase);
7305
7306 /**
7307 * Function constructor().
7308 *
7309 * Create Commands Base.
7310 *
7311 * @param {*} [args={}]
7312 * @param {*} [commandsAPI={}]
7313 */
7314 function CommandBase(args) {
7315 var _this;
7316
7317 var commandsAPI = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : $e.commands;
7318 (0, _classCallCheck2.default)(this, CommandBase);
7319 _this = _super.call(this, args); // Acknowledge self about which command it run.
7320
7321 (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "component", void 0);
7322 _this.currentCommand = commandsAPI.getCurrentLast(); // Assign instance of current component.
7323
7324 _this.component = commandsAPI.getComponent(_this.currentCommand); // Who ever need do something before without `super` the constructor can use `initialize` method.
7325
7326 _this.initialize(args); // Refresh args, maybe the changed via `initialize`.
7327
7328
7329 args = _this.args; // Validate args before run.
7330
7331 _this.validateArgs(args);
7332
7333 return _this;
7334 }
7335 /**
7336 * Function requireContainer().
7337 *
7338 * Validate `arg.container` & `arg.containers`.
7339 *
7340 * @param {{}} args
7341 *
7342 * @throws {Error}
7343 */
7344
7345
7346 (0, _createClass2.default)(CommandBase, [{
7347 key: "requireContainer",
7348 value: function requireContainer() {
7349 var _this2 = this;
7350
7351 var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.args;
7352
7353 if (!args.container && !args.containers) {
7354 throw Error('container or containers are required.');
7355 }
7356
7357 if (args.container && args.containers) {
7358 throw Error('container and containers cannot go together please select one of them.');
7359 }
7360
7361 var containers = args.containers || [args.container];
7362 containers.forEach(function (container) {
7363 _this2.requireArgumentInstance('container', elementorModules.editor.Container, {
7364 container: container
7365 });
7366 });
7367 }
7368 /**
7369 * Function initialize().
7370 *
7371 * Initialize command, called after construction.
7372 *
7373 * @param {*} [args={}]
7374 */
7375
7376 }, {
7377 key: "initialize",
7378 value: function initialize() {
7379 var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7380 } // eslint-disable-line no-unused-vars
7381
7382 /**
7383 * Function validateArgs().
7384 *
7385 * Validate command arguments.
7386 *
7387 * @param {*} [args={}]
7388 */
7389
7390 }, {
7391 key: "validateArgs",
7392 value: function validateArgs() {
7393 var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7394 } // eslint-disable-line no-unused-vars
7395
7396 /**
7397 * Function isDataChanged().
7398 *
7399 * Whether the editor needs to set change flag on/off.
7400 *
7401 * @return {boolean} Whether the editor needs to set change flag on/off.
7402 */
7403
7404 }, {
7405 key: "isDataChanged",
7406 value: function isDataChanged() {
7407 return false;
7408 } // eslint-disable-next-line jsdoc/require-returns-check
7409
7410 /**
7411 * Function apply().
7412 *
7413 * Do the actual command.
7414 *
7415 * @param {*} [args={}]
7416 *
7417 * @return {*} callback
7418 */
7419
7420 }, {
7421 key: "apply",
7422 value: function apply() {
7423 var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7424 // eslint-disable-line no-unused-vars
7425 (0, _forceMethodImplementation.default)();
7426 }
7427 /**
7428 * Function run().
7429 *
7430 * Run command with history & hooks.
7431 *
7432 * @return {*} run results
7433 */
7434
7435 }, {
7436 key: "run",
7437 value: function run() {
7438 var result; // For UI Hooks.
7439
7440 this.onBeforeRun(this.args);
7441
7442 try {
7443 // For Data hooks.
7444 this.onBeforeApply(this.args);
7445 result = this.apply(this.args);
7446 } catch (e) {
7447 this.onCatchApply(e); // Catch 'Hook-Break' that comes from hooks base.
7448
7449 if (e instanceof $e.modules.HookBreak) {
7450 // Bypass.
7451 return false;
7452 }
7453 }
7454
7455 return this.runAfter(result);
7456 }
7457 }, {
7458 key: "runAfter",
7459 value: function runAfter(result) {
7460 var _this3 = this;
7461
7462 var onAfter = function onAfter(_result) {
7463 // Run Data hooks.
7464 _this3.onAfterApply(_this3.args, _result); // TODO: Create Command-Base for Command-Document and apply it on after.
7465
7466
7467 if (_this3.isDataChanged()) {
7468 $e.internal('document/save/set-is-modified', {
7469 status: true
7470 });
7471 } // For UI hooks.
7472
7473
7474 _this3.onAfterRun(_this3.args, _result);
7475 },
7476 asyncOnAfter = /*#__PURE__*/function () {
7477 var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(_result) {
7478 var results, promises;
7479 return _regenerator.default.wrap(function _callee$(_context) {
7480 while (1) {
7481 switch (_context.prev = _context.next) {
7482 case 0:
7483 // Run Data hooks.
7484 results = _this3.onAfterApply(_this3.args, _result), promises = Array.isArray(results) ? results.flat().filter(function (filtered) {
7485 return filtered instanceof Promise;
7486 }) : [];
7487
7488 if (!promises.length) {
7489 _context.next = 4;
7490 break;
7491 }
7492
7493 _context.next = 4;
7494 return Promise.all(promises);
7495
7496 case 4:
7497 if (_this3.isDataChanged()) {
7498 // TODO: Create Command-Base for Command-Document and apply it on after.
7499 $e.internal('document/save/set-is-modified', {
7500 status: true
7501 });
7502 } // For UI hooks.
7503
7504
7505 _this3.onAfterRun(_this3.args, _result);
7506
7507 case 6:
7508 case "end":
7509 return _context.stop();
7510 }
7511 }
7512 }, _callee);
7513 }));
7514
7515 return function asyncOnAfter(_x) {
7516 return _ref.apply(this, arguments);
7517 };
7518 }(); // TODO: Temp code determine if it's a jQuery deferred object.
7519
7520
7521 if (result && 'object' === (0, _typeof2.default)(result) && result.promise && result.then && result.fail) {
7522 result.fail(this.onCatchApply.bind(this));
7523 result.done(onAfter);
7524 } else if (result instanceof Promise) {
7525 // Override initial result ( promise ) to await onAfter promises, first!.
7526 return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
7527 return _regenerator.default.wrap(function _callee2$(_context2) {
7528 while (1) {
7529 switch (_context2.prev = _context2.next) {
7530 case 0:
7531 _context2.next = 2;
7532 return result.catch(_this3.onCatchApply.bind(_this3));
7533
7534 case 2:
7535 _context2.next = 4;
7536 return result.then(function (_result) {
7537 return asyncOnAfter(_result);
7538 });
7539
7540 case 4:
7541 return _context2.abrupt("return", result);
7542
7543 case 5:
7544 case "end":
7545 return _context2.stop();
7546 }
7547 }
7548 }, _callee2);
7549 }))();
7550 } else {
7551 onAfter(result);
7552 }
7553
7554 return result;
7555 }
7556 /**
7557 * Run all the catch hooks.
7558 *
7559 * @param {Error} e
7560 */
7561
7562 }, {
7563 key: "runCatchHooks",
7564 value: function runCatchHooks(e) {
7565 $e.hooks.runDataCatch(this.currentCommand, this.args, e);
7566 $e.hooks.runUICatch(this.currentCommand, this.args, e);
7567 }
7568 /**
7569 * Function onBeforeRun.
7570 *
7571 * Called before run().
7572 *
7573 * @param {*} [args={}]
7574 */
7575
7576 }, {
7577 key: "onBeforeRun",
7578 value: function onBeforeRun() {
7579 var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7580 $e.hooks.runUIBefore(this.currentCommand, args);
7581 }
7582 /**
7583 * Function onAfterRun.
7584 *
7585 * Called after run().
7586 *
7587 * @param {*} [args={}]
7588 * @param {*} [result={*}]
7589 */
7590
7591 }, {
7592 key: "onAfterRun",
7593 value: function onAfterRun() {
7594 var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7595 var result = arguments.length > 1 ? arguments[1] : undefined;
7596 $e.hooks.runUIAfter(this.currentCommand, args, result);
7597 }
7598 /**
7599 * Function onBeforeApply.
7600 *
7601 * Called before apply().
7602 *
7603 * @param {*} [args={}]
7604 */
7605
7606 }, {
7607 key: "onBeforeApply",
7608 value: function onBeforeApply() {
7609 var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7610 $e.hooks.runDataDependency(this.currentCommand, args);
7611 }
7612 /**
7613 * Function onAfterApply.
7614 *
7615 * Called after apply().
7616 *
7617 * @param {*} [args={}]
7618 * @param {*} [result={*}]
7619 */
7620
7621 }, {
7622 key: "onAfterApply",
7623 value: function onAfterApply() {
7624 var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7625 var result = arguments.length > 1 ? arguments[1] : undefined;
7626 return $e.hooks.runDataAfter(this.currentCommand, args, result);
7627 }
7628 /**
7629 * Function onCatchApply.
7630 *
7631 * Called after apply() failed.
7632 *
7633 * @param {Error} e
7634 */
7635
7636 }, {
7637 key: "onCatchApply",
7638 value: function onCatchApply(e) {
7639 this.runCatchHooks(e);
7640
7641 _helpers.default.consoleError(e);
7642 }
7643 }], [{
7644 key: "getInstanceType",
7645 value: function getInstanceType() {
7646 return 'CommandBase';
7647 }
7648 /**
7649 * Get info of command.
7650 *
7651 * Use to provide 'extra' information about the command.
7652 *
7653 * @return {Object} info of command
7654 */
7655
7656 }, {
7657 key: "getInfo",
7658 value: function getInfo() {
7659 return {};
7660 }
7661 /**
7662 * Current component.
7663 *
7664 * @type {Component}
7665 */
7666
7667 }]);
7668 return CommandBase;
7669 }(_argsObject.default);
7670
7671 exports["default"] = CommandBase;
7672
7673 /***/ }),
7674
7675 /***/ "../modules/web-cli/assets/js/modules/command-data.js":
7676 /*!************************************************************!*\
7677 !*** ../modules/web-cli/assets/js/modules/command-data.js ***!
7678 \************************************************************/
7679 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
7680
7681 "use strict";
7682
7683
7684 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
7685
7686 var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js");
7687
7688 Object.defineProperty(exports, "__esModule", ({
7689 value: true
7690 }));
7691 exports["default"] = void 0;
7692
7693 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
7694
7695 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
7696
7697 var _assertThisInitialized2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ "../node_modules/@babel/runtime/helpers/assertThisInitialized.js"));
7698
7699 var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
7700
7701 var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
7702
7703 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
7704
7705 var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
7706
7707 var _commandBase = _interopRequireDefault(__webpack_require__(/*! ./command-base */ "../modules/web-cli/assets/js/modules/command-base.js"));
7708
7709 var errors = _interopRequireWildcard(__webpack_require__(/*! ../core/data/errors/ */ "../modules/web-cli/assets/js/core/data/errors/index.js"));
7710
7711 var _helpers = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/helpers */ "../modules/web-cli/assets/js/utils/helpers.js"));
7712
7713 function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
7714
7715 function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
7716
7717 function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
7718
7719 function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
7720
7721 /**
7722 * @typedef {('create'|'delete'|'get'|'update'|'options')} DataTypes
7723 */
7724
7725 /**
7726 * @typedef {{}} RequestData
7727 */
7728
7729 /**
7730 * @typedef {import('../core/data/errors/base-error')} BaseError
7731 */
7732 var CommandData = /*#__PURE__*/function (_CommandBase) {
7733 (0, _inherits2.default)(CommandData, _CommandBase);
7734
7735 var _super = _createSuper(CommandData);
7736
7737 function CommandData(args) {
7738 var _this$args$options;
7739
7740 var _this;
7741
7742 var commandsAPI = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : $e.data;
7743 (0, _classCallCheck2.default)(this, CommandData);
7744 _this = _super.call(this, args, commandsAPI);
7745 (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "data", void 0);
7746 (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "type", void 0);
7747
7748 if ((_this$args$options = _this.args.options) !== null && _this$args$options !== void 0 && _this$args$options.type) {
7749 _this.type = _this.args.options.type;
7750 }
7751
7752 return _this;
7753 }
7754 /**
7755 * Function getEndpointFormat().
7756 *
7757 * @return {null|string} endpoint format
7758 */
7759
7760
7761 (0, _createClass2.default)(CommandData, [{
7762 key: "getApplyMethods",
7763 value:
7764 /**
7765 * @param {DataTypes} type
7766 *
7767 * @return {boolean|{before: (function(*=): {}), after: (function({}, *=): {})}} apply methods
7768 */
7769 function getApplyMethods() {
7770 var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.type;
7771 var before, after;
7772
7773 switch (type) {
7774 case 'create':
7775 before = this.applyBeforeCreate;
7776 after = this.applyAfterCreate;
7777 break;
7778
7779 case 'delete':
7780 before = this.applyBeforeDelete;
7781 after = this.applyAfterDelete;
7782 break;
7783
7784 case 'get':
7785 before = this.applyBeforeGet;
7786 after = this.applyAfterGet;
7787 break;
7788
7789 case 'update':
7790 before = this.applyBeforeUpdate;
7791 after = this.applyAfterUpdate;
7792 break;
7793
7794 case 'options':
7795 before = this.applyBeforeOptions;
7796 after = this.applyAfterOptions;
7797 break;
7798
7799 default:
7800 return false;
7801 }
7802
7803 return {
7804 before: before.bind(this),
7805 after: after.bind(this)
7806 };
7807 }
7808 /**
7809 * Function getRequestData().
7810 *
7811 * @return {RequestData} request data
7812 */
7813
7814 }, {
7815 key: "getRequestData",
7816 value: function getRequestData() {
7817 return {
7818 component: this.component,
7819 command: this.currentCommand,
7820 type: this.type,
7821 args: this.args,
7822 timestamp: new Date().getTime(),
7823 endpoint: $e.data.commandToEndpoint(this.currentCommand, _helpers.default.cloneObject(this.args), this.constructor.getEndpointFormat())
7824 };
7825 }
7826 }, {
7827 key: "apply",
7828 value: function apply() {
7829 var _this2 = this;
7830
7831 var applyMethods = this.getApplyMethods(); // Run 'before' method.
7832
7833 this.args = applyMethods.before(this.args);
7834 var requestData = this.getRequestData();
7835 return $e.data.fetch(requestData).then(function (data) {
7836 _this2.data = data; // Run 'after' method.
7837
7838 _this2.data = applyMethods.after(data, _this2.args);
7839 _this2.data = {
7840 data: _this2.data
7841 }; // Append requestData.
7842
7843 _this2.data = Object.assign({
7844 __requestData__: requestData
7845 }, _this2.data);
7846 return _this2.data;
7847 });
7848 }
7849 /**
7850 * @param {*} [args={}]
7851 * @return {{}} filtered args
7852 */
7853
7854 }, {
7855 key: "applyBeforeCreate",
7856 value: function applyBeforeCreate() {
7857 var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7858 return args;
7859 }
7860 /**
7861 * @param {{}} data
7862 * @param {*} [args={}]
7863 * @return {{}} filtered result
7864 */
7865
7866 }, {
7867 key: "applyAfterCreate",
7868 value: function applyAfterCreate(data) {
7869 var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
7870 // eslint-disable-line no-unused-vars
7871 return data;
7872 }
7873 /**
7874 * @param {*} [args={}]
7875 * @return {{}} filtered args
7876 */
7877
7878 }, {
7879 key: "applyBeforeDelete",
7880 value: function applyBeforeDelete() {
7881 var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7882 return args;
7883 }
7884 /**
7885 * @param {{}} data
7886 * @param {*} [args={}]
7887 * @return {{}} filtered result
7888 */
7889
7890 }, {
7891 key: "applyAfterDelete",
7892 value: function applyAfterDelete(data) {
7893 var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
7894 // eslint-disable-line no-unused-vars
7895 return data;
7896 }
7897 /**
7898 * @param {*} [args={}]
7899 * @return {{}} filtered args
7900 */
7901
7902 }, {
7903 key: "applyBeforeGet",
7904 value: function applyBeforeGet() {
7905 var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7906 return args;
7907 }
7908 /**
7909 * @param {{}} data
7910 * @param {*} [args={}]
7911 * @return {{}} filtered result
7912 */
7913
7914 }, {
7915 key: "applyAfterGet",
7916 value: function applyAfterGet(data) {
7917 var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
7918 // eslint-disable-line no-unused-vars
7919 return data;
7920 }
7921 /**
7922 * @param {*} [args={}]
7923 * @return {{}} filtered args
7924 */
7925
7926 }, {
7927 key: "applyBeforeUpdate",
7928 value: function applyBeforeUpdate() {
7929 var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7930 return args;
7931 }
7932 /**
7933 * @param {{}} data
7934 * @param {*} [args={}]
7935 * @return {{}} filtered result
7936 */
7937
7938 }, {
7939 key: "applyAfterUpdate",
7940 value: function applyAfterUpdate(data) {
7941 var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
7942 // eslint-disable-line no-unused-vars
7943 return data;
7944 }
7945 /**
7946 * @param {*} [args={}]
7947 * @return {{}} filtered args
7948 */
7949
7950 }, {
7951 key: "applyBeforeOptions",
7952 value: function applyBeforeOptions() {
7953 var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7954 return args;
7955 }
7956 /**
7957 * @param {{}} data
7958 * @param {*} [args={}]
7959 * @return {{}} filtered result
7960 */
7961
7962 }, {
7963 key: "applyAfterOptions",
7964 value: function applyAfterOptions(data) {
7965 var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
7966 // eslint-disable-line no-unused-vars
7967 return data;
7968 }
7969 /**
7970 * @param {BaseError} e
7971 */
7972
7973 }, {
7974 key: "applyAfterCatch",
7975 value: function applyAfterCatch(e) {
7976 e.notify();
7977 }
7978 }, {
7979 key: "onCatchApply",
7980 value: function onCatchApply(e) {
7981 var _e, _e$data;
7982
7983 // TODO: If the errors that returns from the server is consistent remove the '?' from 'e'
7984 var httpErrorCode = ((_e = e) === null || _e === void 0 ? void 0 : (_e$data = _e.data) === null || _e$data === void 0 ? void 0 : _e$data.status) || 501;
7985 var dataError = Object.values(errors).find(function (error) {
7986 return error.getHTTPErrorCode() === httpErrorCode;
7987 });
7988
7989 if (!dataError) {
7990 dataError = errors.DefaultError;
7991 }
7992
7993 e = dataError.create(e.message, e.code, e.data || []);
7994 this.runCatchHooks(e);
7995 this.applyAfterCatch(e);
7996 }
7997 }], [{
7998 key: "getInstanceType",
7999 value:
8000 /**
8001 * Data returned from remote.
8002 *
8003 * @type {*}
8004 */
8005
8006 /**
8007 * Fetch type.
8008 *
8009 * @type {DataTypes}
8010 */
8011 function getInstanceType() {
8012 return 'CommandData';
8013 }
8014 }, {
8015 key: "getEndpointFormat",
8016 value: function getEndpointFormat() {
8017 return null;
8018 }
8019 }]);
8020 return CommandData;
8021 }(_commandBase.default);
8022
8023 exports["default"] = CommandData;
8024
8025 /***/ }),
8026
8027 /***/ "../modules/web-cli/assets/js/modules/command-internal-base.js":
8028 /*!*********************************************************************!*\
8029 !*** ../modules/web-cli/assets/js/modules/command-internal-base.js ***!
8030 \*********************************************************************/
8031 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
8032
8033 "use strict";
8034
8035
8036 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
8037
8038 Object.defineProperty(exports, "__esModule", ({
8039 value: true
8040 }));
8041 exports["default"] = void 0;
8042
8043 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
8044
8045 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
8046
8047 var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
8048
8049 var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
8050
8051 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
8052
8053 var _commandBase = _interopRequireDefault(__webpack_require__(/*! ./command-base */ "../modules/web-cli/assets/js/modules/command-base.js"));
8054
8055 function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
8056
8057 function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
8058
8059 var CommandInternalBase = /*#__PURE__*/function (_CommandBase) {
8060 (0, _inherits2.default)(CommandInternalBase, _CommandBase);
8061
8062 var _super = _createSuper(CommandInternalBase);
8063
8064 function CommandInternalBase(args) {
8065 var commandsAPI = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : $e.commandsInternal;
8066 (0, _classCallCheck2.default)(this, CommandInternalBase);
8067 return _super.call(this, args, commandsAPI);
8068 }
8069
8070 (0, _createClass2.default)(CommandInternalBase, null, [{
8071 key: "getInstanceType",
8072 value: function getInstanceType() {
8073 return 'CommandInternalBase';
8074 }
8075 }]);
8076 return CommandInternalBase;
8077 }(_commandBase.default);
8078
8079 exports["default"] = CommandInternalBase;
8080
8081 /***/ }),
8082
8083 /***/ "../modules/web-cli/assets/js/modules/commands/close.js":
8084 /*!**************************************************************!*\
8085 !*** ../modules/web-cli/assets/js/modules/commands/close.js ***!
8086 \**************************************************************/
8087 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
8088
8089 "use strict";
8090
8091
8092 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
8093
8094 Object.defineProperty(exports, "__esModule", ({
8095 value: true
8096 }));
8097 exports["default"] = exports.Close = void 0;
8098
8099 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
8100
8101 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
8102
8103 var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
8104
8105 var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
8106
8107 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
8108
8109 var _commandBase = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/command-base */ "../modules/web-cli/assets/js/modules/command-base.js"));
8110
8111 function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
8112
8113 function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
8114
8115 var Close = /*#__PURE__*/function (_CommandBase) {
8116 (0, _inherits2.default)(Close, _CommandBase);
8117
8118 var _super = _createSuper(Close);
8119
8120 function Close() {
8121 (0, _classCallCheck2.default)(this, Close);
8122 return _super.apply(this, arguments);
8123 }
8124
8125 (0, _createClass2.default)(Close, [{
8126 key: "apply",
8127 value: function apply() {
8128 this.component.close();
8129 }
8130 }]);
8131 return Close;
8132 }(_commandBase.default);
8133
8134 exports.Close = Close;
8135 var _default = Close;
8136 exports["default"] = _default;
8137
8138 /***/ }),
8139
8140 /***/ "../modules/web-cli/assets/js/modules/commands/index.js":
8141 /*!**************************************************************!*\
8142 !*** ../modules/web-cli/assets/js/modules/commands/index.js ***!
8143 \**************************************************************/
8144 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
8145
8146 "use strict";
8147
8148
8149 Object.defineProperty(exports, "__esModule", ({
8150 value: true
8151 }));
8152 Object.defineProperty(exports, "Close", ({
8153 enumerable: true,
8154 get: function get() {
8155 return _close.Close;
8156 }
8157 }));
8158 Object.defineProperty(exports, "Open", ({
8159 enumerable: true,
8160 get: function get() {
8161 return _open.Open;
8162 }
8163 }));
8164 Object.defineProperty(exports, "Toggle", ({
8165 enumerable: true,
8166 get: function get() {
8167 return _toggle.Toggle;
8168 }
8169 }));
8170
8171 var _close = __webpack_require__(/*! ./close */ "../modules/web-cli/assets/js/modules/commands/close.js");
8172
8173 var _open = __webpack_require__(/*! ./open */ "../modules/web-cli/assets/js/modules/commands/open.js");
8174
8175 var _toggle = __webpack_require__(/*! ./toggle */ "../modules/web-cli/assets/js/modules/commands/toggle.js");
8176
8177 /***/ }),
8178
8179 /***/ "../modules/web-cli/assets/js/modules/commands/open.js":
8180 /*!*************************************************************!*\
8181 !*** ../modules/web-cli/assets/js/modules/commands/open.js ***!
8182 \*************************************************************/
8183 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
8184
8185 "use strict";
8186
8187
8188 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
8189
8190 Object.defineProperty(exports, "__esModule", ({
8191 value: true
8192 }));
8193 exports["default"] = exports.Open = void 0;
8194
8195 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
8196
8197 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
8198
8199 var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
8200
8201 var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
8202
8203 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
8204
8205 var _commandBase = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/command-base */ "../modules/web-cli/assets/js/modules/command-base.js"));
8206
8207 function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
8208
8209 function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
8210
8211 var Open = /*#__PURE__*/function (_CommandBase) {
8212 (0, _inherits2.default)(Open, _CommandBase);
8213
8214 var _super = _createSuper(Open);
8215
8216 function Open() {
8217 (0, _classCallCheck2.default)(this, Open);
8218 return _super.apply(this, arguments);
8219 }
8220
8221 (0, _createClass2.default)(Open, [{
8222 key: "apply",
8223 value: function apply() {
8224 $e.route(this.component.getNamespace());
8225 }
8226 }]);
8227 return Open;
8228 }(_commandBase.default);
8229
8230 exports.Open = Open;
8231 var _default = Open;
8232 exports["default"] = _default;
8233
8234 /***/ }),
8235
8236 /***/ "../modules/web-cli/assets/js/modules/commands/toggle.js":
8237 /*!***************************************************************!*\
8238 !*** ../modules/web-cli/assets/js/modules/commands/toggle.js ***!
8239 \***************************************************************/
8240 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
8241
8242 "use strict";
8243
8244
8245 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
8246
8247 Object.defineProperty(exports, "__esModule", ({
8248 value: true
8249 }));
8250 exports["default"] = exports.Toggle = void 0;
8251
8252 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
8253
8254 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
8255
8256 var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
8257
8258 var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
8259
8260 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
8261
8262 var _commandBase = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/command-base */ "../modules/web-cli/assets/js/modules/command-base.js"));
8263
8264 function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
8265
8266 function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
8267
8268 var Toggle = /*#__PURE__*/function (_CommandBase) {
8269 (0, _inherits2.default)(Toggle, _CommandBase);
8270
8271 var _super = _createSuper(Toggle);
8272
8273 function Toggle() {
8274 (0, _classCallCheck2.default)(this, Toggle);
8275 return _super.apply(this, arguments);
8276 }
8277
8278 (0, _createClass2.default)(Toggle, [{
8279 key: "apply",
8280 value: function apply() {
8281 if (this.component.isOpen) {
8282 this.component.close();
8283 } else {
8284 $e.route(this.component.getNamespace());
8285 }
8286 }
8287 }]);
8288 return Toggle;
8289 }(_commandBase.default);
8290
8291 exports.Toggle = Toggle;
8292 var _default = Toggle;
8293 exports["default"] = _default;
8294
8295 /***/ }),
8296
8297 /***/ "../modules/web-cli/assets/js/modules/component-base.js":
8298 /*!**************************************************************!*\
8299 !*** ../modules/web-cli/assets/js/modules/component-base.js ***!
8300 \**************************************************************/
8301 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
8302
8303 "use strict";
8304
8305
8306 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
8307
8308 Object.defineProperty(exports, "__esModule", ({
8309 value: true
8310 }));
8311 exports["default"] = void 0;
8312
8313 var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
8314
8315 var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js"));
8316
8317 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
8318
8319 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
8320
8321 var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
8322
8323 var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
8324
8325 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
8326
8327 var _toolkit = __webpack_require__(/*! @reduxjs/toolkit */ "../node_modules/@reduxjs/toolkit/dist/redux-toolkit.esm.js");
8328
8329 var _module = _interopRequireDefault(__webpack_require__(/*! elementor-assets-js/modules/imports/module.js */ "../assets/dev/js/modules/imports/module.js"));
8330
8331 var _forceMethodImplementation = _interopRequireDefault(__webpack_require__(/*! ../utils/force-method-implementation */ "../modules/web-cli/assets/js/utils/force-method-implementation.js"));
8332
8333 function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
8334
8335 function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
8336
8337 function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
8338
8339 function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
8340
8341 /**
8342 * @typedef {import('./hook-base')} HookBase
8343 */
8344
8345 /**
8346 * @typedef {import('../core/states/ui-state-base')} UiStateBase
8347 */
8348 var ComponentBase = /*#__PURE__*/function (_Module) {
8349 (0, _inherits2.default)(ComponentBase, _Module);
8350
8351 var _super = _createSuper(ComponentBase);
8352
8353 function ComponentBase() {
8354 (0, _classCallCheck2.default)(this, ComponentBase);
8355 return _super.apply(this, arguments);
8356 }
8357
8358 (0, _createClass2.default)(ComponentBase, [{
8359 key: "__construct",
8360 value: function __construct() {
8361 var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
8362
8363 if (args.manager) {
8364 this.manager = args.manager;
8365 }
8366
8367 this.commands = this.defaultCommands();
8368 this.commandsInternal = this.defaultCommandsInternal();
8369 this.hooks = this.defaultHooks();
8370 this.routes = this.defaultRoutes();
8371 this.tabs = this.defaultTabs();
8372 this.shortcuts = this.defaultShortcuts();
8373 this.utils = this.defaultUtils();
8374 this.data = this.defaultData();
8375 this.uiStates = this.defaultUiStates();
8376 this.states = this.defaultStates();
8377 this.defaultRoute = '';
8378 this.currentTab = '';
8379 }
8380 }, {
8381 key: "registerAPI",
8382 value: function registerAPI() {
8383 var _this = this;
8384
8385 Object.entries(this.getTabs()).forEach(function (tab) {
8386 return _this.registerTabRoute(tab[0]);
8387 });
8388 Object.entries(this.getRoutes()).forEach(function (_ref) {
8389 var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
8390 route = _ref2[0],
8391 callback = _ref2[1];
8392
8393 return _this.registerRoute(route, callback);
8394 });
8395 Object.entries(this.getCommands()).forEach(function (_ref3) {
8396 var _ref4 = (0, _slicedToArray2.default)(_ref3, 2),
8397 command = _ref4[0],
8398 callback = _ref4[1];
8399
8400 return _this.registerCommand(command, callback);
8401 });
8402 Object.entries(this.getCommandsInternal()).forEach(function (_ref5) {
8403 var _ref6 = (0, _slicedToArray2.default)(_ref5, 2),
8404 command = _ref6[0],
8405 callback = _ref6[1];
8406
8407 return _this.registerCommandInternal(command, callback);
8408 });
8409 Object.values(this.getHooks()).forEach(function (instance) {
8410 return _this.registerHook(instance);
8411 });
8412 Object.entries(this.getData()).forEach(function (_ref7) {
8413 var _ref8 = (0, _slicedToArray2.default)(_ref7, 2),
8414 command = _ref8[0],
8415 callback = _ref8[1];
8416
8417 return _this.registerData(command, callback);
8418 });
8419 Object.values(this.getUiStates()).forEach(function (instance) {
8420 return _this.registerUiState(instance);
8421 });
8422 Object.entries(this.getStates()).forEach(function (_ref9) {
8423 var _ref10 = (0, _slicedToArray2.default)(_ref9, 2),
8424 id = _ref10[0],
8425 state = _ref10[1];
8426
8427 return _this.registerState(id, state);
8428 });
8429 } // eslint-disable-next-line jsdoc/require-returns-check
8430
8431 /**
8432 * @return {string} namespace
8433 */
8434
8435 }, {
8436 key: "getNamespace",
8437 value: function getNamespace() {
8438 (0, _forceMethodImplementation.default)();
8439 }
8440 }, {
8441 key: "getRootContainer",
8442 value: function getRootContainer() {
8443 var parts = this.getNamespace().split('/');
8444 return parts[0];
8445 }
8446 }, {
8447 key: "defaultTabs",
8448 value: function defaultTabs() {
8449 return {};
8450 }
8451 }, {
8452 key: "defaultRoutes",
8453 value: function defaultRoutes() {
8454 return {};
8455 }
8456 }, {
8457 key: "defaultCommands",
8458 value: function defaultCommands() {
8459 return {};
8460 }
8461 }, {
8462 key: "defaultCommandsInternal",
8463 value: function defaultCommandsInternal() {
8464 return {};
8465 }
8466 }, {
8467 key: "defaultHooks",
8468 value: function defaultHooks() {
8469 return {};
8470 }
8471 /**
8472 * Get the component's default UI states.
8473 *
8474 * @return {Object} default UI states
8475 */
8476
8477 }, {
8478 key: "defaultUiStates",
8479 value: function defaultUiStates() {
8480 return {};
8481 }
8482 /**
8483 * Get the component's Redux slice settings.
8484 *
8485 * @return {Object} Redux slice settings
8486 */
8487
8488 }, {
8489 key: "defaultStates",
8490 value: function defaultStates() {
8491 return {};
8492 }
8493 }, {
8494 key: "defaultShortcuts",
8495 value: function defaultShortcuts() {
8496 return {};
8497 }
8498 }, {
8499 key: "defaultUtils",
8500 value: function defaultUtils() {
8501 return {};
8502 }
8503 }, {
8504 key: "defaultData",
8505 value: function defaultData() {
8506 return {};
8507 }
8508 }, {
8509 key: "getCommands",
8510 value: function getCommands() {
8511 return this.commands;
8512 }
8513 }, {
8514 key: "getCommandsInternal",
8515 value: function getCommandsInternal() {
8516 return this.commandsInternal;
8517 }
8518 }, {
8519 key: "getHooks",
8520 value: function getHooks() {
8521 return this.hooks;
8522 }
8523 /**
8524 * Retrieve the component's UI states.
8525 *
8526 * @return {Object} UI states
8527 */
8528
8529 }, {
8530 key: "getUiStates",
8531 value: function getUiStates() {
8532 return this.uiStates;
8533 }
8534 /**
8535 * Retrieve the component's Redux Slice.
8536 *
8537 * @return {Object} Redux Slice
8538 */
8539
8540 }, {
8541 key: "getStates",
8542 value: function getStates() {
8543 return this.states;
8544 }
8545 }, {
8546 key: "getRoutes",
8547 value: function getRoutes() {
8548 return this.routes;
8549 }
8550 }, {
8551 key: "getTabs",
8552 value: function getTabs() {
8553 return this.tabs;
8554 }
8555 }, {
8556 key: "getShortcuts",
8557 value: function getShortcuts() {
8558 return this.shortcuts;
8559 }
8560 }, {
8561 key: "getData",
8562 value: function getData() {
8563 return this.data;
8564 }
8565 }, {
8566 key: "registerCommand",
8567 value: function registerCommand(command, callback) {
8568 $e.commands.register(this, command, callback);
8569 }
8570 /**
8571 * @param {HookBase} instance
8572 */
8573
8574 }, {
8575 key: "registerHook",
8576 value: function registerHook(instance) {
8577 return instance.register();
8578 }
8579 /**
8580 * Register a UI state.
8581 *
8582 * @param {UiStateBase} instance - UI state instance.
8583 *
8584 * @return {void}
8585 */
8586
8587 }, {
8588 key: "registerUiState",
8589 value: function registerUiState(instance) {
8590 $e.uiStates.register(instance);
8591 }
8592 /**
8593 * Register a Redux Slice.
8594 *
8595 * @param {string} id - State id.
8596 * @param {Object} stateConfig - The state config.
8597 *
8598 * @return {void}
8599 */
8600
8601 }, {
8602 key: "registerState",
8603 value: function registerState(id, stateConfig) {
8604 id = this.getNamespace() + (id ? "/".concat(id) : '');
8605 var slice = (0, _toolkit.createSlice)(_objectSpread(_objectSpread({}, stateConfig), {}, {
8606 name: id
8607 }));
8608 $e.store.register(id, slice);
8609 }
8610 }, {
8611 key: "registerCommandInternal",
8612 value: function registerCommandInternal(command, callback) {
8613 $e.commandsInternal.register(this, command, callback);
8614 }
8615 }, {
8616 key: "registerRoute",
8617 value: function registerRoute(route, callback) {
8618 $e.routes.register(this, route, callback);
8619 }
8620 }, {
8621 key: "registerData",
8622 value: function registerData(command, callback) {
8623 $e.data.register(this, command, callback);
8624 }
8625 }, {
8626 key: "unregisterRoute",
8627 value: function unregisterRoute(route) {
8628 $e.routes.unregister(this, route);
8629 }
8630 }, {
8631 key: "registerTabRoute",
8632 value: function registerTabRoute(tab) {
8633 var _this2 = this;
8634
8635 this.registerRoute(tab, function (args) {
8636 return _this2.activateTab(tab, args);
8637 });
8638 }
8639 }, {
8640 key: "dependency",
8641 value: function dependency() {
8642 return true;
8643 }
8644 }, {
8645 key: "open",
8646 value: function open() {
8647 return true;
8648 }
8649 }, {
8650 key: "close",
8651 value: function close() {
8652 if (!this.isOpen) {
8653 return false;
8654 }
8655
8656 this.isOpen = false;
8657 this.inactivate();
8658 $e.routes.clearCurrent(this.getNamespace());
8659 $e.routes.clearHistory(this.getRootContainer());
8660 return true;
8661 }
8662 }, {
8663 key: "activate",
8664 value: function activate() {
8665 $e.components.activate(this.getNamespace());
8666 }
8667 }, {
8668 key: "inactivate",
8669 value: function inactivate() {
8670 $e.components.inactivate(this.getNamespace());
8671 }
8672 }, {
8673 key: "isActive",
8674 value: function isActive() {
8675 return $e.components.isActive(this.getNamespace());
8676 }
8677 }, {
8678 key: "onRoute",
8679 value: function onRoute(route) {
8680 this.toggleRouteClass(route, true);
8681 this.toggleHistoryClass();
8682 this.activate();
8683 this.trigger('route/open', route);
8684 }
8685 }, {
8686 key: "onCloseRoute",
8687 value: function onCloseRoute(route) {
8688 this.toggleRouteClass(route, false);
8689 this.inactivate();
8690 this.trigger('route/close', route);
8691 }
8692 }, {
8693 key: "setDefaultRoute",
8694 value: function setDefaultRoute(route) {
8695 this.defaultRoute = this.getNamespace() + '/' + route;
8696 }
8697 }, {
8698 key: "getDefaultRoute",
8699 value: function getDefaultRoute() {
8700 return this.defaultRoute;
8701 }
8702 }, {
8703 key: "removeTab",
8704 value: function removeTab(tab) {
8705 delete this.tabs[tab];
8706 this.unregisterRoute(tab);
8707 }
8708 }, {
8709 key: "hasTab",
8710 value: function hasTab(tab) {
8711 return !!this.tabs[tab];
8712 }
8713 }, {
8714 key: "addTab",
8715 value: function addTab(tab, args, position) {
8716 var _this3 = this;
8717
8718 this.tabs[tab] = args; // It can be 0.
8719
8720 if ('undefined' !== typeof position) {
8721 var newTabs = {};
8722 var ids = Object.keys(this.tabs); // Remove new tab
8723
8724 ids.pop(); // Add it to position.
8725
8726 ids.splice(position, 0, tab);
8727 ids.forEach(function (id) {
8728 newTabs[id] = _this3.tabs[id];
8729 });
8730 this.tabs = newTabs;
8731 }
8732
8733 this.registerTabRoute(tab);
8734 }
8735 }, {
8736 key: "getTabsWrapperSelector",
8737 value: function getTabsWrapperSelector() {
8738 return '';
8739 }
8740 }, {
8741 key: "getTabRoute",
8742 value: function getTabRoute(tab) {
8743 return this.getNamespace() + '/' + tab;
8744 }
8745 }, {
8746 key: "renderTab",
8747 value: function renderTab(tab) {} // eslint-disable-line
8748
8749 }, {
8750 key: "activateTab",
8751 value: function activateTab(tab, args) {
8752 var _this4 = this;
8753
8754 this.currentTab = tab;
8755 this.renderTab(tab, args);
8756 jQuery(this.getTabsWrapperSelector() + ' .elementor-component-tab').off('click').on('click', function (event) {
8757 $e.route(_this4.getTabRoute(event.currentTarget.dataset.tab), args);
8758 }).removeClass('elementor-active').filter('[data-tab="' + tab + '"]').addClass('elementor-active');
8759 }
8760 }, {
8761 key: "getActiveTabConfig",
8762 value: function getActiveTabConfig() {
8763 return this.tabs[this.currentTab] || {};
8764 }
8765 }, {
8766 key: "getBodyClass",
8767 value: function getBodyClass(route) {
8768 return 'e-route-' + route.replace(/\//g, '-');
8769 }
8770 /**
8771 * If command includes uppercase character convert it to lowercase and add `-`.
8772 * e.g: `CopyAll` is converted to `copy-all`.
8773 *
8774 * @param {string} commandName
8775 */
8776
8777 }, {
8778 key: "normalizeCommandName",
8779 value: function normalizeCommandName(commandName) {
8780 return commandName.replace(/[A-Z]/g, function (match, offset) {
8781 return (offset > 0 ? '-' : '') + match.toLowerCase();
8782 });
8783 }
8784 }, {
8785 key: "importCommands",
8786 value: function importCommands(commandsFromImport) {
8787 var _this5 = this;
8788
8789 var commands = {}; // Convert `Commands` to `ComponentBase` workable format.
8790
8791 Object.entries(commandsFromImport).forEach(function (_ref11) {
8792 var _ref12 = (0, _slicedToArray2.default)(_ref11, 2),
8793 className = _ref12[0],
8794 Class = _ref12[1];
8795
8796 var command = _this5.normalizeCommandName(className);
8797
8798 commands[command] = function (args) {
8799 return new Class(args).run();
8800 }; // TODO: Temporary code, remove after merge with 'require-commands-base' branch.
8801 // should not return callback, but Class or Instance without run ( gain performance ).
8802
8803
8804 $e.commands.classes[_this5.getNamespace() + '/' + command] = Class;
8805 });
8806 return commands;
8807 }
8808 }, {
8809 key: "importHooks",
8810 value: function importHooks(hooksFromImport) {
8811 var hooks = {};
8812
8813 for (var key in hooksFromImport) {
8814 var hook = new hooksFromImport[key]();
8815 hooks[hook.getId()] = hook;
8816 }
8817
8818 return hooks;
8819 }
8820 /**
8821 * Import & initialize the component's UI states.
8822 * Should be used inside `defaultUiState()`.
8823 *
8824 * @param {Object} statesFromImport - UI states from import.
8825 *
8826 * @return {Object} UI States
8827 */
8828
8829 }, {
8830 key: "importUiStates",
8831 value: function importUiStates(statesFromImport) {
8832 var _this6 = this;
8833
8834 var uiStates = {};
8835 Object.values(statesFromImport).forEach(function (className) {
8836 var uiState = new className(_this6);
8837 uiStates[uiState.getId()] = uiState;
8838 });
8839 return uiStates;
8840 }
8841 /**
8842 * Set a UI state value.
8843 * TODO: Should we provide such function? Maybe the developer should implicitly pass the full state ID?
8844 *
8845 * @param {string} state - Non-prefixed state ID.
8846 * @param {*} value - New state value.
8847 *
8848 * @return {void}
8849 */
8850
8851 }, {
8852 key: "setUiState",
8853 value: function setUiState(state, value) {
8854 $e.uiStates.set("".concat(this.getNamespace(), "/").concat(state), value);
8855 }
8856 }, {
8857 key: "toggleRouteClass",
8858 value: function toggleRouteClass(route, state) {
8859 document.body.classList.toggle(this.getBodyClass(route), state);
8860 }
8861 }, {
8862 key: "toggleHistoryClass",
8863 value: function toggleHistoryClass() {
8864 document.body.classList.toggle('e-routes-has-history', !!$e.routes.getHistory(this.getRootContainer()).length);
8865 }
8866 }]);
8867 return ComponentBase;
8868 }(_module.default);
8869
8870 exports["default"] = ComponentBase;
8871
8872 /***/ }),
8873
8874 /***/ "../modules/web-cli/assets/js/modules/component-modal-base.js":
8875 /*!********************************************************************!*\
8876 !*** ../modules/web-cli/assets/js/modules/component-modal-base.js ***!
8877 \********************************************************************/
8878 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
8879
8880 "use strict";
8881
8882
8883 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
8884
8885 var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js");
8886
8887 Object.defineProperty(exports, "__esModule", ({
8888 value: true
8889 }));
8890 exports["default"] = void 0;
8891
8892 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
8893
8894 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
8895
8896 var _get2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/get */ "../node_modules/@babel/runtime/helpers/get.js"));
8897
8898 var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
8899
8900 var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
8901
8902 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
8903
8904 var _componentBase = _interopRequireDefault(__webpack_require__(/*! ./component-base */ "../modules/web-cli/assets/js/modules/component-base.js"));
8905
8906 var commands = _interopRequireWildcard(__webpack_require__(/*! ./commands/ */ "../modules/web-cli/assets/js/modules/commands/index.js"));
8907
8908 var _forceMethodImplementation = _interopRequireDefault(__webpack_require__(/*! ../utils/force-method-implementation */ "../modules/web-cli/assets/js/utils/force-method-implementation.js"));
8909
8910 function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
8911
8912 function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
8913
8914 function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
8915
8916 function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
8917
8918 var ComponentModalBase = /*#__PURE__*/function (_ComponentBase) {
8919 (0, _inherits2.default)(ComponentModalBase, _ComponentBase);
8920
8921 var _super = _createSuper(ComponentModalBase);
8922
8923 function ComponentModalBase() {
8924 (0, _classCallCheck2.default)(this, ComponentModalBase);
8925 return _super.apply(this, arguments);
8926 }
8927
8928 (0, _createClass2.default)(ComponentModalBase, [{
8929 key: "registerAPI",
8930 value: function registerAPI() {
8931 var _this = this;
8932
8933 (0, _get2.default)((0, _getPrototypeOf2.default)(ComponentModalBase.prototype), "registerAPI", this).call(this);
8934 $e.shortcuts.register('esc', {
8935 scopes: [this.getNamespace()],
8936 callback: function callback() {
8937 return _this.close();
8938 }
8939 });
8940 }
8941 }, {
8942 key: "defaultCommands",
8943 value: function defaultCommands() {
8944 return this.importCommands(commands);
8945 }
8946 }, {
8947 key: "defaultRoutes",
8948 value: function defaultRoutes() {
8949 return {
8950 '': function _() {
8951 /* Nothing to do, it's already rendered. */
8952 }
8953 };
8954 }
8955 }, {
8956 key: "open",
8957 value: function open() {
8958 var _this2 = this;
8959
8960 if (!this.layout) {
8961 var layout = this.getModalLayout();
8962 this.layout = new layout({
8963 component: this
8964 });
8965 this.layout.getModal().on('hide', function () {
8966 return _this2.close();
8967 });
8968 }
8969
8970 this.layout.showModal();
8971 return true;
8972 }
8973 }, {
8974 key: "close",
8975 value: function close() {
8976 if (!(0, _get2.default)((0, _getPrototypeOf2.default)(ComponentModalBase.prototype), "close", this).call(this)) {
8977 return false;
8978 }
8979
8980 this.layout.getModal().hide();
8981 return true;
8982 }
8983 }, {
8984 key: "getModalLayout",
8985 value: function getModalLayout() {
8986 (0, _forceMethodImplementation.default)();
8987 }
8988 }]);
8989 return ComponentModalBase;
8990 }(_componentBase.default);
8991
8992 exports["default"] = ComponentModalBase;
8993
8994 /***/ }),
8995
8996 /***/ "../modules/web-cli/assets/js/modules/hook-base.js":
8997 /*!*********************************************************!*\
8998 !*** ../modules/web-cli/assets/js/modules/hook-base.js ***!
8999 \*********************************************************/
9000 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
9001
9002 "use strict";
9003
9004
9005 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
9006
9007 Object.defineProperty(exports, "__esModule", ({
9008 value: true
9009 }));
9010 exports["default"] = void 0;
9011
9012 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
9013
9014 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
9015
9016 var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
9017
9018 var _forceMethodImplementation = _interopRequireDefault(__webpack_require__(/*! ../utils/force-method-implementation */ "../modules/web-cli/assets/js/utils/force-method-implementation.js"));
9019
9020 var HookBase = /*#__PURE__*/function () {
9021 /**
9022 * Callback type, eg ( hook, event ).
9023 *
9024 * @type {string}
9025 */
9026
9027 /**
9028 * Full command address, that will hook the callback.
9029 *
9030 * @type {string}
9031 */
9032
9033 /**
9034 * Unique id of the callback.
9035 *
9036 * @type {string}
9037 */
9038
9039 /**
9040 * Function constructor().
9041 *
9042 * Create callback base.
9043 */
9044 function HookBase() {
9045 (0, _classCallCheck2.default)(this, HookBase);
9046 (0, _defineProperty2.default)(this, "type", void 0);
9047 (0, _defineProperty2.default)(this, "command", void 0);
9048 (0, _defineProperty2.default)(this, "id", void 0);
9049 this.initialize();
9050 this.type = this.getType();
9051 this.command = this.getCommand();
9052 this.id = this.getId();
9053 }
9054 /**
9055 * Function initialize().
9056 *
9057 * Called after creation of the base, used for initialize extras.
9058 * Without expending constructor.
9059 */
9060
9061
9062 (0, _createClass2.default)(HookBase, [{
9063 key: "initialize",
9064 value: function initialize() {}
9065 /**
9066 * Function register().
9067 *
9068 * Used to register the callback.
9069 *
9070 * @throws {Error}
9071 */
9072
9073 }, {
9074 key: "register",
9075 value: function register() {
9076 (0, _forceMethodImplementation.default)();
9077 } // eslint-disable-next-line jsdoc/require-returns-check
9078
9079 /**
9080 * Function getType().
9081 *
9082 * Get type eg: ( hook, event, etc ... ).
9083 *
9084 * @return {string} type
9085 *
9086 * @throws {Error}
9087 */
9088
9089 }, {
9090 key: "getType",
9091 value: function getType() {
9092 (0, _forceMethodImplementation.default)();
9093 } // eslint-disable-next-line jsdoc/require-returns-check
9094
9095 /**
9096 * Function getCommand().
9097 *
9098 * Returns the full command path for callback binding.
9099 *
9100 * Supports array of strings ( commands ).
9101 *
9102 * @return {string} command
9103 *
9104 * @throws {Error}
9105 */
9106
9107 }, {
9108 key: "getCommand",
9109 value: function getCommand() {
9110 (0, _forceMethodImplementation.default)();
9111 } // eslint-disable-next-line jsdoc/require-returns-check
9112
9113 /**
9114 * Function getId().
9115 *
9116 * Returns command id for the hook (should be unique).
9117 *
9118 * @return {string} id
9119 *
9120 * @throws {Error}
9121 */
9122
9123 }, {
9124 key: "getId",
9125 value: function getId() {
9126 (0, _forceMethodImplementation.default)();
9127 } // eslint-disable-next-line jsdoc/require-returns-check
9128
9129 /**
9130 * Function getContainerType().
9131 *
9132 * Bind eContainer type to callback.
9133 *
9134 * Used to gain performance.
9135 *
9136 * @return {string} type
9137 */
9138
9139 }, {
9140 key: "getContainerType",
9141 value: function getContainerType() {}
9142 /**
9143 * Function getConditions().
9144 *
9145 * Condition for running the callback, if true, call to apply().
9146 *
9147 * @param {*} [args={}]
9148 * @param {*} [result=*]
9149 *
9150 * @return {boolean} conditions
9151 */
9152
9153 }, {
9154 key: "getConditions",
9155 value: function getConditions() {
9156 var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
9157 var result = arguments.length > 1 ? arguments[1] : undefined;
9158 // eslint-disable-line no-unused-vars
9159 return true;
9160 } // eslint-disable-next-line jsdoc/require-returns-check
9161
9162 /**
9163 * Function apply().
9164 *
9165 * Apply the callback, ( The actual affect of the callback ).
9166 *
9167 * @param {*} [args={}]
9168 *
9169 * @return {*} results
9170 */
9171
9172 }, {
9173 key: "apply",
9174 value: function apply(args) {
9175 // eslint-disable-line no-unused-vars
9176 (0, _forceMethodImplementation.default)();
9177 }
9178 /**
9179 * Function run().
9180 *
9181 * Run the callback.
9182 *
9183 * @param {*} args
9184 *
9185 * @return {*} results
9186 */
9187
9188 }, {
9189 key: "run",
9190 value: function run() {
9191 var _ref = arguments.length <= 0 ? undefined : arguments[0],
9192 _ref$options = _ref.options,
9193 options = _ref$options === void 0 ? {} : _ref$options; // Disable callback if requested by args.options.
9194
9195
9196 if (options.callbacks && false === options.callbacks[this.id]) {
9197 return true;
9198 }
9199
9200 if (this.getConditions.apply(this, arguments)) {
9201 if ($e.devTools) {
9202 $e.devTools.log.callbacks().active(this.type, this.command, this.id);
9203 }
9204
9205 return this.apply.apply(this, arguments);
9206 }
9207
9208 return true;
9209 }
9210 }]);
9211 return HookBase;
9212 }();
9213
9214 exports["default"] = HookBase;
9215
9216 /***/ }),
9217
9218 /***/ "../modules/web-cli/assets/js/modules/hook-break.js":
9219 /*!**********************************************************!*\
9220 !*** ../modules/web-cli/assets/js/modules/hook-break.js ***!
9221 \**********************************************************/
9222 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
9223
9224 "use strict";
9225
9226
9227 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
9228
9229 Object.defineProperty(exports, "__esModule", ({
9230 value: true
9231 }));
9232 exports["default"] = void 0;
9233
9234 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
9235
9236 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
9237
9238 var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
9239
9240 var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
9241
9242 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
9243
9244 var _wrapNativeSuper2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/wrapNativeSuper */ "../node_modules/@babel/runtime/helpers/wrapNativeSuper.js"));
9245
9246 function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
9247
9248 function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
9249
9250 var HookBreak = /*#__PURE__*/function (_Error) {
9251 (0, _inherits2.default)(HookBreak, _Error);
9252
9253 var _super = _createSuper(HookBreak);
9254
9255 function HookBreak() {
9256 (0, _classCallCheck2.default)(this, HookBreak);
9257 return _super.call(this, 'HookBreak');
9258 }
9259
9260 return (0, _createClass2.default)(HookBreak);
9261 }( /*#__PURE__*/(0, _wrapNativeSuper2.default)(Error));
9262
9263 exports["default"] = HookBreak;
9264
9265 /***/ }),
9266
9267 /***/ "../modules/web-cli/assets/js/modules/hooks/data/after.js":
9268 /*!****************************************************************!*\
9269 !*** ../modules/web-cli/assets/js/modules/hooks/data/after.js ***!
9270 \****************************************************************/
9271 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
9272
9273 "use strict";
9274
9275
9276 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
9277
9278 Object.defineProperty(exports, "__esModule", ({
9279 value: true
9280 }));
9281 exports["default"] = exports.After = void 0;
9282
9283 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
9284
9285 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
9286
9287 var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
9288
9289 var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
9290
9291 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
9292
9293 var _base = _interopRequireDefault(__webpack_require__(/*! ./base */ "../modules/web-cli/assets/js/modules/hooks/data/base.js"));
9294
9295 function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
9296
9297 function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
9298
9299 var After = /*#__PURE__*/function (_Base) {
9300 (0, _inherits2.default)(After, _Base);
9301
9302 var _super = _createSuper(After);
9303
9304 function After() {
9305 (0, _classCallCheck2.default)(this, After);
9306 return _super.apply(this, arguments);
9307 }
9308
9309 (0, _createClass2.default)(After, [{
9310 key: "register",
9311 value: function register() {
9312 $e.hooks.registerDataAfter(this);
9313 }
9314 }]);
9315 return After;
9316 }(_base.default);
9317
9318 exports.After = After;
9319 var _default = After;
9320 exports["default"] = _default;
9321
9322 /***/ }),
9323
9324 /***/ "../modules/web-cli/assets/js/modules/hooks/data/base.js":
9325 /*!***************************************************************!*\
9326 !*** ../modules/web-cli/assets/js/modules/hooks/data/base.js ***!
9327 \***************************************************************/
9328 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
9329
9330 "use strict";
9331
9332
9333 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
9334
9335 Object.defineProperty(exports, "__esModule", ({
9336 value: true
9337 }));
9338 exports["default"] = exports.Base = void 0;
9339
9340 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
9341
9342 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
9343
9344 var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
9345
9346 var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
9347
9348 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
9349
9350 var _hookBase = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/hook-base */ "../modules/web-cli/assets/js/modules/hook-base.js"));
9351
9352 function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
9353
9354 function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
9355
9356 var Base = /*#__PURE__*/function (_HookBase) {
9357 (0, _inherits2.default)(Base, _HookBase);
9358
9359 var _super = _createSuper(Base);
9360
9361 function Base() {
9362 (0, _classCallCheck2.default)(this, Base);
9363 return _super.apply(this, arguments);
9364 }
9365
9366 (0, _createClass2.default)(Base, [{
9367 key: "getType",
9368 value: function getType() {
9369 return 'data';
9370 }
9371 }]);
9372 return Base;
9373 }(_hookBase.default);
9374
9375 exports.Base = Base;
9376 var _default = Base;
9377 exports["default"] = _default;
9378
9379 /***/ }),
9380
9381 /***/ "../modules/web-cli/assets/js/modules/hooks/data/catch.js":
9382 /*!****************************************************************!*\
9383 !*** ../modules/web-cli/assets/js/modules/hooks/data/catch.js ***!
9384 \****************************************************************/
9385 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
9386
9387 "use strict";
9388
9389
9390 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
9391
9392 Object.defineProperty(exports, "__esModule", ({
9393 value: true
9394 }));
9395 exports["default"] = exports.Catch = void 0;
9396
9397 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
9398
9399 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
9400
9401 var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
9402
9403 var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
9404
9405 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
9406
9407 var _base = _interopRequireDefault(__webpack_require__(/*! ./base */ "../modules/web-cli/assets/js/modules/hooks/data/base.js"));
9408
9409 function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
9410
9411 function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
9412
9413 var Catch = /*#__PURE__*/function (_Base) {
9414 (0, _inherits2.default)(Catch, _Base);
9415
9416 var _super = _createSuper(Catch);
9417
9418 function Catch() {
9419 (0, _classCallCheck2.default)(this, Catch);
9420 return _super.apply(this, arguments);
9421 }
9422
9423 (0, _createClass2.default)(Catch, [{
9424 key: "register",
9425 value: function register() {
9426 $e.hooks.registerDataCatch(this);
9427 }
9428 }]);
9429 return Catch;
9430 }(_base.default);
9431
9432 exports.Catch = Catch;
9433 var _default = Catch;
9434 exports["default"] = _default;
9435
9436 /***/ }),
9437
9438 /***/ "../modules/web-cli/assets/js/modules/hooks/data/dependency.js":
9439 /*!*********************************************************************!*\
9440 !*** ../modules/web-cli/assets/js/modules/hooks/data/dependency.js ***!
9441 \*********************************************************************/
9442 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
9443
9444 "use strict";
9445
9446
9447 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
9448
9449 Object.defineProperty(exports, "__esModule", ({
9450 value: true
9451 }));
9452 exports["default"] = exports.Dependency = void 0;
9453
9454 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
9455
9456 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
9457
9458 var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
9459
9460 var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
9461
9462 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
9463
9464 var _base = _interopRequireDefault(__webpack_require__(/*! ./base */ "../modules/web-cli/assets/js/modules/hooks/data/base.js"));
9465
9466 function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
9467
9468 function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
9469
9470 var Dependency = /*#__PURE__*/function (_Base) {
9471 (0, _inherits2.default)(Dependency, _Base);
9472
9473 var _super = _createSuper(Dependency);
9474
9475 function Dependency() {
9476 (0, _classCallCheck2.default)(this, Dependency);
9477 return _super.apply(this, arguments);
9478 }
9479
9480 (0, _createClass2.default)(Dependency, [{
9481 key: "register",
9482 value: function register() {
9483 $e.hooks.registerDataDependency(this);
9484 }
9485 }]);
9486 return Dependency;
9487 }(_base.default);
9488
9489 exports.Dependency = Dependency;
9490 var _default = Dependency;
9491 exports["default"] = _default;
9492
9493 /***/ }),
9494
9495 /***/ "../modules/web-cli/assets/js/modules/hooks/data/index.js":
9496 /*!****************************************************************!*\
9497 !*** ../modules/web-cli/assets/js/modules/hooks/data/index.js ***!
9498 \****************************************************************/
9499 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
9500
9501 "use strict";
9502
9503
9504 Object.defineProperty(exports, "__esModule", ({
9505 value: true
9506 }));
9507 Object.defineProperty(exports, "After", ({
9508 enumerable: true,
9509 get: function get() {
9510 return _after.After;
9511 }
9512 }));
9513 Object.defineProperty(exports, "Base", ({
9514 enumerable: true,
9515 get: function get() {
9516 return _base.Base;
9517 }
9518 }));
9519 Object.defineProperty(exports, "Catch", ({
9520 enumerable: true,
9521 get: function get() {
9522 return _catch.Catch;
9523 }
9524 }));
9525 Object.defineProperty(exports, "Dependency", ({
9526 enumerable: true,
9527 get: function get() {
9528 return _dependency.Dependency;
9529 }
9530 }));
9531
9532 var _after = __webpack_require__(/*! ./after */ "../modules/web-cli/assets/js/modules/hooks/data/after.js");
9533
9534 var _base = __webpack_require__(/*! ./base */ "../modules/web-cli/assets/js/modules/hooks/data/base.js");
9535
9536 var _catch = __webpack_require__(/*! ./catch */ "../modules/web-cli/assets/js/modules/hooks/data/catch.js");
9537
9538 var _dependency = __webpack_require__(/*! ./dependency */ "../modules/web-cli/assets/js/modules/hooks/data/dependency.js");
9539
9540 /***/ }),
9541
9542 /***/ "../modules/web-cli/assets/js/modules/hooks/ui/after.js":
9543 /*!**************************************************************!*\
9544 !*** ../modules/web-cli/assets/js/modules/hooks/ui/after.js ***!
9545 \**************************************************************/
9546 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
9547
9548 "use strict";
9549
9550
9551 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
9552
9553 Object.defineProperty(exports, "__esModule", ({
9554 value: true
9555 }));
9556 exports["default"] = exports.After = void 0;
9557
9558 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
9559
9560 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
9561
9562 var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
9563
9564 var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
9565
9566 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
9567
9568 var _base = _interopRequireDefault(__webpack_require__(/*! ./base */ "../modules/web-cli/assets/js/modules/hooks/ui/base.js"));
9569
9570 function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
9571
9572 function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
9573
9574 var After = /*#__PURE__*/function (_Base) {
9575 (0, _inherits2.default)(After, _Base);
9576
9577 var _super = _createSuper(After);
9578
9579 function After() {
9580 (0, _classCallCheck2.default)(this, After);
9581 return _super.apply(this, arguments);
9582 }
9583
9584 (0, _createClass2.default)(After, [{
9585 key: "register",
9586 value: function register() {
9587 $e.hooks.registerUIAfter(this);
9588 }
9589 }]);
9590 return After;
9591 }(_base.default);
9592
9593 exports.After = After;
9594 var _default = After;
9595 exports["default"] = _default;
9596
9597 /***/ }),
9598
9599 /***/ "../modules/web-cli/assets/js/modules/hooks/ui/base.js":
9600 /*!*************************************************************!*\
9601 !*** ../modules/web-cli/assets/js/modules/hooks/ui/base.js ***!
9602 \*************************************************************/
9603 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
9604
9605 "use strict";
9606
9607
9608 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
9609
9610 Object.defineProperty(exports, "__esModule", ({
9611 value: true
9612 }));
9613 exports["default"] = exports.Base = void 0;
9614
9615 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
9616
9617 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
9618
9619 var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
9620
9621 var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
9622
9623 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
9624
9625 var _hookBase = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/hook-base */ "../modules/web-cli/assets/js/modules/hook-base.js"));
9626
9627 function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
9628
9629 function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
9630
9631 var Base = /*#__PURE__*/function (_HookBase) {
9632 (0, _inherits2.default)(Base, _HookBase);
9633
9634 var _super = _createSuper(Base);
9635
9636 function Base() {
9637 (0, _classCallCheck2.default)(this, Base);
9638 return _super.apply(this, arguments);
9639 }
9640
9641 (0, _createClass2.default)(Base, [{
9642 key: "getType",
9643 value: function getType() {
9644 return 'ui';
9645 }
9646 }]);
9647 return Base;
9648 }(_hookBase.default);
9649
9650 exports.Base = Base;
9651 var _default = Base;
9652 exports["default"] = _default;
9653
9654 /***/ }),
9655
9656 /***/ "../modules/web-cli/assets/js/modules/hooks/ui/before.js":
9657 /*!***************************************************************!*\
9658 !*** ../modules/web-cli/assets/js/modules/hooks/ui/before.js ***!
9659 \***************************************************************/
9660 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
9661
9662 "use strict";
9663
9664
9665 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
9666
9667 Object.defineProperty(exports, "__esModule", ({
9668 value: true
9669 }));
9670 exports["default"] = exports.Before = void 0;
9671
9672 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
9673
9674 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
9675
9676 var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
9677
9678 var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
9679
9680 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
9681
9682 var _base = _interopRequireDefault(__webpack_require__(/*! ./base */ "../modules/web-cli/assets/js/modules/hooks/ui/base.js"));
9683
9684 function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
9685
9686 function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
9687
9688 var Before = /*#__PURE__*/function (_Base) {
9689 (0, _inherits2.default)(Before, _Base);
9690
9691 var _super = _createSuper(Before);
9692
9693 function Before() {
9694 (0, _classCallCheck2.default)(this, Before);
9695 return _super.apply(this, arguments);
9696 }
9697
9698 (0, _createClass2.default)(Before, [{
9699 key: "register",
9700 value: function register() {
9701 $e.hooks.registerUIBefore(this);
9702 }
9703 }]);
9704 return Before;
9705 }(_base.default);
9706
9707 exports.Before = Before;
9708 var _default = Before;
9709 exports["default"] = _default;
9710
9711 /***/ }),
9712
9713 /***/ "../modules/web-cli/assets/js/modules/hooks/ui/catch.js":
9714 /*!**************************************************************!*\
9715 !*** ../modules/web-cli/assets/js/modules/hooks/ui/catch.js ***!
9716 \**************************************************************/
9717 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
9718
9719 "use strict";
9720
9721
9722 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
9723
9724 Object.defineProperty(exports, "__esModule", ({
9725 value: true
9726 }));
9727 exports["default"] = exports.Catch = void 0;
9728
9729 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
9730
9731 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
9732
9733 var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
9734
9735 var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
9736
9737 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
9738
9739 var _base = _interopRequireDefault(__webpack_require__(/*! ./base */ "../modules/web-cli/assets/js/modules/hooks/ui/base.js"));
9740
9741 function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
9742
9743 function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
9744
9745 var Catch = /*#__PURE__*/function (_Base) {
9746 (0, _inherits2.default)(Catch, _Base);
9747
9748 var _super = _createSuper(Catch);
9749
9750 function Catch() {
9751 (0, _classCallCheck2.default)(this, Catch);
9752 return _super.apply(this, arguments);
9753 }
9754
9755 (0, _createClass2.default)(Catch, [{
9756 key: "register",
9757 value: function register() {
9758 $e.hooks.registerUICatch(this);
9759 }
9760 }]);
9761 return Catch;
9762 }(_base.default);
9763
9764 exports.Catch = Catch;
9765 var _default = Catch;
9766 exports["default"] = _default;
9767
9768 /***/ }),
9769
9770 /***/ "../modules/web-cli/assets/js/modules/hooks/ui/index.js":
9771 /*!**************************************************************!*\
9772 !*** ../modules/web-cli/assets/js/modules/hooks/ui/index.js ***!
9773 \**************************************************************/
9774 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
9775
9776 "use strict";
9777
9778
9779 Object.defineProperty(exports, "__esModule", ({
9780 value: true
9781 }));
9782 Object.defineProperty(exports, "After", ({
9783 enumerable: true,
9784 get: function get() {
9785 return _after.After;
9786 }
9787 }));
9788 Object.defineProperty(exports, "Base", ({
9789 enumerable: true,
9790 get: function get() {
9791 return _base.Base;
9792 }
9793 }));
9794 Object.defineProperty(exports, "Before", ({
9795 enumerable: true,
9796 get: function get() {
9797 return _before.Before;
9798 }
9799 }));
9800 Object.defineProperty(exports, "Catch", ({
9801 enumerable: true,
9802 get: function get() {
9803 return _catch.Catch;
9804 }
9805 }));
9806
9807 var _after = __webpack_require__(/*! ./after */ "../modules/web-cli/assets/js/modules/hooks/ui/after.js");
9808
9809 var _base = __webpack_require__(/*! ./base */ "../modules/web-cli/assets/js/modules/hooks/ui/base.js");
9810
9811 var _before = __webpack_require__(/*! ./before */ "../modules/web-cli/assets/js/modules/hooks/ui/before.js");
9812
9813 var _catch = __webpack_require__(/*! ./catch */ "../modules/web-cli/assets/js/modules/hooks/ui/catch.js");
9814
9815 /***/ }),
9816
9817 /***/ "../modules/web-cli/assets/js/utils/environment.js":
9818 /*!*********************************************************!*\
9819 !*** ../modules/web-cli/assets/js/utils/environment.js ***!
9820 \*********************************************************/
9821 /***/ ((__unused_webpack_module, exports) => {
9822
9823 "use strict";
9824
9825
9826 Object.defineProperty(exports, "__esModule", ({
9827 value: true
9828 }));
9829 exports["default"] = void 0;
9830
9831 // TODO: Copied from `core/common/assets/js/utils/environment.js`.
9832 var matchUserAgent = function matchUserAgent(UserAgentStr) {
9833 return userAgent.indexOf(UserAgentStr) >= 0;
9834 },
9835 userAgent = navigator.userAgent,
9836 // Solution influenced by https://stackoverflow.com/questions/9847580/how-to-detect-safari-chrome-ie-firefox-and-opera-browser
9837 // Opera 8.0+
9838 isOpera = !!window.opr && !!opr.addons || !!window.opera || matchUserAgent(' OPR/'),
9839 // Firefox 1.0+
9840 isFirefox = matchUserAgent('Firefox'),
9841 // Safari 3.0+ "[object HTMLElementConstructor]"
9842 isSafari = /^((?!chrome|android).)*safari/i.test(userAgent) || /constructor/i.test(window.HTMLElement) || function (p) {
9843 return '[object SafariRemoteNotification]' === p.toString();
9844 }(!window.safari || typeof safari !== 'undefined' && safari.pushNotification),
9845 // Internet Explorer 6-11
9846 isIE = /Trident|MSIE/.test(userAgent) && (
9847 /*@cc_on!@*/
9848 false || !!document.documentMode),
9849 // Edge 20+
9850 isEdge = !isIE && !!window.StyleMedia || matchUserAgent('Edg'),
9851 // Google Chrome (Not accurate)
9852 isChrome = !!window.chrome && matchUserAgent('Chrome') && !(isEdge || isOpera),
9853 // Blink engine
9854 isBlink = matchUserAgent('Chrome') && !!window.CSS,
9855 // Apple Webkit engine
9856 isAppleWebkit = matchUserAgent('AppleWebKit') && !isBlink,
9857 environment = {
9858 appleWebkit: isAppleWebkit,
9859 blink: isBlink,
9860 chrome: isChrome,
9861 edge: isEdge,
9862 firefox: isFirefox,
9863 ie: isIE,
9864 mac: matchUserAgent('Macintosh'),
9865 opera: isOpera,
9866 safari: isSafari,
9867 webkit: matchUserAgent('AppleWebKit')
9868 };
9869
9870 var _default = environment;
9871 exports["default"] = _default;
9872
9873 /***/ }),
9874
9875 /***/ "../modules/web-cli/assets/js/utils/force-method-implementation.js":
9876 /*!*************************************************************************!*\
9877 !*** ../modules/web-cli/assets/js/utils/force-method-implementation.js ***!
9878 \*************************************************************************/
9879 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
9880
9881 "use strict";
9882
9883
9884 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
9885
9886 Object.defineProperty(exports, "__esModule", ({
9887 value: true
9888 }));
9889 exports["default"] = exports.ForceMethodImplementation = void 0;
9890
9891 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
9892
9893 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
9894
9895 var _assertThisInitialized2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ "../node_modules/@babel/runtime/helpers/assertThisInitialized.js"));
9896
9897 var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
9898
9899 var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
9900
9901 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
9902
9903 var _wrapNativeSuper2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/wrapNativeSuper */ "../node_modules/@babel/runtime/helpers/wrapNativeSuper.js"));
9904
9905 function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
9906
9907 function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
9908
9909 // TODO: Copied from `assets/dev/js/modules/imports/force-method-implementation.js`;
9910 var ForceMethodImplementation = /*#__PURE__*/function (_Error) {
9911 (0, _inherits2.default)(ForceMethodImplementation, _Error);
9912
9913 var _super = _createSuper(ForceMethodImplementation);
9914
9915 function ForceMethodImplementation() {
9916 var _this;
9917
9918 var info = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
9919 (0, _classCallCheck2.default)(this, ForceMethodImplementation);
9920 _this = _super.call(this, "".concat(info.isStatic ? 'static ' : '').concat(info.fullName, "() should be implemented, please provide '").concat(info.functionName || info.fullName, "' functionality."));
9921 Error.captureStackTrace((0, _assertThisInitialized2.default)(_this), ForceMethodImplementation);
9922 return _this;
9923 }
9924
9925 return (0, _createClass2.default)(ForceMethodImplementation);
9926 }( /*#__PURE__*/(0, _wrapNativeSuper2.default)(Error));
9927
9928 exports.ForceMethodImplementation = ForceMethodImplementation;
9929
9930 var _default = function _default() {
9931 var stack = Error().stack,
9932 caller = stack.split('\n')[2].trim(),
9933 callerName = caller.startsWith('at new') ? 'constructor' : caller.split(' ')[1],
9934 info = {};
9935 info.functionName = callerName;
9936 info.fullName = callerName;
9937
9938 if (info.functionName.includes('.')) {
9939 var parts = info.functionName.split('.');
9940 info.className = parts[0];
9941 info.functionName = parts[1];
9942 } else {
9943 info.isStatic = true;
9944 }
9945
9946 throw new ForceMethodImplementation(info);
9947 };
9948
9949 exports["default"] = _default;
9950
9951 /***/ }),
9952
9953 /***/ "../modules/web-cli/assets/js/utils/helpers.js":
9954 /*!*****************************************************!*\
9955 !*** ../modules/web-cli/assets/js/utils/helpers.js ***!
9956 \*****************************************************/
9957 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
9958
9959 "use strict";
9960
9961
9962 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
9963
9964 Object.defineProperty(exports, "__esModule", ({
9965 value: true
9966 }));
9967 exports["default"] = void 0;
9968
9969 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
9970
9971 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
9972
9973 // TODO: Copied from `core/common/assets/js/utils/helpers.js` and modified into static functions.
9974 var Helpers = /*#__PURE__*/function () {
9975 function Helpers() {
9976 (0, _classCallCheck2.default)(this, Helpers);
9977 }
9978
9979 (0, _createClass2.default)(Helpers, null, [{
9980 key: "softDeprecated",
9981 value: function softDeprecated(name, version, replacement) {
9982 if (elementorWebCliConfig.isDebug) {
9983 this.deprecatedMessage('soft', name, version, replacement);
9984 }
9985 }
9986 }, {
9987 key: "hardDeprecated",
9988 value: function hardDeprecated(name, version, replacement) {
9989 this.deprecatedMessage('hard', name, version, replacement);
9990 }
9991 }, {
9992 key: "deprecatedMessage",
9993 value: function deprecatedMessage(type, name, version, replacement) {
9994 var message = "`".concat(name, "` is ").concat(type, " deprecated since ").concat(version);
9995
9996 if (replacement) {
9997 message += " - Use `".concat(replacement, "` instead");
9998 }
9999
10000 this.consoleWarn(message);
10001 }
10002 }, {
10003 key: "consoleWarn",
10004 value: function consoleWarn() {
10005 var _console;
10006
10007 var style = "font-size: 12px; background-image: url(\"".concat(elementorWebCliConfig.urls.assets, "images/logo-icon.png\"); background-repeat: no-repeat; background-size: contain;");
10008
10009 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
10010 args[_key] = arguments[_key];
10011 }
10012
10013 args.unshift('%c %c', style, '');
10014
10015 (_console = console).warn.apply(_console, args); // eslint-disable-line no-console
10016
10017 }
10018 }, {
10019 key: "consoleError",
10020 value: function consoleError(message) {
10021 // TODO: function is part of $e.
10022 // Show an error if devTools is available.
10023 if ($e.devTools) {
10024 $e.devTools.log.error(message);
10025 } // If not a 'Hook-Break' then show error.
10026
10027
10028 if (!(message instanceof $e.modules.HookBreak)) {
10029 // eslint-disable-next-line no-console
10030 console.error(message);
10031 }
10032 }
10033 }, {
10034 key: "deprecatedMethod",
10035 value: function deprecatedMethod(methodName, version, replacement) {
10036 this.deprecatedMessage('hard', methodName, version, replacement); // This itself is deprecated.
10037
10038 this.softDeprecated('Helpers.deprecatedMethod', '2.8.0', 'Helpers.softDeprecated || Helpers.hardDeprecated');
10039 }
10040 }, {
10041 key: "cloneObject",
10042 value: function cloneObject(object) {
10043 return JSON.parse(JSON.stringify(object));
10044 }
10045 }, {
10046 key: "upperCaseWords",
10047 value: function upperCaseWords(string) {
10048 return (string + '').replace(/^(.)|\s+(.)/g, function ($1) {
10049 return $1.toUpperCase();
10050 });
10051 }
10052 }, {
10053 key: "getUniqueId",
10054 value: function getUniqueId() {
10055 return Math.random().toString(16).substr(2, 7);
10056 }
10057 }]);
10058 return Helpers;
10059 }();
10060
10061 exports["default"] = Helpers;
10062
10063 /***/ }),
10064
10065 /***/ "../node_modules/redux-thunk/es/index.js":
10066 /*!***********************************************!*\
10067 !*** ../node_modules/redux-thunk/es/index.js ***!
10068 \***********************************************/
10069 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
10070
10071 "use strict";
10072 __webpack_require__.r(__webpack_exports__);
10073 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
10074 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
10075 /* harmony export */ });
10076 /** A function that accepts a potential "extra argument" value to be injected later,
10077 * and returns an instance of the thunk middleware that uses that value
10078 */
10079 function createThunkMiddleware(extraArgument) {
10080 // Standard Redux middleware definition pattern:
10081 // See: https://redux.js.org/tutorials/fundamentals/part-4-store#writing-custom-middleware
10082 var middleware = function middleware(_ref) {
10083 var dispatch = _ref.dispatch,
10084 getState = _ref.getState;
10085 return function (next) {
10086 return function (action) {
10087 // The thunk middleware looks for any functions that were passed to `store.dispatch`.
10088 // If this "action" is really a function, call it and return the result.
10089 if (typeof action === 'function') {
10090 // Inject the store's `dispatch` and `getState` methods, as well as any "extra arg"
10091 return action(dispatch, getState, extraArgument);
10092 } // Otherwise, pass the action down the middleware chain as usual
10093
10094
10095 return next(action);
10096 };
10097 };
10098 };
10099
10100 return middleware;
10101 }
10102
10103 var thunk = createThunkMiddleware(); // Attach the factory function so users can create a customized version
10104 // with whatever "extra arg" they want to inject into their thunks
10105
10106 thunk.withExtraArgument = createThunkMiddleware;
10107 /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (thunk);
10108
10109 /***/ }),
10110
10111 /***/ "../node_modules/redux/es/redux.js":
10112 /*!*****************************************!*\
10113 !*** ../node_modules/redux/es/redux.js ***!
10114 \*****************************************/
10115 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
10116
10117 "use strict";
10118 __webpack_require__.r(__webpack_exports__);
10119 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
10120 /* harmony export */ "__DO_NOT_USE__ActionTypes": () => (/* binding */ ActionTypes),
10121 /* harmony export */ "applyMiddleware": () => (/* binding */ applyMiddleware),
10122 /* harmony export */ "bindActionCreators": () => (/* binding */ bindActionCreators),
10123 /* harmony export */ "combineReducers": () => (/* binding */ combineReducers),
10124 /* harmony export */ "compose": () => (/* binding */ compose),
10125 /* harmony export */ "createStore": () => (/* binding */ createStore),
10126 /* harmony export */ "legacy_createStore": () => (/* binding */ legacy_createStore)
10127 /* harmony export */ });
10128 /* 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");
10129
10130
10131 /**
10132 * Adapted from React: https://github.com/facebook/react/blob/master/packages/shared/formatProdErrorMessage.js
10133 *
10134 * Do not require this module directly! Use normal throw error calls. These messages will be replaced with error codes
10135 * during build.
10136 * @param {number} code
10137 */
10138 function formatProdErrorMessage(code) {
10139 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. ';
10140 }
10141
10142 // Inlined version of the `symbol-observable` polyfill
10143 var $$observable = (function () {
10144 return typeof Symbol === 'function' && Symbol.observable || '@@observable';
10145 })();
10146
10147 /**
10148 * These are private action types reserved by Redux.
10149 * For any unknown actions, you must return the current state.
10150 * If the current state is undefined, you must return the initial state.
10151 * Do not reference these action types directly in your code.
10152 */
10153 var randomString = function randomString() {
10154 return Math.random().toString(36).substring(7).split('').join('.');
10155 };
10156
10157 var ActionTypes = {
10158 INIT: "@@redux/INIT" + randomString(),
10159 REPLACE: "@@redux/REPLACE" + randomString(),
10160 PROBE_UNKNOWN_ACTION: function PROBE_UNKNOWN_ACTION() {
10161 return "@@redux/PROBE_UNKNOWN_ACTION" + randomString();
10162 }
10163 };
10164
10165 /**
10166 * @param {any} obj The object to inspect.
10167 * @returns {boolean} True if the argument appears to be a plain object.
10168 */
10169 function isPlainObject(obj) {
10170 if (typeof obj !== 'object' || obj === null) return false;
10171 var proto = obj;
10172
10173 while (Object.getPrototypeOf(proto) !== null) {
10174 proto = Object.getPrototypeOf(proto);
10175 }
10176
10177 return Object.getPrototypeOf(obj) === proto;
10178 }
10179
10180 // Inlined / shortened version of `kindOf` from https://github.com/jonschlinkert/kind-of
10181 function miniKindOf(val) {
10182 if (val === void 0) return 'undefined';
10183 if (val === null) return 'null';
10184 var type = typeof val;
10185
10186 switch (type) {
10187 case 'boolean':
10188 case 'string':
10189 case 'number':
10190 case 'symbol':
10191 case 'function':
10192 {
10193 return type;
10194 }
10195 }
10196
10197 if (Array.isArray(val)) return 'array';
10198 if (isDate(val)) return 'date';
10199 if (isError(val)) return 'error';
10200 var constructorName = ctorName(val);
10201
10202 switch (constructorName) {
10203 case 'Symbol':
10204 case 'Promise':
10205 case 'WeakMap':
10206 case 'WeakSet':
10207 case 'Map':
10208 case 'Set':
10209 return constructorName;
10210 } // other
10211
10212
10213 return type.slice(8, -1).toLowerCase().replace(/\s/g, '');
10214 }
10215
10216 function ctorName(val) {
10217 return typeof val.constructor === 'function' ? val.constructor.name : null;
10218 }
10219
10220 function isError(val) {
10221 return val instanceof Error || typeof val.message === 'string' && val.constructor && typeof val.constructor.stackTraceLimit === 'number';
10222 }
10223
10224 function isDate(val) {
10225 if (val instanceof Date) return true;
10226 return typeof val.toDateString === 'function' && typeof val.getDate === 'function' && typeof val.setDate === 'function';
10227 }
10228
10229 function kindOf(val) {
10230 var typeOfVal = typeof val;
10231
10232 if (true) {
10233 typeOfVal = miniKindOf(val);
10234 }
10235
10236 return typeOfVal;
10237 }
10238
10239 /**
10240 * @deprecated
10241 *
10242 * **We recommend using the `configureStore` method
10243 * of the `@reduxjs/toolkit` package**, which replaces `createStore`.
10244 *
10245 * Redux Toolkit is our recommended approach for writing Redux logic today,
10246 * including store setup, reducers, data fetching, and more.
10247 *
10248 * **For more details, please read this Redux docs page:**
10249 * **https://redux.js.org/introduction/why-rtk-is-redux-today**
10250 *
10251 * `configureStore` from Redux Toolkit is an improved version of `createStore` that
10252 * simplifies setup and helps avoid common bugs.
10253 *
10254 * You should not be using the `redux` core package by itself today, except for learning purposes.
10255 * The `createStore` method from the core `redux` package will not be removed, but we encourage
10256 * all users to migrate to using Redux Toolkit for all Redux code.
10257 *
10258 * If you want to use `createStore` without this visual deprecation warning, use
10259 * the `legacy_createStore` import instead:
10260 *
10261 * `import { legacy_createStore as createStore} from 'redux'`
10262 *
10263 */
10264
10265 function createStore(reducer, preloadedState, enhancer) {
10266 var _ref2;
10267
10268 if (typeof preloadedState === 'function' && typeof enhancer === 'function' || typeof enhancer === 'function' && typeof arguments[3] === 'function') {
10269 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.');
10270 }
10271
10272 if (typeof preloadedState === 'function' && typeof enhancer === 'undefined') {
10273 enhancer = preloadedState;
10274 preloadedState = undefined;
10275 }
10276
10277 if (typeof enhancer !== 'undefined') {
10278 if (typeof enhancer !== 'function') {
10279 throw new Error( false ? 0 : "Expected the enhancer to be a function. Instead, received: '" + kindOf(enhancer) + "'");
10280 }
10281
10282 return enhancer(createStore)(reducer, preloadedState);
10283 }
10284
10285 if (typeof reducer !== 'function') {
10286 throw new Error( false ? 0 : "Expected the root reducer to be a function. Instead, received: '" + kindOf(reducer) + "'");
10287 }
10288
10289 var currentReducer = reducer;
10290 var currentState = preloadedState;
10291 var currentListeners = [];
10292 var nextListeners = currentListeners;
10293 var isDispatching = false;
10294 /**
10295 * This makes a shallow copy of currentListeners so we can use
10296 * nextListeners as a temporary list while dispatching.
10297 *
10298 * This prevents any bugs around consumers calling
10299 * subscribe/unsubscribe in the middle of a dispatch.
10300 */
10301
10302 function ensureCanMutateNextListeners() {
10303 if (nextListeners === currentListeners) {
10304 nextListeners = currentListeners.slice();
10305 }
10306 }
10307 /**
10308 * Reads the state tree managed by the store.
10309 *
10310 * @returns {any} The current state tree of your application.
10311 */
10312
10313
10314 function getState() {
10315 if (isDispatching) {
10316 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.');
10317 }
10318
10319 return currentState;
10320 }
10321 /**
10322 * Adds a change listener. It will be called any time an action is dispatched,
10323 * and some part of the state tree may potentially have changed. You may then
10324 * call `getState()` to read the current state tree inside the callback.
10325 *
10326 * You may call `dispatch()` from a change listener, with the following
10327 * caveats:
10328 *
10329 * 1. The subscriptions are snapshotted just before every `dispatch()` call.
10330 * If you subscribe or unsubscribe while the listeners are being invoked, this
10331 * will not have any effect on the `dispatch()` that is currently in progress.
10332 * However, the next `dispatch()` call, whether nested or not, will use a more
10333 * recent snapshot of the subscription list.
10334 *
10335 * 2. The listener should not expect to see all state changes, as the state
10336 * might have been updated multiple times during a nested `dispatch()` before
10337 * the listener is called. It is, however, guaranteed that all subscribers
10338 * registered before the `dispatch()` started will be called with the latest
10339 * state by the time it exits.
10340 *
10341 * @param {Function} listener A callback to be invoked on every dispatch.
10342 * @returns {Function} A function to remove this change listener.
10343 */
10344
10345
10346 function subscribe(listener) {
10347 if (typeof listener !== 'function') {
10348 throw new Error( false ? 0 : "Expected the listener to be a function. Instead, received: '" + kindOf(listener) + "'");
10349 }
10350
10351 if (isDispatching) {
10352 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.');
10353 }
10354
10355 var isSubscribed = true;
10356 ensureCanMutateNextListeners();
10357 nextListeners.push(listener);
10358 return function unsubscribe() {
10359 if (!isSubscribed) {
10360 return;
10361 }
10362
10363 if (isDispatching) {
10364 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.');
10365 }
10366
10367 isSubscribed = false;
10368 ensureCanMutateNextListeners();
10369 var index = nextListeners.indexOf(listener);
10370 nextListeners.splice(index, 1);
10371 currentListeners = null;
10372 };
10373 }
10374 /**
10375 * Dispatches an action. It is the only way to trigger a state change.
10376 *
10377 * The `reducer` function, used to create the store, will be called with the
10378 * current state tree and the given `action`. Its return value will
10379 * be considered the **next** state of the tree, and the change listeners
10380 * will be notified.
10381 *
10382 * The base implementation only supports plain object actions. If you want to
10383 * dispatch a Promise, an Observable, a thunk, or something else, you need to
10384 * wrap your store creating function into the corresponding middleware. For
10385 * example, see the documentation for the `redux-thunk` package. Even the
10386 * middleware will eventually dispatch plain object actions using this method.
10387 *
10388 * @param {Object} action A plain object representing “what changed”. It is
10389 * a good idea to keep actions serializable so you can record and replay user
10390 * sessions, or use the time travelling `redux-devtools`. An action must have
10391 * a `type` property which may not be `undefined`. It is a good idea to use
10392 * string constants for action types.
10393 *
10394 * @returns {Object} For convenience, the same action object you dispatched.
10395 *
10396 * Note that, if you use a custom middleware, it may wrap `dispatch()` to
10397 * return something else (for example, a Promise you can await).
10398 */
10399
10400
10401 function dispatch(action) {
10402 if (!isPlainObject(action)) {
10403 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.");
10404 }
10405
10406 if (typeof action.type === 'undefined') {
10407 throw new Error( false ? 0 : 'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');
10408 }
10409
10410 if (isDispatching) {
10411 throw new Error( false ? 0 : 'Reducers may not dispatch actions.');
10412 }
10413
10414 try {
10415 isDispatching = true;
10416 currentState = currentReducer(currentState, action);
10417 } finally {
10418 isDispatching = false;
10419 }
10420
10421 var listeners = currentListeners = nextListeners;
10422
10423 for (var i = 0; i < listeners.length; i++) {
10424 var listener = listeners[i];
10425 listener();
10426 }
10427
10428 return action;
10429 }
10430 /**
10431 * Replaces the reducer currently used by the store to calculate the state.
10432 *
10433 * You might need this if your app implements code splitting and you want to
10434 * load some of the reducers dynamically. You might also need this if you
10435 * implement a hot reloading mechanism for Redux.
10436 *
10437 * @param {Function} nextReducer The reducer for the store to use instead.
10438 * @returns {void}
10439 */
10440
10441
10442 function replaceReducer(nextReducer) {
10443 if (typeof nextReducer !== 'function') {
10444 throw new Error( false ? 0 : "Expected the nextReducer to be a function. Instead, received: '" + kindOf(nextReducer));
10445 }
10446
10447 currentReducer = nextReducer; // This action has a similiar effect to ActionTypes.INIT.
10448 // Any reducers that existed in both the new and old rootReducer
10449 // will receive the previous state. This effectively populates
10450 // the new state tree with any relevant data from the old one.
10451
10452 dispatch({
10453 type: ActionTypes.REPLACE
10454 });
10455 }
10456 /**
10457 * Interoperability point for observable/reactive libraries.
10458 * @returns {observable} A minimal observable of state changes.
10459 * For more information, see the observable proposal:
10460 * https://github.com/tc39/proposal-observable
10461 */
10462
10463
10464 function observable() {
10465 var _ref;
10466
10467 var outerSubscribe = subscribe;
10468 return _ref = {
10469 /**
10470 * The minimal observable subscription method.
10471 * @param {Object} observer Any object that can be used as an observer.
10472 * The observer object should have a `next` method.
10473 * @returns {subscription} An object with an `unsubscribe` method that can
10474 * be used to unsubscribe the observable from the store, and prevent further
10475 * emission of values from the observable.
10476 */
10477 subscribe: function subscribe(observer) {
10478 if (typeof observer !== 'object' || observer === null) {
10479 throw new Error( false ? 0 : "Expected the observer to be an object. Instead, received: '" + kindOf(observer) + "'");
10480 }
10481
10482 function observeState() {
10483 if (observer.next) {
10484 observer.next(getState());
10485 }
10486 }
10487
10488 observeState();
10489 var unsubscribe = outerSubscribe(observeState);
10490 return {
10491 unsubscribe: unsubscribe
10492 };
10493 }
10494 }, _ref[$$observable] = function () {
10495 return this;
10496 }, _ref;
10497 } // When a store is created, an "INIT" action is dispatched so that every
10498 // reducer returns their initial state. This effectively populates
10499 // the initial state tree.
10500
10501
10502 dispatch({
10503 type: ActionTypes.INIT
10504 });
10505 return _ref2 = {
10506 dispatch: dispatch,
10507 subscribe: subscribe,
10508 getState: getState,
10509 replaceReducer: replaceReducer
10510 }, _ref2[$$observable] = observable, _ref2;
10511 }
10512 /**
10513 * Creates a Redux store that holds the state tree.
10514 *
10515 * **We recommend using `configureStore` from the
10516 * `@reduxjs/toolkit` package**, which replaces `createStore`:
10517 * **https://redux.js.org/introduction/why-rtk-is-redux-today**
10518 *
10519 * The only way to change the data in the store is to call `dispatch()` on it.
10520 *
10521 * There should only be a single store in your app. To specify how different
10522 * parts of the state tree respond to actions, you may combine several reducers
10523 * into a single reducer function by using `combineReducers`.
10524 *
10525 * @param {Function} reducer A function that returns the next state tree, given
10526 * the current state tree and the action to handle.
10527 *
10528 * @param {any} [preloadedState] The initial state. You may optionally specify it
10529 * to hydrate the state from the server in universal apps, or to restore a
10530 * previously serialized user session.
10531 * If you use `combineReducers` to produce the root reducer function, this must be
10532 * an object with the same shape as `combineReducers` keys.
10533 *
10534 * @param {Function} [enhancer] The store enhancer. You may optionally specify it
10535 * to enhance the store with third-party capabilities such as middleware,
10536 * time travel, persistence, etc. The only store enhancer that ships with Redux
10537 * is `applyMiddleware()`.
10538 *
10539 * @returns {Store} A Redux store that lets you read the state, dispatch actions
10540 * and subscribe to changes.
10541 */
10542
10543 var legacy_createStore = createStore;
10544
10545 /**
10546 * Prints a warning in the console if it exists.
10547 *
10548 * @param {String} message The warning message.
10549 * @returns {void}
10550 */
10551 function warning(message) {
10552 /* eslint-disable no-console */
10553 if (typeof console !== 'undefined' && typeof console.error === 'function') {
10554 console.error(message);
10555 }
10556 /* eslint-enable no-console */
10557
10558
10559 try {
10560 // This error was thrown as a convenience so that if you enable
10561 // "break on all exceptions" in your console,
10562 // it would pause the execution at this line.
10563 throw new Error(message);
10564 } catch (e) {} // eslint-disable-line no-empty
10565
10566 }
10567
10568 function getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) {
10569 var reducerKeys = Object.keys(reducers);
10570 var argumentName = action && action.type === ActionTypes.INIT ? 'preloadedState argument passed to createStore' : 'previous state received by the reducer';
10571
10572 if (reducerKeys.length === 0) {
10573 return 'Store does not have a valid reducer. Make sure the argument passed ' + 'to combineReducers is an object whose values are reducers.';
10574 }
10575
10576 if (!isPlainObject(inputState)) {
10577 return "The " + argumentName + " has unexpected type of \"" + kindOf(inputState) + "\". Expected argument to be an object with the following " + ("keys: \"" + reducerKeys.join('", "') + "\"");
10578 }
10579
10580 var unexpectedKeys = Object.keys(inputState).filter(function (key) {
10581 return !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key];
10582 });
10583 unexpectedKeys.forEach(function (key) {
10584 unexpectedKeyCache[key] = true;
10585 });
10586 if (action && action.type === ActionTypes.REPLACE) return;
10587
10588 if (unexpectedKeys.length > 0) {
10589 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.");
10590 }
10591 }
10592
10593 function assertReducerShape(reducers) {
10594 Object.keys(reducers).forEach(function (key) {
10595 var reducer = reducers[key];
10596 var initialState = reducer(undefined, {
10597 type: ActionTypes.INIT
10598 });
10599
10600 if (typeof initialState === 'undefined') {
10601 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.");
10602 }
10603
10604 if (typeof reducer(undefined, {
10605 type: ActionTypes.PROBE_UNKNOWN_ACTION()
10606 }) === 'undefined') {
10607 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.");
10608 }
10609 });
10610 }
10611 /**
10612 * Turns an object whose values are different reducer functions, into a single
10613 * reducer function. It will call every child reducer, and gather their results
10614 * into a single state object, whose keys correspond to the keys of the passed
10615 * reducer functions.
10616 *
10617 * @param {Object} reducers An object whose values correspond to different
10618 * reducer functions that need to be combined into one. One handy way to obtain
10619 * it is to use ES6 `import * as reducers` syntax. The reducers may never return
10620 * undefined for any action. Instead, they should return their initial state
10621 * if the state passed to them was undefined, and the current state for any
10622 * unrecognized action.
10623 *
10624 * @returns {Function} A reducer function that invokes every reducer inside the
10625 * passed object, and builds a state object with the same shape.
10626 */
10627
10628
10629 function combineReducers(reducers) {
10630 var reducerKeys = Object.keys(reducers);
10631 var finalReducers = {};
10632
10633 for (var i = 0; i < reducerKeys.length; i++) {
10634 var key = reducerKeys[i];
10635
10636 if (true) {
10637 if (typeof reducers[key] === 'undefined') {
10638 warning("No reducer provided for key \"" + key + "\"");
10639 }
10640 }
10641
10642 if (typeof reducers[key] === 'function') {
10643 finalReducers[key] = reducers[key];
10644 }
10645 }
10646
10647 var finalReducerKeys = Object.keys(finalReducers); // This is used to make sure we don't warn about the same
10648 // keys multiple times.
10649
10650 var unexpectedKeyCache;
10651
10652 if (true) {
10653 unexpectedKeyCache = {};
10654 }
10655
10656 var shapeAssertionError;
10657
10658 try {
10659 assertReducerShape(finalReducers);
10660 } catch (e) {
10661 shapeAssertionError = e;
10662 }
10663
10664 return function combination(state, action) {
10665 if (state === void 0) {
10666 state = {};
10667 }
10668
10669 if (shapeAssertionError) {
10670 throw shapeAssertionError;
10671 }
10672
10673 if (true) {
10674 var warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action, unexpectedKeyCache);
10675
10676 if (warningMessage) {
10677 warning(warningMessage);
10678 }
10679 }
10680
10681 var hasChanged = false;
10682 var nextState = {};
10683
10684 for (var _i = 0; _i < finalReducerKeys.length; _i++) {
10685 var _key = finalReducerKeys[_i];
10686 var reducer = finalReducers[_key];
10687 var previousStateForKey = state[_key];
10688 var nextStateForKey = reducer(previousStateForKey, action);
10689
10690 if (typeof nextStateForKey === 'undefined') {
10691 var actionType = action && action.type;
10692 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.");
10693 }
10694
10695 nextState[_key] = nextStateForKey;
10696 hasChanged = hasChanged || nextStateForKey !== previousStateForKey;
10697 }
10698
10699 hasChanged = hasChanged || finalReducerKeys.length !== Object.keys(state).length;
10700 return hasChanged ? nextState : state;
10701 };
10702 }
10703
10704 function bindActionCreator(actionCreator, dispatch) {
10705 return function () {
10706 return dispatch(actionCreator.apply(this, arguments));
10707 };
10708 }
10709 /**
10710 * Turns an object whose values are action creators, into an object with the
10711 * same keys, but with every function wrapped into a `dispatch` call so they
10712 * may be invoked directly. This is just a convenience method, as you can call
10713 * `store.dispatch(MyActionCreators.doSomething())` yourself just fine.
10714 *
10715 * For convenience, you can also pass an action creator as the first argument,
10716 * and get a dispatch wrapped function in return.
10717 *
10718 * @param {Function|Object} actionCreators An object whose values are action
10719 * creator functions. One handy way to obtain it is to use ES6 `import * as`
10720 * syntax. You may also pass a single function.
10721 *
10722 * @param {Function} dispatch The `dispatch` function available on your Redux
10723 * store.
10724 *
10725 * @returns {Function|Object} The object mimicking the original object, but with
10726 * every action creator wrapped into the `dispatch` call. If you passed a
10727 * function as `actionCreators`, the return value will also be a single
10728 * function.
10729 */
10730
10731
10732 function bindActionCreators(actionCreators, dispatch) {
10733 if (typeof actionCreators === 'function') {
10734 return bindActionCreator(actionCreators, dispatch);
10735 }
10736
10737 if (typeof actionCreators !== 'object' || actionCreators === null) {
10738 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\"?");
10739 }
10740
10741 var boundActionCreators = {};
10742
10743 for (var key in actionCreators) {
10744 var actionCreator = actionCreators[key];
10745
10746 if (typeof actionCreator === 'function') {
10747 boundActionCreators[key] = bindActionCreator(actionCreator, dispatch);
10748 }
10749 }
10750
10751 return boundActionCreators;
10752 }
10753
10754 /**
10755 * Composes single-argument functions from right to left. The rightmost
10756 * function can take multiple arguments as it provides the signature for
10757 * the resulting composite function.
10758 *
10759 * @param {...Function} funcs The functions to compose.
10760 * @returns {Function} A function obtained by composing the argument functions
10761 * from right to left. For example, compose(f, g, h) is identical to doing
10762 * (...args) => f(g(h(...args))).
10763 */
10764 function compose() {
10765 for (var _len = arguments.length, funcs = new Array(_len), _key = 0; _key < _len; _key++) {
10766 funcs[_key] = arguments[_key];
10767 }
10768
10769 if (funcs.length === 0) {
10770 return function (arg) {
10771 return arg;
10772 };
10773 }
10774
10775 if (funcs.length === 1) {
10776 return funcs[0];
10777 }
10778
10779 return funcs.reduce(function (a, b) {
10780 return function () {
10781 return a(b.apply(void 0, arguments));
10782 };
10783 });
10784 }
10785
10786 /**
10787 * Creates a store enhancer that applies middleware to the dispatch method
10788 * of the Redux store. This is handy for a variety of tasks, such as expressing
10789 * asynchronous actions in a concise manner, or logging every action payload.
10790 *
10791 * See `redux-thunk` package as an example of the Redux middleware.
10792 *
10793 * Because middleware is potentially asynchronous, this should be the first
10794 * store enhancer in the composition chain.
10795 *
10796 * Note that each middleware will be given the `dispatch` and `getState` functions
10797 * as named arguments.
10798 *
10799 * @param {...Function} middlewares The middleware chain to be applied.
10800 * @returns {Function} A store enhancer applying the middleware.
10801 */
10802
10803 function applyMiddleware() {
10804 for (var _len = arguments.length, middlewares = new Array(_len), _key = 0; _key < _len; _key++) {
10805 middlewares[_key] = arguments[_key];
10806 }
10807
10808 return function (createStore) {
10809 return function () {
10810 var store = createStore.apply(void 0, arguments);
10811
10812 var _dispatch = function dispatch() {
10813 throw new Error( false ? 0 : 'Dispatching while constructing your middleware is not allowed. ' + 'Other middleware would not be applied to this dispatch.');
10814 };
10815
10816 var middlewareAPI = {
10817 getState: store.getState,
10818 dispatch: function dispatch() {
10819 return _dispatch.apply(void 0, arguments);
10820 }
10821 };
10822 var chain = middlewares.map(function (middleware) {
10823 return middleware(middlewareAPI);
10824 });
10825 _dispatch = compose.apply(void 0, chain)(store.dispatch);
10826 return (0,_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_0__["default"])((0,_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_0__["default"])({}, store), {}, {
10827 dispatch: _dispatch
10828 });
10829 };
10830 };
10831 }
10832
10833 /*
10834 * This is a dummy function to check if the function name has been altered by minification.
10835 * If the function has been minified and NODE_ENV !== 'production', warn the user.
10836 */
10837
10838 function isCrushed() {}
10839
10840 if ( true && typeof isCrushed.name === 'string' && isCrushed.name !== 'isCrushed') {
10841 warning('You are currently using minified code outside of NODE_ENV === "production". ' + 'This means that you are running a slower development build of Redux. ' + 'You can use loose-envify (https://github.com/zertosh/loose-envify) for browserify ' + 'or setting mode to production in webpack (https://webpack.js.org/concepts/mode/) ' + 'to ensure you have the correct code for your production build.');
10842 }
10843
10844
10845
10846
10847 /***/ }),
10848
10849 /***/ "../node_modules/reselect/es/defaultMemoize.js":
10850 /*!*****************************************************!*\
10851 !*** ../node_modules/reselect/es/defaultMemoize.js ***!
10852 \*****************************************************/
10853 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
10854
10855 "use strict";
10856 __webpack_require__.r(__webpack_exports__);
10857 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
10858 /* harmony export */ "createCacheKeyComparator": () => (/* binding */ createCacheKeyComparator),
10859 /* harmony export */ "defaultEqualityCheck": () => (/* binding */ defaultEqualityCheck),
10860 /* harmony export */ "defaultMemoize": () => (/* binding */ defaultMemoize)
10861 /* harmony export */ });
10862 // Cache implementation based on Erik Rasmussen's `lru-memoize`:
10863 // https://github.com/erikras/lru-memoize
10864 var NOT_FOUND = 'NOT_FOUND';
10865
10866 function createSingletonCache(equals) {
10867 var entry;
10868 return {
10869 get: function get(key) {
10870 if (entry && equals(entry.key, key)) {
10871 return entry.value;
10872 }
10873
10874 return NOT_FOUND;
10875 },
10876 put: function put(key, value) {
10877 entry = {
10878 key: key,
10879 value: value
10880 };
10881 },
10882 getEntries: function getEntries() {
10883 return entry ? [entry] : [];
10884 },
10885 clear: function clear() {
10886 entry = undefined;
10887 }
10888 };
10889 }
10890
10891 function createLruCache(maxSize, equals) {
10892 var entries = [];
10893
10894 function get(key) {
10895 var cacheIndex = entries.findIndex(function (entry) {
10896 return equals(key, entry.key);
10897 }); // We found a cached entry
10898
10899 if (cacheIndex > -1) {
10900 var entry = entries[cacheIndex]; // Cached entry not at top of cache, move it to the top
10901
10902 if (cacheIndex > 0) {
10903 entries.splice(cacheIndex, 1);
10904 entries.unshift(entry);
10905 }
10906
10907 return entry.value;
10908 } // No entry found in cache, return sentinel
10909
10910
10911 return NOT_FOUND;
10912 }
10913
10914 function put(key, value) {
10915 if (get(key) === NOT_FOUND) {
10916 // TODO Is unshift slow?
10917 entries.unshift({
10918 key: key,
10919 value: value
10920 });
10921
10922 if (entries.length > maxSize) {
10923 entries.pop();
10924 }
10925 }
10926 }
10927
10928 function getEntries() {
10929 return entries;
10930 }
10931
10932 function clear() {
10933 entries = [];
10934 }
10935
10936 return {
10937 get: get,
10938 put: put,
10939 getEntries: getEntries,
10940 clear: clear
10941 };
10942 }
10943
10944 var defaultEqualityCheck = function defaultEqualityCheck(a, b) {
10945 return a === b;
10946 };
10947 function createCacheKeyComparator(equalityCheck) {
10948 return function areArgumentsShallowlyEqual(prev, next) {
10949 if (prev === null || next === null || prev.length !== next.length) {
10950 return false;
10951 } // Do this in a for loop (and not a `forEach` or an `every`) so we can determine equality as fast as possible.
10952
10953
10954 var length = prev.length;
10955
10956 for (var i = 0; i < length; i++) {
10957 if (!equalityCheck(prev[i], next[i])) {
10958 return false;
10959 }
10960 }
10961
10962 return true;
10963 };
10964 }
10965 // defaultMemoize now supports a configurable cache size with LRU behavior,
10966 // and optional comparison of the result value with existing values
10967 function defaultMemoize(func, equalityCheckOrOptions) {
10968 var providedOptions = typeof equalityCheckOrOptions === 'object' ? equalityCheckOrOptions : {
10969 equalityCheck: equalityCheckOrOptions
10970 };
10971 var _providedOptions$equa = providedOptions.equalityCheck,
10972 equalityCheck = _providedOptions$equa === void 0 ? defaultEqualityCheck : _providedOptions$equa,
10973 _providedOptions$maxS = providedOptions.maxSize,
10974 maxSize = _providedOptions$maxS === void 0 ? 1 : _providedOptions$maxS,
10975 resultEqualityCheck = providedOptions.resultEqualityCheck;
10976 var comparator = createCacheKeyComparator(equalityCheck);
10977 var cache = maxSize === 1 ? createSingletonCache(comparator) : createLruCache(maxSize, comparator); // we reference arguments instead of spreading them for performance reasons
10978
10979 function memoized() {
10980 var value = cache.get(arguments);
10981
10982 if (value === NOT_FOUND) {
10983 // @ts-ignore
10984 value = func.apply(null, arguments);
10985
10986 if (resultEqualityCheck) {
10987 var entries = cache.getEntries();
10988 var matchingEntry = entries.find(function (entry) {
10989 return resultEqualityCheck(entry.value, value);
10990 });
10991
10992 if (matchingEntry) {
10993 value = matchingEntry.value;
10994 }
10995 }
10996
10997 cache.put(arguments, value);
10998 }
10999
11000 return value;
11001 }
11002
11003 memoized.clearCache = function () {
11004 return cache.clear();
11005 };
11006
11007 return memoized;
11008 }
11009
11010 /***/ }),
11011
11012 /***/ "../node_modules/reselect/es/index.js":
11013 /*!********************************************!*\
11014 !*** ../node_modules/reselect/es/index.js ***!
11015 \********************************************/
11016 /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
11017
11018 "use strict";
11019 __webpack_require__.r(__webpack_exports__);
11020 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
11021 /* harmony export */ "createSelector": () => (/* binding */ createSelector),
11022 /* harmony export */ "createSelectorCreator": () => (/* binding */ createSelectorCreator),
11023 /* harmony export */ "createStructuredSelector": () => (/* binding */ createStructuredSelector),
11024 /* harmony export */ "defaultEqualityCheck": () => (/* reexport safe */ _defaultMemoize__WEBPACK_IMPORTED_MODULE_0__.defaultEqualityCheck),
11025 /* harmony export */ "defaultMemoize": () => (/* reexport safe */ _defaultMemoize__WEBPACK_IMPORTED_MODULE_0__.defaultMemoize)
11026 /* harmony export */ });
11027 /* harmony import */ var _defaultMemoize__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./defaultMemoize */ "../node_modules/reselect/es/defaultMemoize.js");
11028
11029
11030
11031 function getDependencies(funcs) {
11032 var dependencies = Array.isArray(funcs[0]) ? funcs[0] : funcs;
11033
11034 if (!dependencies.every(function (dep) {
11035 return typeof dep === 'function';
11036 })) {
11037 var dependencyTypes = dependencies.map(function (dep) {
11038 return typeof dep === 'function' ? "function " + (dep.name || 'unnamed') + "()" : typeof dep;
11039 }).join(', ');
11040 throw new Error("createSelector expects all input-selectors to be functions, but received the following types: [" + dependencyTypes + "]");
11041 }
11042
11043 return dependencies;
11044 }
11045
11046 function createSelectorCreator(memoize) {
11047 for (var _len = arguments.length, memoizeOptionsFromArgs = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
11048 memoizeOptionsFromArgs[_key - 1] = arguments[_key];
11049 }
11050
11051 var createSelector = function createSelector() {
11052 for (var _len2 = arguments.length, funcs = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
11053 funcs[_key2] = arguments[_key2];
11054 }
11055
11056 var _recomputations = 0;
11057
11058 var _lastResult; // Due to the intricacies of rest params, we can't do an optional arg after `...funcs`.
11059 // So, start by declaring the default value here.
11060 // (And yes, the words 'memoize' and 'options' appear too many times in this next sequence.)
11061
11062
11063 var directlyPassedOptions = {
11064 memoizeOptions: undefined
11065 }; // Normally, the result func or "output selector" is the last arg
11066
11067 var resultFunc = funcs.pop(); // If the result func is actually an _object_, assume it's our options object
11068
11069 if (typeof resultFunc === 'object') {
11070 directlyPassedOptions = resultFunc; // and pop the real result func off
11071
11072 resultFunc = funcs.pop();
11073 }
11074
11075 if (typeof resultFunc !== 'function') {
11076 throw new Error("createSelector expects an output function after the inputs, but received: [" + typeof resultFunc + "]");
11077 } // Determine which set of options we're using. Prefer options passed directly,
11078 // but fall back to options given to createSelectorCreator.
11079
11080
11081 var _directlyPassedOption = directlyPassedOptions,
11082 _directlyPassedOption2 = _directlyPassedOption.memoizeOptions,
11083 memoizeOptions = _directlyPassedOption2 === void 0 ? memoizeOptionsFromArgs : _directlyPassedOption2; // Simplifying assumption: it's unlikely that the first options arg of the provided memoizer
11084 // is an array. In most libs I've looked at, it's an equality function or options object.
11085 // Based on that, if `memoizeOptions` _is_ an array, we assume it's a full
11086 // user-provided array of options. Otherwise, it must be just the _first_ arg, and so
11087 // we wrap it in an array so we can apply it.
11088
11089 var finalMemoizeOptions = Array.isArray(memoizeOptions) ? memoizeOptions : [memoizeOptions];
11090 var dependencies = getDependencies(funcs);
11091 var memoizedResultFunc = memoize.apply(void 0, [function recomputationWrapper() {
11092 _recomputations++; // apply arguments instead of spreading for performance.
11093
11094 return resultFunc.apply(null, arguments);
11095 }].concat(finalMemoizeOptions)); // If a selector is called with the exact same arguments we don't need to traverse our dependencies again.
11096
11097 var selector = memoize(function dependenciesChecker() {
11098 var params = [];
11099 var length = dependencies.length;
11100
11101 for (var i = 0; i < length; i++) {
11102 // apply arguments instead of spreading and mutate a local list of params for performance.
11103 // @ts-ignore
11104 params.push(dependencies[i].apply(null, arguments));
11105 } // apply arguments instead of spreading for performance.
11106
11107
11108 _lastResult = memoizedResultFunc.apply(null, params);
11109 return _lastResult;
11110 });
11111 Object.assign(selector, {
11112 resultFunc: resultFunc,
11113 memoizedResultFunc: memoizedResultFunc,
11114 dependencies: dependencies,
11115 lastResult: function lastResult() {
11116 return _lastResult;
11117 },
11118 recomputations: function recomputations() {
11119 return _recomputations;
11120 },
11121 resetRecomputations: function resetRecomputations() {
11122 return _recomputations = 0;
11123 }
11124 });
11125 return selector;
11126 }; // @ts-ignore
11127
11128
11129 return createSelector;
11130 }
11131 var createSelector = /* #__PURE__ */createSelectorCreator(_defaultMemoize__WEBPACK_IMPORTED_MODULE_0__.defaultMemoize);
11132 // Manual definition of state and output arguments
11133 var createStructuredSelector = function createStructuredSelector(selectors, selectorCreator) {
11134 if (selectorCreator === void 0) {
11135 selectorCreator = createSelector;
11136 }
11137
11138 if (typeof selectors !== 'object') {
11139 throw new Error('createStructuredSelector expects first argument to be an object ' + ("where each property is a selector, instead received a " + typeof selectors));
11140 }
11141
11142 var objectKeys = Object.keys(selectors);
11143 var resultSelector = selectorCreator( // @ts-ignore
11144 objectKeys.map(function (key) {
11145 return selectors[key];
11146 }), function () {
11147 for (var _len3 = arguments.length, values = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
11148 values[_key3] = arguments[_key3];
11149 }
11150
11151 return values.reduce(function (composition, value, index) {
11152 composition[objectKeys[index]] = value;
11153 return composition;
11154 }, {});
11155 });
11156 return resultSelector;
11157 };
11158
11159 /***/ }),
11160
11161 /***/ "../node_modules/@babel/runtime/helpers/arrayLikeToArray.js":
11162 /*!******************************************************************!*\
11163 !*** ../node_modules/@babel/runtime/helpers/arrayLikeToArray.js ***!
11164 \******************************************************************/
11165 /***/ ((module) => {
11166
11167 function _arrayLikeToArray(arr, len) {
11168 if (len == null || len > arr.length) len = arr.length;
11169
11170 for (var i = 0, arr2 = new Array(len); i < len; i++) {
11171 arr2[i] = arr[i];
11172 }
11173
11174 return arr2;
11175 }
11176
11177 module.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
11178
11179 /***/ }),
11180
11181 /***/ "../node_modules/@babel/runtime/helpers/arrayWithHoles.js":
11182 /*!****************************************************************!*\
11183 !*** ../node_modules/@babel/runtime/helpers/arrayWithHoles.js ***!
11184 \****************************************************************/
11185 /***/ ((module) => {
11186
11187 function _arrayWithHoles(arr) {
11188 if (Array.isArray(arr)) return arr;
11189 }
11190
11191 module.exports = _arrayWithHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
11192
11193 /***/ }),
11194
11195 /***/ "../node_modules/@babel/runtime/helpers/assertThisInitialized.js":
11196 /*!***********************************************************************!*\
11197 !*** ../node_modules/@babel/runtime/helpers/assertThisInitialized.js ***!
11198 \***********************************************************************/
11199 /***/ ((module) => {
11200
11201 function _assertThisInitialized(self) {
11202 if (self === void 0) {
11203 throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
11204 }
11205
11206 return self;
11207 }
11208
11209 module.exports = _assertThisInitialized, module.exports.__esModule = true, module.exports["default"] = module.exports;
11210
11211 /***/ }),
11212
11213 /***/ "../node_modules/@babel/runtime/helpers/asyncToGenerator.js":
11214 /*!******************************************************************!*\
11215 !*** ../node_modules/@babel/runtime/helpers/asyncToGenerator.js ***!
11216 \******************************************************************/
11217 /***/ ((module) => {
11218
11219 function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
11220 try {
11221 var info = gen[key](arg);
11222 var value = info.value;
11223 } catch (error) {
11224 reject(error);
11225 return;
11226 }
11227
11228 if (info.done) {
11229 resolve(value);
11230 } else {
11231 Promise.resolve(value).then(_next, _throw);
11232 }
11233 }
11234
11235 function _asyncToGenerator(fn) {
11236 return function () {
11237 var self = this,
11238 args = arguments;
11239 return new Promise(function (resolve, reject) {
11240 var gen = fn.apply(self, args);
11241
11242 function _next(value) {
11243 asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
11244 }
11245
11246 function _throw(err) {
11247 asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
11248 }
11249
11250 _next(undefined);
11251 });
11252 };
11253 }
11254
11255 module.exports = _asyncToGenerator, module.exports.__esModule = true, module.exports["default"] = module.exports;
11256
11257 /***/ }),
11258
11259 /***/ "../node_modules/@babel/runtime/helpers/classCallCheck.js":
11260 /*!****************************************************************!*\
11261 !*** ../node_modules/@babel/runtime/helpers/classCallCheck.js ***!
11262 \****************************************************************/
11263 /***/ ((module) => {
11264
11265 function _classCallCheck(instance, Constructor) {
11266 if (!(instance instanceof Constructor)) {
11267 throw new TypeError("Cannot call a class as a function");
11268 }
11269 }
11270
11271 module.exports = _classCallCheck, module.exports.__esModule = true, module.exports["default"] = module.exports;
11272
11273 /***/ }),
11274
11275 /***/ "../node_modules/@babel/runtime/helpers/construct.js":
11276 /*!***********************************************************!*\
11277 !*** ../node_modules/@babel/runtime/helpers/construct.js ***!
11278 \***********************************************************/
11279 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
11280
11281 var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ "../node_modules/@babel/runtime/helpers/setPrototypeOf.js");
11282
11283 var isNativeReflectConstruct = __webpack_require__(/*! ./isNativeReflectConstruct.js */ "../node_modules/@babel/runtime/helpers/isNativeReflectConstruct.js");
11284
11285 function _construct(Parent, args, Class) {
11286 if (isNativeReflectConstruct()) {
11287 module.exports = _construct = Reflect.construct.bind(), module.exports.__esModule = true, module.exports["default"] = module.exports;
11288 } else {
11289 module.exports = _construct = function _construct(Parent, args, Class) {
11290 var a = [null];
11291 a.push.apply(a, args);
11292 var Constructor = Function.bind.apply(Parent, a);
11293 var instance = new Constructor();
11294 if (Class) setPrototypeOf(instance, Class.prototype);
11295 return instance;
11296 }, module.exports.__esModule = true, module.exports["default"] = module.exports;
11297 }
11298
11299 return _construct.apply(null, arguments);
11300 }
11301
11302 module.exports = _construct, module.exports.__esModule = true, module.exports["default"] = module.exports;
11303
11304 /***/ }),
11305
11306 /***/ "../node_modules/@babel/runtime/helpers/createClass.js":
11307 /*!*************************************************************!*\
11308 !*** ../node_modules/@babel/runtime/helpers/createClass.js ***!
11309 \*************************************************************/
11310 /***/ ((module) => {
11311
11312 function _defineProperties(target, props) {
11313 for (var i = 0; i < props.length; i++) {
11314 var descriptor = props[i];
11315 descriptor.enumerable = descriptor.enumerable || false;
11316 descriptor.configurable = true;
11317 if ("value" in descriptor) descriptor.writable = true;
11318 Object.defineProperty(target, descriptor.key, descriptor);
11319 }
11320 }
11321
11322 function _createClass(Constructor, protoProps, staticProps) {
11323 if (protoProps) _defineProperties(Constructor.prototype, protoProps);
11324 if (staticProps) _defineProperties(Constructor, staticProps);
11325 Object.defineProperty(Constructor, "prototype", {
11326 writable: false
11327 });
11328 return Constructor;
11329 }
11330
11331 module.exports = _createClass, module.exports.__esModule = true, module.exports["default"] = module.exports;
11332
11333 /***/ }),
11334
11335 /***/ "../node_modules/@babel/runtime/helpers/defineProperty.js":
11336 /*!****************************************************************!*\
11337 !*** ../node_modules/@babel/runtime/helpers/defineProperty.js ***!
11338 \****************************************************************/
11339 /***/ ((module) => {
11340
11341 function _defineProperty(obj, key, value) {
11342 if (key in obj) {
11343 Object.defineProperty(obj, key, {
11344 value: value,
11345 enumerable: true,
11346 configurable: true,
11347 writable: true
11348 });
11349 } else {
11350 obj[key] = value;
11351 }
11352
11353 return obj;
11354 }
11355
11356 module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports;
11357
11358 /***/ }),
11359
11360 /***/ "../node_modules/@babel/runtime/helpers/get.js":
11361 /*!*****************************************************!*\
11362 !*** ../node_modules/@babel/runtime/helpers/get.js ***!
11363 \*****************************************************/
11364 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
11365
11366 var superPropBase = __webpack_require__(/*! ./superPropBase.js */ "../node_modules/@babel/runtime/helpers/superPropBase.js");
11367
11368 function _get() {
11369 if (typeof Reflect !== "undefined" && Reflect.get) {
11370 module.exports = _get = Reflect.get.bind(), module.exports.__esModule = true, module.exports["default"] = module.exports;
11371 } else {
11372 module.exports = _get = function _get(target, property, receiver) {
11373 var base = superPropBase(target, property);
11374 if (!base) return;
11375 var desc = Object.getOwnPropertyDescriptor(base, property);
11376
11377 if (desc.get) {
11378 return desc.get.call(arguments.length < 3 ? target : receiver);
11379 }
11380
11381 return desc.value;
11382 }, module.exports.__esModule = true, module.exports["default"] = module.exports;
11383 }
11384
11385 return _get.apply(this, arguments);
11386 }
11387
11388 module.exports = _get, module.exports.__esModule = true, module.exports["default"] = module.exports;
11389
11390 /***/ }),
11391
11392 /***/ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js":
11393 /*!****************************************************************!*\
11394 !*** ../node_modules/@babel/runtime/helpers/getPrototypeOf.js ***!
11395 \****************************************************************/
11396 /***/ ((module) => {
11397
11398 function _getPrototypeOf(o) {
11399 module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
11400 return o.__proto__ || Object.getPrototypeOf(o);
11401 }, module.exports.__esModule = true, module.exports["default"] = module.exports;
11402 return _getPrototypeOf(o);
11403 }
11404
11405 module.exports = _getPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
11406
11407 /***/ }),
11408
11409 /***/ "../node_modules/@babel/runtime/helpers/inherits.js":
11410 /*!**********************************************************!*\
11411 !*** ../node_modules/@babel/runtime/helpers/inherits.js ***!
11412 \**********************************************************/
11413 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
11414
11415 var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ "../node_modules/@babel/runtime/helpers/setPrototypeOf.js");
11416
11417 function _inherits(subClass, superClass) {
11418 if (typeof superClass !== "function" && superClass !== null) {
11419 throw new TypeError("Super expression must either be null or a function");
11420 }
11421
11422 subClass.prototype = Object.create(superClass && superClass.prototype, {
11423 constructor: {
11424 value: subClass,
11425 writable: true,
11426 configurable: true
11427 }
11428 });
11429 Object.defineProperty(subClass, "prototype", {
11430 writable: false
11431 });
11432 if (superClass) setPrototypeOf(subClass, superClass);
11433 }
11434
11435 module.exports = _inherits, module.exports.__esModule = true, module.exports["default"] = module.exports;
11436
11437 /***/ }),
11438
11439 /***/ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js":
11440 /*!***********************************************************************!*\
11441 !*** ../node_modules/@babel/runtime/helpers/interopRequireDefault.js ***!
11442 \***********************************************************************/
11443 /***/ ((module) => {
11444
11445 function _interopRequireDefault(obj) {
11446 return obj && obj.__esModule ? obj : {
11447 "default": obj
11448 };
11449 }
11450
11451 module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
11452
11453 /***/ }),
11454
11455 /***/ "../node_modules/@babel/runtime/helpers/isNativeFunction.js":
11456 /*!******************************************************************!*\
11457 !*** ../node_modules/@babel/runtime/helpers/isNativeFunction.js ***!
11458 \******************************************************************/
11459 /***/ ((module) => {
11460
11461 function _isNativeFunction(fn) {
11462 return Function.toString.call(fn).indexOf("[native code]") !== -1;
11463 }
11464
11465 module.exports = _isNativeFunction, module.exports.__esModule = true, module.exports["default"] = module.exports;
11466
11467 /***/ }),
11468
11469 /***/ "../node_modules/@babel/runtime/helpers/isNativeReflectConstruct.js":
11470 /*!**************************************************************************!*\
11471 !*** ../node_modules/@babel/runtime/helpers/isNativeReflectConstruct.js ***!
11472 \**************************************************************************/
11473 /***/ ((module) => {
11474
11475 function _isNativeReflectConstruct() {
11476 if (typeof Reflect === "undefined" || !Reflect.construct) return false;
11477 if (Reflect.construct.sham) return false;
11478 if (typeof Proxy === "function") return true;
11479
11480 try {
11481 Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
11482 return true;
11483 } catch (e) {
11484 return false;
11485 }
11486 }
11487
11488 module.exports = _isNativeReflectConstruct, module.exports.__esModule = true, module.exports["default"] = module.exports;
11489
11490 /***/ }),
11491
11492 /***/ "../node_modules/@babel/runtime/helpers/iterableToArrayLimit.js":
11493 /*!**********************************************************************!*\
11494 !*** ../node_modules/@babel/runtime/helpers/iterableToArrayLimit.js ***!
11495 \**********************************************************************/
11496 /***/ ((module) => {
11497
11498 function _iterableToArrayLimit(arr, i) {
11499 var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
11500
11501 if (_i == null) return;
11502 var _arr = [];
11503 var _n = true;
11504 var _d = false;
11505
11506 var _s, _e;
11507
11508 try {
11509 for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
11510 _arr.push(_s.value);
11511
11512 if (i && _arr.length === i) break;
11513 }
11514 } catch (err) {
11515 _d = true;
11516 _e = err;
11517 } finally {
11518 try {
11519 if (!_n && _i["return"] != null) _i["return"]();
11520 } finally {
11521 if (_d) throw _e;
11522 }
11523 }
11524
11525 return _arr;
11526 }
11527
11528 module.exports = _iterableToArrayLimit, module.exports.__esModule = true, module.exports["default"] = module.exports;
11529
11530 /***/ }),
11531
11532 /***/ "../node_modules/@babel/runtime/helpers/nonIterableRest.js":
11533 /*!*****************************************************************!*\
11534 !*** ../node_modules/@babel/runtime/helpers/nonIterableRest.js ***!
11535 \*****************************************************************/
11536 /***/ ((module) => {
11537
11538 function _nonIterableRest() {
11539 throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
11540 }
11541
11542 module.exports = _nonIterableRest, module.exports.__esModule = true, module.exports["default"] = module.exports;
11543
11544 /***/ }),
11545
11546 /***/ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js":
11547 /*!***************************************************************************!*\
11548 !*** ../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js ***!
11549 \***************************************************************************/
11550 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
11551
11552 var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]);
11553
11554 var assertThisInitialized = __webpack_require__(/*! ./assertThisInitialized.js */ "../node_modules/@babel/runtime/helpers/assertThisInitialized.js");
11555
11556 function _possibleConstructorReturn(self, call) {
11557 if (call && (_typeof(call) === "object" || typeof call === "function")) {
11558 return call;
11559 } else if (call !== void 0) {
11560 throw new TypeError("Derived constructors may only return object or undefined");
11561 }
11562
11563 return assertThisInitialized(self);
11564 }
11565
11566 module.exports = _possibleConstructorReturn, module.exports.__esModule = true, module.exports["default"] = module.exports;
11567
11568 /***/ }),
11569
11570 /***/ "../node_modules/@babel/runtime/helpers/regeneratorRuntime.js":
11571 /*!********************************************************************!*\
11572 !*** ../node_modules/@babel/runtime/helpers/regeneratorRuntime.js ***!
11573 \********************************************************************/
11574 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
11575
11576 var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]);
11577
11578 function _regeneratorRuntime() {
11579 "use strict";
11580 /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
11581
11582 module.exports = _regeneratorRuntime = function _regeneratorRuntime() {
11583 return exports;
11584 }, module.exports.__esModule = true, module.exports["default"] = module.exports;
11585 var exports = {},
11586 Op = Object.prototype,
11587 hasOwn = Op.hasOwnProperty,
11588 $Symbol = "function" == typeof Symbol ? Symbol : {},
11589 iteratorSymbol = $Symbol.iterator || "@@iterator",
11590 asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
11591 toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
11592
11593 function define(obj, key, value) {
11594 return Object.defineProperty(obj, key, {
11595 value: value,
11596 enumerable: !0,
11597 configurable: !0,
11598 writable: !0
11599 }), obj[key];
11600 }
11601
11602 try {
11603 define({}, "");
11604 } catch (err) {
11605 define = function define(obj, key, value) {
11606 return obj[key] = value;
11607 };
11608 }
11609
11610 function wrap(innerFn, outerFn, self, tryLocsList) {
11611 var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
11612 generator = Object.create(protoGenerator.prototype),
11613 context = new Context(tryLocsList || []);
11614 return generator._invoke = function (innerFn, self, context) {
11615 var state = "suspendedStart";
11616 return function (method, arg) {
11617 if ("executing" === state) throw new Error("Generator is already running");
11618
11619 if ("completed" === state) {
11620 if ("throw" === method) throw arg;
11621 return doneResult();
11622 }
11623
11624 for (context.method = method, context.arg = arg;;) {
11625 var delegate = context.delegate;
11626
11627 if (delegate) {
11628 var delegateResult = maybeInvokeDelegate(delegate, context);
11629
11630 if (delegateResult) {
11631 if (delegateResult === ContinueSentinel) continue;
11632 return delegateResult;
11633 }
11634 }
11635
11636 if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
11637 if ("suspendedStart" === state) throw state = "completed", context.arg;
11638 context.dispatchException(context.arg);
11639 } else "return" === context.method && context.abrupt("return", context.arg);
11640 state = "executing";
11641 var record = tryCatch(innerFn, self, context);
11642
11643 if ("normal" === record.type) {
11644 if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
11645 return {
11646 value: record.arg,
11647 done: context.done
11648 };
11649 }
11650
11651 "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
11652 }
11653 };
11654 }(innerFn, self, context), generator;
11655 }
11656
11657 function tryCatch(fn, obj, arg) {
11658 try {
11659 return {
11660 type: "normal",
11661 arg: fn.call(obj, arg)
11662 };
11663 } catch (err) {
11664 return {
11665 type: "throw",
11666 arg: err
11667 };
11668 }
11669 }
11670
11671 exports.wrap = wrap;
11672 var ContinueSentinel = {};
11673
11674 function Generator() {}
11675
11676 function GeneratorFunction() {}
11677
11678 function GeneratorFunctionPrototype() {}
11679
11680 var IteratorPrototype = {};
11681 define(IteratorPrototype, iteratorSymbol, function () {
11682 return this;
11683 });
11684 var getProto = Object.getPrototypeOf,
11685 NativeIteratorPrototype = getProto && getProto(getProto(values([])));
11686 NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
11687 var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
11688
11689 function defineIteratorMethods(prototype) {
11690 ["next", "throw", "return"].forEach(function (method) {
11691 define(prototype, method, function (arg) {
11692 return this._invoke(method, arg);
11693 });
11694 });
11695 }
11696
11697 function AsyncIterator(generator, PromiseImpl) {
11698 function invoke(method, arg, resolve, reject) {
11699 var record = tryCatch(generator[method], generator, arg);
11700
11701 if ("throw" !== record.type) {
11702 var result = record.arg,
11703 value = result.value;
11704 return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
11705 invoke("next", value, resolve, reject);
11706 }, function (err) {
11707 invoke("throw", err, resolve, reject);
11708 }) : PromiseImpl.resolve(value).then(function (unwrapped) {
11709 result.value = unwrapped, resolve(result);
11710 }, function (error) {
11711 return invoke("throw", error, resolve, reject);
11712 });
11713 }
11714
11715 reject(record.arg);
11716 }
11717
11718 var previousPromise;
11719
11720 this._invoke = function (method, arg) {
11721 function callInvokeWithMethodAndArg() {
11722 return new PromiseImpl(function (resolve, reject) {
11723 invoke(method, arg, resolve, reject);
11724 });
11725 }
11726
11727 return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
11728 };
11729 }
11730
11731 function maybeInvokeDelegate(delegate, context) {
11732 var method = delegate.iterator[context.method];
11733
11734 if (undefined === method) {
11735 if (context.delegate = null, "throw" === context.method) {
11736 if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel;
11737 context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method");
11738 }
11739
11740 return ContinueSentinel;
11741 }
11742
11743 var record = tryCatch(method, delegate.iterator, context.arg);
11744 if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
11745 var info = record.arg;
11746 return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel);
11747 }
11748
11749 function pushTryEntry(locs) {
11750 var entry = {
11751 tryLoc: locs[0]
11752 };
11753 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
11754 }
11755
11756 function resetTryEntry(entry) {
11757 var record = entry.completion || {};
11758 record.type = "normal", delete record.arg, entry.completion = record;
11759 }
11760
11761 function Context(tryLocsList) {
11762 this.tryEntries = [{
11763 tryLoc: "root"
11764 }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
11765 }
11766
11767 function values(iterable) {
11768 if (iterable) {
11769 var iteratorMethod = iterable[iteratorSymbol];
11770 if (iteratorMethod) return iteratorMethod.call(iterable);
11771 if ("function" == typeof iterable.next) return iterable;
11772
11773 if (!isNaN(iterable.length)) {
11774 var i = -1,
11775 next = function next() {
11776 for (; ++i < iterable.length;) {
11777 if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
11778 }
11779
11780 return next.value = undefined, next.done = !0, next;
11781 };
11782
11783 return next.next = next;
11784 }
11785 }
11786
11787 return {
11788 next: doneResult
11789 };
11790 }
11791
11792 function doneResult() {
11793 return {
11794 value: undefined,
11795 done: !0
11796 };
11797 }
11798
11799 return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
11800 var ctor = "function" == typeof genFun && genFun.constructor;
11801 return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
11802 }, exports.mark = function (genFun) {
11803 return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
11804 }, exports.awrap = function (arg) {
11805 return {
11806 __await: arg
11807 };
11808 }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
11809 return this;
11810 }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
11811 void 0 === PromiseImpl && (PromiseImpl = Promise);
11812 var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
11813 return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
11814 return result.done ? result.value : iter.next();
11815 });
11816 }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
11817 return this;
11818 }), define(Gp, "toString", function () {
11819 return "[object Generator]";
11820 }), exports.keys = function (object) {
11821 var keys = [];
11822
11823 for (var key in object) {
11824 keys.push(key);
11825 }
11826
11827 return keys.reverse(), function next() {
11828 for (; keys.length;) {
11829 var key = keys.pop();
11830 if (key in object) return next.value = key, next.done = !1, next;
11831 }
11832
11833 return next.done = !0, next;
11834 };
11835 }, exports.values = values, Context.prototype = {
11836 constructor: Context,
11837 reset: function reset(skipTempReset) {
11838 if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) {
11839 "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
11840 }
11841 },
11842 stop: function stop() {
11843 this.done = !0;
11844 var rootRecord = this.tryEntries[0].completion;
11845 if ("throw" === rootRecord.type) throw rootRecord.arg;
11846 return this.rval;
11847 },
11848 dispatchException: function dispatchException(exception) {
11849 if (this.done) throw exception;
11850 var context = this;
11851
11852 function handle(loc, caught) {
11853 return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
11854 }
11855
11856 for (var i = this.tryEntries.length - 1; i >= 0; --i) {
11857 var entry = this.tryEntries[i],
11858 record = entry.completion;
11859 if ("root" === entry.tryLoc) return handle("end");
11860
11861 if (entry.tryLoc <= this.prev) {
11862 var hasCatch = hasOwn.call(entry, "catchLoc"),
11863 hasFinally = hasOwn.call(entry, "finallyLoc");
11864
11865 if (hasCatch && hasFinally) {
11866 if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
11867 if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
11868 } else if (hasCatch) {
11869 if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
11870 } else {
11871 if (!hasFinally) throw new Error("try statement without catch or finally");
11872 if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
11873 }
11874 }
11875 }
11876 },
11877 abrupt: function abrupt(type, arg) {
11878 for (var i = this.tryEntries.length - 1; i >= 0; --i) {
11879 var entry = this.tryEntries[i];
11880
11881 if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
11882 var finallyEntry = entry;
11883 break;
11884 }
11885 }
11886
11887 finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
11888 var record = finallyEntry ? finallyEntry.completion : {};
11889 return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
11890 },
11891 complete: function complete(record, afterLoc) {
11892 if ("throw" === record.type) throw record.arg;
11893 return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;
11894 },
11895 finish: function finish(finallyLoc) {
11896 for (var i = this.tryEntries.length - 1; i >= 0; --i) {
11897 var entry = this.tryEntries[i];
11898 if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
11899 }
11900 },
11901 "catch": function _catch(tryLoc) {
11902 for (var i = this.tryEntries.length - 1; i >= 0; --i) {
11903 var entry = this.tryEntries[i];
11904
11905 if (entry.tryLoc === tryLoc) {
11906 var record = entry.completion;
11907
11908 if ("throw" === record.type) {
11909 var thrown = record.arg;
11910 resetTryEntry(entry);
11911 }
11912
11913 return thrown;
11914 }
11915 }
11916
11917 throw new Error("illegal catch attempt");
11918 },
11919 delegateYield: function delegateYield(iterable, resultName, nextLoc) {
11920 return this.delegate = {
11921 iterator: values(iterable),
11922 resultName: resultName,
11923 nextLoc: nextLoc
11924 }, "next" === this.method && (this.arg = undefined), ContinueSentinel;
11925 }
11926 }, exports;
11927 }
11928
11929 module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;
11930
11931 /***/ }),
11932
11933 /***/ "../node_modules/@babel/runtime/helpers/setPrototypeOf.js":
11934 /*!****************************************************************!*\
11935 !*** ../node_modules/@babel/runtime/helpers/setPrototypeOf.js ***!
11936 \****************************************************************/
11937 /***/ ((module) => {
11938
11939 function _setPrototypeOf(o, p) {
11940 module.exports = _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
11941 o.__proto__ = p;
11942 return o;
11943 }, module.exports.__esModule = true, module.exports["default"] = module.exports;
11944 return _setPrototypeOf(o, p);
11945 }
11946
11947 module.exports = _setPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
11948
11949 /***/ }),
11950
11951 /***/ "../node_modules/@babel/runtime/helpers/slicedToArray.js":
11952 /*!***************************************************************!*\
11953 !*** ../node_modules/@babel/runtime/helpers/slicedToArray.js ***!
11954 \***************************************************************/
11955 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
11956
11957 var arrayWithHoles = __webpack_require__(/*! ./arrayWithHoles.js */ "../node_modules/@babel/runtime/helpers/arrayWithHoles.js");
11958
11959 var iterableToArrayLimit = __webpack_require__(/*! ./iterableToArrayLimit.js */ "../node_modules/@babel/runtime/helpers/iterableToArrayLimit.js");
11960
11961 var unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray.js */ "../node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js");
11962
11963 var nonIterableRest = __webpack_require__(/*! ./nonIterableRest.js */ "../node_modules/@babel/runtime/helpers/nonIterableRest.js");
11964
11965 function _slicedToArray(arr, i) {
11966 return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();
11967 }
11968
11969 module.exports = _slicedToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
11970
11971 /***/ }),
11972
11973 /***/ "../node_modules/@babel/runtime/helpers/superPropBase.js":
11974 /*!***************************************************************!*\
11975 !*** ../node_modules/@babel/runtime/helpers/superPropBase.js ***!
11976 \***************************************************************/
11977 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
11978
11979 var getPrototypeOf = __webpack_require__(/*! ./getPrototypeOf.js */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js");
11980
11981 function _superPropBase(object, property) {
11982 while (!Object.prototype.hasOwnProperty.call(object, property)) {
11983 object = getPrototypeOf(object);
11984 if (object === null) break;
11985 }
11986
11987 return object;
11988 }
11989
11990 module.exports = _superPropBase, module.exports.__esModule = true, module.exports["default"] = module.exports;
11991
11992 /***/ }),
11993
11994 /***/ "../node_modules/@babel/runtime/helpers/typeof.js":
11995 /*!********************************************************!*\
11996 !*** ../node_modules/@babel/runtime/helpers/typeof.js ***!
11997 \********************************************************/
11998 /***/ ((module) => {
11999
12000 function _typeof(obj) {
12001 "@babel/helpers - typeof";
12002
12003 return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
12004 return typeof obj;
12005 } : function (obj) {
12006 return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
12007 }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(obj);
12008 }
12009
12010 module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
12011
12012 /***/ }),
12013
12014 /***/ "../node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js":
12015 /*!****************************************************************************!*\
12016 !*** ../node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js ***!
12017 \****************************************************************************/
12018 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
12019
12020 var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray.js */ "../node_modules/@babel/runtime/helpers/arrayLikeToArray.js");
12021
12022 function _unsupportedIterableToArray(o, minLen) {
12023 if (!o) return;
12024 if (typeof o === "string") return arrayLikeToArray(o, minLen);
12025 var n = Object.prototype.toString.call(o).slice(8, -1);
12026 if (n === "Object" && o.constructor) n = o.constructor.name;
12027 if (n === "Map" || n === "Set") return Array.from(o);
12028 if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);
12029 }
12030
12031 module.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
12032
12033 /***/ }),
12034
12035 /***/ "../node_modules/@babel/runtime/helpers/wrapNativeSuper.js":
12036 /*!*****************************************************************!*\
12037 !*** ../node_modules/@babel/runtime/helpers/wrapNativeSuper.js ***!
12038 \*****************************************************************/
12039 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
12040
12041 var getPrototypeOf = __webpack_require__(/*! ./getPrototypeOf.js */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js");
12042
12043 var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ "../node_modules/@babel/runtime/helpers/setPrototypeOf.js");
12044
12045 var isNativeFunction = __webpack_require__(/*! ./isNativeFunction.js */ "../node_modules/@babel/runtime/helpers/isNativeFunction.js");
12046
12047 var construct = __webpack_require__(/*! ./construct.js */ "../node_modules/@babel/runtime/helpers/construct.js");
12048
12049 function _wrapNativeSuper(Class) {
12050 var _cache = typeof Map === "function" ? new Map() : undefined;
12051
12052 module.exports = _wrapNativeSuper = function _wrapNativeSuper(Class) {
12053 if (Class === null || !isNativeFunction(Class)) return Class;
12054
12055 if (typeof Class !== "function") {
12056 throw new TypeError("Super expression must either be null or a function");
12057 }
12058
12059 if (typeof _cache !== "undefined") {
12060 if (_cache.has(Class)) return _cache.get(Class);
12061
12062 _cache.set(Class, Wrapper);
12063 }
12064
12065 function Wrapper() {
12066 return construct(Class, arguments, getPrototypeOf(this).constructor);
12067 }
12068
12069 Wrapper.prototype = Object.create(Class.prototype, {
12070 constructor: {
12071 value: Wrapper,
12072 enumerable: false,
12073 writable: true,
12074 configurable: true
12075 }
12076 });
12077 return setPrototypeOf(Wrapper, Class);
12078 }, module.exports.__esModule = true, module.exports["default"] = module.exports;
12079 return _wrapNativeSuper(Class);
12080 }
12081
12082 module.exports = _wrapNativeSuper, module.exports.__esModule = true, module.exports["default"] = module.exports;
12083
12084 /***/ }),
12085
12086 /***/ "../node_modules/@babel/runtime/regenerator/index.js":
12087 /*!***********************************************************!*\
12088 !*** ../node_modules/@babel/runtime/regenerator/index.js ***!
12089 \***********************************************************/
12090 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
12091
12092 // TODO(Babel 8): Remove this file.
12093
12094 var runtime = __webpack_require__(/*! ../helpers/regeneratorRuntime */ "../node_modules/@babel/runtime/helpers/regeneratorRuntime.js")();
12095 module.exports = runtime;
12096
12097 // Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736=
12098 try {
12099 regeneratorRuntime = runtime;
12100 } catch (accidentalStrictMode) {
12101 if (typeof globalThis === "object") {
12102 globalThis.regeneratorRuntime = runtime;
12103 } else {
12104 Function("r", "regeneratorRuntime = r")(runtime);
12105 }
12106 }
12107
12108
12109 /***/ }),
12110
12111 /***/ "../node_modules/@babel/runtime/helpers/esm/defineProperty.js":
12112 /*!********************************************************************!*\
12113 !*** ../node_modules/@babel/runtime/helpers/esm/defineProperty.js ***!
12114 \********************************************************************/
12115 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
12116
12117 "use strict";
12118 __webpack_require__.r(__webpack_exports__);
12119 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
12120 /* harmony export */ "default": () => (/* binding */ _defineProperty)
12121 /* harmony export */ });
12122 function _defineProperty(obj, key, value) {
12123 if (key in obj) {
12124 Object.defineProperty(obj, key, {
12125 value: value,
12126 enumerable: true,
12127 configurable: true,
12128 writable: true
12129 });
12130 } else {
12131 obj[key] = value;
12132 }
12133
12134 return obj;
12135 }
12136
12137 /***/ }),
12138
12139 /***/ "../node_modules/@babel/runtime/helpers/esm/objectSpread2.js":
12140 /*!*******************************************************************!*\
12141 !*** ../node_modules/@babel/runtime/helpers/esm/objectSpread2.js ***!
12142 \*******************************************************************/
12143 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
12144
12145 "use strict";
12146 __webpack_require__.r(__webpack_exports__);
12147 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
12148 /* harmony export */ "default": () => (/* binding */ _objectSpread2)
12149 /* harmony export */ });
12150 /* harmony import */ var _defineProperty_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./defineProperty.js */ "../node_modules/@babel/runtime/helpers/esm/defineProperty.js");
12151
12152
12153 function ownKeys(object, enumerableOnly) {
12154 var keys = Object.keys(object);
12155
12156 if (Object.getOwnPropertySymbols) {
12157 var symbols = Object.getOwnPropertySymbols(object);
12158 enumerableOnly && (symbols = symbols.filter(function (sym) {
12159 return Object.getOwnPropertyDescriptor(object, sym).enumerable;
12160 })), keys.push.apply(keys, symbols);
12161 }
12162
12163 return keys;
12164 }
12165
12166 function _objectSpread2(target) {
12167 for (var i = 1; i < arguments.length; i++) {
12168 var source = null != arguments[i] ? arguments[i] : {};
12169 i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
12170 (0,_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(target, key, source[key]);
12171 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
12172 Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
12173 });
12174 }
12175
12176 return target;
12177 }
12178
12179 /***/ }),
12180
12181 /***/ "../node_modules/immer/dist/immer.esm.mjs":
12182 /*!************************************************!*\
12183 !*** ../node_modules/immer/dist/immer.esm.mjs ***!
12184 \************************************************/
12185 /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
12186
12187 "use strict";
12188 __webpack_require__.r(__webpack_exports__);
12189 /* harmony export */ __webpack_require__.d(__webpack_exports__, {
12190 /* harmony export */ "Immer": () => (/* binding */ un),
12191 /* harmony export */ "applyPatches": () => (/* binding */ pn),
12192 /* harmony export */ "castDraft": () => (/* binding */ K),
12193 /* harmony export */ "castImmutable": () => (/* binding */ $),
12194 /* harmony export */ "createDraft": () => (/* binding */ ln),
12195 /* harmony export */ "current": () => (/* binding */ D),
12196 /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
12197 /* harmony export */ "enableAllPlugins": () => (/* binding */ J),
12198 /* harmony export */ "enableES5": () => (/* binding */ N),
12199 /* harmony export */ "enableMapSet": () => (/* binding */ C),
12200 /* harmony export */ "enablePatches": () => (/* binding */ T),
12201 /* harmony export */ "finishDraft": () => (/* binding */ dn),
12202 /* harmony export */ "freeze": () => (/* binding */ d),
12203 /* harmony export */ "immerable": () => (/* binding */ L),
12204 /* harmony export */ "isDraft": () => (/* binding */ r),
12205 /* harmony export */ "isDraftable": () => (/* binding */ t),
12206 /* harmony export */ "nothing": () => (/* binding */ H),
12207 /* harmony export */ "original": () => (/* binding */ e),
12208 /* harmony export */ "produce": () => (/* binding */ fn),
12209 /* harmony export */ "produceWithPatches": () => (/* binding */ cn),
12210 /* harmony export */ "setAutoFreeze": () => (/* binding */ sn),
12211 /* harmony export */ "setUseProxies": () => (/* binding */ vn)
12212 /* harmony export */ });
12213 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)}throw Error("[Immer] minified error nr: "+n+(t.length?" "+t.map((function(n){return"'"+n+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function r(n){return!!n&&!!n[Q]}function t(n){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]||!!n.constructor[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.delete(r),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)?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 O(n){g(n),n.p.forEach(S),n.p=null}function g(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.O=!0}function P(r,e){e._=e.p.length;var i=e.p[0],o=void 0!==r&&r!==i;return e.h.g||b("ES5").S(e,r,o),o?(i[Q].P&&(O(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,[]),O(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;i(3===e.i?new Set(o):o,(function(r,i){return A(n,e,o,r,i,t)})),x(n,o,!1),t&&n.u&&b("Patches").R(e,t,n.u,n.s)}return e.o}function A(e,i,o,a,c,s){if( true&&c===o&&n(5),r(c)){var v=M(e,c,s&&i&&3!==i.i&&!u(i.D,a)?s.concat(a):void 0);if(f(o,a,v),!r(v))return;e.m=!1}if(t(c)&&!y(c)){if(!e.h.F&&e._<1)return;M(e,c),i&&i.A.l||x(e,c)}}function x(n,r,t){void 0===t&&(t=!1),n.h.F&&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 R(n,r,t){var e=s(r)?b("MapSet").N(r,t):v(r)?b("MapSet").T(r,t):n.g?function(n,r){var t=Array.isArray(n),e={i:t?1:0,A:r?r.A:_(),P:!1,I:!1,D:{},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 D(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=F(r,c),u.I=!1}else e=F(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 F(n,r){switch(r){case 2:return new Map(n);case 3:return Array.from(n)}return l(n)}function N(){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.O&&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,D:{},l:r,t:n,k:i,o:null,O:!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.D,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];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},R: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.D,(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.D,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.D=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=R(n.A.h,r,n);n.p.set(r,e),n.o.add(e)}else n.o.add(r)})))}function u(r){r.O&&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,D:void 0,t:n,k:this,C:!1,O:!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.D.set(n,!0),t.o.set(n,r),t.D.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.D.set(n,!1):r.D.delete(n),r.o.delete(n),!0},o.clear=function(){var n=this[Q];u(n),p(n).size&&(e(n),k(n),n.D=new Map,i(n.t,(function(r){n.D.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=R(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,O:!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",{N:function(n,r){return new f(n,r)},T:function(n,r){return new c(n,r)}})}function J(){N(),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]=R(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.D[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&&"number"!=typeof t&&(void 0!==t||r in n.o)||(n.o[r]=t,n.D[r]=!0,!0)},deleteProperty:function(n,r){return void 0!==z(n.t,r)||r in n.t?(n.D[r]=!1,E(n),k(n)):delete n.D[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.g=B,this.F=!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=R(e,r,void 0),v=!0;try{f=i(s),v=!1}finally{v?O(c):g(c)}return"undefined"!=typeof Promise&&f instanceof Promise?f.then((function(n){return j(c,o),P(n,c)}),(function(n){throw O(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.F&&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=D(e));var i=w(this),o=R(this,e,void 0);return o[Q].C=!0,g(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.F=n},i.setUseProxies=function(r){r&&!B&&n(20),this.g=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);
12214 //# sourceMappingURL=immer.esm.js.map
12215
12216
12217 /***/ })
12218
12219 /******/ });
12220 /************************************************************************/
12221 /******/ // The module cache
12222 /******/ var __webpack_module_cache__ = {};
12223 /******/
12224 /******/ // The require function
12225 /******/ function __webpack_require__(moduleId) {
12226 /******/ // Check if module is in cache
12227 /******/ var cachedModule = __webpack_module_cache__[moduleId];
12228 /******/ if (cachedModule !== undefined) {
12229 /******/ return cachedModule.exports;
12230 /******/ }
12231 /******/ // Create a new module (and put it into the cache)
12232 /******/ var module = __webpack_module_cache__[moduleId] = {
12233 /******/ // no module.id needed
12234 /******/ // no module.loaded needed
12235 /******/ exports: {}
12236 /******/ };
12237 /******/
12238 /******/ // Execute the module function
12239 /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
12240 /******/
12241 /******/ // Return the exports of the module
12242 /******/ return module.exports;
12243 /******/ }
12244 /******/
12245 /************************************************************************/
12246 /******/ /* webpack/runtime/define property getters */
12247 /******/ (() => {
12248 /******/ // define getter functions for harmony exports
12249 /******/ __webpack_require__.d = (exports, definition) => {
12250 /******/ for(var key in definition) {
12251 /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
12252 /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
12253 /******/ }
12254 /******/ }
12255 /******/ };
12256 /******/ })();
12257 /******/
12258 /******/ /* webpack/runtime/hasOwnProperty shorthand */
12259 /******/ (() => {
12260 /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
12261 /******/ })();
12262 /******/
12263 /******/ /* webpack/runtime/make namespace object */
12264 /******/ (() => {
12265 /******/ // define __esModule on exports
12266 /******/ __webpack_require__.r = (exports) => {
12267 /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
12268 /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
12269 /******/ }
12270 /******/ Object.defineProperty(exports, '__esModule', { value: true });
12271 /******/ };
12272 /******/ })();
12273 /******/
12274 /************************************************************************/
12275 var __webpack_exports__ = {};
12276 // This entry need to be wrapped in an IIFE because it need to be in strict mode.
12277 (() => {
12278 "use strict";
12279 /*!*********************************************!*\
12280 !*** ../modules/web-cli/assets/js/index.js ***!
12281 \*********************************************/
12282
12283
12284 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
12285
12286 var _api = _interopRequireDefault(__webpack_require__(/*! ./api */ "../modules/web-cli/assets/js/api.js"));
12287
12288 window.$e = new _api.default();
12289 })();
12290
12291 /******/ })()
12292 ;
12293 //# sourceMappingURL=web-cli.js.map