PluginProbe
Elementor Website Builder – more than just a page builder / 3.9.0
Elementor Website Builder – more than just a page builder v3.9.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 4.0.8 4.1.0-beta1 4.1.0-dev1 All 452 releases
← All changes | assets/js/web-cli.js +11479 -5813 4.3.0-beta33.9.0 View file →
@@ -1,5912 +1,11578 @@
1 -(function(_reduxjs_toolkit) {
1 +/*! elementor - v3.9.0 - 06-12-2022 */
2 +/******/ (() => { // webpackBootstrap
3 +/******/ var __webpack_modules__ = ({
2 4
3 -//#region \0rolldown/runtime.js
4 - var __create = Object.create;
5 - var __defProp = Object.defineProperty;
6 - var __name = (target, value) => __defProp(target, "name", {
7 - value,
8 - configurable: true
9 - });
10 - var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
11 - var __getOwnPropNames = Object.getOwnPropertyNames;
12 - var __getProtoOf = Object.getPrototypeOf;
13 - var __hasOwnProp = Object.prototype.hasOwnProperty;
14 - var __esmMin = (fn, res, err) => () => {
15 - if (err) throw err[0];
16 - try {
17 - return fn && (res = fn(fn = 0)), res;
18 - } catch (e) {
19 - throw err = [e], e;
20 - }
21 - };
22 - var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
23 - var __exportAll = (all, no_symbols) => {
24 - let target = {};
25 - for (var name in all) {
26 - __defProp(target, name, {
27 - get: all[name],
28 - enumerable: true
29 - });
30 - }
31 - if (!no_symbols) {
32 - __defProp(target, Symbol.toStringTag, { value: "Module" });
33 - }
34 - return target;
35 - };
36 - var __copyProps = (to, from, except, desc) => {
37 - if (from && typeof from === "object" || typeof from === "function") {
38 - for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
39 - key = keys[i];
40 - if (!__hasOwnProp.call(to, key) && key !== except) {
41 - __defProp(to, key, {
42 - get: ((k) => from[k]).bind(null, key),
43 - enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
44 - });
45 - }
46 - }
47 - }
48 - return to;
49 - };
50 - var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
51 - value: mod,
52 - enumerable: true
53 - }) : target, mod));
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__) => {
54 10
55 -//#endregion
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 || 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 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 (result === void 0) {
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 (result === void 0) {
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 = Object.keys(state.entities);
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
56 1839
57 -//#region node_modules/@babel/runtime/helpers/esm/classCallCheck.js
58 - function _classCallCheck(a, n) {
59 - if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
60 - }
1840 +/***/ }),
61 1841
62 -//#endregion
63 -//#region node_modules/@babel/runtime/helpers/esm/typeof.js
64 - function _typeof(o) {
65 - "@babel/helpers - typeof";
66 - return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
67 - return typeof o;
68 - } : function(o) {
69 - return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
70 - }, _typeof(o);
71 - }
72 - var init_typeof = __esmMin((() => {}));
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) => {
73 1847
74 -//#endregion
75 -//#region node_modules/@babel/runtime/helpers/esm/toPrimitive.js
76 - init_typeof();
77 - function toPrimitive(t, r) {
78 - if ("object" != _typeof(t) || !t) return t;
79 - var e = t[Symbol.toPrimitive];
80 - if (void 0 !== e) {
81 - var i = e.call(t, r || "default");
82 - if ("object" != _typeof(i)) return i;
83 - throw new TypeError("@@toPrimitive must return a primitive value.");
84 - }
85 - return ("string" === r ? String : Number)(t);
86 - }
1848 +"use strict";
87 1849
88 -//#endregion
89 -//#region node_modules/@babel/runtime/helpers/esm/toPropertyKey.js
90 - init_typeof();
91 - function toPropertyKey(t) {
92 - var i = toPrimitive(t, "string");
93 - return "symbol" == _typeof(i) ? i : i + "";
94 - }
95 1850
96 -//#endregion
97 -//#region node_modules/@babel/runtime/helpers/esm/createClass.js
98 - function _defineProperties(e, r) {
99 - for (var t = 0; t < r.length; t++) {
100 - var o = r[t];
101 - o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, toPropertyKey(o.key), o);
102 - }
103 - }
104 - function _createClass(e, r, t) {
105 - return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e;
106 - }
1851 +Object.defineProperty(exports, "__esModule", ({
1852 + value: true
1853 +}));
1854 +exports["default"] = void 0;
1855 +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; } } }; }
1856 +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); }
1857 +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; }
1858 +/**
1859 + * Some FileAPI objects such as FileList, DataTransferItem and DataTransferItemList has inconsistency with the retrieved
1860 + * object (from events, etc.) and the actual JavaScript object so a regular instanceof doesn't work. This function can
1861 + * check whether it's instanceof by using the objects constructor and prototype names.
1862 + *
1863 + * @param object
1864 + * @param constructors
1865 + * @return {boolean}
1866 + */
1867 +var _default = function _default(object, constructors) {
1868 + constructors = Array.isArray(constructors) ? constructors : [constructors];
1869 + var _iterator = _createForOfIteratorHelper(constructors),
1870 + _step;
1871 + try {
1872 + for (_iterator.s(); !(_step = _iterator.n()).done;) {
1873 + var _constructor = _step.value;
1874 + if (object.constructor.name === _constructor.prototype[Symbol.toStringTag]) {
1875 + return true;
1876 + }
1877 + }
1878 + } catch (err) {
1879 + _iterator.e(err);
1880 + } finally {
1881 + _iterator.f();
1882 + }
1883 + return false;
1884 +};
1885 +exports["default"] = _default;
107 1886
108 -//#endregion
109 -//#region node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js
110 - function _assertThisInitialized(e) {
111 - if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
112 - return e;
113 - }
1887 +/***/ }),
114 1888
115 -//#endregion
116 -//#region node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js
117 - init_typeof();
118 - function _possibleConstructorReturn(t, e) {
119 - if (e && ("object" == _typeof(e) || "function" == typeof e)) return e;
120 - if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
121 - return _assertThisInitialized(t);
122 - }
1889 +/***/ "../assets/dev/js/modules/imports/args-object.js":
1890 +/*!*******************************************************!*\
1891 + !*** ../assets/dev/js/modules/imports/args-object.js ***!
1892 + \*******************************************************/
1893 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
123 1894
124 -//#endregion
125 -//#region node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js
126 - function _getPrototypeOf(t) {
127 - return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(t) {
128 - return t.__proto__ || Object.getPrototypeOf(t);
129 - }, _getPrototypeOf(t);
130 - }
1895 +"use strict";
131 1896
132 -//#endregion
133 -//#region node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js
134 - function _setPrototypeOf(t, e) {
135 - return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t, e) {
136 - return t.__proto__ = e, t;
137 - }, _setPrototypeOf(t, e);
138 - }
139 1897
140 -//#endregion
141 -//#region node_modules/@babel/runtime/helpers/esm/inherits.js
142 - function _inherits(t, e) {
143 - if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
144 - t.prototype = Object.create(e && e.prototype, { constructor: {
145 - value: t,
146 - writable: !0,
147 - configurable: !0
148 - } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e);
149 - }
1898 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
1899 +Object.defineProperty(exports, "__esModule", ({
1900 + value: true
1901 +}));
1902 +exports["default"] = void 0;
1903 +var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js"));
1904 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
1905 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
1906 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
1907 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
1908 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
1909 +var _instanceType = _interopRequireDefault(__webpack_require__(/*! ./instance-type */ "../assets/dev/js/modules/imports/instance-type.js"));
1910 +var _isInstanceof = _interopRequireDefault(__webpack_require__(/*! ../../editor/utils/is-instanceof */ "../assets/dev/js/editor/utils/is-instanceof.js"));
1911 +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); }; }
1912 +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; } }
1913 +var ArgsObject = /*#__PURE__*/function (_InstanceType) {
1914 + (0, _inherits2.default)(ArgsObject, _InstanceType);
1915 + var _super = _createSuper(ArgsObject);
1916 + /**
1917 + * Function constructor().
1918 + *
1919 + * Create ArgsObject.
1920 + *
1921 + * @param {{}} args
1922 + */
1923 + function ArgsObject(args) {
1924 + var _this;
1925 + (0, _classCallCheck2.default)(this, ArgsObject);
1926 + _this = _super.call(this);
1927 + _this.args = args;
1928 + return _this;
1929 + }
150 1930
151 -//#endregion
152 -//#region node_modules/@babel/runtime/helpers/esm/defineProperty.js
153 - function _defineProperty(e, r, t) {
154 - return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
155 - value: t,
156 - enumerable: !0,
157 - configurable: !0,
158 - writable: !0
159 - }) : e[r] = t, e;
160 - }
1931 + /**
1932 + * Function requireArgument().
1933 + *
1934 + * Validate property in args.
1935 + *
1936 + * @param {string} property
1937 + * @param {{}} args
1938 + *
1939 + * @throws {Error}
1940 + *
1941 + */
1942 + (0, _createClass2.default)(ArgsObject, [{
1943 + key: "requireArgument",
1944 + value: function requireArgument(property) {
1945 + var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.args;
1946 + if (!Object.prototype.hasOwnProperty.call(args, property)) {
1947 + throw Error("".concat(property, " is required."));
1948 + }
1949 + }
161 1950
162 -//#endregion
163 -//#region node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js
164 - function _arrayWithHoles(r) {
165 - if (Array.isArray(r)) return r;
166 - }
1951 + /**
1952 + * Function requireArgumentType().
1953 + *
1954 + * Validate property in args using `type === typeof(args.whatever)`.
1955 + *
1956 + * @param {string} property
1957 + * @param {string} type
1958 + * @param {{}} args
1959 + *
1960 + * @throws {Error}
1961 + *
1962 + */
1963 + }, {
1964 + key: "requireArgumentType",
1965 + value: function requireArgumentType(property, type) {
1966 + var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.args;
1967 + this.requireArgument(property, args);
1968 + if ((0, _typeof2.default)(args[property]) !== type) {
1969 + throw Error("".concat(property, " invalid type: ").concat(type, "."));
1970 + }
1971 + }
167 1972
168 -//#endregion
169 -//#region node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js
170 - function _iterableToArrayLimit(r, l) {
171 - var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
172 - if (null != t) {
173 - var e;
174 - var n;
175 - var i;
176 - var u;
177 - var a = [];
178 - var f = !0;
179 - var o = !1;
180 - try {
181 - if (i = (t = t.call(r)).next, 0 === l) {
182 - if (Object(t) !== t) return;
183 - f = !1;
184 - } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
185 - } catch (r) {
186 - o = !0, n = r;
187 - } finally {
188 - try {
189 - if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
190 - } finally {
191 - if (o) throw n;
192 - }
193 - }
194 - return a;
195 - }
196 - }
1973 + /**
1974 + * Function requireArgumentInstance().
1975 + *
1976 + * Validate property in args using `args.whatever instanceof instance`.
1977 + *
1978 + * @param {string} property
1979 + * @param {*} instance
1980 + * @param {{}} args
1981 + *
1982 + * @throws {Error}
1983 + *
1984 + */
1985 + }, {
1986 + key: "requireArgumentInstance",
1987 + value: function requireArgumentInstance(property, instance) {
1988 + var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.args;
1989 + this.requireArgument(property, args);
1990 + if (!(args[property] instanceof instance) && !(0, _isInstanceof.default)(args[property], instance)) {
1991 + throw Error("".concat(property, " invalid instance."));
1992 + }
1993 + }
197 1994
198 -//#endregion
199 -//#region node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
200 - function _arrayLikeToArray$2(r, a) {
201 - (null == a || a > r.length) && (a = r.length);
202 - for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
203 - return n;
204 - }
205 - __name(_arrayLikeToArray$2, "_arrayLikeToArray");
1995 + /**
1996 + * Function requireArgumentConstructor().
1997 + *
1998 + * Validate property in args using `type === args.whatever.constructor`.
1999 + *
2000 + * @param {string} property
2001 + * @param {*} type
2002 + * @param {{}} args
2003 + *
2004 + * @throws {Error}
2005 + *
2006 + */
2007 + }, {
2008 + key: "requireArgumentConstructor",
2009 + value: function requireArgumentConstructor(property, type) {
2010 + var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.args;
2011 + this.requireArgument(property, args);
206 2012
207 -//#endregion
208 -//#region node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
209 - function _unsupportedIterableToArray$2(r, a) {
210 - if (r) {
211 - if ("string" == typeof r) return _arrayLikeToArray$2(r, a);
212 - var t = {}.toString.call(r).slice(8, -1);
213 - return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$2(r, a) : void 0;
214 - }
215 - }
216 - __name(_unsupportedIterableToArray$2, "_unsupportedIterableToArray");
2013 + // Note: Converting the constructor to string in order to avoid equation issues
2014 + // due to different memory addresses between iframes (window.Object !== window.top.Object).
2015 + if (args[property].constructor.toString() !== type.prototype.constructor.toString()) {
2016 + throw Error("".concat(property, " invalid constructor type."));
2017 + }
2018 + }
2019 + }], [{
2020 + key: "getInstanceType",
2021 + value: function getInstanceType() {
2022 + return 'ArgsObject';
2023 + }
2024 + }]);
2025 + return ArgsObject;
2026 +}(_instanceType.default);
2027 +exports["default"] = ArgsObject;
217 2028
218 -//#endregion
219 -//#region node_modules/@babel/runtime/helpers/esm/nonIterableRest.js
220 - function _nonIterableRest() {
221 - throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
222 - }
2029 +/***/ }),
223 2030
224 -//#endregion
225 -//#region node_modules/@babel/runtime/helpers/esm/slicedToArray.js
226 - function _slicedToArray(r, e) {
227 - return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray$2(r, e) || _nonIterableRest();
228 - }
2031 +/***/ "../assets/dev/js/modules/imports/instance-type.js":
2032 +/*!*********************************************************!*\
2033 + !*** ../assets/dev/js/modules/imports/instance-type.js ***!
2034 + \*********************************************************/
2035 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
229 2036
230 -//#endregion
231 -//#region node_modules/@babel/runtime/helpers/esm/superPropBase.js
232 - function _superPropBase(t, o) {
233 - for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t)););
234 - return t;
235 - }
2037 +"use strict";
236 2038
237 -//#endregion
238 -//#region node_modules/@babel/runtime/helpers/esm/get.js
239 - function _get() {
240 - return _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function(e, t, r) {
241 - var p = _superPropBase(e, t);
242 - if (p) {
243 - var n = Object.getOwnPropertyDescriptor(p, t);
244 - return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value;
245 - }
246 - }, _get.apply(null, arguments);
247 - }
248 2039
249 -//#endregion
250 -//#region assets/dev/js/modules/imports/instance-type.js
251 - function _superPropGet$5(t, o, e, r) {
252 - var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e);
253 - return 2 & r && "function" == typeof p ? function(t) {
254 - return p.apply(e, t);
255 - } : p;
256 - }
257 - __name(_superPropGet$5, "_superPropGet");
258 - var InstanceType = /*#__PURE__*/ function() {
259 - function InstanceType() {
260 - var _this = this;
261 - _classCallCheck(this, InstanceType);
262 - var target = this instanceof InstanceType ? this.constructor : void 0;
263 - var prototypes = [];
264 - while (target.__proto__ && target.__proto__.name) {
265 - prototypes.push(target.__proto__);
266 - target = target.__proto__;
267 - }
268 - prototypes.reverse().forEach(function(proto) {
269 - return _this instanceof proto;
270 - });
271 - }
272 - return _createClass(InstanceType, null, [{
273 - key: Symbol.hasInstance,
274 - value: function value(target) {
275 - /**
276 - * This is function extending being called each time JS uses instanceOf, since babel use it each time it create new class
277 - * its give's opportunity to mange capabilities of instanceOf operator.
278 - * saving current class each time will give option later to handle instanceOf manually.
279 - */
280 - var result = _superPropGet$5(InstanceType, Symbol.hasInstance, this, 2)([target]);
281 - if (target && !target.constructor.getInstanceType) return result;
282 - if (target) {
283 - if (!target.instanceTypes) target.instanceTypes = [];
284 - if (!result) {
285 - if (this.getInstanceType() === target.constructor.getInstanceType()) result = true;
286 - }
287 - if (result) {
288 - var name = this.getInstanceType === InstanceType.getInstanceType ? "BaseInstanceType" : this.getInstanceType();
289 - if (-1 === target.instanceTypes.indexOf(name)) target.instanceTypes.push(name);
290 - }
291 - }
292 - if (!result && target) result = target.instanceTypes && Array.isArray(target.instanceTypes) && -1 !== target.instanceTypes.indexOf(this.getInstanceType());
293 - return result;
294 - }
295 - }, {
296 - key: "getInstanceType",
297 - value: function getInstanceType() {
298 - elementorModules.ForceMethodImplementation();
299 - }
300 - }]);
301 - }();
2040 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
2041 +Object.defineProperty(exports, "__esModule", ({
2042 + value: true
2043 +}));
2044 +exports["default"] = void 0;
2045 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
2046 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
2047 +var _get2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/get */ "../node_modules/@babel/runtime/helpers/get.js"));
2048 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
2049 +var InstanceType = /*#__PURE__*/function (_Symbol$hasInstance) {
2050 + function InstanceType() {
2051 + var _this = this;
2052 + (0, _classCallCheck2.default)(this, InstanceType);
2053 + // Since anonymous classes sometimes do not get validated by babel, do it manually.
2054 + var target = this instanceof InstanceType ? this.constructor : void 0;
2055 + var prototypes = [];
2056 + while (target.__proto__ && target.__proto__.name) {
2057 + prototypes.push(target.__proto__);
2058 + target = target.__proto__;
2059 + }
2060 + prototypes.reverse().forEach(function (proto) {
2061 + return _this instanceof proto;
2062 + });
2063 + }
2064 + (0, _createClass2.default)(InstanceType, null, [{
2065 + key: _Symbol$hasInstance,
2066 + value: function value(target) {
2067 + /**
2068 + * This is function extending being called each time JS uses instanceOf, since babel use it each time it create new class
2069 + * its give's opportunity to mange capabilities of instanceOf operator.
2070 + * saving current class each time will give option later to handle instanceOf manually.
2071 + */
2072 + var result = (0, _get2.default)((0, _getPrototypeOf2.default)(InstanceType), Symbol.hasInstance, this).call(this, target);
302 2073
303 -//#endregion
304 -//#region assets/dev/js/editor/utils/is-instanceof.js
305 - function _createForOfIteratorHelper$1(r, e) {
306 - var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
307 - if (!t) {
308 - if (Array.isArray(r) || (t = _unsupportedIterableToArray$1(r)) || e && r && "number" == typeof r.length) {
309 - t && (r = t);
310 - var _n = 0;
311 - var F = function F() {};
312 - return {
313 - s: F,
314 - n: function n() {
315 - return _n >= r.length ? { done: !0 } : {
316 - done: !1,
317 - value: r[_n++]
318 - };
319 - },
320 - e: function e(r) {
321 - throw r;
322 - },
323 - f: F
324 - };
325 - }
326 - throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
327 - }
328 - var o;
329 - var a = !0;
330 - var u = !1;
331 - return {
332 - s: function s() {
333 - t = t.call(r);
334 - },
335 - n: function n() {
336 - var r = t.next();
337 - return a = r.done, r;
338 - },
339 - e: function e(r) {
340 - u = !0, o = r;
341 - },
342 - f: function f() {
343 - try {
344 - a || null == t.return || t.return();
345 - } finally {
346 - if (u) throw o;
347 - }
348 - }
349 - };
350 - }
351 - __name(_createForOfIteratorHelper$1, "_createForOfIteratorHelper");
352 - function _unsupportedIterableToArray$1(r, a) {
353 - if (r) {
354 - if ("string" == typeof r) return _arrayLikeToArray$1(r, a);
355 - var t = {}.toString.call(r).slice(8, -1);
356 - return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$1(r, a) : void 0;
357 - }
358 - }
359 - __name(_unsupportedIterableToArray$1, "_unsupportedIterableToArray");
360 - function _arrayLikeToArray$1(r, a) {
361 - (null == a || a > r.length) && (a = r.length);
362 - for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
363 - return n;
364 - }
365 - __name(_arrayLikeToArray$1, "_arrayLikeToArray");
366 - /**
367 - * Some FileAPI objects such as FileList, DataTransferItem and DataTransferItemList has inconsistency with the retrieved
368 - * object (from events, etc.) and the actual JavaScript object so a regular instanceof doesn't work. This function can
369 - * check whether it's instanceof by using the objects constructor and prototype names.
370 - *
371 - * @param object
372 - * @param constructors
373 - * @return {boolean}
374 - */
375 - var is_instanceof_default = /* @__PURE__ */ __name((function(object, constructors) {
376 - constructors = Array.isArray(constructors) ? constructors : [constructors];
377 - var _iterator = _createForOfIteratorHelper$1(constructors);
378 - var _step;
379 - try {
380 - for (_iterator.s(); !(_step = _iterator.n()).done;) {
381 - var constructor = _step.value;
382 - if (object.constructor.name === constructor.prototype[Symbol.toStringTag]) return true;
383 - }
384 - } catch (err) {
385 - _iterator.e(err);
386 - } finally {
387 - _iterator.f();
388 - }
389 - return false;
390 - }), "default");
2074 + // Act normal when validate a class, which does not have instance type.
2075 + if (target && !target.constructor.getInstanceType) {
2076 + return result;
2077 + }
2078 + if (target) {
2079 + if (!target.instanceTypes) {
2080 + target.instanceTypes = [];
2081 + }
2082 + if (!result) {
2083 + if (this.getInstanceType() === target.constructor.getInstanceType()) {
2084 + result = true;
2085 + }
2086 + }
2087 + if (result) {
2088 + var name = this.getInstanceType === InstanceType.getInstanceType ? 'BaseInstanceType' : this.getInstanceType();
2089 + if (-1 === target.instanceTypes.indexOf(name)) {
2090 + target.instanceTypes.push(name);
2091 + }
2092 + }
2093 + }
2094 + if (!result && target) {
2095 + // Check if the given 'target', is instance of known types.
2096 + result = target.instanceTypes && Array.isArray(target.instanceTypes) && -1 !== target.instanceTypes.indexOf(this.getInstanceType());
2097 + }
2098 + return result;
2099 + }
2100 + }, {
2101 + key: "getInstanceType",
2102 + value: function getInstanceType() {
2103 + elementorModules.ForceMethodImplementation();
2104 + }
2105 + }]);
2106 + return InstanceType;
2107 +}(Symbol.hasInstance);
2108 +exports["default"] = InstanceType;
391 2109
392 -//#endregion
393 -//#region assets/dev/js/modules/imports/args-object.js
394 - init_typeof();
395 - function _callSuper$35(t, o, e) {
396 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$36() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
397 - }
398 - __name(_callSuper$35, "_callSuper");
399 - function _isNativeReflectConstruct$36() {
400 - try {
401 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
402 - } catch (t) {}
403 - return (_isNativeReflectConstruct$36 = function _isNativeReflectConstruct() {
404 - return !!t;
405 - })();
406 - }
407 - __name(_isNativeReflectConstruct$36, "_isNativeReflectConstruct");
408 - var ArgsObject = /*#__PURE__*/ function(_InstanceType) {
409 - /**
410 - * Function constructor().
411 - *
412 - * Create ArgsObject.
413 - *
414 - * @param {{}} args
415 - */
416 - function ArgsObject(args) {
417 - var _this;
418 - _classCallCheck(this, ArgsObject);
419 - _this = _callSuper$35(this, ArgsObject);
420 - _this.args = args;
421 - return _this;
422 - }
423 - /**
424 - * Function requireArgument().
425 - *
426 - * Validate property in args.
427 - *
428 - * @param {string} property
429 - * @param {{}} args
430 - *
431 - * @throws {Error}
432 - */
433 - _inherits(ArgsObject, _InstanceType);
434 - return _createClass(ArgsObject, [
435 - {
436 - key: "requireArgument",
437 - value: function requireArgument(property) {
438 - var args = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this.args;
439 - if (!Object.prototype.hasOwnProperty.call(args, property)) throw Error("".concat(property, " is required."));
440 - }
441 - },
442 - {
443 - key: "requireArgumentType",
444 - value: function requireArgumentType(property, type) {
445 - var args = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : this.args;
446 - this.requireArgument(property, args);
447 - if (_typeof(args[property]) !== type) throw Error("".concat(property, " invalid type: ").concat(type, "."));
448 - }
449 - },
450 - {
451 - key: "requireArgumentInstance",
452 - value: function requireArgumentInstance(property, instance) {
453 - var args = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : this.args;
454 - this.requireArgument(property, args);
455 - if (!(args[property] instanceof instance) && !is_instanceof_default(args[property], instance)) throw Error("".concat(property, " invalid instance."));
456 - }
457 - },
458 - {
459 - key: "requireArgumentConstructor",
460 - value: function requireArgumentConstructor(property, type) {
461 - var args = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : this.args;
462 - this.requireArgument(property, args);
463 - if (args[property].constructor.toString() !== type.prototype.constructor.toString()) throw Error("".concat(property, " invalid constructor type."));
464 - }
465 - }
466 - ], [{
467 - key: "getInstanceType",
468 - value: function getInstanceType() {
469 - return "ArgsObject";
470 - }
471 - }]);
472 - }(InstanceType);
2110 +/***/ }),
473 2111
474 -//#endregion
475 -//#region modules/web-cli/assets/js/utils/console.js
476 - var Console = /*#__PURE__*/ function() {
477 - function Console() {
478 - _classCallCheck(this, Console);
479 - }
480 - return _createClass(Console, null, [{
481 - key: "error",
482 - value: function error(message) {
483 - if ($e.devTools) $e.devTools.log.error(message);
484 - if (!(message instanceof $e.modules.HookBreak)) console.error(message);
485 - }
486 - }, {
487 - key: "warn",
488 - value: function warn() {
489 - var _console;
490 - var style = "font-size: 12px; background-image: url(\"".concat(elementorWebCliConfig.urls.assets, "images/logo-icon.png\"); background-repeat: no-repeat; background-size: contain;");
491 - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];
492 - args.unshift("%c %c", style, "");
493 - (_console = console).warn.apply(_console, args);
494 - }
495 - }]);
496 - }();
2112 +/***/ "../assets/dev/js/modules/imports/module.js":
2113 +/*!**************************************************!*\
2114 + !*** ../assets/dev/js/modules/imports/module.js ***!
2115 + \**************************************************/
2116 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
497 2117
498 -//#endregion
499 -//#region modules/web-cli/assets/js/utils/deprecation.js
2118 +"use strict";
2119 +
2120 +
2121 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
2122 +var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js"));
2123 +var Module = function Module() {
2124 + var $ = jQuery,
2125 + instanceParams = arguments,
2126 + self = this,
2127 + events = {};
2128 + var settings;
2129 + var ensureClosureMethods = function ensureClosureMethods() {
2130 + $.each(self, function (methodName) {
2131 + var oldMethod = self[methodName];
2132 + if ('function' !== typeof oldMethod) {
2133 + return;
2134 + }
2135 + self[methodName] = function () {
2136 + return oldMethod.apply(self, arguments);
2137 + };
2138 + });
2139 + };
2140 + var initSettings = function initSettings() {
2141 + settings = self.getDefaultSettings();
2142 + var instanceSettings = instanceParams[0];
2143 + if (instanceSettings) {
2144 + $.extend(true, settings, instanceSettings);
2145 + }
2146 + };
2147 + var init = function init() {
2148 + self.__construct.apply(self, instanceParams);
2149 + ensureClosureMethods();
2150 + initSettings();
2151 + self.trigger('init');
2152 + };
2153 + this.getItems = function (items, itemKey) {
2154 + if (itemKey) {
2155 + var keyStack = itemKey.split('.'),
2156 + currentKey = keyStack.splice(0, 1);
2157 + if (!keyStack.length) {
2158 + return items[currentKey];
2159 + }
2160 + if (!items[currentKey]) {
2161 + return;
2162 + }
2163 + return this.getItems(items[currentKey], keyStack.join('.'));
2164 + }
2165 + return items;
2166 + };
2167 + this.getSettings = function (setting) {
2168 + return this.getItems(settings, setting);
2169 + };
2170 + this.setSettings = function (settingKey, value, settingsContainer) {
2171 + if (!settingsContainer) {
2172 + settingsContainer = settings;
2173 + }
2174 + if ('object' === (0, _typeof2.default)(settingKey)) {
2175 + $.extend(settingsContainer, settingKey);
2176 + return self;
2177 + }
2178 + var keyStack = settingKey.split('.'),
2179 + currentKey = keyStack.splice(0, 1);
2180 + if (!keyStack.length) {
2181 + settingsContainer[currentKey] = value;
2182 + return self;
2183 + }
2184 + if (!settingsContainer[currentKey]) {
2185 + settingsContainer[currentKey] = {};
2186 + }
2187 + return self.setSettings(keyStack.join('.'), value, settingsContainer[currentKey]);
2188 + };
2189 + this.getErrorMessage = function (type, functionName) {
2190 + var message;
2191 + switch (type) {
2192 + case 'forceMethodImplementation':
2193 + message = "The method '".concat(functionName, "' must to be implemented in the inheritor child.");
2194 + break;
2195 + default:
2196 + message = 'An error occurs';
2197 + }
2198 + return message;
2199 + };
2200 +
2201 + // TODO: This function should be deleted ?.
2202 + this.forceMethodImplementation = function (functionName) {
2203 + throw new Error(this.getErrorMessage('forceMethodImplementation', functionName));
2204 + };
2205 + this.on = function (eventName, callback) {
2206 + if ('object' === (0, _typeof2.default)(eventName)) {
2207 + $.each(eventName, function (singleEventName) {
2208 + self.on(singleEventName, this);
2209 + });
2210 + return self;
2211 + }
2212 + var eventNames = eventName.split(' ');
2213 + eventNames.forEach(function (singleEventName) {
2214 + if (!events[singleEventName]) {
2215 + events[singleEventName] = [];
2216 + }
2217 + events[singleEventName].push(callback);
2218 + });
2219 + return self;
2220 + };
2221 + this.off = function (eventName, callback) {
2222 + if (!events[eventName]) {
2223 + return self;
2224 + }
2225 + if (!callback) {
2226 + delete events[eventName];
2227 + return self;
2228 + }
2229 + var callbackIndex = events[eventName].indexOf(callback);
2230 + if (-1 !== callbackIndex) {
2231 + delete events[eventName][callbackIndex];
2232 +
2233 + // Reset array index (for next off on same event).
2234 + events[eventName] = events[eventName].filter(function (val) {
2235 + return val;
2236 + });
2237 + }
2238 + return self;
2239 + };
2240 + this.trigger = function (eventName) {
2241 + var methodName = 'on' + eventName[0].toUpperCase() + eventName.slice(1),
2242 + params = Array.prototype.slice.call(arguments, 1);
2243 + if (self[methodName]) {
2244 + self[methodName].apply(self, params);
2245 + }
2246 + var callbacks = events[eventName];
2247 + if (!callbacks) {
2248 + return self;
2249 + }
2250 + $.each(callbacks, function (index, callback) {
2251 + callback.apply(self, params);
2252 + });
2253 + return self;
2254 + };
2255 + init();
2256 +};
2257 +Module.prototype.__construct = function () {};
2258 +Module.prototype.getDefaultSettings = function () {
2259 + return {};
2260 +};
2261 +Module.prototype.getConstructorID = function () {
2262 + return this.constructor.name;
2263 +};
2264 +Module.extend = function (properties) {
2265 + var $ = jQuery,
2266 + parent = this;
2267 + var child = function child() {
2268 + return parent.apply(this, arguments);
2269 + };
2270 + $.extend(child, parent);
2271 + child.prototype = Object.create($.extend({}, parent.prototype, properties));
2272 + child.prototype.constructor = child;
2273 + child.__super__ = parent.prototype;
2274 + return child;
2275 +};
2276 +module.exports = Module;
2277 +
2278 +/***/ }),
2279 +
2280 +/***/ "../modules/web-cli/assets/js/api.js":
2281 +/*!*******************************************!*\
2282 + !*** ../modules/web-cli/assets/js/api.js ***!
2283 + \*******************************************/
2284 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
2285 +
2286 +"use strict";
2287 +
2288 +
2289 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
2290 +var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js");
2291 +Object.defineProperty(exports, "__esModule", ({
2292 + value: true
2293 +}));
2294 +exports["default"] = void 0;
2295 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
2296 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
2297 +var _backwardsCompatibility = _interopRequireDefault(__webpack_require__(/*! ./core/backwards-compatibility */ "../modules/web-cli/assets/js/core/backwards-compatibility.js"));
2298 +var _commandBase = _interopRequireDefault(__webpack_require__(/*! ./modules/command-base */ "../modules/web-cli/assets/js/modules/command-base.js"));
2299 +var _commandInternalBase = _interopRequireDefault(__webpack_require__(/*! ./modules/command-internal-base */ "../modules/web-cli/assets/js/modules/command-internal-base.js"));
2300 +var _commandData = _interopRequireDefault(__webpack_require__(/*! ./modules/command-data */ "../modules/web-cli/assets/js/modules/command-data.js"));
2301 +var _commands = _interopRequireDefault(__webpack_require__(/*! ./core/commands */ "../modules/web-cli/assets/js/core/commands.js"));
2302 +var _commandsInternal = _interopRequireDefault(__webpack_require__(/*! ./core/commands-internal */ "../modules/web-cli/assets/js/core/commands-internal.js"));
2303 +var _componentBase = _interopRequireDefault(__webpack_require__(/*! ./modules/component-base */ "../modules/web-cli/assets/js/modules/component-base.js"));
2304 +var _componentModalBase = _interopRequireDefault(__webpack_require__(/*! ./modules/component-modal-base */ "../modules/web-cli/assets/js/modules/component-modal-base.js"));
2305 +var _components = _interopRequireDefault(__webpack_require__(/*! ./core/components */ "../modules/web-cli/assets/js/core/components.js"));
2306 +var _data = _interopRequireDefault(__webpack_require__(/*! ./core/data.js */ "../modules/web-cli/assets/js/core/data.js"));
2307 +var _hashCommands = _interopRequireDefault(__webpack_require__(/*! ./extras/hash-commands */ "../modules/web-cli/assets/js/extras/hash-commands.js"));
2308 +var _hookBreak = _interopRequireDefault(__webpack_require__(/*! ./modules/hook-break */ "../modules/web-cli/assets/js/modules/hook-break.js"));
2309 +var _hooks = _interopRequireDefault(__webpack_require__(/*! ./core/hooks */ "../modules/web-cli/assets/js/core/hooks.js"));
2310 +var _routes = _interopRequireDefault(__webpack_require__(/*! ./core/routes */ "../modules/web-cli/assets/js/core/routes.js"));
2311 +var _shortcuts = _interopRequireDefault(__webpack_require__(/*! ./core/shortcuts */ "../modules/web-cli/assets/js/core/shortcuts.js"));
2312 +var _store = _interopRequireDefault(__webpack_require__(/*! ./core/store */ "../modules/web-cli/assets/js/core/store.js"));
2313 +var _uiStates = _interopRequireDefault(__webpack_require__(/*! ./core/ui-states */ "../modules/web-cli/assets/js/core/ui-states.js"));
2314 +var hookData = _interopRequireWildcard(__webpack_require__(/*! ./modules/hooks/data/ */ "../modules/web-cli/assets/js/modules/hooks/data/index.js"));
2315 +var hookUI = _interopRequireWildcard(__webpack_require__(/*! ./modules/hooks/ui */ "../modules/web-cli/assets/js/modules/hooks/ui/index.js"));
2316 +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); }
2317 +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; }
2318 +/* Alphabetical order */
2319 +var API = /*#__PURE__*/function () {
2320 + /**
2321 + * Function constructor().
2322 + *
2323 + * Create's 'elementor' api.
2324 + */
2325 + function API() {
2326 + (0, _classCallCheck2.default)(this, API);
2327 + this.components = new _components.default();
2328 + this.commands = new _commands.default();
2329 + this.commandsInternal = new _commandsInternal.default();
2330 + this.hooks = new _hooks.default();
2331 + this.routes = new _routes.default();
2332 + this.shortcuts = new _shortcuts.default(jQuery(window));
2333 + this.data = new _data.default();
2334 + this.store = new _store.default();
2335 + this.uiStates = new _uiStates.default();
2336 + this.modules = {
2337 + CommandBase: _commandBase.default,
2338 + CommandInternalBase: _commandInternalBase.default,
2339 + CommandData: _commandData.default,
2340 + ComponentBase: _componentBase.default,
2341 + ComponentModalBase: _componentModalBase.default,
2342 + HookBreak: _hookBreak.default,
2343 + hookData: hookData,
2344 + hookUI: hookUI
2345 + };
2346 + this.extras = {
2347 + hashCommands: new _hashCommands.default()
2348 + };
2349 +
2350 + // Backwards compatibility should be last, in order to handle others.
2351 + this.bc = new _backwardsCompatibility.default();
2352 + }
2353 +
2354 + /**
2355 + * Function run().
2356 + *
2357 + * Alias of `$e.commands.run()`.
2358 + *
2359 + * @param {string} command
2360 + * @param {*} [args={}]
2361 + *
2362 + * @return {*} result
2363 + */
2364 + (0, _createClass2.default)(API, [{
2365 + key: "run",
2366 + value: function run(command) {
2367 + var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2368 + return $e.commands.run(command, args);
2369 + }
2370 +
2371 + /**
2372 + * Function internal().
2373 + *
2374 + * Alias of `$e.commandsInternal.run()`.
2375 + *
2376 + * @param {string} command
2377 + * @param {*} [args={}]
2378 + *
2379 + * @return {boolean} result
2380 + */
2381 + }, {
2382 + key: "internal",
2383 + value: function internal(command) {
2384 + var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2385 + return $e.commandsInternal.run(command, args);
2386 + }
2387 +
2388 + /**
2389 + * Function route().
2390 + *
2391 + * Alias of `$e.routes.to()`.
2392 + *
2393 + * @param {string} route
2394 + * @param {*} [args={}]
2395 + */
2396 + }, {
2397 + key: "route",
2398 + value: function route(_route) {
2399 + var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2400 + return $e.routes.to(_route, args);
2401 + }
2402 +
2403 + // TODO: shortcut();
2404 + }]);
2405 + return API;
2406 +}();
2407 +exports["default"] = API;
2408 +
2409 +/***/ }),
2410 +
2411 +/***/ "../modules/web-cli/assets/js/core/backwards-compatibility.js":
2412 +/*!********************************************************************!*\
2413 + !*** ../modules/web-cli/assets/js/core/backwards-compatibility.js ***!
2414 + \********************************************************************/
2415 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
2416 +
2417 +"use strict";
2418 +
2419 +
2420 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
2421 +Object.defineProperty(exports, "__esModule", ({
2422 + value: true
2423 +}));
2424 +exports["default"] = void 0;
2425 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
2426 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
2427 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
2428 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
2429 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
2430 +var _componentBase = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/component-base */ "../modules/web-cli/assets/js/modules/component-base.js"));
2431 +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); }; }
2432 +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; } }
2433 +var BackwardsCompatibility = /*#__PURE__*/function () {
2434 + function BackwardsCompatibility() {
2435 + (0, _classCallCheck2.default)(this, BackwardsCompatibility);
2436 + }
2437 + (0, _createClass2.default)(BackwardsCompatibility, [{
2438 + key: "ensureTab",
2439 + value: function ensureTab(namespace, tabSlug) {
2440 + var page = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
2441 + var component = $e.components.get(namespace);
2442 + if (!component) {
2443 + var Component = /*#__PURE__*/function (_ComponentBase) {
2444 + (0, _inherits2.default)(Component, _ComponentBase);
2445 + var _super = _createSuper(Component);
2446 + function Component() {
2447 + (0, _classCallCheck2.default)(this, Component);
2448 + return _super.apply(this, arguments);
2449 + }
2450 + (0, _createClass2.default)(Component, [{
2451 + key: "getNamespace",
2452 + value: function getNamespace() {
2453 + return namespace;
2454 + }
2455 + }, {
2456 + key: "renderTab",
2457 + value: function renderTab(tab) {
2458 + elementor.getPanelView().setPage(page).activateTab(tab);
2459 + }
2460 + }]);
2461 + return Component;
2462 + }(_componentBase.default);
2463 + component = $e.components.register(new Component());
2464 + }
2465 + if (!component.hasTab(tabSlug) && elementor.config.tabs[tabSlug]) {
2466 + component.addTab(tabSlug, {
2467 + title: elementor.config.tabs[tabSlug]
2468 + });
2469 + }
2470 + }
2471 + }]);
2472 + return BackwardsCompatibility;
2473 +}();
2474 +exports["default"] = BackwardsCompatibility;
2475 +
2476 +/***/ }),
2477 +
2478 +/***/ "../modules/web-cli/assets/js/core/backwards-compatibility/commands.js":
2479 +/*!*****************************************************************************!*\
2480 + !*** ../modules/web-cli/assets/js/core/backwards-compatibility/commands.js ***!
2481 + \*****************************************************************************/
2482 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
2483 +
2484 +"use strict";
2485 +
2486 +
2487 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
2488 +Object.defineProperty(exports, "__esModule", ({
2489 + value: true
2490 +}));
2491 +exports["default"] = void 0;
2492 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
2493 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
2494 +var _assertThisInitialized2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ "../node_modules/@babel/runtime/helpers/assertThisInitialized.js"));
2495 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
2496 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
2497 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
2498 +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
2499 +var _module = _interopRequireDefault(__webpack_require__(/*! elementor-assets-js/modules/imports/module.js */ "../assets/dev/js/modules/imports/module.js"));
2500 +var _deprecation = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/deprecation */ "../modules/web-cli/assets/js/utils/deprecation.js"));
2501 +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); }; }
2502 +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; } }
2503 +var CommandsBackwardsCompatibility = /*#__PURE__*/function (_Module) {
2504 + (0, _inherits2.default)(CommandsBackwardsCompatibility, _Module);
2505 + var _super = _createSuper(CommandsBackwardsCompatibility);
2506 + function CommandsBackwardsCompatibility() {
2507 + var _this;
2508 + (0, _classCallCheck2.default)(this, CommandsBackwardsCompatibility);
2509 + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
2510 + args[_key] = arguments[_key];
2511 + }
2512 + _this = _super.call.apply(_super, [this].concat(args));
2513 + (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "on", function (eventName, callback) {
2514 + if ('run' === eventName) {
2515 + var componentName = _this.getConstructorID();
2516 +
2517 + // Regex takes the first letter and convert it to lower case.
2518 + componentName = componentName.replace(/^./, function (val) {
2519 + return val.toLowerCase();
2520 + });
2521 + _deprecation.default.deprecated("$e.".concat(componentName, ".on( 'run', ... )"), '3.0.0', "$e.".concat(componentName, ".on( 'run:before', ... )"));
2522 + _this.onOrig('run:before', callback);
2523 + return;
2524 + }
2525 + _this.onOrig(eventName, callback);
2526 + });
2527 + return _this;
2528 + }
2529 + (0, _createClass2.default)(CommandsBackwardsCompatibility, [{
2530 + key: "__construct",
2531 + value: function __construct() {
2532 + this.onOrig = this.on;
2533 + }
2534 + }]);
2535 + return CommandsBackwardsCompatibility;
2536 +}(_module.default);
2537 +exports["default"] = CommandsBackwardsCompatibility;
2538 +
2539 +/***/ }),
2540 +
2541 +/***/ "../modules/web-cli/assets/js/core/commands-internal.js":
2542 +/*!**************************************************************!*\
2543 + !*** ../modules/web-cli/assets/js/core/commands-internal.js ***!
2544 + \**************************************************************/
2545 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
2546 +
2547 +"use strict";
2548 +
2549 +
2550 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
2551 +Object.defineProperty(exports, "__esModule", ({
2552 + value: true
2553 +}));
2554 +exports["default"] = void 0;
2555 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
2556 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
2557 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
2558 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
2559 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
2560 +var _commands = _interopRequireDefault(__webpack_require__(/*! ./commands.js */ "../modules/web-cli/assets/js/core/commands.js"));
2561 +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); }; }
2562 +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; } }
2563 +var CommandsInternal = /*#__PURE__*/function (_Commands) {
2564 + (0, _inherits2.default)(CommandsInternal, _Commands);
2565 + var _super = _createSuper(CommandsInternal);
2566 + function CommandsInternal() {
2567 + (0, _classCallCheck2.default)(this, CommandsInternal);
2568 + return _super.apply(this, arguments);
2569 + }
2570 + (0, _createClass2.default)(CommandsInternal, [{
2571 + key: "error",
2572 + value: function error(message) {
2573 + throw Error('Commands internal: ' + message);
2574 + }
2575 + }]);
2576 + return CommandsInternal;
2577 +}(_commands.default);
2578 +exports["default"] = CommandsInternal;
2579 +
2580 +/***/ }),
2581 +
2582 +/***/ "../modules/web-cli/assets/js/core/commands.js":
2583 +/*!*****************************************************!*\
2584 + !*** ../modules/web-cli/assets/js/core/commands.js ***!
2585 + \*****************************************************/
2586 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
2587 +
2588 +"use strict";
2589 +
2590 +
2591 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
2592 +Object.defineProperty(exports, "__esModule", ({
2593 + value: true
2594 +}));
2595 +exports["default"] = void 0;
2596 +var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ "../node_modules/@babel/runtime/regenerator/index.js"));
2597 +var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "../node_modules/@babel/runtime/helpers/asyncToGenerator.js"));
2598 +var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js"));
2599 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
2600 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
2601 +var _assertThisInitialized2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ "../node_modules/@babel/runtime/helpers/assertThisInitialized.js"));
2602 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
2603 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
2604 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
2605 +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
2606 +var _commands = _interopRequireDefault(__webpack_require__(/*! ./backwards-compatibility/commands */ "../modules/web-cli/assets/js/core/backwards-compatibility/commands.js"));
2607 +var _commandBase = _interopRequireDefault(__webpack_require__(/*! ../modules/command-base */ "../modules/web-cli/assets/js/modules/command-base.js"));
2608 +var _console = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/console */ "../modules/web-cli/assets/js/utils/console.js"));
2609 +var _deprecation = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/deprecation */ "../modules/web-cli/assets/js/utils/deprecation.js"));
2610 +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; }
2611 +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; }
2612 +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); }; }
2613 +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; } }
500 2614 /**
501 - * @typedef {Object} Version
502 - * @property {number} major1 The first number
503 - * @property {number} major2 The second number
504 - * @property {number} minor The third number
505 - * @property {string} build The fourth number
506 - */
507 - var softDeprecated = function softDeprecated(name, version, replacement) {
508 - if (elementorWebCliConfig.isDebug) deprecatedMessage("soft", name, version, replacement);
509 - };
510 - var hardDeprecated = function hardDeprecated(name, version, replacement) {
511 - deprecatedMessage("hard", name, version, replacement);
512 - };
513 - var deprecatedMessage = function deprecatedMessage(type, name, version, replacement) {
514 - var message = "`".concat(name, "` is ").concat(type, " deprecated since ").concat(version);
515 - if (replacement) message += " - Use `".concat(replacement, "` instead");
516 - Console.warn(message);
517 - };
518 - var Deprecation = /*#__PURE__*/ function() {
519 - function Deprecation() {
520 - _classCallCheck(this, Deprecation);
521 - }
522 - return _createClass(Deprecation, null, [
523 - {
524 - key: "deprecated",
525 - value: function deprecated(name, version, replacement) {
526 - if (this.isHardDeprecated(version)) hardDeprecated(name, version, replacement);
527 - else softDeprecated(name, version, replacement);
528 - }
529 - },
530 - {
531 - key: "parseVersion",
532 - value: function parseVersion(version) {
533 - var versionParts = version.split(".");
534 - if (versionParts.length < 3 || versionParts.length > 4) throw new RangeError("Invalid Semantic Version string provided");
535 - var _versionParts = _slicedToArray(versionParts, 4);
536 - var major1 = _versionParts[0];
537 - var major2 = _versionParts[1];
538 - var minor = _versionParts[2];
539 - var _versionParts$ = _versionParts[3];
540 - return {
541 - major1: parseInt(major1),
542 - major2: parseInt(major2),
543 - minor: parseInt(minor),
544 - build: _versionParts$ === void 0 ? "" : _versionParts$
545 - };
546 - }
547 - },
548 - {
549 - key: "getTotalMajor",
550 - value: function getTotalMajor(versionObj) {
551 - var total = parseInt("".concat(versionObj.major1).concat(versionObj.major2, "0"));
552 - total = Number((total / 10).toFixed(0));
553 - if (versionObj.major2 > 9) total = versionObj.major2 - 9;
554 - return total;
555 - }
556 - },
557 - {
558 - key: "compareVersion",
559 - value: function compareVersion(version1, version2) {
560 - var _this = this;
561 - return [this.parseVersion(version1), this.parseVersion(version2)].map(function(versionObj) {
562 - return _this.getTotalMajor(versionObj);
563 - }).reduce(function(acc, major) {
564 - return acc - major;
565 - });
566 - }
567 - },
568 - {
569 - key: "isSoftDeprecated",
570 - value: function isSoftDeprecated(version) {
571 - return this.compareVersion(version, elementorWebCliConfig.version) <= 4;
572 - }
573 - },
574 - {
575 - key: "isHardDeprecated",
576 - value: function isHardDeprecated(version) {
577 - var total = this.compareVersion(version, elementorWebCliConfig.version);
578 - return total < 0 || total >= 8;
579 - }
580 - }
581 - ]);
582 - }();
2615 + * @typedef {import('../modules/component-base')} ComponentBase
2616 + */
2617 +/**
2618 + * @typedef {import('../modules/command-base')} CommandBase
2619 + */
2620 +/**
2621 + * @typedef {{}} Component
2622 + */
2623 +var Commands = /*#__PURE__*/function (_CommandsBackwardsCom) {
2624 + (0, _inherits2.default)(Commands, _CommandsBackwardsCom);
2625 + var _super = _createSuper(Commands);
2626 + /**
2627 + * Function constructor().
2628 + *
2629 + * Create `$e.commands` API.
2630 + *
2631 + * @param {{}} args
2632 + */
2633 + function Commands() {
2634 + var _this;
2635 + (0, _classCallCheck2.default)(this, Commands);
2636 + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
2637 + args[_key] = arguments[_key];
2638 + }
2639 + _this = _super.call.apply(_super, [this].concat(args));
2640 + _this.current = {};
2641 + _this.currentArgs = {};
2642 + _this.currentTrace = [];
2643 + _this.commands = {};
2644 + _this.components = {};
2645 + Object.defineProperty((0, _assertThisInitialized2.default)(_this), 'classes', {
2646 + get: function get() {
2647 + _deprecation.default.deprecated('$e.commands.classes', '3.7.0', '$e.commands.getCommandClass(), $e.commandsInternal.getCommandClass(), $e.data.getCommandClass(), $e.routes.getCommandClass() according to the requested command infra-structure,');
2648 + return _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, $e.commands.commands), $e.commandsInternal.commands), $e.data.commands), $e.routes.commands);
2649 + }
2650 + });
2651 + return _this;
2652 + }
583 2653
584 -//#endregion
585 -//#region modules/web-cli/assets/js/modules/command-infra.js
586 - function _callSuper$34(t, o, e) {
587 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$35() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
588 - }
589 - __name(_callSuper$34, "_callSuper");
590 - function _isNativeReflectConstruct$35() {
591 - try {
592 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
593 - } catch (t) {}
594 - return (_isNativeReflectConstruct$35 = function _isNativeReflectConstruct() {
595 - return !!t;
596 - })();
597 - }
598 - __name(_isNativeReflectConstruct$35, "_isNativeReflectConstruct");
599 - /**
600 - * @typedef {import('../modules/component-base')} ComponentBase
601 - */
602 - var CommandInfra = /*#__PURE__*/ function(_ArgsObject) {
603 - /**
604 - * Function constructor().
605 - *
606 - * Create Commands Base.
607 - *
608 - * @param {{}} args
609 - */
610 - function CommandInfra() {
611 - var _this;
612 - var args = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
613 - _classCallCheck(this, CommandInfra);
614 - _this = _callSuper$34(this, CommandInfra, [args]);
615 - if (!_this.constructor.registerConfig) throw RangeError("Doing it wrong: Each command type should have `registerConfig`.");
616 - _this.command = _this.constructor.getCommand();
617 - _this.component = _this.constructor.getComponent();
618 - _this.initialize(args);
619 - args = _this.args;
620 - _this.validateArgs(args);
621 - return _this;
622 - }
623 - /**
624 - * Function initialize().
625 - *
626 - * Initialize command, called after construction.
627 - *
628 - * @param {{}} args
629 - */
630 - _inherits(CommandInfra, _ArgsObject);
631 - return _createClass(CommandInfra, [
632 - {
633 - key: "currentCommand",
634 - get: function get() {
635 - Deprecation.deprecated("this.currentCommand", "3.7.0", "this.command");
636 - return this.command;
637 - }
638 - },
639 - {
640 - key: "initialize",
641 - value: function initialize() {
642 - arguments.length > 0 && arguments[0] !== void 0 && arguments[0];
643 - }
644 - },
645 - {
646 - key: "validateArgs",
647 - value: function validateArgs() {
648 - arguments.length > 0 && arguments[0] !== void 0 && arguments[0];
649 - }
650 - },
651 - {
652 - key: "apply",
653 - value: function apply() {
654 - arguments.length > 0 && arguments[0] !== void 0 && arguments[0];
655 - elementorModules.ForceMethodImplementation();
656 - }
657 - },
658 - {
659 - key: "run",
660 - value: function run() {
661 - return this.apply(this.args);
662 - }
663 - },
664 - {
665 - key: "onBeforeRun",
666 - value: function onBeforeRun() {
667 - arguments.length > 0 && arguments[0] !== void 0 && arguments[0];
668 - }
669 - },
670 - {
671 - key: "onAfterRun",
672 - value: function onAfterRun() {
673 - arguments.length > 0 && arguments[0] !== void 0 && arguments[0];
674 - arguments.length > 1 && arguments[1];
675 - }
676 - },
677 - {
678 - key: "onBeforeApply",
679 - value: function onBeforeApply() {
680 - arguments.length > 0 && arguments[0] !== void 0 && arguments[0];
681 - }
682 - },
683 - {
684 - key: "onAfterApply",
685 - value: function onAfterApply() {
686 - arguments.length > 0 && arguments[0] !== void 0 && arguments[0];
687 - arguments.length > 1 && arguments[1];
688 - }
689 - },
690 - {
691 - key: "onCatchApply",
692 - value: function onCatchApply(e) {}
693 - }
694 - ], [
695 - {
696 - key: "getInstanceType",
697 - value: function getInstanceType() {
698 - return "CommandInfra";
699 - }
700 - },
701 - {
702 - key: "getInfo",
703 - value: function getInfo() {
704 - return {};
705 - }
706 - },
707 - {
708 - key: "getCommand",
709 - value: function getCommand() {
710 - return this.registerConfig.command;
711 - }
712 - },
713 - {
714 - key: "getComponent",
715 - value: function getComponent() {
716 - return this.registerConfig.component;
717 - }
718 - },
719 - {
720 - key: "setRegisterConfig",
721 - value: function setRegisterConfig(config) {
722 - this.registerConfig = Object.freeze(config);
723 - }
724 - }
725 - ]);
726 - }(ArgsObject);
727 - /**
728 - * @type {Object}
729 - */
730 - _defineProperty(CommandInfra, "registerConfig", null);
2654 + /**
2655 + * @param {string} id
2656 + * @return {CommandBase} command class
2657 + */
2658 + (0, _createClass2.default)(Commands, [{
2659 + key: "getCommandClass",
2660 + value: function getCommandClass(id) {
2661 + return this.commands[id];
2662 + }
731 2663
732 -//#endregion
733 -//#region modules/web-cli/assets/js/modules/command-base.js
734 - function _callSuper$33(t, o, e) {
735 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$34() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
736 - }
737 - __name(_callSuper$33, "_callSuper");
738 - function _isNativeReflectConstruct$34() {
739 - try {
740 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
741 - } catch (t) {}
742 - return (_isNativeReflectConstruct$34 = function _isNativeReflectConstruct() {
743 - return !!t;
744 - })();
745 - }
746 - __name(_isNativeReflectConstruct$34, "_isNativeReflectConstruct");
747 - /**
748 - * @name $e.modules.CommandBase
749 - */
750 - var CommandBase = /*#__PURE__*/ function(_CommandInfra) {
751 - function CommandBase() {
752 - _classCallCheck(this, CommandBase);
753 - return _callSuper$33(this, CommandBase, arguments);
754 - }
755 - _inherits(CommandBase, _CommandInfra);
756 - return _createClass(CommandBase, [
757 - {
758 - key: "onBeforeRun",
759 - value: function onBeforeRun() {
760 - var args = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
761 - $e.hooks.runUIBefore(this.command, args);
762 - }
763 - },
764 - {
765 - key: "onAfterRun",
766 - value: function onAfterRun() {
767 - var args = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
768 - var result = arguments.length > 1 ? arguments[1] : void 0;
769 - $e.hooks.runUIAfter(this.command, args, result);
770 - }
771 - },
772 - {
773 - key: "onBeforeApply",
774 - value: function onBeforeApply() {
775 - var args = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
776 - $e.hooks.runDataDependency(this.command, args);
777 - }
778 - },
779 - {
780 - key: "onAfterApply",
781 - value: function onAfterApply() {
782 - var args = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
783 - var result = arguments.length > 1 ? arguments[1] : void 0;
784 - return $e.hooks.runDataAfter(this.command, args, result);
785 - }
786 - },
787 - {
788 - key: "onCatchApply",
789 - value: function onCatchApply(e) {
790 - this.runCatchHooks(e);
791 - }
792 - },
793 - {
794 - key: "runCatchHooks",
795 - value: function runCatchHooks(e) {
796 - $e.hooks.runDataCatch(this.command, this.args, e);
797 - $e.hooks.runUICatch(this.command, this.args, e);
798 - }
799 - },
800 - {
801 - key: "requireContainer",
802 - value: function requireContainer() {
803 - var _this = this;
804 - var args = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.args;
805 - Deprecation.deprecated("requireContainer()", "3.7.0", "Extend `$e.modules.editor.CommandContainerBase` or `$e.modules.editor.CommandContainerInternalBase`");
806 - if (!args.container && !args.containers) throw Error("container or containers are required.");
807 - if (args.container && args.containers) throw Error("container and containers cannot go together please select one of them.");
808 - (args.containers || [args.container]).forEach(function(container) {
809 - _this.requireArgumentInstance("container", elementorModules.editor.Container, { container });
810 - });
811 - }
812 - }
813 - ], [{
814 - key: "getInstanceType",
815 - value: function getInstanceType() {
816 - return "CommandBase";
817 - }
818 - }]);
819 - }(CommandInfra);
2664 + /**
2665 + * Function getAll().
2666 + *
2667 + * Receive all loaded commands.
2668 + *
2669 + * @return {string[]} commands
2670 + */
2671 + }, {
2672 + key: "getAll",
2673 + value: function getAll() {
2674 + return Object.keys(this.commands).sort();
2675 + }
820 2676
821 -//#endregion
822 -//#region modules/web-cli/assets/js/modules/command-callback-base.js
823 - function _callSuper$32(t, o, e) {
824 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$33() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
825 - }
826 - __name(_callSuper$32, "_callSuper");
827 - function _isNativeReflectConstruct$33() {
828 - try {
829 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
830 - } catch (t) {}
831 - return (_isNativeReflectConstruct$33 = function _isNativeReflectConstruct() {
832 - return !!t;
833 - })();
834 - }
835 - __name(_isNativeReflectConstruct$33, "_isNativeReflectConstruct");
836 - /**
837 - * To support pure callbacks in the API(commands.js), to ensure they have registered with the proper context.
838 - */
839 - var CommandCallbackBase = /*#__PURE__*/ function(_CommandBase) {
840 - function CommandCallbackBase() {
841 - _classCallCheck(this, CommandCallbackBase);
842 - return _callSuper$32(this, CommandCallbackBase, arguments);
843 - }
844 - _inherits(CommandCallbackBase, _CommandBase);
845 - return _createClass(CommandCallbackBase, [{
846 - key: "apply",
847 - value: function apply() {
848 - var args = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
849 - return this.constructor.getCallback()(args);
850 - }
851 - }], [{
852 - key: "getInstanceType",
853 - value: function getInstanceType() {
854 - return "CommandCallbackBase";
855 - }
856 - }, {
857 - key: "getCallback",
858 - value: function getCallback() {
859 - return this.registerConfig.callback;
860 - }
861 - }]);
862 - }(CommandBase);
2677 + /**
2678 + * Function register().
2679 + *
2680 + * Register new command.
2681 + *
2682 + * @param {ComponentBase|string} component
2683 + * @param {string} command
2684 + * @param {Function} callback
2685 + *
2686 + * @return {Commands} commands
2687 + */
2688 + }, {
2689 + key: "register",
2690 + value: function register(component, command, callback) {
2691 + var _this2 = this;
2692 + var namespace;
2693 + if ('string' === typeof component) {
2694 + namespace = component;
2695 + component = $e.components.get(namespace);
2696 + if (!component) {
2697 + this.error("'".concat(namespace, "' component is not exist."));
2698 + }
2699 + } else {
2700 + namespace = component.getNamespace();
2701 + }
2702 + var fullCommand = namespace + (command ? '/' + command : '');
2703 + if (this.commands[fullCommand]) {
2704 + this.error("`".concat(fullCommand, "` is already registered."));
2705 + }
2706 + this.commands[fullCommand] = callback;
2707 + this.components[fullCommand] = namespace;
2708 + var shortcuts = component.getShortcuts(),
2709 + shortcut = shortcuts[command];
2710 + if (shortcut) {
2711 + shortcut.command = fullCommand;
2712 + shortcut.callback = function (event) {
2713 + return _this2.runShortcut(fullCommand, event);
2714 + };
2715 + $e.shortcuts.register(shortcut.keys, shortcut);
2716 + }
2717 + return this;
2718 + }
2719 + }, {
2720 + key: "unregister",
2721 + value: function unregister(component, command) {
2722 + var namespace;
2723 + if ('string' === typeof component) {
2724 + namespace = component;
2725 + component = $e.components.get(namespace);
2726 + if (!component) {
2727 + this.error("'".concat(namespace, "' component is not exist."));
2728 + }
2729 + } else {
2730 + namespace = component.getNamespace();
2731 + }
2732 + var fullCommand = namespace + (command ? '/' + command : '');
2733 + if (!this.commands[fullCommand]) {
2734 + this.error("`".concat(fullCommand, "` not exist."));
2735 + }
2736 + delete this.commands[fullCommand];
2737 + delete this.components[fullCommand];
2738 + var shortcuts = component.getShortcuts(),
2739 + shortcut = shortcuts[command];
2740 + if (shortcut) {
2741 + $e.shortcuts.unregister(shortcut.keys, shortcut);
2742 + }
2743 + return this;
2744 + }
863 2745
864 -//#endregion
865 -//#region assets/dev/js/modules/imports/module.js
866 - var require_module = /* @__PURE__ */ __commonJSMin(((exports, module) => {
867 - init_typeof();
868 - var Module = function Module() {
869 - var $ = jQuery;
870 - var instanceParams = arguments;
871 - var self = this;
872 - var events = {};
873 - var settings;
874 - var ensureClosureMethods = function ensureClosureMethods() {
875 - $.each(self, function(methodName) {
876 - var oldMethod = self[methodName];
877 - if ("function" !== typeof oldMethod) return;
878 - self[methodName] = function() {
879 - return oldMethod.apply(self, arguments);
880 - };
881 - });
882 - };
883 - var initSettings = function initSettings() {
884 - settings = self.getDefaultSettings();
885 - var instanceSettings = instanceParams[0];
886 - if (instanceSettings) $.extend(true, settings, instanceSettings);
887 - };
888 - var init = function init() {
889 - self.__construct.apply(self, instanceParams);
890 - ensureClosureMethods();
891 - initSettings();
892 - self.trigger("init");
893 - };
894 - this.getItems = function(items, itemKey) {
895 - if (itemKey) {
896 - var keyStack = itemKey.split(".");
897 - var currentKey = keyStack.splice(0, 1);
898 - if (!keyStack.length) return items[currentKey];
899 - if (!items[currentKey]) return;
900 - return this.getItems(items[currentKey], keyStack.join("."));
901 - }
902 - return items;
903 - };
904 - this.getSettings = function(setting) {
905 - return this.getItems(settings, setting);
906 - };
907 - this.setSettings = function(settingKey, value, settingsContainer) {
908 - if (!settingsContainer) settingsContainer = settings;
909 - if ("object" === _typeof(settingKey)) {
910 - $.extend(settingsContainer, settingKey);
911 - return self;
912 - }
913 - var keyStack = settingKey.split(".");
914 - var currentKey = keyStack.splice(0, 1);
915 - if (!keyStack.length) {
916 - settingsContainer[currentKey] = value;
917 - return self;
918 - }
919 - if (!settingsContainer[currentKey]) settingsContainer[currentKey] = {};
920 - return self.setSettings(keyStack.join("."), value, settingsContainer[currentKey]);
921 - };
922 - this.getErrorMessage = function(type, functionName) {
923 - var message;
924 - switch (type) {
925 - case "forceMethodImplementation":
926 - message = "The method '".concat(functionName, "' must to be implemented in the inheritor child.");
927 - break;
928 - default: message = "An error occurs";
929 - }
930 - return message;
931 - };
932 - this.forceMethodImplementation = function(functionName) {
933 - throw new Error(this.getErrorMessage("forceMethodImplementation", functionName));
934 - };
935 - this.on = function(eventName, callback) {
936 - if ("object" === _typeof(eventName)) {
937 - $.each(eventName, function(singleEventName) {
938 - self.on(singleEventName, this);
939 - });
940 - return self;
941 - }
942 - eventName.split(" ").forEach(function(singleEventName) {
943 - if (!events[singleEventName]) events[singleEventName] = [];
944 - events[singleEventName].push(callback);
945 - });
946 - return self;
947 - };
948 - this.off = function(eventName, callback) {
949 - if (!events[eventName]) return self;
950 - if (!callback) {
951 - delete events[eventName];
952 - return self;
953 - }
954 - var callbackIndex = events[eventName].indexOf(callback);
955 - if (-1 !== callbackIndex) {
956 - delete events[eventName][callbackIndex];
957 - events[eventName] = events[eventName].filter(function(val) {
958 - return val;
959 - });
960 - }
961 - return self;
962 - };
963 - this.trigger = function(eventName) {
964 - var methodName = "on" + eventName[0].toUpperCase() + eventName.slice(1);
965 - var params = Array.prototype.slice.call(arguments, 1);
966 - if (self[methodName]) self[methodName].apply(self, params);
967 - var callbacks = events[eventName];
968 - if (!callbacks) return self;
969 - $.each(callbacks, function(index, callback) {
970 - callback.apply(self, params);
971 - });
972 - return self;
973 - };
974 - init();
975 - };
976 - Module.prototype.__construct = function() {};
977 - Module.prototype.getDefaultSettings = function() {
978 - return {};
979 - };
980 - Module.prototype.getConstructorID = function() {
981 - return this.constructor.name;
982 - };
983 - Module.extend = function(properties) {
984 - var $ = jQuery;
985 - var parent = this;
986 - var child = function child() {
987 - return parent.apply(this, arguments);
988 - };
989 - $.extend(child, parent);
990 - child.prototype = Object.create($.extend({}, parent.prototype, properties));
991 - child.prototype.constructor = child;
992 - child.__super__ = parent.prototype;
993 - return child;
994 - };
995 - module.exports = Module;
996 - }));
2746 + /**
2747 + * Function getComponent().
2748 + *
2749 + * Receive Component of the command.
2750 + *
2751 + * @param {string} command
2752 + *
2753 + * @return {Component} component
2754 + */
2755 + }, {
2756 + key: "getComponent",
2757 + value: function getComponent(command) {
2758 + var namespace = this.components[command];
2759 + return $e.components.get(namespace);
2760 + }
997 2761
998 -//#endregion
999 -//#region node_modules/@babel/runtime/helpers/esm/isNativeFunction.js
1000 -var import_module = /* @__PURE__ */ __toESM(require_module());
1001 - function _isNativeFunction(t) {
1002 - try {
1003 - return -1 !== Function.toString.call(t).indexOf("[native code]");
1004 - } catch (n) {
1005 - return "function" == typeof t;
1006 - }
1007 - }
2762 + /**
2763 + * Function is().
2764 + *
2765 + * Checks if current running command is the same parameter command.
2766 + *
2767 + * @param {string} command
2768 + *
2769 + * @return {boolean} is this command the same as the one passed in the arguments
2770 + */
2771 + }, {
2772 + key: "is",
2773 + value: function is(command) {
2774 + var component = this.getComponent(command);
2775 + if (!component) {
2776 + return false;
2777 + }
2778 + return command === this.current[component.getServiceName()];
2779 + }
1008 2780
1009 -//#endregion
1010 -//#region node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js
1011 - function _isNativeReflectConstruct$32() {
1012 - try {
1013 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
1014 - } catch (t) {}
1015 - return (_isNativeReflectConstruct$32 = function _isNativeReflectConstruct() {
1016 - return !!t;
1017 - })();
1018 - }
1019 - __name(_isNativeReflectConstruct$32, "_isNativeReflectConstruct");
2781 + /**
2782 + * Function isCurrentFirstTrace().
2783 + *
2784 + * Checks if parameter command is the first command in trace that currently running.
2785 + *
2786 + * @param {string} command
2787 + *
2788 + * @return {boolean} is parameter command the first command in trace that currently running
2789 + */
2790 + }, {
2791 + key: "isCurrentFirstTrace",
2792 + value: function isCurrentFirstTrace(command) {
2793 + return command === this.getCurrentFirstTrace();
2794 + }
1020 2795
1021 -//#endregion
1022 -//#region node_modules/@babel/runtime/helpers/esm/construct.js
1023 - function _construct(t, e, r) {
1024 - if (_isNativeReflectConstruct$32()) return Reflect.construct.apply(null, arguments);
1025 - var o = [null];
1026 - o.push.apply(o, e);
1027 - var p = new (t.bind.apply(t, o))();
1028 - return r && _setPrototypeOf(p, r.prototype), p;
1029 - }
2796 + /**
2797 + * Function getCurrent().
2798 + *
2799 + * Receive currently running components and its commands.
2800 + *
2801 + * @param {string} container
2802 + *
2803 + * @return {{}|boolean|*} currently running components
2804 + */
2805 + }, {
2806 + key: "getCurrent",
2807 + value: function getCurrent() {
2808 + var container = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
2809 + if (container) {
2810 + if (!this.current[container]) {
2811 + return false;
2812 + }
2813 + return this.current[container];
2814 + }
2815 + return this.current;
2816 + }
1030 2817
1031 -//#endregion
1032 -//#region node_modules/@babel/runtime/helpers/esm/wrapNativeSuper.js
1033 - function _wrapNativeSuper(t) {
1034 - var r = "function" == typeof Map ? /* @__PURE__ */ new Map() : void 0;
1035 - return _wrapNativeSuper = function _wrapNativeSuper(t) {
1036 - if (null === t || !_isNativeFunction(t)) return t;
1037 - if ("function" != typeof t) throw new TypeError("Super expression must either be null or a function");
1038 - if (void 0 !== r) {
1039 - if (r.has(t)) return r.get(t);
1040 - r.set(t, Wrapper);
1041 - }
1042 - function Wrapper() {
1043 - return _construct(t, arguments, _getPrototypeOf(this).constructor);
1044 - }
1045 - return Wrapper.prototype = Object.create(t.prototype, { constructor: {
1046 - value: Wrapper,
1047 - enumerable: !1,
1048 - writable: !0,
1049 - configurable: !0
1050 - } }), _setPrototypeOf(Wrapper, t);
1051 - }, _wrapNativeSuper(t);
1052 - }
2818 + /**
2819 + * Function getCurrentArgs().
2820 + *
2821 + * Receive currently running command args.
2822 + *
2823 + * @param {string} container
2824 + *
2825 + * @return {{}|boolean|*} current arguments
2826 + */
2827 + }, {
2828 + key: "getCurrentArgs",
2829 + value: function getCurrentArgs() {
2830 + var container = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
2831 + if (container) {
2832 + if (!this.currentArgs[container]) {
2833 + return false;
2834 + }
2835 + return this.currentArgs[container];
2836 + }
2837 + return this.currentArgs;
2838 + }
1053 2839
1054 -//#endregion
1055 -//#region modules/web-cli/assets/js/utils/force-method-implementation.js
1056 - function _callSuper$31(t, o, e) {
1057 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$31() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
1058 - }
1059 - __name(_callSuper$31, "_callSuper");
1060 - function _isNativeReflectConstruct$31() {
1061 - try {
1062 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
1063 - } catch (t) {}
1064 - return (_isNativeReflectConstruct$31 = function _isNativeReflectConstruct() {
1065 - return !!t;
1066 - })();
1067 - }
1068 - __name(_isNativeReflectConstruct$31, "_isNativeReflectConstruct");
1069 - var ForceMethodImplementation = /*#__PURE__*/ function(_Error) {
1070 - function ForceMethodImplementation() {
1071 - var _this;
1072 - var info = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
1073 - _classCallCheck(this, ForceMethodImplementation);
1074 - _this = _callSuper$31(this, ForceMethodImplementation, ["".concat(info.isStatic ? "static " : "").concat(info.fullName, "() should be implemented, please provide '").concat(info.functionName || info.fullName, "' functionality.")]);
1075 - Error.captureStackTrace(_this, ForceMethodImplementation);
1076 - return _this;
1077 - }
1078 - _inherits(ForceMethodImplementation, _Error);
1079 - return _createClass(ForceMethodImplementation);
1080 - }(/*#__PURE__*/ _wrapNativeSuper(Error));
1081 - var force_method_implementation_default = /* @__PURE__ */ __name((function() {
1082 - var caller = Error().stack.split("\n")[2].trim();
1083 - var callerName = caller.startsWith("at new") ? "constructor" : caller.split(" ")[1];
1084 - var info = {};
1085 - info.functionName = callerName;
1086 - info.fullName = callerName;
1087 - if (info.functionName.includes(".")) {
1088 - var parts = info.functionName.split(".");
1089 - info.className = parts[0];
1090 - info.functionName = parts[1];
1091 - } else info.isStatic = true;
1092 - throw new ForceMethodImplementation(info);
1093 - }), "default");
2840 + /**
2841 + * Function getCurrentFirst().
2842 + *
2843 + * Receive first command that currently running.
2844 + *
2845 + * @return {string} first running command
2846 + */
2847 + }, {
2848 + key: "getCurrentFirst",
2849 + value: function getCurrentFirst() {
2850 + return Object.values(this.current)[0];
2851 + }
1094 2852
1095 -//#endregion
1096 -//#region modules/web-cli/assets/js/modules/component-base.js
1097 - function ownKeys$3(e, r) {
1098 - var t = Object.keys(e);
1099 - if (Object.getOwnPropertySymbols) {
1100 - var o = Object.getOwnPropertySymbols(e);
1101 - r && (o = o.filter(function(r) {
1102 - return Object.getOwnPropertyDescriptor(e, r).enumerable;
1103 - })), t.push.apply(t, o);
1104 - }
1105 - return t;
1106 - }
1107 - __name(ownKeys$3, "ownKeys");
1108 - function _objectSpread$3(e) {
1109 - for (var r = 1; r < arguments.length; r++) {
1110 - var t = null != arguments[r] ? arguments[r] : {};
1111 - r % 2 ? ownKeys$3(Object(t), !0).forEach(function(r) {
1112 - _defineProperty(e, r, t[r]);
1113 - }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function(r) {
1114 - Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
1115 - });
1116 - }
1117 - return e;
1118 - }
1119 - __name(_objectSpread$3, "_objectSpread");
1120 - function _callSuper$30(t, o, e) {
1121 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$30() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
1122 - }
1123 - __name(_callSuper$30, "_callSuper");
1124 - function _isNativeReflectConstruct$30() {
1125 - try {
1126 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
1127 - } catch (t) {}
1128 - return (_isNativeReflectConstruct$30 = function _isNativeReflectConstruct() {
1129 - return !!t;
1130 - })();
1131 - }
1132 - __name(_isNativeReflectConstruct$30, "_isNativeReflectConstruct");
1133 - /**
1134 - * @typedef {import('./command-infra')} CommandInfra
1135 - * @typedef {import('./hook-base')} HookBase
1136 - * @typedef {import('../core/states/ui-state-base')} UiStateBase
1137 - */
1138 - var ComponentBase = /*#__PURE__*/ function(_Module) {
1139 - function ComponentBase() {
1140 - _classCallCheck(this, ComponentBase);
1141 - return _callSuper$30(this, ComponentBase, arguments);
1142 - }
1143 - _inherits(ComponentBase, _Module);
1144 - return _createClass(ComponentBase, [
1145 - {
1146 - key: "__construct",
1147 - value: function __construct() {
1148 - var args = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
1149 - if (args.manager) this.manager = args.manager;
1150 - this.commands = this.defaultCommands();
1151 - this.commandsInternal = this.defaultCommandsInternal();
1152 - this.hooks = this.defaultHooks();
1153 - this.routes = this.defaultRoutes();
1154 - this.tabs = this.defaultTabs();
1155 - this.shortcuts = this.defaultShortcuts();
1156 - this.utils = this.defaultUtils();
1157 - this.data = this.defaultData();
1158 - this.uiStates = this.defaultUiStates();
1159 - this.states = this.defaultStates();
1160 - this.defaultRoute = "";
1161 - this.currentTab = "";
1162 - }
1163 - },
1164 - {
1165 - key: "registerAPI",
1166 - value: function registerAPI() {
1167 - var _this = this;
1168 - Object.entries(this.getTabs()).forEach(function(tab) {
1169 - return _this.registerTabRoute(tab[0]);
1170 - });
1171 - Object.entries(this.getRoutes()).forEach(function(_ref) {
1172 - var _ref2 = _slicedToArray(_ref, 2);
1173 - var route = _ref2[0];
1174 - var callback = _ref2[1];
1175 - return _this.registerRoute(route, callback);
1176 - });
1177 - Object.entries(this.getCommands()).forEach(function(_ref3) {
1178 - var _ref4 = _slicedToArray(_ref3, 2);
1179 - var command = _ref4[0];
1180 - var callback = _ref4[1];
1181 - return _this.registerCommand(command, callback);
1182 - });
1183 - Object.entries(this.getCommandsInternal()).forEach(function(_ref5) {
1184 - var _ref6 = _slicedToArray(_ref5, 2);
1185 - var command = _ref6[0];
1186 - var callback = _ref6[1];
1187 - return _this.registerCommandInternal(command, callback);
1188 - });
1189 - Object.values(this.getHooks()).forEach(function(instance) {
1190 - return _this.registerHook(instance);
1191 - });
1192 - Object.entries(this.getData()).forEach(function(_ref7) {
1193 - var _ref8 = _slicedToArray(_ref7, 2);
1194 - var command = _ref8[0];
1195 - var callback = _ref8[1];
1196 - return _this.registerData(command, callback);
1197 - });
1198 - Object.values(this.getUiStates()).forEach(function(instance) {
1199 - return _this.registerUiState(instance);
1200 - });
1201 - Object.entries(this.getStates()).forEach(function(_ref9) {
1202 - var _ref0 = _slicedToArray(_ref9, 2);
1203 - var id = _ref0[0];
1204 - var state = _ref0[1];
1205 - return _this.registerState(id, state);
1206 - });
1207 - }
1208 - },
1209 - {
1210 - key: "getNamespace",
1211 - value: function getNamespace() {
1212 - force_method_implementation_default();
1213 - }
1214 - },
1215 - {
1216 - key: "getRootContainer",
1217 - value: function getRootContainer() {
1218 - Deprecation.deprecated("getRootContainer()", "3.7.0", "getServiceName()");
1219 - return this.getServiceName();
1220 - }
1221 - },
1222 - {
1223 - key: "getServiceName",
1224 - value: function getServiceName() {
1225 - return this.getNamespace().split("/")[0];
1226 - }
1227 - },
1228 - {
1229 - key: "store",
1230 - get: function get() {
1231 - return $e.store.get(this.getNamespace());
1232 - }
1233 - },
1234 - {
1235 - key: "defaultTabs",
1236 - value: function defaultTabs() {
1237 - return {};
1238 - }
1239 - },
1240 - {
1241 - key: "defaultRoutes",
1242 - value: function defaultRoutes() {
1243 - return {};
1244 - }
1245 - },
1246 - {
1247 - key: "defaultCommands",
1248 - value: function defaultCommands() {
1249 - return {};
1250 - }
1251 - },
1252 - {
1253 - key: "defaultCommandsInternal",
1254 - value: function defaultCommandsInternal() {
1255 - return {};
1256 - }
1257 - },
1258 - {
1259 - key: "defaultHooks",
1260 - value: function defaultHooks() {
1261 - return {};
1262 - }
1263 - },
1264 - {
1265 - key: "defaultUiStates",
1266 - value: function defaultUiStates() {
1267 - return {};
1268 - }
1269 - },
1270 - {
1271 - key: "defaultStates",
1272 - value: function defaultStates() {
1273 - return {};
1274 - }
1275 - },
1276 - {
1277 - key: "defaultShortcuts",
1278 - value: function defaultShortcuts() {
1279 - return {};
1280 - }
1281 - },
1282 - {
1283 - key: "defaultUtils",
1284 - value: function defaultUtils() {
1285 - return {};
1286 - }
1287 - },
1288 - {
1289 - key: "defaultData",
1290 - value: function defaultData() {
1291 - return {};
1292 - }
1293 - },
1294 - {
1295 - key: "getCommands",
1296 - value: function getCommands() {
1297 - return this.commands;
1298 - }
1299 - },
1300 - {
1301 - key: "getCommandsInternal",
1302 - value: function getCommandsInternal() {
1303 - return this.commandsInternal;
1304 - }
1305 - },
1306 - {
1307 - key: "getHooks",
1308 - value: function getHooks() {
1309 - return this.hooks;
1310 - }
1311 - },
1312 - {
1313 - key: "getUiStates",
1314 - value: function getUiStates() {
1315 - return this.uiStates;
1316 - }
1317 - },
1318 - {
1319 - key: "getStates",
1320 - value: function getStates() {
1321 - return this.states;
1322 - }
1323 - },
1324 - {
1325 - key: "getRoutes",
1326 - value: function getRoutes() {
1327 - return this.routes;
1328 - }
1329 - },
1330 - {
1331 - key: "getTabs",
1332 - value: function getTabs() {
1333 - return this.tabs;
1334 - }
1335 - },
1336 - {
1337 - key: "getShortcuts",
1338 - value: function getShortcuts() {
1339 - return this.shortcuts;
1340 - }
1341 - },
1342 - {
1343 - key: "getData",
1344 - value: function getData() {
1345 - return this.data;
1346 - }
1347 - },
1348 - {
1349 - key: "registerCommand",
1350 - value: function registerCommand(command, context) {
1351 - var commandsType = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "default";
1352 - var commandsManager;
1353 - switch (commandsType) {
1354 - case "default":
1355 - commandsManager = $e.commands;
1356 - break;
1357 - case "internal":
1358 - commandsManager = $e.commandsInternal;
1359 - break;
1360 - case "data":
1361 - commandsManager = $e.data;
1362 - break;
1363 - default: throw new Error("Invalid commands type: '".concat(command, "'"));
1364 - }
1365 - var fullCommand = this.getNamespace() + "/" + command;
1366 - var instanceType = context.getInstanceType ? context.getInstanceType() : false;
1367 - var registerConfig = {
1368 - command: fullCommand,
1369 - component: this
1370 - };
1371 - if (!instanceType) {
1372 - if ($e.devTools) $e.devTools.log.warn("Attach command-callback-base, on command: '".concat(fullCommand, "', context is unknown type."));
1373 - registerConfig.callback = context;
1374 - context = /*#__PURE__*/ function(_CommandCallbackBase) {
1375 - function context() {
1376 - _classCallCheck(this, context);
1377 - return _callSuper$30(this, context, arguments);
1378 - }
1379 - _inherits(context, _CommandCallbackBase);
1380 - return _createClass(context);
1381 - }(CommandCallbackBase);
1382 - }
1383 - context.setRegisterConfig(registerConfig);
1384 - commandsManager.register(this, command, context);
1385 - }
1386 - },
1387 - {
1388 - key: "registerHook",
1389 - value: function registerHook(instance) {
1390 - return instance.register();
1391 - }
1392 - },
1393 - {
1394 - key: "registerCommandInternal",
1395 - value: function registerCommandInternal(command, context) {
1396 - this.registerCommand(command, context, "internal");
1397 - }
1398 - },
1399 - {
1400 - key: "registerUiState",
1401 - value: function registerUiState(instance) {
1402 - $e.uiStates.register(instance);
1403 - }
1404 - },
1405 - {
1406 - key: "registerState",
1407 - value: function registerState(id, stateConfig) {
1408 - id = this.getNamespace() + (id ? "/".concat(id) : "");
1409 - var slice = (0, _reduxjs_toolkit.createSlice)(_objectSpread$3(_objectSpread$3({}, stateConfig), {}, { name: id }));
1410 - $e.store.register(id, slice);
1411 - }
1412 - },
1413 - {
1414 - key: "registerRoute",
1415 - value: function registerRoute(route, callback) {
1416 - $e.routes.register(this, route, callback);
1417 - }
1418 - },
1419 - {
1420 - key: "registerData",
1421 - value: function registerData(command, context) {
1422 - this.registerCommand(command, context, "data");
1423 - }
1424 - },
1425 - {
1426 - key: "unregisterRoute",
1427 - value: function unregisterRoute(route) {
1428 - $e.routes.unregister(this, route);
1429 - }
1430 - },
1431 - {
1432 - key: "registerTabRoute",
1433 - value: function registerTabRoute(tab) {
1434 - var _this2 = this;
1435 - this.registerRoute(tab, function(args) {
1436 - return _this2.activateTab(tab, args);
1437 - });
1438 - }
1439 - },
1440 - {
1441 - key: "dependency",
1442 - value: function dependency() {
1443 - return true;
1444 - }
1445 - },
1446 - {
1447 - key: "open",
1448 - value: function open() {
1449 - return true;
1450 - }
1451 - },
1452 - {
1453 - key: "close",
1454 - value: function close() {
1455 - if (!this.isOpen) return false;
1456 - this.isOpen = false;
1457 - this.inactivate();
1458 - $e.routes.clearCurrent(this.getNamespace());
1459 - $e.routes.clearHistory(this.getServiceName());
1460 - return true;
1461 - }
1462 - },
1463 - {
1464 - key: "activate",
1465 - value: function activate() {
1466 - $e.components.activate(this.getNamespace());
1467 - }
1468 - },
1469 - {
1470 - key: "inactivate",
1471 - value: function inactivate() {
1472 - $e.components.inactivate(this.getNamespace());
1473 - }
1474 - },
1475 - {
1476 - key: "isActive",
1477 - value: function isActive() {
1478 - return $e.components.isActive(this.getNamespace());
1479 - }
1480 - },
1481 - {
1482 - key: "onRoute",
1483 - value: function onRoute(route) {
1484 - this.toggleRouteClass(route, true);
1485 - this.toggleHistoryClass();
1486 - this.activate();
1487 - this.trigger("route/open", route);
1488 - }
1489 - },
1490 - {
1491 - key: "onCloseRoute",
1492 - value: function onCloseRoute(route) {
1493 - this.toggleRouteClass(route, false);
1494 - this.inactivate();
1495 - this.trigger("route/close", route);
1496 - }
1497 - },
1498 - {
1499 - key: "setDefaultRoute",
1500 - value: function setDefaultRoute(route) {
1501 - this.defaultRoute = this.getNamespace() + "/" + route;
1502 - }
1503 - },
1504 - {
1505 - key: "getDefaultRoute",
1506 - value: function getDefaultRoute() {
1507 - return this.defaultRoute;
1508 - }
1509 - },
1510 - {
1511 - key: "removeTab",
1512 - value: function removeTab(tab) {
1513 - delete this.tabs[tab];
1514 - this.unregisterRoute(tab);
1515 - }
1516 - },
1517 - {
1518 - key: "hasTab",
1519 - value: function hasTab(tab) {
1520 - return !!this.tabs[tab];
1521 - }
1522 - },
1523 - {
1524 - key: "addTab",
1525 - value: function addTab(tab, args, position) {
1526 - var _this3 = this;
1527 - this.tabs[tab] = args;
1528 - if ("undefined" !== typeof position) {
1529 - var newTabs = {};
1530 - var ids = Object.keys(this.tabs);
1531 - ids.pop();
1532 - ids.splice(position, 0, tab);
1533 - ids.forEach(function(id) {
1534 - newTabs[id] = _this3.tabs[id];
1535 - });
1536 - this.tabs = newTabs;
1537 - }
1538 - this.registerTabRoute(tab);
1539 - }
1540 - },
1541 - {
1542 - key: "getTabsWrapperSelector",
1543 - value: function getTabsWrapperSelector() {
1544 - return "";
1545 - }
1546 - },
1547 - {
1548 - key: "getTabRoute",
1549 - value: function getTabRoute(tab) {
1550 - return this.getNamespace() + "/" + tab;
1551 - }
1552 - },
1553 - {
1554 - key: "renderTab",
1555 - value: function renderTab(tab) {}
1556 - },
1557 - {
1558 - key: "activateTab",
1559 - value: function activateTab(tab, args) {
1560 - var _this4 = this;
1561 - this.renderTab(tab, args);
1562 - jQuery(this.getTabsWrapperSelector() + " .elementor-component-tab").off("click").on("click", function(event) {
1563 - $e.route(_this4.getTabRoute(event.currentTarget.dataset.tab), args);
1564 - }).removeClass("elementor-active").filter("[data-tab=\"" + tab + "\"]").addClass("elementor-active");
1565 - }
1566 - },
1567 - {
1568 - key: "getActiveTabConfig",
1569 - value: function getActiveTabConfig() {
1570 - return this.tabs[this.currentTab] || {};
1571 - }
1572 - },
1573 - {
1574 - key: "getBodyClass",
1575 - value: function getBodyClass(route) {
1576 - return "e-route-" + route.replace(/\//g, "-");
1577 - }
1578 - },
1579 - {
1580 - key: "normalizeCommandName",
1581 - value: function normalizeCommandName(commandName) {
1582 - return commandName.replace(/[A-Z]/g, function(match, offset) {
1583 - return (offset > 0 ? "-" : "") + match.toLowerCase();
1584 - });
1585 - }
1586 - },
1587 - {
1588 - key: "importCommands",
1589 - value: function importCommands(commandsFromImport) {
1590 - var _this5 = this;
1591 - var commands = {};
1592 - Object.entries(commandsFromImport).forEach(function(_ref1) {
1593 - var _ref10 = _slicedToArray(_ref1, 2);
1594 - var className = _ref10[0];
1595 - var Class = _ref10[1];
1596 - var command = _this5.normalizeCommandName(className);
1597 - commands[command] = Class;
1598 - });
1599 - return commands;
1600 - }
1601 - },
1602 - {
1603 - key: "importHooks",
1604 - value: function importHooks(hooksFromImport) {
1605 - var hooks = {};
1606 - for (var key in hooksFromImport) {
1607 - var hook = new hooksFromImport[key]();
1608 - hooks[hook.getId()] = hook;
1609 - }
1610 - return hooks;
1611 - }
1612 - },
1613 - {
1614 - key: "importUiStates",
1615 - value: function importUiStates(statesFromImport) {
1616 - var _this6 = this;
1617 - var uiStates = {};
1618 - Object.values(statesFromImport).forEach(function(className) {
1619 - var uiState = new className(_this6);
1620 - uiStates[uiState.getId()] = uiState;
1621 - });
1622 - return uiStates;
1623 - }
1624 - },
1625 - {
1626 - key: "setUiState",
1627 - value: function setUiState(state, value) {
1628 - $e.uiStates.set("".concat(this.getNamespace(), "/").concat(state), value);
1629 - }
1630 - },
1631 - {
1632 - key: "toggleRouteClass",
1633 - value: function toggleRouteClass(route, state) {
1634 - document.body.classList.toggle(this.getBodyClass(route), state);
1635 - }
1636 - },
1637 - {
1638 - key: "toggleHistoryClass",
1639 - value: function toggleHistoryClass() {
1640 - document.body.classList.toggle("e-routes-has-history", !!$e.routes.getHistory(this.getServiceName()).length);
1641 - }
1642 - }
1643 - ]);
1644 - }(import_module.default);
2853 + /**
2854 + * Function getCurrentLast().
2855 + *
2856 + * Receive last command that currently running.
2857 + *
2858 + * @return {string} last running command
2859 + */
2860 + }, {
2861 + key: "getCurrentLast",
2862 + value: function getCurrentLast() {
2863 + var current = Object.values(this.current);
2864 + return current[current.length - 1];
2865 + }
1645 2866
1646 -//#endregion
1647 -//#region modules/web-cli/assets/js/core/backwards-compatibility.js
1648 - function _callSuper$29(t, o, e) {
1649 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$29() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
1650 - }
1651 - __name(_callSuper$29, "_callSuper");
1652 - function _isNativeReflectConstruct$29() {
1653 - try {
1654 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
1655 - } catch (t) {}
1656 - return (_isNativeReflectConstruct$29 = function _isNativeReflectConstruct() {
1657 - return !!t;
1658 - })();
1659 - }
1660 - __name(_isNativeReflectConstruct$29, "_isNativeReflectConstruct");
1661 - var BackwardsCompatibility = /*#__PURE__*/ function() {
1662 - function BackwardsCompatibility() {
1663 - _classCallCheck(this, BackwardsCompatibility);
1664 - }
1665 - return _createClass(BackwardsCompatibility, [{
1666 - key: "ensureTab",
1667 - value: function ensureTab(namespace, tabSlug) {
1668 - var page = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "";
1669 - var component = $e.components.get(namespace);
1670 - if (!component) {
1671 - var Component = /*#__PURE__*/ function(_ComponentBase) {
1672 - function Component() {
1673 - _classCallCheck(this, Component);
1674 - return _callSuper$29(this, Component, arguments);
1675 - }
1676 - _inherits(Component, _ComponentBase);
1677 - return _createClass(Component, [{
1678 - key: "getNamespace",
1679 - value: function getNamespace() {
1680 - return namespace;
1681 - }
1682 - }, {
1683 - key: "renderTab",
1684 - value: function renderTab(tab) {
1685 - elementor.getPanelView().setPage(page).activateTab(tab);
1686 - }
1687 - }]);
1688 - }(ComponentBase);
1689 - component = $e.components.register(new Component());
1690 - }
1691 - if (!component.hasTab(tabSlug) && elementor.config.tabs[tabSlug]) component.addTab(tabSlug, { title: elementor.config.tabs[tabSlug] });
1692 - }
1693 - }]);
1694 - }();
2867 + /**
2868 + * Function getCurrentFirstTrace().
2869 + *
2870 + * Receive first command in trace that currently running
2871 + *
2872 + * @return {string} first command in trace
2873 + */
2874 + }, {
2875 + key: "getCurrentFirstTrace",
2876 + value: function getCurrentFirstTrace() {
2877 + return this.currentTrace[0];
2878 + }
1695 2879
1696 -//#endregion
1697 -//#region modules/web-cli/assets/js/modules/command-internal-base.js
1698 - function _callSuper$28(t, o, e) {
1699 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$28() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
1700 - }
1701 - __name(_callSuper$28, "_callSuper");
1702 - function _isNativeReflectConstruct$28() {
1703 - try {
1704 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
1705 - } catch (t) {}
1706 - return (_isNativeReflectConstruct$28 = function _isNativeReflectConstruct() {
1707 - return !!t;
1708 - })();
1709 - }
1710 - __name(_isNativeReflectConstruct$28, "_isNativeReflectConstruct");
1711 - /**
1712 - * @name $e.modules.CommandInternalBase
1713 - */
1714 - var CommandInternalBase = /*#__PURE__*/ function(_CommandBase) {
1715 - function CommandInternalBase(args) {
1716 - var commandsAPI = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : $e.commandsInternal;
1717 - _classCallCheck(this, CommandInternalBase);
1718 - return _callSuper$28(this, CommandInternalBase, [args, commandsAPI]);
1719 - }
1720 - _inherits(CommandInternalBase, _CommandBase);
1721 - return _createClass(CommandInternalBase, null, [{
1722 - key: "getInstanceType",
1723 - value: function getInstanceType() {
1724 - return "CommandInternalBase";
1725 - }
1726 - }]);
1727 - }(CommandBase);
2880 + /**
2881 + * Function beforeRun().
2882 + *
2883 + * Responsible to add current command to trace and trigger 'run:before' event.
2884 + * Run before command.
2885 + *
2886 + * @param {string} command
2887 + * @param {{}} args
2888 + * @param {boolean} [addTrace=true]
2889 + */
2890 + }, {
2891 + key: "beforeRun",
2892 + value: function beforeRun(command) {
2893 + var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2894 + var addTrace = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
2895 + var component = this.getComponent(command),
2896 + container = component.getServiceName();
2897 + if (addTrace) {
2898 + this.addCurrentTrace(container, command, args);
2899 + }
2900 + if (args.onBefore) {
2901 + args.onBefore.apply(component, [args]);
2902 + }
2903 + this.trigger('run:before', component, command, args);
2904 + }
1728 2905
1729 -//#endregion
1730 -//#region modules/web-cli/assets/js/core/data/errors/base-error.js
1731 - function ownKeys$2(e, r) {
1732 - var t = Object.keys(e);
1733 - if (Object.getOwnPropertySymbols) {
1734 - var o = Object.getOwnPropertySymbols(e);
1735 - r && (o = o.filter(function(r) {
1736 - return Object.getOwnPropertyDescriptor(e, r).enumerable;
1737 - })), t.push.apply(t, o);
1738 - }
1739 - return t;
1740 - }
1741 - __name(ownKeys$2, "ownKeys");
1742 - function _objectSpread$2(e) {
1743 - for (var r = 1; r < arguments.length; r++) {
1744 - var t = null != arguments[r] ? arguments[r] : {};
1745 - r % 2 ? ownKeys$2(Object(t), !0).forEach(function(r) {
1746 - _defineProperty(e, r, t[r]);
1747 - }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function(r) {
1748 - Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
1749 - });
1750 - }
1751 - return e;
1752 - }
1753 - __name(_objectSpread$2, "_objectSpread");
1754 - function _callSuper$27(t, o, e) {
1755 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$27() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
1756 - }
1757 - __name(_callSuper$27, "_callSuper");
1758 - function _isNativeReflectConstruct$27() {
1759 - try {
1760 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
1761 - } catch (t) {}
1762 - return (_isNativeReflectConstruct$27 = function _isNativeReflectConstruct() {
1763 - return !!t;
1764 - })();
1765 - }
1766 - __name(_isNativeReflectConstruct$27, "_isNativeReflectConstruct");
1767 - var BaseError = /*#__PURE__*/ function(_Error) {
1768 - /**
1769 - * Error constructor.
1770 - *
1771 - * @param {string} message
1772 - * @param {string} code
1773 - * @param {*} data
1774 - */
1775 - function BaseError() {
1776 - var _this;
1777 - var message = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
1778 - var code = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
1779 - var data = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : [];
1780 - _classCallCheck(this, BaseError);
1781 - _this = _callSuper$27(this, BaseError, [message]);
1782 - /**
1783 - * The server error code.
1784 - *
1785 - * @type {string}
1786 - */
1787 - _defineProperty(_this, "code", "");
1788 - /**
1789 - * Additional data about the current error.
1790 - *
1791 - * @type {*[]}
1792 - */
1793 - _defineProperty(_this, "data", []);
1794 - _this.code = code;
1795 - _this.data = data;
1796 - return _this;
1797 - }
1798 - /**
1799 - * Notify a message when the error occurs.
1800 - */
1801 - _inherits(BaseError, _Error);
1802 - return _createClass(BaseError, [{
1803 - key: "notify",
1804 - value: function notify() {
1805 - Console.error(_objectSpread$2({ message: this.message }, this));
1806 - }
1807 - }], [{
1808 - key: "create",
1809 - value: function create(message) {
1810 - var code = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : "";
1811 - var data = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : [];
1812 - return new this(message, code, data);
1813 - }
1814 - }, {
1815 - key: "getHTTPErrorCode",
1816 - value: function getHTTPErrorCode() {
1817 - force_method_implementation_default();
1818 - }
1819 - }]);
1820 - }(/*#__PURE__*/ _wrapNativeSuper(Error));
2906 + /**
2907 + * Function validateRun().
2908 + *
2909 + * Responsible to validate if the run is even possible.
2910 + * Runs immediately after entering `run()`.
2911 + *
2912 + * @param {string} command
2913 + * @param {*} args
2914 + *
2915 + * @return {boolean} dependency result
2916 + */
2917 + }, {
2918 + key: "validateRun",
2919 + value: function validateRun(command) {
2920 + var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2921 + if (!this.commands[command]) {
2922 + this.error("`".concat(command, "` not found."));
2923 + }
2924 + return this.getComponent(command).dependency(command, args);
2925 + }
1821 2926
1822 -//#endregion
1823 -//#region modules/web-cli/assets/js/core/data/errors/default-error.js
1824 - function _callSuper$26(t, o, e) {
1825 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$26() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
1826 - }
1827 - __name(_callSuper$26, "_callSuper");
1828 - function _isNativeReflectConstruct$26() {
1829 - try {
1830 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
1831 - } catch (t) {}
1832 - return (_isNativeReflectConstruct$26 = function _isNativeReflectConstruct() {
1833 - return !!t;
1834 - })();
1835 - }
1836 - __name(_isNativeReflectConstruct$26, "_isNativeReflectConstruct");
1837 - var DefaultError = /*#__PURE__*/ function(_BaseError) {
1838 - function DefaultError() {
1839 - _classCallCheck(this, DefaultError);
1840 - return _callSuper$26(this, DefaultError, arguments);
1841 - }
1842 - _inherits(DefaultError, _BaseError);
1843 - return _createClass(DefaultError, null, [{
1844 - key: "getHTTPErrorCode",
1845 - value: function getHTTPErrorCode() {
1846 - return 501;
1847 - }
1848 - }]);
1849 - }(BaseError);
2927 + /**
2928 + * Function run().
2929 + *
2930 + * Runs a command.
2931 + *
2932 + * @param {string} command
2933 + * @param {{}} args
2934 + *
2935 + * @return {boolean|*} results
2936 + */
2937 + }, {
2938 + key: "run",
2939 + value: function run(command) {
2940 + var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2941 + if (!this.validateRun(command, args)) {
2942 + return false;
2943 + }
2944 + this.beforeRun(command, args);
1850 2945
1851 -//#endregion
1852 -//#region modules/web-cli/assets/js/core/data/errors/error-404.js
1853 - function _callSuper$25(t, o, e) {
1854 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$25() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
1855 - }
1856 - __name(_callSuper$25, "_callSuper");
1857 - function _isNativeReflectConstruct$25() {
1858 - try {
1859 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
1860 - } catch (t) {}
1861 - return (_isNativeReflectConstruct$25 = function _isNativeReflectConstruct() {
1862 - return !!t;
1863 - })();
1864 - }
1865 - __name(_isNativeReflectConstruct$25, "_isNativeReflectConstruct");
1866 - var Error404 = /*#__PURE__*/ function(_BaseError) {
1867 - function Error404() {
1868 - _classCallCheck(this, Error404);
1869 - return _callSuper$25(this, Error404, arguments);
1870 - }
1871 - _inherits(Error404, _BaseError);
1872 - return _createClass(Error404, [{
1873 - key: "notify",
1874 - value: function notify() {
1875 - Console.warn(this.message);
1876 - }
1877 - }], [{
1878 - key: "getHTTPErrorCode",
1879 - value: function getHTTPErrorCode() {
1880 - return 404;
1881 - }
1882 - }]);
1883 - }(BaseError);
2946 + // Get command class or callback.
2947 + var context = this.commands[command];
1884 2948
1885 -//#endregion
1886 -//#region modules/web-cli/assets/js/core/data/errors/index.js
1887 - var errors_exports = /* @__PURE__ */ __exportAll({
1888 - DefaultError: () => DefaultError,
1889 - Error404: () => Error404
1890 - });
2949 + // Is it command-base based class?
2950 + if (context.getInstanceType) {
2951 + context = new context(args);
2952 + }
2953 + var currentComponent = this.getComponent(command);
1891 2954
1892 -//#endregion
1893 -//#region modules/web-cli/assets/js/modules/command-data.js
1894 - function _callSuper$24(t, o, e) {
1895 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$24() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
1896 - }
1897 - __name(_callSuper$24, "_callSuper");
1898 - function _isNativeReflectConstruct$24() {
1899 - try {
1900 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
1901 - } catch (t) {}
1902 - return (_isNativeReflectConstruct$24 = function _isNativeReflectConstruct() {
1903 - return !!t;
1904 - })();
1905 - }
1906 - __name(_isNativeReflectConstruct$24, "_isNativeReflectConstruct");
1907 - /**
1908 - * @name $e.modules.CommandData
1909 - */
1910 - /**
1911 - * @typedef {('create'|'delete'|'get'|'update'|'options')} DataTypes
1912 - */
1913 - /**
1914 - * @typedef {{}} RequestData
1915 - */
1916 - /**
1917 - * @typedef {import('../core/data/errors/base-error')} BaseError
1918 - */
1919 - var CommandData = /*#__PURE__*/ function(_CommandBase) {
1920 - function CommandData(args) {
1921 - var _this$args$options;
1922 - var _this;
1923 - var commandsAPI = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : $e.data;
1924 - _classCallCheck(this, CommandData);
1925 - _this = _callSuper$24(this, CommandData, [args, commandsAPI]);
1926 - /**
1927 - * Data returned from remote.
1928 - *
1929 - * @type {*}
1930 - */
1931 - _defineProperty(_this, "data", void 0);
1932 - /**
1933 - * Fetch type.
1934 - *
1935 - * @type {DataTypes}
1936 - */
1937 - _defineProperty(_this, "type", void 0);
1938 - if ((_this$args$options = _this.args.options) !== null && _this$args$options !== void 0 && _this$args$options.type) _this.type = _this.args.options.type;
1939 - return _this;
1940 - }
1941 - /**
1942 - * Function getEndpointFormat().
1943 - *
1944 - * @return {null|string} endpoint format
1945 - */
1946 - _inherits(CommandData, _CommandBase);
1947 - return _createClass(CommandData, [
1948 - {
1949 - key: "getApplyMethods",
1950 - value: function getApplyMethods() {
1951 - var type = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.type;
1952 - var before;
1953 - var after;
1954 - switch (type) {
1955 - case "create":
1956 - before = this.applyBeforeCreate;
1957 - after = this.applyAfterCreate;
1958 - break;
1959 - case "delete":
1960 - before = this.applyBeforeDelete;
1961 - after = this.applyAfterDelete;
1962 - break;
1963 - case "get":
1964 - before = this.applyBeforeGet;
1965 - after = this.applyAfterGet;
1966 - break;
1967 - case "update":
1968 - before = this.applyBeforeUpdate;
1969 - after = this.applyAfterUpdate;
1970 - break;
1971 - case "options":
1972 - before = this.applyBeforeOptions;
1973 - after = this.applyAfterOptions;
1974 - break;
1975 - default: return false;
1976 - }
1977 - return {
1978 - before: before.bind(this),
1979 - after: after.bind(this)
1980 - };
1981 - }
1982 - },
1983 - {
1984 - key: "getRequestData",
1985 - value: function getRequestData() {
1986 - return {
1987 - type: this.type,
1988 - args: this.args,
1989 - timestamp: (/* @__PURE__ */ new Date()).getTime(),
1990 - component: this.component,
1991 - command: this.command,
1992 - endpoint: $e.data.commandToEndpoint(this.command, JSON.parse(JSON.stringify(this.args)), this.constructor.getEndpointFormat())
1993 - };
1994 - }
1995 - },
1996 - {
1997 - key: "apply",
1998 - value: function apply() {
1999 - var _this2 = this;
2000 - var applyMethods = this.getApplyMethods();
2001 - this.args = applyMethods.before(this.args);
2002 - var requestData = this.getRequestData();
2003 - return $e.data.fetch(requestData).then(function(data) {
2004 - _this2.data = data;
2005 - _this2.data = applyMethods.after(data, _this2.args);
2006 - _this2.data = { data: _this2.data };
2007 - _this2.data = Object.assign({ __requestData__: requestData }, _this2.data);
2008 - return _this2.data;
2009 - });
2010 - }
2011 - },
2012 - {
2013 - key: "applyBeforeCreate",
2014 - value: function applyBeforeCreate() {
2015 - return arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
2016 - }
2017 - },
2018 - {
2019 - key: "applyAfterCreate",
2020 - value: function applyAfterCreate(data) {
2021 - arguments.length > 1 && arguments[1] !== void 0 && arguments[1];
2022 - return data;
2023 - }
2024 - },
2025 - {
2026 - key: "applyBeforeDelete",
2027 - value: function applyBeforeDelete() {
2028 - return arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
2029 - }
2030 - },
2031 - {
2032 - key: "applyAfterDelete",
2033 - value: function applyAfterDelete(data) {
2034 - arguments.length > 1 && arguments[1] !== void 0 && arguments[1];
2035 - return data;
2036 - }
2037 - },
2038 - {
2039 - key: "applyBeforeGet",
2040 - value: function applyBeforeGet() {
2041 - return arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
2042 - }
2043 - },
2044 - {
2045 - key: "applyAfterGet",
2046 - value: function applyAfterGet(data) {
2047 - arguments.length > 1 && arguments[1] !== void 0 && arguments[1];
2048 - return data;
2049 - }
2050 - },
2051 - {
2052 - key: "applyBeforeUpdate",
2053 - value: function applyBeforeUpdate() {
2054 - return arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
2055 - }
2056 - },
2057 - {
2058 - key: "applyAfterUpdate",
2059 - value: function applyAfterUpdate(data) {
2060 - arguments.length > 1 && arguments[1] !== void 0 && arguments[1];
2061 - return data;
2062 - }
2063 - },
2064 - {
2065 - key: "applyBeforeOptions",
2066 - value: function applyBeforeOptions() {
2067 - return arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
2068 - }
2069 - },
2070 - {
2071 - key: "applyAfterOptions",
2072 - value: function applyAfterOptions(data) {
2073 - arguments.length > 1 && arguments[1] !== void 0 && arguments[1];
2074 - return data;
2075 - }
2076 - },
2077 - {
2078 - key: "applyAfterCatch",
2079 - value: function applyAfterCatch(e) {
2080 - e.notify();
2081 - }
2082 - },
2083 - {
2084 - key: "onCatchApply",
2085 - value: function onCatchApply(e) {
2086 - var _e;
2087 - var httpErrorCode = ((_e = e) === null || _e === void 0 || (_e = _e.data) === null || _e === void 0 ? void 0 : _e.status) || 501;
2088 - var dataError = Object.values(errors_exports).find(function(error) {
2089 - return error.getHTTPErrorCode() === httpErrorCode;
2090 - });
2091 - if (!dataError) dataError = DefaultError;
2092 - e = dataError.create(e.message, e.code, e.data || []);
2093 - this.runCatchHooks(e);
2094 - this.applyAfterCatch(e);
2095 - }
2096 - }
2097 - ], [{
2098 - key: "getInstanceType",
2099 - value: function getInstanceType() {
2100 - return "CommandData";
2101 - }
2102 - }, {
2103 - key: "getEndpointFormat",
2104 - value: function getEndpointFormat() {
2105 - return null;
2106 - }
2107 - }]);
2108 - }(CommandBase);
2955 + // Is simple callback? (e.g. a route)
2956 + if (!(context instanceof _commandBase.default)) {
2957 + var results = context.apply(currentComponent, [args]);
2958 + this.afterRun(command, args, results);
2959 + return results;
2960 + }
2961 + if (!this.validateInstanceScope(context, currentComponent, command)) {
2962 + return this.removeCurrentTrace(currentComponent);
2963 + }
2964 + return this.runInstance(context);
2965 + }
2109 2966
2110 -//#endregion
2111 -//#region node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js
2112 - function asyncGeneratorStep(n, t, e, r, o, a, c) {
2113 - try {
2114 - var i = n[a](c);
2115 - var u = i.value;
2116 - } catch (n) {
2117 - e(n);
2118 - return;
2119 - }
2120 - i.done ? t(u) : Promise.resolve(u).then(r, o);
2121 - }
2122 - function _asyncToGenerator(n) {
2123 - return function() {
2124 - var t = this;
2125 - var e = arguments;
2126 - return new Promise(function(r, o) {
2127 - var a = n.apply(t, e);
2128 - function _next(n) {
2129 - asyncGeneratorStep(a, r, o, _next, _throw, "next", n);
2130 - }
2131 - function _throw(n) {
2132 - asyncGeneratorStep(a, r, o, _next, _throw, "throw", n);
2133 - }
2134 - _next(void 0);
2135 - });
2136 - };
2137 - }
2967 + /**
2968 + * Function runInstance().
2969 + *
2970 + * @param {CommandBase} instance
2971 + *
2972 + * @return {boolean|Promise<*>}
2973 + */
2974 + }, {
2975 + key: "runInstance",
2976 + value: function runInstance(instance) {
2977 + var results = null;
2138 2978
2139 -//#endregion
2140 -//#region node_modules/@babel/runtime/helpers/OverloadYield.js
2141 - var require_OverloadYield = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2142 - function _OverloadYield(e, d) {
2143 - this.v = e, this.k = d;
2144 - }
2145 - module.exports = _OverloadYield, module.exports.__esModule = true, module.exports["default"] = module.exports;
2146 - }));
2979 + // For UI Hooks.
2980 + instance.onBeforeRun(instance.args);
2981 + try {
2982 + // For data hooks.
2983 + instance.onBeforeApply(instance.args);
2984 + results = instance.run();
2985 + } catch (e) {
2986 + this.catchApply(e, instance);
2987 + if (e instanceof $e.modules.HookBreak) {
2988 + this.removeCurrentTrace(instance.component);
2989 + return false;
2990 + }
2991 + }
2992 + return this.applyRunAfter(instance, results);
2993 + }
2147 2994
2148 -//#endregion
2149 -//#region node_modules/@babel/runtime/helpers/regeneratorDefine.js
2150 - var require_regeneratorDefine = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2151 - function _regeneratorDefine(e, r, n, t) {
2152 - var i = Object.defineProperty;
2153 - try {
2154 - i({}, "", {});
2155 - } catch (e) {
2156 - i = 0;
2157 - }
2158 - module.exports = _regeneratorDefine = function regeneratorDefine(e, r, n, t) {
2159 - function o(r, n) {
2160 - _regeneratorDefine(e, r, function(e) {
2161 - return this._invoke(r, n, e);
2162 - });
2163 - }
2164 - r ? i ? i(e, r, {
2165 - value: n,
2166 - enumerable: !t,
2167 - configurable: !t,
2168 - writable: !t
2169 - }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2));
2170 - }, module.exports.__esModule = true, module.exports["default"] = module.exports, _regeneratorDefine(e, r, n, t);
2171 - }
2172 - module.exports = _regeneratorDefine, module.exports.__esModule = true, module.exports["default"] = module.exports;
2173 - }));
2995 + /**
2996 + * Function applyRunAfter().
2997 + *
2998 + * Responsible for applying everything that need to be run after each command runs.
2999 + * Called on run() after runInstance(), to manipulate results & apply 'after' hooks.
3000 + *
3001 + * @param {CommandBase} instance
3002 + * @param {*} result
3003 + *
3004 + * @return {Promise<*>|*}
3005 + */
3006 + }, {
3007 + key: "applyRunAfter",
3008 + value: function applyRunAfter(instance, result) {
3009 + var _this3 = this;
3010 + // TODO: Temp code determine if it's a jQuery deferred object.
3011 + if (result && 'object' === (0, _typeof2.default)(result) && result.promise && result.then && result.fail) {
3012 + var handleJQueryDeferred = function handleJQueryDeferred(_result) {
3013 + _result.fail(function (e) {
3014 + _this3.catchApply(e, instance);
3015 + _this3.afterRun(instance.command, instance.args, e);
3016 + });
3017 + _result.done(function (__result) {
3018 + _this3.applyRunAfterSync(instance, __result);
3019 + });
3020 + return _result;
3021 + };
3022 + return handleJQueryDeferred(result);
3023 + } else if (result instanceof Promise) {
3024 + return this.applyRunAfterAsync(instance, result);
3025 + }
3026 + this.applyRunAfterSync(instance, result);
3027 + return result;
3028 + }
2174 3029
2175 -//#endregion
2176 -//#region node_modules/@babel/runtime/helpers/regenerator.js
2177 - var require_regenerator$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2178 - var regeneratorDefine = require_regeneratorDefine();
2179 - function _regenerator() {
2180 - /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
2181 - var e;
2182 - var t;
2183 - var r = "function" == typeof Symbol ? Symbol : {};
2184 - var n = r.iterator || "@@iterator";
2185 - var o = r.toStringTag || "@@toStringTag";
2186 - function i(r, n, o, i) {
2187 - var c = n && n.prototype instanceof Generator ? n : Generator;
2188 - var u = Object.create(c.prototype);
2189 - return regeneratorDefine(u, "_invoke", function(r, n, o) {
2190 - var i;
2191 - var c;
2192 - var u;
2193 - var f = 0;
2194 - var p = o || [];
2195 - var y = !1;
2196 - var G = {
2197 - p: 0,
2198 - n: 0,
2199 - v: e,
2200 - a: d,
2201 - f: d.bind(e, 4),
2202 - d: function d(t, r) {
2203 - return i = t, c = 0, u = e, G.n = r, a;
2204 - }
2205 - };
2206 - function d(r, n) {
2207 - for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) {
2208 - var o;
2209 - var i = p[t];
2210 - var d = G.p;
2211 - var l = i[2];
2212 - r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0));
2213 - }
2214 - if (o || r > 1) return a;
2215 - throw y = !0, n;
2216 - }
2217 - return function(o, p, l) {
2218 - if (f > 1) throw TypeError("Generator is already running");
2219 - for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) {
2220 - i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u);
2221 - try {
2222 - if (f = 2, i) {
2223 - if (c || (o = "next"), t = i[o]) {
2224 - if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object");
2225 - if (!t.done) return t;
2226 - u = t.value, c < 2 && (c = 0);
2227 - } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1);
2228 - i = e;
2229 - } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break;
2230 - } catch (t) {
2231 - i = e, c = 1, u = t;
2232 - } finally {
2233 - f = 1;
2234 - }
2235 - }
2236 - return {
2237 - value: t,
2238 - done: y
2239 - };
2240 - };
2241 - }(r, o, i), !0), u;
2242 - }
2243 - var a = {};
2244 - function Generator() {}
2245 - function GeneratorFunction() {}
2246 - function GeneratorFunctionPrototype() {}
2247 - t = Object.getPrototypeOf;
2248 - var c = [][n] ? t(t([][n]())) : (regeneratorDefine(t = {}, n, function() {
2249 - return this;
2250 - }), t);
2251 - var u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c);
2252 - function f(e) {
2253 - return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, regeneratorDefine(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e;
2254 - }
2255 - return GeneratorFunction.prototype = GeneratorFunctionPrototype, regeneratorDefine(u, "constructor", GeneratorFunctionPrototype), regeneratorDefine(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", regeneratorDefine(GeneratorFunctionPrototype, o, "GeneratorFunction"), regeneratorDefine(u), regeneratorDefine(u, o, "Generator"), regeneratorDefine(u, n, function() {
2256 - return this;
2257 - }), regeneratorDefine(u, "toString", function() {
2258 - return "[object Generator]";
2259 - }), (module.exports = _regenerator = function _regenerator() {
2260 - return {
2261 - w: i,
2262 - m: f
2263 - };
2264 - }, module.exports.__esModule = true, module.exports["default"] = module.exports)();
2265 - }
2266 - module.exports = _regenerator, module.exports.__esModule = true, module.exports["default"] = module.exports;
2267 - }));
3030 + /**
3031 + * Function applyRunAfterSync().
3032 + *
3033 + * Responsible to handle simple(synchronous) 'run after' behavior.
3034 + * Called on applyRunAfterSync() after runInstance(), to handle results.
3035 + *
3036 + * @param {CommandBase} instance
3037 + * @param {*} result
3038 + */
3039 + }, {
3040 + key: "applyRunAfterSync",
3041 + value: function applyRunAfterSync(instance, result) {
3042 + // Run Data hooks.
3043 + instance.onAfterApply(instance.args, result);
2268 3044
2269 -//#endregion
2270 -//#region node_modules/@babel/runtime/helpers/regeneratorAsyncIterator.js
2271 - var require_regeneratorAsyncIterator = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2272 - var OverloadYield = require_OverloadYield();
2273 - var regeneratorDefine = require_regeneratorDefine();
2274 - function AsyncIterator(t, e) {
2275 - function n(r, o, i, f) {
2276 - try {
2277 - var c = t[r](o);
2278 - var u = c.value;
2279 - return u instanceof OverloadYield ? e.resolve(u.v).then(function(t) {
2280 - n("next", t, i, f);
2281 - }, function(t) {
2282 - n("throw", t, i, f);
2283 - }) : e.resolve(u).then(function(t) {
2284 - c.value = t, i(c);
2285 - }, function(t) {
2286 - return n("throw", t, i, f);
2287 - });
2288 - } catch (t) {
2289 - f(t);
2290 - }
2291 - }
2292 - var r;
2293 - this.next || (regeneratorDefine(AsyncIterator.prototype), regeneratorDefine(AsyncIterator.prototype, "function" == typeof Symbol && Symbol.asyncIterator || "@asyncIterator", function() {
2294 - return this;
2295 - })), regeneratorDefine(this, "_invoke", function(t, o, i) {
2296 - function f() {
2297 - return new e(function(e, r) {
2298 - n(t, i, e, r);
2299 - });
2300 - }
2301 - return r = r ? r.then(f, f) : f();
2302 - }, !0);
2303 - }
2304 - module.exports = AsyncIterator, module.exports.__esModule = true, module.exports["default"] = module.exports;
2305 - }));
3045 + // For UI hooks.
3046 + instance.onAfterRun(instance.args, result);
3047 + this.afterRun(instance.command, instance.args, result);
3048 + }
2306 3049
2307 -//#endregion
2308 -//#region node_modules/@babel/runtime/helpers/regeneratorAsyncGen.js
2309 - var require_regeneratorAsyncGen = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2310 - var regenerator = require_regenerator$1();
2311 - var regeneratorAsyncIterator = require_regeneratorAsyncIterator();
2312 - function _regeneratorAsyncGen(r, e, t, o, n) {
2313 - return new regeneratorAsyncIterator(regenerator().w(r, e, t, o), n || Promise);
2314 - }
2315 - module.exports = _regeneratorAsyncGen, module.exports.__esModule = true, module.exports["default"] = module.exports;
2316 - }));
3050 + /**
3051 + * Function applyRunAfterAsync().
3052 + *
3053 + * Await for promise result.
3054 + * Called on applyRunAfter() after runInstance().
3055 + *
3056 + * @param {CommandBase} instance
3057 + * @param {*} result
3058 + */
3059 + }, {
3060 + key: "applyRunAfterAsync",
3061 + value: function applyRunAfterAsync(instance, result) {
3062 + var _this4 = this;
3063 + // Override initial result ( promise ) to await onAfter promises, first!.
3064 + return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
3065 + return _regenerator.default.wrap(function _callee$(_context) {
3066 + while (1) {
3067 + switch (_context.prev = _context.next) {
3068 + case 0:
3069 + _context.next = 2;
3070 + return result.catch(function (e) {
3071 + _this4.catchApply(e, instance);
3072 + _this4.afterRun(instance.command, instance.args, e);
3073 + });
3074 + case 2:
3075 + _context.next = 4;
3076 + return result.then(function (_result) {
3077 + return _this4.applyRunAfterAsyncResult(instance, _result);
3078 + });
3079 + case 4:
3080 + return _context.abrupt("return", result);
3081 + case 5:
3082 + case "end":
3083 + return _context.stop();
3084 + }
3085 + }
3086 + }, _callee);
3087 + }))();
3088 + }
2317 3089
2318 -//#endregion
2319 -//#region node_modules/@babel/runtime/helpers/regeneratorAsync.js
2320 - var require_regeneratorAsync = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2321 - var regeneratorAsyncGen = require_regeneratorAsyncGen();
2322 - function _regeneratorAsync(n, e, r, t, o) {
2323 - var a = regeneratorAsyncGen(n, e, r, t, o);
2324 - return a.next().then(function(n) {
2325 - return n.done ? n.value : a.next();
2326 - });
2327 - }
2328 - module.exports = _regeneratorAsync, module.exports.__esModule = true, module.exports["default"] = module.exports;
2329 - }));
3090 + /**
3091 + * Function applyRunAfterAsyncResult().
3092 + *
3093 + * Responsible to await all promises results.
3094 + * Called on applyRunAfterAsync() after runInstance(), to handle async results.
3095 + * Awaits all the promises, before releasing the command.
3096 + *
3097 + * @param {CommandBase} instance
3098 + * @param {*} result
3099 + */
3100 + }, {
3101 + key: "applyRunAfterAsyncResult",
3102 + value: function () {
3103 + var _applyRunAfterAsyncResult = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(instance, result) {
3104 + var results, promises;
3105 + return _regenerator.default.wrap(function _callee2$(_context2) {
3106 + while (1) {
3107 + switch (_context2.prev = _context2.next) {
3108 + case 0:
3109 + // Run Data hooks.
3110 + results = instance.onAfterApply(instance.args, result), promises = Array.isArray(results) ? results.flat().filter(function (filtered) {
3111 + return filtered instanceof Promise;
3112 + }) : [];
3113 + if (!promises.length) {
3114 + _context2.next = 4;
3115 + break;
3116 + }
3117 + _context2.next = 4;
3118 + return Promise.all(promises);
3119 + case 4:
3120 + // For UI hooks.
3121 + instance.onAfterRun(instance.args, result);
3122 + this.afterRun(instance.command, instance.args, result);
3123 + case 6:
3124 + case "end":
3125 + return _context2.stop();
3126 + }
3127 + }
3128 + }, _callee2, this);
3129 + }));
3130 + function applyRunAfterAsyncResult(_x, _x2) {
3131 + return _applyRunAfterAsyncResult.apply(this, arguments);
3132 + }
3133 + return applyRunAfterAsyncResult;
3134 + }()
3135 + /**
3136 + * Function afterRun().
3137 + *
3138 + * Responsible to to clear command from trace, and run 'run:after' event.
3139 + * Method fired after the command runs.
3140 + *
3141 + * @param {string} command
3142 + * @param {{}} args
3143 + * @param {*} results
3144 + * @param {boolean} [removeTrace=true]
3145 + */
3146 + }, {
3147 + key: "afterRun",
3148 + value: function afterRun(command, args) {
3149 + var results = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;
3150 + var removeTrace = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
3151 + var component = this.getComponent(command);
3152 + if (args.onAfter) {
3153 + args.onAfter.apply(component, [args, results]);
3154 + }
3155 + this.trigger('run:after', component, command, args, results);
3156 + if (removeTrace) {
3157 + this.removeCurrentTrace(component);
3158 + }
3159 + }
2330 3160
2331 -//#endregion
2332 -//#region node_modules/@babel/runtime/helpers/regeneratorKeys.js
2333 - var require_regeneratorKeys = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2334 - function _regeneratorKeys(e) {
2335 - var n = Object(e);
2336 - var r = [];
2337 - for (var t in n) r.unshift(t);
2338 - return function e() {
2339 - for (; r.length;) if ((t = r.pop()) in n) return e.value = t, e.done = !1, e;
2340 - return e.done = !0, e;
2341 - };
2342 - }
2343 - module.exports = _regeneratorKeys, module.exports.__esModule = true, module.exports["default"] = module.exports;
2344 - }));
3161 + /**
3162 + * @param {Error} e
3163 + * @param {CommandBase} instance
3164 + */
3165 + }, {
3166 + key: "catchApply",
3167 + value: function catchApply(e, instance) {
3168 + instance.onCatchApply(e);
3169 + _console.default.error(e);
3170 + }
2345 3171
2346 -//#endregion
2347 -//#region node_modules/@babel/runtime/helpers/typeof.js
2348 - var require_typeof = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2349 - function _typeof(o) {
2350 - "@babel/helpers - typeof";
2351 - return module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
2352 - return typeof o;
2353 - } : function(o) {
2354 - return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
2355 - }, module.exports.__esModule = true, module.exports["default"] = module.exports, _typeof(o);
2356 - }
2357 - module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
2358 - }));
3172 + /**
3173 + * Function runShortcut().
3174 + *
3175 + * Run shortcut.
3176 + *
3177 + * It's separated in order to allow override.
3178 + *
3179 + * @param {string} command
3180 + * @param {*} event
3181 + *
3182 + * @return {boolean|*} result
3183 + */
3184 + }, {
3185 + key: "runShortcut",
3186 + value: function runShortcut(command, event) {
3187 + return this.run(command, event);
3188 + }
3189 + }, {
3190 + key: "validateInstanceScope",
3191 + value: function validateInstanceScope(instance, currentComponent, command) {
3192 + if (!(instance instanceof _commandBase.default)) {
3193 + this.error("invalid instance, command: '".concat(command, "' "));
3194 + }
2359 3195
2360 -//#endregion
2361 -//#region node_modules/@babel/runtime/helpers/regeneratorValues.js
2362 - var require_regeneratorValues = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2363 - var _typeof = require_typeof()["default"];
2364 - function _regeneratorValues(e) {
2365 - if (null != e) {
2366 - var t = e["function" == typeof Symbol && Symbol.iterator || "@@iterator"];
2367 - var r = 0;
2368 - if (t) return t.call(e);
2369 - if ("function" == typeof e.next) return e;
2370 - if (!isNaN(e.length)) return { next: function next() {
2371 - return e && r >= e.length && (e = void 0), {
2372 - value: e && e[r++],
2373 - done: !e
2374 - };
2375 - } };
2376 - }
2377 - throw new TypeError(_typeof(e) + " is not iterable");
2378 - }
2379 - module.exports = _regeneratorValues, module.exports.__esModule = true, module.exports["default"] = module.exports;
2380 - }));
3196 + // In case of different scope.
3197 + if (currentComponent !== instance.component) {
3198 + if ($e.devTools) {
3199 + $e.devTools.log.warn("Command: '".concat(command, "' registerArgs.component: '").concat(instance.component.getNamespace(), "' while current component is: '").concat(currentComponent.getNamespace(), "'"));
3200 + }
3201 + return false;
3202 + }
3203 + return true;
3204 + }
3205 + }, {
3206 + key: "addCurrentTrace",
3207 + value: function addCurrentTrace(container, command, args) {
3208 + this.currentTrace.push(command);
3209 + Commands.trace.push(command);
3210 + this.attachCurrent(container, command, args);
3211 + }
3212 + }, {
3213 + key: "removeCurrentTrace",
3214 + value: function removeCurrentTrace(currentComponent) {
3215 + var container = currentComponent.getServiceName();
3216 + this.currentTrace.pop();
3217 + Commands.trace.pop();
3218 + this.detachCurrent(container);
3219 + }
3220 + }, {
3221 + key: "attachCurrent",
3222 + value: function attachCurrent(container, command, args) {
3223 + this.current[container] = command;
3224 + this.currentArgs[container] = args;
3225 + }
3226 + }, {
3227 + key: "detachCurrent",
3228 + value: function detachCurrent(container) {
3229 + delete this.current[container];
3230 + delete this.currentArgs[container];
3231 + }
2381 3232
2382 -//#endregion
2383 -//#region node_modules/@babel/runtime/helpers/regeneratorRuntime.js
2384 - var require_regeneratorRuntime = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2385 - var OverloadYield = require_OverloadYield();
2386 - var regenerator = require_regenerator$1();
2387 - var regeneratorAsync = require_regeneratorAsync();
2388 - var regeneratorAsyncGen = require_regeneratorAsyncGen();
2389 - var regeneratorAsyncIterator = require_regeneratorAsyncIterator();
2390 - var regeneratorKeys = require_regeneratorKeys();
2391 - var regeneratorValues = require_regeneratorValues();
2392 - function _regeneratorRuntime() {
2393 - "use strict";
2394 - var r = regenerator();
2395 - var e = r.m(_regeneratorRuntime);
2396 - var t = (Object.getPrototypeOf ? Object.getPrototypeOf(e) : e.__proto__).constructor;
2397 - function n(r) {
2398 - var e = "function" == typeof r && r.constructor;
2399 - return !!e && (e === t || "GeneratorFunction" === (e.displayName || e.name));
2400 - }
2401 - var o = {
2402 - "throw": 1,
2403 - "return": 2,
2404 - "break": 3,
2405 - "continue": 3
2406 - };
2407 - function a(r) {
2408 - var e;
2409 - var t;
2410 - return function(n) {
2411 - e || (e = {
2412 - stop: function stop() {
2413 - return t(n.a, 2);
2414 - },
2415 - "catch": function _catch() {
2416 - return n.v;
2417 - },
2418 - abrupt: function abrupt(r, e) {
2419 - return t(n.a, o[r], e);
2420 - },
2421 - delegateYield: function delegateYield(r, o, a) {
2422 - return e.resultName = o, t(n.d, regeneratorValues(r), a);
2423 - },
2424 - finish: function finish(r) {
2425 - return t(n.f, r);
2426 - }
2427 - }, t = function t(r, _t, o) {
2428 - n.p = e.prev, n.n = e.next;
2429 - try {
2430 - return r(_t, o);
2431 - } finally {
2432 - e.next = n.n;
2433 - }
2434 - }), e.resultName && (e[e.resultName] = n.v, e.resultName = void 0), e.sent = n.v, e.next = n.n;
2435 - try {
2436 - return r.call(this, e);
2437 - } finally {
2438 - n.p = e.prev, n.n = e.next;
2439 - }
2440 - };
2441 - }
2442 - return (module.exports = _regeneratorRuntime = function _regeneratorRuntime() {
2443 - return {
2444 - wrap: function wrap(e, t, n, o) {
2445 - return r.w(a(e), t, n, o && o.reverse());
2446 - },
2447 - isGeneratorFunction: n,
2448 - mark: r.m,
2449 - awrap: function awrap(r, e) {
2450 - return new OverloadYield(r, e);
2451 - },
2452 - AsyncIterator: regeneratorAsyncIterator,
2453 - async: function async(r, e, t, o, u) {
2454 - return (n(e) ? regeneratorAsyncGen : regeneratorAsync)(a(r), e, t, o, u);
2455 - },
2456 - keys: regeneratorKeys,
2457 - values: regeneratorValues
2458 - };
2459 - }, module.exports.__esModule = true, module.exports["default"] = module.exports)();
2460 - }
2461 - module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;
2462 - }));
3233 + /**
3234 + * Function error().
3235 + *
3236 + * Throws error.
3237 + *
3238 + * @throws {Error}
3239 + *
3240 + * @param {string} message
3241 + */
3242 + }, {
3243 + key: "error",
3244 + value: function error(message) {
3245 + throw Error("Commands: ".concat(message));
3246 + }
3247 + }]);
3248 + return Commands;
3249 +}(_commands.default);
3250 +exports["default"] = Commands;
3251 +(0, _defineProperty2.default)(Commands, "trace", []);
2463 3252
2464 -//#endregion
2465 -//#region node_modules/@babel/runtime/regenerator/index.js
2466 - var require_regenerator = /* @__PURE__ */ __commonJSMin(((exports, module) => {
2467 - var runtime = require_regeneratorRuntime()();
2468 - module.exports = runtime;
2469 - try {
2470 - regeneratorRuntime = runtime;
2471 - } catch (accidentalStrictMode) {
2472 - if (typeof globalThis === "object") globalThis.regeneratorRuntime = runtime;
2473 - else Function("r", "regeneratorRuntime = r")(runtime);
2474 - }
2475 - }));
3253 +/***/ }),
2476 3254
2477 -//#endregion
2478 -//#region modules/web-cli/assets/js/core/backwards-compatibility/commands.js
2479 -var import_regenerator = /* @__PURE__ */ __toESM(require_regenerator());
2480 - function _callSuper$23(t, o, e) {
2481 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$23() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
2482 - }
2483 - __name(_callSuper$23, "_callSuper");
2484 - function _isNativeReflectConstruct$23() {
2485 - try {
2486 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
2487 - } catch (t) {}
2488 - return (_isNativeReflectConstruct$23 = function _isNativeReflectConstruct() {
2489 - return !!t;
2490 - })();
2491 - }
2492 - __name(_isNativeReflectConstruct$23, "_isNativeReflectConstruct");
2493 - var CommandsBackwardsCompatibility = /*#__PURE__*/ function(_Module) {
2494 - function CommandsBackwardsCompatibility() {
2495 - var _this;
2496 - _classCallCheck(this, CommandsBackwardsCompatibility);
2497 - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];
2498 - _this = _callSuper$23(this, CommandsBackwardsCompatibility, [].concat(args));
2499 - _defineProperty(_this, "on", function(eventName, callback) {
2500 - if ("run" === eventName) {
2501 - var componentName = _this.getConstructorID();
2502 - componentName = componentName.replace(/^./, function(val) {
2503 - return val.toLowerCase();
2504 - });
2505 - Deprecation.deprecated("$e.".concat(componentName, ".on( 'run', ... )"), "3.0.0", "$e.".concat(componentName, ".on( 'run:before', ... )"));
2506 - _this.onOrig("run:before", callback);
2507 - return;
2508 - }
2509 - _this.onOrig(eventName, callback);
2510 - });
2511 - return _this;
2512 - }
2513 - _inherits(CommandsBackwardsCompatibility, _Module);
2514 - return _createClass(CommandsBackwardsCompatibility, [{
2515 - key: "__construct",
2516 - value: function __construct() {
2517 - this.onOrig = this.on;
2518 - }
2519 - }]);
2520 - }(import_module.default);
3255 +/***/ "../modules/web-cli/assets/js/core/components.js":
3256 +/*!*******************************************************!*\
3257 + !*** ../modules/web-cli/assets/js/core/components.js ***!
3258 + \*******************************************************/
3259 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
2521 3260
2522 -//#endregion
2523 -//#region modules/web-cli/assets/js/core/commands.js
2524 - init_typeof();
2525 - function ownKeys$1(e, r) {
2526 - var t = Object.keys(e);
2527 - if (Object.getOwnPropertySymbols) {
2528 - var o = Object.getOwnPropertySymbols(e);
2529 - r && (o = o.filter(function(r) {
2530 - return Object.getOwnPropertyDescriptor(e, r).enumerable;
2531 - })), t.push.apply(t, o);
2532 - }
2533 - return t;
2534 - }
2535 - __name(ownKeys$1, "ownKeys");
2536 - function _objectSpread$1(e) {
2537 - for (var r = 1; r < arguments.length; r++) {
2538 - var t = null != arguments[r] ? arguments[r] : {};
2539 - r % 2 ? ownKeys$1(Object(t), !0).forEach(function(r) {
2540 - _defineProperty(e, r, t[r]);
2541 - }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function(r) {
2542 - Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
2543 - });
2544 - }
2545 - return e;
2546 - }
2547 - __name(_objectSpread$1, "_objectSpread");
2548 - function _callSuper$22(t, o, e) {
2549 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$22() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
2550 - }
2551 - __name(_callSuper$22, "_callSuper");
2552 - function _isNativeReflectConstruct$22() {
2553 - try {
2554 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
2555 - } catch (t) {}
2556 - return (_isNativeReflectConstruct$22 = function _isNativeReflectConstruct() {
2557 - return !!t;
2558 - })();
2559 - }
2560 - __name(_isNativeReflectConstruct$22, "_isNativeReflectConstruct");
2561 - /**
2562 - * @typedef {import('../modules/component-base')} ComponentBase
2563 - */
2564 - /**
2565 - * @typedef {import('../modules/command-base')} CommandBase
2566 - */
2567 - /**
2568 - * @typedef {{}} Component
2569 - */
2570 - var Commands = /*#__PURE__*/ function(_CommandsBackwardsCom) {
2571 - /**
2572 - * Function constructor().
2573 - *
2574 - * Create `$e.commands` API.
2575 - *
2576 - * @param {{}} args
2577 - */
2578 - function Commands() {
2579 - var _this;
2580 - _classCallCheck(this, Commands);
2581 - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];
2582 - _this = _callSuper$22(this, Commands, [].concat(args));
2583 - _this.current = {};
2584 - _this.currentArgs = {};
2585 - _this.currentTrace = [];
2586 - _this.commands = {};
2587 - _this.components = {};
2588 - Object.defineProperty(_this, "classes", { get: function get() {
2589 - Deprecation.deprecated("$e.commands.classes", "3.7.0", "$e.commands.getCommandClass(), $e.commandsInternal.getCommandClass(), $e.data.getCommandClass(), $e.routes.getCommandClass() according to the requested command infra-structure,");
2590 - return _objectSpread$1(_objectSpread$1(_objectSpread$1(_objectSpread$1({}, $e.commands.commands), $e.commandsInternal.commands), $e.data.commands), $e.routes.commands);
2591 - } });
2592 - return _this;
2593 - }
2594 - /**
2595 - * @param {string} id
2596 - * @return {CommandBase} command class
2597 - */
2598 - _inherits(Commands, _CommandsBackwardsCom);
2599 - return _createClass(Commands, [
2600 - {
2601 - key: "getCommandClass",
2602 - value: function getCommandClass(id) {
2603 - return this.commands[id];
2604 - }
2605 - },
2606 - {
2607 - key: "getAll",
2608 - value: function getAll() {
2609 - return Object.keys(this.commands).sort();
2610 - }
2611 - },
2612 - {
2613 - key: "register",
2614 - value: function register(component, command, callback) {
2615 - var _this2 = this;
2616 - var namespace;
2617 - if ("string" === typeof component) {
2618 - namespace = component;
2619 - component = $e.components.get(namespace);
2620 - if (!component) this.error("'".concat(namespace, "' component is not exist."));
2621 - } else namespace = component.getNamespace();
2622 - var fullCommand = namespace + (command ? "/" + command : "");
2623 - if (this.commands[fullCommand]) this.error("`".concat(fullCommand, "` is already registered."));
2624 - this.commands[fullCommand] = callback;
2625 - this.components[fullCommand] = namespace;
2626 - var shortcut = component.getShortcuts()[command];
2627 - if (shortcut) {
2628 - shortcut.command = fullCommand;
2629 - shortcut.callback = function(event) {
2630 - return _this2.runShortcut(fullCommand, event);
2631 - };
2632 - $e.shortcuts.register(shortcut.keys, shortcut);
2633 - }
2634 - return this;
2635 - }
2636 - },
2637 - {
2638 - key: "unregister",
2639 - value: function unregister(component, command) {
2640 - var namespace;
2641 - if ("string" === typeof component) {
2642 - namespace = component;
2643 - component = $e.components.get(namespace);
2644 - if (!component) this.error("'".concat(namespace, "' component is not exist."));
2645 - } else namespace = component.getNamespace();
2646 - var fullCommand = namespace + (command ? "/" + command : "");
2647 - if (!this.commands[fullCommand]) this.error("`".concat(fullCommand, "` not exist."));
2648 - delete this.commands[fullCommand];
2649 - delete this.components[fullCommand];
2650 - var shortcut = component.getShortcuts()[command];
2651 - if (shortcut) $e.shortcuts.unregister(shortcut.keys, shortcut);
2652 - return this;
2653 - }
2654 - },
2655 - {
2656 - key: "getComponent",
2657 - value: function getComponent(command) {
2658 - var namespace = this.components[command];
2659 - return $e.components.get(namespace);
2660 - }
2661 - },
2662 - {
2663 - key: "is",
2664 - value: function is(command) {
2665 - var component = this.getComponent(command);
2666 - if (!component) return false;
2667 - return command === this.current[component.getServiceName()];
2668 - }
2669 - },
2670 - {
2671 - key: "isCurrentFirstTrace",
2672 - value: function isCurrentFirstTrace(command) {
2673 - return command === this.getCurrentFirstTrace();
2674 - }
2675 - },
2676 - {
2677 - key: "getCurrent",
2678 - value: function getCurrent() {
2679 - var container = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
2680 - if (container) {
2681 - if (!this.current[container]) return false;
2682 - return this.current[container];
2683 - }
2684 - return this.current;
2685 - }
2686 - },
2687 - {
2688 - key: "getCurrentArgs",
2689 - value: function getCurrentArgs() {
2690 - var container = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
2691 - if (container) {
2692 - if (!this.currentArgs[container]) return false;
2693 - return this.currentArgs[container];
2694 - }
2695 - return this.currentArgs;
2696 - }
2697 - },
2698 - {
2699 - key: "getCurrentFirst",
2700 - value: function getCurrentFirst() {
2701 - return Object.values(this.current)[0];
2702 - }
2703 - },
2704 - {
2705 - key: "getCurrentLast",
2706 - value: function getCurrentLast() {
2707 - var current = Object.values(this.current);
2708 - return current[current.length - 1];
2709 - }
2710 - },
2711 - {
2712 - key: "getCurrentFirstTrace",
2713 - value: function getCurrentFirstTrace() {
2714 - return this.currentTrace[0];
2715 - }
2716 - },
2717 - {
2718 - key: "beforeRun",
2719 - value: function beforeRun(command) {
2720 - var args = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
2721 - var addTrace = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : true;
2722 - var component = this.getComponent(command);
2723 - var container = component.getServiceName();
2724 - if (addTrace) this.addCurrentTrace(container, command, args);
2725 - if (args.onBefore) args.onBefore.apply(component, [args]);
2726 - this.trigger("run:before", component, command, args);
2727 - window.dispatchEvent(new CustomEvent("elementor/commands/run/before", { detail: {
2728 - command,
2729 - args
2730 - } }));
2731 - }
2732 - },
2733 - {
2734 - key: "validateRun",
2735 - value: function validateRun(command) {
2736 - var args = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
2737 - if (!this.commands[command]) this.error("`".concat(command, "` not found."));
2738 - return this.getComponent(command).dependency(command, args);
2739 - }
2740 - },
2741 - {
2742 - key: "run",
2743 - value: function run(command) {
2744 - var args = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
2745 - if (!this.validateRun(command, args)) return false;
2746 - this.beforeRun(command, args);
2747 - var context = this.commands[command];
2748 - if (context.getInstanceType) context = new context(args);
2749 - var currentComponent = this.getComponent(command);
2750 - if (!(context instanceof CommandBase)) {
2751 - var results = context.apply(currentComponent, [args]);
2752 - this.afterRun(command, args, results);
2753 - return results;
2754 - }
2755 - if (!this.validateInstanceScope(context, currentComponent, command)) return this.removeCurrentTrace(currentComponent);
2756 - return this.runInstance(context);
2757 - }
2758 - },
2759 - {
2760 - key: "runInstance",
2761 - value: function runInstance(instance) {
2762 - var results = null;
2763 - instance.onBeforeRun(instance.args);
2764 - try {
2765 - instance.onBeforeApply(instance.args);
2766 - results = instance.run();
2767 - } catch (e) {
2768 - this.catchApply(e, instance);
2769 - if (e instanceof $e.modules.HookBreak) {
2770 - this.removeCurrentTrace(instance.component);
2771 - return false;
2772 - }
2773 - }
2774 - return this.applyRunAfter(instance, results);
2775 - }
2776 - },
2777 - {
2778 - key: "applyRunAfter",
2779 - value: function applyRunAfter(instance, result) {
2780 - var _this3 = this;
2781 - if (result && "object" === _typeof(result) && result.promise && result.then && result.fail) return function handleJQueryDeferred(_result) {
2782 - _result.fail(function(e) {
2783 - _this3.catchApply(e, instance);
2784 - _this3.afterRun(instance.command, instance.args, e);
2785 - });
2786 - return _result.done(function(__result) {
2787 - return _this3.applyRunAfterAsyncResult(instance, __result);
2788 - });
2789 - }(result);
2790 - else if (result instanceof Promise) return this.applyRunAfterAsync(instance, result);
2791 - this.applyRunAfterSync(instance, result);
2792 - return result;
2793 - }
2794 - },
2795 - {
2796 - key: "applyRunAfterSync",
2797 - value: function applyRunAfterSync(instance, result) {
2798 - instance.onAfterApply(instance.args, result);
2799 - instance.onAfterRun(instance.args, result);
2800 - this.afterRun(instance.command, instance.args, result);
2801 - }
2802 - },
2803 - {
2804 - key: "applyRunAfterAsync",
2805 - value: function applyRunAfterAsync(instance, result) {
2806 - var _this4 = this;
2807 - return _asyncToGenerator(/*#__PURE__*/ import_regenerator.default.mark(function _callee() {
2808 - return import_regenerator.default.wrap(function(_context) {
2809 - while (1) switch (_context.prev = _context.next) {
2810 - case 0:
2811 - _context.next = 1;
2812 - return result.catch(function(e) {
2813 - _this4.catchApply(e, instance);
2814 - _this4.afterRun(instance.command, instance.args, e);
2815 - });
2816 - case 1:
2817 - _context.next = 2;
2818 - return result.then(function(_result) {
2819 - return _this4.applyRunAfterAsyncResult(instance, _result);
2820 - });
2821 - case 2: return _context.abrupt("return", result);
2822 - case 3:
2823 - case "end": return _context.stop();
2824 - }
2825 - }, _callee);
2826 - }))();
2827 - }
2828 - },
2829 - {
2830 - key: "applyRunAfterAsyncResult",
2831 - value: function() {
2832 - var _applyRunAfterAsyncResult = _asyncToGenerator(/*#__PURE__*/ import_regenerator.default.mark(function _callee2(instance, result) {
2833 - var results;
2834 - var promises;
2835 - return import_regenerator.default.wrap(function(_context2) {
2836 - while (1) switch (_context2.prev = _context2.next) {
2837 - case 0:
2838 - results = instance.onAfterApply(instance.args, result), promises = Array.isArray(results) ? results.flat().filter(function(filtered) {
2839 - return filtered instanceof Promise;
2840 - }) : [];
2841 - if (!promises.length) {
2842 - _context2.next = 1;
2843 - break;
2844 - }
2845 - _context2.next = 1;
2846 - return Promise.all(promises);
2847 - case 1:
2848 - instance.onAfterRun(instance.args, result);
2849 - this.afterRun(instance.command, instance.args, result);
2850 - case 2:
2851 - case "end": return _context2.stop();
2852 - }
2853 - }, _callee2, this);
2854 - }));
2855 - function applyRunAfterAsyncResult(_x, _x2) {
2856 - return _applyRunAfterAsyncResult.apply(this, arguments);
2857 - }
2858 - return applyRunAfterAsyncResult;
2859 - }()
2860 - },
2861 - {
2862 - key: "afterRun",
2863 - value: function afterRun(command, args) {
2864 - var results = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : void 0;
2865 - var removeTrace = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : true;
2866 - var component = this.getComponent(command);
2867 - if (args.onAfter) args.onAfter.apply(component, [args, results]);
2868 - this.trigger("run:after", component, command, args, results);
2869 - window.dispatchEvent(new CustomEvent("elementor/commands/run/after", { detail: {
2870 - command,
2871 - args
2872 - } }));
2873 - if (removeTrace) this.removeCurrentTrace(component);
2874 - }
2875 - },
2876 - {
2877 - key: "catchApply",
2878 - value: function catchApply(e, instance) {
2879 - instance.onCatchApply(e);
2880 - Console.error(e);
2881 - }
2882 - },
2883 - {
2884 - key: "runShortcut",
2885 - value: function runShortcut(command, event) {
2886 - return this.run(command, event);
2887 - }
2888 - },
2889 - {
2890 - key: "validateInstanceScope",
2891 - value: function validateInstanceScope(instance, currentComponent, command) {
2892 - if (!(instance instanceof CommandBase)) this.error("invalid instance, command: '".concat(command, "' "));
2893 - if (currentComponent !== instance.component) {
2894 - if ($e.devTools) $e.devTools.log.warn("Command: '".concat(command, "' registerArgs.component: '").concat(instance.component.getNamespace(), "' while current component is: '").concat(currentComponent.getNamespace(), "'"));
2895 - return false;
2896 - }
2897 - return true;
2898 - }
2899 - },
2900 - {
2901 - key: "addCurrentTrace",
2902 - value: function addCurrentTrace(container, command, args) {
2903 - this.currentTrace.push(command);
2904 - Commands.trace.push(command);
2905 - this.attachCurrent(container, command, args);
2906 - }
2907 - },
2908 - {
2909 - key: "removeCurrentTrace",
2910 - value: function removeCurrentTrace(currentComponent) {
2911 - var container = currentComponent.getServiceName();
2912 - this.currentTrace.pop();
2913 - Commands.trace.pop();
2914 - this.detachCurrent(container);
2915 - }
2916 - },
2917 - {
2918 - key: "attachCurrent",
2919 - value: function attachCurrent(container, command, args) {
2920 - this.current[container] = command;
2921 - this.currentArgs[container] = args;
2922 - }
2923 - },
2924 - {
2925 - key: "detachCurrent",
2926 - value: function detachCurrent(container) {
2927 - delete this.current[container];
2928 - delete this.currentArgs[container];
2929 - }
2930 - },
2931 - {
2932 - key: "error",
2933 - value: function error(message) {
2934 - throw Error("Commands: ".concat(message));
2935 - }
2936 - }
2937 - ]);
2938 - }(CommandsBackwardsCompatibility);
2939 - _defineProperty(Commands, "trace", []);
3261 +"use strict";
2940 3262
2941 -//#endregion
2942 -//#region modules/web-cli/assets/js/core/commands-internal.js
2943 - function _callSuper$21(t, o, e) {
2944 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$21() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
2945 - }
2946 - __name(_callSuper$21, "_callSuper");
2947 - function _isNativeReflectConstruct$21() {
2948 - try {
2949 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
2950 - } catch (t) {}
2951 - return (_isNativeReflectConstruct$21 = function _isNativeReflectConstruct() {
2952 - return !!t;
2953 - })();
2954 - }
2955 - __name(_isNativeReflectConstruct$21, "_isNativeReflectConstruct");
2956 - var CommandsInternal = /*#__PURE__*/ function(_Commands) {
2957 - function CommandsInternal() {
2958 - _classCallCheck(this, CommandsInternal);
2959 - return _callSuper$21(this, CommandsInternal, arguments);
2960 - }
2961 - _inherits(CommandsInternal, _Commands);
2962 - return _createClass(CommandsInternal, [{
2963 - key: "error",
2964 - value: function error(message) {
2965 - throw Error("Commands internal: " + message);
2966 - }
2967 - }]);
2968 - }(Commands);
2969 3263
2970 -//#endregion
2971 -//#region modules/web-cli/assets/js/modules/commands/close.js
2972 - function _callSuper$20(t, o, e) {
2973 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$20() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
2974 - }
2975 - __name(_callSuper$20, "_callSuper");
2976 - function _isNativeReflectConstruct$20() {
2977 - try {
2978 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
2979 - } catch (t) {}
2980 - return (_isNativeReflectConstruct$20 = function _isNativeReflectConstruct() {
2981 - return !!t;
2982 - })();
2983 - }
2984 - __name(_isNativeReflectConstruct$20, "_isNativeReflectConstruct");
2985 - var Close = /*#__PURE__*/ function(_CommandBase) {
2986 - function Close() {
2987 - _classCallCheck(this, Close);
2988 - return _callSuper$20(this, Close, arguments);
2989 - }
2990 - _inherits(Close, _CommandBase);
2991 - return _createClass(Close, [{
2992 - key: "apply",
2993 - value: function apply() {
2994 - this.component.close();
2995 - }
2996 - }]);
2997 - }(CommandBase);
3264 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
3265 +Object.defineProperty(exports, "__esModule", ({
3266 + value: true
3267 +}));
3268 +exports["default"] = void 0;
3269 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
3270 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
3271 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
3272 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
3273 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
3274 +var _module = _interopRequireDefault(__webpack_require__(/*! elementor-assets-js/modules/imports/module.js */ "../assets/dev/js/modules/imports/module.js"));
3275 +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); }; }
3276 +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; } }
3277 +/**
3278 + * @typedef {{}} Component
3279 + */
3280 +var _default = /*#__PURE__*/function (_Module) {
3281 + (0, _inherits2.default)(_default, _Module);
3282 + var _super = _createSuper(_default);
3283 + function _default() {
3284 + var _this;
3285 + (0, _classCallCheck2.default)(this, _default);
3286 + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
3287 + args[_key] = arguments[_key];
3288 + }
3289 + _this = _super.call.apply(_super, [this].concat(args));
3290 + _this.components = {};
3291 + _this.activeComponents = {};
3292 + return _this;
3293 + }
3294 + (0, _createClass2.default)(_default, [{
3295 + key: "getAll",
3296 + value: function getAll() {
3297 + return Object.keys(this.components).sort();
3298 + }
3299 + }, {
3300 + key: "register",
3301 + value: function register(component) {
3302 + if (this.components[component.getNamespace()]) {
3303 + return;
3304 + }
3305 + component.registerAPI();
3306 + this.components[component.getNamespace()] = component;
3307 + return component;
3308 + }
2998 3309
2999 -//#endregion
3000 -//#region modules/web-cli/assets/js/modules/commands/open.js
3001 - function _callSuper$19(t, o, e) {
3002 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$19() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
3003 - }
3004 - __name(_callSuper$19, "_callSuper");
3005 - function _isNativeReflectConstruct$19() {
3006 - try {
3007 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
3008 - } catch (t) {}
3009 - return (_isNativeReflectConstruct$19 = function _isNativeReflectConstruct() {
3010 - return !!t;
3011 - })();
3012 - }
3013 - __name(_isNativeReflectConstruct$19, "_isNativeReflectConstruct");
3014 - var Open = /*#__PURE__*/ function(_CommandBase) {
3015 - function Open() {
3016 - _classCallCheck(this, Open);
3017 - return _callSuper$19(this, Open, arguments);
3018 - }
3019 - _inherits(Open, _CommandBase);
3020 - return _createClass(Open, [{
3021 - key: "apply",
3022 - value: function apply() {
3023 - $e.route(this.component.getNamespace());
3024 - }
3025 - }]);
3026 - }(CommandBase);
3310 + /**
3311 + * @param {string} id
3312 + * @return {Component} component
3313 + */
3314 + }, {
3315 + key: "get",
3316 + value: function get(id) {
3317 + return this.components[id];
3318 + }
3319 + }, {
3320 + key: "getActive",
3321 + value: function getActive() {
3322 + return this.activeComponents;
3323 + }
3324 + }, {
3325 + key: "activate",
3326 + value: function activate(namespace) {
3327 + // Add as last.
3328 + this.inactivate(namespace);
3329 + this.activeComponents[namespace] = true;
3330 + }
3331 + }, {
3332 + key: "inactivate",
3333 + value: function inactivate(namespace) {
3334 + delete this.activeComponents[namespace];
3335 + }
3336 + }, {
3337 + key: "isActive",
3338 + value: function isActive(namespace) {
3339 + return !!this.activeComponents[namespace];
3340 + }
3341 + }]);
3342 + return _default;
3343 +}(_module.default);
3344 +exports["default"] = _default;
3027 3345
3028 -//#endregion
3029 -//#region modules/web-cli/assets/js/modules/commands/toggle.js
3030 - function _callSuper$18(t, o, e) {
3031 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$18() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
3032 - }
3033 - __name(_callSuper$18, "_callSuper");
3034 - function _isNativeReflectConstruct$18() {
3035 - try {
3036 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
3037 - } catch (t) {}
3038 - return (_isNativeReflectConstruct$18 = function _isNativeReflectConstruct() {
3039 - return !!t;
3040 - })();
3041 - }
3042 - __name(_isNativeReflectConstruct$18, "_isNativeReflectConstruct");
3043 - var Toggle = /*#__PURE__*/ function(_CommandBase) {
3044 - function Toggle() {
3045 - _classCallCheck(this, Toggle);
3046 - return _callSuper$18(this, Toggle, arguments);
3047 - }
3048 - _inherits(Toggle, _CommandBase);
3049 - return _createClass(Toggle, [{
3050 - key: "apply",
3051 - value: function apply() {
3052 - if (this.component.isOpen) this.component.close();
3053 - else $e.route(this.component.getNamespace());
3054 - }
3055 - }]);
3056 - }(CommandBase);
3346 +/***/ }),
3057 3347
3058 -//#endregion
3059 -//#region modules/web-cli/assets/js/modules/commands/index.js
3060 - var commands_exports = /* @__PURE__ */ __exportAll({
3061 - Close: () => Close,
3062 - Open: () => Open,
3063 - Toggle: () => Toggle
3064 - });
3348 +/***/ "../modules/web-cli/assets/js/core/data.js":
3349 +/*!*************************************************!*\
3350 + !*** ../modules/web-cli/assets/js/core/data.js ***!
3351 + \*************************************************/
3352 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
3065 3353
3066 -//#endregion
3067 -//#region modules/web-cli/assets/js/modules/component-modal-base.js
3068 - function _callSuper$17(t, o, e) {
3069 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$17() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
3070 - }
3071 - __name(_callSuper$17, "_callSuper");
3072 - function _isNativeReflectConstruct$17() {
3073 - try {
3074 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
3075 - } catch (t) {}
3076 - return (_isNativeReflectConstruct$17 = function _isNativeReflectConstruct() {
3077 - return !!t;
3078 - })();
3079 - }
3080 - __name(_isNativeReflectConstruct$17, "_isNativeReflectConstruct");
3081 - function _superPropGet$4(t, o, e, r) {
3082 - var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e);
3083 - return 2 & r && "function" == typeof p ? function(t) {
3084 - return p.apply(e, t);
3085 - } : p;
3086 - }
3087 - __name(_superPropGet$4, "_superPropGet");
3088 - var ComponentModalBase = /*#__PURE__*/ function(_ComponentBase) {
3089 - function ComponentModalBase() {
3090 - _classCallCheck(this, ComponentModalBase);
3091 - return _callSuper$17(this, ComponentModalBase, arguments);
3092 - }
3093 - _inherits(ComponentModalBase, _ComponentBase);
3094 - return _createClass(ComponentModalBase, [
3095 - {
3096 - key: "registerAPI",
3097 - value: function registerAPI() {
3098 - var _this = this;
3099 - _superPropGet$4(ComponentModalBase, "registerAPI", this, 3)([]);
3100 - $e.shortcuts.register("esc", {
3101 - scopes: [this.getNamespace()],
3102 - callback: function callback() {
3103 - return _this.close();
3104 - }
3105 - });
3106 - }
3107 - },
3108 - {
3109 - key: "defaultCommands",
3110 - value: function defaultCommands() {
3111 - return this.importCommands(commands_exports);
3112 - }
3113 - },
3114 - {
3115 - key: "defaultRoutes",
3116 - value: function defaultRoutes() {
3117 - return { "": function _() {} };
3118 - }
3119 - },
3120 - {
3121 - key: "open",
3122 - value: function open() {
3123 - var _this2 = this;
3124 - if (!this.layout) {
3125 - var layout = this.getModalLayout();
3126 - this.layout = new layout({ component: this });
3127 - this.layout.getModal().on("hide", function() {
3128 - return _this2.close();
3129 - });
3130 - }
3131 - this.layout.showModal();
3132 - return true;
3133 - }
3134 - },
3135 - {
3136 - key: "close",
3137 - value: function close() {
3138 - if (!_superPropGet$4(ComponentModalBase, "close", this, 3)([])) return false;
3139 - elementor.hooks.applyFilters("component/modal/close", this.layout.getModal().hide.bind(this.layout.getModal()), this)();
3140 - return true;
3141 - }
3142 - },
3143 - {
3144 - key: "getModalLayout",
3145 - value: function getModalLayout() {
3146 - force_method_implementation_default();
3147 - }
3148 - }
3149 - ]);
3150 - }(ComponentBase);
3354 +"use strict";
3151 3355
3152 -//#endregion
3153 -//#region modules/web-cli/assets/js/core/components.js
3154 - function _callSuper$16(t, o, e) {
3155 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$16() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
3156 - }
3157 - __name(_callSuper$16, "_callSuper");
3158 - function _isNativeReflectConstruct$16() {
3159 - try {
3160 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
3161 - } catch (t) {}
3162 - return (_isNativeReflectConstruct$16 = function _isNativeReflectConstruct() {
3163 - return !!t;
3164 - })();
3165 - }
3166 - __name(_isNativeReflectConstruct$16, "_isNativeReflectConstruct");
3167 - /**
3168 - * @typedef {{}} Component
3169 - */
3170 - var _default = /*#__PURE__*/ function(_Module) {
3171 - function _default() {
3172 - var _this;
3173 - _classCallCheck(this, _default);
3174 - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];
3175 - _this = _callSuper$16(this, _default, [].concat(args));
3176 - _this.components = {};
3177 - _this.activeComponents = {};
3178 - return _this;
3179 - }
3180 - _inherits(_default, _Module);
3181 - return _createClass(_default, [
3182 - {
3183 - key: "getAll",
3184 - value: function getAll() {
3185 - return Object.keys(this.components).sort();
3186 - }
3187 - },
3188 - {
3189 - key: "register",
3190 - value: function register(component) {
3191 - if (this.components[component.getNamespace()]) return;
3192 - component.registerAPI();
3193 - this.components[component.getNamespace()] = component;
3194 - return component;
3195 - }
3196 - },
3197 - {
3198 - key: "get",
3199 - value: function get(id) {
3200 - return this.components[id];
3201 - }
3202 - },
3203 - {
3204 - key: "getActive",
3205 - value: function getActive() {
3206 - return this.activeComponents;
3207 - }
3208 - },
3209 - {
3210 - key: "activate",
3211 - value: function activate(namespace) {
3212 - this.inactivate(namespace);
3213 - this.activeComponents[namespace] = true;
3214 - }
3215 - },
3216 - {
3217 - key: "inactivate",
3218 - value: function inactivate(namespace) {
3219 - delete this.activeComponents[namespace];
3220 - }
3221 - },
3222 - {
3223 - key: "isActive",
3224 - value: function isActive(namespace) {
3225 - return !!this.activeComponents[namespace];
3226 - }
3227 - }
3228 - ]);
3229 - }(import_module.default);
3230 3356
3231 -//#endregion
3232 -//#region modules/web-cli/assets/js/core/data/storages/base-storage.js
3357 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
3358 +Object.defineProperty(exports, "__esModule", ({
3359 + value: true
3360 +}));
3361 +exports["default"] = exports.READABLE = exports.EDITABLE = exports.DELETABLE = exports.CREATABLE = exports.ALLMETHODS = void 0;
3362 +var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ "../node_modules/@babel/runtime/regenerator/index.js"));
3363 +var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "../node_modules/@babel/runtime/helpers/asyncToGenerator.js"));
3364 +var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js"));
3365 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
3366 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
3367 +var _assertThisInitialized2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ "../node_modules/@babel/runtime/helpers/assertThisInitialized.js"));
3368 +var _get2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/get */ "../node_modules/@babel/runtime/helpers/get.js"));
3369 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
3370 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
3371 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
3372 +var _argsObject = _interopRequireDefault(__webpack_require__(/*! elementor-assets-js/modules/imports/args-object */ "../assets/dev/js/modules/imports/args-object.js"));
3373 +var _commands = _interopRequireDefault(__webpack_require__(/*! ./commands.js */ "../modules/web-cli/assets/js/core/commands.js"));
3374 +var _cache = _interopRequireDefault(__webpack_require__(/*! ./data/cache */ "../modules/web-cli/assets/js/core/data/cache.js"));
3375 +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); }; }
3376 +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 3377 /**
3234 - * TODO: Merge all storage's to one.
3235 - * Using this technique give's the ability to use JSDOC from 'window.storage'.
3236 - *
3237 - * @implements {Storage}
3238 - */
3239 - var BaseStorage = /*#__PURE__*/ function() {
3240 - /**
3241 - * Create storage wrapper.
3242 - *
3243 - * @param {Storage} provider
3244 - */
3245 - function BaseStorage(provider) {
3246 - _classCallCheck(this, BaseStorage);
3247 - if (BaseStorage === (this instanceof BaseStorage ? this.constructor : void 0)) throw new TypeError("Cannot construct BaseStorage instances directly");
3248 - this.provider = provider;
3249 - }
3250 - return _createClass(BaseStorage, [
3251 - {
3252 - key: "clear",
3253 - value: function clear() {
3254 - return this.provider.clear();
3255 - }
3256 - },
3257 - {
3258 - key: "getItem",
3259 - value: function getItem(key) {
3260 - var result = this.provider.getItem(key);
3261 - if (null !== result) return JSON.parse(result);
3262 - return result;
3263 - }
3264 - },
3265 - {
3266 - key: "key",
3267 - value: function key(index) {
3268 - return this.provider.key(index);
3269 - }
3270 - },
3271 - {
3272 - key: "removeItem",
3273 - value: function removeItem(key) {
3274 - return this.provider.removeItem(key);
3275 - }
3276 - },
3277 - {
3278 - key: "setItem",
3279 - value: function setItem(key, value) {
3280 - return this.provider.setItem(key, JSON.stringify(value));
3281 - }
3282 - },
3283 - {
3284 - key: "getAll",
3285 - value: function getAll() {
3286 - var _this = this;
3287 - var keys = Object.keys(this.provider);
3288 - var result = {};
3289 - keys.forEach(function(key) {
3290 - result[key] = _this.getItem(key);
3291 - });
3292 - return result;
3293 - }
3294 - }
3295 - ]);
3296 - }();
3378 + * @typedef {('create'|'delete'|'get'|'update'|'options')} DataTypes
3379 + */
3380 +/**
3381 + * @typedef {import('../modules/component-base')} ComponentBase
3382 + */
3383 +/**
3384 + * @typedef {{}} RequestInfo
3385 + */
3297 3386
3298 -//#endregion
3299 -//#region modules/web-cli/assets/js/core/data/storages/base-prefix-storage.js
3300 - function _callSuper$15(t, o, e) {
3301 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$15() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
3302 - }
3303 - __name(_callSuper$15, "_callSuper");
3304 - function _isNativeReflectConstruct$15() {
3305 - try {
3306 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
3307 - } catch (t) {}
3308 - return (_isNativeReflectConstruct$15 = function _isNativeReflectConstruct() {
3309 - return !!t;
3310 - })();
3311 - }
3312 - __name(_isNativeReflectConstruct$15, "_isNativeReflectConstruct");
3313 - function _superPropGet$3(t, o, e, r) {
3314 - var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e);
3315 - return 2 & r && "function" == typeof p ? function(t) {
3316 - return p.apply(e, t);
3317 - } : p;
3318 - }
3319 - __name(_superPropGet$3, "_superPropGet");
3320 - var BasePrefixStorage = /*#__PURE__*/ function(_BaseStorage) {
3321 - function BasePrefixStorage() {
3322 - _classCallCheck(this, BasePrefixStorage);
3323 - return _callSuper$15(this, BasePrefixStorage, arguments);
3324 - }
3325 - _inherits(BasePrefixStorage, _BaseStorage);
3326 - return _createClass(BasePrefixStorage, [
3327 - {
3328 - key: "clear",
3329 - value: function clear() {
3330 - var _this = this;
3331 - Object.keys(this.getAll()).forEach(function(key) {
3332 - return _this.removeItem(key);
3333 - });
3334 - }
3335 - },
3336 - {
3337 - key: "getItem",
3338 - value: function getItem(key) {
3339 - return _superPropGet$3(BasePrefixStorage, "getItem", this, 3)([BasePrefixStorage.DEFAULT_KEY_PREFIX + key]);
3340 - }
3341 - },
3342 - {
3343 - key: "removeItem",
3344 - value: function removeItem(key) {
3345 - return _superPropGet$3(BasePrefixStorage, "removeItem", this, 3)([BasePrefixStorage.DEFAULT_KEY_PREFIX + key]);
3346 - }
3347 - },
3348 - {
3349 - key: "setItem",
3350 - value: function setItem(key, value) {
3351 - return _superPropGet$3(BasePrefixStorage, "setItem", this, 3)([BasePrefixStorage.DEFAULT_KEY_PREFIX + key, value]);
3352 - }
3353 - },
3354 - {
3355 - key: "getAll",
3356 - value: function getAll() {
3357 - var _this2 = this;
3358 - var DEFAULT_KEY_PREFIX = BasePrefixStorage.DEFAULT_KEY_PREFIX;
3359 - var keys = Object.keys(this.provider);
3360 - var result = {};
3361 - keys.forEach(function(key) {
3362 - if (key.startsWith(DEFAULT_KEY_PREFIX)) {
3363 - key = key.replace(DEFAULT_KEY_PREFIX, "");
3364 - result[key] = _this2.getItem(key);
3365 - }
3366 - });
3367 - return result;
3368 - }
3369 - }
3370 - ]);
3371 - }(BaseStorage);
3372 - _defineProperty(BasePrefixStorage, "DEFAULT_KEY_PREFIX", "e_");
3387 +/**
3388 + * @typedef {{}} RequestData
3389 + * @property {ComponentBase} component component
3390 + * @property {string} command command
3391 + * @property {{}} args arguments
3392 + * @property {DataTypes} type type
3393 + * @property {number} timestamp timestamp
3394 + * @property {string} endpoint endpoint
3395 + *
3396 + * @property {string} [baseEndpointURL] baseEndpointURL
3397 + * @property {string} [namespace] namespace
3398 + * @property {string} [version] version
3399 + * @property {('hit'|'miss')} [cache] cache
3400 + */
3373 3401
3374 -//#endregion
3375 -//#region modules/web-cli/assets/js/core/data/storages/local-storage.js
3376 - function _callSuper$14(t, o, e) {
3377 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$14() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
3378 - }
3379 - __name(_callSuper$14, "_callSuper");
3380 - function _isNativeReflectConstruct$14() {
3381 - try {
3382 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
3383 - } catch (t) {}
3384 - return (_isNativeReflectConstruct$14 = function _isNativeReflectConstruct() {
3385 - return !!t;
3386 - })();
3387 - }
3388 - __name(_isNativeReflectConstruct$14, "_isNativeReflectConstruct");
3389 - var LocalStorage = /*#__PURE__*/ function(_BasePrefixStorage) {
3390 - function LocalStorage() {
3391 - _classCallCheck(this, LocalStorage);
3392 - return _callSuper$14(this, LocalStorage, [localStorage]);
3393 - }
3394 - _inherits(LocalStorage, _BasePrefixStorage);
3395 - return _createClass(LocalStorage, [{
3396 - key: "debug",
3397 - value: function debug() {
3398 - var entries = this.getAll();
3399 - var ordered = {};
3400 - Object.keys(entries).sort().forEach(function(key) {
3401 - ordered[key] = entries[key];
3402 - });
3403 - return ordered;
3404 - }
3405 - }]);
3406 - }(BasePrefixStorage);
3402 +/**
3403 + * @typedef {Object} ExtractedCommand
3404 + * @property {string} command command
3405 + * @property {Object} args arguments
3406 + */
3407 3407
3408 -//#endregion
3409 -//#region modules/web-cli/assets/js/core/data/cache.js
3410 - init_typeof();
3411 - /**
3412 - * @typedef {{}} RequestData
3413 - */
3414 - /**
3415 - * @typedef {import('../data')} Data
3416 - */
3417 - /**
3418 - * TODO: Search common logic, create functions to reduce code size.
3419 - */
3420 - var Cache = /*#__PURE__*/ function() {
3421 - /**
3422 - * Function constructor().
3423 - *
3424 - * Create cache.
3425 - *
3426 - * @param {Data} manager
3427 - */
3428 - function Cache(manager) {
3429 - _classCallCheck(this, Cache);
3430 - this.manager = manager;
3431 - this.storage = new LocalStorage();
3432 - }
3433 - /**
3434 - * Function getAsync().
3435 - *
3436 - * Receive from cache. the difference between getAsync() and get() is that receive return it as promise...
3437 - * to fake fetch mechanism.
3438 - *
3439 - * @param {RequestData} requestData
3440 - *
3441 - * @return {(Promise|boolean)} request data
3442 - */
3443 - return _createClass(Cache, [
3444 - {
3445 - key: "getAsync",
3446 - value: function getAsync(requestData) {
3447 - var data = this.get(requestData);
3448 - if (null !== data) {
3449 - requestData.cache = "hit";
3450 - return new Promise(function(resolve) {
3451 - resolve(data);
3452 - });
3453 - }
3454 - return false;
3455 - }
3456 - },
3457 - {
3458 - key: "set",
3459 - value: function set(requestData, data) {
3460 - $e.data.validateRequestData(requestData);
3461 - var componentName = requestData.component.getNamespace();
3462 - var pureEndpoint = requestData.endpoint.replace(componentName + "/", "");
3463 - var pureEndpointParts = pureEndpoint.split("/");
3464 - var newData = {};
3465 - if (pureEndpointParts.length && pureEndpoint !== componentName) {
3466 - var result = pureEndpointParts.reduce(function(accumulator, pureEndpointPart) {
3467 - accumulator[pureEndpointPart] = {};
3468 - return accumulator[pureEndpointPart];
3469 - }, newData);
3470 - Object.assign(result, data);
3471 - } else newData = data;
3472 - var oldData = this.storage.getItem(componentName);
3473 - if (oldData !== null) newData = jQuery.extend(true, oldData, newData);
3474 - this.storage.setItem(componentName, newData);
3475 - }
3476 - },
3477 - {
3478 - key: "get",
3479 - value: function get(requestData) {
3480 - $e.data.validateRequestData(requestData);
3481 - var componentName = requestData.component.getNamespace();
3482 - var componentData = this.storage.getItem(componentName);
3483 - if (componentData !== null) {
3484 - if (componentName === requestData.endpoint) return componentData;
3485 - return requestData.endpoint.replace(requestData.component.getNamespace() + "/", "").split("/").reduce(function(accumulator, endpointPart) {
3486 - if (accumulator && accumulator[endpointPart]) return accumulator[endpointPart];
3487 - }, componentData) || null;
3488 - }
3489 - return null;
3490 - }
3491 - },
3492 - {
3493 - key: "update",
3494 - value: function update(requestData) {
3495 - $e.data.validateRequestData(requestData, true);
3496 - var endpoint = requestData.endpoint;
3497 - var response = {};
3498 - Object.entries(this.storage.getAll()).forEach(function(_ref) {
3499 - var _ref2 = _slicedToArray(_ref, 2);
3500 - var endpointKey = _ref2[0];
3501 - var endpointValue = _ref2[1];
3502 - if (endpointValue && endpoint.includes(endpointKey)) {
3503 - var oldData = endpointValue;
3504 - var pureEndpointParts = requestData.endpoint.replace(requestData.component.getNamespace() + "/", "").split("/");
3505 - if (1 === pureEndpointParts.length && endpointKey === requestData.endpoint && endpointKey === requestData.component.getNamespace()) response = jQuery.extend(true, oldData, requestData.args.data);
3506 - else {
3507 - var oldSpecificData = pureEndpointParts.reduce(function(accumulator, pureEndpointPart) {
3508 - return accumulator[pureEndpointPart];
3509 - }, oldData);
3510 - response = jQuery.extend(true, oldSpecificData, requestData.args.data);
3511 - }
3512 - }
3513 - });
3514 - if (0 === Object.values(response).length) return false;
3515 - this.set(requestData, response);
3516 - return true;
3517 - }
3518 - },
3519 - {
3520 - key: "delete",
3521 - value: function _delete(requestData) {
3522 - $e.data.validateRequestData(requestData);
3523 - var result = false;
3524 - var componentName = requestData.component.getNamespace();
3525 - if (componentName !== requestData.endpoint) {
3526 - var oldData = this.storage.getItem(componentName);
3527 - var newData = {};
3528 - if (null === oldData) return false;
3529 - var pureEndpointParts = requestData.endpoint.replace(componentName + "/", "").split("/");
3530 - var lastEndpointPart = pureEndpointParts[pureEndpointParts.length - 1];
3531 - pureEndpointParts.reduce(function(accumulator, pureEndpointPart) {
3532 - if (pureEndpointPart === lastEndpointPart) accumulator[pureEndpointPart] = null;
3533 - else accumulator[pureEndpointPart] = {};
3534 - return accumulator[pureEndpointPart];
3535 - }, newData);
3536 - if (Object.keys(oldData).length) {
3537 - var _deleteKeys = function deleteKeys(target, nullsObject) {
3538 - if (nullsObject) Object.keys(nullsObject).forEach(function(key) {
3539 - if (nullsObject[key] && "object" === _typeof(nullsObject[key])) _deleteKeys(target[key], nullsObject[key]);
3540 - else if (null === nullsObject[key]) {
3541 - delete target[key];
3542 - result = true;
3543 - }
3544 - });
3545 - else Object.keys(target).forEach(function(key) {
3546 - return delete target[key];
3547 - });
3548 - return target;
3549 - };
3550 - this.storage.setItem(componentName, _deleteKeys(oldData, newData));
3551 - }
3552 - } else for (var key in this.storage.getAll()) if (key === requestData.endpoint) {
3553 - this.storage.removeItem(requestData.endpoint);
3554 - result = true;
3555 - break;
3556 - }
3557 - return result;
3558 - }
3559 - }
3560 - ]);
3561 - }();
3408 +// TODO: Return it from the server. Original at WP_REST_Server.
3409 +var READABLE = ['GET'],
3410 + CREATABLE = ['POST'],
3411 + EDITABLE = ['POST', 'PUT', 'PATCH'],
3412 + DELETABLE = ['DELETE'],
3413 + ALLMETHODS = ['GET', 'POST', 'PUT', 'PATCH', 'DELETE'];
3414 +exports.ALLMETHODS = ALLMETHODS;
3415 +exports.DELETABLE = DELETABLE;
3416 +exports.EDITABLE = EDITABLE;
3417 +exports.CREATABLE = CREATABLE;
3418 +exports.READABLE = READABLE;
3419 +var Data = /*#__PURE__*/function (_Commands) {
3420 + (0, _inherits2.default)(Data, _Commands);
3421 + var _super = _createSuper(Data);
3422 + function Data() {
3423 + var _this;
3424 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
3425 + (0, _classCallCheck2.default)(this, Data);
3426 + _this = _super.call(this, args);
3427 + _this.args = Object.assign(args, {
3428 + namespace: 'elementor',
3429 + version: '1',
3430 + baseEndpointURL: elementorWebCliConfig.urls.rest
3431 + });
3432 + _this.cache = new _cache.default((0, _assertThisInitialized2.default)(_this));
3433 + _this.validatedRequests = {};
3434 + _this.commandFormats = {};
3435 + return _this;
3436 + }
3562 3437
3563 -//#endregion
3564 -//#region modules/web-cli/assets/js/core/data.js
3565 - function _callSuper$13(t, o, e) {
3566 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$13() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
3567 - }
3568 - __name(_callSuper$13, "_callSuper");
3569 - function _isNativeReflectConstruct$13() {
3570 - try {
3571 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
3572 - } catch (t) {}
3573 - return (_isNativeReflectConstruct$13 = function _isNativeReflectConstruct() {
3574 - return !!t;
3575 - })();
3576 - }
3577 - __name(_isNativeReflectConstruct$13, "_isNativeReflectConstruct");
3578 - function _superPropGet$2(t, o, e, r) {
3579 - var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e);
3580 - return 2 & r && "function" == typeof p ? function(t) {
3581 - return p.apply(e, t);
3582 - } : p;
3583 - }
3584 - __name(_superPropGet$2, "_superPropGet");
3585 - /**
3586 - * @typedef {('create'|'delete'|'get'|'update'|'options')} DataTypes
3587 - */
3588 - /**
3589 - * @typedef {import('../modules/component-base')} ComponentBase
3590 - */
3591 - /**
3592 - * @typedef {{}} RequestInfo
3593 - */
3594 - /**
3595 - * @typedef {{}} RequestData
3596 - * @property {ComponentBase} component component
3597 - * @property {string} command command
3598 - * @property {{}} args arguments
3599 - * @property {DataTypes} type type
3600 - * @property {number} timestamp timestamp
3601 - * @property {string} endpoint endpoint
3602 - *
3603 - * @property {string} [baseEndpointURL] baseEndpointURL
3604 - * @property {string} [namespace] namespace
3605 - * @property {string} [version] version
3606 - * @property {('hit'|'miss')} [cache] cache
3607 - */
3608 - /**
3609 - * @typedef {Object} ExtractedCommand
3610 - * @property {string} command command
3611 - * @property {Object} args arguments
3612 - */
3613 - var READABLE = ["GET"];
3614 - var CREATABLE = ["POST"];
3615 - var EDITABLE = [
3616 - "POST",
3617 - "PUT",
3618 - "PATCH"
3619 - ];
3620 - var DELETABLE = ["DELETE"];
3621 - var Data$1 = /*#__PURE__*/ function(_Commands) {
3622 - function Data() {
3623 - var _this;
3624 - var args = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
3625 - _classCallCheck(this, Data);
3626 - _this = _callSuper$13(this, Data, [args]);
3627 - _this.args = Object.assign(args, {
3628 - namespace: "elementor",
3629 - version: "1",
3630 - baseEndpointURL: elementorWebCliConfig.urls.rest
3631 - });
3632 - _this.cache = new Cache(_this);
3633 - _this.validatedRequests = {};
3634 - _this.commandFormats = {};
3635 - return _this;
3636 - }
3637 - /**
3638 - * Function getHTTPMethod().
3639 - *
3640 - * Returns HTTP Method by type.
3641 - *
3642 - * @param {DataTypes} type
3643 - *
3644 - * @return {string|boolean} HTTP Method
3645 - */
3646 - _inherits(Data, _Commands);
3647 - return _createClass(Data, [
3648 - {
3649 - key: "getHTTPMethod",
3650 - value: function getHTTPMethod(type) {
3651 - switch (type) {
3652 - case "create": return "POST";
3653 - case "delete": return "DELETE";
3654 - case "get": return "GET";
3655 - case "update": return "PUT";
3656 - case "options": return "OPTIONS";
3657 - }
3658 - return false;
3659 - }
3660 - },
3661 - {
3662 - key: "getAllowedMethods",
3663 - value: function getAllowedMethods(type) {
3664 - switch (type) {
3665 - case "create": return CREATABLE;
3666 - case "delete": return DELETABLE;
3667 - case "get": return READABLE;
3668 - case "update": return EDITABLE;
3669 - case "options": return ["OPTIONS"];
3670 - }
3671 - return false;
3672 - }
3673 - },
3674 - {
3675 - key: "getEndpointURL",
3676 - value: function getEndpointURL(requestData) {
3677 - var endpoint = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : requestData.endpoint;
3678 - var _requestData$baseEndp = requestData.baseEndpointURL;
3679 - var baseEndpointURL = _requestData$baseEndp === void 0 ? this.args.baseEndpointURL : _requestData$baseEndp;
3680 - var _requestData$namespac = requestData.namespace;
3681 - var namespace = _requestData$namespac === void 0 ? this.args.namespace : _requestData$namespac;
3682 - var _requestData$version = requestData.version;
3683 - var version = _requestData$version === void 0 ? this.args.version : _requestData$version;
3684 - return "".concat(baseEndpointURL).concat(namespace, "/v").concat(version, "/") + endpoint;
3685 - }
3686 - },
3687 - {
3688 - key: "commandToEndpoint",
3689 - value: function commandToEndpoint(command, args) {
3690 - var format = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null;
3691 - var endpoint = command;
3692 - if ((args !== null && args !== void 0 && args.query ? Object.values(args.query).length : 0) && format && format.includes("/{")) format.split("/").filter(function(str) {
3693 - return "{" === str.charAt(0);
3694 - }).forEach(function(param) {
3695 - param = param.replace("{", "");
3696 - param = param.replace("}", "");
3697 - var formatted = Object.entries(args.query).find(function(_ref) {
3698 - return _slicedToArray(_ref, 1)[0] === param;
3699 - });
3700 - if (!formatted) return;
3701 - var key = formatted[0];
3702 - var value = formatted[1].toString();
3703 - format = format.replace(new RegExp("{" + param + "}", "g"), value);
3704 - delete args.query[key];
3705 - });
3706 - if (format) endpoint = format;
3707 - if (format && endpoint.includes("/{")) endpoint = endpoint.substring(0, endpoint.indexOf("/{"));
3708 - if (args.query && Object.values(args.query).length) {
3709 - var queryEntries = Object.entries(args.query).sort(function(_ref3, _ref4) {
3710 - return _slicedToArray(_ref3, 1)[0] - _slicedToArray(_ref4, 1)[0];
3711 - });
3712 - if (queryEntries.length) {
3713 - endpoint += "?";
3714 - queryEntries.forEach(function(_ref7) {
3715 - var _ref8 = _slicedToArray(_ref7, 2);
3716 - var name = _ref8[0];
3717 - var value = _ref8[1];
3718 - value = "".concat(value).replace(/\//g, "%2F");
3719 - endpoint += name + "=" + value + "&";
3720 - });
3721 - }
3722 - endpoint = endpoint.replace(/&$/, "");
3723 - }
3724 - return endpoint;
3725 - }
3726 - },
3727 - {
3728 - key: "commandExtractArgs",
3729 - value: function commandExtractArgs(command) {
3730 - var _command;
3731 - var args = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
3732 - if ((_command = command) !== null && _command !== void 0 && _command.includes("?")) {
3733 - if (!args.query) args.query = {};
3734 - var commandParts = command.split("?");
3735 - var pureCommand = commandParts[0];
3736 - var queryString = commandParts[1];
3737 - var query = new URLSearchParams(queryString);
3738 - Object.assign(args.query, Object.fromEntries(query));
3739 - command = pureCommand;
3740 - }
3741 - return {
3742 - command,
3743 - args
3744 - };
3745 - }
3746 - },
3747 - {
3748 - key: "validateRequestData",
3749 - value: function validateRequestData(requestData) {
3750 - var requireArgsData = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
3751 - if (requestData.timestamp && this.validatedRequests[requestData.timestamp]) return;
3752 - var argsObject = new ArgsObject(requestData);
3753 - argsObject.requireArgument("component");
3754 - argsObject.requireArgumentType("command", "string");
3755 - argsObject.requireArgumentType("endpoint", "string");
3756 - if (requireArgsData) argsObject.requireArgumentType("data", "object", requestData.args);
3757 - if (!requestData.timestamp) requestData.timestamp = (/* @__PURE__ */ new Date()).getTime();
3758 - this.validatedRequests[requestData.timestamp] = true;
3759 - }
3760 - },
3761 - {
3762 - key: "prepareHeaders",
3763 - value: function prepareHeaders(requestData) {
3764 - var _requestData$args;
3765 - var type = requestData.type;
3766 - var nonce = elementorWebCliConfig.nonce;
3767 - var params = {
3768 - signal: (_requestData$args = requestData.args) === null || _requestData$args === void 0 || (_requestData$args = _requestData$args.options) === null || _requestData$args === void 0 ? void 0 : _requestData$args.signal,
3769 - credentials: "include"
3770 - };
3771 - var headers = { "X-WP-Nonce": nonce };
3772 - /**
3773 - * Translate:
3774 - * 'create, delete, get, update' to HTTP Methods:
3775 - * 'GET, POST, PUT, PATCH, DELETE'
3776 - */
3777 - var allowedMethods = this.getAllowedMethods(type);
3778 - var method = this.getHTTPMethod(type);
3779 - if ("GET" === method) Object.assign(params, { headers });
3780 - else if (allowedMethods) {
3781 - var _requestData$args2;
3782 - var _requestData$args3;
3783 - if (["POST", "PUT"].includes(method) && !((_requestData$args2 = requestData.args) !== null && _requestData$args2 !== void 0 && _requestData$args2.data)) throw Error("Invalid requestData.args.data");
3784 - Object.assign(headers, { "Content-Type": "application/json" });
3785 - if ((_requestData$args3 = requestData.args) !== null && _requestData$args3 !== void 0 && _requestData$args3.headers) Object.assign(headers, requestData.args.headers);
3786 - Object.assign(params, {
3787 - method,
3788 - headers,
3789 - body: "application/json" === headers["Content-Type"] ? JSON.stringify(requestData.args.data) : requestData.args.data
3790 - });
3791 - } else throw Error("Invalid type: '".concat(type, "'"));
3792 - return params;
3793 - }
3794 - },
3795 - {
3796 - key: "prepareEndpoint",
3797 - value: function prepareEndpoint(requestData) {
3798 - var splitEndpoint = requestData.endpoint.split("?");
3799 - var endpoint = splitEndpoint.shift();
3800 - var endpointAddress = this.getEndpointURL(requestData, endpoint);
3801 - if (splitEndpoint.length) {
3802 - var separator = endpointAddress.includes("?") ? "&" : "?";
3803 - endpointAddress += separator + splitEndpoint.pop();
3804 - }
3805 - return endpointAddress;
3806 - }
3807 - },
3808 - {
3809 - key: "fetch",
3810 - value: function fetch(requestData) {
3811 - var _requestData$args$opt;
3812 - var _this2 = this;
3813 - var fetchAPI = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : window.fetch;
3814 - requestData.cache = "miss";
3815 - var refresh = (_requestData$args$opt = requestData.args.options) === null || _requestData$args$opt === void 0 ? void 0 : _requestData$args$opt.refresh;
3816 - var getCache = "get" === requestData.type && !refresh;
3817 - var saveCache = ["create", "get"].includes(requestData.type) && !refresh;
3818 - if (getCache) {
3819 - var cachePromise = this.cache.getAsync(requestData);
3820 - if (cachePromise) return cachePromise;
3821 - }
3822 - var params = this.prepareHeaders(requestData);
3823 - return new Promise(/*#__PURE__*/ function() {
3824 - var _ref9 = _asyncToGenerator(/*#__PURE__*/ import_regenerator.default.mark(function _callee2(resolve, reject) {
3825 - var endpoint;
3826 - var request;
3827 - var response;
3828 - var _t;
3829 - return import_regenerator.default.wrap(function(_context2) {
3830 - while (1) switch (_context2.prev = _context2.next) {
3831 - case 0:
3832 - _context2.prev = 0;
3833 - endpoint = _this2.prepareEndpoint(requestData);
3834 - request = fetchAPI(endpoint, params);
3835 - _context2.next = 1;
3836 - return request.then(/*#__PURE__*/ function() {
3837 - var _ref0 = _asyncToGenerator(/*#__PURE__*/ import_regenerator.default.mark(function _callee(_response) {
3838 - return import_regenerator.default.wrap(function(_context) {
3839 - while (1) switch (_context.prev = _context.next) {
3840 - case 0:
3841 - if (_response.ok) {
3842 - _context.next = 3;
3843 - break;
3844 - }
3845 - if (!_response.headers.get("content-type").includes("application/json")) {
3846 - _context.next = 2;
3847 - break;
3848 - }
3849 - _context.next = 1;
3850 - return _response.json();
3851 - case 1: _response = _context.sent;
3852 - case 2: throw _response;
3853 - case 3: return _context.abrupt("return", _response.json());
3854 - case 4:
3855 - case "end": return _context.stop();
3856 - }
3857 - }, _callee);
3858 - }));
3859 - return function(_x3) {
3860 - return _ref0.apply(this, arguments);
3861 - };
3862 - }());
3863 - case 1:
3864 - response = _context2.sent;
3865 - if (saveCache) _this2.cache.set(requestData, response);
3866 - resolve(response);
3867 - _context2.next = 3;
3868 - break;
3869 - case 2:
3870 - _context2.prev = 2;
3871 - _t = _context2["catch"](0);
3872 - reject(_t);
3873 - case 3:
3874 - case "end": return _context2.stop();
3875 - }
3876 - }, _callee2, null, [[0, 2]]);
3877 - }));
3878 - return function(_x, _x2) {
3879 - return _ref9.apply(this, arguments);
3880 - };
3881 - }());
3882 - }
3883 - },
3884 - {
3885 - key: "getCache",
3886 - value: function getCache(component, command) {
3887 - var args = { query: arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {} };
3888 - return this.cache.get({
3889 - endpoint: this.commandToEndpoint(command, args, this.commandFormats[command]),
3890 - component,
3891 - command,
3892 - args
3893 - });
3894 - }
3895 - },
3896 - {
3897 - key: "setCache",
3898 - value: function setCache(component, command, query, data) {
3899 - var args = { query };
3900 - this.cache.set({
3901 - endpoint: this.commandToEndpoint(command, args, this.commandFormats[command]),
3902 - component,
3903 - command,
3904 - args
3905 - }, data);
3906 - }
3907 - },
3908 - {
3909 - key: "updateCache",
3910 - value: function updateCache(component, command, query, data) {
3911 - var args = {
3912 - query,
3913 - data
3914 - };
3915 - this.cache.update({
3916 - endpoint: this.commandToEndpoint(command, args, this.commandFormats[command]),
3917 - component,
3918 - command,
3919 - args
3920 - });
3921 - }
3922 - },
3923 - {
3924 - key: "deleteCache",
3925 - value: function deleteCache(component, command) {
3926 - var args = { query: arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {} };
3927 - this.cache.delete({
3928 - endpoint: this.commandToEndpoint(command, args, this.commandFormats[command]),
3929 - component,
3930 - command,
3931 - args
3932 - });
3933 - }
3934 - },
3935 - {
3936 - key: "registerFormat",
3937 - value: function registerFormat(command, format) {
3938 - this.commandFormats[command] = format;
3939 - }
3940 - },
3941 - {
3942 - key: "create",
3943 - value: function create(command, data) {
3944 - var query = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
3945 - var options = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
3946 - return this.run("create", command, {
3947 - query,
3948 - options,
3949 - data
3950 - });
3951 - }
3952 - },
3953 - {
3954 - key: "delete",
3955 - value: function _delete(command) {
3956 - var query = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
3957 - var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
3958 - return this.run("delete", command, {
3959 - query,
3960 - options
3961 - });
3962 - }
3963 - },
3964 - {
3965 - key: "get",
3966 - value: function get(command) {
3967 - var query = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
3968 - var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
3969 - return this.run("get", command, {
3970 - query,
3971 - options
3972 - });
3973 - }
3974 - },
3975 - {
3976 - key: "update",
3977 - value: function update(command, data) {
3978 - var query = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
3979 - var options = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {};
3980 - return this.run("update", command, {
3981 - query,
3982 - options,
3983 - data
3984 - });
3985 - }
3986 - },
3987 - {
3988 - key: "options",
3989 - value: function options(command, query) {
3990 - var _options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {};
3991 - return this.run("options", command, {
3992 - query,
3993 - options: _options
3994 - });
3995 - }
3996 - },
3997 - {
3998 - key: "register",
3999 - value: function register(component, command, callback) {
4000 - _superPropGet$2(Data, "register", this, 3)([
4001 - component,
4002 - command,
4003 - callback
4004 - ]);
4005 - var fullCommandName = component.getNamespace() + "/" + command;
4006 - var commandInstance = $e.data.getCommandClass(fullCommandName);
4007 - var format = commandInstance !== null && commandInstance !== void 0 && commandInstance.getEndpointFormat ? commandInstance.getEndpointFormat() : false;
4008 - if (format) $e.data.registerFormat(fullCommandName, format);
4009 - return this;
4010 - }
4011 - },
4012 - {
4013 - key: "run",
4014 - value: function run(type, command, args) {
4015 - args.options.type = type;
4016 - var _this$commandExtractA = this.commandExtractArgs(command, args);
4017 - command = _this$commandExtractA.command;
4018 - args = _this$commandExtractA.args;
4019 - return _superPropGet$2(Data, "run", this, 3)([command, args]);
4020 - }
4021 - },
4022 - {
4023 - key: "error",
4024 - value: function error(message) {
4025 - throw Error("Data commands: " + message);
4026 - }
4027 - }
4028 - ]);
4029 - }(Commands);
3438 + /**
3439 + * Function getHTTPMethod().
3440 + *
3441 + * Returns HTTP Method by type.
3442 + *
3443 + * @param {DataTypes} type
3444 + *
3445 + * @return {string|boolean} HTTP Method
3446 + */
3447 + (0, _createClass2.default)(Data, [{
3448 + key: "getHTTPMethod",
3449 + value: function getHTTPMethod(type) {
3450 + switch (type) {
3451 + case 'create':
3452 + return 'POST';
3453 + case 'delete':
3454 + return 'DELETE';
3455 + case 'get':
3456 + return 'GET';
3457 + case 'update':
3458 + return 'PUT';
3459 + case 'options':
3460 + return 'OPTIONS';
3461 + }
3462 + return false;
3463 + }
4030 3464
4031 -//#endregion
4032 -//#region modules/web-cli/assets/js/extras/hash-commands.js
4033 - function _createForOfIteratorHelper(r, e) {
4034 - var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
4035 - if (!t) {
4036 - if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) {
4037 - t && (r = t);
4038 - var _n = 0;
4039 - var F = function F() {};
4040 - return {
4041 - s: F,
4042 - n: function n() {
4043 - return _n >= r.length ? { done: !0 } : {
4044 - done: !1,
4045 - value: r[_n++]
4046 - };
4047 - },
4048 - e: function e(r) {
4049 - throw r;
4050 - },
4051 - f: F
4052 - };
4053 - }
4054 - throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
4055 - }
4056 - var o;
4057 - var a = !0;
4058 - var u = !1;
4059 - return {
4060 - s: function s() {
4061 - t = t.call(r);
4062 - },
4063 - n: function n() {
4064 - var r = t.next();
4065 - return a = r.done, r;
4066 - },
4067 - e: function e(r) {
4068 - u = !0, o = r;
4069 - },
4070 - f: function f() {
4071 - try {
4072 - a || null == t.return || t.return();
4073 - } finally {
4074 - if (u) throw o;
4075 - }
4076 - }
4077 - };
4078 - }
4079 - function _unsupportedIterableToArray(r, a) {
4080 - if (r) {
4081 - if ("string" == typeof r) return _arrayLikeToArray(r, a);
4082 - var t = {}.toString.call(r).slice(8, -1);
4083 - return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
4084 - }
4085 - }
4086 - function _arrayLikeToArray(r, a) {
4087 - (null == a || a > r.length) && (a = r.length);
4088 - for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
4089 - return n;
4090 - }
4091 - var HashCommands = /*#__PURE__*/ function() {
4092 - function HashCommands() {
4093 - _classCallCheck(this, HashCommands);
4094 - /**
4095 - * Cannot be static since it uses callback(s) that are available only after '$e' is initialized.
4096 - */
4097 - _defineProperty(this, "dispatchersList", {
4098 - "e:run": {
4099 - runner: function runner() {
4100 - return $e.run;
4101 - },
4102 - isSafe: function isSafe(command) {
4103 - var _$e$commands$getComma;
4104 - return (_$e$commands$getComma = $e.commands.getCommandClass(command)) === null || _$e$commands$getComma === void 0 ? void 0 : _$e$commands$getComma.getInfo().isSafe;
4105 - },
4106 - isSafeWithArgs: function isSafeWithArgs(command) {
4107 - var _$e$commands$getComma2;
4108 - return (_$e$commands$getComma2 = $e.commands.getCommandClass(command)) === null || _$e$commands$getComma2 === void 0 ? void 0 : _$e$commands$getComma2.getInfo().isSafeWithArgs;
4109 - }
4110 - },
4111 - "e:route": {
4112 - runner: function runner() {
4113 - return $e.route;
4114 - },
4115 - isSafe: function isSafe() {
4116 - return true;
4117 - },
4118 - isSafeWithArgs: function isSafeWithArgs() {
4119 - return false;
4120 - }
4121 - }
4122 - });
4123 - /**
4124 - * @typedef HashCommand
4125 - * @property {string} method method
4126 - * @property {string} command command
4127 - * @property {Object} args arguments
4128 - */
4129 - /**
4130 - * List of current loaded hash commands.
4131 - *
4132 - * @type {Array.<HashCommand>}
4133 - */
4134 - _defineProperty(this, "commands", []);
4135 - this.commands = this.get();
4136 - }
4137 - /**
4138 - * Function get().
4139 - *
4140 - * Get API requests that comes from hash ( eg #e:run ).
4141 - *
4142 - * @param {string} hash
4143 - *
4144 - * @return {Array.<HashCommand>} API requests
4145 - */
4146 - return _createClass(HashCommands, [
4147 - {
4148 - key: "get",
4149 - value: function get() {
4150 - var _this = this;
4151 - var hash = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : location.hash;
4152 - var result = [];
4153 - if (hash) hash.substr(1).split("&").forEach(function(hashItem) {
4154 - var _hashItem$split2 = _slicedToArray(hashItem.split("?"), 2);
4155 - var rawCommand = _hashItem$split2[0];
4156 - var rawArgs = _hashItem$split2[1];
4157 - var hashParts = rawCommand.split(":");
4158 - if (3 !== hashParts.length) return;
4159 - var method = hashParts[0] + ":" + hashParts[1];
4160 - if (_this.dispatchersList[method]) {
4161 - var command = hashParts[2];
4162 - var args = _this.parseCommandArgs(rawArgs);
4163 - result.push({
4164 - method,
4165 - command,
4166 - args
4167 - });
4168 - }
4169 - });
4170 - return result;
4171 - }
4172 - },
4173 - {
4174 - key: "run",
4175 - value: function() {
4176 - var _run = _asyncToGenerator(/*#__PURE__*/ import_regenerator.default.mark(function _callee() {
4177 - var commands;
4178 - var _iterator;
4179 - var _step;
4180 - var hashCommand;
4181 - var dispatcher;
4182 - var _iterator2;
4183 - var _step2;
4184 - var _hashCommand;
4185 - var _dispatcher;
4186 - var _args = arguments;
4187 - var _t;
4188 - var _t2;
4189 - return import_regenerator.default.wrap(function(_context) {
4190 - while (1) switch (_context.prev = _context.next) {
4191 - case 0:
4192 - commands = _args.length > 0 && _args[0] !== void 0 ? _args[0] : this.commands;
4193 - _iterator = _createForOfIteratorHelper(commands);
4194 - _context.prev = 1;
4195 - _iterator.s();
4196 - case 2:
4197 - if ((_step = _iterator.n()).done) {
4198 - _context.next = 5;
4199 - break;
4200 - }
4201 - hashCommand = _step.value;
4202 - dispatcher = this.dispatchersList[hashCommand.method];
4203 - if (dispatcher) {
4204 - _context.next = 3;
4205 - break;
4206 - }
4207 - return _context.abrupt("return", Promise.reject(new Error("No dispatcher found for the command: `".concat(hashCommand.command, "`."))));
4208 - case 3:
4209 - if (dispatcher.isSafe(hashCommand.command)) {
4210 - _context.next = 4;
4211 - break;
4212 - }
4213 - return _context.abrupt("return", Promise.reject(new Error("Attempting to run unsafe or non exist command: `".concat(hashCommand.command, "`."))));
4214 - case 4:
4215 - _context.next = 2;
4216 - break;
4217 - case 5:
4218 - _context.next = 7;
4219 - break;
4220 - case 6:
4221 - _context.prev = 6;
4222 - _t = _context["catch"](1);
4223 - _iterator.e(_t);
4224 - case 7:
4225 - _context.prev = 7;
4226 - _iterator.f();
4227 - return _context.finish(7);
4228 - case 8:
4229 - _iterator2 = _createForOfIteratorHelper(commands);
4230 - _context.prev = 9;
4231 - _iterator2.s();
4232 - case 10:
4233 - if ((_step2 = _iterator2.n()).done) {
4234 - _context.next = 12;
4235 - break;
4236 - }
4237 - _hashCommand = _step2.value;
4238 - _dispatcher = this.dispatchersList[_hashCommand.method];
4239 - _context.next = 11;
4240 - return _dispatcher.runner()(_hashCommand.command, _dispatcher.isSafeWithArgs(_hashCommand.command) ? _hashCommand.args : void 0);
4241 - case 11:
4242 - _context.next = 10;
4243 - break;
4244 - case 12:
4245 - _context.next = 14;
4246 - break;
4247 - case 13:
4248 - _context.prev = 13;
4249 - _t2 = _context["catch"](9);
4250 - _iterator2.e(_t2);
4251 - case 14:
4252 - _context.prev = 14;
4253 - _iterator2.f();
4254 - return _context.finish(14);
4255 - case 15:
4256 - case "end": return _context.stop();
4257 - }
4258 - }, _callee, this, [[
4259 - 1,
4260 - 6,
4261 - 7,
4262 - 8
4263 - ], [
4264 - 9,
4265 - 13,
4266 - 14,
4267 - 15
4268 - ]]);
4269 - }));
4270 - function run() {
4271 - return _run.apply(this, arguments);
4272 - }
4273 - return run;
4274 - }()
4275 - },
4276 - {
4277 - key: "runOnce",
4278 - value: function runOnce() {
4279 - var _this2 = this;
4280 - this.run(this.commands).then(function() {
4281 - _this2.commands = [];
4282 - });
4283 - }
4284 - },
4285 - {
4286 - key: "parseCommandArgs",
4287 - value: function parseCommandArgs(rawArgs) {
4288 - try {
4289 - return JSON.parse(decodeURI(rawArgs || "{}"));
4290 - } catch (e) {
4291 - Console.warn("Hash commands JSON args cannot be parsed. \n\n", e);
4292 - return {};
4293 - }
4294 - }
4295 - }
4296 - ]);
4297 - }();
3465 + /**
3466 + * Function getAllowedMethods().
3467 + *
3468 + * Returns allowed HTTP methods by type.
3469 + *
3470 + * @param {DataTypes} type
3471 + *
3472 + * @return {[string]|boolean} allowed HTTP methods
3473 + */
3474 + }, {
3475 + key: "getAllowedMethods",
3476 + value: function getAllowedMethods(type) {
3477 + switch (type) {
3478 + case 'create':
3479 + return CREATABLE;
3480 + case 'delete':
3481 + return DELETABLE;
3482 + case 'get':
3483 + return READABLE;
3484 + case 'update':
3485 + return EDITABLE;
3486 + case 'options':
3487 + return ['OPTIONS'];
3488 + }
3489 + return false;
3490 + }
4298 3491
4299 -//#endregion
4300 -//#region modules/web-cli/assets/js/modules/hook-break.js
4301 - function _callSuper$12(t, o, e) {
4302 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$12() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
4303 - }
4304 - __name(_callSuper$12, "_callSuper");
4305 - function _isNativeReflectConstruct$12() {
4306 - try {
4307 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
4308 - } catch (t) {}
4309 - return (_isNativeReflectConstruct$12 = function _isNativeReflectConstruct() {
4310 - return !!t;
4311 - })();
4312 - }
4313 - __name(_isNativeReflectConstruct$12, "_isNativeReflectConstruct");
4314 - var HookBreak = /*#__PURE__*/ function(_Error) {
4315 - function HookBreak() {
4316 - _classCallCheck(this, HookBreak);
4317 - return _callSuper$12(this, HookBreak, ["HookBreak"]);
4318 - }
4319 - _inherits(HookBreak, _Error);
4320 - return _createClass(HookBreak);
4321 - }(/*#__PURE__*/ _wrapNativeSuper(Error));
3492 + /**
3493 + * Function getEndpointURL().
3494 + *
3495 + * Get remote endpoint address.
3496 + *
3497 + * @param {RequestData} requestData
3498 + * @param {string} [endpoint=requestData.endpoint]
3499 + *
3500 + * @return {string} endpoint address
3501 + */
3502 + }, {
3503 + key: "getEndpointURL",
3504 + value: function getEndpointURL(requestData) {
3505 + var endpoint = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : requestData.endpoint;
3506 + // Allow to request data override default namespace and args.
3507 + var _requestData$baseEndp = requestData.baseEndpointURL,
3508 + baseEndpointURL = _requestData$baseEndp === void 0 ? this.args.baseEndpointURL : _requestData$baseEndp,
3509 + _requestData$namespac = requestData.namespace,
3510 + namespace = _requestData$namespac === void 0 ? this.args.namespace : _requestData$namespac,
3511 + _requestData$version = requestData.version,
3512 + version = _requestData$version === void 0 ? this.args.version : _requestData$version;
3513 + return "".concat(baseEndpointURL).concat(namespace, "/v").concat(version, "/") + endpoint;
3514 + }
4322 3515
4323 -//#endregion
4324 -//#region modules/web-cli/assets/js/core/hooks/base.js
4325 - function _callSuper$11(t, o, e) {
4326 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$11() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
4327 - }
4328 - __name(_callSuper$11, "_callSuper");
4329 - function _isNativeReflectConstruct$11() {
4330 - try {
4331 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
4332 - } catch (t) {}
4333 - return (_isNativeReflectConstruct$11 = function _isNativeReflectConstruct() {
4334 - return !!t;
4335 - })();
4336 - }
4337 - __name(_isNativeReflectConstruct$11, "_isNativeReflectConstruct");
4338 - /**
4339 - * @typedef {import('../../modules/hook-base')} HookBase
4340 - */
4341 - var HooksBase = /*#__PURE__*/ function(_Module) {
4342 - /**
4343 - * Function constructor().
4344 - *
4345 - * Create hooks base.
4346 - *
4347 - * @param {{}} args
4348 - */
4349 - function HooksBase() {
4350 - var _this;
4351 - _classCallCheck(this, HooksBase);
4352 - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];
4353 - _this = _callSuper$11(this, HooksBase, [].concat(args));
4354 - /**
4355 - * Current command.
4356 - *
4357 - * @type {string}
4358 - */
4359 - _this.current = "";
4360 - /**
4361 - * Array of ids which in use.
4362 - *
4363 - * @type {Array}
4364 - */
4365 - _this.usedIds = [];
4366 - /**
4367 - * Object of callbacks that was bound by container type.
4368 - *
4369 - * @type {{}}
4370 - */
4371 - _this.callbacks = {
4372 - after: {},
4373 - catch: {}
4374 - };
4375 - /**
4376 - * Object of depth.
4377 - *
4378 - * @type {{}}
4379 - */
4380 - _this.depth = {
4381 - after: {},
4382 - catch: {}
4383 - };
4384 - _this.callbacksFlatList = {};
4385 - return _this;
4386 - }
4387 - _inherits(HooksBase, _Module);
4388 - return _createClass(HooksBase, [
4389 - {
4390 - key: "activate",
4391 - value: function activate() {
4392 - Object.values(this.getAll(true)).forEach(function(callback) {
4393 - callback.activate();
4394 - });
4395 - }
4396 - },
4397 - {
4398 - key: "deactivate",
4399 - value: function deactivate() {
4400 - Object.values(this.getAll(true)).forEach(function(callback) {
4401 - callback.deactivate();
4402 - });
4403 - }
4404 - },
4405 - {
4406 - key: "getType",
4407 - value: function getType() {
4408 - force_method_implementation_default();
4409 - }
4410 - },
4411 - {
4412 - key: "get",
4413 - value: function get(id) {
4414 - return this.callbacksFlatList[id];
4415 - }
4416 - },
4417 - {
4418 - key: "getAll",
4419 - value: function getAll() {
4420 - var _this2 = this;
4421 - if (arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false) return this.callbacksFlatList;
4422 - var result = {};
4423 - Object.keys(this.callbacks).forEach(function(event) {
4424 - if (!result[event]) result[event] = [];
4425 - Object.keys(_this2.callbacks[event]).forEach(function(command) {
4426 - result[event].push({
4427 - command,
4428 - callbacks: _this2.callbacks[event][command]
4429 - });
4430 - });
4431 - });
4432 - return result;
4433 - }
4434 - },
4435 - {
4436 - key: "getCurrent",
4437 - value: function getCurrent() {
4438 - return this.current;
4439 - }
4440 - },
4441 - {
4442 - key: "getUsedIds",
4443 - value: function getUsedIds() {
4444 - return this.usedIds;
4445 - }
4446 - },
4447 - {
4448 - key: "getCallbacks",
4449 - value: function getCallbacks(event, command, args) {
4450 - var _args$containers = args.containers;
4451 - var containers = _args$containers === void 0 ? [args.container] : _args$containers;
4452 - var containerType = containers[0] ? containers[0].type : false;
4453 - var callbacks = [];
4454 - if (this.callbacks[event] && this.callbacks[event][command]) {
4455 - if (containerType && this.callbacks[event][command][containerType]) callbacks = callbacks.concat(this.callbacks[event][command][containerType]);
4456 - if (this.callbacks[event][command].all) callbacks = callbacks.concat(this.callbacks[event][command].all);
4457 - }
4458 - if (callbacks.length) return callbacks;
4459 - return false;
4460 - }
4461 - },
4462 - {
4463 - key: "checkEvent",
4464 - value: function checkEvent(event) {
4465 - if (-1 === Object.keys(this.callbacks).indexOf(event)) throw Error("".concat(this.getType(), ": '").concat(event, "' is not available."));
4466 - }
4467 - },
4468 - {
4469 - key: "checkInstance",
4470 - value: function checkInstance(instance) {
4471 - if (instance.getType() !== this.getType()) throw new Error("invalid instance, please use: 'elementor-api/modules/hook-base.js'. ");
4472 - }
4473 - },
4474 - {
4475 - key: "checkId",
4476 - value: function checkId(id) {
4477 - if (-1 !== this.usedIds.indexOf(id)) throw Error("id: '".concat(id, "' is already in use."));
4478 - }
4479 - },
4480 - {
4481 - key: "shouldRun",
4482 - value: function shouldRun(callbacks) {
4483 - return !!callbacks && callbacks.length;
4484 - }
4485 - },
4486 - {
4487 - key: "register",
4488 - value: function register(event, instance) {
4489 - var command = instance.getCommand();
4490 - var id = instance.getId();
4491 - var containerType = instance.getContainerType();
4492 - this.checkEvent(event);
4493 - this.checkInstance(instance);
4494 - this.checkId(id);
4495 - return this.registerCallback(id, event, command, instance, containerType);
4496 - }
4497 - },
4498 - {
4499 - key: "registerCallback",
4500 - value: function registerCallback(id, event, command, instance, containerType) {
4501 - if (!this.callbacks[event][command]) this.callbacks[event][command] = [];
4502 - this.usedIds.push(id);
4503 - if (!this.callbacks[event][command]) this.callbacks[event][command] = {};
4504 - var callback = {
4505 - id,
4506 - callback: instance.run.bind(instance),
4507 - isActive: true,
4508 - activate: function activate() {
4509 - this.isActive = true;
4510 - },
4511 - deactivate: function deactivate() {
4512 - this.isActive = false;
4513 - }
4514 - };
4515 - if (containerType) {
4516 - if (!this.callbacks[event][command][containerType]) this.callbacks[event][command][containerType] = [];
4517 - this.callbacks[event][command][containerType].push(callback);
4518 - } else {
4519 - if (!this.callbacks[event][command].all) this.callbacks[event][command].all = [];
4520 - this.callbacks[event][command].all.push(callback);
4521 - }
4522 - this.callbacksFlatList[callback.id] = callback;
4523 - return callback;
4524 - }
4525 - },
4526 - {
4527 - key: "run",
4528 - value: function run(event, command, args) {
4529 - var result = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : void 0;
4530 - var callbacks = this.getCallbacks(event, command, args);
4531 - if (this.shouldRun(callbacks)) {
4532 - this.current = command;
4533 - this.onRun(command, args, event);
4534 - return this.runCallbacks(event, command, callbacks, args, result);
4535 - }
4536 - return false;
4537 - }
4538 - },
4539 - {
4540 - key: "runCallbacks",
4541 - value: function runCallbacks(event, command, callbacks, args, result) {
4542 - var callbacksResult = [];
4543 - for (var i in callbacks) {
4544 - var callback = callbacks[i];
4545 - if (!callback.isActive) continue;
4546 - if (void 0 === this.depth[event][callback.id]) this.depth[event][callback.id] = 0;
4547 - this.depth[event][callback.id]++;
4548 - if (1 === this.depth[event][callback.id]) {
4549 - this.onCallback(command, args, event, callback.id);
4550 - try {
4551 - var callbackResult = this.runCallback(event, callback, args, result);
4552 - if (!callbackResult) throw Error("Callback failed, event: '".concat(event, "'"));
4553 - callbacksResult.push(callbackResult);
4554 - } catch (e) {
4555 - if (e instanceof $e.modules.HookBreak) throw e;
4556 - Console.error(e);
4557 - }
4558 - }
4559 - this.depth[event][callback.id]--;
4560 - }
4561 - return callbacksResult;
4562 - }
4563 - },
4564 - {
4565 - key: "runCallback",
4566 - value: function runCallback(event, callback, args, result) {
4567 - force_method_implementation_default();
4568 - }
4569 - },
4570 - {
4571 - key: "onRun",
4572 - value: function onRun(command, args, event) {
4573 - force_method_implementation_default();
4574 - }
4575 - },
4576 - {
4577 - key: "onCallback",
4578 - value: function onCallback(command, args, event, id) {
4579 - force_method_implementation_default();
4580 - }
4581 - }
4582 - ]);
4583 - }(import_module.default);
3516 + /**
3517 + * Function commandToEndpoint().
3518 + *
3519 + * Convert command to endpoint.
3520 + *
3521 + * For example `component/command/{arg}` => `controller/endpoint/8`.
3522 + *
3523 + * TODO: Find a better solution.
3524 + *
3525 + * @param {string} command
3526 + * @param {{}} args
3527 + * @param {string|null} [format]
3528 + *
3529 + * @return {string} endpoint
3530 + */
3531 + }, {
3532 + key: "commandToEndpoint",
3533 + value: function commandToEndpoint(command, args) {
3534 + var format = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
3535 + var endpoint = command;
3536 + var argsQueryLength = args !== null && args !== void 0 && args.query ? Object.values(args.query).length : 0;
3537 + if (argsQueryLength && format && format.includes('/{')) {
3538 + // Means command includes magic query arguments ( controller/endpoint/{whatever} ).
3539 + var magicParams = format.split('/').filter(function (str) {
3540 + return '{' === str.charAt(0);
3541 + });
3542 + magicParams.forEach(function (param) {
3543 + // Remove the '{', '}'.
3544 + param = param.replace('{', '');
3545 + param = param.replace('}', '');
3546 + var formatted = Object.entries(args.query).find(function (_ref) {
3547 + var _ref2 = (0, _slicedToArray2.default)(_ref, 1),
3548 + key = _ref2[0];
3549 + return key === param;
3550 + });
3551 + if (!formatted) {
3552 + return;
3553 + }
3554 + var key = formatted[0],
3555 + value = formatted[1].toString();
4584 3556
4585 -//#endregion
4586 -//#region modules/web-cli/assets/js/core/hooks/data.js
4587 - function _callSuper$10(t, o, e) {
4588 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$10() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
4589 - }
4590 - __name(_callSuper$10, "_callSuper");
4591 - function _isNativeReflectConstruct$10() {
4592 - try {
4593 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
4594 - } catch (t) {}
4595 - return (_isNativeReflectConstruct$10 = function _isNativeReflectConstruct() {
4596 - return !!t;
4597 - })();
4598 - }
4599 - __name(_isNativeReflectConstruct$10, "_isNativeReflectConstruct");
4600 - function _superPropGet$1(t, o, e, r) {
4601 - var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e);
4602 - return 2 & r && "function" == typeof p ? function(t) {
4603 - return p.apply(e, t);
4604 - } : p;
4605 - }
4606 - __name(_superPropGet$1, "_superPropGet");
4607 - var Data = /*#__PURE__*/ function(_HooksBase) {
4608 - function Data() {
4609 - var _this;
4610 - _classCallCheck(this, Data);
4611 - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];
4612 - _this = _callSuper$10(this, Data, [].concat(args));
4613 - _this.callbacks.dependency = {};
4614 - _this.depth.dependency = {};
4615 - return _this;
4616 - }
4617 - _inherits(Data, _HooksBase);
4618 - return _createClass(Data, [
4619 - {
4620 - key: "getType",
4621 - value: function getType() {
4622 - return "data";
4623 - }
4624 - },
4625 - {
4626 - key: "runCallback",
4627 - value: function runCallback(event, callback, args, result) {
4628 - switch (event) {
4629 - case "dependency":
4630 - if (!callback.callback(args)) {
4631 - this.depth[event][callback.id]--;
4632 - throw new $e.modules.HookBreak();
4633 - }
4634 - return true;
4635 - case "catch":
4636 - case "after":
4637 - /**
4638 - * When handling HOOK which is data after (not breakable),
4639 - * even the result of the callback is negative, it is required to return positive,
4640 - * since result of runCallback determine if the callback succeeded.
4641 - */
4642 - return callback.callback(args, result) || "after" === event;
4643 - }
4644 - return false;
4645 - }
4646 - },
4647 - {
4648 - key: "shouldRun",
4649 - value: function shouldRun(callbacks) {
4650 - return _superPropGet$1(Data, "shouldRun", this, 3)([callbacks]) && elementor.documents.getCurrent().history.getActive();
4651 - }
4652 - },
4653 - {
4654 - key: "onRun",
4655 - value: function onRun(command, args, event) {
4656 - if (!$e.devTools) return;
4657 - $e.devTools.log.callbacks().run(this.getType(), command, args, event);
4658 - }
4659 - },
4660 - {
4661 - key: "onCallback",
4662 - value: function onCallback(command, args, event, id) {
4663 - if (!$e.devTools) return;
4664 - $e.devTools.log.callbacks().callback(this.getType(), command, args, event, id);
4665 - }
4666 - }
4667 - ]);
4668 - }(HooksBase);
3557 + // Replace magic params with values.
3558 + format = format.replace(new RegExp('{' + param + '}', 'g'), value);
3559 + delete args.query[key];
3560 + });
3561 + }
3562 + if (format) {
3563 + endpoint = format;
3564 + }
4669 3565
4670 -//#endregion
4671 -//#region modules/web-cli/assets/js/core/hooks/ui.js
4672 - function _callSuper$9(t, o, e) {
4673 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$9() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
4674 - }
4675 - __name(_callSuper$9, "_callSuper");
4676 - function _isNativeReflectConstruct$9() {
4677 - try {
4678 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
4679 - } catch (t) {}
4680 - return (_isNativeReflectConstruct$9 = function _isNativeReflectConstruct() {
4681 - return !!t;
4682 - })();
4683 - }
4684 - __name(_isNativeReflectConstruct$9, "_isNativeReflectConstruct");
4685 - var Ui = /*#__PURE__*/ function(_HooksBase) {
4686 - function Ui() {
4687 - var _this;
4688 - _classCallCheck(this, Ui);
4689 - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];
4690 - _this = _callSuper$9(this, Ui, [].concat(args));
4691 - _this.callbacks.before = {};
4692 - _this.depth.before = {};
4693 - return _this;
4694 - }
4695 - _inherits(Ui, _HooksBase);
4696 - return _createClass(Ui, [
4697 - {
4698 - key: "getType",
4699 - value: function getType() {
4700 - return "ui";
4701 - }
4702 - },
4703 - {
4704 - key: "runCallback",
4705 - value: function runCallback(event, callback, args, result) {
4706 - switch (event) {
4707 - case "before":
4708 - callback.callback(args);
4709 - break;
4710 - case "catch":
4711 - case "after":
4712 - callback.callback(args, result);
4713 - break;
4714 - default: return false;
4715 - }
4716 - return true;
4717 - }
4718 - },
4719 - {
4720 - key: "onRun",
4721 - value: function onRun(command, args, event) {
4722 - if (!$e.devTools) return;
4723 - $e.devTools.log.callbacks().run(this.getType(), command, args, event);
4724 - }
4725 - },
4726 - {
4727 - key: "onCallback",
4728 - value: function onCallback(command, args, event, id) {
4729 - if (!$e.devTools) return;
4730 - $e.devTools.log.callbacks().callback(this.getType(), command, args, event, id);
4731 - }
4732 - }
4733 - ]);
4734 - }(HooksBase);
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 + if (format && endpoint.includes('/{')) {
3570 + endpoint = endpoint.substring(0, endpoint.indexOf('/{'));
3571 + }
3572 + if (args.query && Object.values(args.query).length) {
3573 + // Sorting since the endpoint later will be used as key to store the cache.
3574 + var queryEntries = Object.entries(args.query).sort(function (_ref3, _ref4) {
3575 + var _ref5 = (0, _slicedToArray2.default)(_ref3, 1),
3576 + aKey = _ref5[0];
3577 + var _ref6 = (0, _slicedToArray2.default)(_ref4, 1),
3578 + bKey = _ref6[0];
3579 + return aKey - bKey;
3580 + } // Sort by param name.
3581 + );
4735 3582
4736 -//#endregion
4737 -//#region modules/web-cli/assets/js/core/hooks.js
3583 + // `args.query` will become a part of GET params.
3584 + if (queryEntries.length) {
3585 + endpoint += '?';
3586 + queryEntries.forEach(function (_ref7) {
3587 + var _ref8 = (0, _slicedToArray2.default)(_ref7, 2),
3588 + name = _ref8[0],
3589 + value = _ref8[1];
3590 + // Replace the character '/' with the encoded version,
3591 + // mostly because when saving this endpoint value to the cache it splits the url base on the '/' character.
3592 + value = "".concat(value).replace(/\//g, '%2F');
3593 + endpoint += name + '=' + value + '&';
3594 + });
3595 + }
3596 +
3597 + // If last character is '&' remove it.
3598 + endpoint = endpoint.replace(/&$/, '');
3599 + }
3600 + return endpoint;
3601 + }
3602 +
3603 + /**
3604 + * Function commandExtractArgs().
3605 + *
3606 + * If the command have query convert it to args.
3607 + *
3608 + * @param {string} command
3609 + * @param {Object} args
3610 + *
3611 + * @return {ExtractedCommand} command
3612 + */
3613 + }, {
3614 + key: "commandExtractArgs",
3615 + value: function commandExtractArgs(command) {
3616 + var _command;
3617 + var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
3618 + if ((_command = command) !== null && _command !== void 0 && _command.includes('?')) {
3619 + if (!args.query) {
3620 + args.query = {};
3621 + }
3622 + var commandParts = command.split('?'),
3623 + pureCommand = commandParts[0],
3624 + queryString = commandParts[1],
3625 + query = new URLSearchParams(queryString);
3626 + Object.assign(args.query, Object.fromEntries(query));
3627 + command = pureCommand;
3628 + }
3629 + return {
3630 + command: command,
3631 + args: args
3632 + };
3633 + }
3634 +
3635 + /**
3636 + * Function validateRequestData().
3637 + *
3638 + * Validate request data requirements.
3639 + *
3640 + * @param {RequestData} requestData
3641 + * @param {boolean} [requireArgsData]
3642 + */
3643 + }, {
3644 + key: "validateRequestData",
3645 + value: function validateRequestData(requestData) {
3646 + var requireArgsData = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
3647 + // Do not validate if its already valid.
3648 + if (requestData.timestamp && this.validatedRequests[requestData.timestamp]) {
3649 + return;
3650 + }
3651 + var argsObject = new _argsObject.default(requestData);
3652 + argsObject.requireArgument('component');
3653 + argsObject.requireArgumentType('command', 'string');
3654 + argsObject.requireArgumentType('endpoint', 'string');
3655 + if (requireArgsData) {
3656 + argsObject.requireArgumentType('data', 'object', requestData.args);
3657 + }
3658 +
3659 + // Ensure timestamp.
3660 + if (!requestData.timestamp) {
3661 + requestData.timestamp = new Date().getTime();
3662 + }
3663 + this.validatedRequests[requestData.timestamp] = true;
3664 + }
3665 +
3666 + /**
3667 + * Function prepareHeaders().
3668 + *
3669 + * Prepare the headers for each request.
3670 + *
3671 + * @param {RequestData} requestData
3672 + *
3673 + * @return {{}} params
3674 + */
3675 + }, {
3676 + key: "prepareHeaders",
3677 + value: function prepareHeaders(requestData) {
3678 + var _requestData$args, _requestData$args$opt;
3679 + var type = requestData.type,
3680 + nonce = elementorWebCliConfig.nonce,
3681 + params = {
3682 + 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,
3683 + credentials: 'include' // Cookies is required for wp reset.
3684 + },
3685 + headers = {
3686 + 'X-WP-Nonce': nonce
3687 + };
3688 +
3689 + /**
3690 + * Translate:
3691 + * 'create, delete, get, update' to HTTP Methods:
3692 + * 'GET, POST, PUT, PATCH, DELETE'
3693 + */
3694 + var allowedMethods = this.getAllowedMethods(type),
3695 + method = this.getHTTPMethod(type);
3696 + if ('GET' === method) {
3697 + Object.assign(params, {
3698 + headers: headers
3699 + });
3700 + } else if (allowedMethods) {
3701 + var _requestData$args2, _requestData$args3;
3702 + if (['POST', 'PUT'].includes(method) && !((_requestData$args2 = requestData.args) !== null && _requestData$args2 !== void 0 && _requestData$args2.data)) {
3703 + throw Error('Invalid requestData.args.data');
3704 + }
3705 + Object.assign(headers, {
3706 + 'Content-Type': 'application/json'
3707 + });
3708 + if ((_requestData$args3 = requestData.args) !== null && _requestData$args3 !== void 0 && _requestData$args3.headers) {
3709 + Object.assign(headers, requestData.args.headers);
3710 + }
3711 + Object.assign(params, {
3712 + method: method,
3713 + headers: headers,
3714 + body: 'application/json' === headers['Content-Type'] ? JSON.stringify(requestData.args.data) : requestData.args.data
3715 + });
3716 + } else {
3717 + throw Error("Invalid type: '".concat(type, "'"));
3718 + }
3719 + return params;
3720 + }
3721 +
3722 + /**
3723 + * Function prepareEndpoint().
3724 + *
3725 + * This method response for building a final endpoint,
3726 + * the main problem is with plain permalink mode + command with query params that creates a weird url,
3727 + * the current method should fix it.
3728 + *
3729 + * @param {RequestData} requestData
3730 + *
3731 + * @return {string} Endpoint URL
3732 + */
3733 + }, {
3734 + key: "prepareEndpoint",
3735 + value: function prepareEndpoint(requestData) {
3736 + var splitEndpoint = requestData.endpoint.split('?'),
3737 + endpoint = splitEndpoint.shift();
3738 + var endpointAddress = this.getEndpointURL(requestData, endpoint);
3739 + if (splitEndpoint.length) {
3740 + var separator = endpointAddress.includes('?') ? '&' : '?';
3741 + endpointAddress += separator + splitEndpoint.pop();
3742 + }
3743 + return endpointAddress;
3744 + }
3745 +
3746 + /**
3747 + * Function fetch().
3748 + *
3749 + * @param {RequestData} requestData
3750 + * @param {function(RequestInfo,*) : Promise<Response> } [fetchAPI]
3751 + *
3752 + * @return {Promise<Response>} response
3753 + */
3754 + }, {
3755 + key: "fetch",
3756 + value: function fetch(requestData) {
3757 + var _requestData$args$opt2,
3758 + _this2 = this;
3759 + var fetchAPI = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : window.fetch;
3760 + requestData.cache = 'miss';
3761 + var refresh = (_requestData$args$opt2 = requestData.args.options) === null || _requestData$args$opt2 === void 0 ? void 0 : _requestData$args$opt2.refresh,
3762 + getCache = 'get' === requestData.type && !refresh,
3763 + saveCache = ['create', 'get'].includes(requestData.type) && !refresh;
3764 + if (getCache) {
3765 + var cachePromise = this.cache.getAsync(requestData);
3766 + if (cachePromise) {
3767 + return cachePromise;
3768 + }
3769 + }
3770 + var params = this.prepareHeaders(requestData);
3771 + // eslint-disable-next-line no-async-promise-executor
3772 + return new Promise( /*#__PURE__*/function () {
3773 + var _ref9 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(resolve, reject) {
3774 + var endpoint, request, response;
3775 + return _regenerator.default.wrap(function _callee2$(_context2) {
3776 + while (1) {
3777 + switch (_context2.prev = _context2.next) {
3778 + case 0:
3779 + _context2.prev = 0;
3780 + endpoint = _this2.prepareEndpoint(requestData);
3781 + request = fetchAPI(endpoint, params);
3782 + _context2.next = 5;
3783 + return request.then( /*#__PURE__*/function () {
3784 + var _ref10 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(_response) {
3785 + return _regenerator.default.wrap(function _callee$(_context) {
3786 + while (1) {
3787 + switch (_context.prev = _context.next) {
3788 + case 0:
3789 + if (_response.ok) {
3790 + _context.next = 6;
3791 + break;
3792 + }
3793 + if (!_response.headers.get('content-type').includes('application/json')) {
3794 + _context.next = 5;
3795 + break;
3796 + }
3797 + _context.next = 4;
3798 + return _response.json();
3799 + case 4:
3800 + _response = _context.sent;
3801 + case 5:
3802 + throw _response;
3803 + case 6:
3804 + return _context.abrupt("return", _response.json());
3805 + case 7:
3806 + case "end":
3807 + return _context.stop();
3808 + }
3809 + }
3810 + }, _callee);
3811 + }));
3812 + return function (_x3) {
3813 + return _ref10.apply(this, arguments);
3814 + };
3815 + }());
3816 + case 5:
3817 + response = _context2.sent;
3818 + // At this point, it got the resolved response from remote.
3819 + // So load cache, and resolve it.
3820 + if (saveCache) {
3821 + _this2.cache.set(requestData, response);
3822 + }
3823 + resolve(response);
3824 + _context2.next = 13;
3825 + break;
3826 + case 10:
3827 + _context2.prev = 10;
3828 + _context2.t0 = _context2["catch"](0);
3829 + reject(_context2.t0);
3830 + case 13:
3831 + case "end":
3832 + return _context2.stop();
3833 + }
3834 + }
3835 + }, _callee2, null, [[0, 10]]);
3836 + }));
3837 + return function (_x, _x2) {
3838 + return _ref9.apply(this, arguments);
3839 + };
3840 + }());
3841 + }
3842 +
3843 + /**
3844 + * Function getCache().
3845 + *
3846 + * @param {ComponentBase} component
3847 + * @param {string} command
3848 + * @param {{}} query
3849 + *
3850 + * @return {{}} cache object
3851 + */
3852 + }, {
3853 + key: "getCache",
3854 + value: function getCache(component, command) {
3855 + var query = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
3856 + var args = {
3857 + query: query
3858 + };
3859 + return this.cache.get({
3860 + endpoint: this.commandToEndpoint(command, args, this.commandFormats[command]),
3861 + component: component,
3862 + command: command,
3863 + args: args
3864 + });
3865 + }
3866 +
3867 + /**
3868 + * Function setCache().
3869 + *
3870 + * @param {ComponentBase} component
3871 + * @param {string} command
3872 + * @param {{}} query
3873 + * @param {*} data
3874 + */
3875 + }, {
3876 + key: "setCache",
3877 + value: function setCache(component, command, query, data) {
3878 + var args = {
3879 + query: query
3880 + };
3881 + this.cache.set({
3882 + endpoint: this.commandToEndpoint(command, args, this.commandFormats[command]),
3883 + component: component,
3884 + command: command,
3885 + args: args
3886 + }, data);
3887 + }
3888 +
3889 + /**
3890 + * Function updateCache().
3891 + *
3892 + * The difference between 'setCache' and 'updateCache' is update will only modify exist values.
3893 + * and 'setCache' will create or update.
3894 + *
3895 + * @param {ComponentBase} component
3896 + * @param {string} command
3897 + * @param {{}} query
3898 + * @param {*} data
3899 + */
3900 + }, {
3901 + key: "updateCache",
3902 + value: function updateCache(component, command, query, data) {
3903 + var args = {
3904 + query: query,
3905 + data: data
3906 + };
3907 + this.cache.update({
3908 + endpoint: this.commandToEndpoint(command, args, this.commandFormats[command]),
3909 + component: component,
3910 + command: command,
3911 + args: args
3912 + });
3913 + }
3914 +
3915 + /**
3916 + * Function deleteCache().
3917 + *
3918 + * @param {ComponentBase} component
3919 + * @param {string} command
3920 + * @param {{}} query
3921 + */
3922 + }, {
3923 + key: "deleteCache",
3924 + value: function deleteCache(component, command) {
3925 + var query = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
3926 + var args = {
3927 + query: query
3928 + };
3929 + this.cache.delete({
3930 + endpoint: this.commandToEndpoint(command, args, this.commandFormats[command]),
3931 + component: component,
3932 + command: command,
3933 + args: args
3934 + });
3935 + }
3936 +
3937 + /**
3938 + * Function registerFormat().
3939 + *
3940 + * Register's format for each command.
3941 + *
3942 + * @param {string} command
3943 + * @param {string} format
3944 + */
3945 + }, {
3946 + key: "registerFormat",
3947 + value: function registerFormat(command, format) {
3948 + this.commandFormats[command] = format;
3949 + }
3950 +
3951 + /**
3952 + * Function create().
3953 + *
3954 + * Run a command, that will be translated as endpoint for creating new data.
3955 + *
3956 + * @param {string} command
3957 + * @param {*} data
3958 + * @param {{}} query
3959 + * @param {{}} options
3960 + *
3961 + * @return {*} result
3962 + */
3963 + }, {
3964 + key: "create",
3965 + value: function create(command, data) {
3966 + var query = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
3967 + var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
3968 + return this.run('create', command, {
3969 + query: query,
3970 + options: options,
3971 + data: data
3972 + });
3973 + }
3974 +
3975 + /**
3976 + * Function delete().
3977 + *
3978 + * Run a command, that will be translated as endpoint for deleting data.
3979 + *
3980 + * @param {string} command
3981 + * @param {{}} query
3982 + * @param {{}} options
3983 + *
3984 + * @return {*} result
3985 + */
3986 + }, {
3987 + key: "delete",
3988 + value: function _delete(command) {
3989 + var query = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
3990 + var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
3991 + return this.run('delete', command, {
3992 + query: query,
3993 + options: options
3994 + });
3995 + }
3996 +
3997 + /**
3998 + * Function get().
3999 + *
4000 + * Run a command, that will be translated as endpoint for getting data.
4001 + *
4002 + * @param {string} command
4003 + * @param {{}} query
4004 + * @param {{}} options
4005 + *
4006 + * @return {*} result
4007 + */
4008 + }, {
4009 + key: "get",
4010 + value: function get(command) {
4011 + var query = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
4012 + var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
4013 + return this.run('get', command, {
4014 + query: query,
4015 + options: options
4016 + });
4017 + }
4018 +
4019 + /**
4020 + * Function update().
4021 + *
4022 + * Run a command, that will be translated as endpoint for updating data.
4023 + *
4024 + * @param {string} command
4025 + * @param {*} data
4026 + * @param {{}} query
4027 + * @param {{}} options
4028 + *
4029 + * @return {*} result
4030 + */
4031 + }, {
4032 + key: "update",
4033 + value: function update(command, data) {
4034 + var query = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
4035 + var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
4036 + return this.run('update', command, {
4037 + query: query,
4038 + options: options,
4039 + data: data
4040 + });
4041 + }
4042 +
4043 + /**
4044 + * Function options().
4045 + *
4046 + * Run a command, that will be translated as endpoint for requesting options/information about specific endpoint.
4047 + *
4048 + * @param {string} command
4049 + * @param {{}} query
4050 + * @param {{}} options
4051 + *
4052 + * @return {*} result
4053 + */
4054 + }, {
4055 + key: "options",
4056 + value: function options(command, query) {
4057 + var _options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
4058 + return this.run('options', command, {
4059 + query: query,
4060 + options: _options
4061 + });
4062 + }
4063 + }, {
4064 + key: "register",
4065 + value: function register(component, command, callback) {
4066 + (0, _get2.default)((0, _getPrototypeOf2.default)(Data.prototype), "register", this).call(this, component, command, callback);
4067 + var fullCommandName = component.getNamespace() + '/' + command,
4068 + commandInstance = $e.data.getCommandClass(fullCommandName),
4069 + format = commandInstance !== null && commandInstance !== void 0 && commandInstance.getEndpointFormat ? commandInstance.getEndpointFormat() : false;
4070 + if (format) {
4071 + $e.data.registerFormat(fullCommandName, format);
4072 + }
4073 + return this;
4074 + }
4075 +
4076 + /**
4077 + * TODO: Add JSDOC typedef for args ( query and options ).
4078 + *
4079 + * @param {DataTypes} type
4080 + * @param {string} command
4081 + * @param {{}} args
4082 + *
4083 + * @override
4084 + */
4085 + }, {
4086 + key: "run",
4087 + value: function run(type, command, args) {
4088 + args.options.type = type;
4089 + var _this$commandExtractA = this.commandExtractArgs(command, args);
4090 + command = _this$commandExtractA.command;
4091 + args = _this$commandExtractA.args;
4092 + return (0, _get2.default)((0, _getPrototypeOf2.default)(Data.prototype), "run", this).call(this, command, args);
4093 + }
4094 + }, {
4095 + key: "error",
4096 + value: function error(message) {
4097 + throw Error('Data commands: ' + message);
4098 + }
4099 + }]);
4100 + return Data;
4101 +}(_commands.default);
4102 +exports["default"] = Data;
4103 +
4104 +/***/ }),
4105 +
4106 +/***/ "../modules/web-cli/assets/js/core/data/cache.js":
4107 +/*!*******************************************************!*\
4108 + !*** ../modules/web-cli/assets/js/core/data/cache.js ***!
4109 + \*******************************************************/
4110 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
4111 +
4112 +"use strict";
4113 +
4114 +
4115 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
4116 +Object.defineProperty(exports, "__esModule", ({
4117 + value: true
4118 +}));
4119 +exports["default"] = void 0;
4120 +var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js"));
4121 +var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js"));
4122 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
4123 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
4124 +var _localStorage = _interopRequireDefault(__webpack_require__(/*! ./storages/local-storage */ "../modules/web-cli/assets/js/core/data/storages/local-storage.js"));
4738 4125 /**
4739 - * @typedef {import('../modules/hook-base')} HookBase
4740 - */
4741 - var Hooks = /*#__PURE__*/ function() {
4742 - function Hooks() {
4743 - _classCallCheck(this, Hooks);
4744 - _defineProperty(this, "data", new Data());
4745 - _defineProperty(this, "ui", new Ui());
4746 - }
4747 - return _createClass(Hooks, [
4748 - {
4749 - key: "activate",
4750 - value: function activate() {
4751 - this.getTypes().forEach(function(hooksType) {
4752 - hooksType.activate();
4753 - });
4754 - }
4755 - },
4756 - {
4757 - key: "deactivate",
4758 - value: function deactivate() {
4759 - this.getTypes().forEach(function(hooksType) {
4760 - hooksType.deactivate();
4761 - });
4762 - }
4763 - },
4764 - {
4765 - key: "getAll",
4766 - value: function getAll() {
4767 - var flat = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false;
4768 - var result = {};
4769 - this.getTypes().forEach(function(hooksType) {
4770 - result[hooksType.getType()] = hooksType.getAll(flat);
4771 - });
4772 - return result;
4773 - }
4774 - },
4775 - {
4776 - key: "getTypes",
4777 - value: function getTypes() {
4778 - return [this.data, this.ui];
4779 - }
4780 - },
4781 - {
4782 - key: "getType",
4783 - value: function getType(type) {
4784 - return this.getTypes().find(function(hooks) {
4785 - return type === hooks.getType();
4786 - });
4787 - }
4788 - },
4789 - {
4790 - key: "register",
4791 - value: function register(type, event, instance) {
4792 - return this.getType(type).register(event, instance);
4793 - }
4794 - },
4795 - {
4796 - key: "run",
4797 - value: function run(type, event, command, args) {
4798 - var result = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : void 0;
4799 - return this.getType(type).run(event, command, args, result);
4800 - }
4801 - },
4802 - {
4803 - key: "registerDataAfter",
4804 - value: function registerDataAfter(instance) {
4805 - return this.register("data", "after", instance);
4806 - }
4807 - },
4808 - {
4809 - key: "registerDataCatch",
4810 - value: function registerDataCatch(instance) {
4811 - return this.register("data", "catch", instance);
4812 - }
4813 - },
4814 - {
4815 - key: "registerDataDependency",
4816 - value: function registerDataDependency(instance) {
4817 - return this.register("data", "dependency", instance);
4818 - }
4819 - },
4820 - {
4821 - key: "registerUIAfter",
4822 - value: function registerUIAfter(instance) {
4823 - return this.register("ui", "after", instance);
4824 - }
4825 - },
4826 - {
4827 - key: "registerUICatch",
4828 - value: function registerUICatch(instance) {
4829 - return this.register("ui", "catch", instance);
4830 - }
4831 - },
4832 - {
4833 - key: "registerUIBefore",
4834 - value: function registerUIBefore(instance) {
4835 - return this.register("ui", "before", instance);
4836 - }
4837 - },
4838 - {
4839 - key: "runDataAfter",
4840 - value: function runDataAfter(command, args, result) {
4841 - return this.run("data", "after", command, args, result);
4842 - }
4843 - },
4844 - {
4845 - key: "runDataCatch",
4846 - value: function runDataCatch(command, args, error) {
4847 - return this.run("data", "catch", command, args, error);
4848 - }
4849 - },
4850 - {
4851 - key: "runDataDependency",
4852 - value: function runDataDependency(command, args) {
4853 - return this.run("data", "dependency", command, args);
4854 - }
4855 - },
4856 - {
4857 - key: "runUIAfter",
4858 - value: function runUIAfter(command, args, result) {
4859 - return this.run("ui", "after", command, args, result);
4860 - }
4861 - },
4862 - {
4863 - key: "runUICatch",
4864 - value: function runUICatch(command, args, e) {
4865 - return this.run("ui", "catch", command, args, e);
4866 - }
4867 - },
4868 - {
4869 - key: "runUIBefore",
4870 - value: function runUIBefore(command, args) {
4871 - return this.run("ui", "before", command, args);
4872 - }
4873 - }
4874 - ]);
4875 - }();
4126 + * @typedef {{}} RequestData
4127 + */
4128 +/**
4129 + * @typedef {import('../data')} Data
4130 + */
4131 +/**
4132 + * TODO: Search common logic, create functions to reduce code size.
4133 + */
4134 +var Cache = /*#__PURE__*/function () {
4135 + /**
4136 + * Function constructor().
4137 + *
4138 + * Create cache.
4139 + *
4140 + * @param {Data} manager
4141 + */
4142 + function Cache(manager) {
4143 + (0, _classCallCheck2.default)(this, Cache);
4144 + this.manager = manager;
4145 + this.storage = new _localStorage.default();
4146 + }
4876 4147
4877 -//#endregion
4878 -//#region modules/web-cli/assets/js/core/routes.js
4879 - function _callSuper$8(t, o, e) {
4880 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$8() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
4881 - }
4882 - __name(_callSuper$8, "_callSuper");
4883 - function _isNativeReflectConstruct$8() {
4884 - try {
4885 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
4886 - } catch (t) {}
4887 - return (_isNativeReflectConstruct$8 = function _isNativeReflectConstruct() {
4888 - return !!t;
4889 - })();
4890 - }
4891 - __name(_isNativeReflectConstruct$8, "_isNativeReflectConstruct");
4892 - function _superPropGet(t, o, e, r) {
4893 - var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e);
4894 - return 2 & r && "function" == typeof p ? function(t) {
4895 - return p.apply(e, t);
4896 - } : p;
4897 - }
4898 - var Routes = /*#__PURE__*/ function(_Commands) {
4899 - function Routes() {
4900 - var _this;
4901 - _classCallCheck(this, Routes);
4902 - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];
4903 - _this = _callSuper$8(this, Routes, [].concat(args));
4904 - _this.savedStates = {};
4905 - _this.historyPerComponent = {};
4906 - return _this;
4907 - }
4908 - _inherits(Routes, _Commands);
4909 - return _createClass(Routes, [
4910 - {
4911 - key: "refreshContainer",
4912 - value: function refreshContainer(container) {
4913 - var currentRoute = this.getCurrent(container);
4914 - var currentArgs = this.getCurrentArgs(container);
4915 - this.clearCurrent(container);
4916 - this.to(currentRoute, currentArgs);
4917 - }
4918 - },
4919 - {
4920 - key: "getHistory",
4921 - value: function getHistory() {
4922 - var namespaceRoot = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "";
4923 - if (namespaceRoot) return this.historyPerComponent[namespaceRoot] || [];
4924 - return this.historyPerComponent;
4925 - }
4926 - },
4927 - {
4928 - key: "clearHistory",
4929 - value: function clearHistory(namespaceRoot) {
4930 - delete this.historyPerComponent[namespaceRoot];
4931 - }
4932 - },
4933 - {
4934 - key: "clearCurrent",
4935 - value: function clearCurrent(container) {
4936 - var route = this.current[container];
4937 - if (!route) return;
4938 - this.detachCurrent(container);
4939 - this.getComponent(route).onCloseRoute(route);
4940 - this.dispatchOnClose(route);
4941 - }
4942 - },
4943 - {
4944 - key: "clear",
4945 - value: function clear() {
4946 - var _this2 = this;
4947 - Object.keys(this.current).forEach(function(container) {
4948 - return _this2.clearCurrent(container);
4949 - });
4950 - }
4951 - },
4952 - {
4953 - key: "saveState",
4954 - value: function saveState(container) {
4955 - this.savedStates[container] = {
4956 - route: this.current[container],
4957 - args: this.currentArgs[container]
4958 - };
4959 - return this;
4960 - }
4961 - },
4962 - {
4963 - key: "restoreState",
4964 - value: function restoreState(container) {
4965 - if (!this.savedStates[container]) return false;
4966 - this.to(this.savedStates[container].route, this.savedStates[container].args);
4967 - return true;
4968 - }
4969 - },
4970 - {
4971 - key: "validateRun",
4972 - value: function validateRun(route) {
4973 - var args = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
4974 - if (!_superPropGet(Routes, "validateRun", this, 3)([route, args])) return false;
4975 - if (this.is(route, args) && !args.refresh) return false;
4976 - var component = this.getComponent(route);
4977 - if (!component.isOpen || args.reOpen) component.isOpen = component.open(args);
4978 - return component.isOpen;
4979 - }
4980 - },
4981 - {
4982 - key: "beforeRun",
4983 - value: function beforeRun(route, args) {
4984 - var container = this.getComponent(route).getServiceName();
4985 - var oldRoute = this.current[container];
4986 - if (oldRoute) this.getComponent(oldRoute).onCloseRoute(oldRoute);
4987 - Commands.trace.push(route);
4988 - _superPropGet(Routes, "beforeRun", this, 3)([
4989 - route,
4990 - args,
4991 - false
4992 - ]);
4993 - this.attachCurrent(container, route, args);
4994 - if (oldRoute) this.dispatchOnClose(oldRoute);
4995 - }
4996 - },
4997 - {
4998 - key: "to",
4999 - value: function to(route, args) {
5000 - var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : { history: true };
5001 - this.run(route, args);
5002 - var namespaceRoot = this.getComponent(route).getServiceName();
5003 - if (options.history) {
5004 - if (!this.historyPerComponent[namespaceRoot]) this.historyPerComponent[namespaceRoot] = [];
5005 - this.historyPerComponent[namespaceRoot].push({
5006 - route,
5007 - args
5008 - });
5009 - }
5010 - }
5011 - },
5012 - {
5013 - key: "back",
5014 - value: function back(namespaceRoot) {
5015 - var history = this.getHistory(namespaceRoot);
5016 - history.pop();
5017 - var last = history.pop();
5018 - if (!last) return;
5019 - this.to(last.route, last.args);
5020 - }
5021 - },
5022 - {
5023 - key: "runShortcut",
5024 - value: function runShortcut(command) {
5025 - this.to(command);
5026 - }
5027 - },
5028 - {
5029 - key: "afterRun",
5030 - value: function afterRun(route, args) {
5031 - var results = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : void 0;
5032 - this.getComponent(route).onRoute(route, args);
5033 - this.dispatchOnOpen(route);
5034 - _superPropGet(Routes, "afterRun", this, 3)([
5035 - route,
5036 - args,
5037 - results,
5038 - false
5039 - ]);
5040 - Commands.trace.pop();
5041 - }
5042 - },
5043 - {
5044 - key: "is",
5045 - value: function is(route) {
5046 - var args = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
5047 - if (!_superPropGet(Routes, "is", this, 3)([route])) return false;
5048 - var container = this.getComponent(route).getServiceName();
5049 - return _.isEqual(args, this.currentArgs[container]);
5050 - }
5051 - },
5052 - {
5053 - key: "isPartOf",
5054 - value: function isPartOf(route) {
5055 - /**
5056 - * Check against current command hierarchically.
5057 - * For example `is( 'panel' )` will be true for `panel/elements`
5058 - * `is( 'panel/editor' )` will be true for `panel/editor/style`
5059 - */
5060 - var container = route.split("/")[0];
5061 - var toCheck = [];
5062 - var currentParts = this.current[container] ? this.current[container].split("/") : [];
5063 - var match = false;
5064 - currentParts.forEach(function(part) {
5065 - toCheck.push(part);
5066 - if (toCheck.join("/") === route) match = true;
5067 - });
5068 - return match;
5069 - }
5070 - },
5071 - {
5072 - key: "error",
5073 - value: function error(message) {
5074 - throw Error("Routes: " + message);
5075 - }
5076 - },
5077 - {
5078 - key: "dispatchOnOpen",
5079 - value: function dispatchOnOpen(route) {
5080 - window.dispatchEvent(new CustomEvent("elementor/routes/open", { detail: { route } }));
5081 - }
5082 - },
5083 - {
5084 - key: "dispatchOnClose",
5085 - value: function dispatchOnClose(route) {
5086 - window.dispatchEvent(new CustomEvent("elementor/routes/close", { detail: { route } }));
5087 - }
5088 - }
5089 - ]);
5090 - }(Commands);
4148 + /**
4149 + * Function getAsync().
4150 + *
4151 + * Receive from cache. the difference between getAsync() and get() is that receive return it as promise...
4152 + * to fake fetch mechanism.
4153 + *
4154 + * @param {RequestData} requestData
4155 + *
4156 + * @return {(Promise|boolean)} request data
4157 + */
4158 + (0, _createClass2.default)(Cache, [{
4159 + key: "getAsync",
4160 + value: function getAsync(requestData) {
4161 + var data = this.get(requestData);
4162 + if (null !== data) {
4163 + // If data comes from cache, add 'cache = hit' to requestData.
4164 + requestData.cache = 'hit';
4165 + return new Promise(function (resolve) {
4166 + resolve(data);
4167 + });
4168 + }
5091 4169
5092 -//#endregion
5093 -//#region modules/web-cli/assets/js/utils/environment.js
5094 - var matchUserAgent = function matchUserAgent(UserAgentStr) {
5095 - return userAgent.indexOf(UserAgentStr) >= 0;
5096 - };
5097 - var userAgent = navigator.userAgent;
5098 - var isOpera = !!window.opr && !!opr.addons || !!window.opera || matchUserAgent(" OPR/");
5099 - var isFirefox = matchUserAgent("Firefox");
5100 - var isSafari = /^((?!chrome|android).)*safari/i.test(userAgent) || /constructor/i.test(window.HTMLElement) || function(p) {
5101 - return "[object SafariRemoteNotification]" === p.toString();
5102 - }(!window.safari || typeof safari !== "undefined" && safari.pushNotification);
5103 - var isIE = /Trident|MSIE/.test(userAgent) && !!document.documentMode;
5104 - var isEdge = !isIE && !!window.StyleMedia || matchUserAgent("Edg");
5105 - var isChrome = !!window.chrome && matchUserAgent("Chrome") && !(isEdge || isOpera);
5106 - var isBlink = matchUserAgent("Chrome") && !!window.CSS;
5107 - var environment = {
5108 - appleWebkit: matchUserAgent("AppleWebKit") && !isBlink,
5109 - blink: isBlink,
5110 - chrome: isChrome,
5111 - edge: isEdge,
5112 - firefox: isFirefox,
5113 - ie: isIE,
5114 - mac: matchUserAgent("Macintosh"),
5115 - opera: isOpera,
5116 - safari: isSafari,
5117 - webkit: matchUserAgent("AppleWebKit")
5118 - };
4170 + // TODO: Check if possible, always return promise and reject it.
4171 + return false;
4172 + }
5119 4173
5120 -//#endregion
5121 -//#region modules/web-cli/assets/js/core/shortcuts.js
5122 - var Shortcuts = /*#__PURE__*/ function() {
5123 - function Shortcuts($window) {
5124 - _classCallCheck(this, Shortcuts);
5125 - this.specialKeys = {
5126 - 13: "enter",
5127 - 27: "esc",
5128 - 38: "up",
5129 - 40: "down",
5130 - 46: "del",
5131 - 191: "?"
5132 - };
5133 - this.component = "";
5134 - this.handlers = {};
5135 - this.bindListener($window);
5136 - }
5137 - return _createClass(Shortcuts, [
5138 - {
5139 - key: "bindListener",
5140 - value: function bindListener($window) {
5141 - var _this = this;
5142 - $window.on("keydown", function(event) {
5143 - return _this.handle(event);
5144 - });
5145 - }
5146 - },
5147 - {
5148 - key: "getAll",
5149 - value: function getAll() {
5150 - var shortcuts = {};
5151 - jQuery.each(this.handlers, function(key, handler) {
5152 - jQuery.each(handler, function(index, config) {
5153 - shortcuts[config.command] = key;
5154 - });
5155 - });
5156 - return shortcuts;
5157 - }
5158 - },
5159 - {
5160 - key: "register",
5161 - value: function register(shortcuts, args) {
5162 - var _this2 = this;
5163 - shortcuts.replace(" ", "").split(",").forEach(function(shortcut) {
5164 - if (!_this2.handlers[shortcut]) _this2.handlers[shortcut] = [];
5165 - _this2.handlers[shortcut].push(args);
5166 - });
5167 - }
5168 - },
5169 - {
5170 - key: "unregister",
5171 - value: function unregister(shortcuts, args) {
5172 - var _this3 = this;
5173 - shortcuts.replace(" ", "").split(",").forEach(function(shortcut) {
5174 - _this3.handlers[shortcut].forEach(function(index, handler) {
5175 - if (args === handler) delete _this3.handlers[shortcut][index];
5176 - });
5177 - });
5178 - }
5179 - },
5180 - {
5181 - key: "handle",
5182 - value: function handle(event) {
5183 - var handlers = this.getHandlersByPriority(event);
5184 - if (!handlers) return;
5185 - var filteredHandlers = handlers.filter(function(handler) {
5186 - if (handler.exclude && -1 !== handler.exclude.indexOf("input")) {
5187 - var $target = jQuery(event.target);
5188 - if ($target.is(":input, .elementor-input") || $target.closest("[contenteditable=\"true\"]").length) return false;
5189 - }
5190 - if (handler.dependency && !handler.dependency(event)) return false;
5191 - if (!handler.allowAltKey && event.altKey) return false;
5192 - return true;
5193 - });
5194 - if (!filteredHandlers.length) return;
5195 - if (1 < filteredHandlers.length && elementorWebCliConfig.isDebug) Console.warn("Multiple handlers for shortcut.", filteredHandlers, event);
5196 - event.preventDefault();
5197 - filteredHandlers[0].callback(event);
5198 - }
5199 - },
5200 - {
5201 - key: "isControlEvent",
5202 - value: function isControlEvent(event) {
5203 - return event[environment.mac ? "metaKey" : "ctrlKey"];
5204 - }
5205 - },
5206 - {
5207 - key: "getEventShortcut",
5208 - value: function getEventShortcut(event) {
5209 - var shortcut = [];
5210 - if (event.altKey) shortcut.push("alt");
5211 - if (this.isControlEvent(event)) shortcut.push("ctrl");
5212 - if (event.shiftKey) shortcut.push("shift");
5213 - if (this.specialKeys[event.which]) shortcut.push(this.specialKeys[event.which]);
5214 - else shortcut.push(String.fromCharCode(event.which).toLowerCase());
5215 - return shortcut.join("+");
5216 - }
5217 - },
5218 - {
5219 - key: "isActiveScope",
5220 - value: function isActiveScope(scopes) {
5221 - var activeComponents = Object.keys($e.components.activeComponents);
5222 - var activeComponent = activeComponents[activeComponents.length - 1];
5223 - var component = $e.components.get(activeComponent);
5224 - if (!component) return false;
5225 - var namespace = component.getNamespace();
5226 - if (scopes.some(function(scope) {
5227 - return namespace === scope;
5228 - })) return true;
5229 - var namespaceRoot = component.getServiceName();
5230 - return scopes.some(function(scope) {
5231 - return namespaceRoot === scope;
5232 - });
5233 - }
5234 - },
5235 - {
5236 - key: "getHandlersByPriority",
5237 - value: function getHandlersByPriority(event) {
5238 - var _this4 = this;
5239 - var handlers = this.handlers[this.getEventShortcut(event)];
5240 - if (!handlers) return false;
5241 - var inCurrentScope = handlers.filter(function(handler) {
5242 - return handler.scopes && _this4.isActiveScope(handler.scopes);
5243 - });
5244 - if (inCurrentScope.length) return inCurrentScope;
5245 - var noScope = handlers.filter(function(handler) {
5246 - return !handler.scopes;
5247 - });
5248 - if (noScope.length) return noScope;
5249 - }
5250 - }
5251 - ]);
5252 - }();
4174 + /**
4175 + * Function set().
4176 + *
4177 + * set data to cache.
4178 + *
4179 + * The difference between set() and update() is that set, will modify the data anyway...
4180 + * when update() will only modify exist objects/values.
4181 + *
4182 + * @param {RequestData} requestData
4183 + * @param {*} data
4184 + */
4185 + }, {
4186 + key: "set",
4187 + value: function set(requestData, data) {
4188 + $e.data.validateRequestData(requestData);
4189 + var componentName = requestData.component.getNamespace(),
4190 + pureEndpoint = requestData.endpoint.replace(componentName + '/', ''),
4191 + pureEndpointParts = pureEndpoint.split('/');
4192 + var newData = {};
5253 4193
5254 -//#endregion
5255 -//#region modules/web-cli/assets/js/core/store.js
5256 - function ownKeys(e, r) {
5257 - var t = Object.keys(e);
5258 - if (Object.getOwnPropertySymbols) {
5259 - var o = Object.getOwnPropertySymbols(e);
5260 - r && (o = o.filter(function(r) {
5261 - return Object.getOwnPropertyDescriptor(e, r).enumerable;
5262 - })), t.push.apply(t, o);
5263 - }
5264 - return t;
5265 - }
5266 - function _objectSpread(e) {
5267 - for (var r = 1; r < arguments.length; r++) {
5268 - var t = null != arguments[r] ? arguments[r] : {};
5269 - r % 2 ? ownKeys(Object(t), !0).forEach(function(r) {
5270 - _defineProperty(e, r, t[r]);
5271 - }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r) {
5272 - Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
5273 - });
5274 - }
5275 - return e;
5276 - }
5277 - /**
5278 - * @typedef {Promise.resolve(elementorVendors.reduxToolkit).Slice} Slice
5279 - */
5280 - /**
5281 - * @typedef {Promise.resolve(elementorVendors.reduxToolkit).EnhancedStore} EnhancedStore
5282 - */
5283 - /**
5284 - * @typedef {Promise.resolve(elementorVendors.reduxToolkit).AnyAction} AnyAction
5285 - */
5286 - /**
5287 - * @typedef {Promise.resolve(elementorVendors.reduxToolkit).ThunkMiddlewareFor} ThunkMiddlewareFor
5288 - */
5289 - var Store = /*#__PURE__*/ function() {
5290 - /**
5291 - * Initialize the Store.
5292 - *
5293 - * @return {void}
5294 - */
5295 - function Store() {
5296 - _classCallCheck(this, Store);
5297 - /**
5298 - * @type {Object}
5299 - */
5300 - _defineProperty(this, "slices", {});
5301 - /**
5302 - * @type {EnhancedStore<{}, AnyAction, [ThunkMiddlewareFor<{}>]>}
5303 - */
5304 - _defineProperty(this, "reduxStore", void 0);
5305 - this.slices = {};
5306 - this.reduxStore = this.createStore();
5307 - }
5308 - /**
5309 - * Create a Redux Store object.
5310 - *
5311 - * @return {EnhancedStore<{}, AnyAction, [ThunkMiddlewareFor<{}>]>} store
5312 - */
5313 - return _createClass(Store, [
5314 - {
5315 - key: "createStore",
5316 - value: function createStore() {
5317 - return (0, _reduxjs_toolkit.configureStore)({ reducer: function reducer() {} });
5318 - }
5319 - },
5320 - {
5321 - key: "injectReducer",
5322 - value: function injectReducer(id, newReducer) {
5323 - var prevReducers = this.getReducers();
5324 - this.reduxStore.replaceReducer((0, _reduxjs_toolkit.combineReducers)(_objectSpread(_objectSpread({}, prevReducers), {}, _defineProperty({}, id, newReducer))));
5325 - }
5326 - },
5327 - {
5328 - key: "register",
5329 - value: function register(sliceId, instance) {
5330 - if (this.slices[sliceId]) throw "Slice with ID '".concat(sliceId, "' already exists.");
5331 - this.slices[sliceId] = instance;
5332 - this.injectReducer(sliceId, instance.reducer);
5333 - }
5334 - },
5335 - {
5336 - key: "get",
5337 - value: function get(sliceId) {
5338 - return this.slices[sliceId];
5339 - }
5340 - },
5341 - {
5342 - key: "getAllSlices",
5343 - value: function getAllSlices() {
5344 - return this.slices;
5345 - }
5346 - },
5347 - {
5348 - key: "getAll",
5349 - value: function getAll() {
5350 - return Object.keys(this.slices).sort();
5351 - }
5352 - },
5353 - {
5354 - key: "getReducers",
5355 - value: function getReducers() {
5356 - return Object.entries(this.slices).reduce(function(reducers, _ref) {
5357 - var _ref2 = _slicedToArray(_ref, 2);
5358 - var key = _ref2[0];
5359 - var slice = _ref2[1];
5360 - return _objectSpread(_objectSpread({}, reducers), {}, _defineProperty({}, key, slice.reducer));
5361 - }, {});
5362 - }
5363 - },
5364 - {
5365 - key: "getReduxStore",
5366 - value: function getReduxStore() {
5367 - return this.reduxStore;
5368 - }
5369 - },
5370 - {
5371 - key: "dispatch",
5372 - value: function dispatch() {
5373 - var _this$reduxStore;
5374 - return (_this$reduxStore = this.reduxStore).dispatch.apply(_this$reduxStore, arguments);
5375 - }
5376 - },
5377 - {
5378 - key: "getState",
5379 - value: function getState() {
5380 - var sliceId = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : null;
5381 - var state = this.reduxStore.getState();
5382 - return sliceId ? state[sliceId] : state;
5383 - }
5384 - },
5385 - {
5386 - key: "replaceReducer",
5387 - value: function replaceReducer() {
5388 - var _this$reduxStore2;
5389 - return (_this$reduxStore2 = this.reduxStore).replaceReducer.apply(_this$reduxStore2, arguments);
5390 - }
5391 - },
5392 - {
5393 - key: "subscribe",
5394 - value: function subscribe() {
5395 - var _this$reduxStore3;
5396 - return (_this$reduxStore3 = this.reduxStore).subscribe.apply(_this$reduxStore3, arguments);
5397 - }
5398 - }
5399 - ]);
5400 - }();
4194 + // Example of working with reaming endpoint part(s) can be found at 'cache.spec.js' test: 'load(): deep'.
4195 + // Analyze reaming endpoint.
4196 + if (pureEndpointParts.length && pureEndpoint !== componentName) {
4197 + // Using reaming endpoint parts, to build new data object.
4198 + var result = pureEndpointParts.reduce(function (accumulator, pureEndpointPart) {
4199 + accumulator[pureEndpointPart] = {};
4200 + return accumulator[pureEndpointPart];
4201 + }, newData);
5401 4202
5402 -//#endregion
5403 -//#region modules/web-cli/assets/js/core/ui-states.js
4203 + // 'result' is equal to 'newData' with a deeper pointer, build based on 'pureEndpointParts' ( will effect newData ).
4204 + Object.assign(result, data);
4205 + } else {
4206 + newData = data;
4207 + }
4208 + var oldData = this.storage.getItem(componentName);
4209 +
4210 + // When have old data, merge it recursively with newData using jQuery.extend().
4211 + if (oldData !== null) {
4212 + newData = jQuery.extend(true, oldData, newData);
4213 + }
4214 + this.storage.setItem(componentName, newData);
4215 + }
4216 +
4217 + /**
4218 + * Function get().
4219 + *
4220 + * Get from exist storage.
4221 + *
4222 + * @param {RequestData} requestData
4223 + *
4224 + * @return {{}} data
4225 + */
4226 + }, {
4227 + key: "get",
4228 + value: function get(requestData) {
4229 + $e.data.validateRequestData(requestData);
4230 + var componentName = requestData.component.getNamespace(),
4231 + componentData = this.storage.getItem(componentName);
4232 + if (componentData !== null) {
4233 + if (componentName === requestData.endpoint) {
4234 + return componentData;
4235 + }
4236 +
4237 + // Example of working with reaming endpoint part(s) can be found at 'cache.spec.js' test: 'get(): complex'.
4238 + // Analyze reaming endpoint (Using reduce over endpoint parts, build the right index).
4239 + var pureEndpoint = requestData.endpoint.replace(requestData.component.getNamespace() + '/', ''),
4240 + pureEndpointParts = pureEndpoint.split('/'),
4241 + // eslint-disable-next-line array-callback-return
4242 + result = pureEndpointParts.reduce(function (accumulator, endpointPart) {
4243 + if (accumulator && accumulator[endpointPart]) {
4244 + return accumulator[endpointPart];
4245 + }
4246 + }, componentData);
4247 +
4248 + // Since $e.data.cache.receive will reject only if null is the result.
4249 + return result || null;
4250 + }
4251 + return null;
4252 + }
4253 +
4254 + /**
4255 + * Function update().
4256 + *
4257 + * Update only already exist storage, runs over all storage
4258 + *
4259 + * @param {RequestData} requestData
4260 + *
4261 + * @return {boolean} is updated
4262 + */
4263 + }, {
4264 + key: "update",
4265 + value: function update(requestData) {
4266 + $e.data.validateRequestData(requestData, true);
4267 + var endpoint = requestData.endpoint;
4268 + var response = {};
4269 +
4270 + // Simulate response from cache.
4271 + Object.entries(this.storage.getAll()).forEach(function (_ref) {
4272 + var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
4273 + endpointKey = _ref2[0],
4274 + /* String*/endpointValue = _ref2[1];
4275 + if (endpointValue && endpoint.includes(endpointKey)) {
4276 + // Assuming it is a specific endpoint.
4277 + var oldData = endpointValue,
4278 + pureEndpoint = requestData.endpoint.replace(requestData.component.getNamespace() + '/', ''),
4279 + pureEndpointParts = pureEndpoint.split('/'),
4280 + isComponentUpdate = 1 === pureEndpointParts.length && endpointKey === requestData.endpoint && endpointKey === requestData.component.getNamespace();
4281 +
4282 + // Component update or specific update?
4283 + if (isComponentUpdate) {
4284 + response = jQuery.extend(true, oldData, requestData.args.data);
4285 + } else {
4286 + var oldSpecificData = pureEndpointParts.reduce(function (accumulator, pureEndpointPart) {
4287 + return accumulator[pureEndpointPart];
4288 + }, oldData);
4289 + response = jQuery.extend(true, oldSpecificData, requestData.args.data);
4290 + }
4291 + }
4292 + });
4293 +
4294 + // If response not found.
4295 + if (0 === Object.values(response).length) {
4296 + return false;
4297 + }
4298 +
4299 + // Update cache.
4300 + this.set(requestData, response);
4301 + return true;
4302 + }
4303 +
4304 + /**
4305 + * Function delete().
4306 + *
4307 + * Delete endpoint from storage.
4308 + *
4309 + * @param {RequestData} requestData
4310 + *
4311 + * @return {boolean} is deleted
4312 + */
4313 + }, {
4314 + key: "delete",
4315 + value: function _delete(requestData) {
4316 + $e.data.validateRequestData(requestData);
4317 + var result = false;
4318 + var componentName = requestData.component.getNamespace();
4319 + if (componentName !== requestData.endpoint) {
4320 + var oldData = this.storage.getItem(componentName),
4321 + newData = {};
4322 + if (null === oldData) {
4323 + return false;
4324 + }
4325 + var pureEndpoint = requestData.endpoint.replace(componentName + '/', ''),
4326 + pureEndpointParts = pureEndpoint.split('/'),
4327 + lastEndpointPart = pureEndpointParts[pureEndpointParts.length - 1];
4328 + pureEndpointParts.reduce(function (accumulator, pureEndpointPart) {
4329 + if (pureEndpointPart === lastEndpointPart) {
4330 + // Null, means delete.
4331 + accumulator[pureEndpointPart] = null;
4332 + } else {
4333 + accumulator[pureEndpointPart] = {};
4334 + }
4335 + return accumulator[pureEndpointPart];
4336 + }, newData);
4337 + if (Object.keys(oldData).length) {
4338 + var deleteKeys = function deleteKeys(target, nullsObject) {
4339 + if (nullsObject) {
4340 + Object.keys(nullsObject).forEach(function (key) {
4341 + if (nullsObject[key] && 'object' === (0, _typeof2.default)(nullsObject[key])) {
4342 + deleteKeys(target[key], nullsObject[key]);
4343 + } else if (null === nullsObject[key]) {
4344 + delete target[key];
4345 + result = true;
4346 + }
4347 + });
4348 + } else {
4349 + // Means need to clear all the object.
4350 + Object.keys(target).forEach(function (key) {
4351 + return delete target[key];
4352 + });
4353 + }
4354 + return target;
4355 + };
4356 + this.storage.setItem(componentName, deleteKeys(oldData, newData));
4357 + }
4358 + } else {
4359 + for (var key in this.storage.getAll()) {
4360 + if (key === requestData.endpoint) {
4361 + this.storage.removeItem(requestData.endpoint);
4362 + result = true;
4363 + break;
4364 + }
4365 + }
4366 + }
4367 + return result;
4368 + }
4369 + }]);
4370 + return Cache;
4371 +}();
4372 +exports["default"] = Cache;
4373 +
4374 +/***/ }),
4375 +
4376 +/***/ "../modules/web-cli/assets/js/core/data/errors/base-error.js":
4377 +/*!*******************************************************************!*\
4378 + !*** ../modules/web-cli/assets/js/core/data/errors/base-error.js ***!
4379 + \*******************************************************************/
4380 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
4381 +
4382 +"use strict";
4383 +
4384 +
4385 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
4386 +Object.defineProperty(exports, "__esModule", ({
4387 + value: true
4388 +}));
4389 +exports["default"] = void 0;
4390 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
4391 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
4392 +var _assertThisInitialized2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ "../node_modules/@babel/runtime/helpers/assertThisInitialized.js"));
4393 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
4394 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
4395 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
4396 +var _wrapNativeSuper2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/wrapNativeSuper */ "../node_modules/@babel/runtime/helpers/wrapNativeSuper.js"));
4397 +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
4398 +var _console = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/console */ "../modules/web-cli/assets/js/utils/console.js"));
4399 +var _forceMethodImplementation = _interopRequireDefault(__webpack_require__(/*! ../../../utils/force-method-implementation */ "../modules/web-cli/assets/js/utils/force-method-implementation.js"));
4400 +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; }
4401 +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; }
4402 +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); }; }
4403 +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; } }
4404 +var BaseError = /*#__PURE__*/function (_Error) {
4405 + (0, _inherits2.default)(BaseError, _Error);
4406 + var _super = _createSuper(BaseError);
4407 + /**
4408 + * Error constructor.
4409 + *
4410 + * @param {string} message
4411 + * @param {string} code
4412 + * @param {*} data
4413 + */
4414 + function BaseError() {
4415 + var _this;
4416 + var message = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
4417 + var code = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
4418 + var data = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
4419 + (0, _classCallCheck2.default)(this, BaseError);
4420 + _this = _super.call(this, message);
4421 + (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "code", '');
4422 + (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "data", []);
4423 + _this.code = code;
4424 + _this.data = data;
4425 + return _this;
4426 + }
4427 +
4428 + /**
4429 + * Notify a message when the error occurs.
4430 + */
4431 + (0, _createClass2.default)(BaseError, [{
4432 + key: "notify",
4433 + value: function notify() {
4434 + _console.default.error(_objectSpread({
4435 + message: this.message
4436 + }, this));
4437 + }
4438 + }], [{
4439 + key: "create",
4440 + value:
4441 + /**
4442 + * The server error code.
4443 + *
4444 + * @type {string}
4445 + */
4446 +
4447 + /**
4448 + * Additional data about the current error.
4449 + *
4450 + * @type {*[]}
4451 + */
4452 +
4453 + /**
4454 + * Static helper function to create the error.
4455 + *
4456 + * @param {string} message
4457 + * @param {string} code
4458 + * @param {*} data
4459 + * @return {BaseError} error
4460 + */
4461 + function create(message) {
4462 + var code = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
4463 + var data = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
4464 + return new this(message, code, data);
4465 + }
4466 +
4467 + /**
4468 + * Returns the status code of the error.
4469 + */
4470 + }, {
4471 + key: "getHTTPErrorCode",
4472 + value: function getHTTPErrorCode() {
4473 + (0, _forceMethodImplementation.default)();
4474 + }
4475 + }]);
4476 + return BaseError;
4477 +}( /*#__PURE__*/(0, _wrapNativeSuper2.default)(Error));
4478 +exports["default"] = BaseError;
4479 +
4480 +/***/ }),
4481 +
4482 +/***/ "../modules/web-cli/assets/js/core/data/errors/default-error.js":
4483 +/*!**********************************************************************!*\
4484 + !*** ../modules/web-cli/assets/js/core/data/errors/default-error.js ***!
4485 + \**********************************************************************/
4486 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
4487 +
4488 +"use strict";
4489 +
4490 +
4491 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
4492 +Object.defineProperty(exports, "__esModule", ({
4493 + value: true
4494 +}));
4495 +exports["default"] = exports.DefaultError = void 0;
4496 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
4497 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
4498 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
4499 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
4500 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
4501 +var _baseError = _interopRequireDefault(__webpack_require__(/*! ./base-error */ "../modules/web-cli/assets/js/core/data/errors/base-error.js"));
4502 +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); }; }
4503 +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; } }
4504 +var DefaultError = /*#__PURE__*/function (_BaseError) {
4505 + (0, _inherits2.default)(DefaultError, _BaseError);
4506 + var _super = _createSuper(DefaultError);
4507 + function DefaultError() {
4508 + (0, _classCallCheck2.default)(this, DefaultError);
4509 + return _super.apply(this, arguments);
4510 + }
4511 + (0, _createClass2.default)(DefaultError, null, [{
4512 + key: "getHTTPErrorCode",
4513 + value: function getHTTPErrorCode() {
4514 + return 501;
4515 + }
4516 + }]);
4517 + return DefaultError;
4518 +}(_baseError.default);
4519 +exports.DefaultError = DefaultError;
4520 +var _default = DefaultError;
4521 +exports["default"] = _default;
4522 +
4523 +/***/ }),
4524 +
4525 +/***/ "../modules/web-cli/assets/js/core/data/errors/error-404.js":
4526 +/*!******************************************************************!*\
4527 + !*** ../modules/web-cli/assets/js/core/data/errors/error-404.js ***!
4528 + \******************************************************************/
4529 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
4530 +
4531 +"use strict";
4532 +
4533 +
4534 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
4535 +Object.defineProperty(exports, "__esModule", ({
4536 + value: true
4537 +}));
4538 +exports["default"] = exports.Error404 = void 0;
4539 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
4540 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
4541 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
4542 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
4543 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
4544 +var _baseError = _interopRequireDefault(__webpack_require__(/*! ./base-error */ "../modules/web-cli/assets/js/core/data/errors/base-error.js"));
4545 +var _console = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/console */ "../modules/web-cli/assets/js/utils/console.js"));
4546 +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); }; }
4547 +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; } }
4548 +var Error404 = /*#__PURE__*/function (_BaseError) {
4549 + (0, _inherits2.default)(Error404, _BaseError);
4550 + var _super = _createSuper(Error404);
4551 + function Error404() {
4552 + (0, _classCallCheck2.default)(this, Error404);
4553 + return _super.apply(this, arguments);
4554 + }
4555 + (0, _createClass2.default)(Error404, [{
4556 + key: "notify",
4557 + value: function notify() {
4558 + _console.default.warn(this.message);
4559 + }
4560 + }], [{
4561 + key: "getHTTPErrorCode",
4562 + value: function getHTTPErrorCode() {
4563 + return 404;
4564 + }
4565 + }]);
4566 + return Error404;
4567 +}(_baseError.default);
4568 +exports.Error404 = Error404;
4569 +var _default = Error404;
4570 +exports["default"] = _default;
4571 +
4572 +/***/ }),
4573 +
4574 +/***/ "../modules/web-cli/assets/js/core/data/errors/index.js":
4575 +/*!**************************************************************!*\
4576 + !*** ../modules/web-cli/assets/js/core/data/errors/index.js ***!
4577 + \**************************************************************/
4578 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
4579 +
4580 +"use strict";
4581 +
4582 +
4583 +Object.defineProperty(exports, "__esModule", ({
4584 + value: true
4585 +}));
4586 +Object.defineProperty(exports, "DefaultError", ({
4587 + enumerable: true,
4588 + get: function get() {
4589 + return _defaultError.DefaultError;
4590 + }
4591 +}));
4592 +Object.defineProperty(exports, "Error404", ({
4593 + enumerable: true,
4594 + get: function get() {
4595 + return _error.Error404;
4596 + }
4597 +}));
4598 +var _defaultError = __webpack_require__(/*! ./default-error */ "../modules/web-cli/assets/js/core/data/errors/default-error.js");
4599 +var _error = __webpack_require__(/*! ./error-404 */ "../modules/web-cli/assets/js/core/data/errors/error-404.js");
4600 +
4601 +/***/ }),
4602 +
4603 +/***/ "../modules/web-cli/assets/js/core/data/storages/base-prefix-storage.js":
4604 +/*!******************************************************************************!*\
4605 + !*** ../modules/web-cli/assets/js/core/data/storages/base-prefix-storage.js ***!
4606 + \******************************************************************************/
4607 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
4608 +
4609 +"use strict";
4610 +
4611 +
4612 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
4613 +Object.defineProperty(exports, "__esModule", ({
4614 + value: true
4615 +}));
4616 +exports["default"] = void 0;
4617 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
4618 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
4619 +var _get2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/get */ "../node_modules/@babel/runtime/helpers/get.js"));
4620 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
4621 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
4622 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
4623 +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
4624 +var _baseStorage = _interopRequireDefault(__webpack_require__(/*! elementor-api/core/data/storages/base-storage */ "../modules/web-cli/assets/js/core/data/storages/base-storage.js"));
4625 +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); }; }
4626 +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; } }
4627 +var BasePrefixStorage = /*#__PURE__*/function (_BaseStorage) {
4628 + (0, _inherits2.default)(BasePrefixStorage, _BaseStorage);
4629 + var _super = _createSuper(BasePrefixStorage);
4630 + function BasePrefixStorage() {
4631 + (0, _classCallCheck2.default)(this, BasePrefixStorage);
4632 + return _super.apply(this, arguments);
4633 + }
4634 + (0, _createClass2.default)(BasePrefixStorage, [{
4635 + key: "clear",
4636 + value: function clear() {
4637 + var _this = this;
4638 + Object.keys(this.getAll()).forEach(function (key) {
4639 + return _this.removeItem(key);
4640 + });
4641 + }
4642 + }, {
4643 + key: "getItem",
4644 + value: function getItem(key) {
4645 + return (0, _get2.default)((0, _getPrototypeOf2.default)(BasePrefixStorage.prototype), "getItem", this).call(this, BasePrefixStorage.DEFAULT_KEY_PREFIX + key);
4646 + }
4647 + }, {
4648 + key: "removeItem",
4649 + value: function removeItem(key) {
4650 + return (0, _get2.default)((0, _getPrototypeOf2.default)(BasePrefixStorage.prototype), "removeItem", this).call(this, BasePrefixStorage.DEFAULT_KEY_PREFIX + key);
4651 + }
4652 + }, {
4653 + key: "setItem",
4654 + value: function setItem(key, value) {
4655 + return (0, _get2.default)((0, _getPrototypeOf2.default)(BasePrefixStorage.prototype), "setItem", this).call(this, BasePrefixStorage.DEFAULT_KEY_PREFIX + key, value);
4656 + }
4657 + }, {
4658 + key: "getAll",
4659 + value: function getAll() {
4660 + var _this2 = this;
4661 + var DEFAULT_KEY_PREFIX = BasePrefixStorage.DEFAULT_KEY_PREFIX,
4662 + keys = Object.keys(this.provider),
4663 + result = {};
4664 + keys.forEach(function (key) {
4665 + if (key.startsWith(DEFAULT_KEY_PREFIX)) {
4666 + key = key.replace(DEFAULT_KEY_PREFIX, '');
4667 + result[key] = _this2.getItem(key);
4668 + }
4669 + });
4670 + return result;
4671 + }
4672 + }]);
4673 + return BasePrefixStorage;
4674 +}(_baseStorage.default);
4675 +exports["default"] = BasePrefixStorage;
4676 +(0, _defineProperty2.default)(BasePrefixStorage, "DEFAULT_KEY_PREFIX", 'e_');
4677 +
4678 +/***/ }),
4679 +
4680 +/***/ "../modules/web-cli/assets/js/core/data/storages/base-storage.js":
4681 +/*!***********************************************************************!*\
4682 + !*** ../modules/web-cli/assets/js/core/data/storages/base-storage.js ***!
4683 + \***********************************************************************/
4684 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
4685 +
4686 +"use strict";
4687 +
4688 +
4689 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
4690 +Object.defineProperty(exports, "__esModule", ({
4691 + value: true
4692 +}));
4693 +exports["default"] = void 0;
4694 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
4695 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
5404 4696 /**
5405 - * @typedef {import('./states/ui-state-base')} UiStateBase
5406 - */
5407 - var UiStates = /*#__PURE__*/ function() {
5408 - /**
5409 - * Initialize the State Manager.
5410 - *
5411 - * @return {void}
5412 - */
5413 - function UiStates() {
5414 - _classCallCheck(this, UiStates);
5415 - this.states = {};
5416 - }
5417 - /**
5418 - * Register a new state.
5419 - *
5420 - * @param {UiStateBase} instance - State instance.
5421 - */
5422 - return _createClass(UiStates, [
5423 - {
5424 - key: "register",
5425 - value: function register(instance) {
5426 - var stateId = instance.getPrefixedId();
5427 - if (this.states[stateId]) throw "State '".concat(stateId, "' already exists.");
5428 - this.states[stateId] = instance;
5429 - }
5430 - },
5431 - {
5432 - key: "getAll",
5433 - value: function getAll() {
5434 - var states = {};
5435 - Object.entries(this.states).forEach(function(_ref) {
5436 - var _ref2 = _slicedToArray(_ref, 2);
5437 - var id = _ref2[0];
5438 - var options = _ref2[1].getOptions();
5439 - states[id] = Object.keys(options);
5440 - });
5441 - return states;
5442 - }
5443 - },
5444 - {
5445 - key: "get",
5446 - value: function get(state) {
5447 - if (state) return this.states[state];
5448 - return this.states;
5449 - }
5450 - },
5451 - {
5452 - key: "set",
5453 - value: function set(state, value) {
5454 - if (!this.get(state)) throw "State '".concat(state, "' doesn't exist.");
5455 - var oldValue = this.getCurrent(state);
5456 - var classPrefix = "e-ui-state--".concat(state.replaceAll("/", "-"));
5457 - var oldStateClass = "".concat(classPrefix, "__").concat(oldValue);
5458 - var newStateClass = "".concat(classPrefix, "__").concat(value);
5459 - var scopes = this.get(state).getScopes();
5460 - this.get(state).set(value);
5461 - scopes.forEach(function(scope) {
5462 - scope.classList.remove(oldStateClass);
5463 - if (value) scope.classList.add(newStateClass);
5464 - var event = new CustomEvent("e-ui-state:".concat(state), { detail: {
5465 - oldValue,
5466 - newValue: value
5467 - } });
5468 - scope.dispatchEvent(event);
5469 - });
5470 - }
5471 - },
5472 - {
5473 - key: "remove",
5474 - value: function remove(state) {
5475 - this.set(state, "");
5476 - }
5477 - },
5478 - {
5479 - key: "getCurrent",
5480 - value: function getCurrent(state) {
5481 - var _this$get;
5482 - return (_this$get = this.get(state)) === null || _this$get === void 0 ? void 0 : _this$get.getCurrent();
5483 - }
5484 - }
5485 - ]);
5486 - }();
4697 + * TODO: Merge all storage's to one.
4698 + * Using this technique give's the ability to use JSDOC from 'window.storage'.
4699 + *
4700 + * @implements {Storage}
4701 + */
4702 +var BaseStorage = /*#__PURE__*/function () {
4703 + /**
4704 + * Create storage wrapper.
4705 + *
4706 + * @param {Storage} provider
4707 + */
4708 + function BaseStorage(provider) {
4709 + (0, _classCallCheck2.default)(this, BaseStorage);
4710 + if (BaseStorage === (this instanceof BaseStorage ? this.constructor : void 0)) {
4711 + throw new TypeError('Cannot construct BaseStorage instances directly');
4712 + }
4713 + this.provider = provider;
4714 + }
4715 + (0, _createClass2.default)(BaseStorage, [{
4716 + key: "clear",
4717 + value: function clear() {
4718 + return this.provider.clear();
4719 + }
4720 + }, {
4721 + key: "getItem",
4722 + value: function getItem(key) {
4723 + var result = this.provider.getItem(key);
4724 + if (null !== result) {
4725 + return JSON.parse(result);
4726 + }
4727 + return result;
4728 + }
4729 + }, {
4730 + key: "key",
4731 + value: function key(index) {
4732 + return this.provider.key(index);
4733 + }
4734 + }, {
4735 + key: "removeItem",
4736 + value: function removeItem(key) {
4737 + return this.provider.removeItem(key);
4738 + }
4739 + }, {
4740 + key: "setItem",
4741 + value: function setItem(key, value) {
4742 + return this.provider.setItem(key, JSON.stringify(value));
4743 + }
4744 + }, {
4745 + key: "getAll",
4746 + value: function getAll() {
4747 + var _this = this;
4748 + var keys = Object.keys(this.provider),
4749 + result = {};
4750 + keys.forEach(function (key) {
4751 + result[key] = _this.getItem(key);
4752 + });
4753 + return result;
4754 + }
4755 + }]);
4756 + return BaseStorage;
4757 +}();
4758 +exports["default"] = BaseStorage;
5487 4759
5488 -//#endregion
5489 -//#region modules/web-cli/assets/js/modules/hook-base.js
5490 - var HookBase = /*#__PURE__*/ function() {
5491 - /**
5492 - * Function constructor().
5493 - *
5494 - * Create callback base.
5495 - */
5496 - function HookBase() {
5497 - _classCallCheck(this, HookBase);
5498 - /**
5499 - * Callback type, eg ( hook, event ).
5500 - *
5501 - * @type {string}
5502 - */
5503 - _defineProperty(this, "type", void 0);
5504 - /**
5505 - * Full command address, that will hook the callback.
5506 - *
5507 - * @type {string}
5508 - */
5509 - _defineProperty(this, "command", void 0);
5510 - /**
5511 - * Unique id of the callback.
5512 - *
5513 - * @type {string}
5514 - */
5515 - _defineProperty(this, "id", void 0);
5516 - this.initialize();
5517 - this.type = this.getType();
5518 - this.command = this.getCommand();
5519 - this.id = this.getId();
5520 - }
5521 - /**
5522 - * Function initialize().
5523 - *
5524 - * Called after creation of the base, used for initialize extras.
5525 - * Without expending constructor.
5526 - */
5527 - return _createClass(HookBase, [
5528 - {
5529 - key: "initialize",
5530 - value: function initialize() {}
5531 - },
5532 - {
5533 - key: "register",
5534 - value: function register() {
5535 - force_method_implementation_default();
5536 - }
5537 - },
5538 - {
5539 - key: "getType",
5540 - value: function getType() {
5541 - force_method_implementation_default();
5542 - }
5543 - },
5544 - {
5545 - key: "getCommand",
5546 - value: function getCommand() {
5547 - force_method_implementation_default();
5548 - }
5549 - },
5550 - {
5551 - key: "getId",
5552 - value: function getId() {
5553 - force_method_implementation_default();
5554 - }
5555 - },
5556 - {
5557 - key: "getContainerType",
5558 - value: function getContainerType() {}
5559 - },
5560 - {
5561 - key: "getConditions",
5562 - value: function getConditions() {
5563 - arguments.length > 0 && arguments[0] !== void 0 && arguments[0];
5564 - arguments.length > 1 && arguments[1];
5565 - return true;
5566 - }
5567 - },
5568 - {
5569 - key: "apply",
5570 - value: function apply(args) {
5571 - force_method_implementation_default();
5572 - }
5573 - },
5574 - {
5575 - key: "run",
5576 - value: function run() {
5577 - var _ref$options = (arguments.length <= 0 ? void 0 : arguments[0]).options;
5578 - var options = _ref$options === void 0 ? {} : _ref$options;
5579 - if (options.callbacks && false === options.callbacks[this.id]) return true;
5580 - if (this.getConditions.apply(this, arguments)) {
5581 - if ($e.devTools) $e.devTools.log.callbacks().active(this.type, this.command, this.id);
5582 - return this.apply.apply(this, arguments);
5583 - }
5584 - return true;
5585 - }
5586 - }
5587 - ]);
5588 - }();
4760 +/***/ }),
5589 4761
5590 -//#endregion
5591 -//#region modules/web-cli/assets/js/modules/hooks/data/base.js
5592 - function _callSuper$7(t, o, e) {
5593 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$7() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
5594 - }
5595 - __name(_callSuper$7, "_callSuper");
5596 - function _isNativeReflectConstruct$7() {
5597 - try {
5598 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
5599 - } catch (t) {}
5600 - return (_isNativeReflectConstruct$7 = function _isNativeReflectConstruct() {
5601 - return !!t;
5602 - })();
5603 - }
5604 - __name(_isNativeReflectConstruct$7, "_isNativeReflectConstruct");
5605 - var Base$1 = /*#__PURE__*/ function(_HookBase) {
5606 - function Base() {
5607 - _classCallCheck(this, Base);
5608 - return _callSuper$7(this, Base, arguments);
5609 - }
5610 - _inherits(Base, _HookBase);
5611 - return _createClass(Base, [{
5612 - key: "getType",
5613 - value: function getType() {
5614 - return "data";
5615 - }
5616 - }]);
5617 - }(HookBase);
4762 +/***/ "../modules/web-cli/assets/js/core/data/storages/local-storage.js":
4763 +/*!************************************************************************!*\
4764 + !*** ../modules/web-cli/assets/js/core/data/storages/local-storage.js ***!
4765 + \************************************************************************/
4766 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
5618 4767
5619 -//#endregion
5620 -//#region modules/web-cli/assets/js/modules/hooks/data/after.js
5621 - function _callSuper$6(t, o, e) {
5622 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$6() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
5623 - }
5624 - __name(_callSuper$6, "_callSuper");
5625 - function _isNativeReflectConstruct$6() {
5626 - try {
5627 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
5628 - } catch (t) {}
5629 - return (_isNativeReflectConstruct$6 = function _isNativeReflectConstruct() {
5630 - return !!t;
5631 - })();
5632 - }
5633 - __name(_isNativeReflectConstruct$6, "_isNativeReflectConstruct");
5634 - var After$1 = /*#__PURE__*/ function(_Base) {
5635 - function After() {
5636 - _classCallCheck(this, After);
5637 - return _callSuper$6(this, After, arguments);
5638 - }
5639 - _inherits(After, _Base);
5640 - return _createClass(After, [{
5641 - key: "register",
5642 - value: function register() {
5643 - $e.hooks.registerDataAfter(this);
5644 - }
5645 - }]);
5646 - }(Base$1);
4768 +"use strict";
5647 4769
5648 -//#endregion
5649 -//#region modules/web-cli/assets/js/modules/hooks/data/catch.js
5650 - function _callSuper$5(t, o, e) {
5651 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$5() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
5652 - }
5653 - __name(_callSuper$5, "_callSuper");
5654 - function _isNativeReflectConstruct$5() {
5655 - try {
5656 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
5657 - } catch (t) {}
5658 - return (_isNativeReflectConstruct$5 = function _isNativeReflectConstruct() {
5659 - return !!t;
5660 - })();
5661 - }
5662 - __name(_isNativeReflectConstruct$5, "_isNativeReflectConstruct");
5663 - var Catch$1 = /*#__PURE__*/ function(_Base) {
5664 - function Catch() {
5665 - _classCallCheck(this, Catch);
5666 - return _callSuper$5(this, Catch, arguments);
5667 - }
5668 - _inherits(Catch, _Base);
5669 - return _createClass(Catch, [{
5670 - key: "register",
5671 - value: function register() {
5672 - $e.hooks.registerDataCatch(this);
5673 - }
5674 - }]);
5675 - }(Base$1);
5676 4770
5677 -//#endregion
5678 -//#region modules/web-cli/assets/js/modules/hooks/data/dependency.js
5679 - function _callSuper$4(t, o, e) {
5680 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$4() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
5681 - }
5682 - __name(_callSuper$4, "_callSuper");
5683 - function _isNativeReflectConstruct$4() {
5684 - try {
5685 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
5686 - } catch (t) {}
5687 - return (_isNativeReflectConstruct$4 = function _isNativeReflectConstruct() {
5688 - return !!t;
5689 - })();
5690 - }
5691 - __name(_isNativeReflectConstruct$4, "_isNativeReflectConstruct");
5692 - var Dependency = /*#__PURE__*/ function(_Base) {
5693 - function Dependency() {
5694 - _classCallCheck(this, Dependency);
5695 - return _callSuper$4(this, Dependency, arguments);
5696 - }
5697 - _inherits(Dependency, _Base);
5698 - return _createClass(Dependency, [{
5699 - key: "register",
5700 - value: function register() {
5701 - $e.hooks.registerDataDependency(this);
5702 - }
5703 - }]);
5704 - }(Base$1);
4771 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
4772 +Object.defineProperty(exports, "__esModule", ({
4773 + value: true
4774 +}));
4775 +exports["default"] = void 0;
4776 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
4777 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
4778 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
4779 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
4780 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
4781 +var _basePrefixStorage = _interopRequireDefault(__webpack_require__(/*! ./base-prefix-storage */ "../modules/web-cli/assets/js/core/data/storages/base-prefix-storage.js"));
4782 +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); }; }
4783 +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; } }
4784 +var LocalStorage = /*#__PURE__*/function (_BasePrefixStorage) {
4785 + (0, _inherits2.default)(LocalStorage, _BasePrefixStorage);
4786 + var _super = _createSuper(LocalStorage);
4787 + function LocalStorage() {
4788 + (0, _classCallCheck2.default)(this, LocalStorage);
4789 + return _super.call(this, localStorage);
4790 + }
4791 + (0, _createClass2.default)(LocalStorage, [{
4792 + key: "debug",
4793 + value: function debug() {
4794 + var entries = this.getAll(),
4795 + ordered = {};
4796 + Object.keys(entries).sort().forEach(function (key) {
4797 + var value = entries[key];
4798 + ordered[key] = value;
4799 + });
4800 + return ordered;
4801 + }
4802 + }]);
4803 + return LocalStorage;
4804 +}(_basePrefixStorage.default);
4805 +exports["default"] = LocalStorage;
5705 4806
5706 -//#endregion
5707 -//#region modules/web-cli/assets/js/modules/hooks/data/index.js
5708 - var data_exports = /* @__PURE__ */ __exportAll({
5709 - After: () => After$1,
5710 - Base: () => Base$1,
5711 - Catch: () => Catch$1,
5712 - Dependency: () => Dependency
5713 - });
4807 +/***/ }),
5714 4808
5715 -//#endregion
5716 -//#region modules/web-cli/assets/js/modules/hooks/ui/base.js
5717 - function _callSuper$3(t, o, e) {
5718 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$3() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
5719 - }
5720 - __name(_callSuper$3, "_callSuper");
5721 - function _isNativeReflectConstruct$3() {
5722 - try {
5723 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
5724 - } catch (t) {}
5725 - return (_isNativeReflectConstruct$3 = function _isNativeReflectConstruct() {
5726 - return !!t;
5727 - })();
5728 - }
5729 - __name(_isNativeReflectConstruct$3, "_isNativeReflectConstruct");
5730 - var Base = /*#__PURE__*/ function(_HookBase) {
5731 - function Base() {
5732 - _classCallCheck(this, Base);
5733 - return _callSuper$3(this, Base, arguments);
5734 - }
5735 - _inherits(Base, _HookBase);
5736 - return _createClass(Base, [{
5737 - key: "getType",
5738 - value: function getType() {
5739 - return "ui";
5740 - }
5741 - }]);
5742 - }(HookBase);
4809 +/***/ "../modules/web-cli/assets/js/core/hooks.js":
4810 +/*!**************************************************!*\
4811 + !*** ../modules/web-cli/assets/js/core/hooks.js ***!
4812 + \**************************************************/
4813 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
5743 4814
5744 -//#endregion
5745 -//#region modules/web-cli/assets/js/modules/hooks/ui/after.js
5746 - function _callSuper$2(t, o, e) {
5747 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$2() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
5748 - }
5749 - __name(_callSuper$2, "_callSuper");
5750 - function _isNativeReflectConstruct$2() {
5751 - try {
5752 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
5753 - } catch (t) {}
5754 - return (_isNativeReflectConstruct$2 = function _isNativeReflectConstruct() {
5755 - return !!t;
5756 - })();
5757 - }
5758 - __name(_isNativeReflectConstruct$2, "_isNativeReflectConstruct");
5759 - var After = /*#__PURE__*/ function(_Base) {
5760 - function After() {
5761 - _classCallCheck(this, After);
5762 - return _callSuper$2(this, After, arguments);
5763 - }
5764 - _inherits(After, _Base);
5765 - return _createClass(After, [{
5766 - key: "register",
5767 - value: function register() {
5768 - $e.hooks.registerUIAfter(this);
5769 - }
5770 - }]);
5771 - }(Base);
4815 +"use strict";
5772 4816
5773 -//#endregion
5774 -//#region modules/web-cli/assets/js/modules/hooks/ui/before.js
5775 - function _callSuper$1(t, o, e) {
5776 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$1() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
5777 - }
5778 - __name(_callSuper$1, "_callSuper");
5779 - function _isNativeReflectConstruct$1() {
5780 - try {
5781 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
5782 - } catch (t) {}
5783 - return (_isNativeReflectConstruct$1 = function _isNativeReflectConstruct() {
5784 - return !!t;
5785 - })();
5786 - }
5787 - __name(_isNativeReflectConstruct$1, "_isNativeReflectConstruct");
5788 - var Before = /*#__PURE__*/ function(_Base) {
5789 - function Before() {
5790 - _classCallCheck(this, Before);
5791 - return _callSuper$1(this, Before, arguments);
5792 - }
5793 - _inherits(Before, _Base);
5794 - return _createClass(Before, [{
5795 - key: "register",
5796 - value: function register() {
5797 - $e.hooks.registerUIBefore(this);
5798 - }
5799 - }]);
5800 - }(Base);
5801 4817
5802 -//#endregion
5803 -//#region modules/web-cli/assets/js/modules/hooks/ui/catch.js
5804 - function _callSuper(t, o, e) {
5805 - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
5806 - }
5807 - function _isNativeReflectConstruct() {
5808 - try {
5809 - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
5810 - } catch (t) {}
5811 - return (_isNativeReflectConstruct = function _isNativeReflectConstruct() {
5812 - return !!t;
5813 - })();
5814 - }
5815 - var Catch = /*#__PURE__*/ function(_Base) {
5816 - function Catch() {
5817 - _classCallCheck(this, Catch);
5818 - return _callSuper(this, Catch, arguments);
5819 - }
5820 - _inherits(Catch, _Base);
5821 - return _createClass(Catch, [{
5822 - key: "register",
5823 - value: function register() {
5824 - $e.hooks.registerUICatch(this);
5825 - }
5826 - }]);
5827 - }(Base);
4818 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
4819 +Object.defineProperty(exports, "__esModule", ({
4820 + value: true
4821 +}));
4822 +exports["default"] = void 0;
4823 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
4824 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
4825 +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
4826 +var _data = _interopRequireDefault(__webpack_require__(/*! ./hooks/data.js */ "../modules/web-cli/assets/js/core/hooks/data.js"));
4827 +var _ui = _interopRequireDefault(__webpack_require__(/*! ./hooks/ui.js */ "../modules/web-cli/assets/js/core/hooks/ui.js"));
4828 +/**
4829 + * @typedef {import('../modules/hook-base')} HookBase
4830 + */
4831 +var Hooks = /*#__PURE__*/function () {
4832 + function Hooks() {
4833 + (0, _classCallCheck2.default)(this, Hooks);
4834 + (0, _defineProperty2.default)(this, "data", new _data.default());
4835 + (0, _defineProperty2.default)(this, "ui", new _ui.default());
4836 + }
4837 + (0, _createClass2.default)(Hooks, [{
4838 + key: "activate",
4839 + value:
4840 + /**
4841 + * Function activate().
4842 + *
4843 + * Activate all hooks.
4844 + */
4845 + function activate() {
4846 + this.getTypes().forEach(function (hooksType) {
4847 + hooksType.activate();
4848 + });
4849 + }
5828 4850
5829 -//#endregion
5830 -//#region modules/web-cli/assets/js/modules/hooks/ui/index.js
5831 - var ui_exports = /* @__PURE__ */ __exportAll({
5832 - After: () => After,
5833 - Base: () => Base,
5834 - Before: () => Before,
5835 - Catch: () => Catch
5836 - });
4851 + /**
4852 + * Function deactivate().
4853 + *
4854 + * Deactivate all hooks.
4855 + */
4856 + }, {
4857 + key: "deactivate",
4858 + value: function deactivate() {
4859 + this.getTypes().forEach(function (hooksType) {
4860 + hooksType.deactivate();
4861 + });
4862 + }
4863 + }, {
4864 + key: "getAll",
4865 + value: function getAll() {
4866 + var flat = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
4867 + var result = {};
4868 + this.getTypes().forEach(function (hooksType) {
4869 + result[hooksType.getType()] = hooksType.getAll(flat);
4870 + });
4871 + return result;
4872 + }
4873 + }, {
4874 + key: "getTypes",
4875 + value: function getTypes() {
4876 + return [this.data, this.ui];
4877 + }
4878 + }, {
4879 + key: "getType",
4880 + value: function getType(type) {
4881 + return this.getTypes().find(function (hooks) {
4882 + return type === hooks.getType();
4883 + });
4884 + }
5837 4885
5838 -//#endregion
5839 -//#region modules/web-cli/assets/js/api.js
5840 - var API = /*#__PURE__*/ function() {
5841 - /**
5842 - * Function constructor().
5843 - *
5844 - * Create's 'elementor' api.
5845 - */
5846 - function API() {
5847 - _classCallCheck(this, API);
5848 - this.components = new _default();
5849 - this.commands = new Commands();
5850 - this.commandsInternal = new CommandsInternal();
5851 - this.hooks = new Hooks();
5852 - this.routes = new Routes();
5853 - this.shortcuts = new Shortcuts(jQuery(window));
5854 - this.data = new Data$1();
5855 - this.store = new Store();
5856 - this.uiStates = new UiStates();
5857 - this.modules = {
5858 - CommandBase,
5859 - CommandInternalBase,
5860 - CommandData,
5861 - ComponentBase,
5862 - ComponentModalBase,
5863 - HookBreak,
5864 - hookData: data_exports,
5865 - hookUI: ui_exports
5866 - };
5867 - this.extras = { hashCommands: new HashCommands() };
5868 - this.bc = new BackwardsCompatibility();
5869 - }
5870 - /**
5871 - * Function run().
5872 - *
5873 - * Alias of `$e.commands.run()`.
5874 - *
5875 - * @param {string} command
5876 - * @param {*} [args={}]
5877 - *
5878 - * @return {*} result
5879 - */
5880 - return _createClass(API, [
5881 - {
5882 - key: "run",
5883 - value: function run(command) {
5884 - var args = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
5885 - return $e.commands.run(command, args);
5886 - }
5887 - },
5888 - {
5889 - key: "internal",
5890 - value: function internal(command) {
5891 - var args = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
5892 - return $e.commandsInternal.run(command, args);
5893 - }
5894 - },
5895 - {
5896 - key: "route",
5897 - value: function route(_route) {
5898 - var args = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
5899 - var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : { history: true };
5900 - return $e.routes.to(_route, args, options);
5901 - }
5902 - }
5903 - ]);
5904 - }();
4886 + /**
4887 + * Function register().
4888 + *
4889 + * Register hook.
4890 + *
4891 + * @param {string} type
4892 + * @param {string} event
4893 + * @param {HookBase} instance
4894 + *
4895 + * @return {{}} Created callback
4896 + */
4897 + }, {
4898 + key: "register",
4899 + value: function register(type, event, instance) {
4900 + return this.getType(type).register(event, instance);
4901 + }
5905 4902
5906 -//#endregion
5907 -//#region modules/web-cli/assets/js/index.js
5908 - window.$e = new API();
4903 + /**
4904 + * Function run().
4905 + *
4906 + * Run's a hook.
4907 + *
4908 + * @param {string} type
4909 + * @param {string} event
4910 + * @param {string} command
4911 + * @param {{}} args
4912 + * @param {*} result
4913 + *
4914 + * @return {boolean} result
4915 + */
4916 + }, {
4917 + key: "run",
4918 + value: function run(type, event, command, args) {
4919 + var result = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : undefined;
4920 + return this.getType(type).run(event, command, args, result);
4921 + }
5909 4922
5910 -//#endregion
5911 -})(elementorVendors.reduxToolkit);
4923 + /**
4924 + * Function registerDataAfter().
4925 + *
4926 + * Register data hook that's run after the command.
4927 + *
4928 + * @param {HookBase} instance
4929 + *
4930 + * @return {{}} callback
4931 + */
4932 + }, {
4933 + key: "registerDataAfter",
4934 + value: function registerDataAfter(instance) {
4935 + return this.register('data', 'after', instance);
4936 + }
4937 +
4938 + /**
4939 + * Function registerDataCatch().
4940 + *
4941 + * Register data hook that's run when the command fails.
4942 + *
4943 + * @param {HookBase} instance
4944 + *
4945 + * @return {{}} callback
4946 + */
4947 + }, {
4948 + key: "registerDataCatch",
4949 + value: function registerDataCatch(instance) {
4950 + return this.register('data', 'catch', instance);
4951 + }
4952 +
4953 + /**
4954 + * Function registerDataDependency().
4955 + *
4956 + * Register data hook that's run before the command as dependency.
4957 + *
4958 + * @param {HookBase} instance
4959 + *
4960 + * @return {{}} callback
4961 + */
4962 + }, {
4963 + key: "registerDataDependency",
4964 + value: function registerDataDependency(instance) {
4965 + return this.register('data', 'dependency', instance);
4966 + }
4967 +
4968 + /**
4969 + * Function registerUIAfter().
4970 + *
4971 + * Register UI hook that's run after the commands run.
4972 + *
4973 + * @param {HookBase} instance
4974 + *
4975 + * @return {{}} callback
4976 + */
4977 + }, {
4978 + key: "registerUIAfter",
4979 + value: function registerUIAfter(instance) {
4980 + return this.register('ui', 'after', instance);
4981 + }
4982 +
4983 + /**
4984 + * Function registerUICatch().
4985 + *
4986 + * Register UI hook that's run when the command fails.
4987 + *
4988 + * @param {HookBase} instance
4989 + *
4990 + * @return {{}} callback
4991 + */
4992 + }, {
4993 + key: "registerUICatch",
4994 + value: function registerUICatch(instance) {
4995 + return this.register('ui', 'catch', instance);
4996 + }
4997 +
4998 + /**
4999 + * Function registerUIBefore().
5000 + *
5001 + * Register UI hook that's run before the command.
5002 + *
5003 + * @param {HookBase} instance
5004 + *
5005 + * @return {{}} callback
5006 + */
5007 + }, {
5008 + key: "registerUIBefore",
5009 + value: function registerUIBefore(instance) {
5010 + return this.register('ui', 'before', instance);
5011 + }
5012 +
5013 + /**
5014 + * Function runDataAfter().
5015 + *
5016 + * Run data hook that's run after the command.
5017 + *
5018 + * @param {string} command
5019 + * @param {{}} args
5020 + * @param {*} result
5021 + *
5022 + * @return {boolean} result
5023 + */
5024 + }, {
5025 + key: "runDataAfter",
5026 + value: function runDataAfter(command, args, result) {
5027 + return this.run('data', 'after', command, args, result);
5028 + }
5029 +
5030 + /**
5031 + * Function runDataCatch().
5032 + *
5033 + * Run data hook that's run when the command fails.
5034 + *
5035 + * @param {string} command
5036 + * @param {{}} args
5037 + * @param {*} error
5038 + *
5039 + * @return {boolean} result
5040 + */
5041 + }, {
5042 + key: "runDataCatch",
5043 + value: function runDataCatch(command, args, error) {
5044 + return this.run('data', 'catch', command, args, error);
5045 + }
5046 +
5047 + /**
5048 + * Function runDataDependency().
5049 + *
5050 + * Run data hook that's run before the command as dependency.
5051 + *
5052 + * @param {string} command
5053 + * @param {{}} args
5054 + *
5055 + * @return {boolean} result
5056 + */
5057 + }, {
5058 + key: "runDataDependency",
5059 + value: function runDataDependency(command, args) {
5060 + return this.run('data', 'dependency', command, args);
5061 + }
5062 +
5063 + /**
5064 + * Function runUIAfter().
5065 + *
5066 + * Run UI hook that's run after the commands run.
5067 + *
5068 + * @param {string} command
5069 + * @param {{}} args
5070 + * @param {*} result
5071 + *
5072 + * @return {boolean} result
5073 + */
5074 + }, {
5075 + key: "runUIAfter",
5076 + value: function runUIAfter(command, args, result) {
5077 + return this.run('ui', 'after', command, args, result);
5078 + }
5079 +
5080 + /**
5081 + * Function runUICatch().
5082 + *
5083 + * Run UI hook that's run when the command fails.
5084 + *
5085 + * @param {string} command
5086 + * @param {{}} args
5087 + * @param {*} e
5088 + *
5089 + * @return {boolean} result
5090 + */
5091 + }, {
5092 + key: "runUICatch",
5093 + value: function runUICatch(command, args, e) {
5094 + return this.run('ui', 'catch', command, args, e);
5095 + }
5096 +
5097 + /**
5098 + * Function runUIBefore().
5099 + *
5100 + * Run UI hook that's run before the command.
5101 + *
5102 + * @param {string} command
5103 + * @param {{}} args
5104 + *
5105 + * @return {boolean} result
5106 + */
5107 + }, {
5108 + key: "runUIBefore",
5109 + value: function runUIBefore(command, args) {
5110 + return this.run('ui', 'before', command, args);
5111 + }
5112 + }]);
5113 + return Hooks;
5114 +}();
5115 +exports["default"] = Hooks;
5116 +
5117 +/***/ }),
5118 +
5119 +/***/ "../modules/web-cli/assets/js/core/hooks/base.js":
5120 +/*!*******************************************************!*\
5121 + !*** ../modules/web-cli/assets/js/core/hooks/base.js ***!
5122 + \*******************************************************/
5123 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
5124 +
5125 +"use strict";
5126 +
5127 +
5128 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
5129 +Object.defineProperty(exports, "__esModule", ({
5130 + value: true
5131 +}));
5132 +exports["default"] = void 0;
5133 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
5134 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
5135 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
5136 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
5137 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
5138 +var _console = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/console */ "../modules/web-cli/assets/js/utils/console.js"));
5139 +var _module = _interopRequireDefault(__webpack_require__(/*! elementor-assets-js/modules/imports/module.js */ "../assets/dev/js/modules/imports/module.js"));
5140 +var _forceMethodImplementation = _interopRequireDefault(__webpack_require__(/*! ../../utils/force-method-implementation */ "../modules/web-cli/assets/js/utils/force-method-implementation.js"));
5141 +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); }; }
5142 +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; } }
5143 +/**
5144 + * @typedef {import('../../modules/hook-base')} HookBase
5145 + */
5146 +var HooksBase = /*#__PURE__*/function (_Module) {
5147 + (0, _inherits2.default)(HooksBase, _Module);
5148 + var _super = _createSuper(HooksBase);
5149 + /**
5150 + * Function constructor().
5151 + *
5152 + * Create hooks base.
5153 + *
5154 + * @param {{}} args
5155 + */
5156 + function HooksBase() {
5157 + var _this;
5158 + (0, _classCallCheck2.default)(this, HooksBase);
5159 + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
5160 + args[_key] = arguments[_key];
5161 + }
5162 + _this = _super.call.apply(_super, [this].concat(args));
5163 +
5164 + /**
5165 + * Current command.
5166 + *
5167 + * @type {string}
5168 + */
5169 + _this.current = '';
5170 +
5171 + /**
5172 + * Array of ids which in use.
5173 + *
5174 + * @type {Array}
5175 + */
5176 + _this.usedIds = [];
5177 +
5178 + /**
5179 + * Object of callbacks that was bound by container type.
5180 + *
5181 + * @type {{}}
5182 + */
5183 + _this.callbacks = {
5184 + after: {},
5185 + catch: {}
5186 + };
5187 +
5188 + /**
5189 + * Object of depth.
5190 + *
5191 + * @type {{}}
5192 + */
5193 + _this.depth = {
5194 + after: {},
5195 + catch: {}
5196 + };
5197 + _this.callbacksFlatList = {};
5198 + return _this;
5199 + }
5200 + (0, _createClass2.default)(HooksBase, [{
5201 + key: "activate",
5202 + value: function activate() {
5203 + Object.values(this.getAll(true)).forEach(function (callback) {
5204 + callback.activate();
5205 + });
5206 + }
5207 + }, {
5208 + key: "deactivate",
5209 + value: function deactivate() {
5210 + Object.values(this.getAll(true)).forEach(function (callback) {
5211 + callback.deactivate();
5212 + });
5213 + }
5214 +
5215 + // eslint-disable-next-line jsdoc/require-returns-check
5216 + /**
5217 + * Function getType().
5218 + *
5219 + * Returns type eg: ( event, hook, etc ... ).
5220 + *
5221 + * @return {string} type
5222 + */
5223 + }, {
5224 + key: "getType",
5225 + value: function getType() {
5226 + (0, _forceMethodImplementation.default)();
5227 + }
5228 + }, {
5229 + key: "get",
5230 + value: function get(id) {
5231 + return this.callbacksFlatList[id];
5232 + }
5233 +
5234 + /**
5235 + * Function getAll().
5236 + *
5237 + * Return all possible callbacks.
5238 + *
5239 + * @param {boolean} flat
5240 + *
5241 + * @return {{}} all callbacks
5242 + */
5243 + }, {
5244 + key: "getAll",
5245 + value: function getAll() {
5246 + var _this2 = this;
5247 + var flat = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
5248 + if (flat) {
5249 + return this.callbacksFlatList;
5250 + }
5251 + var result = {};
5252 + Object.keys(this.callbacks).forEach(function (event) {
5253 + if (!result[event]) {
5254 + result[event] = [];
5255 + }
5256 + Object.keys(_this2.callbacks[event]).forEach(function (command) {
5257 + result[event].push({
5258 + command: command,
5259 + callbacks: _this2.callbacks[event][command]
5260 + });
5261 + });
5262 + });
5263 + return result;
5264 + }
5265 +
5266 + /**
5267 + * Function getCurrent();
5268 + *
5269 + * Return current command.
5270 + *
5271 + * @return {string} current command
5272 + */
5273 + }, {
5274 + key: "getCurrent",
5275 + value: function getCurrent() {
5276 + return this.current;
5277 + }
5278 +
5279 + /**
5280 + * Function getUsedIds().
5281 + *
5282 + * Returns the current used ids.
5283 + *
5284 + * @return {Array} used IDs
5285 + */
5286 + }, {
5287 + key: "getUsedIds",
5288 + value: function getUsedIds() {
5289 + return this.usedIds;
5290 + }
5291 +
5292 + /**
5293 + * Function getCallbacks().
5294 + *
5295 + * Get available callbacks for specific event and command.
5296 + *
5297 + * @param {string} event
5298 + * @param {string} command
5299 + * @param {*} args
5300 + * @return {(Array | boolean)} callbacks
5301 + */
5302 + }, {
5303 + key: "getCallbacks",
5304 + value: function getCallbacks(event, command, args) {
5305 + var _args$containers = args.containers,
5306 + containers = _args$containers === void 0 ? [args.container] : _args$containers,
5307 + containerType = containers[0] ? containers[0].type : false;
5308 + var callbacks = [];
5309 + if (this.callbacks[event] && this.callbacks[event][command]) {
5310 + if (containerType && this.callbacks[event][command][containerType]) {
5311 + callbacks = callbacks.concat(this.callbacks[event][command][containerType]);
5312 + }
5313 + if (this.callbacks[event][command].all) {
5314 + callbacks = callbacks.concat(this.callbacks[event][command].all);
5315 + }
5316 + }
5317 + if (callbacks.length) {
5318 + return callbacks;
5319 + }
5320 + return false;
5321 + }
5322 +
5323 + /**
5324 + * Function checkEvent().
5325 + *
5326 + * Validate if the event is available.
5327 + *
5328 + * @param {string} event
5329 + */
5330 + }, {
5331 + key: "checkEvent",
5332 + value: function checkEvent(event) {
5333 + if (-1 === Object.keys(this.callbacks).indexOf(event)) {
5334 + throw Error("".concat(this.getType(), ": '").concat(event, "' is not available."));
5335 + }
5336 + }
5337 +
5338 + /**
5339 + * Function checkInstance().
5340 + *
5341 + * Validate given instance.
5342 + *
5343 + * @param {HookBase} instance
5344 + */
5345 + }, {
5346 + key: "checkInstance",
5347 + value: function checkInstance(instance) {
5348 + if (instance.getType() !== this.getType()) {
5349 + throw new Error("invalid instance, please use: 'elementor-api/modules/hook-base.js'. ");
5350 + }
5351 + }
5352 +
5353 + /**
5354 + * Function checkId().
5355 + *
5356 + * Validate if the id is not used before.
5357 + *
5358 + * @param {string} id
5359 + */
5360 + }, {
5361 + key: "checkId",
5362 + value: function checkId(id) {
5363 + if (-1 !== this.usedIds.indexOf(id)) {
5364 + throw Error("id: '".concat(id, "' is already in use."));
5365 + }
5366 + }
5367 +
5368 + /**
5369 + * Function shouldRun().
5370 + *
5371 + * Determine if the event should run.
5372 + *
5373 + * @param {Array} callbacks
5374 + *
5375 + * @return {boolean} true if there are callbacks, otherwise false
5376 + *
5377 + * @throws {Error}
5378 + */
5379 + }, {
5380 + key: "shouldRun",
5381 + value: function shouldRun(callbacks) {
5382 + return !!callbacks && callbacks.length;
5383 + }
5384 +
5385 + /**
5386 + * Function register().
5387 + *
5388 + * Register the callback instance.
5389 + *
5390 + * @param {string} event
5391 + * @param {HookBase} instance
5392 + *
5393 + * @return {{}} Created callback
5394 + */
5395 + }, {
5396 + key: "register",
5397 + value: function register(event, instance) {
5398 + var command = instance.getCommand(),
5399 + id = instance.getId(),
5400 + containerType = instance.getContainerType();
5401 + this.checkEvent(event);
5402 + this.checkInstance(instance);
5403 + this.checkId(id);
5404 + return this.registerCallback(id, event, command, instance, containerType);
5405 + }
5406 +
5407 + /**
5408 + * Function registerCallback().
5409 + *
5410 + * Register callback.
5411 + *
5412 + * @param {string} id
5413 + * @param {string} event
5414 + * @param {string} command
5415 + * @param {HookBase} instance
5416 + * @param {string} containerType
5417 + *
5418 + * TODO: Consider replace with typedef.
5419 + * @return {{callback: *, id: *, isActive: boolean}} callback
5420 + */
5421 + }, {
5422 + key: "registerCallback",
5423 + value: function registerCallback(id, event, command, instance, containerType) {
5424 + if (!this.callbacks[event][command]) {
5425 + this.callbacks[event][command] = [];
5426 + }
5427 +
5428 + // Save used id(s).
5429 + this.usedIds.push(id);
5430 + if (!this.callbacks[event][command]) {
5431 + this.callbacks[event][command] = {};
5432 + }
5433 +
5434 + // TODO: Create HookCallback class/type.
5435 + var callback = {
5436 + id: id,
5437 + callback: instance.run.bind(instance),
5438 + isActive: true,
5439 + activate: function activate() {
5440 + this.isActive = true;
5441 + },
5442 + deactivate: function deactivate() {
5443 + this.isActive = false;
5444 + }
5445 + };
5446 + if (containerType) {
5447 + if (!this.callbacks[event][command][containerType]) {
5448 + this.callbacks[event][command][containerType] = [];
5449 + }
5450 + this.callbacks[event][command][containerType].push(callback);
5451 + } else {
5452 + if (!this.callbacks[event][command].all) {
5453 + this.callbacks[event][command].all = [];
5454 + }
5455 + this.callbacks[event][command].all.push(callback);
5456 + }
5457 + this.callbacksFlatList[callback.id] = callback;
5458 + return callback;
5459 + }
5460 +
5461 + /**
5462 + * Function run().
5463 + *
5464 + * Run the callbacks.
5465 + *
5466 + * @param {string} event
5467 + * @param {string} command
5468 + * @param {{}} args
5469 + * @param {*} result
5470 + *
5471 + * @return {*} results
5472 + */
5473 + }, {
5474 + key: "run",
5475 + value: function run(event, command, args) {
5476 + var result = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : undefined;
5477 + var callbacks = this.getCallbacks(event, command, args);
5478 + if (this.shouldRun(callbacks)) {
5479 + this.current = command;
5480 + this.onRun(command, args, event);
5481 + return this.runCallbacks(event, command, callbacks, args, result);
5482 + }
5483 + return false;
5484 + }
5485 +
5486 + /**
5487 + * Function runCallbacks().
5488 + *
5489 + * Run's the given callbacks.
5490 + *
5491 + * @param {string} event
5492 + * @param {string} command
5493 + * @param {Array} callbacks
5494 + * @param {{}} args
5495 + * @param {[]} result
5496 + */
5497 + }, {
5498 + key: "runCallbacks",
5499 + value: function runCallbacks(event, command, callbacks, args, result) {
5500 + var callbacksResult = [];
5501 + for (var i in callbacks) {
5502 + var callback = callbacks[i];
5503 + if (!callback.isActive) {
5504 + continue;
5505 + }
5506 +
5507 + // If not exist, set zero.
5508 + if (undefined === this.depth[event][callback.id]) {
5509 + this.depth[event][callback.id] = 0;
5510 + }
5511 + this.depth[event][callback.id]++;
5512 +
5513 + // Prevent recursive hooks.
5514 + if (1 === this.depth[event][callback.id]) {
5515 + this.onCallback(command, args, event, callback.id);
5516 + try {
5517 + var callbackResult = this.runCallback(event, callback, args, result);
5518 + if (!callbackResult) {
5519 + throw Error("Callback failed, event: '".concat(event, "'"));
5520 + }
5521 + callbacksResult.push(callbackResult);
5522 + } catch (e) {
5523 + // If its 'Hook-Break' then parent `try {}` will handle it.
5524 + if (e instanceof $e.modules.HookBreak) {
5525 + throw e;
5526 + }
5527 + _console.default.error(e);
5528 + }
5529 + }
5530 + this.depth[event][callback.id]--;
5531 + }
5532 + return callbacksResult;
5533 + }
5534 +
5535 + // eslint-disable-next-line jsdoc/require-returns-check
5536 + /**
5537 + * Function runCallback().
5538 + *
5539 + * Run's the given callback.
5540 + *
5541 + * @param {string} event
5542 + * @param {{}} callback
5543 + * @param {{}} args
5544 + * @param {*} result
5545 + *
5546 + * @return {*} results
5547 + *
5548 + * @throws {Error}
5549 + */
5550 + }, {
5551 + key: "runCallback",
5552 + value: function runCallback(event, callback, args, result) {
5553 + // eslint-disable-line no-unused-vars
5554 + (0, _forceMethodImplementation.default)();
5555 + }
5556 +
5557 + /**
5558 + * Function onRun().
5559 + *
5560 + * Called before run a set of callbacks.
5561 + *
5562 + * @param {string} command
5563 + * @param {{}} args
5564 + * @param {string} event
5565 + *
5566 + * @throws {Error}
5567 + */
5568 + }, {
5569 + key: "onRun",
5570 + value: function onRun(command, args, event) {
5571 + // eslint-disable-line no-unused-vars
5572 + (0, _forceMethodImplementation.default)();
5573 + }
5574 +
5575 + /**
5576 + * Function onCallback().
5577 + *
5578 + * Called before a single callback.
5579 + *
5580 + * @param {string} command
5581 + * @param {{}} args
5582 + * @param {string} event
5583 + * @param {string} id
5584 + *
5585 + * @throws {Error}
5586 + */
5587 + }, {
5588 + key: "onCallback",
5589 + value: function onCallback(command, args, event, id) {
5590 + // eslint-disable-line no-unused-vars
5591 + (0, _forceMethodImplementation.default)();
5592 + }
5593 + }]);
5594 + return HooksBase;
5595 +}(_module.default);
5596 +exports["default"] = HooksBase;
5597 +
5598 +/***/ }),
5599 +
5600 +/***/ "../modules/web-cli/assets/js/core/hooks/data.js":
5601 +/*!*******************************************************!*\
5602 + !*** ../modules/web-cli/assets/js/core/hooks/data.js ***!
5603 + \*******************************************************/
5604 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
5605 +
5606 +"use strict";
5607 +
5608 +
5609 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
5610 +Object.defineProperty(exports, "__esModule", ({
5611 + value: true
5612 +}));
5613 +exports["default"] = void 0;
5614 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
5615 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
5616 +var _get2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/get */ "../node_modules/@babel/runtime/helpers/get.js"));
5617 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
5618 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
5619 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
5620 +var _base = _interopRequireDefault(__webpack_require__(/*! ./base.js */ "../modules/web-cli/assets/js/core/hooks/base.js"));
5621 +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); }; }
5622 +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; } }
5623 +var Data = /*#__PURE__*/function (_HooksBase) {
5624 + (0, _inherits2.default)(Data, _HooksBase);
5625 + var _super = _createSuper(Data);
5626 + function Data() {
5627 + var _this;
5628 + (0, _classCallCheck2.default)(this, Data);
5629 + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
5630 + args[_key] = arguments[_key];
5631 + }
5632 + _this = _super.call.apply(_super, [this].concat(args));
5633 + _this.callbacks.dependency = {};
5634 + _this.depth.dependency = {};
5635 + return _this;
5636 + }
5637 + (0, _createClass2.default)(Data, [{
5638 + key: "getType",
5639 + value: function getType() {
5640 + return 'data';
5641 + }
5642 + }, {
5643 + key: "runCallback",
5644 + value: function runCallback(event, callback, args, result) {
5645 + switch (event) {
5646 + case 'dependency':
5647 + {
5648 + // If callback returns false and its dependency, then 'Hook-Break'.
5649 + if (!callback.callback(args)) {
5650 + this.depth[event][callback.id]--;
5651 +
5652 + // Throw custom break to be catch by the base for 'Safe' exit.
5653 + throw new $e.modules.HookBreak();
5654 + }
5655 + return true;
5656 + }
5657 + case 'catch':
5658 + case 'after':
5659 + {
5660 + /**
5661 + * When handling HOOK which is data after (not breakable),
5662 + * even the result of the callback is negative, it is required to return positive,
5663 + * since result of runCallback determine if the callback succeeded.
5664 + */
5665 + return callback.callback(args, result) || 'after' === event;
5666 + }
5667 + }
5668 + return false;
5669 + }
5670 + }, {
5671 + key: "shouldRun",
5672 + value: function shouldRun(callbacks) {
5673 + return (0, _get2.default)((0, _getPrototypeOf2.default)(Data.prototype), "shouldRun", this).call(this, callbacks) && elementor.documents.getCurrent().history.getActive();
5674 + }
5675 + }, {
5676 + key: "onRun",
5677 + value: function onRun(command, args, event) {
5678 + if (!$e.devTools) {
5679 + return;
5680 + }
5681 + $e.devTools.log.callbacks().run(this.getType(), command, args, event);
5682 + }
5683 + }, {
5684 + key: "onCallback",
5685 + value: function onCallback(command, args, event, id) {
5686 + if (!$e.devTools) {
5687 + return;
5688 + }
5689 + $e.devTools.log.callbacks().callback(this.getType(), command, args, event, id);
5690 + }
5691 + }]);
5692 + return Data;
5693 +}(_base.default);
5694 +exports["default"] = Data;
5695 +
5696 +/***/ }),
5697 +
5698 +/***/ "../modules/web-cli/assets/js/core/hooks/ui.js":
5699 +/*!*****************************************************!*\
5700 + !*** ../modules/web-cli/assets/js/core/hooks/ui.js ***!
5701 + \*****************************************************/
5702 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
5703 +
5704 +"use strict";
5705 +
5706 +
5707 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
5708 +Object.defineProperty(exports, "__esModule", ({
5709 + value: true
5710 +}));
5711 +exports["default"] = void 0;
5712 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
5713 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
5714 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
5715 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
5716 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
5717 +var _base = _interopRequireDefault(__webpack_require__(/*! ./base */ "../modules/web-cli/assets/js/core/hooks/base.js"));
5718 +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); }; }
5719 +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; } }
5720 +var Ui = /*#__PURE__*/function (_HooksBase) {
5721 + (0, _inherits2.default)(Ui, _HooksBase);
5722 + var _super = _createSuper(Ui);
5723 + function Ui() {
5724 + var _this;
5725 + (0, _classCallCheck2.default)(this, Ui);
5726 + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
5727 + args[_key] = arguments[_key];
5728 + }
5729 + _this = _super.call.apply(_super, [this].concat(args));
5730 + _this.callbacks.before = {};
5731 + _this.depth.before = {};
5732 + return _this;
5733 + }
5734 + (0, _createClass2.default)(Ui, [{
5735 + key: "getType",
5736 + value: function getType() {
5737 + return 'ui';
5738 + }
5739 + }, {
5740 + key: "runCallback",
5741 + value: function runCallback(event, callback, args, result) {
5742 + switch (event) {
5743 + case 'before':
5744 + callback.callback(args);
5745 + break;
5746 + case 'catch':
5747 + case 'after':
5748 + callback.callback(args, result);
5749 + break;
5750 + default:
5751 + return false;
5752 + }
5753 + return true;
5754 + }
5755 + }, {
5756 + key: "onRun",
5757 + value: function onRun(command, args, event) {
5758 + if (!$e.devTools) {
5759 + return;
5760 + }
5761 + $e.devTools.log.callbacks().run(this.getType(), command, args, event);
5762 + }
5763 + }, {
5764 + key: "onCallback",
5765 + value: function onCallback(command, args, event, id) {
5766 + if (!$e.devTools) {
5767 + return;
5768 + }
5769 + $e.devTools.log.callbacks().callback(this.getType(), command, args, event, id);
5770 + }
5771 + }]);
5772 + return Ui;
5773 +}(_base.default);
5774 +exports["default"] = Ui;
5775 +
5776 +/***/ }),
5777 +
5778 +/***/ "../modules/web-cli/assets/js/core/routes.js":
5779 +/*!***************************************************!*\
5780 + !*** ../modules/web-cli/assets/js/core/routes.js ***!
5781 + \***************************************************/
5782 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
5783 +
5784 +"use strict";
5785 +
5786 +
5787 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
5788 +Object.defineProperty(exports, "__esModule", ({
5789 + value: true
5790 +}));
5791 +exports["default"] = void 0;
5792 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
5793 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
5794 +var _get2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/get */ "../node_modules/@babel/runtime/helpers/get.js"));
5795 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
5796 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
5797 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
5798 +var _commands = _interopRequireDefault(__webpack_require__(/*! ./commands */ "../modules/web-cli/assets/js/core/commands.js"));
5799 +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); }; }
5800 +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; } }
5801 +var Routes = /*#__PURE__*/function (_Commands) {
5802 + (0, _inherits2.default)(Routes, _Commands);
5803 + var _super = _createSuper(Routes);
5804 + function Routes() {
5805 + var _this;
5806 + (0, _classCallCheck2.default)(this, Routes);
5807 + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
5808 + args[_key] = arguments[_key];
5809 + }
5810 + _this = _super.call.apply(_super, [this].concat(args));
5811 + _this.savedStates = {};
5812 + _this.historyPerComponent = {};
5813 + return _this;
5814 + }
5815 + (0, _createClass2.default)(Routes, [{
5816 + key: "refreshContainer",
5817 + value: function refreshContainer(container) {
5818 + var currentRoute = this.getCurrent(container),
5819 + currentArgs = this.getCurrentArgs(container);
5820 + this.clearCurrent(container);
5821 + this.to(currentRoute, currentArgs);
5822 + }
5823 + }, {
5824 + key: "getHistory",
5825 + value: function getHistory() {
5826 + var namespaceRoot = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
5827 + if (namespaceRoot) {
5828 + return this.historyPerComponent[namespaceRoot] || [];
5829 + }
5830 + return this.historyPerComponent;
5831 + }
5832 + }, {
5833 + key: "clearHistory",
5834 + value: function clearHistory(namespaceRoot) {
5835 + delete this.historyPerComponent[namespaceRoot];
5836 + }
5837 + }, {
5838 + key: "clearCurrent",
5839 + value: function clearCurrent(container) {
5840 + var route = this.current[container];
5841 + if (!route) {
5842 + return;
5843 + }
5844 + this.detachCurrent(container);
5845 + this.getComponent(route).onCloseRoute(route);
5846 + }
5847 + }, {
5848 + key: "clear",
5849 + value: function clear() {
5850 + var _this2 = this;
5851 + Object.keys(this.current).forEach(function (container) {
5852 + return _this2.clearCurrent(container);
5853 + });
5854 + }
5855 + }, {
5856 + key: "saveState",
5857 + value: function saveState(container) {
5858 + this.savedStates[container] = {
5859 + route: this.current[container],
5860 + args: this.currentArgs[container]
5861 + };
5862 + return this;
5863 + }
5864 + }, {
5865 + key: "restoreState",
5866 + value: function restoreState(container) {
5867 + if (!this.savedStates[container]) {
5868 + return false;
5869 + }
5870 + this.to(this.savedStates[container].route, this.savedStates[container].args);
5871 + return true;
5872 + }
5873 + }, {
5874 + key: "validateRun",
5875 + value: function validateRun(route) {
5876 + var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
5877 + if (!(0, _get2.default)((0, _getPrototypeOf2.default)(Routes.prototype), "validateRun", this).call(this, route, args)) {
5878 + return false;
5879 + }
5880 + if (this.is(route, args) && !args.refresh) {
5881 + return false;
5882 + }
5883 + var component = this.getComponent(route);
5884 + if (!component.isOpen || args.reOpen) {
5885 + component.isOpen = component.open(args);
5886 + }
5887 + return component.isOpen;
5888 + }
5889 +
5890 + /**
5891 + * @override
5892 + */
5893 + }, {
5894 + key: "beforeRun",
5895 + value: function beforeRun(route, args) {
5896 + var component = this.getComponent(route),
5897 + container = component.getServiceName(),
5898 + oldRoute = this.current[container];
5899 + if (oldRoute) {
5900 + this.getComponent(oldRoute).onCloseRoute(oldRoute);
5901 + }
5902 + _commands.default.trace.push(route);
5903 + (0, _get2.default)((0, _getPrototypeOf2.default)(Routes.prototype), "beforeRun", this).call(this, route, args, false);
5904 + this.attachCurrent(container, route, args);
5905 + }
5906 + }, {
5907 + key: "to",
5908 + value: function to(route, args) {
5909 + this.run(route, args);
5910 + var namespaceRoot = this.getComponent(route).getServiceName();
5911 + if (!this.historyPerComponent[namespaceRoot]) {
5912 + this.historyPerComponent[namespaceRoot] = [];
5913 + }
5914 + this.historyPerComponent[namespaceRoot].push({
5915 + route: route,
5916 + args: args
5917 + });
5918 + }
5919 + }, {
5920 + key: "back",
5921 + value: function back(namespaceRoot) {
5922 + var history = this.getHistory(namespaceRoot);
5923 +
5924 + // Remove current;
5925 + history.pop();
5926 + var last = history.pop();
5927 + if (!last) {
5928 + return;
5929 + }
5930 + this.to(last.route, last.args);
5931 + }
5932 +
5933 + // Don't use the event object.
5934 + }, {
5935 + key: "runShortcut",
5936 + value: function runShortcut(command) {
5937 + this.to(command);
5938 + }
5939 +
5940 + // Don't clear current route.
5941 + }, {
5942 + key: "afterRun",
5943 + value: function afterRun(route, args) {
5944 + var results = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;
5945 + var component = this.getComponent(route);
5946 + component.onRoute(route, args);
5947 + (0, _get2.default)((0, _getPrototypeOf2.default)(Routes.prototype), "afterRun", this).call(this, route, args, results, false);
5948 + _commands.default.trace.pop();
5949 + }
5950 + }, {
5951 + key: "is",
5952 + value: function is(route) {
5953 + var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
5954 + if (!(0, _get2.default)((0, _getPrototypeOf2.default)(Routes.prototype), "is", this).call(this, route)) {
5955 + return false;
5956 + }
5957 + var container = this.getComponent(route).getServiceName();
5958 + return _.isEqual(args, this.currentArgs[container]);
5959 + }
5960 + }, {
5961 + key: "isPartOf",
5962 + value: function isPartOf(route) {
5963 + /**
5964 + * Check against current command hierarchically.
5965 + * For example `is( 'panel' )` will be true for `panel/elements`
5966 + * `is( 'panel/editor' )` will be true for `panel/editor/style`
5967 + */
5968 + var parts = route.split('/'),
5969 + container = parts[0],
5970 + toCheck = [],
5971 + currentParts = this.current[container] ? this.current[container].split('/') : [];
5972 + var match = false;
5973 + currentParts.forEach(function (part) {
5974 + toCheck.push(part);
5975 + if (toCheck.join('/') === route) {
5976 + match = true;
5977 + }
5978 + });
5979 + return match;
5980 + }
5981 + }, {
5982 + key: "error",
5983 + value: function error(message) {
5984 + throw Error('Routes: ' + message);
5985 + }
5986 + }]);
5987 + return Routes;
5988 +}(_commands.default);
5989 +exports["default"] = Routes;
5990 +
5991 +/***/ }),
5992 +
5993 +/***/ "../modules/web-cli/assets/js/core/shortcuts.js":
5994 +/*!******************************************************!*\
5995 + !*** ../modules/web-cli/assets/js/core/shortcuts.js ***!
5996 + \******************************************************/
5997 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
5998 +
5999 +"use strict";
6000 +
6001 +
6002 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
6003 +Object.defineProperty(exports, "__esModule", ({
6004 + value: true
6005 +}));
6006 +exports["default"] = void 0;
6007 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
6008 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
6009 +var _environment = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/environment */ "../modules/web-cli/assets/js/utils/environment.js"));
6010 +var _console = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/console */ "../modules/web-cli/assets/js/utils/console.js"));
6011 +var Shortcuts = /*#__PURE__*/function () {
6012 + function Shortcuts($window) {
6013 + (0, _classCallCheck2.default)(this, Shortcuts);
6014 + this.specialKeys = {
6015 + 13: 'enter',
6016 + 27: 'esc',
6017 + 38: 'up',
6018 + 40: 'down',
6019 + 46: 'del',
6020 + 191: '?'
6021 + };
6022 + this.component = '';
6023 + this.handlers = {};
6024 + this.bindListener($window);
6025 + }
6026 + (0, _createClass2.default)(Shortcuts, [{
6027 + key: "bindListener",
6028 + value: function bindListener($window) {
6029 + var _this = this;
6030 + $window.on('keydown', function (event) {
6031 + return _this.handle(event);
6032 + });
6033 + }
6034 + }, {
6035 + key: "getAll",
6036 + value: function getAll() {
6037 + var shortcuts = {};
6038 + jQuery.each(this.handlers, function (key, handler) {
6039 + jQuery.each(handler, function (index, config) {
6040 + shortcuts[config.command] = key;
6041 + });
6042 + });
6043 + return shortcuts;
6044 + }
6045 +
6046 + /**
6047 + * @param {string} shortcuts
6048 + * @param {Object} args
6049 + * @param {Function} args.callback Required
6050 + * @param {string} args.component Optional
6051 + * @param {Function} args.dependency Optional
6052 + * @param {Array} args.exclude Optional
6053 + * @param {boolean} args.allowAltKey Optional
6054 + */
6055 + }, {
6056 + key: "register",
6057 + value: function register(shortcuts, args) {
6058 + var _this2 = this;
6059 + shortcuts.replace(' ', '').split(',').forEach(function (shortcut) {
6060 + if (!_this2.handlers[shortcut]) {
6061 + _this2.handlers[shortcut] = [];
6062 + }
6063 + _this2.handlers[shortcut].push(args);
6064 + });
6065 + }
6066 + }, {
6067 + key: "unregister",
6068 + value: function unregister(shortcuts, args) {
6069 + var _this3 = this;
6070 + shortcuts.replace(' ', '').split(',').forEach(function (shortcut) {
6071 + _this3.handlers[shortcut].forEach(function (index, handler) {
6072 + if (args === handler) {
6073 + delete _this3.handlers[shortcut][index];
6074 + }
6075 + });
6076 + });
6077 + }
6078 + }, {
6079 + key: "handle",
6080 + value: function handle(event) {
6081 + var handlers = this.getHandlersByPriority(event);
6082 + if (!handlers) {
6083 + return;
6084 + }
6085 + var filteredHandlers = handlers.filter(function (handler) {
6086 + if (handler.exclude && -1 !== handler.exclude.indexOf('input')) {
6087 + var $target = jQuery(event.target);
6088 + if ($target.is(':input, .elementor-input') || $target.closest('[contenteditable="true"]').length) {
6089 + return false;
6090 + }
6091 + }
6092 + if (handler.dependency && !handler.dependency(event)) {
6093 + return false;
6094 + }
6095 +
6096 + // Fix for some keyboard sources that consider alt key as ctrl key
6097 + if (!handler.allowAltKey && event.altKey) {
6098 + return false;
6099 + }
6100 + return true;
6101 + });
6102 + if (!filteredHandlers.length) {
6103 + return;
6104 + }
6105 + if (1 < filteredHandlers.length && elementorWebCliConfig.isDebug) {
6106 + _console.default.warn('Multiple handlers for shortcut.', filteredHandlers, event);
6107 + }
6108 + event.preventDefault();
6109 + filteredHandlers[0].callback(event);
6110 + }
6111 + }, {
6112 + key: "isControlEvent",
6113 + value: function isControlEvent(event) {
6114 + return event[_environment.default.mac ? 'metaKey' : 'ctrlKey'];
6115 + }
6116 + }, {
6117 + key: "getEventShortcut",
6118 + value: function getEventShortcut(event) {
6119 + var shortcut = [];
6120 + if (event.altKey) {
6121 + shortcut.push('alt');
6122 + }
6123 + if (this.isControlEvent(event)) {
6124 + shortcut.push('ctrl');
6125 + }
6126 + if (event.shiftKey) {
6127 + shortcut.push('shift');
6128 + }
6129 + if (this.specialKeys[event.which]) {
6130 + shortcut.push(this.specialKeys[event.which]);
6131 + } else {
6132 + shortcut.push(String.fromCharCode(event.which).toLowerCase());
6133 + }
6134 + return shortcut.join('+');
6135 + }
6136 + }, {
6137 + key: "isActiveScope",
6138 + value: function isActiveScope(scopes) {
6139 + var activeComponents = Object.keys($e.components.activeComponents),
6140 + activeComponent = activeComponents[activeComponents.length - 1],
6141 + component = $e.components.get(activeComponent);
6142 + if (!component) {
6143 + return false;
6144 + }
6145 + var namespace = component.getNamespace();
6146 + var filteredByNamespace = scopes.some(function (scope) {
6147 + return namespace === scope;
6148 + });
6149 + if (filteredByNamespace) {
6150 + return true;
6151 + }
6152 +
6153 + // Else filter by namespaceRoot.
6154 + var namespaceRoot = component.getServiceName();
6155 + return scopes.some(function (scope) {
6156 + return namespaceRoot === scope;
6157 + });
6158 + }
6159 + }, {
6160 + key: "getHandlersByPriority",
6161 + value: function getHandlersByPriority(event) {
6162 + var _this4 = this;
6163 + var handlers = this.handlers[this.getEventShortcut(event)];
6164 + if (!handlers) {
6165 + return false;
6166 + }
6167 +
6168 + // TODO: Prioritize current scope before roo scope.
6169 + var inCurrentScope = handlers.filter(function (handler) {
6170 + return handler.scopes && _this4.isActiveScope(handler.scopes);
6171 + });
6172 + if (inCurrentScope.length) {
6173 + return inCurrentScope;
6174 + }
6175 + var noScope = handlers.filter(function (handler) {
6176 + return !handler.scopes;
6177 + });
6178 + if (noScope.length) {
6179 + return noScope;
6180 + }
6181 + }
6182 + }]);
6183 + return Shortcuts;
6184 +}();
6185 +exports["default"] = Shortcuts;
6186 +
6187 +/***/ }),
6188 +
6189 +/***/ "../modules/web-cli/assets/js/core/store.js":
6190 +/*!**************************************************!*\
6191 + !*** ../modules/web-cli/assets/js/core/store.js ***!
6192 + \**************************************************/
6193 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
6194 +
6195 +"use strict";
6196 +
6197 +
6198 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
6199 +Object.defineProperty(exports, "__esModule", ({
6200 + value: true
6201 +}));
6202 +exports["default"] = void 0;
6203 +var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js"));
6204 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
6205 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
6206 +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
6207 +var _toolkit = __webpack_require__(/*! @reduxjs/toolkit */ "../node_modules/@reduxjs/toolkit/dist/redux-toolkit.esm.js");
6208 +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; }
6209 +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; }
6210 +/**
6211 + * @typedef {import('@reduxjs/toolkit').Slice} Slice
6212 + */
6213 +/**
6214 + * @typedef {import('@reduxjs/toolkit').EnhancedStore} EnhancedStore
6215 + */
6216 +/**
6217 + * @typedef {import('@reduxjs/toolkit').AnyAction} AnyAction
6218 + */
6219 +/**
6220 + * @typedef {import('@reduxjs/toolkit').ThunkMiddlewareFor} ThunkMiddlewareFor
6221 + */
6222 +var Store = /*#__PURE__*/function () {
6223 + /**
6224 + * @type {Object}
6225 + */
6226 +
6227 + /**
6228 + * @type {EnhancedStore<{}, AnyAction, [ThunkMiddlewareFor<{}>]>}
6229 + */
6230 +
6231 + /**
6232 + * Initialize the Store.
6233 + *
6234 + * @return {void}
6235 + */
6236 + function Store() {
6237 + (0, _classCallCheck2.default)(this, Store);
6238 + (0, _defineProperty2.default)(this, "slices", {});
6239 + (0, _defineProperty2.default)(this, "reduxStore", void 0);
6240 + this.slices = {};
6241 + this.reduxStore = this.createStore();
6242 + }
6243 +
6244 + /**
6245 + * Create a Redux Store object.
6246 + *
6247 + * @return {EnhancedStore<{}, AnyAction, [ThunkMiddlewareFor<{}>]>} store
6248 + */
6249 + (0, _createClass2.default)(Store, [{
6250 + key: "createStore",
6251 + value: function createStore() {
6252 + return (0, _toolkit.configureStore)({
6253 + // Use an empty function instead of empty object since an empty object
6254 + // isn't a valid reducer value.
6255 + reducer: function reducer() {}
6256 + });
6257 + }
6258 +
6259 + /**
6260 + * Inject a new reducer.
6261 + *
6262 + * See: https://redux.js.org/usage/code-splitting#defining-an-injectreducer-function
6263 + *
6264 + * @param {string} id - Reducer unique ID.
6265 + * @param {Function} newReducer - New reducer to inject.
6266 + *
6267 + * @return {void}
6268 + */
6269 + }, {
6270 + key: "injectReducer",
6271 + value: function injectReducer(id, newReducer) {
6272 + var prevReducers = this.getReducers();
6273 + this.reduxStore.replaceReducer((0, _toolkit.combineReducers)(_objectSpread(_objectSpread({}, prevReducers), {}, (0, _defineProperty2.default)({}, id, newReducer))));
6274 + }
6275 +
6276 + /**
6277 + * Register a Redux Store slice.
6278 + *
6279 + * @param {string} sliceId - Slice unique ID.
6280 + * @param {Slice} instance - Slice object to add.
6281 + *
6282 + * @return {void}
6283 + */
6284 + }, {
6285 + key: "register",
6286 + value: function register(sliceId, instance) {
6287 + if (this.slices[sliceId]) {
6288 + throw "Slice with ID '".concat(sliceId, "' already exists.");
6289 + }
6290 + this.slices[sliceId] = instance;
6291 + this.injectReducer(sliceId, instance.reducer);
6292 + }
6293 +
6294 + /**
6295 + * Get a specific slice.
6296 + *
6297 + * @param {string|null} sliceId - Slice ID to get.
6298 + *
6299 + * @return {Slice} slice
6300 + */
6301 + }, {
6302 + key: "get",
6303 + value: function get(sliceId) {
6304 + return this.slices[sliceId];
6305 + }
6306 +
6307 + /**
6308 + * Get all slices.
6309 + *
6310 + * @return {Object} slices
6311 + */
6312 + }, {
6313 + key: "getAllSlices",
6314 + value: function getAllSlices() {
6315 + return this.slices;
6316 + }
6317 +
6318 + /**
6319 + * Get All slices.
6320 + *
6321 + * @return {Object} slices
6322 + */
6323 + }, {
6324 + key: "getAll",
6325 + value: function getAll() {
6326 + return Object.keys(this.slices).sort();
6327 + }
6328 +
6329 + /**
6330 + * Return the current reducers.
6331 + *
6332 + * @return {Object} reducers
6333 + */
6334 + }, {
6335 + key: "getReducers",
6336 + value: function getReducers() {
6337 + return Object.entries(this.slices).reduce(function (reducers, _ref) {
6338 + var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
6339 + key = _ref2[0],
6340 + slice = _ref2[1];
6341 + return _objectSpread(_objectSpread({}, reducers), {}, (0, _defineProperty2.default)({}, key, slice.reducer));
6342 + }, {});
6343 + }
6344 +
6345 + /**
6346 + * Get the actual Redux store object.
6347 + *
6348 + * @return {Object} redux store object
6349 + */
6350 + }, {
6351 + key: "getReduxStore",
6352 + value: function getReduxStore() {
6353 + return this.reduxStore;
6354 + }
6355 +
6356 + /**
6357 + * Proxy to Redux's `dispatch()` function.
6358 + *
6359 + * @return {*} the dispatched action
6360 + */
6361 + }, {
6362 + key: "dispatch",
6363 + value: function dispatch() {
6364 + var _this$reduxStore;
6365 + return (_this$reduxStore = this.reduxStore).dispatch.apply(_this$reduxStore, arguments);
6366 + }
6367 +
6368 + /**
6369 + * Proxy to Redux's `getState()` function, with the ability to get a specific slice.
6370 + *
6371 + * @param {string|null} sliceId
6372 + *
6373 + * @return {*} The current state tree of the application
6374 + */
6375 + }, {
6376 + key: "getState",
6377 + value: function getState() {
6378 + var sliceId = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
6379 + var state = this.reduxStore.getState();
6380 + return sliceId ? state[sliceId] : state;
6381 + }
6382 +
6383 + /**
6384 + * Proxy to Redux's `replaceReducer()` function.
6385 + * TODO: Do we want that?
6386 + *
6387 + * @return {*} undefined
6388 + */
6389 + }, {
6390 + key: "replaceReducer",
6391 + value: function replaceReducer() {
6392 + var _this$reduxStore2;
6393 + return (_this$reduxStore2 = this.reduxStore).replaceReducer.apply(_this$reduxStore2, arguments);
6394 + }
6395 +
6396 + /**
6397 + * Proxy to Redux's `subscribe()` function.
6398 + *
6399 + * @return {*} A function that unsubscribes the change listener
6400 + */
6401 + }, {
6402 + key: "subscribe",
6403 + value: function subscribe() {
6404 + var _this$reduxStore3;
6405 + return (_this$reduxStore3 = this.reduxStore).subscribe.apply(_this$reduxStore3, arguments);
6406 + }
6407 + }]);
6408 + return Store;
6409 +}();
6410 +exports["default"] = Store;
6411 +
6412 +/***/ }),
6413 +
6414 +/***/ "../modules/web-cli/assets/js/core/ui-states.js":
6415 +/*!******************************************************!*\
6416 + !*** ../modules/web-cli/assets/js/core/ui-states.js ***!
6417 + \******************************************************/
6418 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
6419 +
6420 +"use strict";
6421 +
6422 +
6423 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
6424 +Object.defineProperty(exports, "__esModule", ({
6425 + value: true
6426 +}));
6427 +exports["default"] = void 0;
6428 +var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js"));
6429 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
6430 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
6431 +/**
6432 + * @typedef {import('./states/ui-state-base')} UiStateBase
6433 + */
6434 +var UiStates = /*#__PURE__*/function () {
6435 + /**
6436 + * Initialize the State Manager.
6437 + *
6438 + * @return {void}
6439 + */
6440 + function UiStates() {
6441 + (0, _classCallCheck2.default)(this, UiStates);
6442 + this.states = {};
6443 + }
6444 +
6445 + /**
6446 + * Register a new state.
6447 + *
6448 + * @param {UiStateBase} instance - State instance.
6449 + */
6450 + (0, _createClass2.default)(UiStates, [{
6451 + key: "register",
6452 + value: function register(instance) {
6453 + var stateId = instance.getPrefixedId();
6454 + if (this.states[stateId]) {
6455 + throw "State '".concat(stateId, "' already exists.");
6456 + }
6457 + this.states[stateId] = instance;
6458 + }
6459 +
6460 + /**
6461 + * Get all existing states with their options:
6462 + *
6463 + * {
6464 + * 'state-id': [
6465 + * 'option-1',
6466 + * 'option-2',
6467 + * 'option-3',
6468 + * ],
6469 + * }
6470 + *
6471 + * @return {Object} all existing states
6472 + */
6473 + }, {
6474 + key: "getAll",
6475 + value: function getAll() {
6476 + var states = {};
6477 + Object.entries(this.states).forEach(function (_ref) {
6478 + var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
6479 + id = _ref2[0],
6480 + instance = _ref2[1];
6481 + var options = instance.getOptions();
6482 + states[id] = Object.keys(options);
6483 + });
6484 + return states;
6485 + }
6486 +
6487 + /**
6488 + * Get the state value, or return all of them if no `state` is set.
6489 + *
6490 + * @param {string} state - State ID.
6491 + *
6492 + * @return {UiStateBase} state value
6493 + */
6494 + }, {
6495 + key: "get",
6496 + value: function get(state) {
6497 + if (state) {
6498 + return this.states[state];
6499 + }
6500 + return this.states;
6501 + }
6502 +
6503 + /**
6504 + * Set the current state value and trigger its callbacks & events.
6505 + * This function triggers a `e-ui-state:${ stateID }` event to the scope, with `oldValue` & `newValue`
6506 + * under `e.detail`.
6507 + * Additionally, it adds a `e-ui-state--${ stateID }__${ value }` class to the scope element.
6508 + *
6509 + * @param {string} state - State ID.
6510 + * @param {string} value - New state value.
6511 + *
6512 + * @return {void}
6513 + */
6514 + }, {
6515 + key: "set",
6516 + value: function set(state, value) {
6517 + // Invalid state or option.
6518 + if (!this.get(state)) {
6519 + throw "State '".concat(state, "' doesn't exist.");
6520 + }
6521 + var oldValue = this.getCurrent(state),
6522 + classPrefix = "e-ui-state--".concat(state.replaceAll('/', '-')),
6523 + oldStateClass = "".concat(classPrefix, "__").concat(oldValue),
6524 + newStateClass = "".concat(classPrefix, "__").concat(value),
6525 + scopes = this.get(state).getScopes();
6526 +
6527 + // Set the current state to the new value.
6528 + this.get(state).set(value);
6529 + scopes.forEach(function (scope) {
6530 + scope.classList.remove(oldStateClass);
6531 +
6532 + // Set the new class only if there is a value (i.e. it's not a state removal action).
6533 + if (value) {
6534 + scope.classList.add(newStateClass);
6535 + }
6536 +
6537 + // Dispatch a custom state-change event to the scope.
6538 + var event = new CustomEvent("e-ui-state:".concat(state), {
6539 + detail: {
6540 + oldValue: oldValue,
6541 + newValue: value
6542 + }
6543 + });
6544 + scope.dispatchEvent(event);
6545 + });
6546 + }
6547 +
6548 + /**
6549 + * Remove a state.
6550 + *
6551 + * @param {string} state - State ID.
6552 + *
6553 + * @return {void}
6554 + */
6555 + }, {
6556 + key: "remove",
6557 + value: function remove(state) {
6558 + this.set(state, '');
6559 + }
6560 +
6561 + /**
6562 + * Get the current state value.
6563 + *
6564 + * @param {string} state - State ID.
6565 + *
6566 + * @return {string} current state value
6567 + */
6568 + }, {
6569 + key: "getCurrent",
6570 + value: function getCurrent(state) {
6571 + var _this$get;
6572 + return (_this$get = this.get(state)) === null || _this$get === void 0 ? void 0 : _this$get.getCurrent();
6573 + }
6574 + }]);
6575 + return UiStates;
6576 +}();
6577 +exports["default"] = UiStates;
6578 +
6579 +/***/ }),
6580 +
6581 +/***/ "../modules/web-cli/assets/js/extras/hash-commands.js":
6582 +/*!************************************************************!*\
6583 + !*** ../modules/web-cli/assets/js/extras/hash-commands.js ***!
6584 + \************************************************************/
6585 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
6586 +
6587 +"use strict";
6588 +
6589 +
6590 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
6591 +Object.defineProperty(exports, "__esModule", ({
6592 + value: true
6593 +}));
6594 +exports["default"] = void 0;
6595 +var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ "../node_modules/@babel/runtime/regenerator/index.js"));
6596 +var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "../node_modules/@babel/runtime/helpers/asyncToGenerator.js"));
6597 +var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js"));
6598 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
6599 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
6600 +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
6601 +var _console = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/console */ "../modules/web-cli/assets/js/utils/console.js"));
6602 +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; } } }; }
6603 +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); }
6604 +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; }
6605 +var HashCommands = /*#__PURE__*/function () {
6606 + /**
6607 + * Cannot be static since it uses callback(s) that are available only after '$e' is initialized.
6608 + */
6609 +
6610 + /**
6611 + * @typedef HashCommand
6612 + * @property {string} method method
6613 + * @property {string} command command
6614 + * @property {Object} args arguments
6615 + */
6616 + /**
6617 + * List of current loaded hash commands.
6618 + *
6619 + * @type {Array.<HashCommand>}
6620 + */
6621 +
6622 + function HashCommands() {
6623 + (0, _classCallCheck2.default)(this, HashCommands);
6624 + (0, _defineProperty2.default)(this, "dispatchersList", {
6625 + 'e:run': {
6626 + runner: function runner() {
6627 + return $e.run;
6628 + },
6629 + isSafe: function isSafe(command) {
6630 + var _$e$commands$getComma;
6631 + return (_$e$commands$getComma = $e.commands.getCommandClass(command)) === null || _$e$commands$getComma === void 0 ? void 0 : _$e$commands$getComma.getInfo().isSafe;
6632 + },
6633 + isSafeWithArgs: function isSafeWithArgs(command) {
6634 + var _$e$commands$getComma2;
6635 + return (_$e$commands$getComma2 = $e.commands.getCommandClass(command)) === null || _$e$commands$getComma2 === void 0 ? void 0 : _$e$commands$getComma2.getInfo().isSafeWithArgs;
6636 + }
6637 + },
6638 + 'e:route': {
6639 + runner: function runner() {
6640 + return $e.route;
6641 + },
6642 + isSafe: function isSafe() {
6643 + return true;
6644 + },
6645 + isSafeWithArgs: function isSafeWithArgs() {
6646 + return false;
6647 + }
6648 + }
6649 + });
6650 + (0, _defineProperty2.default)(this, "commands", []);
6651 + this.commands = this.get();
6652 + }
6653 +
6654 + /**
6655 + * Function get().
6656 + *
6657 + * Get API requests that comes from hash ( eg #e:run ).
6658 + *
6659 + * @param {string} hash
6660 + *
6661 + * @return {Array.<HashCommand>} API requests
6662 + */
6663 + (0, _createClass2.default)(HashCommands, [{
6664 + key: "get",
6665 + value: function get() {
6666 + var _this = this;
6667 + var hash = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : location.hash;
6668 + var result = [];
6669 + if (hash) {
6670 + // Remove first '#' and split each '&'.
6671 + var hashList = hash.substr(1).split('&');
6672 + hashList.forEach(function (hashItem) {
6673 + // eslint-disable-next-line @wordpress/no-unused-vars-before-return
6674 + var _hashItem$split = hashItem.split('?'),
6675 + _hashItem$split2 = (0, _slicedToArray2.default)(_hashItem$split, 2),
6676 + rawCommand = _hashItem$split2[0],
6677 + rawArgs = _hashItem$split2[1];
6678 + var hashParts = rawCommand.split(':');
6679 + if (3 !== hashParts.length) {
6680 + return;
6681 + }
6682 + var method = hashParts[0] + ':' + hashParts[1],
6683 + dispatcher = _this.dispatchersList[method];
6684 + if (dispatcher) {
6685 + var command = hashParts[2],
6686 + args = _this.parseCommandArgs(rawArgs);
6687 + result.push({
6688 + method: method,
6689 + command: command,
6690 + args: args
6691 + });
6692 + }
6693 + });
6694 + }
6695 + return result;
6696 + }
6697 +
6698 + /**
6699 + * Function run().
6700 + *
6701 + * Run API requests that comes from hash ( eg #e:run ).
6702 + *
6703 + * @param {Array.<HashCommand>} [commands=this.commands]
6704 + */
6705 + }, {
6706 + key: "run",
6707 + value: function () {
6708 + var _run = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
6709 + var commands,
6710 + _iterator,
6711 + _step,
6712 + hashCommand,
6713 + dispatcher,
6714 + _iterator2,
6715 + _step2,
6716 + _hashCommand,
6717 + _dispatcher,
6718 + _args = arguments;
6719 + return _regenerator.default.wrap(function _callee$(_context) {
6720 + while (1) {
6721 + switch (_context.prev = _context.next) {
6722 + case 0:
6723 + commands = _args.length > 0 && _args[0] !== undefined ? _args[0] : this.commands;
6724 + // To allow validate the run first.
6725 + _iterator = _createForOfIteratorHelper(commands);
6726 + _context.prev = 2;
6727 + _iterator.s();
6728 + case 4:
6729 + if ((_step = _iterator.n()).done) {
6730 + _context.next = 13;
6731 + break;
6732 + }
6733 + hashCommand = _step.value;
6734 + dispatcher = this.dispatchersList[hashCommand.method];
6735 + if (dispatcher) {
6736 + _context.next = 9;
6737 + break;
6738 + }
6739 + return _context.abrupt("return", Promise.reject(new Error("No dispatcher found for the command: `".concat(hashCommand.command, "`."))));
6740 + case 9:
6741 + if (dispatcher.isSafe(hashCommand.command)) {
6742 + _context.next = 11;
6743 + break;
6744 + }
6745 + return _context.abrupt("return", Promise.reject(new Error("Attempting to run unsafe or non exist command: `".concat(hashCommand.command, "`."))));
6746 + case 11:
6747 + _context.next = 4;
6748 + break;
6749 + case 13:
6750 + _context.next = 18;
6751 + break;
6752 + case 15:
6753 + _context.prev = 15;
6754 + _context.t0 = _context["catch"](2);
6755 + _iterator.e(_context.t0);
6756 + case 18:
6757 + _context.prev = 18;
6758 + _iterator.f();
6759 + return _context.finish(18);
6760 + case 21:
6761 + // This logic will run the promises by sequence (will wait for dispatcher to finish, before run again).
6762 + _iterator2 = _createForOfIteratorHelper(commands);
6763 + _context.prev = 22;
6764 + _iterator2.s();
6765 + case 24:
6766 + if ((_step2 = _iterator2.n()).done) {
6767 + _context.next = 31;
6768 + break;
6769 + }
6770 + _hashCommand = _step2.value;
6771 + _dispatcher = this.dispatchersList[_hashCommand.method];
6772 + _context.next = 29;
6773 + return _dispatcher.runner()(_hashCommand.command, _dispatcher.isSafeWithArgs(_hashCommand.command) ? _hashCommand.args : undefined);
6774 + case 29:
6775 + _context.next = 24;
6776 + break;
6777 + case 31:
6778 + _context.next = 36;
6779 + break;
6780 + case 33:
6781 + _context.prev = 33;
6782 + _context.t1 = _context["catch"](22);
6783 + _iterator2.e(_context.t1);
6784 + case 36:
6785 + _context.prev = 36;
6786 + _iterator2.f();
6787 + return _context.finish(36);
6788 + case 39:
6789 + case "end":
6790 + return _context.stop();
6791 + }
6792 + }
6793 + }, _callee, this, [[2, 15, 18, 21], [22, 33, 36, 39]]);
6794 + }));
6795 + function run() {
6796 + return _run.apply(this, arguments);
6797 + }
6798 + return run;
6799 + }()
6800 + /**
6801 + * Function runOnce().
6802 + *
6803 + * Do same as `run` but clear `this.commands` before leaving.
6804 + */
6805 + }, {
6806 + key: "runOnce",
6807 + value: function runOnce() {
6808 + var _this2 = this;
6809 + this.run(this.commands).then(function () {
6810 + _this2.commands = [];
6811 + });
6812 + }
6813 +
6814 + /**
6815 + * Takes a args in form of JSON and parse it.
6816 + *
6817 + * @param {string} rawArgs
6818 + * @return {Object} args in as an object
6819 + */
6820 + }, {
6821 + key: "parseCommandArgs",
6822 + value: function parseCommandArgs(rawArgs) {
6823 + try {
6824 + return JSON.parse(decodeURI(rawArgs || '{}'));
6825 + } catch (e) {
6826 + _console.default.warn('Hash commands JSON args cannot be parsed. \n\n', e);
6827 + return {};
6828 + }
6829 + }
6830 + }]);
6831 + return HashCommands;
6832 +}();
6833 +exports["default"] = HashCommands;
6834 +
6835 +/***/ }),
6836 +
6837 +/***/ "../modules/web-cli/assets/js/modules/command-base.js":
6838 +/*!************************************************************!*\
6839 + !*** ../modules/web-cli/assets/js/modules/command-base.js ***!
6840 + \************************************************************/
6841 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
6842 +
6843 +"use strict";
6844 +
6845 +
6846 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
6847 +Object.defineProperty(exports, "__esModule", ({
6848 + value: true
6849 +}));
6850 +exports["default"] = void 0;
6851 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
6852 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
6853 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
6854 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
6855 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
6856 +var _commandInfra = _interopRequireDefault(__webpack_require__(/*! ./command-infra */ "../modules/web-cli/assets/js/modules/command-infra.js"));
6857 +var _deprecation = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/deprecation */ "../modules/web-cli/assets/js/utils/deprecation.js"));
6858 +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); }; }
6859 +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; } }
6860 +/**
6861 + * @name $e.modules.CommandBase
6862 + */
6863 +var CommandBase = /*#__PURE__*/function (_CommandInfra) {
6864 + (0, _inherits2.default)(CommandBase, _CommandInfra);
6865 + var _super = _createSuper(CommandBase);
6866 + function CommandBase() {
6867 + (0, _classCallCheck2.default)(this, CommandBase);
6868 + return _super.apply(this, arguments);
6869 + }
6870 + (0, _createClass2.default)(CommandBase, [{
6871 + key: "onBeforeRun",
6872 + value: function onBeforeRun() {
6873 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
6874 + $e.hooks.runUIBefore(this.command, args);
6875 + }
6876 + }, {
6877 + key: "onAfterRun",
6878 + value: function onAfterRun() {
6879 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
6880 + var result = arguments.length > 1 ? arguments[1] : undefined;
6881 + $e.hooks.runUIAfter(this.command, args, result);
6882 + }
6883 + }, {
6884 + key: "onBeforeApply",
6885 + value: function onBeforeApply() {
6886 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
6887 + $e.hooks.runDataDependency(this.command, args);
6888 + }
6889 + }, {
6890 + key: "onAfterApply",
6891 + value: function onAfterApply() {
6892 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
6893 + var result = arguments.length > 1 ? arguments[1] : undefined;
6894 + $e.hooks.runDataAfter(this.command, args, result);
6895 + }
6896 + }, {
6897 + key: "onCatchApply",
6898 + value: function onCatchApply(e) {
6899 + this.runCatchHooks(e);
6900 + }
6901 +
6902 + /**
6903 + * Run all the catch hooks.
6904 + *
6905 + * @param {Error} e
6906 + */
6907 + }, {
6908 + key: "runCatchHooks",
6909 + value: function runCatchHooks(e) {
6910 + $e.hooks.runDataCatch(this.command, this.args, e);
6911 + $e.hooks.runUICatch(this.command, this.args, e);
6912 + }
6913 +
6914 + /**
6915 + * TODO - Remove - Backwards compatibility.
6916 + *
6917 + * Function requireContainer().
6918 + *
6919 + * Validate `arg.container` & `arg.containers`.
6920 + *
6921 + * @param {{}} args
6922 + *
6923 + * @throws {Error}
6924 + */
6925 + }, {
6926 + key: "requireContainer",
6927 + value: function requireContainer() {
6928 + var _this = this;
6929 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.args;
6930 + _deprecation.default.deprecated('requireContainer', '3.7.0', 'Extend `$e.modules.editor.CommandContainerBase` or `$e.modules.editor.CommandContainerInternalBase`');
6931 + if (!args.container && !args.containers) {
6932 + throw Error('container or containers are required.');
6933 + }
6934 + if (args.container && args.containers) {
6935 + throw Error('container and containers cannot go together please select one of them.');
6936 + }
6937 + var containers = args.containers || [args.container];
6938 + containers.forEach(function (container) {
6939 + _this.requireArgumentInstance('container', elementorModules.editor.Container, {
6940 + container: container
6941 + });
6942 + });
6943 + }
6944 + }], [{
6945 + key: "getInstanceType",
6946 + value: function getInstanceType() {
6947 + return 'CommandBase';
6948 + }
6949 + }]);
6950 + return CommandBase;
6951 +}(_commandInfra.default);
6952 +exports["default"] = CommandBase;
6953 +
6954 +/***/ }),
6955 +
6956 +/***/ "../modules/web-cli/assets/js/modules/command-callback-base.js":
6957 +/*!*********************************************************************!*\
6958 + !*** ../modules/web-cli/assets/js/modules/command-callback-base.js ***!
6959 + \*********************************************************************/
6960 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
6961 +
6962 +"use strict";
6963 +
6964 +
6965 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
6966 +Object.defineProperty(exports, "__esModule", ({
6967 + value: true
6968 +}));
6969 +exports["default"] = void 0;
6970 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
6971 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
6972 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
6973 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
6974 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
6975 +var _commandBase = _interopRequireDefault(__webpack_require__(/*! ./command-base */ "../modules/web-cli/assets/js/modules/command-base.js"));
6976 +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); }; }
6977 +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; } }
6978 +/**
6979 + * To support pure callbacks in the API(commands.js), to ensure they have registered with the proper context.
6980 + */
6981 +var CommandCallbackBase = /*#__PURE__*/function (_CommandBase) {
6982 + (0, _inherits2.default)(CommandCallbackBase, _CommandBase);
6983 + var _super = _createSuper(CommandCallbackBase);
6984 + function CommandCallbackBase() {
6985 + (0, _classCallCheck2.default)(this, CommandCallbackBase);
6986 + return _super.apply(this, arguments);
6987 + }
6988 + (0, _createClass2.default)(CommandCallbackBase, [{
6989 + key: "apply",
6990 + value: function apply() {
6991 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
6992 + return this.constructor.getCallback()(args);
6993 + }
6994 + }], [{
6995 + key: "getInstanceType",
6996 + value: function getInstanceType() {
6997 + return 'CommandCallbackBase';
6998 + }
6999 +
7000 + /**
7001 + * Get original callback of the command.
7002 + *
7003 + * Support pure callbacks ( Non command-base ).
7004 + *
7005 + * @return {()=>{}} Command Results.
7006 + */
7007 + }, {
7008 + key: "getCallback",
7009 + value: function getCallback() {
7010 + return this.registerConfig.callback;
7011 + }
7012 + }]);
7013 + return CommandCallbackBase;
7014 +}(_commandBase.default);
7015 +exports["default"] = CommandCallbackBase;
7016 +
7017 +/***/ }),
7018 +
7019 +/***/ "../modules/web-cli/assets/js/modules/command-data.js":
7020 +/*!************************************************************!*\
7021 + !*** ../modules/web-cli/assets/js/modules/command-data.js ***!
7022 + \************************************************************/
7023 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
7024 +
7025 +"use strict";
7026 +
7027 +
7028 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
7029 +var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js");
7030 +Object.defineProperty(exports, "__esModule", ({
7031 + value: true
7032 +}));
7033 +exports["default"] = void 0;
7034 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
7035 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
7036 +var _assertThisInitialized2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ "../node_modules/@babel/runtime/helpers/assertThisInitialized.js"));
7037 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
7038 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
7039 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
7040 +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
7041 +var _commandBase = _interopRequireDefault(__webpack_require__(/*! ./command-base */ "../modules/web-cli/assets/js/modules/command-base.js"));
7042 +var errors = _interopRequireWildcard(__webpack_require__(/*! ../core/data/errors/ */ "../modules/web-cli/assets/js/core/data/errors/index.js"));
7043 +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); }
7044 +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; }
7045 +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); }; }
7046 +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; } }
7047 +/**
7048 + * @name $e.modules.CommandData
7049 + */
7050 +/**
7051 + * @typedef {('create'|'delete'|'get'|'update'|'options')} DataTypes
7052 + */
7053 +/**
7054 + * @typedef {{}} RequestData
7055 + */
7056 +/**
7057 + * @typedef {import('../core/data/errors/base-error')} BaseError
7058 + */
7059 +var CommandData = /*#__PURE__*/function (_CommandBase) {
7060 + (0, _inherits2.default)(CommandData, _CommandBase);
7061 + var _super = _createSuper(CommandData);
7062 + function CommandData(args) {
7063 + var _this$args$options;
7064 + var _this;
7065 + var commandsAPI = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : $e.data;
7066 + (0, _classCallCheck2.default)(this, CommandData);
7067 + _this = _super.call(this, args, commandsAPI);
7068 + (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "data", void 0);
7069 + (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "type", void 0);
7070 + if ((_this$args$options = _this.args.options) !== null && _this$args$options !== void 0 && _this$args$options.type) {
7071 + _this.type = _this.args.options.type;
7072 + }
7073 + return _this;
7074 + }
7075 +
7076 + /**
7077 + * Function getEndpointFormat().
7078 + *
7079 + * @return {null|string} endpoint format
7080 + */
7081 + (0, _createClass2.default)(CommandData, [{
7082 + key: "getApplyMethods",
7083 + value:
7084 + /**
7085 + * @param {DataTypes} type
7086 + *
7087 + * @return {boolean|{before: (function(*=): {}), after: (function({}, *=): {})}} apply methods
7088 + */
7089 + function getApplyMethods() {
7090 + var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.type;
7091 + var before, after;
7092 + switch (type) {
7093 + case 'create':
7094 + before = this.applyBeforeCreate;
7095 + after = this.applyAfterCreate;
7096 + break;
7097 + case 'delete':
7098 + before = this.applyBeforeDelete;
7099 + after = this.applyAfterDelete;
7100 + break;
7101 + case 'get':
7102 + before = this.applyBeforeGet;
7103 + after = this.applyAfterGet;
7104 + break;
7105 + case 'update':
7106 + before = this.applyBeforeUpdate;
7107 + after = this.applyAfterUpdate;
7108 + break;
7109 + case 'options':
7110 + before = this.applyBeforeOptions;
7111 + after = this.applyAfterOptions;
7112 + break;
7113 + default:
7114 + return false;
7115 + }
7116 + return {
7117 + before: before.bind(this),
7118 + after: after.bind(this)
7119 + };
7120 + }
7121 +
7122 + /**
7123 + * Function getRequestData().
7124 + *
7125 + * @return {RequestData} request data
7126 + */
7127 + }, {
7128 + key: "getRequestData",
7129 + value: function getRequestData() {
7130 + return {
7131 + type: this.type,
7132 + args: this.args,
7133 + timestamp: new Date().getTime(),
7134 + component: this.component,
7135 + command: this.command,
7136 + endpoint: $e.data.commandToEndpoint(this.command, JSON.parse(JSON.stringify(this.args)), this.constructor.getEndpointFormat())
7137 + };
7138 + }
7139 + }, {
7140 + key: "apply",
7141 + value: function apply() {
7142 + var _this2 = this;
7143 + var applyMethods = this.getApplyMethods();
7144 +
7145 + // Run 'before' method.
7146 + this.args = applyMethods.before(this.args);
7147 + var requestData = this.getRequestData();
7148 + return $e.data.fetch(requestData).then(function (data) {
7149 + _this2.data = data;
7150 +
7151 + // Run 'after' method.
7152 + _this2.data = applyMethods.after(data, _this2.args);
7153 + _this2.data = {
7154 + data: _this2.data
7155 + };
7156 +
7157 + // Append requestData.
7158 + _this2.data = Object.assign({
7159 + __requestData__: requestData
7160 + }, _this2.data);
7161 + return _this2.data;
7162 + });
7163 + }
7164 +
7165 + /**
7166 + * @param {*} [args={}]
7167 + * @return {{}} filtered args
7168 + */
7169 + }, {
7170 + key: "applyBeforeCreate",
7171 + value: function applyBeforeCreate() {
7172 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7173 + return args;
7174 + }
7175 +
7176 + /**
7177 + * @param {{}} data
7178 + * @param {*} [args={}]
7179 + * @return {{}} filtered result
7180 + */
7181 + }, {
7182 + key: "applyAfterCreate",
7183 + value: function applyAfterCreate(data) {
7184 + var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
7185 + // eslint-disable-line no-unused-vars
7186 + return data;
7187 + }
7188 +
7189 + /**
7190 + * @param {*} [args={}]
7191 + * @return {{}} filtered args
7192 + */
7193 + }, {
7194 + key: "applyBeforeDelete",
7195 + value: function applyBeforeDelete() {
7196 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7197 + return args;
7198 + }
7199 +
7200 + /**
7201 + * @param {{}} data
7202 + * @param {*} [args={}]
7203 + * @return {{}} filtered result
7204 + */
7205 + }, {
7206 + key: "applyAfterDelete",
7207 + value: function applyAfterDelete(data) {
7208 + var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
7209 + // eslint-disable-line no-unused-vars
7210 + return data;
7211 + }
7212 +
7213 + /**
7214 + * @param {*} [args={}]
7215 + * @return {{}} filtered args
7216 + */
7217 + }, {
7218 + key: "applyBeforeGet",
7219 + value: function applyBeforeGet() {
7220 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7221 + return args;
7222 + }
7223 +
7224 + /**
7225 + * @param {{}} data
7226 + * @param {*} [args={}]
7227 + * @return {{}} filtered result
7228 + */
7229 + }, {
7230 + key: "applyAfterGet",
7231 + value: function applyAfterGet(data) {
7232 + var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
7233 + // eslint-disable-line no-unused-vars
7234 + return data;
7235 + }
7236 +
7237 + /**
7238 + * @param {*} [args={}]
7239 + * @return {{}} filtered args
7240 + */
7241 + }, {
7242 + key: "applyBeforeUpdate",
7243 + value: function applyBeforeUpdate() {
7244 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7245 + return args;
7246 + }
7247 +
7248 + /**
7249 + * @param {{}} data
7250 + * @param {*} [args={}]
7251 + * @return {{}} filtered result
7252 + */
7253 + }, {
7254 + key: "applyAfterUpdate",
7255 + value: function applyAfterUpdate(data) {
7256 + var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
7257 + // eslint-disable-line no-unused-vars
7258 + return data;
7259 + }
7260 +
7261 + /**
7262 + * @param {*} [args={}]
7263 + * @return {{}} filtered args
7264 + */
7265 + }, {
7266 + key: "applyBeforeOptions",
7267 + value: function applyBeforeOptions() {
7268 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7269 + return args;
7270 + }
7271 +
7272 + /**
7273 + * @param {{}} data
7274 + * @param {*} [args={}]
7275 + * @return {{}} filtered result
7276 + */
7277 + }, {
7278 + key: "applyAfterOptions",
7279 + value: function applyAfterOptions(data) {
7280 + var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
7281 + // eslint-disable-line no-unused-vars
7282 + return data;
7283 + }
7284 +
7285 + /**
7286 + * @param {BaseError} e
7287 + */
7288 + }, {
7289 + key: "applyAfterCatch",
7290 + value: function applyAfterCatch(e) {
7291 + e.notify();
7292 + }
7293 + }, {
7294 + key: "onCatchApply",
7295 + value: function onCatchApply(e) {
7296 + var _e, _e$data;
7297 + // TODO: If the errors that returns from the server is consistent remove the '?' from 'e'
7298 + 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;
7299 + var dataError = Object.values(errors).find(function (error) {
7300 + return error.getHTTPErrorCode() === httpErrorCode;
7301 + });
7302 + if (!dataError) {
7303 + dataError = errors.DefaultError;
7304 + }
7305 + e = dataError.create(e.message, e.code, e.data || []);
7306 + this.runCatchHooks(e);
7307 + this.applyAfterCatch(e);
7308 + }
7309 + }], [{
7310 + key: "getInstanceType",
7311 + value:
7312 + /**
7313 + * Data returned from remote.
7314 + *
7315 + * @type {*}
7316 + */
7317 +
7318 + /**
7319 + * Fetch type.
7320 + *
7321 + * @type {DataTypes}
7322 + */
7323 +
7324 + function getInstanceType() {
7325 + return 'CommandData';
7326 + }
7327 + }, {
7328 + key: "getEndpointFormat",
7329 + value: function getEndpointFormat() {
7330 + return null;
7331 + }
7332 + }]);
7333 + return CommandData;
7334 +}(_commandBase.default);
7335 +exports["default"] = CommandData;
7336 +
7337 +/***/ }),
7338 +
7339 +/***/ "../modules/web-cli/assets/js/modules/command-infra.js":
7340 +/*!*************************************************************!*\
7341 + !*** ../modules/web-cli/assets/js/modules/command-infra.js ***!
7342 + \*************************************************************/
7343 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
7344 +
7345 +"use strict";
7346 +
7347 +
7348 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
7349 +Object.defineProperty(exports, "__esModule", ({
7350 + value: true
7351 +}));
7352 +exports["default"] = void 0;
7353 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
7354 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
7355 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
7356 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
7357 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
7358 +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
7359 +var _argsObject = _interopRequireDefault(__webpack_require__(/*! elementor-assets-js/modules/imports/args-object */ "../assets/dev/js/modules/imports/args-object.js"));
7360 +var _deprecation = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/deprecation */ "../modules/web-cli/assets/js/utils/deprecation.js"));
7361 +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); }; }
7362 +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; } }
7363 +/**
7364 + * @typedef {import('../modules/component-base')} ComponentBase
7365 + */
7366 +var CommandInfra = /*#__PURE__*/function (_ArgsObject) {
7367 + (0, _inherits2.default)(CommandInfra, _ArgsObject);
7368 + var _super = _createSuper(CommandInfra);
7369 + /**
7370 + * Function constructor().
7371 + *
7372 + * Create Commands Base.
7373 + *
7374 + * @param {{}} args
7375 + */
7376 + function CommandInfra() {
7377 + var _this;
7378 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7379 + (0, _classCallCheck2.default)(this, CommandInfra);
7380 + _this = _super.call(this, args);
7381 + if (!_this.constructor.registerConfig) {
7382 + throw RangeError('Doing it wrong: Each command type should have `registerConfig`.');
7383 + }
7384 +
7385 + // Acknowledge self about which command it run.
7386 + _this.command = _this.constructor.getCommand();
7387 +
7388 + // Assign instance of current component.
7389 + _this.component = _this.constructor.getComponent();
7390 +
7391 + // Who ever need do something before without `super` the constructor can use `initialize` method.
7392 + _this.initialize(args);
7393 +
7394 + // Refresh args, maybe the changed via `initialize`.
7395 + args = _this.args;
7396 +
7397 + // Validate args before run.
7398 + _this.validateArgs(args);
7399 + return _this;
7400 + }
7401 +
7402 + /**
7403 + * Function initialize().
7404 + *
7405 + * Initialize command, called after construction.
7406 + *
7407 + * @param {{}} args
7408 + */
7409 + (0, _createClass2.default)(CommandInfra, [{
7410 + key: "currentCommand",
7411 + get:
7412 + // TODO - Remove backwards compatibility.
7413 + function get() {
7414 + _deprecation.default.deprecated('this.currentCommand', '3.7.0', 'this.command');
7415 + return this.command;
7416 + }
7417 + }, {
7418 + key: "initialize",
7419 + value: function initialize() {
7420 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7421 + } // eslint-disable-line no-unused-vars
7422 +
7423 + /**
7424 + * Function validateArgs().
7425 + *
7426 + * Validate command arguments.
7427 + *
7428 + * @param {{}} args
7429 + */
7430 + }, {
7431 + key: "validateArgs",
7432 + value: function validateArgs() {
7433 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7434 + } // eslint-disable-line no-unused-vars
7435 +
7436 + // eslint-disable-next-line jsdoc/require-returns-check
7437 + /**
7438 + * Function apply().
7439 + *
7440 + * Do the actual command.
7441 + *
7442 + * @param {{}} args
7443 + *
7444 + * @return {*} Command results.
7445 + */
7446 + }, {
7447 + key: "apply",
7448 + value: function apply() {
7449 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7450 + // eslint-disable-line no-unused-vars
7451 + elementorModules.ForceMethodImplementation();
7452 + }
7453 +
7454 + /**
7455 + * Function run().
7456 + *
7457 + * Run command with history & hooks.
7458 + *
7459 + * @return {*} Command results.
7460 + */
7461 + }, {
7462 + key: "run",
7463 + value: function run() {
7464 + return this.apply(this.args);
7465 + }
7466 +
7467 + /**
7468 + * Function onBeforeRun.
7469 + *
7470 + * Called before run().
7471 + *
7472 + * @param {{}} args
7473 + */
7474 + }, {
7475 + key: "onBeforeRun",
7476 + value: function onBeforeRun() {
7477 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7478 + } // eslint-disable-line no-unused-vars
7479 +
7480 + /**
7481 + * Function onAfterRun.
7482 + *
7483 + * Called after run().
7484 + *
7485 + * @param {{}} args
7486 + * @param {*} result
7487 + */
7488 + }, {
7489 + key: "onAfterRun",
7490 + value: function onAfterRun() {
7491 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7492 + var result = arguments.length > 1 ? arguments[1] : undefined;
7493 + } // eslint-disable-line no-unused-vars
7494 +
7495 + /**
7496 + * Function onBeforeApply.
7497 + *
7498 + * Called before apply().
7499 + *
7500 + * @param {{}} args
7501 + */
7502 + }, {
7503 + key: "onBeforeApply",
7504 + value: function onBeforeApply() {
7505 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7506 + } // eslint-disable-line no-unused-vars
7507 +
7508 + /**
7509 + * Function onAfterApply.
7510 + *
7511 + * Called after apply().
7512 + *
7513 + * @param {{}} args
7514 + * @param {*} result
7515 + */
7516 + }, {
7517 + key: "onAfterApply",
7518 + value: function onAfterApply() {
7519 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7520 + var result = arguments.length > 1 ? arguments[1] : undefined;
7521 + } // eslint-disable-line no-unused-vars
7522 +
7523 + /**
7524 + * Function onCatchApply.
7525 + *
7526 + * Called after apply() failed.
7527 + *
7528 + * @param {Error} e
7529 + */
7530 + }, {
7531 + key: "onCatchApply",
7532 + value: function onCatchApply(e) {} // eslint-disable-line no-unused-vars
7533 + }], [{
7534 + key: "getInstanceType",
7535 + value:
7536 + /**
7537 + * @type {Object}
7538 + */
7539 +
7540 + function getInstanceType() {
7541 + return 'CommandInfra';
7542 + }
7543 +
7544 + /**
7545 + * Get info of command.
7546 + *
7547 + * @return {Object} Extra information about the command.
7548 + */
7549 + }, {
7550 + key: "getInfo",
7551 + value: function getInfo() {
7552 + return {};
7553 + }
7554 +
7555 + /**
7556 + * @return {string} Self command name.
7557 + */
7558 + }, {
7559 + key: "getCommand",
7560 + value: function getCommand() {
7561 + return this.registerConfig.command;
7562 + }
7563 +
7564 + /**
7565 + * @return {ComponentBase} Self component
7566 + */
7567 + }, {
7568 + key: "getComponent",
7569 + value: function getComponent() {
7570 + return this.registerConfig.component;
7571 + }
7572 + }, {
7573 + key: "setRegisterConfig",
7574 + value: function setRegisterConfig(config) {
7575 + this.registerConfig = Object.freeze(config);
7576 + }
7577 + }]);
7578 + return CommandInfra;
7579 +}(_argsObject.default);
7580 +exports["default"] = CommandInfra;
7581 +(0, _defineProperty2.default)(CommandInfra, "registerConfig", null);
7582 +
7583 +/***/ }),
7584 +
7585 +/***/ "../modules/web-cli/assets/js/modules/command-internal-base.js":
7586 +/*!*********************************************************************!*\
7587 + !*** ../modules/web-cli/assets/js/modules/command-internal-base.js ***!
7588 + \*********************************************************************/
7589 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
7590 +
7591 +"use strict";
7592 +
7593 +
7594 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
7595 +Object.defineProperty(exports, "__esModule", ({
7596 + value: true
7597 +}));
7598 +exports["default"] = void 0;
7599 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
7600 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
7601 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
7602 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
7603 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
7604 +var _commandBase = _interopRequireDefault(__webpack_require__(/*! ./command-base */ "../modules/web-cli/assets/js/modules/command-base.js"));
7605 +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); }; }
7606 +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; } }
7607 +/**
7608 + * @name $e.modules.CommandInternalBase
7609 + */
7610 +var CommandInternalBase = /*#__PURE__*/function (_CommandBase) {
7611 + (0, _inherits2.default)(CommandInternalBase, _CommandBase);
7612 + var _super = _createSuper(CommandInternalBase);
7613 + function CommandInternalBase(args) {
7614 + var commandsAPI = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : $e.commandsInternal;
7615 + (0, _classCallCheck2.default)(this, CommandInternalBase);
7616 + return _super.call(this, args, commandsAPI);
7617 + }
7618 + (0, _createClass2.default)(CommandInternalBase, null, [{
7619 + key: "getInstanceType",
7620 + value: function getInstanceType() {
7621 + return 'CommandInternalBase';
7622 + }
7623 + }]);
7624 + return CommandInternalBase;
7625 +}(_commandBase.default);
7626 +exports["default"] = CommandInternalBase;
7627 +
7628 +/***/ }),
7629 +
7630 +/***/ "../modules/web-cli/assets/js/modules/commands/close.js":
7631 +/*!**************************************************************!*\
7632 + !*** ../modules/web-cli/assets/js/modules/commands/close.js ***!
7633 + \**************************************************************/
7634 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
7635 +
7636 +"use strict";
7637 +
7638 +
7639 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
7640 +Object.defineProperty(exports, "__esModule", ({
7641 + value: true
7642 +}));
7643 +exports["default"] = exports.Close = void 0;
7644 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
7645 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
7646 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
7647 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
7648 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
7649 +var _commandBase = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/command-base */ "../modules/web-cli/assets/js/modules/command-base.js"));
7650 +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); }; }
7651 +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; } }
7652 +var Close = /*#__PURE__*/function (_CommandBase) {
7653 + (0, _inherits2.default)(Close, _CommandBase);
7654 + var _super = _createSuper(Close);
7655 + function Close() {
7656 + (0, _classCallCheck2.default)(this, Close);
7657 + return _super.apply(this, arguments);
7658 + }
7659 + (0, _createClass2.default)(Close, [{
7660 + key: "apply",
7661 + value: function apply() {
7662 + this.component.close();
7663 + }
7664 + }]);
7665 + return Close;
7666 +}(_commandBase.default);
7667 +exports.Close = Close;
7668 +var _default = Close;
7669 +exports["default"] = _default;
7670 +
7671 +/***/ }),
7672 +
7673 +/***/ "../modules/web-cli/assets/js/modules/commands/index.js":
7674 +/*!**************************************************************!*\
7675 + !*** ../modules/web-cli/assets/js/modules/commands/index.js ***!
7676 + \**************************************************************/
7677 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
7678 +
7679 +"use strict";
7680 +
7681 +
7682 +Object.defineProperty(exports, "__esModule", ({
7683 + value: true
7684 +}));
7685 +Object.defineProperty(exports, "Close", ({
7686 + enumerable: true,
7687 + get: function get() {
7688 + return _close.Close;
7689 + }
7690 +}));
7691 +Object.defineProperty(exports, "Open", ({
7692 + enumerable: true,
7693 + get: function get() {
7694 + return _open.Open;
7695 + }
7696 +}));
7697 +Object.defineProperty(exports, "Toggle", ({
7698 + enumerable: true,
7699 + get: function get() {
7700 + return _toggle.Toggle;
7701 + }
7702 +}));
7703 +var _close = __webpack_require__(/*! ./close */ "../modules/web-cli/assets/js/modules/commands/close.js");
7704 +var _open = __webpack_require__(/*! ./open */ "../modules/web-cli/assets/js/modules/commands/open.js");
7705 +var _toggle = __webpack_require__(/*! ./toggle */ "../modules/web-cli/assets/js/modules/commands/toggle.js");
7706 +
7707 +/***/ }),
7708 +
7709 +/***/ "../modules/web-cli/assets/js/modules/commands/open.js":
7710 +/*!*************************************************************!*\
7711 + !*** ../modules/web-cli/assets/js/modules/commands/open.js ***!
7712 + \*************************************************************/
7713 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
7714 +
7715 +"use strict";
7716 +
7717 +
7718 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
7719 +Object.defineProperty(exports, "__esModule", ({
7720 + value: true
7721 +}));
7722 +exports["default"] = exports.Open = void 0;
7723 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
7724 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
7725 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
7726 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
7727 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
7728 +var _commandBase = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/command-base */ "../modules/web-cli/assets/js/modules/command-base.js"));
7729 +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); }; }
7730 +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; } }
7731 +var Open = /*#__PURE__*/function (_CommandBase) {
7732 + (0, _inherits2.default)(Open, _CommandBase);
7733 + var _super = _createSuper(Open);
7734 + function Open() {
7735 + (0, _classCallCheck2.default)(this, Open);
7736 + return _super.apply(this, arguments);
7737 + }
7738 + (0, _createClass2.default)(Open, [{
7739 + key: "apply",
7740 + value: function apply() {
7741 + $e.route(this.component.getNamespace());
7742 + }
7743 + }]);
7744 + return Open;
7745 +}(_commandBase.default);
7746 +exports.Open = Open;
7747 +var _default = Open;
7748 +exports["default"] = _default;
7749 +
7750 +/***/ }),
7751 +
7752 +/***/ "../modules/web-cli/assets/js/modules/commands/toggle.js":
7753 +/*!***************************************************************!*\
7754 + !*** ../modules/web-cli/assets/js/modules/commands/toggle.js ***!
7755 + \***************************************************************/
7756 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
7757 +
7758 +"use strict";
7759 +
7760 +
7761 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
7762 +Object.defineProperty(exports, "__esModule", ({
7763 + value: true
7764 +}));
7765 +exports["default"] = exports.Toggle = void 0;
7766 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
7767 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
7768 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
7769 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
7770 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
7771 +var _commandBase = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/command-base */ "../modules/web-cli/assets/js/modules/command-base.js"));
7772 +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); }; }
7773 +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; } }
7774 +var Toggle = /*#__PURE__*/function (_CommandBase) {
7775 + (0, _inherits2.default)(Toggle, _CommandBase);
7776 + var _super = _createSuper(Toggle);
7777 + function Toggle() {
7778 + (0, _classCallCheck2.default)(this, Toggle);
7779 + return _super.apply(this, arguments);
7780 + }
7781 + (0, _createClass2.default)(Toggle, [{
7782 + key: "apply",
7783 + value: function apply() {
7784 + if (this.component.isOpen) {
7785 + this.component.close();
7786 + } else {
7787 + $e.route(this.component.getNamespace());
7788 + }
7789 + }
7790 + }]);
7791 + return Toggle;
7792 +}(_commandBase.default);
7793 +exports.Toggle = Toggle;
7794 +var _default = Toggle;
7795 +exports["default"] = _default;
7796 +
7797 +/***/ }),
7798 +
7799 +/***/ "../modules/web-cli/assets/js/modules/component-base.js":
7800 +/*!**************************************************************!*\
7801 + !*** ../modules/web-cli/assets/js/modules/component-base.js ***!
7802 + \**************************************************************/
7803 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
7804 +
7805 +"use strict";
7806 +
7807 +
7808 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
7809 +Object.defineProperty(exports, "__esModule", ({
7810 + value: true
7811 +}));
7812 +exports["default"] = void 0;
7813 +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
7814 +var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js"));
7815 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
7816 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
7817 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
7818 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
7819 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
7820 +var _commandCallbackBase = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/command-callback-base */ "../modules/web-cli/assets/js/modules/command-callback-base.js"));
7821 +var _toolkit = __webpack_require__(/*! @reduxjs/toolkit */ "../node_modules/@reduxjs/toolkit/dist/redux-toolkit.esm.js");
7822 +var _module = _interopRequireDefault(__webpack_require__(/*! elementor/assets/dev/js/modules/imports/module.js */ "../assets/dev/js/modules/imports/module.js"));
7823 +var _forceMethodImplementation = _interopRequireDefault(__webpack_require__(/*! ../utils/force-method-implementation */ "../modules/web-cli/assets/js/utils/force-method-implementation.js"));
7824 +var _deprecation = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/deprecation */ "../modules/web-cli/assets/js/utils/deprecation.js"));
7825 +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; }
7826 +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; }
7827 +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); }; }
7828 +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; } }
7829 +/**
7830 + * @typedef {import('./command-infra')} CommandInfra
7831 + * @typedef {import('./hook-base')} HookBase
7832 + * @typedef {import('../core/states/ui-state-base')} UiStateBase
7833 + */
7834 +var ComponentBase = /*#__PURE__*/function (_Module) {
7835 + (0, _inherits2.default)(ComponentBase, _Module);
7836 + var _super = _createSuper(ComponentBase);
7837 + function ComponentBase() {
7838 + (0, _classCallCheck2.default)(this, ComponentBase);
7839 + return _super.apply(this, arguments);
7840 + }
7841 + (0, _createClass2.default)(ComponentBase, [{
7842 + key: "__construct",
7843 + value: function __construct() {
7844 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7845 + if (args.manager) {
7846 + this.manager = args.manager;
7847 + }
7848 + this.commands = this.defaultCommands();
7849 + this.commandsInternal = this.defaultCommandsInternal();
7850 + this.hooks = this.defaultHooks();
7851 + this.routes = this.defaultRoutes();
7852 + this.tabs = this.defaultTabs();
7853 + this.shortcuts = this.defaultShortcuts();
7854 + this.utils = this.defaultUtils();
7855 + this.data = this.defaultData();
7856 + this.uiStates = this.defaultUiStates();
7857 + this.states = this.defaultStates();
7858 + this.defaultRoute = '';
7859 + this.currentTab = '';
7860 + }
7861 + }, {
7862 + key: "registerAPI",
7863 + value: function registerAPI() {
7864 + var _this = this;
7865 + Object.entries(this.getTabs()).forEach(function (tab) {
7866 + return _this.registerTabRoute(tab[0]);
7867 + });
7868 + Object.entries(this.getRoutes()).forEach(function (_ref) {
7869 + var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
7870 + route = _ref2[0],
7871 + callback = _ref2[1];
7872 + return _this.registerRoute(route, callback);
7873 + });
7874 + Object.entries(this.getCommands()).forEach(function (_ref3) {
7875 + var _ref4 = (0, _slicedToArray2.default)(_ref3, 2),
7876 + command = _ref4[0],
7877 + callback = _ref4[1];
7878 + return _this.registerCommand(command, callback);
7879 + });
7880 + Object.entries(this.getCommandsInternal()).forEach(function (_ref5) {
7881 + var _ref6 = (0, _slicedToArray2.default)(_ref5, 2),
7882 + command = _ref6[0],
7883 + callback = _ref6[1];
7884 + return _this.registerCommandInternal(command, callback);
7885 + });
7886 + Object.values(this.getHooks()).forEach(function (instance) {
7887 + return _this.registerHook(instance);
7888 + });
7889 + Object.entries(this.getData()).forEach(function (_ref7) {
7890 + var _ref8 = (0, _slicedToArray2.default)(_ref7, 2),
7891 + command = _ref8[0],
7892 + callback = _ref8[1];
7893 + return _this.registerData(command, callback);
7894 + });
7895 + Object.values(this.getUiStates()).forEach(function (instance) {
7896 + return _this.registerUiState(instance);
7897 + });
7898 + Object.entries(this.getStates()).forEach(function (_ref9) {
7899 + var _ref10 = (0, _slicedToArray2.default)(_ref9, 2),
7900 + id = _ref10[0],
7901 + state = _ref10[1];
7902 + return _this.registerState(id, state);
7903 + });
7904 + }
7905 +
7906 + // eslint-disable-next-line jsdoc/require-returns-check
7907 + /**
7908 + * @return {string} namespace
7909 + */
7910 + }, {
7911 + key: "getNamespace",
7912 + value: function getNamespace() {
7913 + (0, _forceMethodImplementation.default)();
7914 + }
7915 + }, {
7916 + key: "getRootContainer",
7917 + value: function getRootContainer() {
7918 + _deprecation.default.deprecated('getRootContainer()', '3.7.0', 'getServiceName()');
7919 + return this.getServiceName();
7920 + }
7921 + }, {
7922 + key: "getServiceName",
7923 + value: function getServiceName() {
7924 + return this.getNamespace().split('/')[0];
7925 + }
7926 + }, {
7927 + key: "store",
7928 + get: function get() {
7929 + return $e.store.get(this.getNamespace());
7930 + }
7931 + }, {
7932 + key: "defaultTabs",
7933 + value: function defaultTabs() {
7934 + return {};
7935 + }
7936 + }, {
7937 + key: "defaultRoutes",
7938 + value: function defaultRoutes() {
7939 + return {};
7940 + }
7941 + }, {
7942 + key: "defaultCommands",
7943 + value: function defaultCommands() {
7944 + return {};
7945 + }
7946 + }, {
7947 + key: "defaultCommandsInternal",
7948 + value: function defaultCommandsInternal() {
7949 + return {};
7950 + }
7951 + }, {
7952 + key: "defaultHooks",
7953 + value: function defaultHooks() {
7954 + return {};
7955 + }
7956 +
7957 + /**
7958 + * Get the component's default UI states.
7959 + *
7960 + * @return {Object} default UI states
7961 + */
7962 + }, {
7963 + key: "defaultUiStates",
7964 + value: function defaultUiStates() {
7965 + return {};
7966 + }
7967 +
7968 + /**
7969 + * Get the component's Redux slice settings.
7970 + *
7971 + * @return {Object} Redux slice settings
7972 + */
7973 + }, {
7974 + key: "defaultStates",
7975 + value: function defaultStates() {
7976 + return {};
7977 + }
7978 + }, {
7979 + key: "defaultShortcuts",
7980 + value: function defaultShortcuts() {
7981 + return {};
7982 + }
7983 + }, {
7984 + key: "defaultUtils",
7985 + value: function defaultUtils() {
7986 + return {};
7987 + }
7988 + }, {
7989 + key: "defaultData",
7990 + value: function defaultData() {
7991 + return {};
7992 + }
7993 + }, {
7994 + key: "getCommands",
7995 + value: function getCommands() {
7996 + return this.commands;
7997 + }
7998 + }, {
7999 + key: "getCommandsInternal",
8000 + value: function getCommandsInternal() {
8001 + return this.commandsInternal;
8002 + }
8003 + }, {
8004 + key: "getHooks",
8005 + value: function getHooks() {
8006 + return this.hooks;
8007 + }
8008 +
8009 + /**
8010 + * Retrieve the component's UI states.
8011 + *
8012 + * @return {Object} UI states
8013 + */
8014 + }, {
8015 + key: "getUiStates",
8016 + value: function getUiStates() {
8017 + return this.uiStates;
8018 + }
8019 +
8020 + /**
8021 + * Retrieve the component's Redux Slice.
8022 + *
8023 + * @return {Object} Redux Slice
8024 + */
8025 + }, {
8026 + key: "getStates",
8027 + value: function getStates() {
8028 + return this.states;
8029 + }
8030 + }, {
8031 + key: "getRoutes",
8032 + value: function getRoutes() {
8033 + return this.routes;
8034 + }
8035 + }, {
8036 + key: "getTabs",
8037 + value: function getTabs() {
8038 + return this.tabs;
8039 + }
8040 + }, {
8041 + key: "getShortcuts",
8042 + value: function getShortcuts() {
8043 + return this.shortcuts;
8044 + }
8045 + }, {
8046 + key: "getData",
8047 + value: function getData() {
8048 + return this.data;
8049 + }
8050 +
8051 + /**
8052 + * @param {string} command
8053 + * @param {(()=>{}|CommandInfra)} context
8054 + * @param {'default'|'internal'|'data'} commandsType
8055 + */
8056 + }, {
8057 + key: "registerCommand",
8058 + value: function registerCommand(command, context) {
8059 + var commandsType = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'default';
8060 + var commandsManager;
8061 + switch (commandsType) {
8062 + case 'default':
8063 + commandsManager = $e.commands;
8064 + break;
8065 + case 'internal':
8066 + commandsManager = $e.commandsInternal;
8067 + break;
8068 + case 'data':
8069 + commandsManager = $e.data;
8070 + break;
8071 + default:
8072 + throw new Error("Invalid commands type: '".concat(command, "'"));
8073 + }
8074 + var fullCommand = this.getNamespace() + '/' + command,
8075 + instanceType = context.getInstanceType ? context.getInstanceType() : false,
8076 + registerConfig = {
8077 + command: fullCommand,
8078 + component: this
8079 + };
8080 +
8081 + // Support pure callback.
8082 + if (!instanceType) {
8083 + if ($e.devTools) {
8084 + $e.devTools.log.warn("Attach command-callback-base, on command: '".concat(fullCommand, "', context is unknown type."));
8085 + }
8086 + registerConfig.callback = context;
8087 +
8088 + // Unique class.
8089 + context = /*#__PURE__*/function (_CommandCallbackBase) {
8090 + (0, _inherits2.default)(context, _CommandCallbackBase);
8091 + var _super2 = _createSuper(context);
8092 + function context() {
8093 + (0, _classCallCheck2.default)(this, context);
8094 + return _super2.apply(this, arguments);
8095 + }
8096 + return (0, _createClass2.default)(context);
8097 + }(_commandCallbackBase.default);
8098 + }
8099 + context.setRegisterConfig(registerConfig);
8100 + commandsManager.register(this, command, context);
8101 + }
8102 +
8103 + /**
8104 + * @param {HookBase} instance
8105 + */
8106 + }, {
8107 + key: "registerHook",
8108 + value: function registerHook(instance) {
8109 + return instance.register();
8110 + }
8111 + }, {
8112 + key: "registerCommandInternal",
8113 + value: function registerCommandInternal(command, context) {
8114 + this.registerCommand(command, context, 'internal');
8115 + }
8116 +
8117 + /**
8118 + * Register a UI state.
8119 + *
8120 + * @param {UiStateBase} instance - UI state instance.
8121 + *
8122 + * @return {void}
8123 + */
8124 + }, {
8125 + key: "registerUiState",
8126 + value: function registerUiState(instance) {
8127 + $e.uiStates.register(instance);
8128 + }
8129 +
8130 + /**
8131 + * Register a Redux Slice.
8132 + *
8133 + * @param {string} id - State id.
8134 + * @param {Object} stateConfig - The state config.
8135 + *
8136 + * @return {void}
8137 + */
8138 + }, {
8139 + key: "registerState",
8140 + value: function registerState(id, stateConfig) {
8141 + id = this.getNamespace() + (id ? "/".concat(id) : '');
8142 + var slice = (0, _toolkit.createSlice)(_objectSpread(_objectSpread({}, stateConfig), {}, {
8143 + name: id
8144 + }));
8145 + $e.store.register(id, slice);
8146 + }
8147 + }, {
8148 + key: "registerRoute",
8149 + value: function registerRoute(route, callback) {
8150 + $e.routes.register(this, route, callback);
8151 + }
8152 + }, {
8153 + key: "registerData",
8154 + value: function registerData(command, context) {
8155 + this.registerCommand(command, context, 'data');
8156 + }
8157 + }, {
8158 + key: "unregisterRoute",
8159 + value: function unregisterRoute(route) {
8160 + $e.routes.unregister(this, route);
8161 + }
8162 + }, {
8163 + key: "registerTabRoute",
8164 + value: function registerTabRoute(tab) {
8165 + var _this2 = this;
8166 + this.registerRoute(tab, function (args) {
8167 + return _this2.activateTab(tab, args);
8168 + });
8169 + }
8170 + }, {
8171 + key: "dependency",
8172 + value: function dependency() {
8173 + return true;
8174 + }
8175 + }, {
8176 + key: "open",
8177 + value: function open() {
8178 + return true;
8179 + }
8180 + }, {
8181 + key: "close",
8182 + value: function close() {
8183 + if (!this.isOpen) {
8184 + return false;
8185 + }
8186 + this.isOpen = false;
8187 + this.inactivate();
8188 + $e.routes.clearCurrent(this.getNamespace());
8189 + $e.routes.clearHistory(this.getServiceName());
8190 + return true;
8191 + }
8192 + }, {
8193 + key: "activate",
8194 + value: function activate() {
8195 + $e.components.activate(this.getNamespace());
8196 + }
8197 + }, {
8198 + key: "inactivate",
8199 + value: function inactivate() {
8200 + $e.components.inactivate(this.getNamespace());
8201 + }
8202 + }, {
8203 + key: "isActive",
8204 + value: function isActive() {
8205 + return $e.components.isActive(this.getNamespace());
8206 + }
8207 + }, {
8208 + key: "onRoute",
8209 + value: function onRoute(route) {
8210 + this.toggleRouteClass(route, true);
8211 + this.toggleHistoryClass();
8212 + this.activate();
8213 + this.trigger('route/open', route);
8214 + }
8215 + }, {
8216 + key: "onCloseRoute",
8217 + value: function onCloseRoute(route) {
8218 + this.toggleRouteClass(route, false);
8219 + this.inactivate();
8220 + this.trigger('route/close', route);
8221 + }
8222 + }, {
8223 + key: "setDefaultRoute",
8224 + value: function setDefaultRoute(route) {
8225 + this.defaultRoute = this.getNamespace() + '/' + route;
8226 + }
8227 + }, {
8228 + key: "getDefaultRoute",
8229 + value: function getDefaultRoute() {
8230 + return this.defaultRoute;
8231 + }
8232 + }, {
8233 + key: "removeTab",
8234 + value: function removeTab(tab) {
8235 + delete this.tabs[tab];
8236 + this.unregisterRoute(tab);
8237 + }
8238 + }, {
8239 + key: "hasTab",
8240 + value: function hasTab(tab) {
8241 + return !!this.tabs[tab];
8242 + }
8243 + }, {
8244 + key: "addTab",
8245 + value: function addTab(tab, args, position) {
8246 + var _this3 = this;
8247 + this.tabs[tab] = args;
8248 + // It can be 0.
8249 + if ('undefined' !== typeof position) {
8250 + var newTabs = {};
8251 + var ids = Object.keys(this.tabs);
8252 + // Remove new tab
8253 + ids.pop();
8254 +
8255 + // Add it to position.
8256 + ids.splice(position, 0, tab);
8257 + ids.forEach(function (id) {
8258 + newTabs[id] = _this3.tabs[id];
8259 + });
8260 + this.tabs = newTabs;
8261 + }
8262 + this.registerTabRoute(tab);
8263 + }
8264 + }, {
8265 + key: "getTabsWrapperSelector",
8266 + value: function getTabsWrapperSelector() {
8267 + return '';
8268 + }
8269 + }, {
8270 + key: "getTabRoute",
8271 + value: function getTabRoute(tab) {
8272 + return this.getNamespace() + '/' + tab;
8273 + }
8274 + }, {
8275 + key: "renderTab",
8276 + value: function renderTab(tab) {} // eslint-disable-line
8277 + }, {
8278 + key: "activateTab",
8279 + value: function activateTab(tab, args) {
8280 + var _this4 = this;
8281 + this.currentTab = tab;
8282 + this.renderTab(tab, args);
8283 + jQuery(this.getTabsWrapperSelector() + ' .elementor-component-tab').off('click').on('click', function (event) {
8284 + $e.route(_this4.getTabRoute(event.currentTarget.dataset.tab), args);
8285 + }).removeClass('elementor-active').filter('[data-tab="' + tab + '"]').addClass('elementor-active');
8286 + }
8287 + }, {
8288 + key: "getActiveTabConfig",
8289 + value: function getActiveTabConfig() {
8290 + return this.tabs[this.currentTab] || {};
8291 + }
8292 + }, {
8293 + key: "getBodyClass",
8294 + value: function getBodyClass(route) {
8295 + return 'e-route-' + route.replace(/\//g, '-');
8296 + }
8297 +
8298 + /**
8299 + * If command includes uppercase character convert it to lowercase and add `-`.
8300 + * e.g: `CopyAll` is converted to `copy-all`.
8301 + *
8302 + * @param {string} commandName
8303 + */
8304 + }, {
8305 + key: "normalizeCommandName",
8306 + value: function normalizeCommandName(commandName) {
8307 + return commandName.replace(/[A-Z]/g, function (match, offset) {
8308 + return (offset > 0 ? '-' : '') + match.toLowerCase();
8309 + });
8310 + }
8311 +
8312 + /**
8313 + * @param {{}} commandsFromImport
8314 + * @return {{}} imported commands
8315 + */
8316 + }, {
8317 + key: "importCommands",
8318 + value: function importCommands(commandsFromImport) {
8319 + var _this5 = this;
8320 + var commands = {};
8321 +
8322 + // Convert `Commands` to `ComponentBase` workable format.
8323 + Object.entries(commandsFromImport).forEach(function (_ref11) {
8324 + var _ref12 = (0, _slicedToArray2.default)(_ref11, 2),
8325 + className = _ref12[0],
8326 + Class = _ref12[1];
8327 + var command = _this5.normalizeCommandName(className);
8328 + commands[command] = Class;
8329 + });
8330 + return commands;
8331 + }
8332 + }, {
8333 + key: "importHooks",
8334 + value: function importHooks(hooksFromImport) {
8335 + var hooks = {};
8336 + for (var key in hooksFromImport) {
8337 + var hook = new hooksFromImport[key]();
8338 + hooks[hook.getId()] = hook;
8339 + }
8340 + return hooks;
8341 + }
8342 +
8343 + /**
8344 + * Import & initialize the component's UI states.
8345 + * Should be used inside `defaultUiState()`.
8346 + *
8347 + * @param {Object} statesFromImport - UI states from import.
8348 + *
8349 + * @return {Object} UI States
8350 + */
8351 + }, {
8352 + key: "importUiStates",
8353 + value: function importUiStates(statesFromImport) {
8354 + var _this6 = this;
8355 + var uiStates = {};
8356 + Object.values(statesFromImport).forEach(function (className) {
8357 + var uiState = new className(_this6);
8358 + uiStates[uiState.getId()] = uiState;
8359 + });
8360 + return uiStates;
8361 + }
8362 +
8363 + /**
8364 + * Set a UI state value.
8365 + * TODO: Should we provide such function? Maybe the developer should implicitly pass the full state ID?
8366 + *
8367 + * @param {string} state - Non-prefixed state ID.
8368 + * @param {*} value - New state value.
8369 + *
8370 + * @return {void}
8371 + */
8372 + }, {
8373 + key: "setUiState",
8374 + value: function setUiState(state, value) {
8375 + $e.uiStates.set("".concat(this.getNamespace(), "/").concat(state), value);
8376 + }
8377 + }, {
8378 + key: "toggleRouteClass",
8379 + value: function toggleRouteClass(route, state) {
8380 + document.body.classList.toggle(this.getBodyClass(route), state);
8381 + }
8382 + }, {
8383 + key: "toggleHistoryClass",
8384 + value: function toggleHistoryClass() {
8385 + document.body.classList.toggle('e-routes-has-history', !!$e.routes.getHistory(this.getServiceName()).length);
8386 + }
8387 + }]);
8388 + return ComponentBase;
8389 +}(_module.default);
8390 +exports["default"] = ComponentBase;
8391 +
8392 +/***/ }),
8393 +
8394 +/***/ "../modules/web-cli/assets/js/modules/component-modal-base.js":
8395 +/*!********************************************************************!*\
8396 + !*** ../modules/web-cli/assets/js/modules/component-modal-base.js ***!
8397 + \********************************************************************/
8398 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
8399 +
8400 +"use strict";
8401 +
8402 +
8403 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
8404 +var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js");
8405 +Object.defineProperty(exports, "__esModule", ({
8406 + value: true
8407 +}));
8408 +exports["default"] = void 0;
8409 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
8410 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
8411 +var _get2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/get */ "../node_modules/@babel/runtime/helpers/get.js"));
8412 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
8413 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
8414 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
8415 +var _componentBase = _interopRequireDefault(__webpack_require__(/*! ./component-base */ "../modules/web-cli/assets/js/modules/component-base.js"));
8416 +var commands = _interopRequireWildcard(__webpack_require__(/*! ./commands/ */ "../modules/web-cli/assets/js/modules/commands/index.js"));
8417 +var _forceMethodImplementation = _interopRequireDefault(__webpack_require__(/*! ../utils/force-method-implementation */ "../modules/web-cli/assets/js/utils/force-method-implementation.js"));
8418 +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); }
8419 +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; }
8420 +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); }; }
8421 +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; } }
8422 +var ComponentModalBase = /*#__PURE__*/function (_ComponentBase) {
8423 + (0, _inherits2.default)(ComponentModalBase, _ComponentBase);
8424 + var _super = _createSuper(ComponentModalBase);
8425 + function ComponentModalBase() {
8426 + (0, _classCallCheck2.default)(this, ComponentModalBase);
8427 + return _super.apply(this, arguments);
8428 + }
8429 + (0, _createClass2.default)(ComponentModalBase, [{
8430 + key: "registerAPI",
8431 + value: function registerAPI() {
8432 + var _this = this;
8433 + (0, _get2.default)((0, _getPrototypeOf2.default)(ComponentModalBase.prototype), "registerAPI", this).call(this);
8434 + $e.shortcuts.register('esc', {
8435 + scopes: [this.getNamespace()],
8436 + callback: function callback() {
8437 + return _this.close();
8438 + }
8439 + });
8440 + }
8441 + }, {
8442 + key: "defaultCommands",
8443 + value: function defaultCommands() {
8444 + return this.importCommands(commands);
8445 + }
8446 + }, {
8447 + key: "defaultRoutes",
8448 + value: function defaultRoutes() {
8449 + return {
8450 + '': function _() {/* Nothing to do, it's already rendered. */}
8451 + };
8452 + }
8453 + }, {
8454 + key: "open",
8455 + value: function open() {
8456 + var _this2 = this;
8457 + if (!this.layout) {
8458 + var layout = this.getModalLayout();
8459 + this.layout = new layout({
8460 + component: this
8461 + });
8462 + this.layout.getModal().on('hide', function () {
8463 + return _this2.close();
8464 + });
8465 + }
8466 + this.layout.showModal();
8467 + return true;
8468 + }
8469 + }, {
8470 + key: "close",
8471 + value: function close() {
8472 + if (!(0, _get2.default)((0, _getPrototypeOf2.default)(ComponentModalBase.prototype), "close", this).call(this)) {
8473 + return false;
8474 + }
8475 + this.layout.getModal().hide();
8476 + return true;
8477 + }
8478 + }, {
8479 + key: "getModalLayout",
8480 + value: function getModalLayout() {
8481 + (0, _forceMethodImplementation.default)();
8482 + }
8483 + }]);
8484 + return ComponentModalBase;
8485 +}(_componentBase.default);
8486 +exports["default"] = ComponentModalBase;
8487 +
8488 +/***/ }),
8489 +
8490 +/***/ "../modules/web-cli/assets/js/modules/hook-base.js":
8491 +/*!*********************************************************!*\
8492 + !*** ../modules/web-cli/assets/js/modules/hook-base.js ***!
8493 + \*********************************************************/
8494 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
8495 +
8496 +"use strict";
8497 +
8498 +
8499 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
8500 +Object.defineProperty(exports, "__esModule", ({
8501 + value: true
8502 +}));
8503 +exports["default"] = void 0;
8504 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
8505 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
8506 +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
8507 +var _forceMethodImplementation = _interopRequireDefault(__webpack_require__(/*! ../utils/force-method-implementation */ "../modules/web-cli/assets/js/utils/force-method-implementation.js"));
8508 +var HookBase = /*#__PURE__*/function () {
8509 + /**
8510 + * Callback type, eg ( hook, event ).
8511 + *
8512 + * @type {string}
8513 + */
8514 +
8515 + /**
8516 + * Full command address, that will hook the callback.
8517 + *
8518 + * @type {string}
8519 + */
8520 +
8521 + /**
8522 + * Unique id of the callback.
8523 + *
8524 + * @type {string}
8525 + */
8526 +
8527 + /**
8528 + * Function constructor().
8529 + *
8530 + * Create callback base.
8531 + */
8532 + function HookBase() {
8533 + (0, _classCallCheck2.default)(this, HookBase);
8534 + (0, _defineProperty2.default)(this, "type", void 0);
8535 + (0, _defineProperty2.default)(this, "command", void 0);
8536 + (0, _defineProperty2.default)(this, "id", void 0);
8537 + this.initialize();
8538 + this.type = this.getType();
8539 + this.command = this.getCommand();
8540 + this.id = this.getId();
8541 + }
8542 +
8543 + /**
8544 + * Function initialize().
8545 + *
8546 + * Called after creation of the base, used for initialize extras.
8547 + * Without expending constructor.
8548 + */
8549 + (0, _createClass2.default)(HookBase, [{
8550 + key: "initialize",
8551 + value: function initialize() {}
8552 +
8553 + /**
8554 + * Function register().
8555 + *
8556 + * Used to register the callback.
8557 + *
8558 + * @throws {Error}
8559 + */
8560 + }, {
8561 + key: "register",
8562 + value: function register() {
8563 + (0, _forceMethodImplementation.default)();
8564 + }
8565 +
8566 + // eslint-disable-next-line jsdoc/require-returns-check
8567 + /**
8568 + * Function getType().
8569 + *
8570 + * Get type eg: ( hook, event, etc ... ).
8571 + *
8572 + * @return {string} type
8573 + *
8574 + * @throws {Error}
8575 + */
8576 + }, {
8577 + key: "getType",
8578 + value: function getType() {
8579 + (0, _forceMethodImplementation.default)();
8580 + }
8581 +
8582 + // eslint-disable-next-line jsdoc/require-returns-check
8583 + /**
8584 + * Function getCommand().
8585 + *
8586 + * Returns the full command path for callback binding.
8587 + *
8588 + * Supports array of strings ( commands ).
8589 + *
8590 + * @return {string} command
8591 + *
8592 + * @throws {Error}
8593 + */
8594 + }, {
8595 + key: "getCommand",
8596 + value: function getCommand() {
8597 + (0, _forceMethodImplementation.default)();
8598 + }
8599 +
8600 + // eslint-disable-next-line jsdoc/require-returns-check
8601 + /**
8602 + * Function getId().
8603 + *
8604 + * Returns command id for the hook (should be unique).
8605 + *
8606 + * @return {string} id
8607 + *
8608 + * @throws {Error}
8609 + */
8610 + }, {
8611 + key: "getId",
8612 + value: function getId() {
8613 + (0, _forceMethodImplementation.default)();
8614 + }
8615 +
8616 + // eslint-disable-next-line jsdoc/require-returns-check
8617 + /**
8618 + * Function getContainerType().
8619 + *
8620 + * Bind eContainer type to callback.
8621 + *
8622 + * Used to gain performance.
8623 + *
8624 + * @return {string} type
8625 + */
8626 + }, {
8627 + key: "getContainerType",
8628 + value: function getContainerType() {}
8629 +
8630 + /**
8631 + * Function getConditions().
8632 + *
8633 + * Condition for running the callback, if true, call to apply().
8634 + *
8635 + * @param {*} [args={}]
8636 + * @param {*} [result=*]
8637 + *
8638 + * @return {boolean} conditions
8639 + */
8640 + }, {
8641 + key: "getConditions",
8642 + value: function getConditions() {
8643 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
8644 + var result = arguments.length > 1 ? arguments[1] : undefined;
8645 + // eslint-disable-line no-unused-vars
8646 + return true;
8647 + }
8648 +
8649 + // eslint-disable-next-line jsdoc/require-returns-check
8650 + /**
8651 + * Function apply().
8652 + *
8653 + * Apply the callback, ( The actual affect of the callback ).
8654 + *
8655 + * @param {*} [args={}]
8656 + *
8657 + * @return {*} results
8658 + */
8659 + }, {
8660 + key: "apply",
8661 + value: function apply(args) {
8662 + // eslint-disable-line no-unused-vars
8663 + (0, _forceMethodImplementation.default)();
8664 + }
8665 +
8666 + /**
8667 + * Function run().
8668 + *
8669 + * Run the callback.
8670 + *
8671 + * @param {*} args
8672 + *
8673 + * @return {*} results
8674 + */
8675 + }, {
8676 + key: "run",
8677 + value: function run() {
8678 + var _ref = arguments.length <= 0 ? undefined : arguments[0],
8679 + _ref$options = _ref.options,
8680 + options = _ref$options === void 0 ? {} : _ref$options;
8681 +
8682 + // Disable callback if requested by args.options.
8683 + if (options.callbacks && false === options.callbacks[this.id]) {
8684 + return true;
8685 + }
8686 + if (this.getConditions.apply(this, arguments)) {
8687 + if ($e.devTools) {
8688 + $e.devTools.log.callbacks().active(this.type, this.command, this.id);
8689 + }
8690 + return this.apply.apply(this, arguments);
8691 + }
8692 + return true;
8693 + }
8694 + }]);
8695 + return HookBase;
8696 +}();
8697 +exports["default"] = HookBase;
8698 +
8699 +/***/ }),
8700 +
8701 +/***/ "../modules/web-cli/assets/js/modules/hook-break.js":
8702 +/*!**********************************************************!*\
8703 + !*** ../modules/web-cli/assets/js/modules/hook-break.js ***!
8704 + \**********************************************************/
8705 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
8706 +
8707 +"use strict";
8708 +
8709 +
8710 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
8711 +Object.defineProperty(exports, "__esModule", ({
8712 + value: true
8713 +}));
8714 +exports["default"] = void 0;
8715 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
8716 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
8717 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
8718 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
8719 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
8720 +var _wrapNativeSuper2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/wrapNativeSuper */ "../node_modules/@babel/runtime/helpers/wrapNativeSuper.js"));
8721 +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); }; }
8722 +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; } }
8723 +var HookBreak = /*#__PURE__*/function (_Error) {
8724 + (0, _inherits2.default)(HookBreak, _Error);
8725 + var _super = _createSuper(HookBreak);
8726 + function HookBreak() {
8727 + (0, _classCallCheck2.default)(this, HookBreak);
8728 + return _super.call(this, 'HookBreak');
8729 + }
8730 + return (0, _createClass2.default)(HookBreak);
8731 +}( /*#__PURE__*/(0, _wrapNativeSuper2.default)(Error));
8732 +exports["default"] = HookBreak;
8733 +
8734 +/***/ }),
8735 +
8736 +/***/ "../modules/web-cli/assets/js/modules/hooks/data/after.js":
8737 +/*!****************************************************************!*\
8738 + !*** ../modules/web-cli/assets/js/modules/hooks/data/after.js ***!
8739 + \****************************************************************/
8740 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
8741 +
8742 +"use strict";
8743 +
8744 +
8745 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
8746 +Object.defineProperty(exports, "__esModule", ({
8747 + value: true
8748 +}));
8749 +exports["default"] = exports.After = void 0;
8750 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
8751 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
8752 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
8753 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
8754 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
8755 +var _base = _interopRequireDefault(__webpack_require__(/*! ./base */ "../modules/web-cli/assets/js/modules/hooks/data/base.js"));
8756 +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); }; }
8757 +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; } }
8758 +var After = /*#__PURE__*/function (_Base) {
8759 + (0, _inherits2.default)(After, _Base);
8760 + var _super = _createSuper(After);
8761 + function After() {
8762 + (0, _classCallCheck2.default)(this, After);
8763 + return _super.apply(this, arguments);
8764 + }
8765 + (0, _createClass2.default)(After, [{
8766 + key: "register",
8767 + value: function register() {
8768 + $e.hooks.registerDataAfter(this);
8769 + }
8770 + }]);
8771 + return After;
8772 +}(_base.default);
8773 +exports.After = After;
8774 +var _default = After;
8775 +exports["default"] = _default;
8776 +
8777 +/***/ }),
8778 +
8779 +/***/ "../modules/web-cli/assets/js/modules/hooks/data/base.js":
8780 +/*!***************************************************************!*\
8781 + !*** ../modules/web-cli/assets/js/modules/hooks/data/base.js ***!
8782 + \***************************************************************/
8783 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
8784 +
8785 +"use strict";
8786 +
8787 +
8788 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
8789 +Object.defineProperty(exports, "__esModule", ({
8790 + value: true
8791 +}));
8792 +exports["default"] = exports.Base = void 0;
8793 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
8794 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
8795 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
8796 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
8797 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
8798 +var _hookBase = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/hook-base */ "../modules/web-cli/assets/js/modules/hook-base.js"));
8799 +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); }; }
8800 +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; } }
8801 +var Base = /*#__PURE__*/function (_HookBase) {
8802 + (0, _inherits2.default)(Base, _HookBase);
8803 + var _super = _createSuper(Base);
8804 + function Base() {
8805 + (0, _classCallCheck2.default)(this, Base);
8806 + return _super.apply(this, arguments);
8807 + }
8808 + (0, _createClass2.default)(Base, [{
8809 + key: "getType",
8810 + value: function getType() {
8811 + return 'data';
8812 + }
8813 + }]);
8814 + return Base;
8815 +}(_hookBase.default);
8816 +exports.Base = Base;
8817 +var _default = Base;
8818 +exports["default"] = _default;
8819 +
8820 +/***/ }),
8821 +
8822 +/***/ "../modules/web-cli/assets/js/modules/hooks/data/catch.js":
8823 +/*!****************************************************************!*\
8824 + !*** ../modules/web-cli/assets/js/modules/hooks/data/catch.js ***!
8825 + \****************************************************************/
8826 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
8827 +
8828 +"use strict";
8829 +
8830 +
8831 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
8832 +Object.defineProperty(exports, "__esModule", ({
8833 + value: true
8834 +}));
8835 +exports["default"] = exports.Catch = void 0;
8836 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
8837 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
8838 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
8839 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
8840 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
8841 +var _base = _interopRequireDefault(__webpack_require__(/*! ./base */ "../modules/web-cli/assets/js/modules/hooks/data/base.js"));
8842 +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); }; }
8843 +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; } }
8844 +var Catch = /*#__PURE__*/function (_Base) {
8845 + (0, _inherits2.default)(Catch, _Base);
8846 + var _super = _createSuper(Catch);
8847 + function Catch() {
8848 + (0, _classCallCheck2.default)(this, Catch);
8849 + return _super.apply(this, arguments);
8850 + }
8851 + (0, _createClass2.default)(Catch, [{
8852 + key: "register",
8853 + value: function register() {
8854 + $e.hooks.registerDataCatch(this);
8855 + }
8856 + }]);
8857 + return Catch;
8858 +}(_base.default);
8859 +exports.Catch = Catch;
8860 +var _default = Catch;
8861 +exports["default"] = _default;
8862 +
8863 +/***/ }),
8864 +
8865 +/***/ "../modules/web-cli/assets/js/modules/hooks/data/dependency.js":
8866 +/*!*********************************************************************!*\
8867 + !*** ../modules/web-cli/assets/js/modules/hooks/data/dependency.js ***!
8868 + \*********************************************************************/
8869 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
8870 +
8871 +"use strict";
8872 +
8873 +
8874 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
8875 +Object.defineProperty(exports, "__esModule", ({
8876 + value: true
8877 +}));
8878 +exports["default"] = exports.Dependency = void 0;
8879 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
8880 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
8881 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
8882 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
8883 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
8884 +var _base = _interopRequireDefault(__webpack_require__(/*! ./base */ "../modules/web-cli/assets/js/modules/hooks/data/base.js"));
8885 +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); }; }
8886 +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; } }
8887 +var Dependency = /*#__PURE__*/function (_Base) {
8888 + (0, _inherits2.default)(Dependency, _Base);
8889 + var _super = _createSuper(Dependency);
8890 + function Dependency() {
8891 + (0, _classCallCheck2.default)(this, Dependency);
8892 + return _super.apply(this, arguments);
8893 + }
8894 + (0, _createClass2.default)(Dependency, [{
8895 + key: "register",
8896 + value: function register() {
8897 + $e.hooks.registerDataDependency(this);
8898 + }
8899 + }]);
8900 + return Dependency;
8901 +}(_base.default);
8902 +exports.Dependency = Dependency;
8903 +var _default = Dependency;
8904 +exports["default"] = _default;
8905 +
8906 +/***/ }),
8907 +
8908 +/***/ "../modules/web-cli/assets/js/modules/hooks/data/index.js":
8909 +/*!****************************************************************!*\
8910 + !*** ../modules/web-cli/assets/js/modules/hooks/data/index.js ***!
8911 + \****************************************************************/
8912 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
8913 +
8914 +"use strict";
8915 +
8916 +
8917 +Object.defineProperty(exports, "__esModule", ({
8918 + value: true
8919 +}));
8920 +Object.defineProperty(exports, "After", ({
8921 + enumerable: true,
8922 + get: function get() {
8923 + return _after.After;
8924 + }
8925 +}));
8926 +Object.defineProperty(exports, "Base", ({
8927 + enumerable: true,
8928 + get: function get() {
8929 + return _base.Base;
8930 + }
8931 +}));
8932 +Object.defineProperty(exports, "Catch", ({
8933 + enumerable: true,
8934 + get: function get() {
8935 + return _catch.Catch;
8936 + }
8937 +}));
8938 +Object.defineProperty(exports, "Dependency", ({
8939 + enumerable: true,
8940 + get: function get() {
8941 + return _dependency.Dependency;
8942 + }
8943 +}));
8944 +var _after = __webpack_require__(/*! ./after */ "../modules/web-cli/assets/js/modules/hooks/data/after.js");
8945 +var _base = __webpack_require__(/*! ./base */ "../modules/web-cli/assets/js/modules/hooks/data/base.js");
8946 +var _catch = __webpack_require__(/*! ./catch */ "../modules/web-cli/assets/js/modules/hooks/data/catch.js");
8947 +var _dependency = __webpack_require__(/*! ./dependency */ "../modules/web-cli/assets/js/modules/hooks/data/dependency.js");
8948 +
8949 +/***/ }),
8950 +
8951 +/***/ "../modules/web-cli/assets/js/modules/hooks/ui/after.js":
8952 +/*!**************************************************************!*\
8953 + !*** ../modules/web-cli/assets/js/modules/hooks/ui/after.js ***!
8954 + \**************************************************************/
8955 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
8956 +
8957 +"use strict";
8958 +
8959 +
8960 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
8961 +Object.defineProperty(exports, "__esModule", ({
8962 + value: true
8963 +}));
8964 +exports["default"] = exports.After = void 0;
8965 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
8966 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
8967 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
8968 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
8969 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
8970 +var _base = _interopRequireDefault(__webpack_require__(/*! ./base */ "../modules/web-cli/assets/js/modules/hooks/ui/base.js"));
8971 +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); }; }
8972 +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; } }
8973 +var After = /*#__PURE__*/function (_Base) {
8974 + (0, _inherits2.default)(After, _Base);
8975 + var _super = _createSuper(After);
8976 + function After() {
8977 + (0, _classCallCheck2.default)(this, After);
8978 + return _super.apply(this, arguments);
8979 + }
8980 + (0, _createClass2.default)(After, [{
8981 + key: "register",
8982 + value: function register() {
8983 + $e.hooks.registerUIAfter(this);
8984 + }
8985 + }]);
8986 + return After;
8987 +}(_base.default);
8988 +exports.After = After;
8989 +var _default = After;
8990 +exports["default"] = _default;
8991 +
8992 +/***/ }),
8993 +
8994 +/***/ "../modules/web-cli/assets/js/modules/hooks/ui/base.js":
8995 +/*!*************************************************************!*\
8996 + !*** ../modules/web-cli/assets/js/modules/hooks/ui/base.js ***!
8997 + \*************************************************************/
8998 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
8999 +
9000 +"use strict";
9001 +
9002 +
9003 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
9004 +Object.defineProperty(exports, "__esModule", ({
9005 + value: true
9006 +}));
9007 +exports["default"] = exports.Base = void 0;
9008 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
9009 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
9010 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
9011 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
9012 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
9013 +var _hookBase = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/hook-base */ "../modules/web-cli/assets/js/modules/hook-base.js"));
9014 +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); }; }
9015 +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; } }
9016 +var Base = /*#__PURE__*/function (_HookBase) {
9017 + (0, _inherits2.default)(Base, _HookBase);
9018 + var _super = _createSuper(Base);
9019 + function Base() {
9020 + (0, _classCallCheck2.default)(this, Base);
9021 + return _super.apply(this, arguments);
9022 + }
9023 + (0, _createClass2.default)(Base, [{
9024 + key: "getType",
9025 + value: function getType() {
9026 + return 'ui';
9027 + }
9028 + }]);
9029 + return Base;
9030 +}(_hookBase.default);
9031 +exports.Base = Base;
9032 +var _default = Base;
9033 +exports["default"] = _default;
9034 +
9035 +/***/ }),
9036 +
9037 +/***/ "../modules/web-cli/assets/js/modules/hooks/ui/before.js":
9038 +/*!***************************************************************!*\
9039 + !*** ../modules/web-cli/assets/js/modules/hooks/ui/before.js ***!
9040 + \***************************************************************/
9041 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
9042 +
9043 +"use strict";
9044 +
9045 +
9046 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
9047 +Object.defineProperty(exports, "__esModule", ({
9048 + value: true
9049 +}));
9050 +exports["default"] = exports.Before = void 0;
9051 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
9052 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
9053 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
9054 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
9055 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
9056 +var _base = _interopRequireDefault(__webpack_require__(/*! ./base */ "../modules/web-cli/assets/js/modules/hooks/ui/base.js"));
9057 +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); }; }
9058 +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; } }
9059 +var Before = /*#__PURE__*/function (_Base) {
9060 + (0, _inherits2.default)(Before, _Base);
9061 + var _super = _createSuper(Before);
9062 + function Before() {
9063 + (0, _classCallCheck2.default)(this, Before);
9064 + return _super.apply(this, arguments);
9065 + }
9066 + (0, _createClass2.default)(Before, [{
9067 + key: "register",
9068 + value: function register() {
9069 + $e.hooks.registerUIBefore(this);
9070 + }
9071 + }]);
9072 + return Before;
9073 +}(_base.default);
9074 +exports.Before = Before;
9075 +var _default = Before;
9076 +exports["default"] = _default;
9077 +
9078 +/***/ }),
9079 +
9080 +/***/ "../modules/web-cli/assets/js/modules/hooks/ui/catch.js":
9081 +/*!**************************************************************!*\
9082 + !*** ../modules/web-cli/assets/js/modules/hooks/ui/catch.js ***!
9083 + \**************************************************************/
9084 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
9085 +
9086 +"use strict";
9087 +
9088 +
9089 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
9090 +Object.defineProperty(exports, "__esModule", ({
9091 + value: true
9092 +}));
9093 +exports["default"] = exports.Catch = void 0;
9094 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
9095 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
9096 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
9097 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
9098 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
9099 +var _base = _interopRequireDefault(__webpack_require__(/*! ./base */ "../modules/web-cli/assets/js/modules/hooks/ui/base.js"));
9100 +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); }; }
9101 +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; } }
9102 +var Catch = /*#__PURE__*/function (_Base) {
9103 + (0, _inherits2.default)(Catch, _Base);
9104 + var _super = _createSuper(Catch);
9105 + function Catch() {
9106 + (0, _classCallCheck2.default)(this, Catch);
9107 + return _super.apply(this, arguments);
9108 + }
9109 + (0, _createClass2.default)(Catch, [{
9110 + key: "register",
9111 + value: function register() {
9112 + $e.hooks.registerUICatch(this);
9113 + }
9114 + }]);
9115 + return Catch;
9116 +}(_base.default);
9117 +exports.Catch = Catch;
9118 +var _default = Catch;
9119 +exports["default"] = _default;
9120 +
9121 +/***/ }),
9122 +
9123 +/***/ "../modules/web-cli/assets/js/modules/hooks/ui/index.js":
9124 +/*!**************************************************************!*\
9125 + !*** ../modules/web-cli/assets/js/modules/hooks/ui/index.js ***!
9126 + \**************************************************************/
9127 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
9128 +
9129 +"use strict";
9130 +
9131 +
9132 +Object.defineProperty(exports, "__esModule", ({
9133 + value: true
9134 +}));
9135 +Object.defineProperty(exports, "After", ({
9136 + enumerable: true,
9137 + get: function get() {
9138 + return _after.After;
9139 + }
9140 +}));
9141 +Object.defineProperty(exports, "Base", ({
9142 + enumerable: true,
9143 + get: function get() {
9144 + return _base.Base;
9145 + }
9146 +}));
9147 +Object.defineProperty(exports, "Before", ({
9148 + enumerable: true,
9149 + get: function get() {
9150 + return _before.Before;
9151 + }
9152 +}));
9153 +Object.defineProperty(exports, "Catch", ({
9154 + enumerable: true,
9155 + get: function get() {
9156 + return _catch.Catch;
9157 + }
9158 +}));
9159 +var _after = __webpack_require__(/*! ./after */ "../modules/web-cli/assets/js/modules/hooks/ui/after.js");
9160 +var _base = __webpack_require__(/*! ./base */ "../modules/web-cli/assets/js/modules/hooks/ui/base.js");
9161 +var _before = __webpack_require__(/*! ./before */ "../modules/web-cli/assets/js/modules/hooks/ui/before.js");
9162 +var _catch = __webpack_require__(/*! ./catch */ "../modules/web-cli/assets/js/modules/hooks/ui/catch.js");
9163 +
9164 +/***/ }),
9165 +
9166 +/***/ "../modules/web-cli/assets/js/utils/console.js":
9167 +/*!*****************************************************!*\
9168 + !*** ../modules/web-cli/assets/js/utils/console.js ***!
9169 + \*****************************************************/
9170 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
9171 +
9172 +"use strict";
9173 +
9174 +
9175 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
9176 +Object.defineProperty(exports, "__esModule", ({
9177 + value: true
9178 +}));
9179 +exports["default"] = void 0;
9180 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
9181 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
9182 +var Console = /*#__PURE__*/function () {
9183 + function Console() {
9184 + (0, _classCallCheck2.default)(this, Console);
9185 + }
9186 + (0, _createClass2.default)(Console, null, [{
9187 + key: "error",
9188 + value: function error(message) {
9189 + // Show an error if devTools is available.
9190 + if ($e.devTools) {
9191 + $e.devTools.log.error(message);
9192 + }
9193 +
9194 + // If not a 'Hook-Break' then show error.
9195 + if (!(message instanceof $e.modules.HookBreak)) {
9196 + // eslint-disable-next-line no-console
9197 + console.error(message);
9198 + }
9199 + }
9200 + }, {
9201 + key: "warn",
9202 + value: function warn() {
9203 + var _console;
9204 + var style = "font-size: 12px; background-image: url(\"".concat(elementorWebCliConfig.urls.assets, "images/logo-icon.png\"); background-repeat: no-repeat; background-size: contain;");
9205 + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
9206 + args[_key] = arguments[_key];
9207 + }
9208 + args.unshift('%c %c', style, '');
9209 + (_console = console).warn.apply(_console, args); // eslint-disable-line no-console
9210 + }
9211 + }]);
9212 + return Console;
9213 +}();
9214 +exports["default"] = Console;
9215 +
9216 +/***/ }),
9217 +
9218 +/***/ "../modules/web-cli/assets/js/utils/deprecation.js":
9219 +/*!*********************************************************!*\
9220 + !*** ../modules/web-cli/assets/js/utils/deprecation.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 +Object.defineProperty(exports, "__esModule", ({
9229 + value: true
9230 +}));
9231 +exports["default"] = void 0;
9232 +var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js"));
9233 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
9234 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
9235 +var _console = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/console */ "../modules/web-cli/assets/js/utils/console.js"));
9236 +// Copied from `modules/dev-tools/assets/js/deprecation.js`
9237 +/**
9238 + * @typedef {Object} Version
9239 + * @property {number} major1 The first number
9240 + * @property {number} major2 The second number
9241 + * @property {number} minor The third number
9242 + * @property {string} build The fourth number
9243 + */
9244 +
9245 +var softDeprecated = function softDeprecated(name, version, replacement) {
9246 + if (elementorWebCliConfig.isDebug) {
9247 + deprecatedMessage('soft', name, version, replacement);
9248 + }
9249 +};
9250 +var hardDeprecated = function hardDeprecated(name, version, replacement) {
9251 + deprecatedMessage('hard', name, version, replacement);
9252 +};
9253 +var deprecatedMessage = function deprecatedMessage(type, name, version, replacement) {
9254 + var message = "`".concat(name, "` is ").concat(type, " deprecated since ").concat(version);
9255 + if (replacement) {
9256 + message += " - Use `".concat(replacement, "` instead");
9257 + }
9258 + _console.default.warn(message);
9259 +};
9260 +var Deprecation = /*#__PURE__*/function () {
9261 + function Deprecation() {
9262 + (0, _classCallCheck2.default)(this, Deprecation);
9263 + }
9264 + (0, _createClass2.default)(Deprecation, null, [{
9265 + key: "deprecated",
9266 + value: function deprecated(name, version, replacement) {
9267 + if (this.isHardDeprecated(version)) {
9268 + hardDeprecated(name, version, replacement);
9269 + } else {
9270 + softDeprecated(name, version, replacement);
9271 + }
9272 + }
9273 +
9274 + /**
9275 + * @param {string} version
9276 + *
9277 + * @return {Version}
9278 + */
9279 + }, {
9280 + key: "parseVersion",
9281 + value: function parseVersion(version) {
9282 + var versionParts = version.split('.');
9283 + if (versionParts.length < 3 || versionParts.length > 4) {
9284 + throw new RangeError('Invalid Semantic Version string provided');
9285 + }
9286 + var _versionParts = (0, _slicedToArray2.default)(versionParts, 4),
9287 + major1 = _versionParts[0],
9288 + major2 = _versionParts[1],
9289 + minor = _versionParts[2],
9290 + _versionParts$ = _versionParts[3],
9291 + build = _versionParts$ === void 0 ? '' : _versionParts$;
9292 + return {
9293 + major1: parseInt(major1),
9294 + major2: parseInt(major2),
9295 + minor: parseInt(minor),
9296 + build: build
9297 + };
9298 + }
9299 +
9300 + /**
9301 + * Get total of major.
9302 + *
9303 + * Since `get_total_major` cannot determine how much really versions between 2.9.0 and 3.3.0 if there is 2.10.0 version for example,
9304 + * versions with major2 more then 9 will be added to total.
9305 + *
9306 + * @param {Version} versionObj
9307 + *
9308 + * @return {number}
9309 + */
9310 + }, {
9311 + key: "getTotalMajor",
9312 + value: function getTotalMajor(versionObj) {
9313 + var total = parseInt("".concat(versionObj.major1).concat(versionObj.major2, "0"));
9314 + total = Number((total / 10).toFixed(0));
9315 + if (versionObj.major2 > 9) {
9316 + total = versionObj.major2 - 9;
9317 + }
9318 + return total;
9319 + }
9320 +
9321 + /**
9322 + * @param {string} version1
9323 + * @param {string} version2
9324 + *
9325 + * @return {number}
9326 + */
9327 + }, {
9328 + key: "compareVersion",
9329 + value: function compareVersion(version1, version2) {
9330 + var _this = this;
9331 + return [this.parseVersion(version1), this.parseVersion(version2)].map(function (versionObj) {
9332 + return _this.getTotalMajor(versionObj);
9333 + }).reduce(function (acc, major) {
9334 + return acc - major;
9335 + });
9336 + }
9337 +
9338 + /**
9339 + * @param {string} version
9340 + *
9341 + * @return {boolean}
9342 + */
9343 + }, {
9344 + key: "isSoftDeprecated",
9345 + value: function isSoftDeprecated(version) {
9346 + var total = this.compareVersion(version, elementorWebCliConfig.version);
9347 + return total <= 4;
9348 + }
9349 +
9350 + /**
9351 + * @param {string} version
9352 + * @return {boolean}
9353 + */
9354 + }, {
9355 + key: "isHardDeprecated",
9356 + value: function isHardDeprecated(version) {
9357 + var total = this.compareVersion(version, elementorWebCliConfig.version);
9358 + return total < 0 || total >= 8;
9359 + }
9360 + }]);
9361 + return Deprecation;
9362 +}();
9363 +exports["default"] = Deprecation;
9364 +
9365 +/***/ }),
9366 +
9367 +/***/ "../modules/web-cli/assets/js/utils/environment.js":
9368 +/*!*********************************************************!*\
9369 + !*** ../modules/web-cli/assets/js/utils/environment.js ***!
9370 + \*********************************************************/
9371 +/***/ ((__unused_webpack_module, exports) => {
9372 +
9373 +"use strict";
9374 +
9375 +
9376 +Object.defineProperty(exports, "__esModule", ({
9377 + value: true
9378 +}));
9379 +exports["default"] = void 0;
9380 +// TODO: Copied from `core/common/assets/js/utils/environment.js`.
9381 +var matchUserAgent = function matchUserAgent(UserAgentStr) {
9382 + return userAgent.indexOf(UserAgentStr) >= 0;
9383 + },
9384 + userAgent = navigator.userAgent,
9385 + // Solution influenced by https://stackoverflow.com/questions/9847580/how-to-detect-safari-chrome-ie-firefox-and-opera-browser
9386 +
9387 + // Opera 8.0+
9388 + isOpera = !!window.opr && !!opr.addons || !!window.opera || matchUserAgent(' OPR/'),
9389 + // Firefox 1.0+
9390 + isFirefox = matchUserAgent('Firefox'),
9391 + // Safari 3.0+ "[object HTMLElementConstructor]"
9392 + isSafari = /^((?!chrome|android).)*safari/i.test(userAgent) || /constructor/i.test(window.HTMLElement) || function (p) {
9393 + return '[object SafariRemoteNotification]' === p.toString();
9394 + }(!window.safari || typeof safari !== 'undefined' && safari.pushNotification),
9395 + // Internet Explorer 6-11
9396 + isIE = /Trident|MSIE/.test(userAgent) && ( /* @cc_on!@*/ false || !!document.documentMode),
9397 + // Edge 20+
9398 + isEdge = !isIE && !!window.StyleMedia || matchUserAgent('Edg'),
9399 + // Google Chrome (Not accurate)
9400 + isChrome = !!window.chrome && matchUserAgent('Chrome') && !(isEdge || isOpera),
9401 + // Blink engine
9402 + isBlink = matchUserAgent('Chrome') && !!window.CSS,
9403 + // Apple Webkit engine
9404 + isAppleWebkit = matchUserAgent('AppleWebKit') && !isBlink,
9405 + environment = {
9406 + appleWebkit: isAppleWebkit,
9407 + blink: isBlink,
9408 + chrome: isChrome,
9409 + edge: isEdge,
9410 + firefox: isFirefox,
9411 + ie: isIE,
9412 + mac: matchUserAgent('Macintosh'),
9413 + opera: isOpera,
9414 + safari: isSafari,
9415 + webkit: matchUserAgent('AppleWebKit')
9416 + };
9417 +var _default = environment;
9418 +exports["default"] = _default;
9419 +
9420 +/***/ }),
9421 +
9422 +/***/ "../modules/web-cli/assets/js/utils/force-method-implementation.js":
9423 +/*!*************************************************************************!*\
9424 + !*** ../modules/web-cli/assets/js/utils/force-method-implementation.js ***!
9425 + \*************************************************************************/
9426 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
9427 +
9428 +"use strict";
9429 +
9430 +
9431 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
9432 +Object.defineProperty(exports, "__esModule", ({
9433 + value: true
9434 +}));
9435 +exports["default"] = exports.ForceMethodImplementation = void 0;
9436 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
9437 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
9438 +var _assertThisInitialized2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ "../node_modules/@babel/runtime/helpers/assertThisInitialized.js"));
9439 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
9440 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
9441 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
9442 +var _wrapNativeSuper2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/wrapNativeSuper */ "../node_modules/@babel/runtime/helpers/wrapNativeSuper.js"));
9443 +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); }; }
9444 +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; } }
9445 +// TODO: Copied from `assets/dev/js/modules/imports/force-method-implementation.js`;
9446 +var ForceMethodImplementation = /*#__PURE__*/function (_Error) {
9447 + (0, _inherits2.default)(ForceMethodImplementation, _Error);
9448 + var _super = _createSuper(ForceMethodImplementation);
9449 + function ForceMethodImplementation() {
9450 + var _this;
9451 + var info = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
9452 + (0, _classCallCheck2.default)(this, ForceMethodImplementation);
9453 + _this = _super.call(this, "".concat(info.isStatic ? 'static ' : '').concat(info.fullName, "() should be implemented, please provide '").concat(info.functionName || info.fullName, "' functionality."));
9454 + Error.captureStackTrace((0, _assertThisInitialized2.default)(_this), ForceMethodImplementation);
9455 + return _this;
9456 + }
9457 + return (0, _createClass2.default)(ForceMethodImplementation);
9458 +}( /*#__PURE__*/(0, _wrapNativeSuper2.default)(Error));
9459 +exports.ForceMethodImplementation = ForceMethodImplementation;
9460 +var _default = function _default() {
9461 + var stack = Error().stack,
9462 + caller = stack.split('\n')[2].trim(),
9463 + callerName = caller.startsWith('at new') ? 'constructor' : caller.split(' ')[1],
9464 + info = {};
9465 + info.functionName = callerName;
9466 + info.fullName = callerName;
9467 + if (info.functionName.includes('.')) {
9468 + var parts = info.functionName.split('.');
9469 + info.className = parts[0];
9470 + info.functionName = parts[1];
9471 + } else {
9472 + info.isStatic = true;
9473 + }
9474 + throw new ForceMethodImplementation(info);
9475 +};
9476 +exports["default"] = _default;
9477 +
9478 +/***/ }),
9479 +
9480 +/***/ "../node_modules/redux-thunk/es/index.js":
9481 +/*!***********************************************!*\
9482 + !*** ../node_modules/redux-thunk/es/index.js ***!
9483 + \***********************************************/
9484 +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
9485 +
9486 +"use strict";
9487 +__webpack_require__.r(__webpack_exports__);
9488 +/* harmony export */ __webpack_require__.d(__webpack_exports__, {
9489 +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
9490 +/* harmony export */ });
9491 +/** A function that accepts a potential "extra argument" value to be injected later,
9492 + * and returns an instance of the thunk middleware that uses that value
9493 + */
9494 +function createThunkMiddleware(extraArgument) {
9495 + // Standard Redux middleware definition pattern:
9496 + // See: https://redux.js.org/tutorials/fundamentals/part-4-store#writing-custom-middleware
9497 + var middleware = function middleware(_ref) {
9498 + var dispatch = _ref.dispatch,
9499 + getState = _ref.getState;
9500 + return function (next) {
9501 + return function (action) {
9502 + // The thunk middleware looks for any functions that were passed to `store.dispatch`.
9503 + // If this "action" is really a function, call it and return the result.
9504 + if (typeof action === 'function') {
9505 + // Inject the store's `dispatch` and `getState` methods, as well as any "extra arg"
9506 + return action(dispatch, getState, extraArgument);
9507 + } // Otherwise, pass the action down the middleware chain as usual
9508 +
9509 +
9510 + return next(action);
9511 + };
9512 + };
9513 + };
9514 +
9515 + return middleware;
9516 +}
9517 +
9518 +var thunk = createThunkMiddleware(); // Attach the factory function so users can create a customized version
9519 +// with whatever "extra arg" they want to inject into their thunks
9520 +
9521 +thunk.withExtraArgument = createThunkMiddleware;
9522 +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (thunk);
9523 +
9524 +/***/ }),
9525 +
9526 +/***/ "../node_modules/redux/es/redux.js":
9527 +/*!*****************************************!*\
9528 + !*** ../node_modules/redux/es/redux.js ***!
9529 + \*****************************************/
9530 +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
9531 +
9532 +"use strict";
9533 +__webpack_require__.r(__webpack_exports__);
9534 +/* harmony export */ __webpack_require__.d(__webpack_exports__, {
9535 +/* harmony export */ "__DO_NOT_USE__ActionTypes": () => (/* binding */ ActionTypes),
9536 +/* harmony export */ "applyMiddleware": () => (/* binding */ applyMiddleware),
9537 +/* harmony export */ "bindActionCreators": () => (/* binding */ bindActionCreators),
9538 +/* harmony export */ "combineReducers": () => (/* binding */ combineReducers),
9539 +/* harmony export */ "compose": () => (/* binding */ compose),
9540 +/* harmony export */ "createStore": () => (/* binding */ createStore),
9541 +/* harmony export */ "legacy_createStore": () => (/* binding */ legacy_createStore)
9542 +/* harmony export */ });
9543 +/* 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");
9544 +
9545 +
9546 +/**
9547 + * Adapted from React: https://github.com/facebook/react/blob/master/packages/shared/formatProdErrorMessage.js
9548 + *
9549 + * Do not require this module directly! Use normal throw error calls. These messages will be replaced with error codes
9550 + * during build.
9551 + * @param {number} code
9552 + */
9553 +function formatProdErrorMessage(code) {
9554 + 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. ';
9555 +}
9556 +
9557 +// Inlined version of the `symbol-observable` polyfill
9558 +var $$observable = (function () {
9559 + return typeof Symbol === 'function' && Symbol.observable || '@@observable';
9560 +})();
9561 +
9562 +/**
9563 + * These are private action types reserved by Redux.
9564 + * For any unknown actions, you must return the current state.
9565 + * If the current state is undefined, you must return the initial state.
9566 + * Do not reference these action types directly in your code.
9567 + */
9568 +var randomString = function randomString() {
9569 + return Math.random().toString(36).substring(7).split('').join('.');
9570 +};
9571 +
9572 +var ActionTypes = {
9573 + INIT: "@@redux/INIT" + randomString(),
9574 + REPLACE: "@@redux/REPLACE" + randomString(),
9575 + PROBE_UNKNOWN_ACTION: function PROBE_UNKNOWN_ACTION() {
9576 + return "@@redux/PROBE_UNKNOWN_ACTION" + randomString();
9577 + }
9578 +};
9579 +
9580 +/**
9581 + * @param {any} obj The object to inspect.
9582 + * @returns {boolean} True if the argument appears to be a plain object.
9583 + */
9584 +function isPlainObject(obj) {
9585 + if (typeof obj !== 'object' || obj === null) return false;
9586 + var proto = obj;
9587 +
9588 + while (Object.getPrototypeOf(proto) !== null) {
9589 + proto = Object.getPrototypeOf(proto);
9590 + }
9591 +
9592 + return Object.getPrototypeOf(obj) === proto;
9593 +}
9594 +
9595 +// Inlined / shortened version of `kindOf` from https://github.com/jonschlinkert/kind-of
9596 +function miniKindOf(val) {
9597 + if (val === void 0) return 'undefined';
9598 + if (val === null) return 'null';
9599 + var type = typeof val;
9600 +
9601 + switch (type) {
9602 + case 'boolean':
9603 + case 'string':
9604 + case 'number':
9605 + case 'symbol':
9606 + case 'function':
9607 + {
9608 + return type;
9609 + }
9610 + }
9611 +
9612 + if (Array.isArray(val)) return 'array';
9613 + if (isDate(val)) return 'date';
9614 + if (isError(val)) return 'error';
9615 + var constructorName = ctorName(val);
9616 +
9617 + switch (constructorName) {
9618 + case 'Symbol':
9619 + case 'Promise':
9620 + case 'WeakMap':
9621 + case 'WeakSet':
9622 + case 'Map':
9623 + case 'Set':
9624 + return constructorName;
9625 + } // other
9626 +
9627 +
9628 + return type.slice(8, -1).toLowerCase().replace(/\s/g, '');
9629 +}
9630 +
9631 +function ctorName(val) {
9632 + return typeof val.constructor === 'function' ? val.constructor.name : null;
9633 +}
9634 +
9635 +function isError(val) {
9636 + return val instanceof Error || typeof val.message === 'string' && val.constructor && typeof val.constructor.stackTraceLimit === 'number';
9637 +}
9638 +
9639 +function isDate(val) {
9640 + if (val instanceof Date) return true;
9641 + return typeof val.toDateString === 'function' && typeof val.getDate === 'function' && typeof val.setDate === 'function';
9642 +}
9643 +
9644 +function kindOf(val) {
9645 + var typeOfVal = typeof val;
9646 +
9647 + if (true) {
9648 + typeOfVal = miniKindOf(val);
9649 + }
9650 +
9651 + return typeOfVal;
9652 +}
9653 +
9654 +/**
9655 + * @deprecated
9656 + *
9657 + * **We recommend using the `configureStore` method
9658 + * of the `@reduxjs/toolkit` package**, which replaces `createStore`.
9659 + *
9660 + * Redux Toolkit is our recommended approach for writing Redux logic today,
9661 + * including store setup, reducers, data fetching, and more.
9662 + *
9663 + * **For more details, please read this Redux docs page:**
9664 + * **https://redux.js.org/introduction/why-rtk-is-redux-today**
9665 + *
9666 + * `configureStore` from Redux Toolkit is an improved version of `createStore` that
9667 + * simplifies setup and helps avoid common bugs.
9668 + *
9669 + * You should not be using the `redux` core package by itself today, except for learning purposes.
9670 + * The `createStore` method from the core `redux` package will not be removed, but we encourage
9671 + * all users to migrate to using Redux Toolkit for all Redux code.
9672 + *
9673 + * If you want to use `createStore` without this visual deprecation warning, use
9674 + * the `legacy_createStore` import instead:
9675 + *
9676 + * `import { legacy_createStore as createStore} from 'redux'`
9677 + *
9678 + */
9679 +
9680 +function createStore(reducer, preloadedState, enhancer) {
9681 + var _ref2;
9682 +
9683 + if (typeof preloadedState === 'function' && typeof enhancer === 'function' || typeof enhancer === 'function' && typeof arguments[3] === 'function') {
9684 + 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.');
9685 + }
9686 +
9687 + if (typeof preloadedState === 'function' && typeof enhancer === 'undefined') {
9688 + enhancer = preloadedState;
9689 + preloadedState = undefined;
9690 + }
9691 +
9692 + if (typeof enhancer !== 'undefined') {
9693 + if (typeof enhancer !== 'function') {
9694 + throw new Error( false ? 0 : "Expected the enhancer to be a function. Instead, received: '" + kindOf(enhancer) + "'");
9695 + }
9696 +
9697 + return enhancer(createStore)(reducer, preloadedState);
9698 + }
9699 +
9700 + if (typeof reducer !== 'function') {
9701 + throw new Error( false ? 0 : "Expected the root reducer to be a function. Instead, received: '" + kindOf(reducer) + "'");
9702 + }
9703 +
9704 + var currentReducer = reducer;
9705 + var currentState = preloadedState;
9706 + var currentListeners = [];
9707 + var nextListeners = currentListeners;
9708 + var isDispatching = false;
9709 + /**
9710 + * This makes a shallow copy of currentListeners so we can use
9711 + * nextListeners as a temporary list while dispatching.
9712 + *
9713 + * This prevents any bugs around consumers calling
9714 + * subscribe/unsubscribe in the middle of a dispatch.
9715 + */
9716 +
9717 + function ensureCanMutateNextListeners() {
9718 + if (nextListeners === currentListeners) {
9719 + nextListeners = currentListeners.slice();
9720 + }
9721 + }
9722 + /**
9723 + * Reads the state tree managed by the store.
9724 + *
9725 + * @returns {any} The current state tree of your application.
9726 + */
9727 +
9728 +
9729 + function getState() {
9730 + if (isDispatching) {
9731 + 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.');
9732 + }
9733 +
9734 + return currentState;
9735 + }
9736 + /**
9737 + * Adds a change listener. It will be called any time an action is dispatched,
9738 + * and some part of the state tree may potentially have changed. You may then
9739 + * call `getState()` to read the current state tree inside the callback.
9740 + *
9741 + * You may call `dispatch()` from a change listener, with the following
9742 + * caveats:
9743 + *
9744 + * 1. The subscriptions are snapshotted just before every `dispatch()` call.
9745 + * If you subscribe or unsubscribe while the listeners are being invoked, this
9746 + * will not have any effect on the `dispatch()` that is currently in progress.
9747 + * However, the next `dispatch()` call, whether nested or not, will use a more
9748 + * recent snapshot of the subscription list.
9749 + *
9750 + * 2. The listener should not expect to see all state changes, as the state
9751 + * might have been updated multiple times during a nested `dispatch()` before
9752 + * the listener is called. It is, however, guaranteed that all subscribers
9753 + * registered before the `dispatch()` started will be called with the latest
9754 + * state by the time it exits.
9755 + *
9756 + * @param {Function} listener A callback to be invoked on every dispatch.
9757 + * @returns {Function} A function to remove this change listener.
9758 + */
9759 +
9760 +
9761 + function subscribe(listener) {
9762 + if (typeof listener !== 'function') {
9763 + throw new Error( false ? 0 : "Expected the listener to be a function. Instead, received: '" + kindOf(listener) + "'");
9764 + }
9765 +
9766 + if (isDispatching) {
9767 + 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.');
9768 + }
9769 +
9770 + var isSubscribed = true;
9771 + ensureCanMutateNextListeners();
9772 + nextListeners.push(listener);
9773 + return function unsubscribe() {
9774 + if (!isSubscribed) {
9775 + return;
9776 + }
9777 +
9778 + if (isDispatching) {
9779 + 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.');
9780 + }
9781 +
9782 + isSubscribed = false;
9783 + ensureCanMutateNextListeners();
9784 + var index = nextListeners.indexOf(listener);
9785 + nextListeners.splice(index, 1);
9786 + currentListeners = null;
9787 + };
9788 + }
9789 + /**
9790 + * Dispatches an action. It is the only way to trigger a state change.
9791 + *
9792 + * The `reducer` function, used to create the store, will be called with the
9793 + * current state tree and the given `action`. Its return value will
9794 + * be considered the **next** state of the tree, and the change listeners
9795 + * will be notified.
9796 + *
9797 + * The base implementation only supports plain object actions. If you want to
9798 + * dispatch a Promise, an Observable, a thunk, or something else, you need to
9799 + * wrap your store creating function into the corresponding middleware. For
9800 + * example, see the documentation for the `redux-thunk` package. Even the
9801 + * middleware will eventually dispatch plain object actions using this method.
9802 + *
9803 + * @param {Object} action A plain object representing “what changed”. It is
9804 + * a good idea to keep actions serializable so you can record and replay user
9805 + * sessions, or use the time travelling `redux-devtools`. An action must have
9806 + * a `type` property which may not be `undefined`. It is a good idea to use
9807 + * string constants for action types.
9808 + *
9809 + * @returns {Object} For convenience, the same action object you dispatched.
9810 + *
9811 + * Note that, if you use a custom middleware, it may wrap `dispatch()` to
9812 + * return something else (for example, a Promise you can await).
9813 + */
9814 +
9815 +
9816 + function dispatch(action) {
9817 + if (!isPlainObject(action)) {
9818 + 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.");
9819 + }
9820 +
9821 + if (typeof action.type === 'undefined') {
9822 + throw new Error( false ? 0 : 'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');
9823 + }
9824 +
9825 + if (isDispatching) {
9826 + throw new Error( false ? 0 : 'Reducers may not dispatch actions.');
9827 + }
9828 +
9829 + try {
9830 + isDispatching = true;
9831 + currentState = currentReducer(currentState, action);
9832 + } finally {
9833 + isDispatching = false;
9834 + }
9835 +
9836 + var listeners = currentListeners = nextListeners;
9837 +
9838 + for (var i = 0; i < listeners.length; i++) {
9839 + var listener = listeners[i];
9840 + listener();
9841 + }
9842 +
9843 + return action;
9844 + }
9845 + /**
9846 + * Replaces the reducer currently used by the store to calculate the state.
9847 + *
9848 + * You might need this if your app implements code splitting and you want to
9849 + * load some of the reducers dynamically. You might also need this if you
9850 + * implement a hot reloading mechanism for Redux.
9851 + *
9852 + * @param {Function} nextReducer The reducer for the store to use instead.
9853 + * @returns {void}
9854 + */
9855 +
9856 +
9857 + function replaceReducer(nextReducer) {
9858 + if (typeof nextReducer !== 'function') {
9859 + throw new Error( false ? 0 : "Expected the nextReducer to be a function. Instead, received: '" + kindOf(nextReducer));
9860 + }
9861 +
9862 + currentReducer = nextReducer; // This action has a similiar effect to ActionTypes.INIT.
9863 + // Any reducers that existed in both the new and old rootReducer
9864 + // will receive the previous state. This effectively populates
9865 + // the new state tree with any relevant data from the old one.
9866 +
9867 + dispatch({
9868 + type: ActionTypes.REPLACE
9869 + });
9870 + }
9871 + /**
9872 + * Interoperability point for observable/reactive libraries.
9873 + * @returns {observable} A minimal observable of state changes.
9874 + * For more information, see the observable proposal:
9875 + * https://github.com/tc39/proposal-observable
9876 + */
9877 +
9878 +
9879 + function observable() {
9880 + var _ref;
9881 +
9882 + var outerSubscribe = subscribe;
9883 + return _ref = {
9884 + /**
9885 + * The minimal observable subscription method.
9886 + * @param {Object} observer Any object that can be used as an observer.
9887 + * The observer object should have a `next` method.
9888 + * @returns {subscription} An object with an `unsubscribe` method that can
9889 + * be used to unsubscribe the observable from the store, and prevent further
9890 + * emission of values from the observable.
9891 + */
9892 + subscribe: function subscribe(observer) {
9893 + if (typeof observer !== 'object' || observer === null) {
9894 + throw new Error( false ? 0 : "Expected the observer to be an object. Instead, received: '" + kindOf(observer) + "'");
9895 + }
9896 +
9897 + function observeState() {
9898 + if (observer.next) {
9899 + observer.next(getState());
9900 + }
9901 + }
9902 +
9903 + observeState();
9904 + var unsubscribe = outerSubscribe(observeState);
9905 + return {
9906 + unsubscribe: unsubscribe
9907 + };
9908 + }
9909 + }, _ref[$$observable] = function () {
9910 + return this;
9911 + }, _ref;
9912 + } // When a store is created, an "INIT" action is dispatched so that every
9913 + // reducer returns their initial state. This effectively populates
9914 + // the initial state tree.
9915 +
9916 +
9917 + dispatch({
9918 + type: ActionTypes.INIT
9919 + });
9920 + return _ref2 = {
9921 + dispatch: dispatch,
9922 + subscribe: subscribe,
9923 + getState: getState,
9924 + replaceReducer: replaceReducer
9925 + }, _ref2[$$observable] = observable, _ref2;
9926 +}
9927 +/**
9928 + * Creates a Redux store that holds the state tree.
9929 + *
9930 + * **We recommend using `configureStore` from the
9931 + * `@reduxjs/toolkit` package**, which replaces `createStore`:
9932 + * **https://redux.js.org/introduction/why-rtk-is-redux-today**
9933 + *
9934 + * The only way to change the data in the store is to call `dispatch()` on it.
9935 + *
9936 + * There should only be a single store in your app. To specify how different
9937 + * parts of the state tree respond to actions, you may combine several reducers
9938 + * into a single reducer function by using `combineReducers`.
9939 + *
9940 + * @param {Function} reducer A function that returns the next state tree, given
9941 + * the current state tree and the action to handle.
9942 + *
9943 + * @param {any} [preloadedState] The initial state. You may optionally specify it
9944 + * to hydrate the state from the server in universal apps, or to restore a
9945 + * previously serialized user session.
9946 + * If you use `combineReducers` to produce the root reducer function, this must be
9947 + * an object with the same shape as `combineReducers` keys.
9948 + *
9949 + * @param {Function} [enhancer] The store enhancer. You may optionally specify it
9950 + * to enhance the store with third-party capabilities such as middleware,
9951 + * time travel, persistence, etc. The only store enhancer that ships with Redux
9952 + * is `applyMiddleware()`.
9953 + *
9954 + * @returns {Store} A Redux store that lets you read the state, dispatch actions
9955 + * and subscribe to changes.
9956 + */
9957 +
9958 +var legacy_createStore = createStore;
9959 +
9960 +/**
9961 + * Prints a warning in the console if it exists.
9962 + *
9963 + * @param {String} message The warning message.
9964 + * @returns {void}
9965 + */
9966 +function warning(message) {
9967 + /* eslint-disable no-console */
9968 + if (typeof console !== 'undefined' && typeof console.error === 'function') {
9969 + console.error(message);
9970 + }
9971 + /* eslint-enable no-console */
9972 +
9973 +
9974 + try {
9975 + // This error was thrown as a convenience so that if you enable
9976 + // "break on all exceptions" in your console,
9977 + // it would pause the execution at this line.
9978 + throw new Error(message);
9979 + } catch (e) {} // eslint-disable-line no-empty
9980 +
9981 +}
9982 +
9983 +function getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) {
9984 + var reducerKeys = Object.keys(reducers);
9985 + var argumentName = action && action.type === ActionTypes.INIT ? 'preloadedState argument passed to createStore' : 'previous state received by the reducer';
9986 +
9987 + if (reducerKeys.length === 0) {
9988 + return 'Store does not have a valid reducer. Make sure the argument passed ' + 'to combineReducers is an object whose values are reducers.';
9989 + }
9990 +
9991 + if (!isPlainObject(inputState)) {
9992 + return "The " + argumentName + " has unexpected type of \"" + kindOf(inputState) + "\". Expected argument to be an object with the following " + ("keys: \"" + reducerKeys.join('", "') + "\"");
9993 + }
9994 +
9995 + var unexpectedKeys = Object.keys(inputState).filter(function (key) {
9996 + return !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key];
9997 + });
9998 + unexpectedKeys.forEach(function (key) {
9999 + unexpectedKeyCache[key] = true;
10000 + });
10001 + if (action && action.type === ActionTypes.REPLACE) return;
10002 +
10003 + if (unexpectedKeys.length > 0) {
10004 + 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.");
10005 + }
10006 +}
10007 +
10008 +function assertReducerShape(reducers) {
10009 + Object.keys(reducers).forEach(function (key) {
10010 + var reducer = reducers[key];
10011 + var initialState = reducer(undefined, {
10012 + type: ActionTypes.INIT
10013 + });
10014 +
10015 + if (typeof initialState === 'undefined') {
10016 + 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.");
10017 + }
10018 +
10019 + if (typeof reducer(undefined, {
10020 + type: ActionTypes.PROBE_UNKNOWN_ACTION()
10021 + }) === 'undefined') {
10022 + 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.");
10023 + }
10024 + });
10025 +}
10026 +/**
10027 + * Turns an object whose values are different reducer functions, into a single
10028 + * reducer function. It will call every child reducer, and gather their results
10029 + * into a single state object, whose keys correspond to the keys of the passed
10030 + * reducer functions.
10031 + *
10032 + * @param {Object} reducers An object whose values correspond to different
10033 + * reducer functions that need to be combined into one. One handy way to obtain
10034 + * it is to use ES6 `import * as reducers` syntax. The reducers may never return
10035 + * undefined for any action. Instead, they should return their initial state
10036 + * if the state passed to them was undefined, and the current state for any
10037 + * unrecognized action.
10038 + *
10039 + * @returns {Function} A reducer function that invokes every reducer inside the
10040 + * passed object, and builds a state object with the same shape.
10041 + */
10042 +
10043 +
10044 +function combineReducers(reducers) {
10045 + var reducerKeys = Object.keys(reducers);
10046 + var finalReducers = {};
10047 +
10048 + for (var i = 0; i < reducerKeys.length; i++) {
10049 + var key = reducerKeys[i];
10050 +
10051 + if (true) {
10052 + if (typeof reducers[key] === 'undefined') {
10053 + warning("No reducer provided for key \"" + key + "\"");
10054 + }
10055 + }
10056 +
10057 + if (typeof reducers[key] === 'function') {
10058 + finalReducers[key] = reducers[key];
10059 + }
10060 + }
10061 +
10062 + var finalReducerKeys = Object.keys(finalReducers); // This is used to make sure we don't warn about the same
10063 + // keys multiple times.
10064 +
10065 + var unexpectedKeyCache;
10066 +
10067 + if (true) {
10068 + unexpectedKeyCache = {};
10069 + }
10070 +
10071 + var shapeAssertionError;
10072 +
10073 + try {
10074 + assertReducerShape(finalReducers);
10075 + } catch (e) {
10076 + shapeAssertionError = e;
10077 + }
10078 +
10079 + return function combination(state, action) {
10080 + if (state === void 0) {
10081 + state = {};
10082 + }
10083 +
10084 + if (shapeAssertionError) {
10085 + throw shapeAssertionError;
10086 + }
10087 +
10088 + if (true) {
10089 + var warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action, unexpectedKeyCache);
10090 +
10091 + if (warningMessage) {
10092 + warning(warningMessage);
10093 + }
10094 + }
10095 +
10096 + var hasChanged = false;
10097 + var nextState = {};
10098 +
10099 + for (var _i = 0; _i < finalReducerKeys.length; _i++) {
10100 + var _key = finalReducerKeys[_i];
10101 + var reducer = finalReducers[_key];
10102 + var previousStateForKey = state[_key];
10103 + var nextStateForKey = reducer(previousStateForKey, action);
10104 +
10105 + if (typeof nextStateForKey === 'undefined') {
10106 + var actionType = action && action.type;
10107 + 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.");
10108 + }
10109 +
10110 + nextState[_key] = nextStateForKey;
10111 + hasChanged = hasChanged || nextStateForKey !== previousStateForKey;
10112 + }
10113 +
10114 + hasChanged = hasChanged || finalReducerKeys.length !== Object.keys(state).length;
10115 + return hasChanged ? nextState : state;
10116 + };
10117 +}
10118 +
10119 +function bindActionCreator(actionCreator, dispatch) {
10120 + return function () {
10121 + return dispatch(actionCreator.apply(this, arguments));
10122 + };
10123 +}
10124 +/**
10125 + * Turns an object whose values are action creators, into an object with the
10126 + * same keys, but with every function wrapped into a `dispatch` call so they
10127 + * may be invoked directly. This is just a convenience method, as you can call
10128 + * `store.dispatch(MyActionCreators.doSomething())` yourself just fine.
10129 + *
10130 + * For convenience, you can also pass an action creator as the first argument,
10131 + * and get a dispatch wrapped function in return.
10132 + *
10133 + * @param {Function|Object} actionCreators An object whose values are action
10134 + * creator functions. One handy way to obtain it is to use ES6 `import * as`
10135 + * syntax. You may also pass a single function.
10136 + *
10137 + * @param {Function} dispatch The `dispatch` function available on your Redux
10138 + * store.
10139 + *
10140 + * @returns {Function|Object} The object mimicking the original object, but with
10141 + * every action creator wrapped into the `dispatch` call. If you passed a
10142 + * function as `actionCreators`, the return value will also be a single
10143 + * function.
10144 + */
10145 +
10146 +
10147 +function bindActionCreators(actionCreators, dispatch) {
10148 + if (typeof actionCreators === 'function') {
10149 + return bindActionCreator(actionCreators, dispatch);
10150 + }
10151 +
10152 + if (typeof actionCreators !== 'object' || actionCreators === null) {
10153 + 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\"?");
10154 + }
10155 +
10156 + var boundActionCreators = {};
10157 +
10158 + for (var key in actionCreators) {
10159 + var actionCreator = actionCreators[key];
10160 +
10161 + if (typeof actionCreator === 'function') {
10162 + boundActionCreators[key] = bindActionCreator(actionCreator, dispatch);
10163 + }
10164 + }
10165 +
10166 + return boundActionCreators;
10167 +}
10168 +
10169 +/**
10170 + * Composes single-argument functions from right to left. The rightmost
10171 + * function can take multiple arguments as it provides the signature for
10172 + * the resulting composite function.
10173 + *
10174 + * @param {...Function} funcs The functions to compose.
10175 + * @returns {Function} A function obtained by composing the argument functions
10176 + * from right to left. For example, compose(f, g, h) is identical to doing
10177 + * (...args) => f(g(h(...args))).
10178 + */
10179 +function compose() {
10180 + for (var _len = arguments.length, funcs = new Array(_len), _key = 0; _key < _len; _key++) {
10181 + funcs[_key] = arguments[_key];
10182 + }
10183 +
10184 + if (funcs.length === 0) {
10185 + return function (arg) {
10186 + return arg;
10187 + };
10188 + }
10189 +
10190 + if (funcs.length === 1) {
10191 + return funcs[0];
10192 + }
10193 +
10194 + return funcs.reduce(function (a, b) {
10195 + return function () {
10196 + return a(b.apply(void 0, arguments));
10197 + };
10198 + });
10199 +}
10200 +
10201 +/**
10202 + * Creates a store enhancer that applies middleware to the dispatch method
10203 + * of the Redux store. This is handy for a variety of tasks, such as expressing
10204 + * asynchronous actions in a concise manner, or logging every action payload.
10205 + *
10206 + * See `redux-thunk` package as an example of the Redux middleware.
10207 + *
10208 + * Because middleware is potentially asynchronous, this should be the first
10209 + * store enhancer in the composition chain.
10210 + *
10211 + * Note that each middleware will be given the `dispatch` and `getState` functions
10212 + * as named arguments.
10213 + *
10214 + * @param {...Function} middlewares The middleware chain to be applied.
10215 + * @returns {Function} A store enhancer applying the middleware.
10216 + */
10217 +
10218 +function applyMiddleware() {
10219 + for (var _len = arguments.length, middlewares = new Array(_len), _key = 0; _key < _len; _key++) {
10220 + middlewares[_key] = arguments[_key];
10221 + }
10222 +
10223 + return function (createStore) {
10224 + return function () {
10225 + var store = createStore.apply(void 0, arguments);
10226 +
10227 + var _dispatch = function dispatch() {
10228 + throw new Error( false ? 0 : 'Dispatching while constructing your middleware is not allowed. ' + 'Other middleware would not be applied to this dispatch.');
10229 + };
10230 +
10231 + var middlewareAPI = {
10232 + getState: store.getState,
10233 + dispatch: function dispatch() {
10234 + return _dispatch.apply(void 0, arguments);
10235 + }
10236 + };
10237 + var chain = middlewares.map(function (middleware) {
10238 + return middleware(middlewareAPI);
10239 + });
10240 + _dispatch = compose.apply(void 0, chain)(store.dispatch);
10241 + return (0,_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_0__["default"])((0,_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_0__["default"])({}, store), {}, {
10242 + dispatch: _dispatch
10243 + });
10244 + };
10245 + };
10246 +}
10247 +
10248 +/*
10249 + * This is a dummy function to check if the function name has been altered by minification.
10250 + * If the function has been minified and NODE_ENV !== 'production', warn the user.
10251 + */
10252 +
10253 +function isCrushed() {}
10254 +
10255 +if ( true && typeof isCrushed.name === 'string' && isCrushed.name !== 'isCrushed') {
10256 + 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.');
10257 +}
10258 +
10259 +
10260 +
10261 +
10262 +/***/ }),
10263 +
10264 +/***/ "../node_modules/reselect/es/defaultMemoize.js":
10265 +/*!*****************************************************!*\
10266 + !*** ../node_modules/reselect/es/defaultMemoize.js ***!
10267 + \*****************************************************/
10268 +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
10269 +
10270 +"use strict";
10271 +__webpack_require__.r(__webpack_exports__);
10272 +/* harmony export */ __webpack_require__.d(__webpack_exports__, {
10273 +/* harmony export */ "createCacheKeyComparator": () => (/* binding */ createCacheKeyComparator),
10274 +/* harmony export */ "defaultEqualityCheck": () => (/* binding */ defaultEqualityCheck),
10275 +/* harmony export */ "defaultMemoize": () => (/* binding */ defaultMemoize)
10276 +/* harmony export */ });
10277 +// Cache implementation based on Erik Rasmussen's `lru-memoize`:
10278 +// https://github.com/erikras/lru-memoize
10279 +var NOT_FOUND = 'NOT_FOUND';
10280 +
10281 +function createSingletonCache(equals) {
10282 + var entry;
10283 + return {
10284 + get: function get(key) {
10285 + if (entry && equals(entry.key, key)) {
10286 + return entry.value;
10287 + }
10288 +
10289 + return NOT_FOUND;
10290 + },
10291 + put: function put(key, value) {
10292 + entry = {
10293 + key: key,
10294 + value: value
10295 + };
10296 + },
10297 + getEntries: function getEntries() {
10298 + return entry ? [entry] : [];
10299 + },
10300 + clear: function clear() {
10301 + entry = undefined;
10302 + }
10303 + };
10304 +}
10305 +
10306 +function createLruCache(maxSize, equals) {
10307 + var entries = [];
10308 +
10309 + function get(key) {
10310 + var cacheIndex = entries.findIndex(function (entry) {
10311 + return equals(key, entry.key);
10312 + }); // We found a cached entry
10313 +
10314 + if (cacheIndex > -1) {
10315 + var entry = entries[cacheIndex]; // Cached entry not at top of cache, move it to the top
10316 +
10317 + if (cacheIndex > 0) {
10318 + entries.splice(cacheIndex, 1);
10319 + entries.unshift(entry);
10320 + }
10321 +
10322 + return entry.value;
10323 + } // No entry found in cache, return sentinel
10324 +
10325 +
10326 + return NOT_FOUND;
10327 + }
10328 +
10329 + function put(key, value) {
10330 + if (get(key) === NOT_FOUND) {
10331 + // TODO Is unshift slow?
10332 + entries.unshift({
10333 + key: key,
10334 + value: value
10335 + });
10336 +
10337 + if (entries.length > maxSize) {
10338 + entries.pop();
10339 + }
10340 + }
10341 + }
10342 +
10343 + function getEntries() {
10344 + return entries;
10345 + }
10346 +
10347 + function clear() {
10348 + entries = [];
10349 + }
10350 +
10351 + return {
10352 + get: get,
10353 + put: put,
10354 + getEntries: getEntries,
10355 + clear: clear
10356 + };
10357 +}
10358 +
10359 +var defaultEqualityCheck = function defaultEqualityCheck(a, b) {
10360 + return a === b;
10361 +};
10362 +function createCacheKeyComparator(equalityCheck) {
10363 + return function areArgumentsShallowlyEqual(prev, next) {
10364 + if (prev === null || next === null || prev.length !== next.length) {
10365 + return false;
10366 + } // Do this in a for loop (and not a `forEach` or an `every`) so we can determine equality as fast as possible.
10367 +
10368 +
10369 + var length = prev.length;
10370 +
10371 + for (var i = 0; i < length; i++) {
10372 + if (!equalityCheck(prev[i], next[i])) {
10373 + return false;
10374 + }
10375 + }
10376 +
10377 + return true;
10378 + };
10379 +}
10380 +// defaultMemoize now supports a configurable cache size with LRU behavior,
10381 +// and optional comparison of the result value with existing values
10382 +function defaultMemoize(func, equalityCheckOrOptions) {
10383 + var providedOptions = typeof equalityCheckOrOptions === 'object' ? equalityCheckOrOptions : {
10384 + equalityCheck: equalityCheckOrOptions
10385 + };
10386 + var _providedOptions$equa = providedOptions.equalityCheck,
10387 + equalityCheck = _providedOptions$equa === void 0 ? defaultEqualityCheck : _providedOptions$equa,
10388 + _providedOptions$maxS = providedOptions.maxSize,
10389 + maxSize = _providedOptions$maxS === void 0 ? 1 : _providedOptions$maxS,
10390 + resultEqualityCheck = providedOptions.resultEqualityCheck;
10391 + var comparator = createCacheKeyComparator(equalityCheck);
10392 + var cache = maxSize === 1 ? createSingletonCache(comparator) : createLruCache(maxSize, comparator); // we reference arguments instead of spreading them for performance reasons
10393 +
10394 + function memoized() {
10395 + var value = cache.get(arguments);
10396 +
10397 + if (value === NOT_FOUND) {
10398 + // @ts-ignore
10399 + value = func.apply(null, arguments);
10400 +
10401 + if (resultEqualityCheck) {
10402 + var entries = cache.getEntries();
10403 + var matchingEntry = entries.find(function (entry) {
10404 + return resultEqualityCheck(entry.value, value);
10405 + });
10406 +
10407 + if (matchingEntry) {
10408 + value = matchingEntry.value;
10409 + }
10410 + }
10411 +
10412 + cache.put(arguments, value);
10413 + }
10414 +
10415 + return value;
10416 + }
10417 +
10418 + memoized.clearCache = function () {
10419 + return cache.clear();
10420 + };
10421 +
10422 + return memoized;
10423 +}
10424 +
10425 +/***/ }),
10426 +
10427 +/***/ "../node_modules/reselect/es/index.js":
10428 +/*!********************************************!*\
10429 + !*** ../node_modules/reselect/es/index.js ***!
10430 + \********************************************/
10431 +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
10432 +
10433 +"use strict";
10434 +__webpack_require__.r(__webpack_exports__);
10435 +/* harmony export */ __webpack_require__.d(__webpack_exports__, {
10436 +/* harmony export */ "createSelector": () => (/* binding */ createSelector),
10437 +/* harmony export */ "createSelectorCreator": () => (/* binding */ createSelectorCreator),
10438 +/* harmony export */ "createStructuredSelector": () => (/* binding */ createStructuredSelector),
10439 +/* harmony export */ "defaultEqualityCheck": () => (/* reexport safe */ _defaultMemoize__WEBPACK_IMPORTED_MODULE_0__.defaultEqualityCheck),
10440 +/* harmony export */ "defaultMemoize": () => (/* reexport safe */ _defaultMemoize__WEBPACK_IMPORTED_MODULE_0__.defaultMemoize)
10441 +/* harmony export */ });
10442 +/* harmony import */ var _defaultMemoize__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./defaultMemoize */ "../node_modules/reselect/es/defaultMemoize.js");
10443 +
10444 +
10445 +
10446 +function getDependencies(funcs) {
10447 + var dependencies = Array.isArray(funcs[0]) ? funcs[0] : funcs;
10448 +
10449 + if (!dependencies.every(function (dep) {
10450 + return typeof dep === 'function';
10451 + })) {
10452 + var dependencyTypes = dependencies.map(function (dep) {
10453 + return typeof dep === 'function' ? "function " + (dep.name || 'unnamed') + "()" : typeof dep;
10454 + }).join(', ');
10455 + throw new Error("createSelector expects all input-selectors to be functions, but received the following types: [" + dependencyTypes + "]");
10456 + }
10457 +
10458 + return dependencies;
10459 +}
10460 +
10461 +function createSelectorCreator(memoize) {
10462 + for (var _len = arguments.length, memoizeOptionsFromArgs = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
10463 + memoizeOptionsFromArgs[_key - 1] = arguments[_key];
10464 + }
10465 +
10466 + var createSelector = function createSelector() {
10467 + for (var _len2 = arguments.length, funcs = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
10468 + funcs[_key2] = arguments[_key2];
10469 + }
10470 +
10471 + var _recomputations = 0;
10472 +
10473 + var _lastResult; // Due to the intricacies of rest params, we can't do an optional arg after `...funcs`.
10474 + // So, start by declaring the default value here.
10475 + // (And yes, the words 'memoize' and 'options' appear too many times in this next sequence.)
10476 +
10477 +
10478 + var directlyPassedOptions = {
10479 + memoizeOptions: undefined
10480 + }; // Normally, the result func or "output selector" is the last arg
10481 +
10482 + var resultFunc = funcs.pop(); // If the result func is actually an _object_, assume it's our options object
10483 +
10484 + if (typeof resultFunc === 'object') {
10485 + directlyPassedOptions = resultFunc; // and pop the real result func off
10486 +
10487 + resultFunc = funcs.pop();
10488 + }
10489 +
10490 + if (typeof resultFunc !== 'function') {
10491 + throw new Error("createSelector expects an output function after the inputs, but received: [" + typeof resultFunc + "]");
10492 + } // Determine which set of options we're using. Prefer options passed directly,
10493 + // but fall back to options given to createSelectorCreator.
10494 +
10495 +
10496 + var _directlyPassedOption = directlyPassedOptions,
10497 + _directlyPassedOption2 = _directlyPassedOption.memoizeOptions,
10498 + memoizeOptions = _directlyPassedOption2 === void 0 ? memoizeOptionsFromArgs : _directlyPassedOption2; // Simplifying assumption: it's unlikely that the first options arg of the provided memoizer
10499 + // is an array. In most libs I've looked at, it's an equality function or options object.
10500 + // Based on that, if `memoizeOptions` _is_ an array, we assume it's a full
10501 + // user-provided array of options. Otherwise, it must be just the _first_ arg, and so
10502 + // we wrap it in an array so we can apply it.
10503 +
10504 + var finalMemoizeOptions = Array.isArray(memoizeOptions) ? memoizeOptions : [memoizeOptions];
10505 + var dependencies = getDependencies(funcs);
10506 + var memoizedResultFunc = memoize.apply(void 0, [function recomputationWrapper() {
10507 + _recomputations++; // apply arguments instead of spreading for performance.
10508 +
10509 + return resultFunc.apply(null, arguments);
10510 + }].concat(finalMemoizeOptions)); // If a selector is called with the exact same arguments we don't need to traverse our dependencies again.
10511 +
10512 + var selector = memoize(function dependenciesChecker() {
10513 + var params = [];
10514 + var length = dependencies.length;
10515 +
10516 + for (var i = 0; i < length; i++) {
10517 + // apply arguments instead of spreading and mutate a local list of params for performance.
10518 + // @ts-ignore
10519 + params.push(dependencies[i].apply(null, arguments));
10520 + } // apply arguments instead of spreading for performance.
10521 +
10522 +
10523 + _lastResult = memoizedResultFunc.apply(null, params);
10524 + return _lastResult;
10525 + });
10526 + Object.assign(selector, {
10527 + resultFunc: resultFunc,
10528 + memoizedResultFunc: memoizedResultFunc,
10529 + dependencies: dependencies,
10530 + lastResult: function lastResult() {
10531 + return _lastResult;
10532 + },
10533 + recomputations: function recomputations() {
10534 + return _recomputations;
10535 + },
10536 + resetRecomputations: function resetRecomputations() {
10537 + return _recomputations = 0;
10538 + }
10539 + });
10540 + return selector;
10541 + }; // @ts-ignore
10542 +
10543 +
10544 + return createSelector;
10545 +}
10546 +var createSelector = /* #__PURE__ */createSelectorCreator(_defaultMemoize__WEBPACK_IMPORTED_MODULE_0__.defaultMemoize);
10547 +// Manual definition of state and output arguments
10548 +var createStructuredSelector = function createStructuredSelector(selectors, selectorCreator) {
10549 + if (selectorCreator === void 0) {
10550 + selectorCreator = createSelector;
10551 + }
10552 +
10553 + if (typeof selectors !== 'object') {
10554 + throw new Error('createStructuredSelector expects first argument to be an object ' + ("where each property is a selector, instead received a " + typeof selectors));
10555 + }
10556 +
10557 + var objectKeys = Object.keys(selectors);
10558 + var resultSelector = selectorCreator( // @ts-ignore
10559 + objectKeys.map(function (key) {
10560 + return selectors[key];
10561 + }), function () {
10562 + for (var _len3 = arguments.length, values = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
10563 + values[_key3] = arguments[_key3];
10564 + }
10565 +
10566 + return values.reduce(function (composition, value, index) {
10567 + composition[objectKeys[index]] = value;
10568 + return composition;
10569 + }, {});
10570 + });
10571 + return resultSelector;
10572 +};
10573 +
10574 +/***/ }),
10575 +
10576 +/***/ "../node_modules/@babel/runtime/helpers/arrayLikeToArray.js":
10577 +/*!******************************************************************!*\
10578 + !*** ../node_modules/@babel/runtime/helpers/arrayLikeToArray.js ***!
10579 + \******************************************************************/
10580 +/***/ ((module) => {
10581 +
10582 +function _arrayLikeToArray(arr, len) {
10583 + if (len == null || len > arr.length) len = arr.length;
10584 + for (var i = 0, arr2 = new Array(len); i < len; i++) {
10585 + arr2[i] = arr[i];
10586 + }
10587 + return arr2;
10588 +}
10589 +module.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
10590 +
10591 +/***/ }),
10592 +
10593 +/***/ "../node_modules/@babel/runtime/helpers/arrayWithHoles.js":
10594 +/*!****************************************************************!*\
10595 + !*** ../node_modules/@babel/runtime/helpers/arrayWithHoles.js ***!
10596 + \****************************************************************/
10597 +/***/ ((module) => {
10598 +
10599 +function _arrayWithHoles(arr) {
10600 + if (Array.isArray(arr)) return arr;
10601 +}
10602 +module.exports = _arrayWithHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
10603 +
10604 +/***/ }),
10605 +
10606 +/***/ "../node_modules/@babel/runtime/helpers/assertThisInitialized.js":
10607 +/*!***********************************************************************!*\
10608 + !*** ../node_modules/@babel/runtime/helpers/assertThisInitialized.js ***!
10609 + \***********************************************************************/
10610 +/***/ ((module) => {
10611 +
10612 +function _assertThisInitialized(self) {
10613 + if (self === void 0) {
10614 + throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
10615 + }
10616 + return self;
10617 +}
10618 +module.exports = _assertThisInitialized, module.exports.__esModule = true, module.exports["default"] = module.exports;
10619 +
10620 +/***/ }),
10621 +
10622 +/***/ "../node_modules/@babel/runtime/helpers/asyncToGenerator.js":
10623 +/*!******************************************************************!*\
10624 + !*** ../node_modules/@babel/runtime/helpers/asyncToGenerator.js ***!
10625 + \******************************************************************/
10626 +/***/ ((module) => {
10627 +
10628 +function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
10629 + try {
10630 + var info = gen[key](arg);
10631 + var value = info.value;
10632 + } catch (error) {
10633 + reject(error);
10634 + return;
10635 + }
10636 + if (info.done) {
10637 + resolve(value);
10638 + } else {
10639 + Promise.resolve(value).then(_next, _throw);
10640 + }
10641 +}
10642 +function _asyncToGenerator(fn) {
10643 + return function () {
10644 + var self = this,
10645 + args = arguments;
10646 + return new Promise(function (resolve, reject) {
10647 + var gen = fn.apply(self, args);
10648 + function _next(value) {
10649 + asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
10650 + }
10651 + function _throw(err) {
10652 + asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
10653 + }
10654 + _next(undefined);
10655 + });
10656 + };
10657 +}
10658 +module.exports = _asyncToGenerator, module.exports.__esModule = true, module.exports["default"] = module.exports;
10659 +
10660 +/***/ }),
10661 +
10662 +/***/ "../node_modules/@babel/runtime/helpers/classCallCheck.js":
10663 +/*!****************************************************************!*\
10664 + !*** ../node_modules/@babel/runtime/helpers/classCallCheck.js ***!
10665 + \****************************************************************/
10666 +/***/ ((module) => {
10667 +
10668 +function _classCallCheck(instance, Constructor) {
10669 + if (!(instance instanceof Constructor)) {
10670 + throw new TypeError("Cannot call a class as a function");
10671 + }
10672 +}
10673 +module.exports = _classCallCheck, module.exports.__esModule = true, module.exports["default"] = module.exports;
10674 +
10675 +/***/ }),
10676 +
10677 +/***/ "../node_modules/@babel/runtime/helpers/construct.js":
10678 +/*!***********************************************************!*\
10679 + !*** ../node_modules/@babel/runtime/helpers/construct.js ***!
10680 + \***********************************************************/
10681 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
10682 +
10683 +var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ "../node_modules/@babel/runtime/helpers/setPrototypeOf.js");
10684 +var isNativeReflectConstruct = __webpack_require__(/*! ./isNativeReflectConstruct.js */ "../node_modules/@babel/runtime/helpers/isNativeReflectConstruct.js");
10685 +function _construct(Parent, args, Class) {
10686 + if (isNativeReflectConstruct()) {
10687 + module.exports = _construct = Reflect.construct.bind(), module.exports.__esModule = true, module.exports["default"] = module.exports;
10688 + } else {
10689 + module.exports = _construct = function _construct(Parent, args, Class) {
10690 + var a = [null];
10691 + a.push.apply(a, args);
10692 + var Constructor = Function.bind.apply(Parent, a);
10693 + var instance = new Constructor();
10694 + if (Class) setPrototypeOf(instance, Class.prototype);
10695 + return instance;
10696 + }, module.exports.__esModule = true, module.exports["default"] = module.exports;
10697 + }
10698 + return _construct.apply(null, arguments);
10699 +}
10700 +module.exports = _construct, module.exports.__esModule = true, module.exports["default"] = module.exports;
10701 +
10702 +/***/ }),
10703 +
10704 +/***/ "../node_modules/@babel/runtime/helpers/createClass.js":
10705 +/*!*************************************************************!*\
10706 + !*** ../node_modules/@babel/runtime/helpers/createClass.js ***!
10707 + \*************************************************************/
10708 +/***/ ((module) => {
10709 +
10710 +function _defineProperties(target, props) {
10711 + for (var i = 0; i < props.length; i++) {
10712 + var descriptor = props[i];
10713 + descriptor.enumerable = descriptor.enumerable || false;
10714 + descriptor.configurable = true;
10715 + if ("value" in descriptor) descriptor.writable = true;
10716 + Object.defineProperty(target, descriptor.key, descriptor);
10717 + }
10718 +}
10719 +function _createClass(Constructor, protoProps, staticProps) {
10720 + if (protoProps) _defineProperties(Constructor.prototype, protoProps);
10721 + if (staticProps) _defineProperties(Constructor, staticProps);
10722 + Object.defineProperty(Constructor, "prototype", {
10723 + writable: false
10724 + });
10725 + return Constructor;
10726 +}
10727 +module.exports = _createClass, module.exports.__esModule = true, module.exports["default"] = module.exports;
10728 +
10729 +/***/ }),
10730 +
10731 +/***/ "../node_modules/@babel/runtime/helpers/defineProperty.js":
10732 +/*!****************************************************************!*\
10733 + !*** ../node_modules/@babel/runtime/helpers/defineProperty.js ***!
10734 + \****************************************************************/
10735 +/***/ ((module) => {
10736 +
10737 +function _defineProperty(obj, key, value) {
10738 + if (key in obj) {
10739 + Object.defineProperty(obj, key, {
10740 + value: value,
10741 + enumerable: true,
10742 + configurable: true,
10743 + writable: true
10744 + });
10745 + } else {
10746 + obj[key] = value;
10747 + }
10748 + return obj;
10749 +}
10750 +module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports;
10751 +
10752 +/***/ }),
10753 +
10754 +/***/ "../node_modules/@babel/runtime/helpers/get.js":
10755 +/*!*****************************************************!*\
10756 + !*** ../node_modules/@babel/runtime/helpers/get.js ***!
10757 + \*****************************************************/
10758 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
10759 +
10760 +var superPropBase = __webpack_require__(/*! ./superPropBase.js */ "../node_modules/@babel/runtime/helpers/superPropBase.js");
10761 +function _get() {
10762 + if (typeof Reflect !== "undefined" && Reflect.get) {
10763 + module.exports = _get = Reflect.get.bind(), module.exports.__esModule = true, module.exports["default"] = module.exports;
10764 + } else {
10765 + module.exports = _get = function _get(target, property, receiver) {
10766 + var base = superPropBase(target, property);
10767 + if (!base) return;
10768 + var desc = Object.getOwnPropertyDescriptor(base, property);
10769 + if (desc.get) {
10770 + return desc.get.call(arguments.length < 3 ? target : receiver);
10771 + }
10772 + return desc.value;
10773 + }, module.exports.__esModule = true, module.exports["default"] = module.exports;
10774 + }
10775 + return _get.apply(this, arguments);
10776 +}
10777 +module.exports = _get, module.exports.__esModule = true, module.exports["default"] = module.exports;
10778 +
10779 +/***/ }),
10780 +
10781 +/***/ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js":
10782 +/*!****************************************************************!*\
10783 + !*** ../node_modules/@babel/runtime/helpers/getPrototypeOf.js ***!
10784 + \****************************************************************/
10785 +/***/ ((module) => {
10786 +
10787 +function _getPrototypeOf(o) {
10788 + module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
10789 + return o.__proto__ || Object.getPrototypeOf(o);
10790 + }, module.exports.__esModule = true, module.exports["default"] = module.exports;
10791 + return _getPrototypeOf(o);
10792 +}
10793 +module.exports = _getPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
10794 +
10795 +/***/ }),
10796 +
10797 +/***/ "../node_modules/@babel/runtime/helpers/inherits.js":
10798 +/*!**********************************************************!*\
10799 + !*** ../node_modules/@babel/runtime/helpers/inherits.js ***!
10800 + \**********************************************************/
10801 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
10802 +
10803 +var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ "../node_modules/@babel/runtime/helpers/setPrototypeOf.js");
10804 +function _inherits(subClass, superClass) {
10805 + if (typeof superClass !== "function" && superClass !== null) {
10806 + throw new TypeError("Super expression must either be null or a function");
10807 + }
10808 + subClass.prototype = Object.create(superClass && superClass.prototype, {
10809 + constructor: {
10810 + value: subClass,
10811 + writable: true,
10812 + configurable: true
10813 + }
10814 + });
10815 + Object.defineProperty(subClass, "prototype", {
10816 + writable: false
10817 + });
10818 + if (superClass) setPrototypeOf(subClass, superClass);
10819 +}
10820 +module.exports = _inherits, module.exports.__esModule = true, module.exports["default"] = module.exports;
10821 +
10822 +/***/ }),
10823 +
10824 +/***/ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js":
10825 +/*!***********************************************************************!*\
10826 + !*** ../node_modules/@babel/runtime/helpers/interopRequireDefault.js ***!
10827 + \***********************************************************************/
10828 +/***/ ((module) => {
10829 +
10830 +function _interopRequireDefault(obj) {
10831 + return obj && obj.__esModule ? obj : {
10832 + "default": obj
10833 + };
10834 +}
10835 +module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
10836 +
10837 +/***/ }),
10838 +
10839 +/***/ "../node_modules/@babel/runtime/helpers/isNativeFunction.js":
10840 +/*!******************************************************************!*\
10841 + !*** ../node_modules/@babel/runtime/helpers/isNativeFunction.js ***!
10842 + \******************************************************************/
10843 +/***/ ((module) => {
10844 +
10845 +function _isNativeFunction(fn) {
10846 + return Function.toString.call(fn).indexOf("[native code]") !== -1;
10847 +}
10848 +module.exports = _isNativeFunction, module.exports.__esModule = true, module.exports["default"] = module.exports;
10849 +
10850 +/***/ }),
10851 +
10852 +/***/ "../node_modules/@babel/runtime/helpers/isNativeReflectConstruct.js":
10853 +/*!**************************************************************************!*\
10854 + !*** ../node_modules/@babel/runtime/helpers/isNativeReflectConstruct.js ***!
10855 + \**************************************************************************/
10856 +/***/ ((module) => {
10857 +
10858 +function _isNativeReflectConstruct() {
10859 + if (typeof Reflect === "undefined" || !Reflect.construct) return false;
10860 + if (Reflect.construct.sham) return false;
10861 + if (typeof Proxy === "function") return true;
10862 + try {
10863 + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
10864 + return true;
10865 + } catch (e) {
10866 + return false;
10867 + }
10868 +}
10869 +module.exports = _isNativeReflectConstruct, module.exports.__esModule = true, module.exports["default"] = module.exports;
10870 +
10871 +/***/ }),
10872 +
10873 +/***/ "../node_modules/@babel/runtime/helpers/iterableToArrayLimit.js":
10874 +/*!**********************************************************************!*\
10875 + !*** ../node_modules/@babel/runtime/helpers/iterableToArrayLimit.js ***!
10876 + \**********************************************************************/
10877 +/***/ ((module) => {
10878 +
10879 +function _iterableToArrayLimit(arr, i) {
10880 + var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
10881 + if (_i == null) return;
10882 + var _arr = [];
10883 + var _n = true;
10884 + var _d = false;
10885 + var _s, _e;
10886 + try {
10887 + for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {
10888 + _arr.push(_s.value);
10889 + if (i && _arr.length === i) break;
10890 + }
10891 + } catch (err) {
10892 + _d = true;
10893 + _e = err;
10894 + } finally {
10895 + try {
10896 + if (!_n && _i["return"] != null) _i["return"]();
10897 + } finally {
10898 + if (_d) throw _e;
10899 + }
10900 + }
10901 + return _arr;
10902 +}
10903 +module.exports = _iterableToArrayLimit, module.exports.__esModule = true, module.exports["default"] = module.exports;
10904 +
10905 +/***/ }),
10906 +
10907 +/***/ "../node_modules/@babel/runtime/helpers/nonIterableRest.js":
10908 +/*!*****************************************************************!*\
10909 + !*** ../node_modules/@babel/runtime/helpers/nonIterableRest.js ***!
10910 + \*****************************************************************/
10911 +/***/ ((module) => {
10912 +
10913 +function _nonIterableRest() {
10914 + throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
10915 +}
10916 +module.exports = _nonIterableRest, module.exports.__esModule = true, module.exports["default"] = module.exports;
10917 +
10918 +/***/ }),
10919 +
10920 +/***/ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js":
10921 +/*!***************************************************************************!*\
10922 + !*** ../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js ***!
10923 + \***************************************************************************/
10924 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
10925 +
10926 +var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]);
10927 +var assertThisInitialized = __webpack_require__(/*! ./assertThisInitialized.js */ "../node_modules/@babel/runtime/helpers/assertThisInitialized.js");
10928 +function _possibleConstructorReturn(self, call) {
10929 + if (call && (_typeof(call) === "object" || typeof call === "function")) {
10930 + return call;
10931 + } else if (call !== void 0) {
10932 + throw new TypeError("Derived constructors may only return object or undefined");
10933 + }
10934 + return assertThisInitialized(self);
10935 +}
10936 +module.exports = _possibleConstructorReturn, module.exports.__esModule = true, module.exports["default"] = module.exports;
10937 +
10938 +/***/ }),
10939 +
10940 +/***/ "../node_modules/@babel/runtime/helpers/regeneratorRuntime.js":
10941 +/*!********************************************************************!*\
10942 + !*** ../node_modules/@babel/runtime/helpers/regeneratorRuntime.js ***!
10943 + \********************************************************************/
10944 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
10945 +
10946 +var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]);
10947 +function _regeneratorRuntime() {
10948 + "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
10949 + module.exports = _regeneratorRuntime = function _regeneratorRuntime() {
10950 + return exports;
10951 + }, module.exports.__esModule = true, module.exports["default"] = module.exports;
10952 + var exports = {},
10953 + Op = Object.prototype,
10954 + hasOwn = Op.hasOwnProperty,
10955 + $Symbol = "function" == typeof Symbol ? Symbol : {},
10956 + iteratorSymbol = $Symbol.iterator || "@@iterator",
10957 + asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
10958 + toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
10959 + function define(obj, key, value) {
10960 + return Object.defineProperty(obj, key, {
10961 + value: value,
10962 + enumerable: !0,
10963 + configurable: !0,
10964 + writable: !0
10965 + }), obj[key];
10966 + }
10967 + try {
10968 + define({}, "");
10969 + } catch (err) {
10970 + define = function define(obj, key, value) {
10971 + return obj[key] = value;
10972 + };
10973 + }
10974 + function wrap(innerFn, outerFn, self, tryLocsList) {
10975 + var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
10976 + generator = Object.create(protoGenerator.prototype),
10977 + context = new Context(tryLocsList || []);
10978 + return generator._invoke = function (innerFn, self, context) {
10979 + var state = "suspendedStart";
10980 + return function (method, arg) {
10981 + if ("executing" === state) throw new Error("Generator is already running");
10982 + if ("completed" === state) {
10983 + if ("throw" === method) throw arg;
10984 + return doneResult();
10985 + }
10986 + for (context.method = method, context.arg = arg;;) {
10987 + var delegate = context.delegate;
10988 + if (delegate) {
10989 + var delegateResult = maybeInvokeDelegate(delegate, context);
10990 + if (delegateResult) {
10991 + if (delegateResult === ContinueSentinel) continue;
10992 + return delegateResult;
10993 + }
10994 + }
10995 + if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
10996 + if ("suspendedStart" === state) throw state = "completed", context.arg;
10997 + context.dispatchException(context.arg);
10998 + } else "return" === context.method && context.abrupt("return", context.arg);
10999 + state = "executing";
11000 + var record = tryCatch(innerFn, self, context);
11001 + if ("normal" === record.type) {
11002 + if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
11003 + return {
11004 + value: record.arg,
11005 + done: context.done
11006 + };
11007 + }
11008 + "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
11009 + }
11010 + };
11011 + }(innerFn, self, context), generator;
11012 + }
11013 + function tryCatch(fn, obj, arg) {
11014 + try {
11015 + return {
11016 + type: "normal",
11017 + arg: fn.call(obj, arg)
11018 + };
11019 + } catch (err) {
11020 + return {
11021 + type: "throw",
11022 + arg: err
11023 + };
11024 + }
11025 + }
11026 + exports.wrap = wrap;
11027 + var ContinueSentinel = {};
11028 + function Generator() {}
11029 + function GeneratorFunction() {}
11030 + function GeneratorFunctionPrototype() {}
11031 + var IteratorPrototype = {};
11032 + define(IteratorPrototype, iteratorSymbol, function () {
11033 + return this;
11034 + });
11035 + var getProto = Object.getPrototypeOf,
11036 + NativeIteratorPrototype = getProto && getProto(getProto(values([])));
11037 + NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
11038 + var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
11039 + function defineIteratorMethods(prototype) {
11040 + ["next", "throw", "return"].forEach(function (method) {
11041 + define(prototype, method, function (arg) {
11042 + return this._invoke(method, arg);
11043 + });
11044 + });
11045 + }
11046 + function AsyncIterator(generator, PromiseImpl) {
11047 + function invoke(method, arg, resolve, reject) {
11048 + var record = tryCatch(generator[method], generator, arg);
11049 + if ("throw" !== record.type) {
11050 + var result = record.arg,
11051 + value = result.value;
11052 + return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
11053 + invoke("next", value, resolve, reject);
11054 + }, function (err) {
11055 + invoke("throw", err, resolve, reject);
11056 + }) : PromiseImpl.resolve(value).then(function (unwrapped) {
11057 + result.value = unwrapped, resolve(result);
11058 + }, function (error) {
11059 + return invoke("throw", error, resolve, reject);
11060 + });
11061 + }
11062 + reject(record.arg);
11063 + }
11064 + var previousPromise;
11065 + this._invoke = function (method, arg) {
11066 + function callInvokeWithMethodAndArg() {
11067 + return new PromiseImpl(function (resolve, reject) {
11068 + invoke(method, arg, resolve, reject);
11069 + });
11070 + }
11071 + return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
11072 + };
11073 + }
11074 + function maybeInvokeDelegate(delegate, context) {
11075 + var method = delegate.iterator[context.method];
11076 + if (undefined === method) {
11077 + if (context.delegate = null, "throw" === context.method) {
11078 + if (delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method)) return ContinueSentinel;
11079 + context.method = "throw", context.arg = new TypeError("The iterator does not provide a 'throw' method");
11080 + }
11081 + return ContinueSentinel;
11082 + }
11083 + var record = tryCatch(method, delegate.iterator, context.arg);
11084 + if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
11085 + var info = record.arg;
11086 + 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);
11087 + }
11088 + function pushTryEntry(locs) {
11089 + var entry = {
11090 + tryLoc: locs[0]
11091 + };
11092 + 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
11093 + }
11094 + function resetTryEntry(entry) {
11095 + var record = entry.completion || {};
11096 + record.type = "normal", delete record.arg, entry.completion = record;
11097 + }
11098 + function Context(tryLocsList) {
11099 + this.tryEntries = [{
11100 + tryLoc: "root"
11101 + }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
11102 + }
11103 + function values(iterable) {
11104 + if (iterable) {
11105 + var iteratorMethod = iterable[iteratorSymbol];
11106 + if (iteratorMethod) return iteratorMethod.call(iterable);
11107 + if ("function" == typeof iterable.next) return iterable;
11108 + if (!isNaN(iterable.length)) {
11109 + var i = -1,
11110 + next = function next() {
11111 + for (; ++i < iterable.length;) {
11112 + if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
11113 + }
11114 + return next.value = undefined, next.done = !0, next;
11115 + };
11116 + return next.next = next;
11117 + }
11118 + }
11119 + return {
11120 + next: doneResult
11121 + };
11122 + }
11123 + function doneResult() {
11124 + return {
11125 + value: undefined,
11126 + done: !0
11127 + };
11128 + }
11129 + return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, "constructor", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
11130 + var ctor = "function" == typeof genFun && genFun.constructor;
11131 + return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
11132 + }, exports.mark = function (genFun) {
11133 + return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
11134 + }, exports.awrap = function (arg) {
11135 + return {
11136 + __await: arg
11137 + };
11138 + }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
11139 + return this;
11140 + }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
11141 + void 0 === PromiseImpl && (PromiseImpl = Promise);
11142 + var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
11143 + return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
11144 + return result.done ? result.value : iter.next();
11145 + });
11146 + }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
11147 + return this;
11148 + }), define(Gp, "toString", function () {
11149 + return "[object Generator]";
11150 + }), exports.keys = function (object) {
11151 + var keys = [];
11152 + for (var key in object) {
11153 + keys.push(key);
11154 + }
11155 + return keys.reverse(), function next() {
11156 + for (; keys.length;) {
11157 + var key = keys.pop();
11158 + if (key in object) return next.value = key, next.done = !1, next;
11159 + }
11160 + return next.done = !0, next;
11161 + };
11162 + }, exports.values = values, Context.prototype = {
11163 + constructor: Context,
11164 + reset: function reset(skipTempReset) {
11165 + 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) {
11166 + "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
11167 + }
11168 + },
11169 + stop: function stop() {
11170 + this.done = !0;
11171 + var rootRecord = this.tryEntries[0].completion;
11172 + if ("throw" === rootRecord.type) throw rootRecord.arg;
11173 + return this.rval;
11174 + },
11175 + dispatchException: function dispatchException(exception) {
11176 + if (this.done) throw exception;
11177 + var context = this;
11178 + function handle(loc, caught) {
11179 + return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
11180 + }
11181 + for (var i = this.tryEntries.length - 1; i >= 0; --i) {
11182 + var entry = this.tryEntries[i],
11183 + record = entry.completion;
11184 + if ("root" === entry.tryLoc) return handle("end");
11185 + if (entry.tryLoc <= this.prev) {
11186 + var hasCatch = hasOwn.call(entry, "catchLoc"),
11187 + hasFinally = hasOwn.call(entry, "finallyLoc");
11188 + if (hasCatch && hasFinally) {
11189 + if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
11190 + if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
11191 + } else if (hasCatch) {
11192 + if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
11193 + } else {
11194 + if (!hasFinally) throw new Error("try statement without catch or finally");
11195 + if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
11196 + }
11197 + }
11198 + }
11199 + },
11200 + abrupt: function abrupt(type, arg) {
11201 + for (var i = this.tryEntries.length - 1; i >= 0; --i) {
11202 + var entry = this.tryEntries[i];
11203 + if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
11204 + var finallyEntry = entry;
11205 + break;
11206 + }
11207 + }
11208 + finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
11209 + var record = finallyEntry ? finallyEntry.completion : {};
11210 + return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
11211 + },
11212 + complete: function complete(record, afterLoc) {
11213 + if ("throw" === record.type) throw record.arg;
11214 + 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;
11215 + },
11216 + finish: function finish(finallyLoc) {
11217 + for (var i = this.tryEntries.length - 1; i >= 0; --i) {
11218 + var entry = this.tryEntries[i];
11219 + if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
11220 + }
11221 + },
11222 + "catch": function _catch(tryLoc) {
11223 + for (var i = this.tryEntries.length - 1; i >= 0; --i) {
11224 + var entry = this.tryEntries[i];
11225 + if (entry.tryLoc === tryLoc) {
11226 + var record = entry.completion;
11227 + if ("throw" === record.type) {
11228 + var thrown = record.arg;
11229 + resetTryEntry(entry);
11230 + }
11231 + return thrown;
11232 + }
11233 + }
11234 + throw new Error("illegal catch attempt");
11235 + },
11236 + delegateYield: function delegateYield(iterable, resultName, nextLoc) {
11237 + return this.delegate = {
11238 + iterator: values(iterable),
11239 + resultName: resultName,
11240 + nextLoc: nextLoc
11241 + }, "next" === this.method && (this.arg = undefined), ContinueSentinel;
11242 + }
11243 + }, exports;
11244 +}
11245 +module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;
11246 +
11247 +/***/ }),
11248 +
11249 +/***/ "../node_modules/@babel/runtime/helpers/setPrototypeOf.js":
11250 +/*!****************************************************************!*\
11251 + !*** ../node_modules/@babel/runtime/helpers/setPrototypeOf.js ***!
11252 + \****************************************************************/
11253 +/***/ ((module) => {
11254 +
11255 +function _setPrototypeOf(o, p) {
11256 + module.exports = _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
11257 + o.__proto__ = p;
11258 + return o;
11259 + }, module.exports.__esModule = true, module.exports["default"] = module.exports;
11260 + return _setPrototypeOf(o, p);
11261 +}
11262 +module.exports = _setPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
11263 +
11264 +/***/ }),
11265 +
11266 +/***/ "../node_modules/@babel/runtime/helpers/slicedToArray.js":
11267 +/*!***************************************************************!*\
11268 + !*** ../node_modules/@babel/runtime/helpers/slicedToArray.js ***!
11269 + \***************************************************************/
11270 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
11271 +
11272 +var arrayWithHoles = __webpack_require__(/*! ./arrayWithHoles.js */ "../node_modules/@babel/runtime/helpers/arrayWithHoles.js");
11273 +var iterableToArrayLimit = __webpack_require__(/*! ./iterableToArrayLimit.js */ "../node_modules/@babel/runtime/helpers/iterableToArrayLimit.js");
11274 +var unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray.js */ "../node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js");
11275 +var nonIterableRest = __webpack_require__(/*! ./nonIterableRest.js */ "../node_modules/@babel/runtime/helpers/nonIterableRest.js");
11276 +function _slicedToArray(arr, i) {
11277 + return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();
11278 +}
11279 +module.exports = _slicedToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
11280 +
11281 +/***/ }),
11282 +
11283 +/***/ "../node_modules/@babel/runtime/helpers/superPropBase.js":
11284 +/*!***************************************************************!*\
11285 + !*** ../node_modules/@babel/runtime/helpers/superPropBase.js ***!
11286 + \***************************************************************/
11287 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
11288 +
11289 +var getPrototypeOf = __webpack_require__(/*! ./getPrototypeOf.js */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js");
11290 +function _superPropBase(object, property) {
11291 + while (!Object.prototype.hasOwnProperty.call(object, property)) {
11292 + object = getPrototypeOf(object);
11293 + if (object === null) break;
11294 + }
11295 + return object;
11296 +}
11297 +module.exports = _superPropBase, module.exports.__esModule = true, module.exports["default"] = module.exports;
11298 +
11299 +/***/ }),
11300 +
11301 +/***/ "../node_modules/@babel/runtime/helpers/typeof.js":
11302 +/*!********************************************************!*\
11303 + !*** ../node_modules/@babel/runtime/helpers/typeof.js ***!
11304 + \********************************************************/
11305 +/***/ ((module) => {
11306 +
11307 +function _typeof(obj) {
11308 + "@babel/helpers - typeof";
11309 +
11310 + return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
11311 + return typeof obj;
11312 + } : function (obj) {
11313 + return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
11314 + }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(obj);
11315 +}
11316 +module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
11317 +
11318 +/***/ }),
11319 +
11320 +/***/ "../node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js":
11321 +/*!****************************************************************************!*\
11322 + !*** ../node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js ***!
11323 + \****************************************************************************/
11324 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
11325 +
11326 +var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray.js */ "../node_modules/@babel/runtime/helpers/arrayLikeToArray.js");
11327 +function _unsupportedIterableToArray(o, minLen) {
11328 + if (!o) return;
11329 + if (typeof o === "string") return arrayLikeToArray(o, minLen);
11330 + var n = Object.prototype.toString.call(o).slice(8, -1);
11331 + if (n === "Object" && o.constructor) n = o.constructor.name;
11332 + if (n === "Map" || n === "Set") return Array.from(o);
11333 + if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);
11334 +}
11335 +module.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
11336 +
11337 +/***/ }),
11338 +
11339 +/***/ "../node_modules/@babel/runtime/helpers/wrapNativeSuper.js":
11340 +/*!*****************************************************************!*\
11341 + !*** ../node_modules/@babel/runtime/helpers/wrapNativeSuper.js ***!
11342 + \*****************************************************************/
11343 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
11344 +
11345 +var getPrototypeOf = __webpack_require__(/*! ./getPrototypeOf.js */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js");
11346 +var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ "../node_modules/@babel/runtime/helpers/setPrototypeOf.js");
11347 +var isNativeFunction = __webpack_require__(/*! ./isNativeFunction.js */ "../node_modules/@babel/runtime/helpers/isNativeFunction.js");
11348 +var construct = __webpack_require__(/*! ./construct.js */ "../node_modules/@babel/runtime/helpers/construct.js");
11349 +function _wrapNativeSuper(Class) {
11350 + var _cache = typeof Map === "function" ? new Map() : undefined;
11351 + module.exports = _wrapNativeSuper = function _wrapNativeSuper(Class) {
11352 + if (Class === null || !isNativeFunction(Class)) return Class;
11353 + if (typeof Class !== "function") {
11354 + throw new TypeError("Super expression must either be null or a function");
11355 + }
11356 + if (typeof _cache !== "undefined") {
11357 + if (_cache.has(Class)) return _cache.get(Class);
11358 + _cache.set(Class, Wrapper);
11359 + }
11360 + function Wrapper() {
11361 + return construct(Class, arguments, getPrototypeOf(this).constructor);
11362 + }
11363 + Wrapper.prototype = Object.create(Class.prototype, {
11364 + constructor: {
11365 + value: Wrapper,
11366 + enumerable: false,
11367 + writable: true,
11368 + configurable: true
11369 + }
11370 + });
11371 + return setPrototypeOf(Wrapper, Class);
11372 + }, module.exports.__esModule = true, module.exports["default"] = module.exports;
11373 + return _wrapNativeSuper(Class);
11374 +}
11375 +module.exports = _wrapNativeSuper, module.exports.__esModule = true, module.exports["default"] = module.exports;
11376 +
11377 +/***/ }),
11378 +
11379 +/***/ "../node_modules/@babel/runtime/regenerator/index.js":
11380 +/*!***********************************************************!*\
11381 + !*** ../node_modules/@babel/runtime/regenerator/index.js ***!
11382 + \***********************************************************/
11383 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
11384 +
11385 +// TODO(Babel 8): Remove this file.
11386 +
11387 +var runtime = __webpack_require__(/*! ../helpers/regeneratorRuntime */ "../node_modules/@babel/runtime/helpers/regeneratorRuntime.js")();
11388 +module.exports = runtime;
11389 +
11390 +// Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736=
11391 +try {
11392 + regeneratorRuntime = runtime;
11393 +} catch (accidentalStrictMode) {
11394 + if (typeof globalThis === "object") {
11395 + globalThis.regeneratorRuntime = runtime;
11396 + } else {
11397 + Function("r", "regeneratorRuntime = r")(runtime);
11398 + }
11399 +}
11400 +
11401 +
11402 +/***/ }),
11403 +
11404 +/***/ "../node_modules/@babel/runtime/helpers/esm/defineProperty.js":
11405 +/*!********************************************************************!*\
11406 + !*** ../node_modules/@babel/runtime/helpers/esm/defineProperty.js ***!
11407 + \********************************************************************/
11408 +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
11409 +
11410 +"use strict";
11411 +__webpack_require__.r(__webpack_exports__);
11412 +/* harmony export */ __webpack_require__.d(__webpack_exports__, {
11413 +/* harmony export */ "default": () => (/* binding */ _defineProperty)
11414 +/* harmony export */ });
11415 +function _defineProperty(obj, key, value) {
11416 + if (key in obj) {
11417 + Object.defineProperty(obj, key, {
11418 + value: value,
11419 + enumerable: true,
11420 + configurable: true,
11421 + writable: true
11422 + });
11423 + } else {
11424 + obj[key] = value;
11425 + }
11426 + return obj;
11427 +}
11428 +
11429 +/***/ }),
11430 +
11431 +/***/ "../node_modules/@babel/runtime/helpers/esm/objectSpread2.js":
11432 +/*!*******************************************************************!*\
11433 + !*** ../node_modules/@babel/runtime/helpers/esm/objectSpread2.js ***!
11434 + \*******************************************************************/
11435 +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
11436 +
11437 +"use strict";
11438 +__webpack_require__.r(__webpack_exports__);
11439 +/* harmony export */ __webpack_require__.d(__webpack_exports__, {
11440 +/* harmony export */ "default": () => (/* binding */ _objectSpread2)
11441 +/* harmony export */ });
11442 +/* harmony import */ var _defineProperty_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./defineProperty.js */ "../node_modules/@babel/runtime/helpers/esm/defineProperty.js");
11443 +
11444 +function ownKeys(object, enumerableOnly) {
11445 + var keys = Object.keys(object);
11446 + if (Object.getOwnPropertySymbols) {
11447 + var symbols = Object.getOwnPropertySymbols(object);
11448 + enumerableOnly && (symbols = symbols.filter(function (sym) {
11449 + return Object.getOwnPropertyDescriptor(object, sym).enumerable;
11450 + })), keys.push.apply(keys, symbols);
11451 + }
11452 + return keys;
11453 +}
11454 +function _objectSpread2(target) {
11455 + for (var i = 1; i < arguments.length; i++) {
11456 + var source = null != arguments[i] ? arguments[i] : {};
11457 + i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
11458 + (0,_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(target, key, source[key]);
11459 + }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
11460 + Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
11461 + });
11462 + }
11463 + return target;
11464 +}
11465 +
11466 +/***/ }),
11467 +
11468 +/***/ "../node_modules/immer/dist/immer.esm.mjs":
11469 +/*!************************************************!*\
11470 + !*** ../node_modules/immer/dist/immer.esm.mjs ***!
11471 + \************************************************/
11472 +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
11473 +
11474 +"use strict";
11475 +__webpack_require__.r(__webpack_exports__);
11476 +/* harmony export */ __webpack_require__.d(__webpack_exports__, {
11477 +/* harmony export */ "Immer": () => (/* binding */ un),
11478 +/* harmony export */ "applyPatches": () => (/* binding */ pn),
11479 +/* harmony export */ "castDraft": () => (/* binding */ K),
11480 +/* harmony export */ "castImmutable": () => (/* binding */ $),
11481 +/* harmony export */ "createDraft": () => (/* binding */ ln),
11482 +/* harmony export */ "current": () => (/* binding */ D),
11483 +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
11484 +/* harmony export */ "enableAllPlugins": () => (/* binding */ J),
11485 +/* harmony export */ "enableES5": () => (/* binding */ N),
11486 +/* harmony export */ "enableMapSet": () => (/* binding */ C),
11487 +/* harmony export */ "enablePatches": () => (/* binding */ T),
11488 +/* harmony export */ "finishDraft": () => (/* binding */ dn),
11489 +/* harmony export */ "freeze": () => (/* binding */ d),
11490 +/* harmony export */ "immerable": () => (/* binding */ L),
11491 +/* harmony export */ "isDraft": () => (/* binding */ r),
11492 +/* harmony export */ "isDraftable": () => (/* binding */ t),
11493 +/* harmony export */ "nothing": () => (/* binding */ H),
11494 +/* harmony export */ "original": () => (/* binding */ e),
11495 +/* harmony export */ "produce": () => (/* binding */ fn),
11496 +/* harmony export */ "produceWithPatches": () => (/* binding */ cn),
11497 +/* harmony export */ "setAutoFreeze": () => (/* binding */ sn),
11498 +/* harmony export */ "setUseProxies": () => (/* binding */ vn)
11499 +/* harmony export */ });
11500 +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){var r;return!!n&&(function(n){if(!n||"object"!=typeof n)return!1;var r=Object.getPrototypeOf(n);if(null===r)return!0;var t=Object.hasOwnProperty.call(r,"constructor")&&r.constructor;return t===Object||"function"==typeof t&&Function.toString.call(t)===Z}(n)||Array.isArray(n)||!!n[L]||!!(null===(r=n.constructor)||void 0===r?void 0:r[L])||s(n)||v(n))}function e(t){return r(t)||n(23,t),t[Q].t}function i(n,r,t){void 0===t&&(t=!1),0===o(n)?(t?Object.keys:nn)(n).forEach((function(e){t&&"symbol"==typeof e||r(e,n[e],n)})):n.forEach((function(t,e){return r(e,t,n)}))}function o(n){var r=n[Q];return r?r.i>3?r.i-4:r.i:Array.isArray(n)?1:s(n)?2:v(n)?3:0}function u(n,r){return 2===o(n)?n.has(r):Object.prototype.hasOwnProperty.call(n,r)}function a(n,r){return 2===o(n)?n.get(r):n[r]}function f(n,r,t){var e=o(n);2===e?n.set(r,t):3===e?(n.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);
11501 +//# sourceMappingURL=immer.esm.js.map
11502 +
11503 +
11504 +/***/ })
11505 +
11506 +/******/ });
11507 +/************************************************************************/
11508 +/******/ // The module cache
11509 +/******/ var __webpack_module_cache__ = {};
11510 +/******/
11511 +/******/ // The require function
11512 +/******/ function __webpack_require__(moduleId) {
11513 +/******/ // Check if module is in cache
11514 +/******/ var cachedModule = __webpack_module_cache__[moduleId];
11515 +/******/ if (cachedModule !== undefined) {
11516 +/******/ return cachedModule.exports;
11517 +/******/ }
11518 +/******/ // Create a new module (and put it into the cache)
11519 +/******/ var module = __webpack_module_cache__[moduleId] = {
11520 +/******/ // no module.id needed
11521 +/******/ // no module.loaded needed
11522 +/******/ exports: {}
11523 +/******/ };
11524 +/******/
11525 +/******/ // Execute the module function
11526 +/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
11527 +/******/
11528 +/******/ // Return the exports of the module
11529 +/******/ return module.exports;
11530 +/******/ }
11531 +/******/
11532 +/************************************************************************/
11533 +/******/ /* webpack/runtime/define property getters */
11534 +/******/ (() => {
11535 +/******/ // define getter functions for harmony exports
11536 +/******/ __webpack_require__.d = (exports, definition) => {
11537 +/******/ for(var key in definition) {
11538 +/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
11539 +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
11540 +/******/ }
11541 +/******/ }
11542 +/******/ };
11543 +/******/ })();
11544 +/******/
11545 +/******/ /* webpack/runtime/hasOwnProperty shorthand */
11546 +/******/ (() => {
11547 +/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
11548 +/******/ })();
11549 +/******/
11550 +/******/ /* webpack/runtime/make namespace object */
11551 +/******/ (() => {
11552 +/******/ // define __esModule on exports
11553 +/******/ __webpack_require__.r = (exports) => {
11554 +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
11555 +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
11556 +/******/ }
11557 +/******/ Object.defineProperty(exports, '__esModule', { value: true });
11558 +/******/ };
11559 +/******/ })();
11560 +/******/
11561 +/************************************************************************/
11562 +var __webpack_exports__ = {};
11563 +// This entry need to be wrapped in an IIFE because it need to be in strict mode.
11564 +(() => {
11565 +"use strict";
11566 +/*!*********************************************!*\
11567 + !*** ../modules/web-cli/assets/js/index.js ***!
11568 + \*********************************************/
11569 +
11570 +
11571 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
11572 +var _api = _interopRequireDefault(__webpack_require__(/*! ./api */ "../modules/web-cli/assets/js/api.js"));
11573 +window.$e = new _api.default();
11574 +})();
11575 +
11576 +/******/ })()
11577 +;
5912 11578 //# sourceMappingURL=web-cli.js.map