PluginProbe
Elementor Website Builder – more than just a page builder / 3.13.2
Elementor Website Builder – more than just a page builder v3.13.2
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 +11817 -5813 4.3.0-beta33.13.2 View file →
@@ -1,5912 +1,11916 @@
1 -(function(_reduxjs_toolkit) {
1 +/*! elementor - v3.13.2 - 11-05-2023 */
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 */ "EnhancerArray": () => (/* binding */ EnhancerArray),
15 +/* harmony export */ "MiddlewareArray": () => (/* binding */ MiddlewareArray),
16 +/* harmony export */ "SHOULD_AUTOBATCH": () => (/* binding */ SHOULD_AUTOBATCH),
17 +/* harmony export */ "TaskAbortError": () => (/* binding */ TaskAbortError),
18 +/* harmony export */ "__DO_NOT_USE__ActionTypes": () => (/* reexport safe */ redux__WEBPACK_IMPORTED_MODULE_0__.__DO_NOT_USE__ActionTypes),
19 +/* harmony export */ "addListener": () => (/* binding */ addListener),
20 +/* harmony export */ "applyMiddleware": () => (/* reexport safe */ redux__WEBPACK_IMPORTED_MODULE_0__.applyMiddleware),
21 +/* harmony export */ "autoBatchEnhancer": () => (/* binding */ autoBatchEnhancer),
22 +/* harmony export */ "bindActionCreators": () => (/* reexport safe */ redux__WEBPACK_IMPORTED_MODULE_0__.bindActionCreators),
23 +/* harmony export */ "clearAllListeners": () => (/* binding */ clearAllListeners),
24 +/* harmony export */ "combineReducers": () => (/* reexport safe */ redux__WEBPACK_IMPORTED_MODULE_0__.combineReducers),
25 +/* harmony export */ "compose": () => (/* reexport safe */ redux__WEBPACK_IMPORTED_MODULE_0__.compose),
26 +/* harmony export */ "configureStore": () => (/* binding */ configureStore),
27 +/* harmony export */ "createAction": () => (/* binding */ createAction),
28 +/* harmony export */ "createAsyncThunk": () => (/* binding */ createAsyncThunk),
29 +/* harmony export */ "createDraftSafeSelector": () => (/* binding */ createDraftSafeSelector),
30 +/* harmony export */ "createEntityAdapter": () => (/* binding */ createEntityAdapter),
31 +/* harmony export */ "createImmutableStateInvariantMiddleware": () => (/* binding */ createImmutableStateInvariantMiddleware),
32 +/* harmony export */ "createListenerMiddleware": () => (/* binding */ createListenerMiddleware),
33 +/* harmony export */ "createNextState": () => (/* reexport safe */ immer__WEBPACK_IMPORTED_MODULE_2__["default"]),
34 +/* harmony export */ "createReducer": () => (/* binding */ createReducer),
35 +/* harmony export */ "createSelector": () => (/* reexport safe */ reselect__WEBPACK_IMPORTED_MODULE_1__.createSelector),
36 +/* harmony export */ "createSerializableStateInvariantMiddleware": () => (/* binding */ createSerializableStateInvariantMiddleware),
37 +/* harmony export */ "createSlice": () => (/* binding */ createSlice),
38 +/* harmony export */ "createStore": () => (/* reexport safe */ redux__WEBPACK_IMPORTED_MODULE_0__.createStore),
39 +/* harmony export */ "current": () => (/* reexport safe */ immer__WEBPACK_IMPORTED_MODULE_2__.current),
40 +/* harmony export */ "findNonSerializableValue": () => (/* binding */ findNonSerializableValue),
41 +/* harmony export */ "freeze": () => (/* reexport safe */ immer__WEBPACK_IMPORTED_MODULE_2__.freeze),
42 +/* harmony export */ "getDefaultMiddleware": () => (/* binding */ getDefaultMiddleware),
43 +/* harmony export */ "getType": () => (/* binding */ getType),
44 +/* harmony export */ "isAction": () => (/* binding */ isAction),
45 +/* harmony export */ "isAllOf": () => (/* binding */ isAllOf),
46 +/* harmony export */ "isAnyOf": () => (/* binding */ isAnyOf),
47 +/* harmony export */ "isAsyncThunkAction": () => (/* binding */ isAsyncThunkAction),
48 +/* harmony export */ "isDraft": () => (/* reexport safe */ immer__WEBPACK_IMPORTED_MODULE_2__.isDraft),
49 +/* harmony export */ "isFluxStandardAction": () => (/* binding */ isFSA),
50 +/* harmony export */ "isFulfilled": () => (/* binding */ isFulfilled),
51 +/* harmony export */ "isImmutableDefault": () => (/* binding */ isImmutableDefault),
52 +/* harmony export */ "isPending": () => (/* binding */ isPending),
53 +/* harmony export */ "isPlain": () => (/* binding */ isPlain),
54 +/* harmony export */ "isPlainObject": () => (/* binding */ isPlainObject),
55 +/* harmony export */ "isRejected": () => (/* binding */ isRejected),
56 +/* harmony export */ "isRejectedWithValue": () => (/* binding */ isRejectedWithValue),
57 +/* harmony export */ "legacy_createStore": () => (/* reexport safe */ redux__WEBPACK_IMPORTED_MODULE_0__.legacy_createStore),
58 +/* harmony export */ "miniSerializeError": () => (/* binding */ miniSerializeError),
59 +/* harmony export */ "nanoid": () => (/* binding */ nanoid),
60 +/* harmony export */ "original": () => (/* reexport safe */ immer__WEBPACK_IMPORTED_MODULE_2__.original),
61 +/* harmony export */ "prepareAutoBatched": () => (/* binding */ prepareAutoBatched),
62 +/* harmony export */ "removeListener": () => (/* binding */ removeListener),
63 +/* harmony export */ "unwrapResult": () => (/* binding */ unwrapResult)
64 +/* harmony export */ });
65 +/* harmony import */ var immer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! immer */ "../node_modules/immer/dist/immer.esm.mjs");
66 +/* harmony import */ var redux__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! redux */ "../node_modules/redux/es/redux.js");
67 +/* harmony import */ var reselect__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! reselect */ "../node_modules/reselect/es/index.js");
68 +/* harmony import */ var redux_thunk__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! redux-thunk */ "../node_modules/redux-thunk/es/index.js");
69 +var __extends = (undefined && undefined.__extends) || (function () {
70 + var extendStatics = function (d, b) {
71 + extendStatics = Object.setPrototypeOf ||
72 + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
73 + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
74 + return extendStatics(d, b);
75 + };
76 + return function (d, b) {
77 + if (typeof b !== "function" && b !== null)
78 + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
79 + extendStatics(d, b);
80 + function __() { this.constructor = d; }
81 + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
82 + };
83 +})();
84 +var __generator = (undefined && undefined.__generator) || function (thisArg, body) {
85 + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
86 + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
87 + function verb(n) { return function (v) { return step([n, v]); }; }
88 + function step(op) {
89 + if (f) throw new TypeError("Generator is already executing.");
90 + while (_) try {
91 + 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;
92 + if (y = 0, t) op = [op[0] & 2, t.value];
93 + switch (op[0]) {
94 + case 0: case 1: t = op; break;
95 + case 4: _.label++; return { value: op[1], done: false };
96 + case 5: _.label++; y = op[1]; op = [0]; continue;
97 + case 7: op = _.ops.pop(); _.trys.pop(); continue;
98 + default:
99 + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
100 + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
101 + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
102 + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
103 + if (t[2]) _.ops.pop();
104 + _.trys.pop(); continue;
105 + }
106 + op = body.call(thisArg, _);
107 + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
108 + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
109 + }
110 +};
111 +var __spreadArray = (undefined && undefined.__spreadArray) || function (to, from) {
112 + for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
113 + to[j] = from[i];
114 + return to;
115 +};
116 +var __defProp = Object.defineProperty;
117 +var __defProps = Object.defineProperties;
118 +var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
119 +var __getOwnPropSymbols = Object.getOwnPropertySymbols;
120 +var __hasOwnProp = Object.prototype.hasOwnProperty;
121 +var __propIsEnum = Object.prototype.propertyIsEnumerable;
122 +var __defNormalProp = function (obj, key, value) { return key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value: value }) : obj[key] = value; };
123 +var __spreadValues = function (a, b) {
124 + for (var prop in b || (b = {}))
125 + if (__hasOwnProp.call(b, prop))
126 + __defNormalProp(a, prop, b[prop]);
127 + if (__getOwnPropSymbols)
128 + for (var _i = 0, _c = __getOwnPropSymbols(b); _i < _c.length; _i++) {
129 + var prop = _c[_i];
130 + if (__propIsEnum.call(b, prop))
131 + __defNormalProp(a, prop, b[prop]);
132 + }
133 + return a;
134 +};
135 +var __spreadProps = function (a, b) { return __defProps(a, __getOwnPropDescs(b)); };
136 +var __async = function (__this, __arguments, generator) {
137 + return new Promise(function (resolve, reject) {
138 + var fulfilled = function (value) {
139 + try {
140 + step(generator.next(value));
141 + }
142 + catch (e) {
143 + reject(e);
144 + }
145 + };
146 + var rejected = function (value) {
147 + try {
148 + step(generator.throw(value));
149 + }
150 + catch (e) {
151 + reject(e);
152 + }
153 + };
154 + var step = function (x) { return x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected); };
155 + step((generator = generator.apply(__this, __arguments)).next());
156 + });
157 +};
158 +// src/index.ts
159 +
160 +
161 +
162 +
163 +// src/createDraftSafeSelector.ts
164 +
165 +
166 +var createDraftSafeSelector = function () {
167 + var args = [];
168 + for (var _i = 0; _i < arguments.length; _i++) {
169 + args[_i] = arguments[_i];
170 + }
171 + var selector = reselect__WEBPACK_IMPORTED_MODULE_1__.createSelector.apply(void 0, args);
172 + var wrappedSelector = function (value) {
173 + var rest = [];
174 + for (var _i = 1; _i < arguments.length; _i++) {
175 + rest[_i - 1] = arguments[_i];
176 + }
177 + return selector.apply(void 0, __spreadArray([(0,immer__WEBPACK_IMPORTED_MODULE_2__.isDraft)(value) ? (0,immer__WEBPACK_IMPORTED_MODULE_2__.current)(value) : value], rest));
178 + };
179 + return wrappedSelector;
180 +};
181 +// src/configureStore.ts
182 +
183 +// src/devtoolsExtension.ts
184 +
185 +var composeWithDevTools = typeof window !== "undefined" && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ ? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ : function () {
186 + if (arguments.length === 0)
187 + return void 0;
188 + if (typeof arguments[0] === "object")
189 + return redux__WEBPACK_IMPORTED_MODULE_0__.compose;
190 + return redux__WEBPACK_IMPORTED_MODULE_0__.compose.apply(null, arguments);
191 +};
192 +var devToolsEnhancer = typeof window !== "undefined" && window.__REDUX_DEVTOOLS_EXTENSION__ ? window.__REDUX_DEVTOOLS_EXTENSION__ : function () {
193 + return function (noop2) {
194 + return noop2;
195 + };
196 +};
197 +// src/isPlainObject.ts
198 +function isPlainObject(value) {
199 + if (typeof value !== "object" || value === null)
200 + return false;
201 + var proto = Object.getPrototypeOf(value);
202 + if (proto === null)
203 + return true;
204 + var baseProto = proto;
205 + while (Object.getPrototypeOf(baseProto) !== null) {
206 + baseProto = Object.getPrototypeOf(baseProto);
207 + }
208 + return proto === baseProto;
209 +}
210 +// src/getDefaultMiddleware.ts
211 +
212 +// src/utils.ts
213 +
214 +function getTimeMeasureUtils(maxDelay, fnName) {
215 + var elapsed = 0;
216 + return {
217 + measureTime: function (fn) {
218 + var started = Date.now();
219 + try {
220 + return fn();
221 + }
222 + finally {
223 + var finished = Date.now();
224 + elapsed += finished - started;
225 + }
226 + },
227 + warnIfExceeded: function () {
228 + if (elapsed > maxDelay) {
229 + 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.");
230 + }
231 + }
232 + };
233 +}
234 +var MiddlewareArray = /** @class */ (function (_super) {
235 + __extends(MiddlewareArray, _super);
236 + function MiddlewareArray() {
237 + var args = [];
238 + for (var _i = 0; _i < arguments.length; _i++) {
239 + args[_i] = arguments[_i];
240 + }
241 + var _this = _super.apply(this, args) || this;
242 + Object.setPrototypeOf(_this, MiddlewareArray.prototype);
243 + return _this;
244 + }
245 + Object.defineProperty(MiddlewareArray, Symbol.species, {
246 + get: function () {
247 + return MiddlewareArray;
248 + },
249 + enumerable: false,
250 + configurable: true
251 + });
252 + MiddlewareArray.prototype.concat = function () {
253 + var arr = [];
254 + for (var _i = 0; _i < arguments.length; _i++) {
255 + arr[_i] = arguments[_i];
256 + }
257 + return _super.prototype.concat.apply(this, arr);
258 + };
259 + MiddlewareArray.prototype.prepend = function () {
260 + var arr = [];
261 + for (var _i = 0; _i < arguments.length; _i++) {
262 + arr[_i] = arguments[_i];
263 + }
264 + if (arr.length === 1 && Array.isArray(arr[0])) {
265 + return new (MiddlewareArray.bind.apply(MiddlewareArray, __spreadArray([void 0], arr[0].concat(this))))();
266 + }
267 + return new (MiddlewareArray.bind.apply(MiddlewareArray, __spreadArray([void 0], arr.concat(this))))();
268 + };
269 + return MiddlewareArray;
270 +}(Array));
271 +var EnhancerArray = /** @class */ (function (_super) {
272 + __extends(EnhancerArray, _super);
273 + function EnhancerArray() {
274 + var args = [];
275 + for (var _i = 0; _i < arguments.length; _i++) {
276 + args[_i] = arguments[_i];
277 + }
278 + var _this = _super.apply(this, args) || this;
279 + Object.setPrototypeOf(_this, EnhancerArray.prototype);
280 + return _this;
281 + }
282 + Object.defineProperty(EnhancerArray, Symbol.species, {
283 + get: function () {
284 + return EnhancerArray;
285 + },
286 + enumerable: false,
287 + configurable: true
288 + });
289 + EnhancerArray.prototype.concat = function () {
290 + var arr = [];
291 + for (var _i = 0; _i < arguments.length; _i++) {
292 + arr[_i] = arguments[_i];
293 + }
294 + return _super.prototype.concat.apply(this, arr);
295 + };
296 + EnhancerArray.prototype.prepend = function () {
297 + var arr = [];
298 + for (var _i = 0; _i < arguments.length; _i++) {
299 + arr[_i] = arguments[_i];
300 + }
301 + if (arr.length === 1 && Array.isArray(arr[0])) {
302 + return new (EnhancerArray.bind.apply(EnhancerArray, __spreadArray([void 0], arr[0].concat(this))))();
303 + }
304 + return new (EnhancerArray.bind.apply(EnhancerArray, __spreadArray([void 0], arr.concat(this))))();
305 + };
306 + return EnhancerArray;
307 +}(Array));
308 +function freezeDraftable(val) {
309 + return (0,immer__WEBPACK_IMPORTED_MODULE_2__.isDraftable)(val) ? (0,immer__WEBPACK_IMPORTED_MODULE_2__["default"])(val, function () {
310 + }) : val;
311 +}
312 +// src/immutableStateInvariantMiddleware.ts
313 +var isProduction = "development" === "production";
314 +var prefix = "Invariant failed";
315 +function invariant(condition, message) {
316 + if (condition) {
317 + return;
318 + }
319 + if (isProduction) {
320 + throw new Error(prefix);
321 + }
322 + throw new Error(prefix + ": " + (message || ""));
323 +}
324 +function stringify(obj, serializer, indent, decycler) {
325 + return JSON.stringify(obj, getSerialize(serializer, decycler), indent);
326 +}
327 +function getSerialize(serializer, decycler) {
328 + var stack = [], keys = [];
329 + if (!decycler)
330 + decycler = function (_, value) {
331 + if (stack[0] === value)
332 + return "[Circular ~]";
333 + return "[Circular ~." + keys.slice(0, stack.indexOf(value)).join(".") + "]";
334 + };
335 + return function (key, value) {
336 + if (stack.length > 0) {
337 + var thisPos = stack.indexOf(this);
338 + ~thisPos ? stack.splice(thisPos + 1) : stack.push(this);
339 + ~thisPos ? keys.splice(thisPos, Infinity, key) : keys.push(key);
340 + if (~stack.indexOf(value))
341 + value = decycler.call(this, key, value);
342 + }
343 + else
344 + stack.push(value);
345 + return serializer == null ? value : serializer.call(this, key, value);
346 + };
347 +}
348 +function isImmutableDefault(value) {
349 + return typeof value !== "object" || value == null || Object.isFrozen(value);
350 +}
351 +function trackForMutations(isImmutable, ignorePaths, obj) {
352 + var trackedProperties = trackProperties(isImmutable, ignorePaths, obj);
353 + return {
354 + detectMutations: function () {
355 + return detectMutations(isImmutable, ignorePaths, trackedProperties, obj);
356 + }
357 + };
358 +}
359 +function trackProperties(isImmutable, ignorePaths, obj, path) {
360 + if (ignorePaths === void 0) { ignorePaths = []; }
361 + if (path === void 0) { path = ""; }
362 + var tracked = { value: obj };
363 + if (!isImmutable(obj)) {
364 + tracked.children = {};
365 + for (var key in obj) {
366 + var childPath = path ? path + "." + key : key;
367 + if (ignorePaths.length && ignorePaths.indexOf(childPath) !== -1) {
368 + continue;
369 + }
370 + tracked.children[key] = trackProperties(isImmutable, ignorePaths, obj[key], childPath);
371 + }
372 + }
373 + return tracked;
374 +}
375 +function detectMutations(isImmutable, ignoredPaths, trackedProperty, obj, sameParentRef, path) {
376 + if (ignoredPaths === void 0) { ignoredPaths = []; }
377 + if (sameParentRef === void 0) { sameParentRef = false; }
378 + if (path === void 0) { path = ""; }
379 + var prevObj = trackedProperty ? trackedProperty.value : void 0;
380 + var sameRef = prevObj === obj;
381 + if (sameParentRef && !sameRef && !Number.isNaN(obj)) {
382 + return { wasMutated: true, path: path };
383 + }
384 + if (isImmutable(prevObj) || isImmutable(obj)) {
385 + return { wasMutated: false };
386 + }
387 + var keysToDetect = {};
388 + for (var key in trackedProperty.children) {
389 + keysToDetect[key] = true;
390 + }
391 + for (var key in obj) {
392 + keysToDetect[key] = true;
393 + }
394 + var hasIgnoredPaths = ignoredPaths.length > 0;
395 + var _loop_1 = function (key) {
396 + var nestedPath = path ? path + "." + key : key;
397 + if (hasIgnoredPaths) {
398 + var hasMatches = ignoredPaths.some(function (ignored) {
399 + if (ignored instanceof RegExp) {
400 + return ignored.test(nestedPath);
401 + }
402 + return nestedPath === ignored;
403 + });
404 + if (hasMatches) {
405 + return "continue";
406 + }
407 + }
408 + var result = detectMutations(isImmutable, ignoredPaths, trackedProperty.children[key], obj[key], sameRef, nestedPath);
409 + if (result.wasMutated) {
410 + return { value: result };
411 + }
412 + };
413 + for (var key in keysToDetect) {
414 + var state_1 = _loop_1(key);
415 + if (typeof state_1 === "object")
416 + return state_1.value;
417 + }
418 + return { wasMutated: false };
419 +}
420 +function createImmutableStateInvariantMiddleware(options) {
421 + if (options === void 0) { options = {}; }
422 + if (false) {}
423 + 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;
424 + ignoredPaths = ignoredPaths || ignore;
425 + var track = trackForMutations.bind(null, isImmutable, ignoredPaths);
426 + return function (_c) {
427 + var getState = _c.getState;
428 + var state = getState();
429 + var tracker = track(state);
430 + var result;
431 + return function (next) { return function (action) {
432 + var measureUtils = getTimeMeasureUtils(warnAfter, "ImmutableStateInvariantMiddleware");
433 + measureUtils.measureTime(function () {
434 + state = getState();
435 + result = tracker.detectMutations();
436 + tracker = track(state);
437 + 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)");
438 + });
439 + var dispatchedAction = next(action);
440 + measureUtils.measureTime(function () {
441 + state = getState();
442 + result = tracker.detectMutations();
443 + tracker = track(state);
444 + 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)");
445 + });
446 + measureUtils.warnIfExceeded();
447 + return dispatchedAction;
448 + }; };
449 + };
450 +}
451 +// src/serializableStateInvariantMiddleware.ts
452 +function isPlain(val) {
453 + var type = typeof val;
454 + return val == null || type === "string" || type === "boolean" || type === "number" || Array.isArray(val) || isPlainObject(val);
455 +}
456 +function findNonSerializableValue(value, path, isSerializable, getEntries, ignoredPaths, cache) {
457 + if (path === void 0) { path = ""; }
458 + if (isSerializable === void 0) { isSerializable = isPlain; }
459 + if (ignoredPaths === void 0) { ignoredPaths = []; }
460 + var foundNestedSerializable;
461 + if (!isSerializable(value)) {
462 + return {
463 + keyPath: path || "<root>",
464 + value: value
465 + };
466 + }
467 + if (typeof value !== "object" || value === null) {
468 + return false;
469 + }
470 + if (cache == null ? void 0 : cache.has(value))
471 + return false;
472 + var entries = getEntries != null ? getEntries(value) : Object.entries(value);
473 + var hasIgnoredPaths = ignoredPaths.length > 0;
474 + var _loop_2 = function (key, nestedValue) {
475 + var nestedPath = path ? path + "." + key : key;
476 + if (hasIgnoredPaths) {
477 + var hasMatches = ignoredPaths.some(function (ignored) {
478 + if (ignored instanceof RegExp) {
479 + return ignored.test(nestedPath);
480 + }
481 + return nestedPath === ignored;
482 + });
483 + if (hasMatches) {
484 + return "continue";
485 + }
486 + }
487 + if (!isSerializable(nestedValue)) {
488 + return { value: {
489 + keyPath: nestedPath,
490 + value: nestedValue
491 + } };
492 + }
493 + if (typeof nestedValue === "object") {
494 + foundNestedSerializable = findNonSerializableValue(nestedValue, nestedPath, isSerializable, getEntries, ignoredPaths, cache);
495 + if (foundNestedSerializable) {
496 + return { value: foundNestedSerializable };
497 + }
498 + }
499 + };
500 + for (var _i = 0, entries_1 = entries; _i < entries_1.length; _i++) {
501 + var _c = entries_1[_i], key = _c[0], nestedValue = _c[1];
502 + var state_2 = _loop_2(key, nestedValue);
503 + if (typeof state_2 === "object")
504 + return state_2.value;
505 + }
506 + if (cache && isNestedFrozen(value))
507 + cache.add(value);
508 + return false;
509 +}
510 +function isNestedFrozen(value) {
511 + if (!Object.isFrozen(value))
512 + return false;
513 + for (var _i = 0, _c = Object.values(value); _i < _c.length; _i++) {
514 + var nestedValue = _c[_i];
515 + if (typeof nestedValue !== "object" || nestedValue === null)
516 + continue;
517 + if (!isNestedFrozen(nestedValue))
518 + return false;
519 + }
520 + return true;
521 +}
522 +function createSerializableStateInvariantMiddleware(options) {
523 + if (options === void 0) { options = {}; }
524 + if (false) {}
525 + var _c = options.isSerializable, isSerializable = _c === void 0 ? isPlain : _c, getEntries = options.getEntries, _d = options.ignoredActions, ignoredActions = _d === void 0 ? [] : _d, _e = options.ignoredActionPaths, ignoredActionPaths = _e === void 0 ? ["meta.arg", "meta.baseQueryMeta"] : _e, _f = options.ignoredPaths, ignoredPaths = _f === void 0 ? [] : _f, _g = options.warnAfter, warnAfter = _g === void 0 ? 32 : _g, _h = options.ignoreState, ignoreState = _h === void 0 ? false : _h, _j = options.ignoreActions, ignoreActions = _j === void 0 ? false : _j, _k = options.disableCache, disableCache = _k === void 0 ? false : _k;
526 + var cache = !disableCache && WeakSet ? new WeakSet() : void 0;
527 + return function (storeAPI) { return function (next) { return function (action) {
528 + var result = next(action);
529 + var measureUtils = getTimeMeasureUtils(warnAfter, "SerializableStateInvariantMiddleware");
530 + if (!ignoreActions && !(ignoredActions.length && ignoredActions.indexOf(action.type) !== -1)) {
531 + measureUtils.measureTime(function () {
532 + var foundActionNonSerializableValue = findNonSerializableValue(action, "", isSerializable, getEntries, ignoredActionPaths, cache);
533 + if (foundActionNonSerializableValue) {
534 + var keyPath = foundActionNonSerializableValue.keyPath, value = foundActionNonSerializableValue.value;
535 + 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)");
536 + }
537 + });
538 + }
539 + if (!ignoreState) {
540 + measureUtils.measureTime(function () {
541 + var state = storeAPI.getState();
542 + var foundStateNonSerializableValue = findNonSerializableValue(state, "", isSerializable, getEntries, ignoredPaths, cache);
543 + if (foundStateNonSerializableValue) {
544 + var keyPath = foundStateNonSerializableValue.keyPath, value = foundStateNonSerializableValue.value;
545 + 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)");
546 + }
547 + });
548 + measureUtils.warnIfExceeded();
549 + }
550 + return result;
551 + }; }; };
552 +}
553 +// src/getDefaultMiddleware.ts
554 +function isBoolean(x) {
555 + return typeof x === "boolean";
556 +}
557 +function curryGetDefaultMiddleware() {
558 + return function curriedGetDefaultMiddleware(options) {
559 + return getDefaultMiddleware(options);
560 + };
561 +}
562 +function getDefaultMiddleware(options) {
563 + if (options === void 0) { options = {}; }
564 + 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;
565 + var middlewareArray = new MiddlewareArray();
566 + if (thunk) {
567 + if (isBoolean(thunk)) {
568 + middlewareArray.push(redux_thunk__WEBPACK_IMPORTED_MODULE_3__["default"]);
569 + }
570 + else {
571 + middlewareArray.push(redux_thunk__WEBPACK_IMPORTED_MODULE_3__["default"].withExtraArgument(thunk.extraArgument));
572 + }
573 + }
574 + if (true) {
575 + if (immutableCheck) {
576 + var immutableOptions = {};
577 + if (!isBoolean(immutableCheck)) {
578 + immutableOptions = immutableCheck;
579 + }
580 + middlewareArray.unshift(createImmutableStateInvariantMiddleware(immutableOptions));
581 + }
582 + if (serializableCheck) {
583 + var serializableOptions = {};
584 + if (!isBoolean(serializableCheck)) {
585 + serializableOptions = serializableCheck;
586 + }
587 + middlewareArray.push(createSerializableStateInvariantMiddleware(serializableOptions));
588 + }
589 + }
590 + return middlewareArray;
591 +}
592 +// src/configureStore.ts
593 +var IS_PRODUCTION = "development" === "production";
594 +function configureStore(options) {
595 + var curriedGetDefaultMiddleware = curryGetDefaultMiddleware();
596 + 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;
597 + var rootReducer;
598 + if (typeof reducer === "function") {
599 + rootReducer = reducer;
600 + }
601 + else if (isPlainObject(reducer)) {
602 + rootReducer = (0,redux__WEBPACK_IMPORTED_MODULE_0__.combineReducers)(reducer);
603 + }
604 + else {
605 + throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');
606 + }
607 + var finalMiddleware = middleware;
608 + if (typeof finalMiddleware === "function") {
609 + finalMiddleware = finalMiddleware(curriedGetDefaultMiddleware);
610 + if (!IS_PRODUCTION && !Array.isArray(finalMiddleware)) {
611 + throw new Error("when using a middleware builder function, an array of middleware must be returned");
612 + }
613 + }
614 + if (!IS_PRODUCTION && finalMiddleware.some(function (item) { return typeof item !== "function"; })) {
615 + throw new Error("each middleware provided to configureStore must be a function");
616 + }
617 + var middlewareEnhancer = redux__WEBPACK_IMPORTED_MODULE_0__.applyMiddleware.apply(void 0, finalMiddleware);
618 + var finalCompose = redux__WEBPACK_IMPORTED_MODULE_0__.compose;
619 + if (devTools) {
620 + finalCompose = composeWithDevTools(__spreadValues({
621 + trace: !IS_PRODUCTION
622 + }, typeof devTools === "object" && devTools));
623 + }
624 + var defaultEnhancers = new EnhancerArray(middlewareEnhancer);
625 + var storeEnhancers = defaultEnhancers;
626 + if (Array.isArray(enhancers)) {
627 + storeEnhancers = __spreadArray([middlewareEnhancer], enhancers);
628 + }
629 + else if (typeof enhancers === "function") {
630 + storeEnhancers = enhancers(defaultEnhancers);
631 + }
632 + var composedEnhancer = finalCompose.apply(void 0, storeEnhancers);
633 + return (0,redux__WEBPACK_IMPORTED_MODULE_0__.createStore)(rootReducer, preloadedState, composedEnhancer);
634 +}
635 +// src/createAction.ts
636 +function createAction(type, prepareAction) {
637 + function actionCreator() {
638 + var args = [];
639 + for (var _i = 0; _i < arguments.length; _i++) {
640 + args[_i] = arguments[_i];
641 + }
642 + if (prepareAction) {
643 + var prepared = prepareAction.apply(void 0, args);
644 + if (!prepared) {
645 + throw new Error("prepareAction did not return an object");
646 + }
647 + return __spreadValues(__spreadValues({
648 + type: type,
649 + payload: prepared.payload
650 + }, "meta" in prepared && { meta: prepared.meta }), "error" in prepared && { error: prepared.error });
651 + }
652 + return { type: type, payload: args[0] };
653 + }
654 + actionCreator.toString = function () { return "" + type; };
655 + actionCreator.type = type;
656 + actionCreator.match = function (action) { return action.type === type; };
657 + return actionCreator;
658 +}
659 +function isAction(action) {
660 + return isPlainObject(action) && "type" in action;
661 +}
662 +function isFSA(action) {
663 + return isAction(action) && typeof action.type === "string" && Object.keys(action).every(isValidKey);
664 +}
665 +function isValidKey(key) {
666 + return ["type", "payload", "error", "meta"].indexOf(key) > -1;
667 +}
668 +function getType(actionCreator) {
669 + return "" + actionCreator;
670 +}
671 +// src/createReducer.ts
672 +
673 +// src/mapBuilders.ts
674 +function executeReducerBuilderCallback(builderCallback) {
675 + var actionsMap = {};
676 + var actionMatchers = [];
677 + var defaultCaseReducer;
678 + var builder = {
679 + addCase: function (typeOrActionCreator, reducer) {
680 + if (true) {
681 + if (actionMatchers.length > 0) {
682 + throw new Error("`builder.addCase` should only be called before calling `builder.addMatcher`");
683 + }
684 + if (defaultCaseReducer) {
685 + throw new Error("`builder.addCase` should only be called before calling `builder.addDefaultCase`");
686 + }
687 + }
688 + var type = typeof typeOrActionCreator === "string" ? typeOrActionCreator : typeOrActionCreator.type;
689 + if (type in actionsMap) {
690 + throw new Error("addCase cannot be called with two reducers for the same action type");
691 + }
692 + actionsMap[type] = reducer;
693 + return builder;
694 + },
695 + addMatcher: function (matcher, reducer) {
696 + if (true) {
697 + if (defaultCaseReducer) {
698 + throw new Error("`builder.addMatcher` should only be called before calling `builder.addDefaultCase`");
699 + }
700 + }
701 + actionMatchers.push({ matcher: matcher, reducer: reducer });
702 + return builder;
703 + },
704 + addDefaultCase: function (reducer) {
705 + if (true) {
706 + if (defaultCaseReducer) {
707 + throw new Error("`builder.addDefaultCase` can only be called once");
708 + }
709 + }
710 + defaultCaseReducer = reducer;
711 + return builder;
712 + }
713 + };
714 + builderCallback(builder);
715 + return [actionsMap, actionMatchers, defaultCaseReducer];
716 +}
717 +// src/createReducer.ts
718 +function isStateFunction(x) {
719 + return typeof x === "function";
720 +}
721 +var hasWarnedAboutObjectNotation = false;
722 +function createReducer(initialState, mapOrBuilderCallback, actionMatchers, defaultCaseReducer) {
723 + if (actionMatchers === void 0) { actionMatchers = []; }
724 + if (true) {
725 + if (typeof mapOrBuilderCallback === "object") {
726 + if (!hasWarnedAboutObjectNotation) {
727 + hasWarnedAboutObjectNotation = true;
728 + console.warn("The object notation for `createReducer` is deprecated, and will be removed in RTK 2.0. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createReducer");
729 + }
730 + }
731 + }
732 + var _c = typeof mapOrBuilderCallback === "function" ? executeReducerBuilderCallback(mapOrBuilderCallback) : [mapOrBuilderCallback, actionMatchers, defaultCaseReducer], actionsMap = _c[0], finalActionMatchers = _c[1], finalDefaultCaseReducer = _c[2];
733 + var getInitialState;
734 + if (isStateFunction(initialState)) {
735 + getInitialState = function () { return freezeDraftable(initialState()); };
736 + }
737 + else {
738 + var frozenInitialState_1 = freezeDraftable(initialState);
739 + getInitialState = function () { return frozenInitialState_1; };
740 + }
741 + function reducer(state, action) {
742 + if (state === void 0) { state = getInitialState(); }
743 + var caseReducers = __spreadArray([
744 + actionsMap[action.type]
745 + ], finalActionMatchers.filter(function (_c) {
746 + var matcher = _c.matcher;
747 + return matcher(action);
748 + }).map(function (_c) {
749 + var reducer2 = _c.reducer;
750 + return reducer2;
751 + }));
752 + if (caseReducers.filter(function (cr) { return !!cr; }).length === 0) {
753 + caseReducers = [finalDefaultCaseReducer];
754 + }
755 + return caseReducers.reduce(function (previousState, caseReducer) {
756 + if (caseReducer) {
757 + if ((0,immer__WEBPACK_IMPORTED_MODULE_2__.isDraft)(previousState)) {
758 + var draft = previousState;
759 + var result = caseReducer(draft, action);
760 + if (result === void 0) {
761 + return previousState;
762 + }
763 + return result;
764 + }
765 + else if (!(0,immer__WEBPACK_IMPORTED_MODULE_2__.isDraftable)(previousState)) {
766 + var result = caseReducer(previousState, action);
767 + if (result === void 0) {
768 + if (previousState === null) {
769 + return previousState;
770 + }
771 + throw Error("A case reducer on a non-draftable value must not return undefined");
772 + }
773 + return result;
774 + }
775 + else {
776 + return (0,immer__WEBPACK_IMPORTED_MODULE_2__["default"])(previousState, function (draft) {
777 + return caseReducer(draft, action);
778 + });
779 + }
780 + }
781 + return previousState;
782 + }, state);
783 + }
784 + reducer.getInitialState = getInitialState;
785 + return reducer;
786 +}
787 +// src/createSlice.ts
788 +var hasWarnedAboutObjectNotation2 = false;
789 +function getType2(slice, actionKey) {
790 + return slice + "/" + actionKey;
791 +}
792 +function createSlice(options) {
793 + var name = options.name;
794 + if (!name) {
795 + throw new Error("`name` is a required option for createSlice");
796 + }
797 + if (typeof process !== "undefined" && "development" === "development") {
798 + if (options.initialState === void 0) {
799 + console.error("You must provide an `initialState` value that is not `undefined`. You may have misspelled `initialState`");
800 + }
801 + }
802 + var initialState = typeof options.initialState == "function" ? options.initialState : freezeDraftable(options.initialState);
803 + var reducers = options.reducers || {};
804 + var reducerNames = Object.keys(reducers);
805 + var sliceCaseReducersByName = {};
806 + var sliceCaseReducersByType = {};
807 + var actionCreators = {};
808 + reducerNames.forEach(function (reducerName) {
809 + var maybeReducerWithPrepare = reducers[reducerName];
810 + var type = getType2(name, reducerName);
811 + var caseReducer;
812 + var prepareCallback;
813 + if ("reducer" in maybeReducerWithPrepare) {
814 + caseReducer = maybeReducerWithPrepare.reducer;
815 + prepareCallback = maybeReducerWithPrepare.prepare;
816 + }
817 + else {
818 + caseReducer = maybeReducerWithPrepare;
819 + }
820 + sliceCaseReducersByName[reducerName] = caseReducer;
821 + sliceCaseReducersByType[type] = caseReducer;
822 + actionCreators[reducerName] = prepareCallback ? createAction(type, prepareCallback) : createAction(type);
823 + });
824 + function buildReducer() {
825 + if (true) {
826 + if (typeof options.extraReducers === "object") {
827 + if (!hasWarnedAboutObjectNotation2) {
828 + hasWarnedAboutObjectNotation2 = true;
829 + console.warn("The object notation for `createSlice.extraReducers` is deprecated, and will be removed in RTK 2.0. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createSlice");
830 + }
831 + }
832 + }
833 + 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;
834 + var finalCaseReducers = __spreadValues(__spreadValues({}, extraReducers), sliceCaseReducersByType);
835 + return createReducer(initialState, function (builder) {
836 + for (var key in finalCaseReducers) {
837 + builder.addCase(key, finalCaseReducers[key]);
838 + }
839 + for (var _i = 0, actionMatchers_1 = actionMatchers; _i < actionMatchers_1.length; _i++) {
840 + var m = actionMatchers_1[_i];
841 + builder.addMatcher(m.matcher, m.reducer);
842 + }
843 + if (defaultCaseReducer) {
844 + builder.addDefaultCase(defaultCaseReducer);
845 + }
846 + });
847 + }
848 + var _reducer;
849 + return {
850 + name: name,
851 + reducer: function (state, action) {
852 + if (!_reducer)
853 + _reducer = buildReducer();
854 + return _reducer(state, action);
855 + },
856 + actions: actionCreators,
857 + caseReducers: sliceCaseReducersByName,
858 + getInitialState: function () {
859 + if (!_reducer)
860 + _reducer = buildReducer();
861 + return _reducer.getInitialState();
862 + }
863 + };
864 +}
865 +// src/entities/entity_state.ts
866 +function getInitialEntityState() {
867 + return {
868 + ids: [],
869 + entities: {}
870 + };
871 +}
872 +function createInitialStateFactory() {
873 + function getInitialState(additionalState) {
874 + if (additionalState === void 0) { additionalState = {}; }
875 + return Object.assign(getInitialEntityState(), additionalState);
876 + }
877 + return { getInitialState: getInitialState };
878 +}
879 +// src/entities/state_selectors.ts
880 +function createSelectorsFactory() {
881 + function getSelectors(selectState) {
882 + var selectIds = function (state) { return state.ids; };
883 + var selectEntities = function (state) { return state.entities; };
884 + var selectAll = createDraftSafeSelector(selectIds, selectEntities, function (ids, entities) { return ids.map(function (id) { return entities[id]; }); });
885 + var selectId = function (_, id) { return id; };
886 + var selectById = function (entities, id) { return entities[id]; };
887 + var selectTotal = createDraftSafeSelector(selectIds, function (ids) { return ids.length; });
888 + if (!selectState) {
889 + return {
890 + selectIds: selectIds,
891 + selectEntities: selectEntities,
892 + selectAll: selectAll,
893 + selectTotal: selectTotal,
894 + selectById: createDraftSafeSelector(selectEntities, selectId, selectById)
895 + };
896 + }
897 + var selectGlobalizedEntities = createDraftSafeSelector(selectState, selectEntities);
898 + return {
899 + selectIds: createDraftSafeSelector(selectState, selectIds),
900 + selectEntities: selectGlobalizedEntities,
901 + selectAll: createDraftSafeSelector(selectState, selectAll),
902 + selectTotal: createDraftSafeSelector(selectState, selectTotal),
903 + selectById: createDraftSafeSelector(selectGlobalizedEntities, selectId, selectById)
904 + };
905 + }
906 + return { getSelectors: getSelectors };
907 +}
908 +// src/entities/state_adapter.ts
909 +
910 +function createSingleArgumentStateOperator(mutator) {
911 + var operator = createStateOperator(function (_, state) { return mutator(state); });
912 + return function operation(state) {
913 + return operator(state, void 0);
914 + };
915 +}
916 +function createStateOperator(mutator) {
917 + return function operation(state, arg) {
918 + function isPayloadActionArgument(arg2) {
919 + return isFSA(arg2);
920 + }
921 + var runMutator = function (draft) {
922 + if (isPayloadActionArgument(arg)) {
923 + mutator(arg.payload, draft);
924 + }
925 + else {
926 + mutator(arg, draft);
927 + }
928 + };
929 + if ((0,immer__WEBPACK_IMPORTED_MODULE_2__.isDraft)(state)) {
930 + runMutator(state);
931 + return state;
932 + }
933 + else {
934 + return (0,immer__WEBPACK_IMPORTED_MODULE_2__["default"])(state, runMutator);
935 + }
936 + };
937 +}
938 +// src/entities/utils.ts
939 +function selectIdValue(entity, selectId) {
940 + var key = selectId(entity);
941 + if ( true && key === void 0) {
942 + 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());
943 + }
944 + return key;
945 +}
946 +function ensureEntitiesArray(entities) {
947 + if (!Array.isArray(entities)) {
948 + entities = Object.values(entities);
949 + }
950 + return entities;
951 +}
952 +function splitAddedUpdatedEntities(newEntities, selectId, state) {
953 + newEntities = ensureEntitiesArray(newEntities);
954 + var added = [];
955 + var updated = [];
956 + for (var _i = 0, newEntities_1 = newEntities; _i < newEntities_1.length; _i++) {
957 + var entity = newEntities_1[_i];
958 + var id = selectIdValue(entity, selectId);
959 + if (id in state.entities) {
960 + updated.push({ id: id, changes: entity });
961 + }
962 + else {
963 + added.push(entity);
964 + }
965 + }
966 + return [added, updated];
967 +}
968 +// src/entities/unsorted_state_adapter.ts
969 +function createUnsortedStateAdapter(selectId) {
970 + function addOneMutably(entity, state) {
971 + var key = selectIdValue(entity, selectId);
972 + if (key in state.entities) {
973 + return;
974 + }
975 + state.ids.push(key);
976 + state.entities[key] = entity;
977 + }
978 + function addManyMutably(newEntities, state) {
979 + newEntities = ensureEntitiesArray(newEntities);
980 + for (var _i = 0, newEntities_2 = newEntities; _i < newEntities_2.length; _i++) {
981 + var entity = newEntities_2[_i];
982 + addOneMutably(entity, state);
983 + }
984 + }
985 + function setOneMutably(entity, state) {
986 + var key = selectIdValue(entity, selectId);
987 + if (!(key in state.entities)) {
988 + state.ids.push(key);
989 + }
990 + state.entities[key] = entity;
991 + }
992 + function setManyMutably(newEntities, state) {
993 + newEntities = ensureEntitiesArray(newEntities);
994 + for (var _i = 0, newEntities_3 = newEntities; _i < newEntities_3.length; _i++) {
995 + var entity = newEntities_3[_i];
996 + setOneMutably(entity, state);
997 + }
998 + }
999 + function setAllMutably(newEntities, state) {
1000 + newEntities = ensureEntitiesArray(newEntities);
1001 + state.ids = [];
1002 + state.entities = {};
1003 + addManyMutably(newEntities, state);
1004 + }
1005 + function removeOneMutably(key, state) {
1006 + return removeManyMutably([key], state);
1007 + }
1008 + function removeManyMutably(keys, state) {
1009 + var didMutate = false;
1010 + keys.forEach(function (key) {
1011 + if (key in state.entities) {
1012 + delete state.entities[key];
1013 + didMutate = true;
1014 + }
1015 + });
1016 + if (didMutate) {
1017 + state.ids = state.ids.filter(function (id) { return id in state.entities; });
1018 + }
1019 + }
1020 + function removeAllMutably(state) {
1021 + Object.assign(state, {
1022 + ids: [],
1023 + entities: {}
1024 + });
1025 + }
1026 + function takeNewKey(keys, update, state) {
1027 + var original2 = state.entities[update.id];
1028 + var updated = Object.assign({}, original2, update.changes);
1029 + var newKey = selectIdValue(updated, selectId);
1030 + var hasNewKey = newKey !== update.id;
1031 + if (hasNewKey) {
1032 + keys[update.id] = newKey;
1033 + delete state.entities[update.id];
1034 + }
1035 + state.entities[newKey] = updated;
1036 + return hasNewKey;
1037 + }
1038 + function updateOneMutably(update, state) {
1039 + return updateManyMutably([update], state);
1040 + }
1041 + function updateManyMutably(updates, state) {
1042 + var newKeys = {};
1043 + var updatesPerEntity = {};
1044 + updates.forEach(function (update) {
1045 + if (update.id in state.entities) {
1046 + updatesPerEntity[update.id] = {
1047 + id: update.id,
1048 + changes: __spreadValues(__spreadValues({}, updatesPerEntity[update.id] ? updatesPerEntity[update.id].changes : null), update.changes)
1049 + };
1050 + }
1051 + });
1052 + updates = Object.values(updatesPerEntity);
1053 + var didMutateEntities = updates.length > 0;
1054 + if (didMutateEntities) {
1055 + var didMutateIds = updates.filter(function (update) { return takeNewKey(newKeys, update, state); }).length > 0;
1056 + if (didMutateIds) {
1057 + state.ids = Object.keys(state.entities);
1058 + }
1059 + }
1060 + }
1061 + function upsertOneMutably(entity, state) {
1062 + return upsertManyMutably([entity], state);
1063 + }
1064 + function upsertManyMutably(newEntities, state) {
1065 + var _c = splitAddedUpdatedEntities(newEntities, selectId, state), added = _c[0], updated = _c[1];
1066 + updateManyMutably(updated, state);
1067 + addManyMutably(added, state);
1068 + }
1069 + return {
1070 + removeAll: createSingleArgumentStateOperator(removeAllMutably),
1071 + addOne: createStateOperator(addOneMutably),
1072 + addMany: createStateOperator(addManyMutably),
1073 + setOne: createStateOperator(setOneMutably),
1074 + setMany: createStateOperator(setManyMutably),
1075 + setAll: createStateOperator(setAllMutably),
1076 + updateOne: createStateOperator(updateOneMutably),
1077 + updateMany: createStateOperator(updateManyMutably),
1078 + upsertOne: createStateOperator(upsertOneMutably),
1079 + upsertMany: createStateOperator(upsertManyMutably),
1080 + removeOne: createStateOperator(removeOneMutably),
1081 + removeMany: createStateOperator(removeManyMutably)
1082 + };
1083 +}
1084 +// src/entities/sorted_state_adapter.ts
1085 +function createSortedStateAdapter(selectId, sort) {
1086 + var _c = createUnsortedStateAdapter(selectId), removeOne = _c.removeOne, removeMany = _c.removeMany, removeAll = _c.removeAll;
1087 + function addOneMutably(entity, state) {
1088 + return addManyMutably([entity], state);
1089 + }
1090 + function addManyMutably(newEntities, state) {
1091 + newEntities = ensureEntitiesArray(newEntities);
1092 + var models = newEntities.filter(function (model) { return !(selectIdValue(model, selectId) in state.entities); });
1093 + if (models.length !== 0) {
1094 + merge(models, state);
1095 + }
1096 + }
1097 + function setOneMutably(entity, state) {
1098 + return setManyMutably([entity], state);
1099 + }
1100 + function setManyMutably(newEntities, state) {
1101 + newEntities = ensureEntitiesArray(newEntities);
1102 + if (newEntities.length !== 0) {
1103 + merge(newEntities, state);
1104 + }
1105 + }
1106 + function setAllMutably(newEntities, state) {
1107 + newEntities = ensureEntitiesArray(newEntities);
1108 + state.entities = {};
1109 + state.ids = [];
1110 + addManyMutably(newEntities, state);
1111 + }
1112 + function updateOneMutably(update, state) {
1113 + return updateManyMutably([update], state);
1114 + }
1115 + function updateManyMutably(updates, state) {
1116 + var appliedUpdates = false;
1117 + for (var _i = 0, updates_1 = updates; _i < updates_1.length; _i++) {
1118 + var update = updates_1[_i];
1119 + var entity = state.entities[update.id];
1120 + if (!entity) {
1121 + continue;
1122 + }
1123 + appliedUpdates = true;
1124 + Object.assign(entity, update.changes);
1125 + var newId = selectId(entity);
1126 + if (update.id !== newId) {
1127 + delete state.entities[update.id];
1128 + state.entities[newId] = entity;
1129 + }
1130 + }
1131 + if (appliedUpdates) {
1132 + resortEntities(state);
1133 + }
1134 + }
1135 + function upsertOneMutably(entity, state) {
1136 + return upsertManyMutably([entity], state);
1137 + }
1138 + function upsertManyMutably(newEntities, state) {
1139 + var _c = splitAddedUpdatedEntities(newEntities, selectId, state), added = _c[0], updated = _c[1];
1140 + updateManyMutably(updated, state);
1141 + addManyMutably(added, state);
1142 + }
1143 + function areArraysEqual(a, b) {
1144 + if (a.length !== b.length) {
1145 + return false;
1146 + }
1147 + for (var i = 0; i < a.length && i < b.length; i++) {
1148 + if (a[i] === b[i]) {
1149 + continue;
1150 + }
1151 + return false;
1152 + }
1153 + return true;
1154 + }
1155 + function merge(models, state) {
1156 + models.forEach(function (model) {
1157 + state.entities[selectId(model)] = model;
1158 + });
1159 + resortEntities(state);
1160 + }
1161 + function resortEntities(state) {
1162 + var allEntities = Object.values(state.entities);
1163 + allEntities.sort(sort);
1164 + var newSortedIds = allEntities.map(selectId);
1165 + var ids = state.ids;
1166 + if (!areArraysEqual(ids, newSortedIds)) {
1167 + state.ids = newSortedIds;
1168 + }
1169 + }
1170 + return {
1171 + removeOne: removeOne,
1172 + removeMany: removeMany,
1173 + removeAll: removeAll,
1174 + addOne: createStateOperator(addOneMutably),
1175 + updateOne: createStateOperator(updateOneMutably),
1176 + upsertOne: createStateOperator(upsertOneMutably),
1177 + setOne: createStateOperator(setOneMutably),
1178 + setMany: createStateOperator(setManyMutably),
1179 + setAll: createStateOperator(setAllMutably),
1180 + addMany: createStateOperator(addManyMutably),
1181 + updateMany: createStateOperator(updateManyMutably),
1182 + upsertMany: createStateOperator(upsertManyMutably)
1183 + };
1184 +}
1185 +// src/entities/create_adapter.ts
1186 +function createEntityAdapter(options) {
1187 + if (options === void 0) { options = {}; }
1188 + var _c = __spreadValues({
1189 + sortComparer: false,
1190 + selectId: function (instance) { return instance.id; }
1191 + }, options), selectId = _c.selectId, sortComparer = _c.sortComparer;
1192 + var stateFactory = createInitialStateFactory();
1193 + var selectorsFactory = createSelectorsFactory();
1194 + var stateAdapter = sortComparer ? createSortedStateAdapter(selectId, sortComparer) : createUnsortedStateAdapter(selectId);
1195 + return __spreadValues(__spreadValues(__spreadValues({
1196 + selectId: selectId,
1197 + sortComparer: sortComparer
1198 + }, stateFactory), selectorsFactory), stateAdapter);
1199 +}
1200 +// src/nanoid.ts
1201 +var urlAlphabet = "ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW";
1202 +var nanoid = function (size) {
1203 + if (size === void 0) { size = 21; }
1204 + var id = "";
1205 + var i = size;
1206 + while (i--) {
1207 + id += urlAlphabet[Math.random() * 64 | 0];
1208 + }
1209 + return id;
1210 +};
1211 +// src/createAsyncThunk.ts
1212 +var commonProperties = [
1213 + "name",
1214 + "message",
1215 + "stack",
1216 + "code"
1217 +];
1218 +var RejectWithValue = /** @class */ (function () {
1219 + function RejectWithValue(payload, meta) {
1220 + this.payload = payload;
1221 + this.meta = meta;
1222 + }
1223 + return RejectWithValue;
1224 +}());
1225 +var FulfillWithMeta = /** @class */ (function () {
1226 + function FulfillWithMeta(payload, meta) {
1227 + this.payload = payload;
1228 + this.meta = meta;
1229 + }
1230 + return FulfillWithMeta;
1231 +}());
1232 +var miniSerializeError = function (value) {
1233 + if (typeof value === "object" && value !== null) {
1234 + var simpleError = {};
1235 + for (var _i = 0, commonProperties_1 = commonProperties; _i < commonProperties_1.length; _i++) {
1236 + var property = commonProperties_1[_i];
1237 + if (typeof value[property] === "string") {
1238 + simpleError[property] = value[property];
1239 + }
1240 + }
1241 + return simpleError;
1242 + }
1243 + return { message: String(value) };
1244 +};
1245 +var createAsyncThunk = (function () {
1246 + function createAsyncThunk2(typePrefix, payloadCreator, options) {
1247 + var fulfilled = createAction(typePrefix + "/fulfilled", function (payload, requestId, arg, meta) { return ({
1248 + payload: payload,
1249 + meta: __spreadProps(__spreadValues({}, meta || {}), {
1250 + arg: arg,
1251 + requestId: requestId,
1252 + requestStatus: "fulfilled"
1253 + })
1254 + }); });
1255 + var pending = createAction(typePrefix + "/pending", function (requestId, arg, meta) { return ({
1256 + payload: void 0,
1257 + meta: __spreadProps(__spreadValues({}, meta || {}), {
1258 + arg: arg,
1259 + requestId: requestId,
1260 + requestStatus: "pending"
1261 + })
1262 + }); });
1263 + var rejected = createAction(typePrefix + "/rejected", function (error, requestId, arg, payload, meta) { return ({
1264 + payload: payload,
1265 + error: (options && options.serializeError || miniSerializeError)(error || "Rejected"),
1266 + meta: __spreadProps(__spreadValues({}, meta || {}), {
1267 + arg: arg,
1268 + requestId: requestId,
1269 + rejectedWithValue: !!payload,
1270 + requestStatus: "rejected",
1271 + aborted: (error == null ? void 0 : error.name) === "AbortError",
1272 + condition: (error == null ? void 0 : error.name) === "ConditionError"
1273 + })
1274 + }); });
1275 + var displayedWarning = false;
1276 + var AC = typeof AbortController !== "undefined" ? AbortController : /** @class */ (function () {
1277 + function class_1() {
1278 + this.signal = {
1279 + aborted: false,
1280 + addEventListener: function () {
1281 + },
1282 + dispatchEvent: function () {
1283 + return false;
1284 + },
1285 + onabort: function () {
1286 + },
1287 + removeEventListener: function () {
1288 + },
1289 + reason: void 0,
1290 + throwIfAborted: function () {
1291 + }
1292 + };
1293 + }
1294 + class_1.prototype.abort = function () {
1295 + if (true) {
1296 + if (!displayedWarning) {
1297 + displayedWarning = true;
1298 + 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'.");
1299 + }
1300 + }
1301 + };
1302 + return class_1;
1303 + }());
1304 + function actionCreator(arg) {
1305 + return function (dispatch, getState, extra) {
1306 + var requestId = (options == null ? void 0 : options.idGenerator) ? options.idGenerator(arg) : nanoid();
1307 + var abortController = new AC();
1308 + var abortReason;
1309 + var started = false;
1310 + function abort(reason) {
1311 + abortReason = reason;
1312 + abortController.abort();
1313 + }
1314 + var promise2 = function () {
1315 + return __async(this, null, function () {
1316 + var _a, _b, finalAction, conditionResult, abortedPromise, err_1, skipDispatch;
1317 + return __generator(this, function (_c) {
1318 + switch (_c.label) {
1319 + case 0:
1320 + _c.trys.push([0, 4, , 5]);
1321 + conditionResult = (_a = options == null ? void 0 : options.condition) == null ? void 0 : _a.call(options, arg, { getState: getState, extra: extra });
1322 + if (!isThenable(conditionResult)) return [3 /*break*/, 2];
1323 + return [4 /*yield*/, conditionResult];
1324 + case 1:
1325 + conditionResult = _c.sent();
1326 + _c.label = 2;
1327 + case 2:
1328 + if (conditionResult === false || abortController.signal.aborted) {
1329 + throw {
1330 + name: "ConditionError",
1331 + message: "Aborted due to condition callback returning false."
1332 + };
1333 + }
1334 + started = true;
1335 + abortedPromise = new Promise(function (_, reject) { return abortController.signal.addEventListener("abort", function () { return reject({
1336 + name: "AbortError",
1337 + message: abortReason || "Aborted"
1338 + }); }); });
1339 + 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 })));
1340 + return [4 /*yield*/, Promise.race([
1341 + abortedPromise,
1342 + Promise.resolve(payloadCreator(arg, {
1343 + dispatch: dispatch,
1344 + getState: getState,
1345 + extra: extra,
1346 + requestId: requestId,
1347 + signal: abortController.signal,
1348 + abort: abort,
1349 + rejectWithValue: function (value, meta) {
1350 + return new RejectWithValue(value, meta);
1351 + },
1352 + fulfillWithValue: function (value, meta) {
1353 + return new FulfillWithMeta(value, meta);
1354 + }
1355 + })).then(function (result) {
1356 + if (result instanceof RejectWithValue) {
1357 + throw result;
1358 + }
1359 + if (result instanceof FulfillWithMeta) {
1360 + return fulfilled(result.payload, requestId, arg, result.meta);
1361 + }
1362 + return fulfilled(result, requestId, arg);
1363 + })
1364 + ])];
1365 + case 3:
1366 + finalAction = _c.sent();
1367 + return [3 /*break*/, 5];
1368 + case 4:
1369 + err_1 = _c.sent();
1370 + finalAction = err_1 instanceof RejectWithValue ? rejected(null, requestId, arg, err_1.payload, err_1.meta) : rejected(err_1, requestId, arg);
1371 + return [3 /*break*/, 5];
1372 + case 5:
1373 + skipDispatch = options && !options.dispatchConditionRejection && rejected.match(finalAction) && finalAction.meta.condition;
1374 + if (!skipDispatch) {
1375 + dispatch(finalAction);
1376 + }
1377 + return [2 /*return*/, finalAction];
1378 + }
1379 + });
1380 + });
1381 + }();
1382 + return Object.assign(promise2, {
1383 + abort: abort,
1384 + requestId: requestId,
1385 + arg: arg,
1386 + unwrap: function () {
1387 + return promise2.then(unwrapResult);
1388 + }
1389 + });
1390 + };
1391 + }
1392 + return Object.assign(actionCreator, {
1393 + pending: pending,
1394 + rejected: rejected,
1395 + fulfilled: fulfilled,
1396 + typePrefix: typePrefix
1397 + });
1398 + }
1399 + createAsyncThunk2.withTypes = function () { return createAsyncThunk2; };
1400 + return createAsyncThunk2;
1401 +})();
1402 +function unwrapResult(action) {
1403 + if (action.meta && action.meta.rejectedWithValue) {
1404 + throw action.payload;
1405 + }
1406 + if (action.error) {
1407 + throw action.error;
1408 + }
1409 + return action.payload;
1410 +}
1411 +function isThenable(value) {
1412 + return value !== null && typeof value === "object" && typeof value.then === "function";
1413 +}
1414 +// src/tsHelpers.ts
1415 +var hasMatchFunction = function (v) {
1416 + return v && typeof v.match === "function";
1417 +};
1418 +// src/matchers.ts
1419 +var matches = function (matcher, action) {
1420 + if (hasMatchFunction(matcher)) {
1421 + return matcher.match(action);
1422 + }
1423 + else {
1424 + return matcher(action);
1425 + }
1426 +};
1427 +function isAnyOf() {
1428 + var matchers = [];
1429 + for (var _i = 0; _i < arguments.length; _i++) {
1430 + matchers[_i] = arguments[_i];
1431 + }
1432 + return function (action) {
1433 + return matchers.some(function (matcher) { return matches(matcher, action); });
1434 + };
1435 +}
1436 +function isAllOf() {
1437 + var matchers = [];
1438 + for (var _i = 0; _i < arguments.length; _i++) {
1439 + matchers[_i] = arguments[_i];
1440 + }
1441 + return function (action) {
1442 + return matchers.every(function (matcher) { return matches(matcher, action); });
1443 + };
1444 +}
1445 +function hasExpectedRequestMetadata(action, validStatus) {
1446 + if (!action || !action.meta)
1447 + return false;
1448 + var hasValidRequestId = typeof action.meta.requestId === "string";
1449 + var hasValidRequestStatus = validStatus.indexOf(action.meta.requestStatus) > -1;
1450 + return hasValidRequestId && hasValidRequestStatus;
1451 +}
1452 +function isAsyncThunkArray(a) {
1453 + return typeof a[0] === "function" && "pending" in a[0] && "fulfilled" in a[0] && "rejected" in a[0];
1454 +}
1455 +function isPending() {
1456 + var asyncThunks = [];
1457 + for (var _i = 0; _i < arguments.length; _i++) {
1458 + asyncThunks[_i] = arguments[_i];
1459 + }
1460 + if (asyncThunks.length === 0) {
1461 + return function (action) { return hasExpectedRequestMetadata(action, ["pending"]); };
1462 + }
1463 + if (!isAsyncThunkArray(asyncThunks)) {
1464 + return isPending()(asyncThunks[0]);
1465 + }
1466 + return function (action) {
1467 + var matchers = asyncThunks.map(function (asyncThunk) { return asyncThunk.pending; });
1468 + var combinedMatcher = isAnyOf.apply(void 0, matchers);
1469 + return combinedMatcher(action);
1470 + };
1471 +}
1472 +function isRejected() {
1473 + var asyncThunks = [];
1474 + for (var _i = 0; _i < arguments.length; _i++) {
1475 + asyncThunks[_i] = arguments[_i];
1476 + }
1477 + if (asyncThunks.length === 0) {
1478 + return function (action) { return hasExpectedRequestMetadata(action, ["rejected"]); };
1479 + }
1480 + if (!isAsyncThunkArray(asyncThunks)) {
1481 + return isRejected()(asyncThunks[0]);
1482 + }
1483 + return function (action) {
1484 + var matchers = asyncThunks.map(function (asyncThunk) { return asyncThunk.rejected; });
1485 + var combinedMatcher = isAnyOf.apply(void 0, matchers);
1486 + return combinedMatcher(action);
1487 + };
1488 +}
1489 +function isRejectedWithValue() {
1490 + var asyncThunks = [];
1491 + for (var _i = 0; _i < arguments.length; _i++) {
1492 + asyncThunks[_i] = arguments[_i];
1493 + }
1494 + var hasFlag = function (action) {
1495 + return action && action.meta && action.meta.rejectedWithValue;
1496 + };
1497 + if (asyncThunks.length === 0) {
1498 + return function (action) {
1499 + var combinedMatcher = isAllOf(isRejected.apply(void 0, asyncThunks), hasFlag);
1500 + return combinedMatcher(action);
1501 + };
1502 + }
1503 + if (!isAsyncThunkArray(asyncThunks)) {
1504 + return isRejectedWithValue()(asyncThunks[0]);
1505 + }
1506 + return function (action) {
1507 + var combinedMatcher = isAllOf(isRejected.apply(void 0, asyncThunks), hasFlag);
1508 + return combinedMatcher(action);
1509 + };
1510 +}
1511 +function isFulfilled() {
1512 + var asyncThunks = [];
1513 + for (var _i = 0; _i < arguments.length; _i++) {
1514 + asyncThunks[_i] = arguments[_i];
1515 + }
1516 + if (asyncThunks.length === 0) {
1517 + return function (action) { return hasExpectedRequestMetadata(action, ["fulfilled"]); };
1518 + }
1519 + if (!isAsyncThunkArray(asyncThunks)) {
1520 + return isFulfilled()(asyncThunks[0]);
1521 + }
1522 + return function (action) {
1523 + var matchers = asyncThunks.map(function (asyncThunk) { return asyncThunk.fulfilled; });
1524 + var combinedMatcher = isAnyOf.apply(void 0, matchers);
1525 + return combinedMatcher(action);
1526 + };
1527 +}
1528 +function isAsyncThunkAction() {
1529 + var asyncThunks = [];
1530 + for (var _i = 0; _i < arguments.length; _i++) {
1531 + asyncThunks[_i] = arguments[_i];
1532 + }
1533 + if (asyncThunks.length === 0) {
1534 + return function (action) { return hasExpectedRequestMetadata(action, ["pending", "fulfilled", "rejected"]); };
1535 + }
1536 + if (!isAsyncThunkArray(asyncThunks)) {
1537 + return isAsyncThunkAction()(asyncThunks[0]);
1538 + }
1539 + return function (action) {
1540 + var matchers = [];
1541 + for (var _i = 0, asyncThunks_1 = asyncThunks; _i < asyncThunks_1.length; _i++) {
1542 + var asyncThunk = asyncThunks_1[_i];
1543 + matchers.push(asyncThunk.pending, asyncThunk.rejected, asyncThunk.fulfilled);
1544 + }
1545 + var combinedMatcher = isAnyOf.apply(void 0, matchers);
1546 + return combinedMatcher(action);
1547 + };
1548 +}
1549 +// src/listenerMiddleware/utils.ts
1550 +var assertFunction = function (func, expected) {
1551 + if (typeof func !== "function") {
1552 + throw new TypeError(expected + " is not a function");
1553 + }
1554 +};
1555 +var noop = function () {
1556 +};
1557 +var catchRejection = function (promise2, onError) {
1558 + if (onError === void 0) { onError = noop; }
1559 + promise2.catch(onError);
1560 + return promise2;
1561 +};
1562 +var addAbortSignalListener = function (abortSignal, callback) {
1563 + abortSignal.addEventListener("abort", callback, { once: true });
1564 + return function () { return abortSignal.removeEventListener("abort", callback); };
1565 +};
1566 +var abortControllerWithReason = function (abortController, reason) {
1567 + var signal = abortController.signal;
1568 + if (signal.aborted) {
1569 + return;
1570 + }
1571 + if (!("reason" in signal)) {
1572 + Object.defineProperty(signal, "reason", {
1573 + enumerable: true,
1574 + value: reason,
1575 + configurable: true,
1576 + writable: true
1577 + });
1578 + }
1579 + ;
1580 + abortController.abort(reason);
1581 +};
1582 +// src/listenerMiddleware/exceptions.ts
1583 +var task = "task";
1584 +var listener = "listener";
1585 +var completed = "completed";
1586 +var cancelled = "cancelled";
1587 +var taskCancelled = "task-" + cancelled;
1588 +var taskCompleted = "task-" + completed;
1589 +var listenerCancelled = listener + "-" + cancelled;
1590 +var listenerCompleted = listener + "-" + completed;
1591 +var TaskAbortError = /** @class */ (function () {
1592 + function TaskAbortError(code) {
1593 + this.code = code;
1594 + this.name = "TaskAbortError";
1595 + this.message = task + " " + cancelled + " (reason: " + code + ")";
1596 + }
1597 + return TaskAbortError;
1598 +}());
1599 +// src/listenerMiddleware/task.ts
1600 +var validateActive = function (signal) {
1601 + if (signal.aborted) {
1602 + throw new TaskAbortError(signal.reason);
1603 + }
1604 +};
1605 +function raceWithSignal(signal, promise2) {
1606 + var cleanup = noop;
1607 + return new Promise(function (resolve, reject) {
1608 + var notifyRejection = function () { return reject(new TaskAbortError(signal.reason)); };
1609 + if (signal.aborted) {
1610 + notifyRejection();
1611 + return;
1612 + }
1613 + cleanup = addAbortSignalListener(signal, notifyRejection);
1614 + promise2.finally(function () { return cleanup(); }).then(resolve, reject);
1615 + }).finally(function () {
1616 + cleanup = noop;
1617 + });
1618 +}
1619 +var runTask = function (task2, cleanUp) { return __async(void 0, null, function () {
1620 + var value, error_1;
1621 + return __generator(this, function (_c) {
1622 + switch (_c.label) {
1623 + case 0:
1624 + _c.trys.push([0, 3, 4, 5]);
1625 + return [4 /*yield*/, Promise.resolve()];
1626 + case 1:
1627 + _c.sent();
1628 + return [4 /*yield*/, task2()];
1629 + case 2:
1630 + value = _c.sent();
1631 + return [2 /*return*/, {
1632 + status: "ok",
1633 + value: value
1634 + }];
1635 + case 3:
1636 + error_1 = _c.sent();
1637 + return [2 /*return*/, {
1638 + status: error_1 instanceof TaskAbortError ? "cancelled" : "rejected",
1639 + error: error_1
1640 + }];
1641 + case 4:
1642 + cleanUp == null ? void 0 : cleanUp();
1643 + return [7 /*endfinally*/];
1644 + case 5: return [2 /*return*/];
1645 + }
1646 + });
1647 +}); };
1648 +var createPause = function (signal) {
1649 + return function (promise2) {
1650 + return catchRejection(raceWithSignal(signal, promise2).then(function (output) {
1651 + validateActive(signal);
1652 + return output;
1653 + }));
1654 + };
1655 +};
1656 +var createDelay = function (signal) {
1657 + var pause = createPause(signal);
1658 + return function (timeoutMs) {
1659 + return pause(new Promise(function (resolve) { return setTimeout(resolve, timeoutMs); }));
1660 + };
1661 +};
1662 +// src/listenerMiddleware/index.ts
1663 +var assign = Object.assign;
1664 +var INTERNAL_NIL_TOKEN = {};
1665 +var alm = "listenerMiddleware";
1666 +var createFork = function (parentAbortSignal) {
1667 + var linkControllers = function (controller) { return addAbortSignalListener(parentAbortSignal, function () { return abortControllerWithReason(controller, parentAbortSignal.reason); }); };
1668 + return function (taskExecutor) {
1669 + assertFunction(taskExecutor, "taskExecutor");
1670 + var childAbortController = new AbortController();
1671 + linkControllers(childAbortController);
1672 + var result = runTask(function () { return __async(void 0, null, function () {
1673 + var result2;
1674 + return __generator(this, function (_c) {
1675 + switch (_c.label) {
1676 + case 0:
1677 + validateActive(parentAbortSignal);
1678 + validateActive(childAbortController.signal);
1679 + return [4 /*yield*/, taskExecutor({
1680 + pause: createPause(childAbortController.signal),
1681 + delay: createDelay(childAbortController.signal),
1682 + signal: childAbortController.signal
1683 + })];
1684 + case 1:
1685 + result2 = _c.sent();
1686 + validateActive(childAbortController.signal);
1687 + return [2 /*return*/, result2];
1688 + }
1689 + });
1690 + }); }, function () { return abortControllerWithReason(childAbortController, taskCompleted); });
1691 + return {
1692 + result: createPause(parentAbortSignal)(result),
1693 + cancel: function () {
1694 + abortControllerWithReason(childAbortController, taskCancelled);
1695 + }
1696 + };
1697 + };
1698 +};
1699 +var createTakePattern = function (startListening, signal) {
1700 + var take = function (predicate, timeout) { return __async(void 0, null, function () {
1701 + var unsubscribe, tuplePromise, promises, output;
1702 + return __generator(this, function (_c) {
1703 + switch (_c.label) {
1704 + case 0:
1705 + validateActive(signal);
1706 + unsubscribe = function () {
1707 + };
1708 + tuplePromise = new Promise(function (resolve, reject) {
1709 + var stopListening = startListening({
1710 + predicate: predicate,
1711 + effect: function (action, listenerApi) {
1712 + listenerApi.unsubscribe();
1713 + resolve([
1714 + action,
1715 + listenerApi.getState(),
1716 + listenerApi.getOriginalState()
1717 + ]);
1718 + }
1719 + });
1720 + unsubscribe = function () {
1721 + stopListening();
1722 + reject();
1723 + };
1724 + });
1725 + promises = [
1726 + tuplePromise
1727 + ];
1728 + if (timeout != null) {
1729 + promises.push(new Promise(function (resolve) { return setTimeout(resolve, timeout, null); }));
1730 + }
1731 + _c.label = 1;
1732 + case 1:
1733 + _c.trys.push([1, , 3, 4]);
1734 + return [4 /*yield*/, raceWithSignal(signal, Promise.race(promises))];
1735 + case 2:
1736 + output = _c.sent();
1737 + validateActive(signal);
1738 + return [2 /*return*/, output];
1739 + case 3:
1740 + unsubscribe();
1741 + return [7 /*endfinally*/];
1742 + case 4: return [2 /*return*/];
1743 + }
1744 + });
1745 + }); };
1746 + return function (predicate, timeout) { return catchRejection(take(predicate, timeout)); };
1747 +};
1748 +var getListenerEntryPropsFrom = function (options) {
1749 + var type = options.type, actionCreator = options.actionCreator, matcher = options.matcher, predicate = options.predicate, effect = options.effect;
1750 + if (type) {
1751 + predicate = createAction(type).match;
1752 + }
1753 + else if (actionCreator) {
1754 + type = actionCreator.type;
1755 + predicate = actionCreator.match;
1756 + }
1757 + else if (matcher) {
1758 + predicate = matcher;
1759 + }
1760 + else if (predicate) {
1761 + }
1762 + else {
1763 + throw new Error("Creating or removing a listener requires one of the known fields for matching an action");
1764 + }
1765 + assertFunction(effect, "options.listener");
1766 + return { predicate: predicate, type: type, effect: effect };
1767 +};
1768 +var createListenerEntry = function (options) {
1769 + var _c = getListenerEntryPropsFrom(options), type = _c.type, predicate = _c.predicate, effect = _c.effect;
1770 + var id = nanoid();
1771 + var entry = {
1772 + id: id,
1773 + effect: effect,
1774 + type: type,
1775 + predicate: predicate,
1776 + pending: new Set(),
1777 + unsubscribe: function () {
1778 + throw new Error("Unsubscribe not initialized");
1779 + }
1780 + };
1781 + return entry;
1782 +};
1783 +var cancelActiveListeners = function (entry) {
1784 + entry.pending.forEach(function (controller) {
1785 + abortControllerWithReason(controller, listenerCancelled);
1786 + });
1787 +};
1788 +var createClearListenerMiddleware = function (listenerMap) {
1789 + return function () {
1790 + listenerMap.forEach(cancelActiveListeners);
1791 + listenerMap.clear();
1792 + };
1793 +};
1794 +var safelyNotifyError = function (errorHandler, errorToNotify, errorInfo) {
1795 + try {
1796 + errorHandler(errorToNotify, errorInfo);
1797 + }
1798 + catch (errorHandlerError) {
1799 + setTimeout(function () {
1800 + throw errorHandlerError;
1801 + }, 0);
1802 + }
1803 +};
1804 +var addListener = createAction(alm + "/add");
1805 +var clearAllListeners = createAction(alm + "/removeAll");
1806 +var removeListener = createAction(alm + "/remove");
1807 +var defaultErrorHandler = function () {
1808 + var args = [];
1809 + for (var _i = 0; _i < arguments.length; _i++) {
1810 + args[_i] = arguments[_i];
1811 + }
1812 + console.error.apply(console, __spreadArray([alm + "/error"], args));
1813 +};
1814 +function createListenerMiddleware(middlewareOptions) {
1815 + var _this = this;
1816 + if (middlewareOptions === void 0) { middlewareOptions = {}; }
1817 + var listenerMap = new Map();
1818 + var extra = middlewareOptions.extra, _c = middlewareOptions.onError, onError = _c === void 0 ? defaultErrorHandler : _c;
1819 + assertFunction(onError, "onError");
1820 + var insertEntry = function (entry) {
1821 + entry.unsubscribe = function () { return listenerMap.delete(entry.id); };
1822 + listenerMap.set(entry.id, entry);
1823 + return function (cancelOptions) {
1824 + entry.unsubscribe();
1825 + if (cancelOptions == null ? void 0 : cancelOptions.cancelActive) {
1826 + cancelActiveListeners(entry);
1827 + }
1828 + };
1829 + };
1830 + var findListenerEntry = function (comparator) {
1831 + for (var _i = 0, _c = Array.from(listenerMap.values()); _i < _c.length; _i++) {
1832 + var entry = _c[_i];
1833 + if (comparator(entry)) {
1834 + return entry;
1835 + }
1836 + }
1837 + return void 0;
1838 + };
1839 + var startListening = function (options) {
1840 + var entry = findListenerEntry(function (existingEntry) { return existingEntry.effect === options.effect; });
1841 + if (!entry) {
1842 + entry = createListenerEntry(options);
1843 + }
1844 + return insertEntry(entry);
1845 + };
1846 + var stopListening = function (options) {
1847 + var _c = getListenerEntryPropsFrom(options), type = _c.type, effect = _c.effect, predicate = _c.predicate;
1848 + var entry = findListenerEntry(function (entry2) {
1849 + var matchPredicateOrType = typeof type === "string" ? entry2.type === type : entry2.predicate === predicate;
1850 + return matchPredicateOrType && entry2.effect === effect;
1851 + });
1852 + if (entry) {
1853 + entry.unsubscribe();
1854 + if (options.cancelActive) {
1855 + cancelActiveListeners(entry);
1856 + }
1857 + }
1858 + return !!entry;
1859 + };
1860 + var notifyListener = function (entry, action, api, getOriginalState) { return __async(_this, null, function () {
1861 + var internalTaskController, take, listenerError_1;
1862 + return __generator(this, function (_c) {
1863 + switch (_c.label) {
1864 + case 0:
1865 + internalTaskController = new AbortController();
1866 + take = createTakePattern(startListening, internalTaskController.signal);
1867 + _c.label = 1;
1868 + case 1:
1869 + _c.trys.push([1, 3, 4, 5]);
1870 + entry.pending.add(internalTaskController);
1871 + return [4 /*yield*/, Promise.resolve(entry.effect(action, assign({}, api, {
1872 + getOriginalState: getOriginalState,
1873 + condition: function (predicate, timeout) { return take(predicate, timeout).then(Boolean); },
1874 + take: take,
1875 + delay: createDelay(internalTaskController.signal),
1876 + pause: createPause(internalTaskController.signal),
1877 + extra: extra,
1878 + signal: internalTaskController.signal,
1879 + fork: createFork(internalTaskController.signal),
1880 + unsubscribe: entry.unsubscribe,
1881 + subscribe: function () {
1882 + listenerMap.set(entry.id, entry);
1883 + },
1884 + cancelActiveListeners: function () {
1885 + entry.pending.forEach(function (controller, _, set) {
1886 + if (controller !== internalTaskController) {
1887 + abortControllerWithReason(controller, listenerCancelled);
1888 + set.delete(controller);
1889 + }
1890 + });
1891 + }
1892 + })))];
1893 + case 2:
1894 + _c.sent();
1895 + return [3 /*break*/, 5];
1896 + case 3:
1897 + listenerError_1 = _c.sent();
1898 + if (!(listenerError_1 instanceof TaskAbortError)) {
1899 + safelyNotifyError(onError, listenerError_1, {
1900 + raisedBy: "effect"
1901 + });
1902 + }
1903 + return [3 /*break*/, 5];
1904 + case 4:
1905 + abortControllerWithReason(internalTaskController, listenerCompleted);
1906 + entry.pending.delete(internalTaskController);
1907 + return [7 /*endfinally*/];
1908 + case 5: return [2 /*return*/];
1909 + }
1910 + });
1911 + }); };
1912 + var clearListenerMiddleware = createClearListenerMiddleware(listenerMap);
1913 + var middleware = function (api) { return function (next) { return function (action) {
1914 + if (!isAction(action)) {
1915 + return next(action);
1916 + }
1917 + if (addListener.match(action)) {
1918 + return startListening(action.payload);
1919 + }
1920 + if (clearAllListeners.match(action)) {
1921 + clearListenerMiddleware();
1922 + return;
1923 + }
1924 + if (removeListener.match(action)) {
1925 + return stopListening(action.payload);
1926 + }
1927 + var originalState = api.getState();
1928 + var getOriginalState = function () {
1929 + if (originalState === INTERNAL_NIL_TOKEN) {
1930 + throw new Error(alm + ": getOriginalState can only be called synchronously");
1931 + }
1932 + return originalState;
1933 + };
1934 + var result;
1935 + try {
1936 + result = next(action);
1937 + if (listenerMap.size > 0) {
1938 + var currentState = api.getState();
1939 + var listenerEntries = Array.from(listenerMap.values());
1940 + for (var _i = 0, listenerEntries_1 = listenerEntries; _i < listenerEntries_1.length; _i++) {
1941 + var entry = listenerEntries_1[_i];
1942 + var runListener = false;
1943 + try {
1944 + runListener = entry.predicate(action, currentState, originalState);
1945 + }
1946 + catch (predicateError) {
1947 + runListener = false;
1948 + safelyNotifyError(onError, predicateError, {
1949 + raisedBy: "predicate"
1950 + });
1951 + }
1952 + if (!runListener) {
1953 + continue;
1954 + }
1955 + notifyListener(entry, action, api, getOriginalState);
1956 + }
1957 + }
1958 + }
1959 + finally {
1960 + originalState = INTERNAL_NIL_TOKEN;
1961 + }
1962 + return result;
1963 + }; }; };
1964 + return {
1965 + middleware: middleware,
1966 + startListening: startListening,
1967 + stopListening: stopListening,
1968 + clearListeners: clearListenerMiddleware
1969 + };
1970 +}
1971 +// src/autoBatchEnhancer.ts
1972 +var SHOULD_AUTOBATCH = "RTK_autoBatch";
1973 +var prepareAutoBatched = function () { return function (payload) {
1974 + var _c;
1975 + return ({
1976 + payload: payload,
1977 + meta: (_c = {}, _c[SHOULD_AUTOBATCH] = true, _c)
1978 + });
1979 +}; };
1980 +var promise;
1981 +var queueMicrotaskShim = typeof queueMicrotask === "function" ? queueMicrotask.bind(typeof window !== "undefined" ? window : typeof __webpack_require__.g !== "undefined" ? __webpack_require__.g : globalThis) : function (cb) { return (promise || (promise = Promise.resolve())).then(cb).catch(function (err) { return setTimeout(function () {
1982 + throw err;
1983 +}, 0); }); };
1984 +var createQueueWithTimer = function (timeout) {
1985 + return function (notify) {
1986 + setTimeout(notify, timeout);
1987 + };
1988 +};
1989 +var rAF = typeof window !== "undefined" && window.requestAnimationFrame ? window.requestAnimationFrame : createQueueWithTimer(10);
1990 +var autoBatchEnhancer = function (options) {
1991 + if (options === void 0) { options = { type: "raf" }; }
1992 + return function (next) { return function () {
1993 + var args = [];
1994 + for (var _i = 0; _i < arguments.length; _i++) {
1995 + args[_i] = arguments[_i];
1996 + }
1997 + var store = next.apply(void 0, args);
1998 + var notifying = true;
1999 + var shouldNotifyAtEndOfTick = false;
2000 + var notificationQueued = false;
2001 + var listeners = new Set();
2002 + var queueCallback = options.type === "tick" ? queueMicrotaskShim : options.type === "raf" ? rAF : options.type === "callback" ? options.queueNotification : createQueueWithTimer(options.timeout);
2003 + var notifyListeners = function () {
2004 + notificationQueued = false;
2005 + if (shouldNotifyAtEndOfTick) {
2006 + shouldNotifyAtEndOfTick = false;
2007 + listeners.forEach(function (l) { return l(); });
2008 + }
2009 + };
2010 + return Object.assign({}, store, {
2011 + subscribe: function (listener2) {
2012 + var wrappedListener = function () { return notifying && listener2(); };
2013 + var unsubscribe = store.subscribe(wrappedListener);
2014 + listeners.add(listener2);
2015 + return function () {
2016 + unsubscribe();
2017 + listeners.delete(listener2);
2018 + };
2019 + },
2020 + dispatch: function (action) {
2021 + var _a;
2022 + try {
2023 + notifying = !((_a = action == null ? void 0 : action.meta) == null ? void 0 : _a[SHOULD_AUTOBATCH]);
2024 + shouldNotifyAtEndOfTick = !notifying;
2025 + if (shouldNotifyAtEndOfTick) {
2026 + if (!notificationQueued) {
2027 + notificationQueued = true;
2028 + queueCallback(notifyListeners);
2029 + }
2030 + }
2031 + return store.dispatch(action);
2032 + }
2033 + finally {
2034 + notifying = true;
2035 + }
2036 + }
2037 + });
2038 + }; };
2039 +};
2040 +// src/index.ts
2041 +(0,immer__WEBPACK_IMPORTED_MODULE_2__.enableES5)();
2042 +
2043 +//# sourceMappingURL=redux-toolkit.esm.js.map
56 2044
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 - }
2045 +/***/ }),
61 2046
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((() => {}));
2047 +/***/ "../assets/dev/js/editor/utils/is-instanceof.js":
2048 +/*!******************************************************!*\
2049 + !*** ../assets/dev/js/editor/utils/is-instanceof.js ***!
2050 + \******************************************************/
2051 +/***/ ((__unused_webpack_module, exports) => {
73 2052
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 - }
2053 +"use strict";
87 2054
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 2055
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 - }
2056 +Object.defineProperty(exports, "__esModule", ({
2057 + value: true
2058 +}));
2059 +exports["default"] = void 0;
2060 +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; } } }; }
2061 +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); }
2062 +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; }
2063 +/**
2064 + * Some FileAPI objects such as FileList, DataTransferItem and DataTransferItemList has inconsistency with the retrieved
2065 + * object (from events, etc.) and the actual JavaScript object so a regular instanceof doesn't work. This function can
2066 + * check whether it's instanceof by using the objects constructor and prototype names.
2067 + *
2068 + * @param object
2069 + * @param constructors
2070 + * @return {boolean}
2071 + */
2072 +var _default = function _default(object, constructors) {
2073 + constructors = Array.isArray(constructors) ? constructors : [constructors];
2074 + var _iterator = _createForOfIteratorHelper(constructors),
2075 + _step;
2076 + try {
2077 + for (_iterator.s(); !(_step = _iterator.n()).done;) {
2078 + var _constructor = _step.value;
2079 + if (object.constructor.name === _constructor.prototype[Symbol.toStringTag]) {
2080 + return true;
2081 + }
2082 + }
2083 + } catch (err) {
2084 + _iterator.e(err);
2085 + } finally {
2086 + _iterator.f();
2087 + }
2088 + return false;
2089 +};
2090 +exports["default"] = _default;
107 2091
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 - }
2092 +/***/ }),
114 2093
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 - }
2094 +/***/ "../assets/dev/js/modules/imports/args-object.js":
2095 +/*!*******************************************************!*\
2096 + !*** ../assets/dev/js/modules/imports/args-object.js ***!
2097 + \*******************************************************/
2098 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
123 2099
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 - }
2100 +"use strict";
131 2101
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 2102
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 - }
2103 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
2104 +Object.defineProperty(exports, "__esModule", ({
2105 + value: true
2106 +}));
2107 +exports["default"] = void 0;
2108 +var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js"));
2109 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
2110 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
2111 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
2112 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
2113 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
2114 +var _instanceType = _interopRequireDefault(__webpack_require__(/*! ./instance-type */ "../assets/dev/js/modules/imports/instance-type.js"));
2115 +var _isInstanceof = _interopRequireDefault(__webpack_require__(/*! ../../editor/utils/is-instanceof */ "../assets/dev/js/editor/utils/is-instanceof.js"));
2116 +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); }; }
2117 +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; } }
2118 +var ArgsObject = /*#__PURE__*/function (_InstanceType) {
2119 + (0, _inherits2.default)(ArgsObject, _InstanceType);
2120 + var _super = _createSuper(ArgsObject);
2121 + /**
2122 + * Function constructor().
2123 + *
2124 + * Create ArgsObject.
2125 + *
2126 + * @param {{}} args
2127 + */
2128 + function ArgsObject(args) {
2129 + var _this;
2130 + (0, _classCallCheck2.default)(this, ArgsObject);
2131 + _this = _super.call(this);
2132 + _this.args = args;
2133 + return _this;
2134 + }
150 2135
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 - }
2136 + /**
2137 + * Function requireArgument().
2138 + *
2139 + * Validate property in args.
2140 + *
2141 + * @param {string} property
2142 + * @param {{}} args
2143 + *
2144 + * @throws {Error}
2145 + *
2146 + */
2147 + (0, _createClass2.default)(ArgsObject, [{
2148 + key: "requireArgument",
2149 + value: function requireArgument(property) {
2150 + var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.args;
2151 + if (!Object.prototype.hasOwnProperty.call(args, property)) {
2152 + throw Error("".concat(property, " is required."));
2153 + }
2154 + }
161 2155
162 -//#endregion
163 -//#region node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js
164 - function _arrayWithHoles(r) {
165 - if (Array.isArray(r)) return r;
166 - }
2156 + /**
2157 + * Function requireArgumentType().
2158 + *
2159 + * Validate property in args using `type === typeof(args.whatever)`.
2160 + *
2161 + * @param {string} property
2162 + * @param {string} type
2163 + * @param {{}} args
2164 + *
2165 + * @throws {Error}
2166 + *
2167 + */
2168 + }, {
2169 + key: "requireArgumentType",
2170 + value: function requireArgumentType(property, type) {
2171 + var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.args;
2172 + this.requireArgument(property, args);
2173 + if ((0, _typeof2.default)(args[property]) !== type) {
2174 + throw Error("".concat(property, " invalid type: ").concat(type, "."));
2175 + }
2176 + }
167 2177
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 - }
2178 + /**
2179 + * Function requireArgumentInstance().
2180 + *
2181 + * Validate property in args using `args.whatever instanceof instance`.
2182 + *
2183 + * @param {string} property
2184 + * @param {*} instance
2185 + * @param {{}} args
2186 + *
2187 + * @throws {Error}
2188 + *
2189 + */
2190 + }, {
2191 + key: "requireArgumentInstance",
2192 + value: function requireArgumentInstance(property, instance) {
2193 + var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.args;
2194 + this.requireArgument(property, args);
2195 + if (!(args[property] instanceof instance) && !(0, _isInstanceof.default)(args[property], instance)) {
2196 + throw Error("".concat(property, " invalid instance."));
2197 + }
2198 + }
197 2199
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");
2200 + /**
2201 + * Function requireArgumentConstructor().
2202 + *
2203 + * Validate property in args using `type === args.whatever.constructor`.
2204 + *
2205 + * @param {string} property
2206 + * @param {*} type
2207 + * @param {{}} args
2208 + *
2209 + * @throws {Error}
2210 + *
2211 + */
2212 + }, {
2213 + key: "requireArgumentConstructor",
2214 + value: function requireArgumentConstructor(property, type) {
2215 + var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.args;
2216 + this.requireArgument(property, args);
206 2217
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");
2218 + // Note: Converting the constructor to string in order to avoid equation issues
2219 + // due to different memory addresses between iframes (window.Object !== window.top.Object).
2220 + if (args[property].constructor.toString() !== type.prototype.constructor.toString()) {
2221 + throw Error("".concat(property, " invalid constructor type."));
2222 + }
2223 + }
2224 + }], [{
2225 + key: "getInstanceType",
2226 + value: function getInstanceType() {
2227 + return 'ArgsObject';
2228 + }
2229 + }]);
2230 + return ArgsObject;
2231 +}(_instanceType.default);
2232 +exports["default"] = ArgsObject;
217 2233
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 - }
2234 +/***/ }),
223 2235
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 - }
2236 +/***/ "../assets/dev/js/modules/imports/instance-type.js":
2237 +/*!*********************************************************!*\
2238 + !*** ../assets/dev/js/modules/imports/instance-type.js ***!
2239 + \*********************************************************/
2240 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
229 2241
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 - }
2242 +"use strict";
236 2243
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 2244
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 - }();
2245 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
2246 +Object.defineProperty(exports, "__esModule", ({
2247 + value: true
2248 +}));
2249 +exports["default"] = void 0;
2250 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
2251 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
2252 +var _get2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/get */ "../node_modules/@babel/runtime/helpers/get.js"));
2253 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
2254 +var InstanceType = /*#__PURE__*/function (_Symbol$hasInstance) {
2255 + function InstanceType() {
2256 + var _this = this;
2257 + (0, _classCallCheck2.default)(this, InstanceType);
2258 + // Since anonymous classes sometimes do not get validated by babel, do it manually.
2259 + var target = this instanceof InstanceType ? this.constructor : void 0;
2260 + var prototypes = [];
2261 + while (target.__proto__ && target.__proto__.name) {
2262 + prototypes.push(target.__proto__);
2263 + target = target.__proto__;
2264 + }
2265 + prototypes.reverse().forEach(function (proto) {
2266 + return _this instanceof proto;
2267 + });
2268 + }
2269 + (0, _createClass2.default)(InstanceType, null, [{
2270 + key: _Symbol$hasInstance,
2271 + value: function value(target) {
2272 + /**
2273 + * This is function extending being called each time JS uses instanceOf, since babel use it each time it create new class
2274 + * its give's opportunity to mange capabilities of instanceOf operator.
2275 + * saving current class each time will give option later to handle instanceOf manually.
2276 + */
2277 + var result = (0, _get2.default)((0, _getPrototypeOf2.default)(InstanceType), Symbol.hasInstance, this).call(this, target);
302 2278
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");
2279 + // Act normal when validate a class, which does not have instance type.
2280 + if (target && !target.constructor.getInstanceType) {
2281 + return result;
2282 + }
2283 + if (target) {
2284 + if (!target.instanceTypes) {
2285 + target.instanceTypes = [];
2286 + }
2287 + if (!result) {
2288 + if (this.getInstanceType() === target.constructor.getInstanceType()) {
2289 + result = true;
2290 + }
2291 + }
2292 + if (result) {
2293 + var name = this.getInstanceType === InstanceType.getInstanceType ? 'BaseInstanceType' : this.getInstanceType();
2294 + if (-1 === target.instanceTypes.indexOf(name)) {
2295 + target.instanceTypes.push(name);
2296 + }
2297 + }
2298 + }
2299 + if (!result && target) {
2300 + // Check if the given 'target', is instance of known types.
2301 + result = target.instanceTypes && Array.isArray(target.instanceTypes) && -1 !== target.instanceTypes.indexOf(this.getInstanceType());
2302 + }
2303 + return result;
2304 + }
2305 + }, {
2306 + key: "getInstanceType",
2307 + value: function getInstanceType() {
2308 + elementorModules.ForceMethodImplementation();
2309 + }
2310 + }]);
2311 + return InstanceType;
2312 +}(Symbol.hasInstance);
2313 +exports["default"] = InstanceType;
391 2314
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);
2315 +/***/ }),
473 2316
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 - }();
2317 +/***/ "../assets/dev/js/modules/imports/module.js":
2318 +/*!**************************************************!*\
2319 + !*** ../assets/dev/js/modules/imports/module.js ***!
2320 + \**************************************************/
2321 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
497 2322
498 -//#endregion
499 -//#region modules/web-cli/assets/js/utils/deprecation.js
2323 +"use strict";
2324 +
2325 +
2326 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
2327 +var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js"));
2328 +var Module = function Module() {
2329 + var $ = jQuery,
2330 + instanceParams = arguments,
2331 + self = this,
2332 + events = {};
2333 + var settings;
2334 + var ensureClosureMethods = function ensureClosureMethods() {
2335 + $.each(self, function (methodName) {
2336 + var oldMethod = self[methodName];
2337 + if ('function' !== typeof oldMethod) {
2338 + return;
2339 + }
2340 + self[methodName] = function () {
2341 + return oldMethod.apply(self, arguments);
2342 + };
2343 + });
2344 + };
2345 + var initSettings = function initSettings() {
2346 + settings = self.getDefaultSettings();
2347 + var instanceSettings = instanceParams[0];
2348 + if (instanceSettings) {
2349 + $.extend(true, settings, instanceSettings);
2350 + }
2351 + };
2352 + var init = function init() {
2353 + self.__construct.apply(self, instanceParams);
2354 + ensureClosureMethods();
2355 + initSettings();
2356 + self.trigger('init');
2357 + };
2358 + this.getItems = function (items, itemKey) {
2359 + if (itemKey) {
2360 + var keyStack = itemKey.split('.'),
2361 + currentKey = keyStack.splice(0, 1);
2362 + if (!keyStack.length) {
2363 + return items[currentKey];
2364 + }
2365 + if (!items[currentKey]) {
2366 + return;
2367 + }
2368 + return this.getItems(items[currentKey], keyStack.join('.'));
2369 + }
2370 + return items;
2371 + };
2372 + this.getSettings = function (setting) {
2373 + return this.getItems(settings, setting);
2374 + };
2375 + this.setSettings = function (settingKey, value, settingsContainer) {
2376 + if (!settingsContainer) {
2377 + settingsContainer = settings;
2378 + }
2379 + if ('object' === (0, _typeof2.default)(settingKey)) {
2380 + $.extend(settingsContainer, settingKey);
2381 + return self;
2382 + }
2383 + var keyStack = settingKey.split('.'),
2384 + currentKey = keyStack.splice(0, 1);
2385 + if (!keyStack.length) {
2386 + settingsContainer[currentKey] = value;
2387 + return self;
2388 + }
2389 + if (!settingsContainer[currentKey]) {
2390 + settingsContainer[currentKey] = {};
2391 + }
2392 + return self.setSettings(keyStack.join('.'), value, settingsContainer[currentKey]);
2393 + };
2394 + this.getErrorMessage = function (type, functionName) {
2395 + var message;
2396 + switch (type) {
2397 + case 'forceMethodImplementation':
2398 + message = "The method '".concat(functionName, "' must to be implemented in the inheritor child.");
2399 + break;
2400 + default:
2401 + message = 'An error occurs';
2402 + }
2403 + return message;
2404 + };
2405 +
2406 + // TODO: This function should be deleted ?.
2407 + this.forceMethodImplementation = function (functionName) {
2408 + throw new Error(this.getErrorMessage('forceMethodImplementation', functionName));
2409 + };
2410 + this.on = function (eventName, callback) {
2411 + if ('object' === (0, _typeof2.default)(eventName)) {
2412 + $.each(eventName, function (singleEventName) {
2413 + self.on(singleEventName, this);
2414 + });
2415 + return self;
2416 + }
2417 + var eventNames = eventName.split(' ');
2418 + eventNames.forEach(function (singleEventName) {
2419 + if (!events[singleEventName]) {
2420 + events[singleEventName] = [];
2421 + }
2422 + events[singleEventName].push(callback);
2423 + });
2424 + return self;
2425 + };
2426 + this.off = function (eventName, callback) {
2427 + if (!events[eventName]) {
2428 + return self;
2429 + }
2430 + if (!callback) {
2431 + delete events[eventName];
2432 + return self;
2433 + }
2434 + var callbackIndex = events[eventName].indexOf(callback);
2435 + if (-1 !== callbackIndex) {
2436 + delete events[eventName][callbackIndex];
2437 +
2438 + // Reset array index (for next off on same event).
2439 + events[eventName] = events[eventName].filter(function (val) {
2440 + return val;
2441 + });
2442 + }
2443 + return self;
2444 + };
2445 + this.trigger = function (eventName) {
2446 + var methodName = 'on' + eventName[0].toUpperCase() + eventName.slice(1),
2447 + params = Array.prototype.slice.call(arguments, 1);
2448 + if (self[methodName]) {
2449 + self[methodName].apply(self, params);
2450 + }
2451 + var callbacks = events[eventName];
2452 + if (!callbacks) {
2453 + return self;
2454 + }
2455 + $.each(callbacks, function (index, callback) {
2456 + callback.apply(self, params);
2457 + });
2458 + return self;
2459 + };
2460 + init();
2461 +};
2462 +Module.prototype.__construct = function () {};
2463 +Module.prototype.getDefaultSettings = function () {
2464 + return {};
2465 +};
2466 +Module.prototype.getConstructorID = function () {
2467 + return this.constructor.name;
2468 +};
2469 +Module.extend = function (properties) {
2470 + var $ = jQuery,
2471 + parent = this;
2472 + var child = function child() {
2473 + return parent.apply(this, arguments);
2474 + };
2475 + $.extend(child, parent);
2476 + child.prototype = Object.create($.extend({}, parent.prototype, properties));
2477 + child.prototype.constructor = child;
2478 + child.__super__ = parent.prototype;
2479 + return child;
2480 +};
2481 +module.exports = Module;
2482 +
2483 +/***/ }),
2484 +
2485 +/***/ "../modules/web-cli/assets/js/api.js":
2486 +/*!*******************************************!*\
2487 + !*** ../modules/web-cli/assets/js/api.js ***!
2488 + \*******************************************/
2489 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
2490 +
2491 +"use strict";
2492 +
2493 +
2494 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
2495 +var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js");
2496 +Object.defineProperty(exports, "__esModule", ({
2497 + value: true
2498 +}));
2499 +exports["default"] = void 0;
2500 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
2501 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
2502 +var _backwardsCompatibility = _interopRequireDefault(__webpack_require__(/*! ./core/backwards-compatibility */ "../modules/web-cli/assets/js/core/backwards-compatibility.js"));
2503 +var _commandBase = _interopRequireDefault(__webpack_require__(/*! ./modules/command-base */ "../modules/web-cli/assets/js/modules/command-base.js"));
2504 +var _commandInternalBase = _interopRequireDefault(__webpack_require__(/*! ./modules/command-internal-base */ "../modules/web-cli/assets/js/modules/command-internal-base.js"));
2505 +var _commandData = _interopRequireDefault(__webpack_require__(/*! ./modules/command-data */ "../modules/web-cli/assets/js/modules/command-data.js"));
2506 +var _commands = _interopRequireDefault(__webpack_require__(/*! ./core/commands */ "../modules/web-cli/assets/js/core/commands.js"));
2507 +var _commandsInternal = _interopRequireDefault(__webpack_require__(/*! ./core/commands-internal */ "../modules/web-cli/assets/js/core/commands-internal.js"));
2508 +var _componentBase = _interopRequireDefault(__webpack_require__(/*! ./modules/component-base */ "../modules/web-cli/assets/js/modules/component-base.js"));
2509 +var _componentModalBase = _interopRequireDefault(__webpack_require__(/*! ./modules/component-modal-base */ "../modules/web-cli/assets/js/modules/component-modal-base.js"));
2510 +var _components = _interopRequireDefault(__webpack_require__(/*! ./core/components */ "../modules/web-cli/assets/js/core/components.js"));
2511 +var _data = _interopRequireDefault(__webpack_require__(/*! ./core/data.js */ "../modules/web-cli/assets/js/core/data.js"));
2512 +var _hashCommands = _interopRequireDefault(__webpack_require__(/*! ./extras/hash-commands */ "../modules/web-cli/assets/js/extras/hash-commands.js"));
2513 +var _hookBreak = _interopRequireDefault(__webpack_require__(/*! ./modules/hook-break */ "../modules/web-cli/assets/js/modules/hook-break.js"));
2514 +var _hooks = _interopRequireDefault(__webpack_require__(/*! ./core/hooks */ "../modules/web-cli/assets/js/core/hooks.js"));
2515 +var _routes = _interopRequireDefault(__webpack_require__(/*! ./core/routes */ "../modules/web-cli/assets/js/core/routes.js"));
2516 +var _shortcuts = _interopRequireDefault(__webpack_require__(/*! ./core/shortcuts */ "../modules/web-cli/assets/js/core/shortcuts.js"));
2517 +var _store = _interopRequireDefault(__webpack_require__(/*! ./core/store */ "../modules/web-cli/assets/js/core/store.js"));
2518 +var _uiStates = _interopRequireDefault(__webpack_require__(/*! ./core/ui-states */ "../modules/web-cli/assets/js/core/ui-states.js"));
2519 +var hookData = _interopRequireWildcard(__webpack_require__(/*! ./modules/hooks/data/ */ "../modules/web-cli/assets/js/modules/hooks/data/index.js"));
2520 +var hookUI = _interopRequireWildcard(__webpack_require__(/*! ./modules/hooks/ui */ "../modules/web-cli/assets/js/modules/hooks/ui/index.js"));
2521 +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); }
2522 +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; }
2523 +/* Alphabetical order */
2524 +var API = /*#__PURE__*/function () {
2525 + /**
2526 + * Function constructor().
2527 + *
2528 + * Create's 'elementor' api.
2529 + */
2530 + function API() {
2531 + (0, _classCallCheck2.default)(this, API);
2532 + this.components = new _components.default();
2533 + this.commands = new _commands.default();
2534 + this.commandsInternal = new _commandsInternal.default();
2535 + this.hooks = new _hooks.default();
2536 + this.routes = new _routes.default();
2537 + this.shortcuts = new _shortcuts.default(jQuery(window));
2538 + this.data = new _data.default();
2539 + this.store = new _store.default();
2540 + this.uiStates = new _uiStates.default();
2541 + this.modules = {
2542 + CommandBase: _commandBase.default,
2543 + CommandInternalBase: _commandInternalBase.default,
2544 + CommandData: _commandData.default,
2545 + ComponentBase: _componentBase.default,
2546 + ComponentModalBase: _componentModalBase.default,
2547 + HookBreak: _hookBreak.default,
2548 + hookData: hookData,
2549 + hookUI: hookUI
2550 + };
2551 + this.extras = {
2552 + hashCommands: new _hashCommands.default()
2553 + };
2554 +
2555 + // Backwards compatibility should be last, in order to handle others.
2556 + this.bc = new _backwardsCompatibility.default();
2557 + }
2558 +
2559 + /**
2560 + * Function run().
2561 + *
2562 + * Alias of `$e.commands.run()`.
2563 + *
2564 + * @param {string} command
2565 + * @param {*} [args={}]
2566 + *
2567 + * @return {*} result
2568 + */
2569 + (0, _createClass2.default)(API, [{
2570 + key: "run",
2571 + value: function run(command) {
2572 + var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2573 + return $e.commands.run(command, args);
2574 + }
2575 +
2576 + /**
2577 + * Function internal().
2578 + *
2579 + * Alias of `$e.commandsInternal.run()`.
2580 + *
2581 + * @param {string} command
2582 + * @param {*} [args={}]
2583 + *
2584 + * @return {boolean} result
2585 + */
2586 + }, {
2587 + key: "internal",
2588 + value: function internal(command) {
2589 + var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2590 + return $e.commandsInternal.run(command, args);
2591 + }
2592 +
2593 + /**
2594 + * Function route().
2595 + *
2596 + * Alias of `$e.routes.to()`.
2597 + *
2598 + * @param {string} route
2599 + * @param {*} [args={}]
2600 + */
2601 + }, {
2602 + key: "route",
2603 + value: function route(_route) {
2604 + var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
2605 + return $e.routes.to(_route, args);
2606 + }
2607 +
2608 + // TODO: shortcut();
2609 + }]);
2610 + return API;
2611 +}();
2612 +exports["default"] = API;
2613 +
2614 +/***/ }),
2615 +
2616 +/***/ "../modules/web-cli/assets/js/core/backwards-compatibility.js":
2617 +/*!********************************************************************!*\
2618 + !*** ../modules/web-cli/assets/js/core/backwards-compatibility.js ***!
2619 + \********************************************************************/
2620 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
2621 +
2622 +"use strict";
2623 +
2624 +
2625 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
2626 +Object.defineProperty(exports, "__esModule", ({
2627 + value: true
2628 +}));
2629 +exports["default"] = void 0;
2630 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
2631 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
2632 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
2633 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
2634 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
2635 +var _componentBase = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/component-base */ "../modules/web-cli/assets/js/modules/component-base.js"));
2636 +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); }; }
2637 +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; } }
2638 +var BackwardsCompatibility = /*#__PURE__*/function () {
2639 + function BackwardsCompatibility() {
2640 + (0, _classCallCheck2.default)(this, BackwardsCompatibility);
2641 + }
2642 + (0, _createClass2.default)(BackwardsCompatibility, [{
2643 + key: "ensureTab",
2644 + value: function ensureTab(namespace, tabSlug) {
2645 + var page = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
2646 + var component = $e.components.get(namespace);
2647 + if (!component) {
2648 + var Component = /*#__PURE__*/function (_ComponentBase) {
2649 + (0, _inherits2.default)(Component, _ComponentBase);
2650 + var _super = _createSuper(Component);
2651 + function Component() {
2652 + (0, _classCallCheck2.default)(this, Component);
2653 + return _super.apply(this, arguments);
2654 + }
2655 + (0, _createClass2.default)(Component, [{
2656 + key: "getNamespace",
2657 + value: function getNamespace() {
2658 + return namespace;
2659 + }
2660 + }, {
2661 + key: "renderTab",
2662 + value: function renderTab(tab) {
2663 + elementor.getPanelView().setPage(page).activateTab(tab);
2664 + }
2665 + }]);
2666 + return Component;
2667 + }(_componentBase.default);
2668 + component = $e.components.register(new Component());
2669 + }
2670 + if (!component.hasTab(tabSlug) && elementor.config.tabs[tabSlug]) {
2671 + component.addTab(tabSlug, {
2672 + title: elementor.config.tabs[tabSlug]
2673 + });
2674 + }
2675 + }
2676 + }]);
2677 + return BackwardsCompatibility;
2678 +}();
2679 +exports["default"] = BackwardsCompatibility;
2680 +
2681 +/***/ }),
2682 +
2683 +/***/ "../modules/web-cli/assets/js/core/backwards-compatibility/commands.js":
2684 +/*!*****************************************************************************!*\
2685 + !*** ../modules/web-cli/assets/js/core/backwards-compatibility/commands.js ***!
2686 + \*****************************************************************************/
2687 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
2688 +
2689 +"use strict";
2690 +
2691 +
2692 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
2693 +Object.defineProperty(exports, "__esModule", ({
2694 + value: true
2695 +}));
2696 +exports["default"] = void 0;
2697 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
2698 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
2699 +var _assertThisInitialized2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ "../node_modules/@babel/runtime/helpers/assertThisInitialized.js"));
2700 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
2701 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
2702 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
2703 +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
2704 +var _module = _interopRequireDefault(__webpack_require__(/*! elementor-assets-js/modules/imports/module.js */ "../assets/dev/js/modules/imports/module.js"));
2705 +var _deprecation = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/deprecation */ "../modules/web-cli/assets/js/utils/deprecation.js"));
2706 +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); }; }
2707 +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; } }
2708 +var CommandsBackwardsCompatibility = /*#__PURE__*/function (_Module) {
2709 + (0, _inherits2.default)(CommandsBackwardsCompatibility, _Module);
2710 + var _super = _createSuper(CommandsBackwardsCompatibility);
2711 + function CommandsBackwardsCompatibility() {
2712 + var _this;
2713 + (0, _classCallCheck2.default)(this, CommandsBackwardsCompatibility);
2714 + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
2715 + args[_key] = arguments[_key];
2716 + }
2717 + _this = _super.call.apply(_super, [this].concat(args));
2718 + (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "on", function (eventName, callback) {
2719 + if ('run' === eventName) {
2720 + var componentName = _this.getConstructorID();
2721 +
2722 + // Regex takes the first letter and convert it to lower case.
2723 + componentName = componentName.replace(/^./, function (val) {
2724 + return val.toLowerCase();
2725 + });
2726 + _deprecation.default.deprecated("$e.".concat(componentName, ".on( 'run', ... )"), '3.0.0', "$e.".concat(componentName, ".on( 'run:before', ... )"));
2727 + _this.onOrig('run:before', callback);
2728 + return;
2729 + }
2730 + _this.onOrig(eventName, callback);
2731 + });
2732 + return _this;
2733 + }
2734 + (0, _createClass2.default)(CommandsBackwardsCompatibility, [{
2735 + key: "__construct",
2736 + value: function __construct() {
2737 + this.onOrig = this.on;
2738 + }
2739 + }]);
2740 + return CommandsBackwardsCompatibility;
2741 +}(_module.default);
2742 +exports["default"] = CommandsBackwardsCompatibility;
2743 +
2744 +/***/ }),
2745 +
2746 +/***/ "../modules/web-cli/assets/js/core/commands-internal.js":
2747 +/*!**************************************************************!*\
2748 + !*** ../modules/web-cli/assets/js/core/commands-internal.js ***!
2749 + \**************************************************************/
2750 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
2751 +
2752 +"use strict";
2753 +
2754 +
2755 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
2756 +Object.defineProperty(exports, "__esModule", ({
2757 + value: true
2758 +}));
2759 +exports["default"] = void 0;
2760 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
2761 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
2762 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
2763 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
2764 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
2765 +var _commands = _interopRequireDefault(__webpack_require__(/*! ./commands.js */ "../modules/web-cli/assets/js/core/commands.js"));
2766 +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); }; }
2767 +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; } }
2768 +var CommandsInternal = /*#__PURE__*/function (_Commands) {
2769 + (0, _inherits2.default)(CommandsInternal, _Commands);
2770 + var _super = _createSuper(CommandsInternal);
2771 + function CommandsInternal() {
2772 + (0, _classCallCheck2.default)(this, CommandsInternal);
2773 + return _super.apply(this, arguments);
2774 + }
2775 + (0, _createClass2.default)(CommandsInternal, [{
2776 + key: "error",
2777 + value: function error(message) {
2778 + throw Error('Commands internal: ' + message);
2779 + }
2780 + }]);
2781 + return CommandsInternal;
2782 +}(_commands.default);
2783 +exports["default"] = CommandsInternal;
2784 +
2785 +/***/ }),
2786 +
2787 +/***/ "../modules/web-cli/assets/js/core/commands.js":
2788 +/*!*****************************************************!*\
2789 + !*** ../modules/web-cli/assets/js/core/commands.js ***!
2790 + \*****************************************************/
2791 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
2792 +
2793 +"use strict";
2794 +
2795 +
2796 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
2797 +Object.defineProperty(exports, "__esModule", ({
2798 + value: true
2799 +}));
2800 +exports["default"] = void 0;
2801 +var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ "../node_modules/@babel/runtime/regenerator/index.js"));
2802 +var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "../node_modules/@babel/runtime/helpers/asyncToGenerator.js"));
2803 +var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js"));
2804 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
2805 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
2806 +var _assertThisInitialized2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ "../node_modules/@babel/runtime/helpers/assertThisInitialized.js"));
2807 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
2808 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
2809 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
2810 +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
2811 +var _commands = _interopRequireDefault(__webpack_require__(/*! ./backwards-compatibility/commands */ "../modules/web-cli/assets/js/core/backwards-compatibility/commands.js"));
2812 +var _commandBase = _interopRequireDefault(__webpack_require__(/*! ../modules/command-base */ "../modules/web-cli/assets/js/modules/command-base.js"));
2813 +var _console = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/console */ "../modules/web-cli/assets/js/utils/console.js"));
2814 +var _deprecation = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/deprecation */ "../modules/web-cli/assets/js/utils/deprecation.js"));
2815 +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; }
2816 +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; }
2817 +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); }; }
2818 +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 2819 /**
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 - }();
2820 + * @typedef {import('../modules/component-base')} ComponentBase
2821 + */
2822 +/**
2823 + * @typedef {import('../modules/command-base')} CommandBase
2824 + */
2825 +/**
2826 + * @typedef {{}} Component
2827 + */
2828 +var Commands = /*#__PURE__*/function (_CommandsBackwardsCom) {
2829 + (0, _inherits2.default)(Commands, _CommandsBackwardsCom);
2830 + var _super = _createSuper(Commands);
2831 + /**
2832 + * Function constructor().
2833 + *
2834 + * Create `$e.commands` API.
2835 + *
2836 + * @param {{}} args
2837 + */
2838 + function Commands() {
2839 + var _this;
2840 + (0, _classCallCheck2.default)(this, Commands);
2841 + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
2842 + args[_key] = arguments[_key];
2843 + }
2844 + _this = _super.call.apply(_super, [this].concat(args));
2845 + _this.current = {};
2846 + _this.currentArgs = {};
2847 + _this.currentTrace = [];
2848 + _this.commands = {};
2849 + _this.components = {};
2850 + Object.defineProperty((0, _assertThisInitialized2.default)(_this), 'classes', {
2851 + get: function get() {
2852 + _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,');
2853 + return _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, $e.commands.commands), $e.commandsInternal.commands), $e.data.commands), $e.routes.commands);
2854 + }
2855 + });
2856 + return _this;
2857 + }
583 2858
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);
2859 + /**
2860 + * @param {string} id
2861 + * @return {CommandBase} command class
2862 + */
2863 + (0, _createClass2.default)(Commands, [{
2864 + key: "getCommandClass",
2865 + value: function getCommandClass(id) {
2866 + return this.commands[id];
2867 + }
731 2868
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);
2869 + /**
2870 + * Function getAll().
2871 + *
2872 + * Receive all loaded commands.
2873 + *
2874 + * @return {string[]} commands
2875 + */
2876 + }, {
2877 + key: "getAll",
2878 + value: function getAll() {
2879 + return Object.keys(this.commands).sort();
2880 + }
820 2881
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);
2882 + /**
2883 + * Function register().
2884 + *
2885 + * Register new command.
2886 + *
2887 + * @param {ComponentBase|string} component
2888 + * @param {string} command
2889 + * @param {Function} callback
2890 + *
2891 + * @return {Commands} commands
2892 + */
2893 + }, {
2894 + key: "register",
2895 + value: function register(component, command, callback) {
2896 + var _this2 = this;
2897 + var namespace;
2898 + if ('string' === typeof component) {
2899 + namespace = component;
2900 + component = $e.components.get(namespace);
2901 + if (!component) {
2902 + this.error("'".concat(namespace, "' component is not exist."));
2903 + }
2904 + } else {
2905 + namespace = component.getNamespace();
2906 + }
2907 + var fullCommand = namespace + (command ? '/' + command : '');
2908 + if (this.commands[fullCommand]) {
2909 + this.error("`".concat(fullCommand, "` is already registered."));
2910 + }
2911 + this.commands[fullCommand] = callback;
2912 + this.components[fullCommand] = namespace;
2913 + var shortcuts = component.getShortcuts(),
2914 + shortcut = shortcuts[command];
2915 + if (shortcut) {
2916 + shortcut.command = fullCommand;
2917 + shortcut.callback = function (event) {
2918 + return _this2.runShortcut(fullCommand, event);
2919 + };
2920 + $e.shortcuts.register(shortcut.keys, shortcut);
2921 + }
2922 + return this;
2923 + }
2924 + }, {
2925 + key: "unregister",
2926 + value: function unregister(component, command) {
2927 + var namespace;
2928 + if ('string' === typeof component) {
2929 + namespace = component;
2930 + component = $e.components.get(namespace);
2931 + if (!component) {
2932 + this.error("'".concat(namespace, "' component is not exist."));
2933 + }
2934 + } else {
2935 + namespace = component.getNamespace();
2936 + }
2937 + var fullCommand = namespace + (command ? '/' + command : '');
2938 + if (!this.commands[fullCommand]) {
2939 + this.error("`".concat(fullCommand, "` not exist."));
2940 + }
2941 + delete this.commands[fullCommand];
2942 + delete this.components[fullCommand];
2943 + var shortcuts = component.getShortcuts(),
2944 + shortcut = shortcuts[command];
2945 + if (shortcut) {
2946 + $e.shortcuts.unregister(shortcut.keys, shortcut);
2947 + }
2948 + return this;
2949 + }
863 2950
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 - }));
2951 + /**
2952 + * Function getComponent().
2953 + *
2954 + * Receive Component of the command.
2955 + *
2956 + * @param {string} command
2957 + *
2958 + * @return {Component} component
2959 + */
2960 + }, {
2961 + key: "getComponent",
2962 + value: function getComponent(command) {
2963 + var namespace = this.components[command];
2964 + return $e.components.get(namespace);
2965 + }
997 2966
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 - }
2967 + /**
2968 + * Function is().
2969 + *
2970 + * Checks if current running command is the same parameter command.
2971 + *
2972 + * @param {string} command
2973 + *
2974 + * @return {boolean} is this command the same as the one passed in the arguments
2975 + */
2976 + }, {
2977 + key: "is",
2978 + value: function is(command) {
2979 + var component = this.getComponent(command);
2980 + if (!component) {
2981 + return false;
2982 + }
2983 + return command === this.current[component.getServiceName()];
2984 + }
1008 2985
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");
2986 + /**
2987 + * Function isCurrentFirstTrace().
2988 + *
2989 + * Checks if parameter command is the first command in trace that currently running.
2990 + *
2991 + * @param {string} command
2992 + *
2993 + * @return {boolean} is parameter command the first command in trace that currently running
2994 + */
2995 + }, {
2996 + key: "isCurrentFirstTrace",
2997 + value: function isCurrentFirstTrace(command) {
2998 + return command === this.getCurrentFirstTrace();
2999 + }
1020 3000
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 - }
3001 + /**
3002 + * Function getCurrent().
3003 + *
3004 + * Receive currently running components and its commands.
3005 + *
3006 + * @param {string} container
3007 + *
3008 + * @return {{}|boolean|*} currently running components
3009 + */
3010 + }, {
3011 + key: "getCurrent",
3012 + value: function getCurrent() {
3013 + var container = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
3014 + if (container) {
3015 + if (!this.current[container]) {
3016 + return false;
3017 + }
3018 + return this.current[container];
3019 + }
3020 + return this.current;
3021 + }
1030 3022
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 - }
3023 + /**
3024 + * Function getCurrentArgs().
3025 + *
3026 + * Receive currently running command args.
3027 + *
3028 + * @param {string} container
3029 + *
3030 + * @return {{}|boolean|*} current arguments
3031 + */
3032 + }, {
3033 + key: "getCurrentArgs",
3034 + value: function getCurrentArgs() {
3035 + var container = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
3036 + if (container) {
3037 + if (!this.currentArgs[container]) {
3038 + return false;
3039 + }
3040 + return this.currentArgs[container];
3041 + }
3042 + return this.currentArgs;
3043 + }
1053 3044
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");
3045 + /**
3046 + * Function getCurrentFirst().
3047 + *
3048 + * Receive first command that currently running.
3049 + *
3050 + * @return {string} first running command
3051 + */
3052 + }, {
3053 + key: "getCurrentFirst",
3054 + value: function getCurrentFirst() {
3055 + return Object.values(this.current)[0];
3056 + }
1094 3057
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);
3058 + /**
3059 + * Function getCurrentLast().
3060 + *
3061 + * Receive last command that currently running.
3062 + *
3063 + * @return {string} last running command
3064 + */
3065 + }, {
3066 + key: "getCurrentLast",
3067 + value: function getCurrentLast() {
3068 + var current = Object.values(this.current);
3069 + return current[current.length - 1];
3070 + }
1645 3071
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 - }();
3072 + /**
3073 + * Function getCurrentFirstTrace().
3074 + *
3075 + * Receive first command in trace that currently running
3076 + *
3077 + * @return {string} first command in trace
3078 + */
3079 + }, {
3080 + key: "getCurrentFirstTrace",
3081 + value: function getCurrentFirstTrace() {
3082 + return this.currentTrace[0];
3083 + }
1695 3084
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);
3085 + /**
3086 + * Function beforeRun().
3087 + *
3088 + * Responsible to add current command to trace and trigger 'run:before' event.
3089 + * Run before command.
3090 + *
3091 + * @param {string} command
3092 + * @param {{}} args
3093 + * @param {boolean} [addTrace=true]
3094 + */
3095 + }, {
3096 + key: "beforeRun",
3097 + value: function beforeRun(command) {
3098 + var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
3099 + var addTrace = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
3100 + var component = this.getComponent(command),
3101 + container = component.getServiceName();
3102 + if (addTrace) {
3103 + this.addCurrentTrace(container, command, args);
3104 + }
3105 + if (args.onBefore) {
3106 + args.onBefore.apply(component, [args]);
3107 + }
3108 + this.trigger('run:before', component, command, args);
3109 + window.dispatchEvent(new CustomEvent('elementor/commands/run/before', {
3110 + detail: {
3111 + command: command,
3112 + args: args
3113 + }
3114 + }));
3115 + }
1728 3116
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));
3117 + /**
3118 + * Function validateRun().
3119 + *
3120 + * Responsible to validate if the run is even possible.
3121 + * Runs immediately after entering `run()`.
3122 + *
3123 + * @param {string} command
3124 + * @param {*} args
3125 + *
3126 + * @return {boolean} dependency result
3127 + */
3128 + }, {
3129 + key: "validateRun",
3130 + value: function validateRun(command) {
3131 + var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
3132 + if (!this.commands[command]) {
3133 + this.error("`".concat(command, "` not found."));
3134 + }
3135 + return this.getComponent(command).dependency(command, args);
3136 + }
1821 3137
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);
3138 + /**
3139 + * Function run().
3140 + *
3141 + * Runs a command.
3142 + *
3143 + * @param {string} command
3144 + * @param {{}} args
3145 + *
3146 + * @return {boolean|*} results
3147 + */
3148 + }, {
3149 + key: "run",
3150 + value: function run(command) {
3151 + var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
3152 + if (!this.validateRun(command, args)) {
3153 + return false;
3154 + }
3155 + this.beforeRun(command, args);
1850 3156
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);
3157 + // Get command class or callback.
3158 + var context = this.commands[command];
1884 3159
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 - });
3160 + // Is it command-base based class?
3161 + if (context.getInstanceType) {
3162 + context = new context(args);
3163 + }
3164 + var currentComponent = this.getComponent(command);
1891 3165
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);
3166 + // Is simple callback? (e.g. a route)
3167 + if (!(context instanceof _commandBase.default)) {
3168 + var results = context.apply(currentComponent, [args]);
3169 + this.afterRun(command, args, results);
3170 + return results;
3171 + }
3172 + if (!this.validateInstanceScope(context, currentComponent, command)) {
3173 + return this.removeCurrentTrace(currentComponent);
3174 + }
3175 + return this.runInstance(context);
3176 + }
2109 3177
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 - }
3178 + /**
3179 + * Function runInstance().
3180 + *
3181 + * @param {CommandBase} instance
3182 + *
3183 + * @return {boolean|Promise<*>}
3184 + */
3185 + }, {
3186 + key: "runInstance",
3187 + value: function runInstance(instance) {
3188 + var results = null;
2138 3189
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 - }));
3190 + // For UI Hooks.
3191 + instance.onBeforeRun(instance.args);
3192 + try {
3193 + // For data hooks.
3194 + instance.onBeforeApply(instance.args);
3195 + results = instance.run();
3196 + } catch (e) {
3197 + this.catchApply(e, instance);
3198 + if (e instanceof $e.modules.HookBreak) {
3199 + this.removeCurrentTrace(instance.component);
3200 + return false;
3201 + }
3202 + }
3203 + return this.applyRunAfter(instance, results);
3204 + }
2147 3205
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 - }));
3206 + /**
3207 + * Function applyRunAfter().
3208 + *
3209 + * Responsible for applying everything that need to be run after each command runs.
3210 + * Called on run() after runInstance(), to manipulate results & apply 'after' hooks.
3211 + *
3212 + * @param {CommandBase} instance
3213 + * @param {*} result
3214 + *
3215 + * @return {Promise<*>|*}
3216 + */
3217 + }, {
3218 + key: "applyRunAfter",
3219 + value: function applyRunAfter(instance, result) {
3220 + var _this3 = this;
3221 + // TODO: Temp code determine if it's a jQuery deferred object.
3222 + if (result && 'object' === (0, _typeof2.default)(result) && result.promise && result.then && result.fail) {
3223 + var handleJQueryDeferred = function handleJQueryDeferred(_result) {
3224 + _result.fail(function (e) {
3225 + _this3.catchApply(e, instance);
3226 + _this3.afterRun(instance.command, instance.args, e);
3227 + });
3228 + _result.done(function (__result) {
3229 + _this3.applyRunAfterSync(instance, __result);
3230 + });
3231 + return _result;
3232 + };
3233 + return handleJQueryDeferred(result);
3234 + } else if (result instanceof Promise) {
3235 + return this.applyRunAfterAsync(instance, result);
3236 + }
3237 + this.applyRunAfterSync(instance, result);
3238 + return result;
3239 + }
2174 3240
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 - }));
3241 + /**
3242 + * Function applyRunAfterSync().
3243 + *
3244 + * Responsible to handle simple(synchronous) 'run after' behavior.
3245 + * Called on applyRunAfterSync() after runInstance(), to handle results.
3246 + *
3247 + * @param {CommandBase} instance
3248 + * @param {*} result
3249 + */
3250 + }, {
3251 + key: "applyRunAfterSync",
3252 + value: function applyRunAfterSync(instance, result) {
3253 + // Run Data hooks.
3254 + instance.onAfterApply(instance.args, result);
2268 3255
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 - }));
3256 + // For UI hooks.
3257 + instance.onAfterRun(instance.args, result);
3258 + this.afterRun(instance.command, instance.args, result);
3259 + }
2306 3260
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 - }));
3261 + /**
3262 + * Function applyRunAfterAsync().
3263 + *
3264 + * Await for promise result.
3265 + * Called on applyRunAfter() after runInstance().
3266 + *
3267 + * @param {CommandBase} instance
3268 + * @param {*} result
3269 + */
3270 + }, {
3271 + key: "applyRunAfterAsync",
3272 + value: function applyRunAfterAsync(instance, result) {
3273 + var _this4 = this;
3274 + // Override initial result ( promise ) to await onAfter promises, first!.
3275 + return (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
3276 + return _regenerator.default.wrap(function _callee$(_context) {
3277 + while (1) switch (_context.prev = _context.next) {
3278 + case 0:
3279 + _context.next = 2;
3280 + return result.catch(function (e) {
3281 + _this4.catchApply(e, instance);
3282 + _this4.afterRun(instance.command, instance.args, e);
3283 + });
3284 + case 2:
3285 + _context.next = 4;
3286 + return result.then(function (_result) {
3287 + return _this4.applyRunAfterAsyncResult(instance, _result);
3288 + });
3289 + case 4:
3290 + return _context.abrupt("return", result);
3291 + case 5:
3292 + case "end":
3293 + return _context.stop();
3294 + }
3295 + }, _callee);
3296 + }))();
3297 + }
2317 3298
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 - }));
3299 + /**
3300 + * Function applyRunAfterAsyncResult().
3301 + *
3302 + * Responsible to await all promises results.
3303 + * Called on applyRunAfterAsync() after runInstance(), to handle async results.
3304 + * Awaits all the promises, before releasing the command.
3305 + *
3306 + * @param {CommandBase} instance
3307 + * @param {*} result
3308 + */
3309 + }, {
3310 + key: "applyRunAfterAsyncResult",
3311 + value: function () {
3312 + var _applyRunAfterAsyncResult = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(instance, result) {
3313 + var results, promises;
3314 + return _regenerator.default.wrap(function _callee2$(_context2) {
3315 + while (1) switch (_context2.prev = _context2.next) {
3316 + case 0:
3317 + // Run Data hooks.
3318 + results = instance.onAfterApply(instance.args, result), promises = Array.isArray(results) ? results.flat().filter(function (filtered) {
3319 + return filtered instanceof Promise;
3320 + }) : [];
3321 + if (!promises.length) {
3322 + _context2.next = 4;
3323 + break;
3324 + }
3325 + _context2.next = 4;
3326 + return Promise.all(promises);
3327 + case 4:
3328 + // For UI hooks.
3329 + instance.onAfterRun(instance.args, result);
3330 + this.afterRun(instance.command, instance.args, result);
3331 + case 6:
3332 + case "end":
3333 + return _context2.stop();
3334 + }
3335 + }, _callee2, this);
3336 + }));
3337 + function applyRunAfterAsyncResult(_x, _x2) {
3338 + return _applyRunAfterAsyncResult.apply(this, arguments);
3339 + }
3340 + return applyRunAfterAsyncResult;
3341 + }()
3342 + /**
3343 + * Function afterRun().
3344 + *
3345 + * Responsible to to clear command from trace, and run 'run:after' event.
3346 + * Method fired after the command runs.
3347 + *
3348 + * @param {string} command
3349 + * @param {{}} args
3350 + * @param {*} results
3351 + * @param {boolean} [removeTrace=true]
3352 + */
3353 + }, {
3354 + key: "afterRun",
3355 + value: function afterRun(command, args) {
3356 + var results = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;
3357 + var removeTrace = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true;
3358 + var component = this.getComponent(command);
3359 + if (args.onAfter) {
3360 + args.onAfter.apply(component, [args, results]);
3361 + }
3362 + this.trigger('run:after', component, command, args, results);
3363 + window.dispatchEvent(new CustomEvent('elementor/commands/run/after', {
3364 + detail: {
3365 + command: command,
3366 + args: args
3367 + }
3368 + }));
3369 + if (removeTrace) {
3370 + this.removeCurrentTrace(component);
3371 + }
3372 + }
2330 3373
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 - }));
3374 + /**
3375 + * @param {Error} e
3376 + * @param {CommandBase} instance
3377 + */
3378 + }, {
3379 + key: "catchApply",
3380 + value: function catchApply(e, instance) {
3381 + instance.onCatchApply(e);
3382 + _console.default.error(e);
3383 + }
2345 3384
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 - }));
3385 + /**
3386 + * Function runShortcut().
3387 + *
3388 + * Run shortcut.
3389 + *
3390 + * It's separated in order to allow override.
3391 + *
3392 + * @param {string} command
3393 + * @param {*} event
3394 + *
3395 + * @return {boolean|*} result
3396 + */
3397 + }, {
3398 + key: "runShortcut",
3399 + value: function runShortcut(command, event) {
3400 + return this.run(command, event);
3401 + }
3402 + }, {
3403 + key: "validateInstanceScope",
3404 + value: function validateInstanceScope(instance, currentComponent, command) {
3405 + if (!(instance instanceof _commandBase.default)) {
3406 + this.error("invalid instance, command: '".concat(command, "' "));
3407 + }
2359 3408
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 - }));
3409 + // In case of different scope.
3410 + if (currentComponent !== instance.component) {
3411 + if ($e.devTools) {
3412 + $e.devTools.log.warn("Command: '".concat(command, "' registerArgs.component: '").concat(instance.component.getNamespace(), "' while current component is: '").concat(currentComponent.getNamespace(), "'"));
3413 + }
3414 + return false;
3415 + }
3416 + return true;
3417 + }
3418 + }, {
3419 + key: "addCurrentTrace",
3420 + value: function addCurrentTrace(container, command, args) {
3421 + this.currentTrace.push(command);
3422 + Commands.trace.push(command);
3423 + this.attachCurrent(container, command, args);
3424 + }
3425 + }, {
3426 + key: "removeCurrentTrace",
3427 + value: function removeCurrentTrace(currentComponent) {
3428 + var container = currentComponent.getServiceName();
3429 + this.currentTrace.pop();
3430 + Commands.trace.pop();
3431 + this.detachCurrent(container);
3432 + }
3433 + }, {
3434 + key: "attachCurrent",
3435 + value: function attachCurrent(container, command, args) {
3436 + this.current[container] = command;
3437 + this.currentArgs[container] = args;
3438 + }
3439 + }, {
3440 + key: "detachCurrent",
3441 + value: function detachCurrent(container) {
3442 + delete this.current[container];
3443 + delete this.currentArgs[container];
3444 + }
2381 3445
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 - }));
3446 + /**
3447 + * Function error().
3448 + *
3449 + * Throws error.
3450 + *
3451 + * @throws {Error}
3452 + *
3453 + * @param {string} message
3454 + */
3455 + }, {
3456 + key: "error",
3457 + value: function error(message) {
3458 + throw Error("Commands: ".concat(message));
3459 + }
3460 + }]);
3461 + return Commands;
3462 +}(_commands.default);
3463 +exports["default"] = Commands;
3464 +(0, _defineProperty2.default)(Commands, "trace", []);
2463 3465
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 - }));
3466 +/***/ }),
2476 3467
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);
3468 +/***/ "../modules/web-cli/assets/js/core/components.js":
3469 +/*!*******************************************************!*\
3470 + !*** ../modules/web-cli/assets/js/core/components.js ***!
3471 + \*******************************************************/
3472 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
2521 3473
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", []);
3474 +"use strict";
2940 3475
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 3476
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);
3477 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
3478 +Object.defineProperty(exports, "__esModule", ({
3479 + value: true
3480 +}));
3481 +exports["default"] = void 0;
3482 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
3483 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
3484 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
3485 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
3486 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
3487 +var _module = _interopRequireDefault(__webpack_require__(/*! elementor-assets-js/modules/imports/module.js */ "../assets/dev/js/modules/imports/module.js"));
3488 +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); }; }
3489 +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; } }
3490 +/**
3491 + * @typedef {{}} Component
3492 + */
3493 +var _default = /*#__PURE__*/function (_Module) {
3494 + (0, _inherits2.default)(_default, _Module);
3495 + var _super = _createSuper(_default);
3496 + function _default() {
3497 + var _this;
3498 + (0, _classCallCheck2.default)(this, _default);
3499 + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
3500 + args[_key] = arguments[_key];
3501 + }
3502 + _this = _super.call.apply(_super, [this].concat(args));
3503 + _this.components = {};
3504 + _this.activeComponents = {};
3505 + return _this;
3506 + }
3507 + (0, _createClass2.default)(_default, [{
3508 + key: "getAll",
3509 + value: function getAll() {
3510 + return Object.keys(this.components).sort();
3511 + }
3512 + }, {
3513 + key: "register",
3514 + value: function register(component) {
3515 + if (this.components[component.getNamespace()]) {
3516 + return;
3517 + }
3518 + component.registerAPI();
3519 + this.components[component.getNamespace()] = component;
3520 + return component;
3521 + }
2998 3522
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);
3523 + /**
3524 + * @param {string} id
3525 + * @return {Component} component
3526 + */
3527 + }, {
3528 + key: "get",
3529 + value: function get(id) {
3530 + return this.components[id];
3531 + }
3532 + }, {
3533 + key: "getActive",
3534 + value: function getActive() {
3535 + return this.activeComponents;
3536 + }
3537 + }, {
3538 + key: "activate",
3539 + value: function activate(namespace) {
3540 + // Add as last.
3541 + this.inactivate(namespace);
3542 + this.activeComponents[namespace] = true;
3543 + }
3544 + }, {
3545 + key: "inactivate",
3546 + value: function inactivate(namespace) {
3547 + delete this.activeComponents[namespace];
3548 + }
3549 + }, {
3550 + key: "isActive",
3551 + value: function isActive(namespace) {
3552 + return !!this.activeComponents[namespace];
3553 + }
3554 + }]);
3555 + return _default;
3556 +}(_module.default);
3557 +exports["default"] = _default;
3027 3558
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);
3559 +/***/ }),
3057 3560
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 - });
3561 +/***/ "../modules/web-cli/assets/js/core/data.js":
3562 +/*!*************************************************!*\
3563 + !*** ../modules/web-cli/assets/js/core/data.js ***!
3564 + \*************************************************/
3565 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
3065 3566
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);
3567 +"use strict";
3151 3568
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 3569
3231 -//#endregion
3232 -//#region modules/web-cli/assets/js/core/data/storages/base-storage.js
3570 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
3571 +Object.defineProperty(exports, "__esModule", ({
3572 + value: true
3573 +}));
3574 +exports["default"] = exports.READABLE = exports.EDITABLE = exports.DELETABLE = exports.CREATABLE = exports.ALLMETHODS = void 0;
3575 +var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ "../node_modules/@babel/runtime/regenerator/index.js"));
3576 +var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "../node_modules/@babel/runtime/helpers/asyncToGenerator.js"));
3577 +var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js"));
3578 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
3579 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
3580 +var _assertThisInitialized2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ "../node_modules/@babel/runtime/helpers/assertThisInitialized.js"));
3581 +var _get2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/get */ "../node_modules/@babel/runtime/helpers/get.js"));
3582 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
3583 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
3584 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
3585 +var _argsObject = _interopRequireDefault(__webpack_require__(/*! elementor-assets-js/modules/imports/args-object */ "../assets/dev/js/modules/imports/args-object.js"));
3586 +var _commands = _interopRequireDefault(__webpack_require__(/*! ./commands.js */ "../modules/web-cli/assets/js/core/commands.js"));
3587 +var _cache = _interopRequireDefault(__webpack_require__(/*! ./data/cache */ "../modules/web-cli/assets/js/core/data/cache.js"));
3588 +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); }; }
3589 +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 3590 /**
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 - }();
3591 + * @typedef {('create'|'delete'|'get'|'update'|'options')} DataTypes
3592 + */
3593 +/**
3594 + * @typedef {import('../modules/component-base')} ComponentBase
3595 + */
3596 +/**
3597 + * @typedef {{}} RequestInfo
3598 + */
3297 3599
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_");
3600 +/**
3601 + * @typedef {{}} RequestData
3602 + * @property {ComponentBase} component component
3603 + * @property {string} command command
3604 + * @property {{}} args arguments
3605 + * @property {DataTypes} type type
3606 + * @property {number} timestamp timestamp
3607 + * @property {string} endpoint endpoint
3608 + *
3609 + * @property {string} [baseEndpointURL] baseEndpointURL
3610 + * @property {string} [namespace] namespace
3611 + * @property {string} [version] version
3612 + * @property {('hit'|'miss')} [cache] cache
3613 + */
3373 3614
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);
3615 +/**
3616 + * @typedef {Object} ExtractedCommand
3617 + * @property {string} command command
3618 + * @property {Object} args arguments
3619 + */
3407 3620
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 - }();
3621 +// TODO: Return it from the server. Original at WP_REST_Server.
3622 +var READABLE = ['GET'],
3623 + CREATABLE = ['POST'],
3624 + EDITABLE = ['POST', 'PUT', 'PATCH'],
3625 + DELETABLE = ['DELETE'],
3626 + ALLMETHODS = ['GET', 'POST', 'PUT', 'PATCH', 'DELETE'];
3627 +exports.ALLMETHODS = ALLMETHODS;
3628 +exports.DELETABLE = DELETABLE;
3629 +exports.EDITABLE = EDITABLE;
3630 +exports.CREATABLE = CREATABLE;
3631 +exports.READABLE = READABLE;
3632 +var Data = /*#__PURE__*/function (_Commands) {
3633 + (0, _inherits2.default)(Data, _Commands);
3634 + var _super = _createSuper(Data);
3635 + function Data() {
3636 + var _this;
3637 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
3638 + (0, _classCallCheck2.default)(this, Data);
3639 + _this = _super.call(this, args);
3640 + _this.args = Object.assign(args, {
3641 + namespace: 'elementor',
3642 + version: '1',
3643 + baseEndpointURL: elementorWebCliConfig.urls.rest
3644 + });
3645 + _this.cache = new _cache.default((0, _assertThisInitialized2.default)(_this));
3646 + _this.validatedRequests = {};
3647 + _this.commandFormats = {};
3648 + return _this;
3649 + }
3562 3650
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);
3651 + /**
3652 + * Function getHTTPMethod().
3653 + *
3654 + * Returns HTTP Method by type.
3655 + *
3656 + * @param {DataTypes} type
3657 + *
3658 + * @return {string|boolean} HTTP Method
3659 + */
3660 + (0, _createClass2.default)(Data, [{
3661 + key: "getHTTPMethod",
3662 + value: function getHTTPMethod(type) {
3663 + switch (type) {
3664 + case 'create':
3665 + return 'POST';
3666 + case 'delete':
3667 + return 'DELETE';
3668 + case 'get':
3669 + return 'GET';
3670 + case 'update':
3671 + return 'PUT';
3672 + case 'options':
3673 + return 'OPTIONS';
3674 + }
3675 + return false;
3676 + }
4030 3677
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 - }();
3678 + /**
3679 + * Function getAllowedMethods().
3680 + *
3681 + * Returns allowed HTTP methods by type.
3682 + *
3683 + * @param {DataTypes} type
3684 + *
3685 + * @return {[string]|boolean} allowed HTTP methods
3686 + */
3687 + }, {
3688 + key: "getAllowedMethods",
3689 + value: function getAllowedMethods(type) {
3690 + switch (type) {
3691 + case 'create':
3692 + return CREATABLE;
3693 + case 'delete':
3694 + return DELETABLE;
3695 + case 'get':
3696 + return READABLE;
3697 + case 'update':
3698 + return EDITABLE;
3699 + case 'options':
3700 + return ['OPTIONS'];
3701 + }
3702 + return false;
3703 + }
4298 3704
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));
3705 + /**
3706 + * Function getEndpointURL().
3707 + *
3708 + * Get remote endpoint address.
3709 + *
3710 + * @param {RequestData} requestData
3711 + * @param {string} [endpoint=requestData.endpoint]
3712 + *
3713 + * @return {string} endpoint address
3714 + */
3715 + }, {
3716 + key: "getEndpointURL",
3717 + value: function getEndpointURL(requestData) {
3718 + var endpoint = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : requestData.endpoint;
3719 + // Allow to request data override default namespace and args.
3720 + var _requestData$baseEndp = requestData.baseEndpointURL,
3721 + baseEndpointURL = _requestData$baseEndp === void 0 ? this.args.baseEndpointURL : _requestData$baseEndp,
3722 + _requestData$namespac = requestData.namespace,
3723 + namespace = _requestData$namespac === void 0 ? this.args.namespace : _requestData$namespac,
3724 + _requestData$version = requestData.version,
3725 + version = _requestData$version === void 0 ? this.args.version : _requestData$version;
3726 + return "".concat(baseEndpointURL).concat(namespace, "/v").concat(version, "/") + endpoint;
3727 + }
4322 3728
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);
3729 + /**
3730 + * Function commandToEndpoint().
3731 + *
3732 + * Convert command to endpoint.
3733 + *
3734 + * For example `component/command/{arg}` => `controller/endpoint/8`.
3735 + *
3736 + * TODO: Find a better solution.
3737 + *
3738 + * @param {string} command
3739 + * @param {{}} args
3740 + * @param {string|null} [format]
3741 + *
3742 + * @return {string} endpoint
3743 + */
3744 + }, {
3745 + key: "commandToEndpoint",
3746 + value: function commandToEndpoint(command, args) {
3747 + var format = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
3748 + var endpoint = command;
3749 + var argsQueryLength = args !== null && args !== void 0 && args.query ? Object.values(args.query).length : 0;
3750 + if (argsQueryLength && format && format.includes('/{')) {
3751 + // Means command includes magic query arguments ( controller/endpoint/{whatever} ).
3752 + var magicParams = format.split('/').filter(function (str) {
3753 + return '{' === str.charAt(0);
3754 + });
3755 + magicParams.forEach(function (param) {
3756 + // Remove the '{', '}'.
3757 + param = param.replace('{', '');
3758 + param = param.replace('}', '');
3759 + var formatted = Object.entries(args.query).find(function (_ref) {
3760 + var _ref2 = (0, _slicedToArray2.default)(_ref, 1),
3761 + key = _ref2[0];
3762 + return key === param;
3763 + });
3764 + if (!formatted) {
3765 + return;
3766 + }
3767 + var key = formatted[0],
3768 + value = formatted[1].toString();
4584 3769
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);
3770 + // Replace magic params with values.
3771 + format = format.replace(new RegExp('{' + param + '}', 'g'), value);
3772 + delete args.query[key];
3773 + });
3774 + }
3775 + if (format) {
3776 + endpoint = format;
3777 + }
4669 3778
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);
3779 + // If requested magic param does not exist in args, need to remove it to have fixed endpoint.
3780 + // eg: 'documents/{documentId}/elements/{elementId}' and args { documentId: 4123 }.
3781 + // result: 'documents/4123/elements'
3782 + if (format && endpoint.includes('/{')) {
3783 + endpoint = endpoint.substring(0, endpoint.indexOf('/{'));
3784 + }
3785 + if (args.query && Object.values(args.query).length) {
3786 + // Sorting since the endpoint later will be used as key to store the cache.
3787 + var queryEntries = Object.entries(args.query).sort(function (_ref3, _ref4) {
3788 + var _ref5 = (0, _slicedToArray2.default)(_ref3, 1),
3789 + aKey = _ref5[0];
3790 + var _ref6 = (0, _slicedToArray2.default)(_ref4, 1),
3791 + bKey = _ref6[0];
3792 + return aKey - bKey;
3793 + } // Sort by param name.
3794 + );
4735 3795
4736 -//#endregion
4737 -//#region modules/web-cli/assets/js/core/hooks.js
3796 + // `args.query` will become a part of GET params.
3797 + if (queryEntries.length) {
3798 + endpoint += '?';
3799 + queryEntries.forEach(function (_ref7) {
3800 + var _ref8 = (0, _slicedToArray2.default)(_ref7, 2),
3801 + name = _ref8[0],
3802 + value = _ref8[1];
3803 + // Replace the character '/' with the encoded version,
3804 + // mostly because when saving this endpoint value to the cache it splits the url base on the '/' character.
3805 + value = "".concat(value).replace(/\//g, '%2F');
3806 + endpoint += name + '=' + value + '&';
3807 + });
3808 + }
3809 +
3810 + // If last character is '&' remove it.
3811 + endpoint = endpoint.replace(/&$/, '');
3812 + }
3813 + return endpoint;
3814 + }
3815 +
3816 + /**
3817 + * Function commandExtractArgs().
3818 + *
3819 + * If the command have query convert it to args.
3820 + *
3821 + * @param {string} command
3822 + * @param {Object} args
3823 + *
3824 + * @return {ExtractedCommand} command
3825 + */
3826 + }, {
3827 + key: "commandExtractArgs",
3828 + value: function commandExtractArgs(command) {
3829 + var _command;
3830 + var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
3831 + if ((_command = command) !== null && _command !== void 0 && _command.includes('?')) {
3832 + if (!args.query) {
3833 + args.query = {};
3834 + }
3835 + var commandParts = command.split('?'),
3836 + pureCommand = commandParts[0],
3837 + queryString = commandParts[1],
3838 + query = new URLSearchParams(queryString);
3839 + Object.assign(args.query, Object.fromEntries(query));
3840 + command = pureCommand;
3841 + }
3842 + return {
3843 + command: command,
3844 + args: args
3845 + };
3846 + }
3847 +
3848 + /**
3849 + * Function validateRequestData().
3850 + *
3851 + * Validate request data requirements.
3852 + *
3853 + * @param {RequestData} requestData
3854 + * @param {boolean} [requireArgsData]
3855 + */
3856 + }, {
3857 + key: "validateRequestData",
3858 + value: function validateRequestData(requestData) {
3859 + var requireArgsData = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
3860 + // Do not validate if its already valid.
3861 + if (requestData.timestamp && this.validatedRequests[requestData.timestamp]) {
3862 + return;
3863 + }
3864 + var argsObject = new _argsObject.default(requestData);
3865 + argsObject.requireArgument('component');
3866 + argsObject.requireArgumentType('command', 'string');
3867 + argsObject.requireArgumentType('endpoint', 'string');
3868 + if (requireArgsData) {
3869 + argsObject.requireArgumentType('data', 'object', requestData.args);
3870 + }
3871 +
3872 + // Ensure timestamp.
3873 + if (!requestData.timestamp) {
3874 + requestData.timestamp = new Date().getTime();
3875 + }
3876 + this.validatedRequests[requestData.timestamp] = true;
3877 + }
3878 +
3879 + /**
3880 + * Function prepareHeaders().
3881 + *
3882 + * Prepare the headers for each request.
3883 + *
3884 + * @param {RequestData} requestData
3885 + *
3886 + * @return {{}} params
3887 + */
3888 + }, {
3889 + key: "prepareHeaders",
3890 + value: function prepareHeaders(requestData) {
3891 + var _requestData$args, _requestData$args$opt;
3892 + var type = requestData.type,
3893 + nonce = elementorWebCliConfig.nonce,
3894 + params = {
3895 + 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,
3896 + credentials: 'include' // Cookies is required for wp reset.
3897 + },
3898 + headers = {
3899 + 'X-WP-Nonce': nonce
3900 + };
3901 +
3902 + /**
3903 + * Translate:
3904 + * 'create, delete, get, update' to HTTP Methods:
3905 + * 'GET, POST, PUT, PATCH, DELETE'
3906 + */
3907 + var allowedMethods = this.getAllowedMethods(type),
3908 + method = this.getHTTPMethod(type);
3909 + if ('GET' === method) {
3910 + Object.assign(params, {
3911 + headers: headers
3912 + });
3913 + } else if (allowedMethods) {
3914 + var _requestData$args2, _requestData$args3;
3915 + if (['POST', 'PUT'].includes(method) && !((_requestData$args2 = requestData.args) !== null && _requestData$args2 !== void 0 && _requestData$args2.data)) {
3916 + throw Error('Invalid requestData.args.data');
3917 + }
3918 + Object.assign(headers, {
3919 + 'Content-Type': 'application/json'
3920 + });
3921 + if ((_requestData$args3 = requestData.args) !== null && _requestData$args3 !== void 0 && _requestData$args3.headers) {
3922 + Object.assign(headers, requestData.args.headers);
3923 + }
3924 + Object.assign(params, {
3925 + method: method,
3926 + headers: headers,
3927 + body: 'application/json' === headers['Content-Type'] ? JSON.stringify(requestData.args.data) : requestData.args.data
3928 + });
3929 + } else {
3930 + throw Error("Invalid type: '".concat(type, "'"));
3931 + }
3932 + return params;
3933 + }
3934 +
3935 + /**
3936 + * Function prepareEndpoint().
3937 + *
3938 + * This method response for building a final endpoint,
3939 + * the main problem is with plain permalink mode + command with query params that creates a weird url,
3940 + * the current method should fix it.
3941 + *
3942 + * @param {RequestData} requestData
3943 + *
3944 + * @return {string} Endpoint URL
3945 + */
3946 + }, {
3947 + key: "prepareEndpoint",
3948 + value: function prepareEndpoint(requestData) {
3949 + var splitEndpoint = requestData.endpoint.split('?'),
3950 + endpoint = splitEndpoint.shift();
3951 + var endpointAddress = this.getEndpointURL(requestData, endpoint);
3952 + if (splitEndpoint.length) {
3953 + var separator = endpointAddress.includes('?') ? '&' : '?';
3954 + endpointAddress += separator + splitEndpoint.pop();
3955 + }
3956 + return endpointAddress;
3957 + }
3958 +
3959 + /**
3960 + * Function fetch().
3961 + *
3962 + * @param {RequestData} requestData
3963 + * @param {function(RequestInfo,*) : Promise<Response> } [fetchAPI]
3964 + *
3965 + * @return {Promise<Response>} response
3966 + */
3967 + }, {
3968 + key: "fetch",
3969 + value: function fetch(requestData) {
3970 + var _requestData$args$opt2,
3971 + _this2 = this;
3972 + var fetchAPI = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : window.fetch;
3973 + requestData.cache = 'miss';
3974 + var refresh = (_requestData$args$opt2 = requestData.args.options) === null || _requestData$args$opt2 === void 0 ? void 0 : _requestData$args$opt2.refresh,
3975 + getCache = 'get' === requestData.type && !refresh,
3976 + saveCache = ['create', 'get'].includes(requestData.type) && !refresh;
3977 + if (getCache) {
3978 + var cachePromise = this.cache.getAsync(requestData);
3979 + if (cachePromise) {
3980 + return cachePromise;
3981 + }
3982 + }
3983 + var params = this.prepareHeaders(requestData);
3984 + // eslint-disable-next-line no-async-promise-executor
3985 + return new Promise( /*#__PURE__*/function () {
3986 + var _ref9 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(resolve, reject) {
3987 + var endpoint, request, response;
3988 + return _regenerator.default.wrap(function _callee2$(_context2) {
3989 + while (1) switch (_context2.prev = _context2.next) {
3990 + case 0:
3991 + _context2.prev = 0;
3992 + endpoint = _this2.prepareEndpoint(requestData);
3993 + request = fetchAPI(endpoint, params);
3994 + _context2.next = 5;
3995 + return request.then( /*#__PURE__*/function () {
3996 + var _ref10 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(_response) {
3997 + return _regenerator.default.wrap(function _callee$(_context) {
3998 + while (1) switch (_context.prev = _context.next) {
3999 + case 0:
4000 + if (_response.ok) {
4001 + _context.next = 6;
4002 + break;
4003 + }
4004 + if (!_response.headers.get('content-type').includes('application/json')) {
4005 + _context.next = 5;
4006 + break;
4007 + }
4008 + _context.next = 4;
4009 + return _response.json();
4010 + case 4:
4011 + _response = _context.sent;
4012 + case 5:
4013 + throw _response;
4014 + case 6:
4015 + return _context.abrupt("return", _response.json());
4016 + case 7:
4017 + case "end":
4018 + return _context.stop();
4019 + }
4020 + }, _callee);
4021 + }));
4022 + return function (_x3) {
4023 + return _ref10.apply(this, arguments);
4024 + };
4025 + }());
4026 + case 5:
4027 + response = _context2.sent;
4028 + // At this point, it got the resolved response from remote.
4029 + // So load cache, and resolve it.
4030 + if (saveCache) {
4031 + _this2.cache.set(requestData, response);
4032 + }
4033 + resolve(response);
4034 + _context2.next = 13;
4035 + break;
4036 + case 10:
4037 + _context2.prev = 10;
4038 + _context2.t0 = _context2["catch"](0);
4039 + reject(_context2.t0);
4040 + case 13:
4041 + case "end":
4042 + return _context2.stop();
4043 + }
4044 + }, _callee2, null, [[0, 10]]);
4045 + }));
4046 + return function (_x, _x2) {
4047 + return _ref9.apply(this, arguments);
4048 + };
4049 + }());
4050 + }
4051 +
4052 + /**
4053 + * Function getCache().
4054 + *
4055 + * @param {ComponentBase} component
4056 + * @param {string} command
4057 + * @param {{}} query
4058 + *
4059 + * @return {{}} cache object
4060 + */
4061 + }, {
4062 + key: "getCache",
4063 + value: function getCache(component, command) {
4064 + var query = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
4065 + var args = {
4066 + query: query
4067 + };
4068 + return this.cache.get({
4069 + endpoint: this.commandToEndpoint(command, args, this.commandFormats[command]),
4070 + component: component,
4071 + command: command,
4072 + args: args
4073 + });
4074 + }
4075 +
4076 + /**
4077 + * Function setCache().
4078 + *
4079 + * @param {ComponentBase} component
4080 + * @param {string} command
4081 + * @param {{}} query
4082 + * @param {*} data
4083 + */
4084 + }, {
4085 + key: "setCache",
4086 + value: function setCache(component, command, query, data) {
4087 + var args = {
4088 + query: query
4089 + };
4090 + this.cache.set({
4091 + endpoint: this.commandToEndpoint(command, args, this.commandFormats[command]),
4092 + component: component,
4093 + command: command,
4094 + args: args
4095 + }, data);
4096 + }
4097 +
4098 + /**
4099 + * Function updateCache().
4100 + *
4101 + * The difference between 'setCache' and 'updateCache' is update will only modify exist values.
4102 + * and 'setCache' will create or update.
4103 + *
4104 + * @param {ComponentBase} component
4105 + * @param {string} command
4106 + * @param {{}} query
4107 + * @param {*} data
4108 + */
4109 + }, {
4110 + key: "updateCache",
4111 + value: function updateCache(component, command, query, data) {
4112 + var args = {
4113 + query: query,
4114 + data: data
4115 + };
4116 + this.cache.update({
4117 + endpoint: this.commandToEndpoint(command, args, this.commandFormats[command]),
4118 + component: component,
4119 + command: command,
4120 + args: args
4121 + });
4122 + }
4123 +
4124 + /**
4125 + * Function deleteCache().
4126 + *
4127 + * @param {ComponentBase} component
4128 + * @param {string} command
4129 + * @param {{}} query
4130 + */
4131 + }, {
4132 + key: "deleteCache",
4133 + value: function deleteCache(component, command) {
4134 + var query = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
4135 + var args = {
4136 + query: query
4137 + };
4138 + this.cache.delete({
4139 + endpoint: this.commandToEndpoint(command, args, this.commandFormats[command]),
4140 + component: component,
4141 + command: command,
4142 + args: args
4143 + });
4144 + }
4145 +
4146 + /**
4147 + * Function registerFormat().
4148 + *
4149 + * Register's format for each command.
4150 + *
4151 + * @param {string} command
4152 + * @param {string} format
4153 + */
4154 + }, {
4155 + key: "registerFormat",
4156 + value: function registerFormat(command, format) {
4157 + this.commandFormats[command] = format;
4158 + }
4159 +
4160 + /**
4161 + * Function create().
4162 + *
4163 + * Run a command, that will be translated as endpoint for creating new data.
4164 + *
4165 + * @param {string} command
4166 + * @param {*} data
4167 + * @param {{}} query
4168 + * @param {{}} options
4169 + *
4170 + * @return {*} result
4171 + */
4172 + }, {
4173 + key: "create",
4174 + value: function create(command, data) {
4175 + var query = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
4176 + var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
4177 + return this.run('create', command, {
4178 + query: query,
4179 + options: options,
4180 + data: data
4181 + });
4182 + }
4183 +
4184 + /**
4185 + * Function delete().
4186 + *
4187 + * Run a command, that will be translated as endpoint for deleting data.
4188 + *
4189 + * @param {string} command
4190 + * @param {{}} query
4191 + * @param {{}} options
4192 + *
4193 + * @return {*} result
4194 + */
4195 + }, {
4196 + key: "delete",
4197 + value: function _delete(command) {
4198 + var query = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
4199 + var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
4200 + return this.run('delete', command, {
4201 + query: query,
4202 + options: options
4203 + });
4204 + }
4205 +
4206 + /**
4207 + * Function get().
4208 + *
4209 + * Run a command, that will be translated as endpoint for getting data.
4210 + *
4211 + * @param {string} command
4212 + * @param {{}} query
4213 + * @param {{}} options
4214 + *
4215 + * @return {*} result
4216 + */
4217 + }, {
4218 + key: "get",
4219 + value: function get(command) {
4220 + var query = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
4221 + var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
4222 + return this.run('get', command, {
4223 + query: query,
4224 + options: options
4225 + });
4226 + }
4227 +
4228 + /**
4229 + * Function update().
4230 + *
4231 + * Run a command, that will be translated as endpoint for updating data.
4232 + *
4233 + * @param {string} command
4234 + * @param {*} data
4235 + * @param {{}} query
4236 + * @param {{}} options
4237 + *
4238 + * @return {*} result
4239 + */
4240 + }, {
4241 + key: "update",
4242 + value: function update(command, data) {
4243 + var query = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
4244 + var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
4245 + return this.run('update', command, {
4246 + query: query,
4247 + options: options,
4248 + data: data
4249 + });
4250 + }
4251 +
4252 + /**
4253 + * Function options().
4254 + *
4255 + * Run a command, that will be translated as endpoint for requesting options/information about specific endpoint.
4256 + *
4257 + * @param {string} command
4258 + * @param {{}} query
4259 + * @param {{}} options
4260 + *
4261 + * @return {*} result
4262 + */
4263 + }, {
4264 + key: "options",
4265 + value: function options(command, query) {
4266 + var _options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
4267 + return this.run('options', command, {
4268 + query: query,
4269 + options: _options
4270 + });
4271 + }
4272 + }, {
4273 + key: "register",
4274 + value: function register(component, command, callback) {
4275 + (0, _get2.default)((0, _getPrototypeOf2.default)(Data.prototype), "register", this).call(this, component, command, callback);
4276 + var fullCommandName = component.getNamespace() + '/' + command,
4277 + commandInstance = $e.data.getCommandClass(fullCommandName),
4278 + format = commandInstance !== null && commandInstance !== void 0 && commandInstance.getEndpointFormat ? commandInstance.getEndpointFormat() : false;
4279 + if (format) {
4280 + $e.data.registerFormat(fullCommandName, format);
4281 + }
4282 + return this;
4283 + }
4284 +
4285 + /**
4286 + * TODO: Add JSDOC typedef for args ( query and options ).
4287 + *
4288 + * @param {DataTypes} type
4289 + * @param {string} command
4290 + * @param {{}} args
4291 + *
4292 + * @override
4293 + */
4294 + }, {
4295 + key: "run",
4296 + value: function run(type, command, args) {
4297 + args.options.type = type;
4298 + var _this$commandExtractA = this.commandExtractArgs(command, args);
4299 + command = _this$commandExtractA.command;
4300 + args = _this$commandExtractA.args;
4301 + return (0, _get2.default)((0, _getPrototypeOf2.default)(Data.prototype), "run", this).call(this, command, args);
4302 + }
4303 + }, {
4304 + key: "error",
4305 + value: function error(message) {
4306 + throw Error('Data commands: ' + message);
4307 + }
4308 + }]);
4309 + return Data;
4310 +}(_commands.default);
4311 +exports["default"] = Data;
4312 +
4313 +/***/ }),
4314 +
4315 +/***/ "../modules/web-cli/assets/js/core/data/cache.js":
4316 +/*!*******************************************************!*\
4317 + !*** ../modules/web-cli/assets/js/core/data/cache.js ***!
4318 + \*******************************************************/
4319 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
4320 +
4321 +"use strict";
4322 +
4323 +
4324 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
4325 +Object.defineProperty(exports, "__esModule", ({
4326 + value: true
4327 +}));
4328 +exports["default"] = void 0;
4329 +var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js"));
4330 +var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js"));
4331 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
4332 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
4333 +var _localStorage = _interopRequireDefault(__webpack_require__(/*! ./storages/local-storage */ "../modules/web-cli/assets/js/core/data/storages/local-storage.js"));
4738 4334 /**
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 - }();
4335 + * @typedef {{}} RequestData
4336 + */
4337 +/**
4338 + * @typedef {import('../data')} Data
4339 + */
4340 +/**
4341 + * TODO: Search common logic, create functions to reduce code size.
4342 + */
4343 +var Cache = /*#__PURE__*/function () {
4344 + /**
4345 + * Function constructor().
4346 + *
4347 + * Create cache.
4348 + *
4349 + * @param {Data} manager
4350 + */
4351 + function Cache(manager) {
4352 + (0, _classCallCheck2.default)(this, Cache);
4353 + this.manager = manager;
4354 + this.storage = new _localStorage.default();
4355 + }
4876 4356
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);
4357 + /**
4358 + * Function getAsync().
4359 + *
4360 + * Receive from cache. the difference between getAsync() and get() is that receive return it as promise...
4361 + * to fake fetch mechanism.
4362 + *
4363 + * @param {RequestData} requestData
4364 + *
4365 + * @return {(Promise|boolean)} request data
4366 + */
4367 + (0, _createClass2.default)(Cache, [{
4368 + key: "getAsync",
4369 + value: function getAsync(requestData) {
4370 + var data = this.get(requestData);
4371 + if (null !== data) {
4372 + // If data comes from cache, add 'cache = hit' to requestData.
4373 + requestData.cache = 'hit';
4374 + return new Promise(function (resolve) {
4375 + resolve(data);
4376 + });
4377 + }
5091 4378
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 - };
4379 + // TODO: Check if possible, always return promise and reject it.
4380 + return false;
4381 + }
5119 4382
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 - }();
4383 + /**
4384 + * Function set().
4385 + *
4386 + * set data to cache.
4387 + *
4388 + * The difference between set() and update() is that set, will modify the data anyway...
4389 + * when update() will only modify exist objects/values.
4390 + *
4391 + * @param {RequestData} requestData
4392 + * @param {*} data
4393 + */
4394 + }, {
4395 + key: "set",
4396 + value: function set(requestData, data) {
4397 + $e.data.validateRequestData(requestData);
4398 + var componentName = requestData.component.getNamespace(),
4399 + pureEndpoint = requestData.endpoint.replace(componentName + '/', ''),
4400 + pureEndpointParts = pureEndpoint.split('/');
4401 + var newData = {};
5253 4402
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 - }();
4403 + // Example of working with reaming endpoint part(s) can be found at 'cache.spec.js' test: 'load(): deep'.
4404 + // Analyze reaming endpoint.
4405 + if (pureEndpointParts.length && pureEndpoint !== componentName) {
4406 + // Using reaming endpoint parts, to build new data object.
4407 + var result = pureEndpointParts.reduce(function (accumulator, pureEndpointPart) {
4408 + accumulator[pureEndpointPart] = {};
4409 + return accumulator[pureEndpointPart];
4410 + }, newData);
5401 4411
5402 -//#endregion
5403 -//#region modules/web-cli/assets/js/core/ui-states.js
4412 + // 'result' is equal to 'newData' with a deeper pointer, build based on 'pureEndpointParts' ( will effect newData ).
4413 + Object.assign(result, data);
4414 + } else {
4415 + newData = data;
4416 + }
4417 + var oldData = this.storage.getItem(componentName);
4418 +
4419 + // When have old data, merge it recursively with newData using jQuery.extend().
4420 + if (oldData !== null) {
4421 + newData = jQuery.extend(true, oldData, newData);
4422 + }
4423 + this.storage.setItem(componentName, newData);
4424 + }
4425 +
4426 + /**
4427 + * Function get().
4428 + *
4429 + * Get from exist storage.
4430 + *
4431 + * @param {RequestData} requestData
4432 + *
4433 + * @return {{}} data
4434 + */
4435 + }, {
4436 + key: "get",
4437 + value: function get(requestData) {
4438 + $e.data.validateRequestData(requestData);
4439 + var componentName = requestData.component.getNamespace(),
4440 + componentData = this.storage.getItem(componentName);
4441 + if (componentData !== null) {
4442 + if (componentName === requestData.endpoint) {
4443 + return componentData;
4444 + }
4445 +
4446 + // Example of working with reaming endpoint part(s) can be found at 'cache.spec.js' test: 'get(): complex'.
4447 + // Analyze reaming endpoint (Using reduce over endpoint parts, build the right index).
4448 + var pureEndpoint = requestData.endpoint.replace(requestData.component.getNamespace() + '/', ''),
4449 + pureEndpointParts = pureEndpoint.split('/'),
4450 + // eslint-disable-next-line array-callback-return
4451 + result = pureEndpointParts.reduce(function (accumulator, endpointPart) {
4452 + if (accumulator && accumulator[endpointPart]) {
4453 + return accumulator[endpointPart];
4454 + }
4455 + }, componentData);
4456 +
4457 + // Since $e.data.cache.receive will reject only if null is the result.
4458 + return result || null;
4459 + }
4460 + return null;
4461 + }
4462 +
4463 + /**
4464 + * Function update().
4465 + *
4466 + * Update only already exist storage, runs over all storage
4467 + *
4468 + * @param {RequestData} requestData
4469 + *
4470 + * @return {boolean} is updated
4471 + */
4472 + }, {
4473 + key: "update",
4474 + value: function update(requestData) {
4475 + $e.data.validateRequestData(requestData, true);
4476 + var endpoint = requestData.endpoint;
4477 + var response = {};
4478 +
4479 + // Simulate response from cache.
4480 + Object.entries(this.storage.getAll()).forEach(function (_ref) {
4481 + var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
4482 + endpointKey = _ref2[0],
4483 + /* String*/endpointValue = _ref2[1];
4484 + if (endpointValue && endpoint.includes(endpointKey)) {
4485 + // Assuming it is a specific endpoint.
4486 + var oldData = endpointValue,
4487 + pureEndpoint = requestData.endpoint.replace(requestData.component.getNamespace() + '/', ''),
4488 + pureEndpointParts = pureEndpoint.split('/'),
4489 + isComponentUpdate = 1 === pureEndpointParts.length && endpointKey === requestData.endpoint && endpointKey === requestData.component.getNamespace();
4490 +
4491 + // Component update or specific update?
4492 + if (isComponentUpdate) {
4493 + response = jQuery.extend(true, oldData, requestData.args.data);
4494 + } else {
4495 + var oldSpecificData = pureEndpointParts.reduce(function (accumulator, pureEndpointPart) {
4496 + return accumulator[pureEndpointPart];
4497 + }, oldData);
4498 + response = jQuery.extend(true, oldSpecificData, requestData.args.data);
4499 + }
4500 + }
4501 + });
4502 +
4503 + // If response not found.
4504 + if (0 === Object.values(response).length) {
4505 + return false;
4506 + }
4507 +
4508 + // Update cache.
4509 + this.set(requestData, response);
4510 + return true;
4511 + }
4512 +
4513 + /**
4514 + * Function delete().
4515 + *
4516 + * Delete endpoint from storage.
4517 + *
4518 + * @param {RequestData} requestData
4519 + *
4520 + * @return {boolean} is deleted
4521 + */
4522 + }, {
4523 + key: "delete",
4524 + value: function _delete(requestData) {
4525 + $e.data.validateRequestData(requestData);
4526 + var result = false;
4527 + var componentName = requestData.component.getNamespace();
4528 + if (componentName !== requestData.endpoint) {
4529 + var oldData = this.storage.getItem(componentName),
4530 + newData = {};
4531 + if (null === oldData) {
4532 + return false;
4533 + }
4534 + var pureEndpoint = requestData.endpoint.replace(componentName + '/', ''),
4535 + pureEndpointParts = pureEndpoint.split('/'),
4536 + lastEndpointPart = pureEndpointParts[pureEndpointParts.length - 1];
4537 + pureEndpointParts.reduce(function (accumulator, pureEndpointPart) {
4538 + if (pureEndpointPart === lastEndpointPart) {
4539 + // Null, means delete.
4540 + accumulator[pureEndpointPart] = null;
4541 + } else {
4542 + accumulator[pureEndpointPart] = {};
4543 + }
4544 + return accumulator[pureEndpointPart];
4545 + }, newData);
4546 + if (Object.keys(oldData).length) {
4547 + var deleteKeys = function deleteKeys(target, nullsObject) {
4548 + if (nullsObject) {
4549 + Object.keys(nullsObject).forEach(function (key) {
4550 + if (nullsObject[key] && 'object' === (0, _typeof2.default)(nullsObject[key])) {
4551 + deleteKeys(target[key], nullsObject[key]);
4552 + } else if (null === nullsObject[key]) {
4553 + delete target[key];
4554 + result = true;
4555 + }
4556 + });
4557 + } else {
4558 + // Means need to clear all the object.
4559 + Object.keys(target).forEach(function (key) {
4560 + return delete target[key];
4561 + });
4562 + }
4563 + return target;
4564 + };
4565 + this.storage.setItem(componentName, deleteKeys(oldData, newData));
4566 + }
4567 + } else {
4568 + for (var key in this.storage.getAll()) {
4569 + if (key === requestData.endpoint) {
4570 + this.storage.removeItem(requestData.endpoint);
4571 + result = true;
4572 + break;
4573 + }
4574 + }
4575 + }
4576 + return result;
4577 + }
4578 + }]);
4579 + return Cache;
4580 +}();
4581 +exports["default"] = Cache;
4582 +
4583 +/***/ }),
4584 +
4585 +/***/ "../modules/web-cli/assets/js/core/data/errors/base-error.js":
4586 +/*!*******************************************************************!*\
4587 + !*** ../modules/web-cli/assets/js/core/data/errors/base-error.js ***!
4588 + \*******************************************************************/
4589 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
4590 +
4591 +"use strict";
4592 +
4593 +
4594 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
4595 +Object.defineProperty(exports, "__esModule", ({
4596 + value: true
4597 +}));
4598 +exports["default"] = void 0;
4599 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
4600 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
4601 +var _assertThisInitialized2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ "../node_modules/@babel/runtime/helpers/assertThisInitialized.js"));
4602 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
4603 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
4604 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
4605 +var _wrapNativeSuper2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/wrapNativeSuper */ "../node_modules/@babel/runtime/helpers/wrapNativeSuper.js"));
4606 +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
4607 +var _console = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/console */ "../modules/web-cli/assets/js/utils/console.js"));
4608 +var _forceMethodImplementation = _interopRequireDefault(__webpack_require__(/*! ../../../utils/force-method-implementation */ "../modules/web-cli/assets/js/utils/force-method-implementation.js"));
4609 +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; }
4610 +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; }
4611 +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); }; }
4612 +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; } }
4613 +var BaseError = /*#__PURE__*/function (_Error) {
4614 + (0, _inherits2.default)(BaseError, _Error);
4615 + var _super = _createSuper(BaseError);
4616 + /**
4617 + * Error constructor.
4618 + *
4619 + * @param {string} message
4620 + * @param {string} code
4621 + * @param {*} data
4622 + */
4623 + function BaseError() {
4624 + var _this;
4625 + var message = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
4626 + var code = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
4627 + var data = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
4628 + (0, _classCallCheck2.default)(this, BaseError);
4629 + _this = _super.call(this, message);
4630 + /**
4631 + * The server error code.
4632 + *
4633 + * @type {string}
4634 + */
4635 + (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "code", '');
4636 + /**
4637 + * Additional data about the current error.
4638 + *
4639 + * @type {*[]}
4640 + */
4641 + (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "data", []);
4642 + _this.code = code;
4643 + _this.data = data;
4644 + return _this;
4645 + }
4646 +
4647 + /**
4648 + * Notify a message when the error occurs.
4649 + */
4650 + (0, _createClass2.default)(BaseError, [{
4651 + key: "notify",
4652 + value: function notify() {
4653 + _console.default.error(_objectSpread({
4654 + message: this.message
4655 + }, this));
4656 + }
4657 + }], [{
4658 + key: "create",
4659 + value:
4660 + /**
4661 + * Static helper function to create the error.
4662 + *
4663 + * @param {string} message
4664 + * @param {string} code
4665 + * @param {*} data
4666 + * @return {BaseError} error
4667 + */
4668 + function create(message) {
4669 + var code = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
4670 + var data = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [];
4671 + return new this(message, code, data);
4672 + }
4673 +
4674 + /**
4675 + * Returns the status code of the error.
4676 + */
4677 + }, {
4678 + key: "getHTTPErrorCode",
4679 + value: function getHTTPErrorCode() {
4680 + (0, _forceMethodImplementation.default)();
4681 + }
4682 + }]);
4683 + return BaseError;
4684 +}( /*#__PURE__*/(0, _wrapNativeSuper2.default)(Error));
4685 +exports["default"] = BaseError;
4686 +
4687 +/***/ }),
4688 +
4689 +/***/ "../modules/web-cli/assets/js/core/data/errors/default-error.js":
4690 +/*!**********************************************************************!*\
4691 + !*** ../modules/web-cli/assets/js/core/data/errors/default-error.js ***!
4692 + \**********************************************************************/
4693 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
4694 +
4695 +"use strict";
4696 +
4697 +
4698 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
4699 +Object.defineProperty(exports, "__esModule", ({
4700 + value: true
4701 +}));
4702 +exports["default"] = exports.DefaultError = void 0;
4703 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
4704 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
4705 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
4706 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
4707 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
4708 +var _baseError = _interopRequireDefault(__webpack_require__(/*! ./base-error */ "../modules/web-cli/assets/js/core/data/errors/base-error.js"));
4709 +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); }; }
4710 +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; } }
4711 +var DefaultError = /*#__PURE__*/function (_BaseError) {
4712 + (0, _inherits2.default)(DefaultError, _BaseError);
4713 + var _super = _createSuper(DefaultError);
4714 + function DefaultError() {
4715 + (0, _classCallCheck2.default)(this, DefaultError);
4716 + return _super.apply(this, arguments);
4717 + }
4718 + (0, _createClass2.default)(DefaultError, null, [{
4719 + key: "getHTTPErrorCode",
4720 + value: function getHTTPErrorCode() {
4721 + return 501;
4722 + }
4723 + }]);
4724 + return DefaultError;
4725 +}(_baseError.default);
4726 +exports.DefaultError = DefaultError;
4727 +var _default = DefaultError;
4728 +exports["default"] = _default;
4729 +
4730 +/***/ }),
4731 +
4732 +/***/ "../modules/web-cli/assets/js/core/data/errors/error-404.js":
4733 +/*!******************************************************************!*\
4734 + !*** ../modules/web-cli/assets/js/core/data/errors/error-404.js ***!
4735 + \******************************************************************/
4736 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
4737 +
4738 +"use strict";
4739 +
4740 +
4741 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
4742 +Object.defineProperty(exports, "__esModule", ({
4743 + value: true
4744 +}));
4745 +exports["default"] = exports.Error404 = void 0;
4746 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
4747 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
4748 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
4749 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
4750 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
4751 +var _baseError = _interopRequireDefault(__webpack_require__(/*! ./base-error */ "../modules/web-cli/assets/js/core/data/errors/base-error.js"));
4752 +var _console = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/console */ "../modules/web-cli/assets/js/utils/console.js"));
4753 +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); }; }
4754 +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; } }
4755 +var Error404 = /*#__PURE__*/function (_BaseError) {
4756 + (0, _inherits2.default)(Error404, _BaseError);
4757 + var _super = _createSuper(Error404);
4758 + function Error404() {
4759 + (0, _classCallCheck2.default)(this, Error404);
4760 + return _super.apply(this, arguments);
4761 + }
4762 + (0, _createClass2.default)(Error404, [{
4763 + key: "notify",
4764 + value: function notify() {
4765 + _console.default.warn(this.message);
4766 + }
4767 + }], [{
4768 + key: "getHTTPErrorCode",
4769 + value: function getHTTPErrorCode() {
4770 + return 404;
4771 + }
4772 + }]);
4773 + return Error404;
4774 +}(_baseError.default);
4775 +exports.Error404 = Error404;
4776 +var _default = Error404;
4777 +exports["default"] = _default;
4778 +
4779 +/***/ }),
4780 +
4781 +/***/ "../modules/web-cli/assets/js/core/data/errors/index.js":
4782 +/*!**************************************************************!*\
4783 + !*** ../modules/web-cli/assets/js/core/data/errors/index.js ***!
4784 + \**************************************************************/
4785 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
4786 +
4787 +"use strict";
4788 +
4789 +
4790 +Object.defineProperty(exports, "__esModule", ({
4791 + value: true
4792 +}));
4793 +Object.defineProperty(exports, "DefaultError", ({
4794 + enumerable: true,
4795 + get: function get() {
4796 + return _defaultError.DefaultError;
4797 + }
4798 +}));
4799 +Object.defineProperty(exports, "Error404", ({
4800 + enumerable: true,
4801 + get: function get() {
4802 + return _error.Error404;
4803 + }
4804 +}));
4805 +var _defaultError = __webpack_require__(/*! ./default-error */ "../modules/web-cli/assets/js/core/data/errors/default-error.js");
4806 +var _error = __webpack_require__(/*! ./error-404 */ "../modules/web-cli/assets/js/core/data/errors/error-404.js");
4807 +
4808 +/***/ }),
4809 +
4810 +/***/ "../modules/web-cli/assets/js/core/data/storages/base-prefix-storage.js":
4811 +/*!******************************************************************************!*\
4812 + !*** ../modules/web-cli/assets/js/core/data/storages/base-prefix-storage.js ***!
4813 + \******************************************************************************/
4814 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
4815 +
4816 +"use strict";
4817 +
4818 +
4819 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
4820 +Object.defineProperty(exports, "__esModule", ({
4821 + value: true
4822 +}));
4823 +exports["default"] = void 0;
4824 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
4825 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
4826 +var _get2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/get */ "../node_modules/@babel/runtime/helpers/get.js"));
4827 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
4828 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
4829 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
4830 +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
4831 +var _baseStorage = _interopRequireDefault(__webpack_require__(/*! elementor-api/core/data/storages/base-storage */ "../modules/web-cli/assets/js/core/data/storages/base-storage.js"));
4832 +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); }; }
4833 +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; } }
4834 +var BasePrefixStorage = /*#__PURE__*/function (_BaseStorage) {
4835 + (0, _inherits2.default)(BasePrefixStorage, _BaseStorage);
4836 + var _super = _createSuper(BasePrefixStorage);
4837 + function BasePrefixStorage() {
4838 + (0, _classCallCheck2.default)(this, BasePrefixStorage);
4839 + return _super.apply(this, arguments);
4840 + }
4841 + (0, _createClass2.default)(BasePrefixStorage, [{
4842 + key: "clear",
4843 + value: function clear() {
4844 + var _this = this;
4845 + Object.keys(this.getAll()).forEach(function (key) {
4846 + return _this.removeItem(key);
4847 + });
4848 + }
4849 + }, {
4850 + key: "getItem",
4851 + value: function getItem(key) {
4852 + return (0, _get2.default)((0, _getPrototypeOf2.default)(BasePrefixStorage.prototype), "getItem", this).call(this, BasePrefixStorage.DEFAULT_KEY_PREFIX + key);
4853 + }
4854 + }, {
4855 + key: "removeItem",
4856 + value: function removeItem(key) {
4857 + return (0, _get2.default)((0, _getPrototypeOf2.default)(BasePrefixStorage.prototype), "removeItem", this).call(this, BasePrefixStorage.DEFAULT_KEY_PREFIX + key);
4858 + }
4859 + }, {
4860 + key: "setItem",
4861 + value: function setItem(key, value) {
4862 + return (0, _get2.default)((0, _getPrototypeOf2.default)(BasePrefixStorage.prototype), "setItem", this).call(this, BasePrefixStorage.DEFAULT_KEY_PREFIX + key, value);
4863 + }
4864 + }, {
4865 + key: "getAll",
4866 + value: function getAll() {
4867 + var _this2 = this;
4868 + var DEFAULT_KEY_PREFIX = BasePrefixStorage.DEFAULT_KEY_PREFIX,
4869 + keys = Object.keys(this.provider),
4870 + result = {};
4871 + keys.forEach(function (key) {
4872 + if (key.startsWith(DEFAULT_KEY_PREFIX)) {
4873 + key = key.replace(DEFAULT_KEY_PREFIX, '');
4874 + result[key] = _this2.getItem(key);
4875 + }
4876 + });
4877 + return result;
4878 + }
4879 + }]);
4880 + return BasePrefixStorage;
4881 +}(_baseStorage.default);
4882 +exports["default"] = BasePrefixStorage;
4883 +(0, _defineProperty2.default)(BasePrefixStorage, "DEFAULT_KEY_PREFIX", 'e_');
4884 +
4885 +/***/ }),
4886 +
4887 +/***/ "../modules/web-cli/assets/js/core/data/storages/base-storage.js":
4888 +/*!***********************************************************************!*\
4889 + !*** ../modules/web-cli/assets/js/core/data/storages/base-storage.js ***!
4890 + \***********************************************************************/
4891 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
4892 +
4893 +"use strict";
4894 +
4895 +
4896 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
4897 +Object.defineProperty(exports, "__esModule", ({
4898 + value: true
4899 +}));
4900 +exports["default"] = void 0;
4901 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
4902 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
5404 4903 /**
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 - }();
4904 + * TODO: Merge all storage's to one.
4905 + * Using this technique give's the ability to use JSDOC from 'window.storage'.
4906 + *
4907 + * @implements {Storage}
4908 + */
4909 +var BaseStorage = /*#__PURE__*/function () {
4910 + /**
4911 + * Create storage wrapper.
4912 + *
4913 + * @param {Storage} provider
4914 + */
4915 + function BaseStorage(provider) {
4916 + (0, _classCallCheck2.default)(this, BaseStorage);
4917 + if (BaseStorage === (this instanceof BaseStorage ? this.constructor : void 0)) {
4918 + throw new TypeError('Cannot construct BaseStorage instances directly');
4919 + }
4920 + this.provider = provider;
4921 + }
4922 + (0, _createClass2.default)(BaseStorage, [{
4923 + key: "clear",
4924 + value: function clear() {
4925 + return this.provider.clear();
4926 + }
4927 + }, {
4928 + key: "getItem",
4929 + value: function getItem(key) {
4930 + var result = this.provider.getItem(key);
4931 + if (null !== result) {
4932 + return JSON.parse(result);
4933 + }
4934 + return result;
4935 + }
4936 + }, {
4937 + key: "key",
4938 + value: function key(index) {
4939 + return this.provider.key(index);
4940 + }
4941 + }, {
4942 + key: "removeItem",
4943 + value: function removeItem(key) {
4944 + return this.provider.removeItem(key);
4945 + }
4946 + }, {
4947 + key: "setItem",
4948 + value: function setItem(key, value) {
4949 + return this.provider.setItem(key, JSON.stringify(value));
4950 + }
4951 + }, {
4952 + key: "getAll",
4953 + value: function getAll() {
4954 + var _this = this;
4955 + var keys = Object.keys(this.provider),
4956 + result = {};
4957 + keys.forEach(function (key) {
4958 + result[key] = _this.getItem(key);
4959 + });
4960 + return result;
4961 + }
4962 + }]);
4963 + return BaseStorage;
4964 +}();
4965 +exports["default"] = BaseStorage;
5487 4966
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 - }();
4967 +/***/ }),
5589 4968
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);
4969 +/***/ "../modules/web-cli/assets/js/core/data/storages/local-storage.js":
4970 +/*!************************************************************************!*\
4971 + !*** ../modules/web-cli/assets/js/core/data/storages/local-storage.js ***!
4972 + \************************************************************************/
4973 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
5618 4974
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);
4975 +"use strict";
5647 4976
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 4977
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);
4978 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
4979 +Object.defineProperty(exports, "__esModule", ({
4980 + value: true
4981 +}));
4982 +exports["default"] = void 0;
4983 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
4984 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
4985 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
4986 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
4987 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
4988 +var _basePrefixStorage = _interopRequireDefault(__webpack_require__(/*! ./base-prefix-storage */ "../modules/web-cli/assets/js/core/data/storages/base-prefix-storage.js"));
4989 +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); }; }
4990 +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; } }
4991 +var LocalStorage = /*#__PURE__*/function (_BasePrefixStorage) {
4992 + (0, _inherits2.default)(LocalStorage, _BasePrefixStorage);
4993 + var _super = _createSuper(LocalStorage);
4994 + function LocalStorage() {
4995 + (0, _classCallCheck2.default)(this, LocalStorage);
4996 + return _super.call(this, localStorage);
4997 + }
4998 + (0, _createClass2.default)(LocalStorage, [{
4999 + key: "debug",
5000 + value: function debug() {
5001 + var entries = this.getAll(),
5002 + ordered = {};
5003 + Object.keys(entries).sort().forEach(function (key) {
5004 + var value = entries[key];
5005 + ordered[key] = value;
5006 + });
5007 + return ordered;
5008 + }
5009 + }]);
5010 + return LocalStorage;
5011 +}(_basePrefixStorage.default);
5012 +exports["default"] = LocalStorage;
5705 5013
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 - });
5014 +/***/ }),
5714 5015
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);
5016 +/***/ "../modules/web-cli/assets/js/core/hooks.js":
5017 +/*!**************************************************!*\
5018 + !*** ../modules/web-cli/assets/js/core/hooks.js ***!
5019 + \**************************************************/
5020 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
5743 5021
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);
5022 +"use strict";
5772 5023
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 5024
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);
5025 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
5026 +Object.defineProperty(exports, "__esModule", ({
5027 + value: true
5028 +}));
5029 +exports["default"] = void 0;
5030 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
5031 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
5032 +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
5033 +var _data = _interopRequireDefault(__webpack_require__(/*! ./hooks/data.js */ "../modules/web-cli/assets/js/core/hooks/data.js"));
5034 +var _ui = _interopRequireDefault(__webpack_require__(/*! ./hooks/ui.js */ "../modules/web-cli/assets/js/core/hooks/ui.js"));
5035 +/**
5036 + * @typedef {import('../modules/hook-base')} HookBase
5037 + */
5038 +var Hooks = /*#__PURE__*/function () {
5039 + function Hooks() {
5040 + (0, _classCallCheck2.default)(this, Hooks);
5041 + (0, _defineProperty2.default)(this, "data", new _data.default());
5042 + (0, _defineProperty2.default)(this, "ui", new _ui.default());
5043 + }
5044 + (0, _createClass2.default)(Hooks, [{
5045 + key: "activate",
5046 + value:
5047 + /**
5048 + * Function activate().
5049 + *
5050 + * Activate all hooks.
5051 + */
5052 + function activate() {
5053 + this.getTypes().forEach(function (hooksType) {
5054 + hooksType.activate();
5055 + });
5056 + }
5828 5057
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 - });
5058 + /**
5059 + * Function deactivate().
5060 + *
5061 + * Deactivate all hooks.
5062 + */
5063 + }, {
5064 + key: "deactivate",
5065 + value: function deactivate() {
5066 + this.getTypes().forEach(function (hooksType) {
5067 + hooksType.deactivate();
5068 + });
5069 + }
5070 + }, {
5071 + key: "getAll",
5072 + value: function getAll() {
5073 + var flat = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
5074 + var result = {};
5075 + this.getTypes().forEach(function (hooksType) {
5076 + result[hooksType.getType()] = hooksType.getAll(flat);
5077 + });
5078 + return result;
5079 + }
5080 + }, {
5081 + key: "getTypes",
5082 + value: function getTypes() {
5083 + return [this.data, this.ui];
5084 + }
5085 + }, {
5086 + key: "getType",
5087 + value: function getType(type) {
5088 + return this.getTypes().find(function (hooks) {
5089 + return type === hooks.getType();
5090 + });
5091 + }
5837 5092
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 - }();
5093 + /**
5094 + * Function register().
5095 + *
5096 + * Register hook.
5097 + *
5098 + * @param {string} type
5099 + * @param {string} event
5100 + * @param {HookBase} instance
5101 + *
5102 + * @return {{}} Created callback
5103 + */
5104 + }, {
5105 + key: "register",
5106 + value: function register(type, event, instance) {
5107 + return this.getType(type).register(event, instance);
5108 + }
5905 5109
5906 -//#endregion
5907 -//#region modules/web-cli/assets/js/index.js
5908 - window.$e = new API();
5110 + /**
5111 + * Function run().
5112 + *
5113 + * Run's a hook.
5114 + *
5115 + * @param {string} type
5116 + * @param {string} event
5117 + * @param {string} command
5118 + * @param {{}} args
5119 + * @param {*} result
5120 + *
5121 + * @return {boolean} result
5122 + */
5123 + }, {
5124 + key: "run",
5125 + value: function run(type, event, command, args) {
5126 + var result = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : undefined;
5127 + return this.getType(type).run(event, command, args, result);
5128 + }
5909 5129
5910 -//#endregion
5911 -})(elementorVendors.reduxToolkit);
5130 + /**
5131 + * Function registerDataAfter().
5132 + *
5133 + * Register data hook that's run after the command.
5134 + *
5135 + * @param {HookBase} instance
5136 + *
5137 + * @return {{}} callback
5138 + */
5139 + }, {
5140 + key: "registerDataAfter",
5141 + value: function registerDataAfter(instance) {
5142 + return this.register('data', 'after', instance);
5143 + }
5144 +
5145 + /**
5146 + * Function registerDataCatch().
5147 + *
5148 + * Register data hook that's run when the command fails.
5149 + *
5150 + * @param {HookBase} instance
5151 + *
5152 + * @return {{}} callback
5153 + */
5154 + }, {
5155 + key: "registerDataCatch",
5156 + value: function registerDataCatch(instance) {
5157 + return this.register('data', 'catch', instance);
5158 + }
5159 +
5160 + /**
5161 + * Function registerDataDependency().
5162 + *
5163 + * Register data hook that's run before the command as dependency.
5164 + *
5165 + * @param {HookBase} instance
5166 + *
5167 + * @return {{}} callback
5168 + */
5169 + }, {
5170 + key: "registerDataDependency",
5171 + value: function registerDataDependency(instance) {
5172 + return this.register('data', 'dependency', instance);
5173 + }
5174 +
5175 + /**
5176 + * Function registerUIAfter().
5177 + *
5178 + * Register UI hook that's run after the commands run.
5179 + *
5180 + * @param {HookBase} instance
5181 + *
5182 + * @return {{}} callback
5183 + */
5184 + }, {
5185 + key: "registerUIAfter",
5186 + value: function registerUIAfter(instance) {
5187 + return this.register('ui', 'after', instance);
5188 + }
5189 +
5190 + /**
5191 + * Function registerUICatch().
5192 + *
5193 + * Register UI hook that's run when the command fails.
5194 + *
5195 + * @param {HookBase} instance
5196 + *
5197 + * @return {{}} callback
5198 + */
5199 + }, {
5200 + key: "registerUICatch",
5201 + value: function registerUICatch(instance) {
5202 + return this.register('ui', 'catch', instance);
5203 + }
5204 +
5205 + /**
5206 + * Function registerUIBefore().
5207 + *
5208 + * Register UI hook that's run before the command.
5209 + *
5210 + * @param {HookBase} instance
5211 + *
5212 + * @return {{}} callback
5213 + */
5214 + }, {
5215 + key: "registerUIBefore",
5216 + value: function registerUIBefore(instance) {
5217 + return this.register('ui', 'before', instance);
5218 + }
5219 +
5220 + /**
5221 + * Function runDataAfter().
5222 + *
5223 + * Run data hook that's run after the command.
5224 + *
5225 + * @param {string} command
5226 + * @param {{}} args
5227 + * @param {*} result
5228 + *
5229 + * @return {boolean} result
5230 + */
5231 + }, {
5232 + key: "runDataAfter",
5233 + value: function runDataAfter(command, args, result) {
5234 + return this.run('data', 'after', command, args, result);
5235 + }
5236 +
5237 + /**
5238 + * Function runDataCatch().
5239 + *
5240 + * Run data hook that's run when the command fails.
5241 + *
5242 + * @param {string} command
5243 + * @param {{}} args
5244 + * @param {*} error
5245 + *
5246 + * @return {boolean} result
5247 + */
5248 + }, {
5249 + key: "runDataCatch",
5250 + value: function runDataCatch(command, args, error) {
5251 + return this.run('data', 'catch', command, args, error);
5252 + }
5253 +
5254 + /**
5255 + * Function runDataDependency().
5256 + *
5257 + * Run data hook that's run before the command as dependency.
5258 + *
5259 + * @param {string} command
5260 + * @param {{}} args
5261 + *
5262 + * @return {boolean} result
5263 + */
5264 + }, {
5265 + key: "runDataDependency",
5266 + value: function runDataDependency(command, args) {
5267 + return this.run('data', 'dependency', command, args);
5268 + }
5269 +
5270 + /**
5271 + * Function runUIAfter().
5272 + *
5273 + * Run UI hook that's run after the commands run.
5274 + *
5275 + * @param {string} command
5276 + * @param {{}} args
5277 + * @param {*} result
5278 + *
5279 + * @return {boolean} result
5280 + */
5281 + }, {
5282 + key: "runUIAfter",
5283 + value: function runUIAfter(command, args, result) {
5284 + return this.run('ui', 'after', command, args, result);
5285 + }
5286 +
5287 + /**
5288 + * Function runUICatch().
5289 + *
5290 + * Run UI hook that's run when the command fails.
5291 + *
5292 + * @param {string} command
5293 + * @param {{}} args
5294 + * @param {*} e
5295 + *
5296 + * @return {boolean} result
5297 + */
5298 + }, {
5299 + key: "runUICatch",
5300 + value: function runUICatch(command, args, e) {
5301 + return this.run('ui', 'catch', command, args, e);
5302 + }
5303 +
5304 + /**
5305 + * Function runUIBefore().
5306 + *
5307 + * Run UI hook that's run before the command.
5308 + *
5309 + * @param {string} command
5310 + * @param {{}} args
5311 + *
5312 + * @return {boolean} result
5313 + */
5314 + }, {
5315 + key: "runUIBefore",
5316 + value: function runUIBefore(command, args) {
5317 + return this.run('ui', 'before', command, args);
5318 + }
5319 + }]);
5320 + return Hooks;
5321 +}();
5322 +exports["default"] = Hooks;
5323 +
5324 +/***/ }),
5325 +
5326 +/***/ "../modules/web-cli/assets/js/core/hooks/base.js":
5327 +/*!*******************************************************!*\
5328 + !*** ../modules/web-cli/assets/js/core/hooks/base.js ***!
5329 + \*******************************************************/
5330 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
5331 +
5332 +"use strict";
5333 +
5334 +
5335 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
5336 +Object.defineProperty(exports, "__esModule", ({
5337 + value: true
5338 +}));
5339 +exports["default"] = void 0;
5340 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
5341 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
5342 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
5343 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
5344 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
5345 +var _console = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/console */ "../modules/web-cli/assets/js/utils/console.js"));
5346 +var _module = _interopRequireDefault(__webpack_require__(/*! elementor-assets-js/modules/imports/module.js */ "../assets/dev/js/modules/imports/module.js"));
5347 +var _forceMethodImplementation = _interopRequireDefault(__webpack_require__(/*! ../../utils/force-method-implementation */ "../modules/web-cli/assets/js/utils/force-method-implementation.js"));
5348 +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); }; }
5349 +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; } }
5350 +/**
5351 + * @typedef {import('../../modules/hook-base')} HookBase
5352 + */
5353 +var HooksBase = /*#__PURE__*/function (_Module) {
5354 + (0, _inherits2.default)(HooksBase, _Module);
5355 + var _super = _createSuper(HooksBase);
5356 + /**
5357 + * Function constructor().
5358 + *
5359 + * Create hooks base.
5360 + *
5361 + * @param {{}} args
5362 + */
5363 + function HooksBase() {
5364 + var _this;
5365 + (0, _classCallCheck2.default)(this, HooksBase);
5366 + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
5367 + args[_key] = arguments[_key];
5368 + }
5369 + _this = _super.call.apply(_super, [this].concat(args));
5370 +
5371 + /**
5372 + * Current command.
5373 + *
5374 + * @type {string}
5375 + */
5376 + _this.current = '';
5377 +
5378 + /**
5379 + * Array of ids which in use.
5380 + *
5381 + * @type {Array}
5382 + */
5383 + _this.usedIds = [];
5384 +
5385 + /**
5386 + * Object of callbacks that was bound by container type.
5387 + *
5388 + * @type {{}}
5389 + */
5390 + _this.callbacks = {
5391 + after: {},
5392 + catch: {}
5393 + };
5394 +
5395 + /**
5396 + * Object of depth.
5397 + *
5398 + * @type {{}}
5399 + */
5400 + _this.depth = {
5401 + after: {},
5402 + catch: {}
5403 + };
5404 + _this.callbacksFlatList = {};
5405 + return _this;
5406 + }
5407 + (0, _createClass2.default)(HooksBase, [{
5408 + key: "activate",
5409 + value: function activate() {
5410 + Object.values(this.getAll(true)).forEach(function (callback) {
5411 + callback.activate();
5412 + });
5413 + }
5414 + }, {
5415 + key: "deactivate",
5416 + value: function deactivate() {
5417 + Object.values(this.getAll(true)).forEach(function (callback) {
5418 + callback.deactivate();
5419 + });
5420 + }
5421 +
5422 + // eslint-disable-next-line jsdoc/require-returns-check
5423 + /**
5424 + * Function getType().
5425 + *
5426 + * Returns type eg: ( event, hook, etc ... ).
5427 + *
5428 + * @return {string} type
5429 + */
5430 + }, {
5431 + key: "getType",
5432 + value: function getType() {
5433 + (0, _forceMethodImplementation.default)();
5434 + }
5435 + }, {
5436 + key: "get",
5437 + value: function get(id) {
5438 + return this.callbacksFlatList[id];
5439 + }
5440 +
5441 + /**
5442 + * Function getAll().
5443 + *
5444 + * Return all possible callbacks.
5445 + *
5446 + * @param {boolean} flat
5447 + *
5448 + * @return {{}} all callbacks
5449 + */
5450 + }, {
5451 + key: "getAll",
5452 + value: function getAll() {
5453 + var _this2 = this;
5454 + var flat = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
5455 + if (flat) {
5456 + return this.callbacksFlatList;
5457 + }
5458 + var result = {};
5459 + Object.keys(this.callbacks).forEach(function (event) {
5460 + if (!result[event]) {
5461 + result[event] = [];
5462 + }
5463 + Object.keys(_this2.callbacks[event]).forEach(function (command) {
5464 + result[event].push({
5465 + command: command,
5466 + callbacks: _this2.callbacks[event][command]
5467 + });
5468 + });
5469 + });
5470 + return result;
5471 + }
5472 +
5473 + /**
5474 + * Function getCurrent();
5475 + *
5476 + * Return current command.
5477 + *
5478 + * @return {string} current command
5479 + */
5480 + }, {
5481 + key: "getCurrent",
5482 + value: function getCurrent() {
5483 + return this.current;
5484 + }
5485 +
5486 + /**
5487 + * Function getUsedIds().
5488 + *
5489 + * Returns the current used ids.
5490 + *
5491 + * @return {Array} used IDs
5492 + */
5493 + }, {
5494 + key: "getUsedIds",
5495 + value: function getUsedIds() {
5496 + return this.usedIds;
5497 + }
5498 +
5499 + /**
5500 + * Function getCallbacks().
5501 + *
5502 + * Get available callbacks for specific event and command.
5503 + *
5504 + * @param {string} event
5505 + * @param {string} command
5506 + * @param {*} args
5507 + * @return {(Array | boolean)} callbacks
5508 + */
5509 + }, {
5510 + key: "getCallbacks",
5511 + value: function getCallbacks(event, command, args) {
5512 + var _args$containers = args.containers,
5513 + containers = _args$containers === void 0 ? [args.container] : _args$containers,
5514 + containerType = containers[0] ? containers[0].type : false;
5515 + var callbacks = [];
5516 + if (this.callbacks[event] && this.callbacks[event][command]) {
5517 + if (containerType && this.callbacks[event][command][containerType]) {
5518 + callbacks = callbacks.concat(this.callbacks[event][command][containerType]);
5519 + }
5520 + if (this.callbacks[event][command].all) {
5521 + callbacks = callbacks.concat(this.callbacks[event][command].all);
5522 + }
5523 + }
5524 + if (callbacks.length) {
5525 + return callbacks;
5526 + }
5527 + return false;
5528 + }
5529 +
5530 + /**
5531 + * Function checkEvent().
5532 + *
5533 + * Validate if the event is available.
5534 + *
5535 + * @param {string} event
5536 + */
5537 + }, {
5538 + key: "checkEvent",
5539 + value: function checkEvent(event) {
5540 + if (-1 === Object.keys(this.callbacks).indexOf(event)) {
5541 + throw Error("".concat(this.getType(), ": '").concat(event, "' is not available."));
5542 + }
5543 + }
5544 +
5545 + /**
5546 + * Function checkInstance().
5547 + *
5548 + * Validate given instance.
5549 + *
5550 + * @param {HookBase} instance
5551 + */
5552 + }, {
5553 + key: "checkInstance",
5554 + value: function checkInstance(instance) {
5555 + if (instance.getType() !== this.getType()) {
5556 + throw new Error("invalid instance, please use: 'elementor-api/modules/hook-base.js'. ");
5557 + }
5558 + }
5559 +
5560 + /**
5561 + * Function checkId().
5562 + *
5563 + * Validate if the id is not used before.
5564 + *
5565 + * @param {string} id
5566 + */
5567 + }, {
5568 + key: "checkId",
5569 + value: function checkId(id) {
5570 + if (-1 !== this.usedIds.indexOf(id)) {
5571 + throw Error("id: '".concat(id, "' is already in use."));
5572 + }
5573 + }
5574 +
5575 + /**
5576 + * Function shouldRun().
5577 + *
5578 + * Determine if the event should run.
5579 + *
5580 + * @param {Array} callbacks
5581 + *
5582 + * @return {boolean} true if there are callbacks, otherwise false
5583 + *
5584 + * @throws {Error}
5585 + */
5586 + }, {
5587 + key: "shouldRun",
5588 + value: function shouldRun(callbacks) {
5589 + return !!callbacks && callbacks.length;
5590 + }
5591 +
5592 + /**
5593 + * Function register().
5594 + *
5595 + * Register the callback instance.
5596 + *
5597 + * @param {string} event
5598 + * @param {HookBase} instance
5599 + *
5600 + * @return {{}} Created callback
5601 + */
5602 + }, {
5603 + key: "register",
5604 + value: function register(event, instance) {
5605 + var command = instance.getCommand(),
5606 + id = instance.getId(),
5607 + containerType = instance.getContainerType();
5608 + this.checkEvent(event);
5609 + this.checkInstance(instance);
5610 + this.checkId(id);
5611 + return this.registerCallback(id, event, command, instance, containerType);
5612 + }
5613 +
5614 + /**
5615 + * Function registerCallback().
5616 + *
5617 + * Register callback.
5618 + *
5619 + * @param {string} id
5620 + * @param {string} event
5621 + * @param {string} command
5622 + * @param {HookBase} instance
5623 + * @param {string} containerType
5624 + *
5625 + * TODO: Consider replace with typedef.
5626 + * @return {{callback: *, id: *, isActive: boolean}} callback
5627 + */
5628 + }, {
5629 + key: "registerCallback",
5630 + value: function registerCallback(id, event, command, instance, containerType) {
5631 + if (!this.callbacks[event][command]) {
5632 + this.callbacks[event][command] = [];
5633 + }
5634 +
5635 + // Save used id(s).
5636 + this.usedIds.push(id);
5637 + if (!this.callbacks[event][command]) {
5638 + this.callbacks[event][command] = {};
5639 + }
5640 +
5641 + // TODO: Create HookCallback class/type.
5642 + var callback = {
5643 + id: id,
5644 + callback: instance.run.bind(instance),
5645 + isActive: true,
5646 + activate: function activate() {
5647 + this.isActive = true;
5648 + },
5649 + deactivate: function deactivate() {
5650 + this.isActive = false;
5651 + }
5652 + };
5653 + if (containerType) {
5654 + if (!this.callbacks[event][command][containerType]) {
5655 + this.callbacks[event][command][containerType] = [];
5656 + }
5657 + this.callbacks[event][command][containerType].push(callback);
5658 + } else {
5659 + if (!this.callbacks[event][command].all) {
5660 + this.callbacks[event][command].all = [];
5661 + }
5662 + this.callbacks[event][command].all.push(callback);
5663 + }
5664 + this.callbacksFlatList[callback.id] = callback;
5665 + return callback;
5666 + }
5667 +
5668 + /**
5669 + * Function run().
5670 + *
5671 + * Run the callbacks.
5672 + *
5673 + * @param {string} event
5674 + * @param {string} command
5675 + * @param {{}} args
5676 + * @param {*} result
5677 + *
5678 + * @return {*} results
5679 + */
5680 + }, {
5681 + key: "run",
5682 + value: function run(event, command, args) {
5683 + var result = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : undefined;
5684 + var callbacks = this.getCallbacks(event, command, args);
5685 + if (this.shouldRun(callbacks)) {
5686 + this.current = command;
5687 + this.onRun(command, args, event);
5688 + return this.runCallbacks(event, command, callbacks, args, result);
5689 + }
5690 + return false;
5691 + }
5692 +
5693 + /**
5694 + * Function runCallbacks().
5695 + *
5696 + * Run's the given callbacks.
5697 + *
5698 + * @param {string} event
5699 + * @param {string} command
5700 + * @param {Array} callbacks
5701 + * @param {{}} args
5702 + * @param {[]} result
5703 + */
5704 + }, {
5705 + key: "runCallbacks",
5706 + value: function runCallbacks(event, command, callbacks, args, result) {
5707 + var callbacksResult = [];
5708 + for (var i in callbacks) {
5709 + var callback = callbacks[i];
5710 + if (!callback.isActive) {
5711 + continue;
5712 + }
5713 +
5714 + // If not exist, set zero.
5715 + if (undefined === this.depth[event][callback.id]) {
5716 + this.depth[event][callback.id] = 0;
5717 + }
5718 + this.depth[event][callback.id]++;
5719 +
5720 + // Prevent recursive hooks.
5721 + if (1 === this.depth[event][callback.id]) {
5722 + this.onCallback(command, args, event, callback.id);
5723 + try {
5724 + var callbackResult = this.runCallback(event, callback, args, result);
5725 + if (!callbackResult) {
5726 + throw Error("Callback failed, event: '".concat(event, "'"));
5727 + }
5728 + callbacksResult.push(callbackResult);
5729 + } catch (e) {
5730 + // If its 'Hook-Break' then parent `try {}` will handle it.
5731 + if (e instanceof $e.modules.HookBreak) {
5732 + throw e;
5733 + }
5734 + _console.default.error(e);
5735 + }
5736 + }
5737 + this.depth[event][callback.id]--;
5738 + }
5739 + return callbacksResult;
5740 + }
5741 +
5742 + // eslint-disable-next-line jsdoc/require-returns-check
5743 + /**
5744 + * Function runCallback().
5745 + *
5746 + * Run's the given callback.
5747 + *
5748 + * @param {string} event
5749 + * @param {{}} callback
5750 + * @param {{}} args
5751 + * @param {*} result
5752 + *
5753 + * @return {*} results
5754 + *
5755 + * @throws {Error}
5756 + */
5757 + }, {
5758 + key: "runCallback",
5759 + value: function runCallback(event, callback, args, result) {
5760 + // eslint-disable-line no-unused-vars
5761 + (0, _forceMethodImplementation.default)();
5762 + }
5763 +
5764 + /**
5765 + * Function onRun().
5766 + *
5767 + * Called before run a set of callbacks.
5768 + *
5769 + * @param {string} command
5770 + * @param {{}} args
5771 + * @param {string} event
5772 + *
5773 + * @throws {Error}
5774 + */
5775 + }, {
5776 + key: "onRun",
5777 + value: function onRun(command, args, event) {
5778 + // eslint-disable-line no-unused-vars
5779 + (0, _forceMethodImplementation.default)();
5780 + }
5781 +
5782 + /**
5783 + * Function onCallback().
5784 + *
5785 + * Called before a single callback.
5786 + *
5787 + * @param {string} command
5788 + * @param {{}} args
5789 + * @param {string} event
5790 + * @param {string} id
5791 + *
5792 + * @throws {Error}
5793 + */
5794 + }, {
5795 + key: "onCallback",
5796 + value: function onCallback(command, args, event, id) {
5797 + // eslint-disable-line no-unused-vars
5798 + (0, _forceMethodImplementation.default)();
5799 + }
5800 + }]);
5801 + return HooksBase;
5802 +}(_module.default);
5803 +exports["default"] = HooksBase;
5804 +
5805 +/***/ }),
5806 +
5807 +/***/ "../modules/web-cli/assets/js/core/hooks/data.js":
5808 +/*!*******************************************************!*\
5809 + !*** ../modules/web-cli/assets/js/core/hooks/data.js ***!
5810 + \*******************************************************/
5811 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
5812 +
5813 +"use strict";
5814 +
5815 +
5816 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
5817 +Object.defineProperty(exports, "__esModule", ({
5818 + value: true
5819 +}));
5820 +exports["default"] = void 0;
5821 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
5822 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
5823 +var _get2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/get */ "../node_modules/@babel/runtime/helpers/get.js"));
5824 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
5825 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
5826 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
5827 +var _base = _interopRequireDefault(__webpack_require__(/*! ./base.js */ "../modules/web-cli/assets/js/core/hooks/base.js"));
5828 +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); }; }
5829 +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; } }
5830 +var Data = /*#__PURE__*/function (_HooksBase) {
5831 + (0, _inherits2.default)(Data, _HooksBase);
5832 + var _super = _createSuper(Data);
5833 + function Data() {
5834 + var _this;
5835 + (0, _classCallCheck2.default)(this, Data);
5836 + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
5837 + args[_key] = arguments[_key];
5838 + }
5839 + _this = _super.call.apply(_super, [this].concat(args));
5840 + _this.callbacks.dependency = {};
5841 + _this.depth.dependency = {};
5842 + return _this;
5843 + }
5844 + (0, _createClass2.default)(Data, [{
5845 + key: "getType",
5846 + value: function getType() {
5847 + return 'data';
5848 + }
5849 + }, {
5850 + key: "runCallback",
5851 + value: function runCallback(event, callback, args, result) {
5852 + switch (event) {
5853 + case 'dependency':
5854 + {
5855 + // If callback returns false and its dependency, then 'Hook-Break'.
5856 + if (!callback.callback(args)) {
5857 + this.depth[event][callback.id]--;
5858 +
5859 + // Throw custom break to be catch by the base for 'Safe' exit.
5860 + throw new $e.modules.HookBreak();
5861 + }
5862 + return true;
5863 + }
5864 + case 'catch':
5865 + case 'after':
5866 + {
5867 + /**
5868 + * When handling HOOK which is data after (not breakable),
5869 + * even the result of the callback is negative, it is required to return positive,
5870 + * since result of runCallback determine if the callback succeeded.
5871 + */
5872 + return callback.callback(args, result) || 'after' === event;
5873 + }
5874 + }
5875 + return false;
5876 + }
5877 + }, {
5878 + key: "shouldRun",
5879 + value: function shouldRun(callbacks) {
5880 + return (0, _get2.default)((0, _getPrototypeOf2.default)(Data.prototype), "shouldRun", this).call(this, callbacks) && elementor.documents.getCurrent().history.getActive();
5881 + }
5882 + }, {
5883 + key: "onRun",
5884 + value: function onRun(command, args, event) {
5885 + if (!$e.devTools) {
5886 + return;
5887 + }
5888 + $e.devTools.log.callbacks().run(this.getType(), command, args, event);
5889 + }
5890 + }, {
5891 + key: "onCallback",
5892 + value: function onCallback(command, args, event, id) {
5893 + if (!$e.devTools) {
5894 + return;
5895 + }
5896 + $e.devTools.log.callbacks().callback(this.getType(), command, args, event, id);
5897 + }
5898 + }]);
5899 + return Data;
5900 +}(_base.default);
5901 +exports["default"] = Data;
5902 +
5903 +/***/ }),
5904 +
5905 +/***/ "../modules/web-cli/assets/js/core/hooks/ui.js":
5906 +/*!*****************************************************!*\
5907 + !*** ../modules/web-cli/assets/js/core/hooks/ui.js ***!
5908 + \*****************************************************/
5909 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
5910 +
5911 +"use strict";
5912 +
5913 +
5914 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
5915 +Object.defineProperty(exports, "__esModule", ({
5916 + value: true
5917 +}));
5918 +exports["default"] = void 0;
5919 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
5920 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
5921 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
5922 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
5923 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
5924 +var _base = _interopRequireDefault(__webpack_require__(/*! ./base */ "../modules/web-cli/assets/js/core/hooks/base.js"));
5925 +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); }; }
5926 +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; } }
5927 +var Ui = /*#__PURE__*/function (_HooksBase) {
5928 + (0, _inherits2.default)(Ui, _HooksBase);
5929 + var _super = _createSuper(Ui);
5930 + function Ui() {
5931 + var _this;
5932 + (0, _classCallCheck2.default)(this, Ui);
5933 + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
5934 + args[_key] = arguments[_key];
5935 + }
5936 + _this = _super.call.apply(_super, [this].concat(args));
5937 + _this.callbacks.before = {};
5938 + _this.depth.before = {};
5939 + return _this;
5940 + }
5941 + (0, _createClass2.default)(Ui, [{
5942 + key: "getType",
5943 + value: function getType() {
5944 + return 'ui';
5945 + }
5946 + }, {
5947 + key: "runCallback",
5948 + value: function runCallback(event, callback, args, result) {
5949 + switch (event) {
5950 + case 'before':
5951 + callback.callback(args);
5952 + break;
5953 + case 'catch':
5954 + case 'after':
5955 + callback.callback(args, result);
5956 + break;
5957 + default:
5958 + return false;
5959 + }
5960 + return true;
5961 + }
5962 + }, {
5963 + key: "onRun",
5964 + value: function onRun(command, args, event) {
5965 + if (!$e.devTools) {
5966 + return;
5967 + }
5968 + $e.devTools.log.callbacks().run(this.getType(), command, args, event);
5969 + }
5970 + }, {
5971 + key: "onCallback",
5972 + value: function onCallback(command, args, event, id) {
5973 + if (!$e.devTools) {
5974 + return;
5975 + }
5976 + $e.devTools.log.callbacks().callback(this.getType(), command, args, event, id);
5977 + }
5978 + }]);
5979 + return Ui;
5980 +}(_base.default);
5981 +exports["default"] = Ui;
5982 +
5983 +/***/ }),
5984 +
5985 +/***/ "../modules/web-cli/assets/js/core/routes.js":
5986 +/*!***************************************************!*\
5987 + !*** ../modules/web-cli/assets/js/core/routes.js ***!
5988 + \***************************************************/
5989 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
5990 +
5991 +"use strict";
5992 +
5993 +
5994 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
5995 +Object.defineProperty(exports, "__esModule", ({
5996 + value: true
5997 +}));
5998 +exports["default"] = void 0;
5999 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
6000 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
6001 +var _get2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/get */ "../node_modules/@babel/runtime/helpers/get.js"));
6002 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
6003 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
6004 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
6005 +var _commands = _interopRequireDefault(__webpack_require__(/*! ./commands */ "../modules/web-cli/assets/js/core/commands.js"));
6006 +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); }; }
6007 +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; } }
6008 +var Routes = /*#__PURE__*/function (_Commands) {
6009 + (0, _inherits2.default)(Routes, _Commands);
6010 + var _super = _createSuper(Routes);
6011 + function Routes() {
6012 + var _this;
6013 + (0, _classCallCheck2.default)(this, Routes);
6014 + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
6015 + args[_key] = arguments[_key];
6016 + }
6017 + _this = _super.call.apply(_super, [this].concat(args));
6018 + _this.savedStates = {};
6019 + _this.historyPerComponent = {};
6020 + return _this;
6021 + }
6022 + (0, _createClass2.default)(Routes, [{
6023 + key: "refreshContainer",
6024 + value: function refreshContainer(container) {
6025 + var currentRoute = this.getCurrent(container),
6026 + currentArgs = this.getCurrentArgs(container);
6027 + this.clearCurrent(container);
6028 + this.to(currentRoute, currentArgs);
6029 + }
6030 + }, {
6031 + key: "getHistory",
6032 + value: function getHistory() {
6033 + var namespaceRoot = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
6034 + if (namespaceRoot) {
6035 + return this.historyPerComponent[namespaceRoot] || [];
6036 + }
6037 + return this.historyPerComponent;
6038 + }
6039 + }, {
6040 + key: "clearHistory",
6041 + value: function clearHistory(namespaceRoot) {
6042 + delete this.historyPerComponent[namespaceRoot];
6043 + }
6044 + }, {
6045 + key: "clearCurrent",
6046 + value: function clearCurrent(container) {
6047 + var route = this.current[container];
6048 + if (!route) {
6049 + return;
6050 + }
6051 + this.detachCurrent(container);
6052 + this.getComponent(route).onCloseRoute(route);
6053 + this.dispatchOnClose(route);
6054 + }
6055 + }, {
6056 + key: "clear",
6057 + value: function clear() {
6058 + var _this2 = this;
6059 + Object.keys(this.current).forEach(function (container) {
6060 + return _this2.clearCurrent(container);
6061 + });
6062 + }
6063 + }, {
6064 + key: "saveState",
6065 + value: function saveState(container) {
6066 + this.savedStates[container] = {
6067 + route: this.current[container],
6068 + args: this.currentArgs[container]
6069 + };
6070 + return this;
6071 + }
6072 + }, {
6073 + key: "restoreState",
6074 + value: function restoreState(container) {
6075 + if (!this.savedStates[container]) {
6076 + return false;
6077 + }
6078 + this.to(this.savedStates[container].route, this.savedStates[container].args);
6079 + return true;
6080 + }
6081 + }, {
6082 + key: "validateRun",
6083 + value: function validateRun(route) {
6084 + var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
6085 + if (!(0, _get2.default)((0, _getPrototypeOf2.default)(Routes.prototype), "validateRun", this).call(this, route, args)) {
6086 + return false;
6087 + }
6088 + if (this.is(route, args) && !args.refresh) {
6089 + return false;
6090 + }
6091 + var component = this.getComponent(route);
6092 + if (!component.isOpen || args.reOpen) {
6093 + component.isOpen = component.open(args);
6094 + }
6095 + return component.isOpen;
6096 + }
6097 +
6098 + /**
6099 + * @override
6100 + */
6101 + }, {
6102 + key: "beforeRun",
6103 + value: function beforeRun(route, args) {
6104 + var component = this.getComponent(route),
6105 + container = component.getServiceName(),
6106 + oldRoute = this.current[container];
6107 + if (oldRoute) {
6108 + this.getComponent(oldRoute).onCloseRoute(oldRoute);
6109 + }
6110 + _commands.default.trace.push(route);
6111 + (0, _get2.default)((0, _getPrototypeOf2.default)(Routes.prototype), "beforeRun", this).call(this, route, args, false);
6112 + this.attachCurrent(container, route, args);
6113 +
6114 + // In the previous condition, `$e.routes.is()` resolves the old route as active (because the actual route
6115 + // switching happens inside `this.attachCurrent()`), so we can't use it there.
6116 + if (oldRoute) {
6117 + this.dispatchOnClose(oldRoute);
6118 + }
6119 + }
6120 + }, {
6121 + key: "to",
6122 + value: function to(route, args) {
6123 + this.run(route, args);
6124 + var namespaceRoot = this.getComponent(route).getServiceName();
6125 + if (!this.historyPerComponent[namespaceRoot]) {
6126 + this.historyPerComponent[namespaceRoot] = [];
6127 + }
6128 + this.historyPerComponent[namespaceRoot].push({
6129 + route: route,
6130 + args: args
6131 + });
6132 + }
6133 + }, {
6134 + key: "back",
6135 + value: function back(namespaceRoot) {
6136 + var history = this.getHistory(namespaceRoot);
6137 +
6138 + // Remove current;
6139 + history.pop();
6140 + var last = history.pop();
6141 + if (!last) {
6142 + return;
6143 + }
6144 + this.to(last.route, last.args);
6145 + }
6146 +
6147 + // Don't use the event object.
6148 + }, {
6149 + key: "runShortcut",
6150 + value: function runShortcut(command) {
6151 + this.to(command);
6152 + }
6153 +
6154 + // Don't clear current route.
6155 + }, {
6156 + key: "afterRun",
6157 + value: function afterRun(route, args) {
6158 + var results = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;
6159 + var component = this.getComponent(route);
6160 + component.onRoute(route, args);
6161 + this.dispatchOnOpen(route);
6162 + (0, _get2.default)((0, _getPrototypeOf2.default)(Routes.prototype), "afterRun", this).call(this, route, args, results, false);
6163 + _commands.default.trace.pop();
6164 + }
6165 + }, {
6166 + key: "is",
6167 + value: function is(route) {
6168 + var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
6169 + if (!(0, _get2.default)((0, _getPrototypeOf2.default)(Routes.prototype), "is", this).call(this, route)) {
6170 + return false;
6171 + }
6172 + var container = this.getComponent(route).getServiceName();
6173 + return _.isEqual(args, this.currentArgs[container]);
6174 + }
6175 + }, {
6176 + key: "isPartOf",
6177 + value: function isPartOf(route) {
6178 + /**
6179 + * Check against current command hierarchically.
6180 + * For example `is( 'panel' )` will be true for `panel/elements`
6181 + * `is( 'panel/editor' )` will be true for `panel/editor/style`
6182 + */
6183 + var parts = route.split('/'),
6184 + container = parts[0],
6185 + toCheck = [],
6186 + currentParts = this.current[container] ? this.current[container].split('/') : [];
6187 + var match = false;
6188 + currentParts.forEach(function (part) {
6189 + toCheck.push(part);
6190 + if (toCheck.join('/') === route) {
6191 + match = true;
6192 + }
6193 + });
6194 + return match;
6195 + }
6196 + }, {
6197 + key: "error",
6198 + value: function error(message) {
6199 + throw Error('Routes: ' + message);
6200 + }
6201 + }, {
6202 + key: "dispatchOnOpen",
6203 + value: function dispatchOnOpen(route) {
6204 + window.dispatchEvent(new CustomEvent('elementor/routes/open', {
6205 + detail: {
6206 + route: route
6207 + }
6208 + }));
6209 + }
6210 + }, {
6211 + key: "dispatchOnClose",
6212 + value: function dispatchOnClose(route) {
6213 + window.dispatchEvent(new CustomEvent('elementor/routes/close', {
6214 + detail: {
6215 + route: route
6216 + }
6217 + }));
6218 + }
6219 + }]);
6220 + return Routes;
6221 +}(_commands.default);
6222 +exports["default"] = Routes;
6223 +
6224 +/***/ }),
6225 +
6226 +/***/ "../modules/web-cli/assets/js/core/shortcuts.js":
6227 +/*!******************************************************!*\
6228 + !*** ../modules/web-cli/assets/js/core/shortcuts.js ***!
6229 + \******************************************************/
6230 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
6231 +
6232 +"use strict";
6233 +
6234 +
6235 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
6236 +Object.defineProperty(exports, "__esModule", ({
6237 + value: true
6238 +}));
6239 +exports["default"] = void 0;
6240 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
6241 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
6242 +var _environment = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/environment */ "../modules/web-cli/assets/js/utils/environment.js"));
6243 +var _console = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/console */ "../modules/web-cli/assets/js/utils/console.js"));
6244 +var Shortcuts = /*#__PURE__*/function () {
6245 + function Shortcuts($window) {
6246 + (0, _classCallCheck2.default)(this, Shortcuts);
6247 + this.specialKeys = {
6248 + 13: 'enter',
6249 + 27: 'esc',
6250 + 38: 'up',
6251 + 40: 'down',
6252 + 46: 'del',
6253 + 191: '?'
6254 + };
6255 + this.component = '';
6256 + this.handlers = {};
6257 + this.bindListener($window);
6258 + }
6259 + (0, _createClass2.default)(Shortcuts, [{
6260 + key: "bindListener",
6261 + value: function bindListener($window) {
6262 + var _this = this;
6263 + $window.on('keydown', function (event) {
6264 + return _this.handle(event);
6265 + });
6266 + }
6267 + }, {
6268 + key: "getAll",
6269 + value: function getAll() {
6270 + var shortcuts = {};
6271 + jQuery.each(this.handlers, function (key, handler) {
6272 + jQuery.each(handler, function (index, config) {
6273 + shortcuts[config.command] = key;
6274 + });
6275 + });
6276 + return shortcuts;
6277 + }
6278 +
6279 + /**
6280 + * @param {string} shortcuts
6281 + * @param {Object} args
6282 + * @param {Function} args.callback Required
6283 + * @param {string} args.component Optional
6284 + * @param {Function} args.dependency Optional
6285 + * @param {Array} args.exclude Optional
6286 + * @param {boolean} args.allowAltKey Optional
6287 + */
6288 + }, {
6289 + key: "register",
6290 + value: function register(shortcuts, args) {
6291 + var _this2 = this;
6292 + shortcuts.replace(' ', '').split(',').forEach(function (shortcut) {
6293 + if (!_this2.handlers[shortcut]) {
6294 + _this2.handlers[shortcut] = [];
6295 + }
6296 + _this2.handlers[shortcut].push(args);
6297 + });
6298 + }
6299 + }, {
6300 + key: "unregister",
6301 + value: function unregister(shortcuts, args) {
6302 + var _this3 = this;
6303 + shortcuts.replace(' ', '').split(',').forEach(function (shortcut) {
6304 + _this3.handlers[shortcut].forEach(function (index, handler) {
6305 + if (args === handler) {
6306 + delete _this3.handlers[shortcut][index];
6307 + }
6308 + });
6309 + });
6310 + }
6311 + }, {
6312 + key: "handle",
6313 + value: function handle(event) {
6314 + var handlers = this.getHandlersByPriority(event);
6315 + if (!handlers) {
6316 + return;
6317 + }
6318 + var filteredHandlers = handlers.filter(function (handler) {
6319 + if (handler.exclude && -1 !== handler.exclude.indexOf('input')) {
6320 + var $target = jQuery(event.target);
6321 + if ($target.is(':input, .elementor-input') || $target.closest('[contenteditable="true"]').length) {
6322 + return false;
6323 + }
6324 + }
6325 + if (handler.dependency && !handler.dependency(event)) {
6326 + return false;
6327 + }
6328 +
6329 + // Fix for some keyboard sources that consider alt key as ctrl key
6330 + if (!handler.allowAltKey && event.altKey) {
6331 + return false;
6332 + }
6333 + return true;
6334 + });
6335 + if (!filteredHandlers.length) {
6336 + return;
6337 + }
6338 + if (1 < filteredHandlers.length && elementorWebCliConfig.isDebug) {
6339 + _console.default.warn('Multiple handlers for shortcut.', filteredHandlers, event);
6340 + }
6341 + event.preventDefault();
6342 + filteredHandlers[0].callback(event);
6343 + }
6344 + }, {
6345 + key: "isControlEvent",
6346 + value: function isControlEvent(event) {
6347 + return event[_environment.default.mac ? 'metaKey' : 'ctrlKey'];
6348 + }
6349 + }, {
6350 + key: "getEventShortcut",
6351 + value: function getEventShortcut(event) {
6352 + var shortcut = [];
6353 + if (event.altKey) {
6354 + shortcut.push('alt');
6355 + }
6356 + if (this.isControlEvent(event)) {
6357 + shortcut.push('ctrl');
6358 + }
6359 + if (event.shiftKey) {
6360 + shortcut.push('shift');
6361 + }
6362 + if (this.specialKeys[event.which]) {
6363 + shortcut.push(this.specialKeys[event.which]);
6364 + } else {
6365 + shortcut.push(String.fromCharCode(event.which).toLowerCase());
6366 + }
6367 + return shortcut.join('+');
6368 + }
6369 + }, {
6370 + key: "isActiveScope",
6371 + value: function isActiveScope(scopes) {
6372 + var activeComponents = Object.keys($e.components.activeComponents),
6373 + activeComponent = activeComponents[activeComponents.length - 1],
6374 + component = $e.components.get(activeComponent);
6375 + if (!component) {
6376 + return false;
6377 + }
6378 + var namespace = component.getNamespace();
6379 + var filteredByNamespace = scopes.some(function (scope) {
6380 + return namespace === scope;
6381 + });
6382 + if (filteredByNamespace) {
6383 + return true;
6384 + }
6385 +
6386 + // Else filter by namespaceRoot.
6387 + var namespaceRoot = component.getServiceName();
6388 + return scopes.some(function (scope) {
6389 + return namespaceRoot === scope;
6390 + });
6391 + }
6392 + }, {
6393 + key: "getHandlersByPriority",
6394 + value: function getHandlersByPriority(event) {
6395 + var _this4 = this;
6396 + var handlers = this.handlers[this.getEventShortcut(event)];
6397 + if (!handlers) {
6398 + return false;
6399 + }
6400 +
6401 + // TODO: Prioritize current scope before roo scope.
6402 + var inCurrentScope = handlers.filter(function (handler) {
6403 + return handler.scopes && _this4.isActiveScope(handler.scopes);
6404 + });
6405 + if (inCurrentScope.length) {
6406 + return inCurrentScope;
6407 + }
6408 + var noScope = handlers.filter(function (handler) {
6409 + return !handler.scopes;
6410 + });
6411 + if (noScope.length) {
6412 + return noScope;
6413 + }
6414 + }
6415 + }]);
6416 + return Shortcuts;
6417 +}();
6418 +exports["default"] = Shortcuts;
6419 +
6420 +/***/ }),
6421 +
6422 +/***/ "../modules/web-cli/assets/js/core/store.js":
6423 +/*!**************************************************!*\
6424 + !*** ../modules/web-cli/assets/js/core/store.js ***!
6425 + \**************************************************/
6426 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
6427 +
6428 +"use strict";
6429 +
6430 +
6431 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
6432 +Object.defineProperty(exports, "__esModule", ({
6433 + value: true
6434 +}));
6435 +exports["default"] = void 0;
6436 +var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js"));
6437 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
6438 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
6439 +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
6440 +var _toolkit = __webpack_require__(/*! @reduxjs/toolkit */ "../node_modules/@reduxjs/toolkit/dist/redux-toolkit.esm.js");
6441 +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; }
6442 +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; }
6443 +/**
6444 + * @typedef {import('@reduxjs/toolkit').Slice} Slice
6445 + */
6446 +/**
6447 + * @typedef {import('@reduxjs/toolkit').EnhancedStore} EnhancedStore
6448 + */
6449 +/**
6450 + * @typedef {import('@reduxjs/toolkit').AnyAction} AnyAction
6451 + */
6452 +/**
6453 + * @typedef {import('@reduxjs/toolkit').ThunkMiddlewareFor} ThunkMiddlewareFor
6454 + */
6455 +var Store = /*#__PURE__*/function () {
6456 + /**
6457 + * Initialize the Store.
6458 + *
6459 + * @return {void}
6460 + */
6461 + function Store() {
6462 + (0, _classCallCheck2.default)(this, Store);
6463 + /**
6464 + * @type {Object}
6465 + */
6466 + (0, _defineProperty2.default)(this, "slices", {});
6467 + /**
6468 + * @type {EnhancedStore<{}, AnyAction, [ThunkMiddlewareFor<{}>]>}
6469 + */
6470 + (0, _defineProperty2.default)(this, "reduxStore", void 0);
6471 + this.slices = {};
6472 + this.reduxStore = this.createStore();
6473 + }
6474 +
6475 + /**
6476 + * Create a Redux Store object.
6477 + *
6478 + * @return {EnhancedStore<{}, AnyAction, [ThunkMiddlewareFor<{}>]>} store
6479 + */
6480 + (0, _createClass2.default)(Store, [{
6481 + key: "createStore",
6482 + value: function createStore() {
6483 + return (0, _toolkit.configureStore)({
6484 + // Use an empty function instead of empty object since an empty object
6485 + // isn't a valid reducer value.
6486 + reducer: function reducer() {}
6487 + });
6488 + }
6489 +
6490 + /**
6491 + * Inject a new reducer.
6492 + *
6493 + * See: https://redux.js.org/usage/code-splitting#defining-an-injectreducer-function
6494 + *
6495 + * @param {string} id - Reducer unique ID.
6496 + * @param {Function} newReducer - New reducer to inject.
6497 + *
6498 + * @return {void}
6499 + */
6500 + }, {
6501 + key: "injectReducer",
6502 + value: function injectReducer(id, newReducer) {
6503 + var prevReducers = this.getReducers();
6504 + this.reduxStore.replaceReducer((0, _toolkit.combineReducers)(_objectSpread(_objectSpread({}, prevReducers), {}, (0, _defineProperty2.default)({}, id, newReducer))));
6505 + }
6506 +
6507 + /**
6508 + * Register a Redux Store slice.
6509 + *
6510 + * @param {string} sliceId - Slice unique ID.
6511 + * @param {Slice} instance - Slice object to add.
6512 + *
6513 + * @return {void}
6514 + */
6515 + }, {
6516 + key: "register",
6517 + value: function register(sliceId, instance) {
6518 + if (this.slices[sliceId]) {
6519 + throw "Slice with ID '".concat(sliceId, "' already exists.");
6520 + }
6521 + this.slices[sliceId] = instance;
6522 + this.injectReducer(sliceId, instance.reducer);
6523 + }
6524 +
6525 + /**
6526 + * Get a specific slice.
6527 + *
6528 + * @param {string|null} sliceId - Slice ID to get.
6529 + *
6530 + * @return {Slice} slice
6531 + */
6532 + }, {
6533 + key: "get",
6534 + value: function get(sliceId) {
6535 + return this.slices[sliceId];
6536 + }
6537 +
6538 + /**
6539 + * Get all slices.
6540 + *
6541 + * @return {Object} slices
6542 + */
6543 + }, {
6544 + key: "getAllSlices",
6545 + value: function getAllSlices() {
6546 + return this.slices;
6547 + }
6548 +
6549 + /**
6550 + * Get All slices.
6551 + *
6552 + * @return {Object} slices
6553 + */
6554 + }, {
6555 + key: "getAll",
6556 + value: function getAll() {
6557 + return Object.keys(this.slices).sort();
6558 + }
6559 +
6560 + /**
6561 + * Return the current reducers.
6562 + *
6563 + * @return {Object} reducers
6564 + */
6565 + }, {
6566 + key: "getReducers",
6567 + value: function getReducers() {
6568 + return Object.entries(this.slices).reduce(function (reducers, _ref) {
6569 + var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
6570 + key = _ref2[0],
6571 + slice = _ref2[1];
6572 + return _objectSpread(_objectSpread({}, reducers), {}, (0, _defineProperty2.default)({}, key, slice.reducer));
6573 + }, {});
6574 + }
6575 +
6576 + /**
6577 + * Get the actual Redux store object.
6578 + *
6579 + * @return {Object} redux store object
6580 + */
6581 + }, {
6582 + key: "getReduxStore",
6583 + value: function getReduxStore() {
6584 + return this.reduxStore;
6585 + }
6586 +
6587 + /**
6588 + * Proxy to Redux's `dispatch()` function.
6589 + *
6590 + * @return {*} the dispatched action
6591 + */
6592 + }, {
6593 + key: "dispatch",
6594 + value: function dispatch() {
6595 + var _this$reduxStore;
6596 + return (_this$reduxStore = this.reduxStore).dispatch.apply(_this$reduxStore, arguments);
6597 + }
6598 +
6599 + /**
6600 + * Proxy to Redux's `getState()` function, with the ability to get a specific slice.
6601 + *
6602 + * @param {string|null} sliceId
6603 + *
6604 + * @return {*} The current state tree of the application
6605 + */
6606 + }, {
6607 + key: "getState",
6608 + value: function getState() {
6609 + var sliceId = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
6610 + var state = this.reduxStore.getState();
6611 + return sliceId ? state[sliceId] : state;
6612 + }
6613 +
6614 + /**
6615 + * Proxy to Redux's `replaceReducer()` function.
6616 + * TODO: Do we want that?
6617 + *
6618 + * @return {*} undefined
6619 + */
6620 + }, {
6621 + key: "replaceReducer",
6622 + value: function replaceReducer() {
6623 + var _this$reduxStore2;
6624 + return (_this$reduxStore2 = this.reduxStore).replaceReducer.apply(_this$reduxStore2, arguments);
6625 + }
6626 +
6627 + /**
6628 + * Proxy to Redux's `subscribe()` function.
6629 + *
6630 + * @return {*} A function that unsubscribes the change listener
6631 + */
6632 + }, {
6633 + key: "subscribe",
6634 + value: function subscribe() {
6635 + var _this$reduxStore3;
6636 + return (_this$reduxStore3 = this.reduxStore).subscribe.apply(_this$reduxStore3, arguments);
6637 + }
6638 + }]);
6639 + return Store;
6640 +}();
6641 +exports["default"] = Store;
6642 +
6643 +/***/ }),
6644 +
6645 +/***/ "../modules/web-cli/assets/js/core/ui-states.js":
6646 +/*!******************************************************!*\
6647 + !*** ../modules/web-cli/assets/js/core/ui-states.js ***!
6648 + \******************************************************/
6649 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
6650 +
6651 +"use strict";
6652 +
6653 +
6654 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
6655 +Object.defineProperty(exports, "__esModule", ({
6656 + value: true
6657 +}));
6658 +exports["default"] = void 0;
6659 +var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js"));
6660 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
6661 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
6662 +/**
6663 + * @typedef {import('./states/ui-state-base')} UiStateBase
6664 + */
6665 +var UiStates = /*#__PURE__*/function () {
6666 + /**
6667 + * Initialize the State Manager.
6668 + *
6669 + * @return {void}
6670 + */
6671 + function UiStates() {
6672 + (0, _classCallCheck2.default)(this, UiStates);
6673 + this.states = {};
6674 + }
6675 +
6676 + /**
6677 + * Register a new state.
6678 + *
6679 + * @param {UiStateBase} instance - State instance.
6680 + */
6681 + (0, _createClass2.default)(UiStates, [{
6682 + key: "register",
6683 + value: function register(instance) {
6684 + var stateId = instance.getPrefixedId();
6685 + if (this.states[stateId]) {
6686 + throw "State '".concat(stateId, "' already exists.");
6687 + }
6688 + this.states[stateId] = instance;
6689 + }
6690 +
6691 + /**
6692 + * Get all existing states with their options:
6693 + *
6694 + * {
6695 + * 'state-id': [
6696 + * 'option-1',
6697 + * 'option-2',
6698 + * 'option-3',
6699 + * ],
6700 + * }
6701 + *
6702 + * @return {Object} all existing states
6703 + */
6704 + }, {
6705 + key: "getAll",
6706 + value: function getAll() {
6707 + var states = {};
6708 + Object.entries(this.states).forEach(function (_ref) {
6709 + var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
6710 + id = _ref2[0],
6711 + instance = _ref2[1];
6712 + var options = instance.getOptions();
6713 + states[id] = Object.keys(options);
6714 + });
6715 + return states;
6716 + }
6717 +
6718 + /**
6719 + * Get the state value, or return all of them if no `state` is set.
6720 + *
6721 + * @param {string} state - State ID.
6722 + *
6723 + * @return {UiStateBase} state value
6724 + */
6725 + }, {
6726 + key: "get",
6727 + value: function get(state) {
6728 + if (state) {
6729 + return this.states[state];
6730 + }
6731 + return this.states;
6732 + }
6733 +
6734 + /**
6735 + * Set the current state value and trigger its callbacks & events.
6736 + * This function triggers a `e-ui-state:${ stateID }` event to the scope, with `oldValue` & `newValue`
6737 + * under `e.detail`.
6738 + * Additionally, it adds a `e-ui-state--${ stateID }__${ value }` class to the scope element.
6739 + *
6740 + * @param {string} state - State ID.
6741 + * @param {string} value - New state value.
6742 + *
6743 + * @return {void}
6744 + */
6745 + }, {
6746 + key: "set",
6747 + value: function set(state, value) {
6748 + // Invalid state or option.
6749 + if (!this.get(state)) {
6750 + throw "State '".concat(state, "' doesn't exist.");
6751 + }
6752 + var oldValue = this.getCurrent(state),
6753 + classPrefix = "e-ui-state--".concat(state.replaceAll('/', '-')),
6754 + oldStateClass = "".concat(classPrefix, "__").concat(oldValue),
6755 + newStateClass = "".concat(classPrefix, "__").concat(value),
6756 + scopes = this.get(state).getScopes();
6757 +
6758 + // Set the current state to the new value.
6759 + this.get(state).set(value);
6760 + scopes.forEach(function (scope) {
6761 + scope.classList.remove(oldStateClass);
6762 +
6763 + // Set the new class only if there is a value (i.e. it's not a state removal action).
6764 + if (value) {
6765 + scope.classList.add(newStateClass);
6766 + }
6767 +
6768 + // Dispatch a custom state-change event to the scope.
6769 + var event = new CustomEvent("e-ui-state:".concat(state), {
6770 + detail: {
6771 + oldValue: oldValue,
6772 + newValue: value
6773 + }
6774 + });
6775 + scope.dispatchEvent(event);
6776 + });
6777 + }
6778 +
6779 + /**
6780 + * Remove a state.
6781 + *
6782 + * @param {string} state - State ID.
6783 + *
6784 + * @return {void}
6785 + */
6786 + }, {
6787 + key: "remove",
6788 + value: function remove(state) {
6789 + this.set(state, '');
6790 + }
6791 +
6792 + /**
6793 + * Get the current state value.
6794 + *
6795 + * @param {string} state - State ID.
6796 + *
6797 + * @return {string} current state value
6798 + */
6799 + }, {
6800 + key: "getCurrent",
6801 + value: function getCurrent(state) {
6802 + var _this$get;
6803 + return (_this$get = this.get(state)) === null || _this$get === void 0 ? void 0 : _this$get.getCurrent();
6804 + }
6805 + }]);
6806 + return UiStates;
6807 +}();
6808 +exports["default"] = UiStates;
6809 +
6810 +/***/ }),
6811 +
6812 +/***/ "../modules/web-cli/assets/js/extras/hash-commands.js":
6813 +/*!************************************************************!*\
6814 + !*** ../modules/web-cli/assets/js/extras/hash-commands.js ***!
6815 + \************************************************************/
6816 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
6817 +
6818 +"use strict";
6819 +
6820 +
6821 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
6822 +Object.defineProperty(exports, "__esModule", ({
6823 + value: true
6824 +}));
6825 +exports["default"] = void 0;
6826 +var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ "../node_modules/@babel/runtime/regenerator/index.js"));
6827 +var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "../node_modules/@babel/runtime/helpers/asyncToGenerator.js"));
6828 +var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js"));
6829 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
6830 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
6831 +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
6832 +var _console = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/console */ "../modules/web-cli/assets/js/utils/console.js"));
6833 +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; } } }; }
6834 +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); }
6835 +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; }
6836 +var HashCommands = /*#__PURE__*/function () {
6837 + function HashCommands() {
6838 + (0, _classCallCheck2.default)(this, HashCommands);
6839 + /**
6840 + * Cannot be static since it uses callback(s) that are available only after '$e' is initialized.
6841 + */
6842 + (0, _defineProperty2.default)(this, "dispatchersList", {
6843 + 'e:run': {
6844 + runner: function runner() {
6845 + return $e.run;
6846 + },
6847 + isSafe: function isSafe(command) {
6848 + var _$e$commands$getComma;
6849 + return (_$e$commands$getComma = $e.commands.getCommandClass(command)) === null || _$e$commands$getComma === void 0 ? void 0 : _$e$commands$getComma.getInfo().isSafe;
6850 + },
6851 + isSafeWithArgs: function isSafeWithArgs(command) {
6852 + var _$e$commands$getComma2;
6853 + return (_$e$commands$getComma2 = $e.commands.getCommandClass(command)) === null || _$e$commands$getComma2 === void 0 ? void 0 : _$e$commands$getComma2.getInfo().isSafeWithArgs;
6854 + }
6855 + },
6856 + 'e:route': {
6857 + runner: function runner() {
6858 + return $e.route;
6859 + },
6860 + isSafe: function isSafe() {
6861 + return true;
6862 + },
6863 + isSafeWithArgs: function isSafeWithArgs() {
6864 + return false;
6865 + }
6866 + }
6867 + });
6868 + /**
6869 + * @typedef HashCommand
6870 + * @property {string} method method
6871 + * @property {string} command command
6872 + * @property {Object} args arguments
6873 + */
6874 + /**
6875 + * List of current loaded hash commands.
6876 + *
6877 + * @type {Array.<HashCommand>}
6878 + */
6879 + (0, _defineProperty2.default)(this, "commands", []);
6880 + this.commands = this.get();
6881 + }
6882 +
6883 + /**
6884 + * Function get().
6885 + *
6886 + * Get API requests that comes from hash ( eg #e:run ).
6887 + *
6888 + * @param {string} hash
6889 + *
6890 + * @return {Array.<HashCommand>} API requests
6891 + */
6892 + (0, _createClass2.default)(HashCommands, [{
6893 + key: "get",
6894 + value: function get() {
6895 + var _this = this;
6896 + var hash = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : location.hash;
6897 + var result = [];
6898 + if (hash) {
6899 + // Remove first '#' and split each '&'.
6900 + var hashList = hash.substr(1).split('&');
6901 + hashList.forEach(function (hashItem) {
6902 + // eslint-disable-next-line @wordpress/no-unused-vars-before-return
6903 + var _hashItem$split = hashItem.split('?'),
6904 + _hashItem$split2 = (0, _slicedToArray2.default)(_hashItem$split, 2),
6905 + rawCommand = _hashItem$split2[0],
6906 + rawArgs = _hashItem$split2[1];
6907 + var hashParts = rawCommand.split(':');
6908 + if (3 !== hashParts.length) {
6909 + return;
6910 + }
6911 + var method = hashParts[0] + ':' + hashParts[1],
6912 + dispatcher = _this.dispatchersList[method];
6913 + if (dispatcher) {
6914 + var command = hashParts[2],
6915 + args = _this.parseCommandArgs(rawArgs);
6916 + result.push({
6917 + method: method,
6918 + command: command,
6919 + args: args
6920 + });
6921 + }
6922 + });
6923 + }
6924 + return result;
6925 + }
6926 +
6927 + /**
6928 + * Function run().
6929 + *
6930 + * Run API requests that comes from hash ( eg #e:run ).
6931 + *
6932 + * @param {Array.<HashCommand>} [commands=this.commands]
6933 + */
6934 + }, {
6935 + key: "run",
6936 + value: function () {
6937 + var _run = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
6938 + var commands,
6939 + _iterator,
6940 + _step,
6941 + hashCommand,
6942 + dispatcher,
6943 + _iterator2,
6944 + _step2,
6945 + _hashCommand,
6946 + _dispatcher,
6947 + _args = arguments;
6948 + return _regenerator.default.wrap(function _callee$(_context) {
6949 + while (1) switch (_context.prev = _context.next) {
6950 + case 0:
6951 + commands = _args.length > 0 && _args[0] !== undefined ? _args[0] : this.commands;
6952 + // To allow validate the run first.
6953 + _iterator = _createForOfIteratorHelper(commands);
6954 + _context.prev = 2;
6955 + _iterator.s();
6956 + case 4:
6957 + if ((_step = _iterator.n()).done) {
6958 + _context.next = 13;
6959 + break;
6960 + }
6961 + hashCommand = _step.value;
6962 + dispatcher = this.dispatchersList[hashCommand.method];
6963 + if (dispatcher) {
6964 + _context.next = 9;
6965 + break;
6966 + }
6967 + return _context.abrupt("return", Promise.reject(new Error("No dispatcher found for the command: `".concat(hashCommand.command, "`."))));
6968 + case 9:
6969 + if (dispatcher.isSafe(hashCommand.command)) {
6970 + _context.next = 11;
6971 + break;
6972 + }
6973 + return _context.abrupt("return", Promise.reject(new Error("Attempting to run unsafe or non exist command: `".concat(hashCommand.command, "`."))));
6974 + case 11:
6975 + _context.next = 4;
6976 + break;
6977 + case 13:
6978 + _context.next = 18;
6979 + break;
6980 + case 15:
6981 + _context.prev = 15;
6982 + _context.t0 = _context["catch"](2);
6983 + _iterator.e(_context.t0);
6984 + case 18:
6985 + _context.prev = 18;
6986 + _iterator.f();
6987 + return _context.finish(18);
6988 + case 21:
6989 + // This logic will run the promises by sequence (will wait for dispatcher to finish, before run again).
6990 + _iterator2 = _createForOfIteratorHelper(commands);
6991 + _context.prev = 22;
6992 + _iterator2.s();
6993 + case 24:
6994 + if ((_step2 = _iterator2.n()).done) {
6995 + _context.next = 31;
6996 + break;
6997 + }
6998 + _hashCommand = _step2.value;
6999 + _dispatcher = this.dispatchersList[_hashCommand.method];
7000 + _context.next = 29;
7001 + return _dispatcher.runner()(_hashCommand.command, _dispatcher.isSafeWithArgs(_hashCommand.command) ? _hashCommand.args : undefined);
7002 + case 29:
7003 + _context.next = 24;
7004 + break;
7005 + case 31:
7006 + _context.next = 36;
7007 + break;
7008 + case 33:
7009 + _context.prev = 33;
7010 + _context.t1 = _context["catch"](22);
7011 + _iterator2.e(_context.t1);
7012 + case 36:
7013 + _context.prev = 36;
7014 + _iterator2.f();
7015 + return _context.finish(36);
7016 + case 39:
7017 + case "end":
7018 + return _context.stop();
7019 + }
7020 + }, _callee, this, [[2, 15, 18, 21], [22, 33, 36, 39]]);
7021 + }));
7022 + function run() {
7023 + return _run.apply(this, arguments);
7024 + }
7025 + return run;
7026 + }()
7027 + /**
7028 + * Function runOnce().
7029 + *
7030 + * Do same as `run` but clear `this.commands` before leaving.
7031 + */
7032 + }, {
7033 + key: "runOnce",
7034 + value: function runOnce() {
7035 + var _this2 = this;
7036 + this.run(this.commands).then(function () {
7037 + _this2.commands = [];
7038 + });
7039 + }
7040 +
7041 + /**
7042 + * Takes a args in form of JSON and parse it.
7043 + *
7044 + * @param {string} rawArgs
7045 + * @return {Object} args in as an object
7046 + */
7047 + }, {
7048 + key: "parseCommandArgs",
7049 + value: function parseCommandArgs(rawArgs) {
7050 + try {
7051 + return JSON.parse(decodeURI(rawArgs || '{}'));
7052 + } catch (e) {
7053 + _console.default.warn('Hash commands JSON args cannot be parsed. \n\n', e);
7054 + return {};
7055 + }
7056 + }
7057 + }]);
7058 + return HashCommands;
7059 +}();
7060 +exports["default"] = HashCommands;
7061 +
7062 +/***/ }),
7063 +
7064 +/***/ "../modules/web-cli/assets/js/modules/command-base.js":
7065 +/*!************************************************************!*\
7066 + !*** ../modules/web-cli/assets/js/modules/command-base.js ***!
7067 + \************************************************************/
7068 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
7069 +
7070 +"use strict";
7071 +
7072 +
7073 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
7074 +Object.defineProperty(exports, "__esModule", ({
7075 + value: true
7076 +}));
7077 +exports["default"] = void 0;
7078 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
7079 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
7080 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
7081 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
7082 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
7083 +var _commandInfra = _interopRequireDefault(__webpack_require__(/*! ./command-infra */ "../modules/web-cli/assets/js/modules/command-infra.js"));
7084 +var _deprecation = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/deprecation */ "../modules/web-cli/assets/js/utils/deprecation.js"));
7085 +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); }; }
7086 +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; } }
7087 +/**
7088 + * @name $e.modules.CommandBase
7089 + */
7090 +var CommandBase = /*#__PURE__*/function (_CommandInfra) {
7091 + (0, _inherits2.default)(CommandBase, _CommandInfra);
7092 + var _super = _createSuper(CommandBase);
7093 + function CommandBase() {
7094 + (0, _classCallCheck2.default)(this, CommandBase);
7095 + return _super.apply(this, arguments);
7096 + }
7097 + (0, _createClass2.default)(CommandBase, [{
7098 + key: "onBeforeRun",
7099 + value: function onBeforeRun() {
7100 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7101 + $e.hooks.runUIBefore(this.command, args);
7102 + }
7103 + }, {
7104 + key: "onAfterRun",
7105 + value: function onAfterRun() {
7106 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7107 + var result = arguments.length > 1 ? arguments[1] : undefined;
7108 + $e.hooks.runUIAfter(this.command, args, result);
7109 + }
7110 + }, {
7111 + key: "onBeforeApply",
7112 + value: function onBeforeApply() {
7113 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7114 + $e.hooks.runDataDependency(this.command, args);
7115 + }
7116 + }, {
7117 + key: "onAfterApply",
7118 + value: function onAfterApply() {
7119 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7120 + var result = arguments.length > 1 ? arguments[1] : undefined;
7121 + $e.hooks.runDataAfter(this.command, args, result);
7122 + }
7123 + }, {
7124 + key: "onCatchApply",
7125 + value: function onCatchApply(e) {
7126 + this.runCatchHooks(e);
7127 + }
7128 +
7129 + /**
7130 + * Run all the catch hooks.
7131 + *
7132 + * @param {Error} e
7133 + */
7134 + }, {
7135 + key: "runCatchHooks",
7136 + value: function runCatchHooks(e) {
7137 + $e.hooks.runDataCatch(this.command, this.args, e);
7138 + $e.hooks.runUICatch(this.command, this.args, e);
7139 + }
7140 +
7141 + /**
7142 + * TODO - Remove - Backwards compatibility.
7143 + *
7144 + * Function requireContainer().
7145 + *
7146 + * Validate `arg.container` & `arg.containers`.
7147 + *
7148 + * @param {{}} args
7149 + *
7150 + * @throws {Error}
7151 + */
7152 + }, {
7153 + key: "requireContainer",
7154 + value: function requireContainer() {
7155 + var _this = this;
7156 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.args;
7157 + _deprecation.default.deprecated('requireContainer', '3.7.0', 'Extend `$e.modules.editor.CommandContainerBase` or `$e.modules.editor.CommandContainerInternalBase`');
7158 + if (!args.container && !args.containers) {
7159 + throw Error('container or containers are required.');
7160 + }
7161 + if (args.container && args.containers) {
7162 + throw Error('container and containers cannot go together please select one of them.');
7163 + }
7164 + var containers = args.containers || [args.container];
7165 + containers.forEach(function (container) {
7166 + _this.requireArgumentInstance('container', elementorModules.editor.Container, {
7167 + container: container
7168 + });
7169 + });
7170 + }
7171 + }], [{
7172 + key: "getInstanceType",
7173 + value: function getInstanceType() {
7174 + return 'CommandBase';
7175 + }
7176 + }]);
7177 + return CommandBase;
7178 +}(_commandInfra.default);
7179 +exports["default"] = CommandBase;
7180 +
7181 +/***/ }),
7182 +
7183 +/***/ "../modules/web-cli/assets/js/modules/command-callback-base.js":
7184 +/*!*********************************************************************!*\
7185 + !*** ../modules/web-cli/assets/js/modules/command-callback-base.js ***!
7186 + \*********************************************************************/
7187 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
7188 +
7189 +"use strict";
7190 +
7191 +
7192 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
7193 +Object.defineProperty(exports, "__esModule", ({
7194 + value: true
7195 +}));
7196 +exports["default"] = void 0;
7197 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
7198 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
7199 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
7200 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
7201 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
7202 +var _commandBase = _interopRequireDefault(__webpack_require__(/*! ./command-base */ "../modules/web-cli/assets/js/modules/command-base.js"));
7203 +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); }; }
7204 +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; } }
7205 +/**
7206 + * To support pure callbacks in the API(commands.js), to ensure they have registered with the proper context.
7207 + */
7208 +var CommandCallbackBase = /*#__PURE__*/function (_CommandBase) {
7209 + (0, _inherits2.default)(CommandCallbackBase, _CommandBase);
7210 + var _super = _createSuper(CommandCallbackBase);
7211 + function CommandCallbackBase() {
7212 + (0, _classCallCheck2.default)(this, CommandCallbackBase);
7213 + return _super.apply(this, arguments);
7214 + }
7215 + (0, _createClass2.default)(CommandCallbackBase, [{
7216 + key: "apply",
7217 + value: function apply() {
7218 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7219 + return this.constructor.getCallback()(args);
7220 + }
7221 + }], [{
7222 + key: "getInstanceType",
7223 + value: function getInstanceType() {
7224 + return 'CommandCallbackBase';
7225 + }
7226 +
7227 + /**
7228 + * Get original callback of the command.
7229 + *
7230 + * Support pure callbacks ( Non command-base ).
7231 + *
7232 + * @return {()=>{}} Command Results.
7233 + */
7234 + }, {
7235 + key: "getCallback",
7236 + value: function getCallback() {
7237 + return this.registerConfig.callback;
7238 + }
7239 + }]);
7240 + return CommandCallbackBase;
7241 +}(_commandBase.default);
7242 +exports["default"] = CommandCallbackBase;
7243 +
7244 +/***/ }),
7245 +
7246 +/***/ "../modules/web-cli/assets/js/modules/command-data.js":
7247 +/*!************************************************************!*\
7248 + !*** ../modules/web-cli/assets/js/modules/command-data.js ***!
7249 + \************************************************************/
7250 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
7251 +
7252 +"use strict";
7253 +
7254 +
7255 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
7256 +var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js");
7257 +Object.defineProperty(exports, "__esModule", ({
7258 + value: true
7259 +}));
7260 +exports["default"] = void 0;
7261 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
7262 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
7263 +var _assertThisInitialized2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ "../node_modules/@babel/runtime/helpers/assertThisInitialized.js"));
7264 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
7265 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
7266 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
7267 +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
7268 +var _commandBase = _interopRequireDefault(__webpack_require__(/*! ./command-base */ "../modules/web-cli/assets/js/modules/command-base.js"));
7269 +var errors = _interopRequireWildcard(__webpack_require__(/*! ../core/data/errors/ */ "../modules/web-cli/assets/js/core/data/errors/index.js"));
7270 +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); }
7271 +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; }
7272 +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); }; }
7273 +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; } }
7274 +/**
7275 + * @name $e.modules.CommandData
7276 + */
7277 +/**
7278 + * @typedef {('create'|'delete'|'get'|'update'|'options')} DataTypes
7279 + */
7280 +/**
7281 + * @typedef {{}} RequestData
7282 + */
7283 +/**
7284 + * @typedef {import('../core/data/errors/base-error')} BaseError
7285 + */
7286 +var CommandData = /*#__PURE__*/function (_CommandBase) {
7287 + (0, _inherits2.default)(CommandData, _CommandBase);
7288 + var _super = _createSuper(CommandData);
7289 + function CommandData(args) {
7290 + var _this$args$options;
7291 + var _this;
7292 + var commandsAPI = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : $e.data;
7293 + (0, _classCallCheck2.default)(this, CommandData);
7294 + _this = _super.call(this, args, commandsAPI);
7295 + /**
7296 + * Data returned from remote.
7297 + *
7298 + * @type {*}
7299 + */
7300 + (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "data", void 0);
7301 + /**
7302 + * Fetch type.
7303 + *
7304 + * @type {DataTypes}
7305 + */
7306 + (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "type", void 0);
7307 + if ((_this$args$options = _this.args.options) !== null && _this$args$options !== void 0 && _this$args$options.type) {
7308 + _this.type = _this.args.options.type;
7309 + }
7310 + return _this;
7311 + }
7312 +
7313 + /**
7314 + * Function getEndpointFormat().
7315 + *
7316 + * @return {null|string} endpoint format
7317 + */
7318 + (0, _createClass2.default)(CommandData, [{
7319 + key: "getApplyMethods",
7320 + value:
7321 + /**
7322 + * @param {DataTypes} type
7323 + *
7324 + * @return {boolean|{before: (function(*=): {}), after: (function({}, *=): {})}} apply methods
7325 + */
7326 + function getApplyMethods() {
7327 + var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.type;
7328 + var before, after;
7329 + switch (type) {
7330 + case 'create':
7331 + before = this.applyBeforeCreate;
7332 + after = this.applyAfterCreate;
7333 + break;
7334 + case 'delete':
7335 + before = this.applyBeforeDelete;
7336 + after = this.applyAfterDelete;
7337 + break;
7338 + case 'get':
7339 + before = this.applyBeforeGet;
7340 + after = this.applyAfterGet;
7341 + break;
7342 + case 'update':
7343 + before = this.applyBeforeUpdate;
7344 + after = this.applyAfterUpdate;
7345 + break;
7346 + case 'options':
7347 + before = this.applyBeforeOptions;
7348 + after = this.applyAfterOptions;
7349 + break;
7350 + default:
7351 + return false;
7352 + }
7353 + return {
7354 + before: before.bind(this),
7355 + after: after.bind(this)
7356 + };
7357 + }
7358 +
7359 + /**
7360 + * Function getRequestData().
7361 + *
7362 + * @return {RequestData} request data
7363 + */
7364 + }, {
7365 + key: "getRequestData",
7366 + value: function getRequestData() {
7367 + return {
7368 + type: this.type,
7369 + args: this.args,
7370 + timestamp: new Date().getTime(),
7371 + component: this.component,
7372 + command: this.command,
7373 + endpoint: $e.data.commandToEndpoint(this.command, JSON.parse(JSON.stringify(this.args)), this.constructor.getEndpointFormat())
7374 + };
7375 + }
7376 + }, {
7377 + key: "apply",
7378 + value: function apply() {
7379 + var _this2 = this;
7380 + var applyMethods = this.getApplyMethods();
7381 +
7382 + // Run 'before' method.
7383 + this.args = applyMethods.before(this.args);
7384 + var requestData = this.getRequestData();
7385 + return $e.data.fetch(requestData).then(function (data) {
7386 + _this2.data = data;
7387 +
7388 + // Run 'after' method.
7389 + _this2.data = applyMethods.after(data, _this2.args);
7390 + _this2.data = {
7391 + data: _this2.data
7392 + };
7393 +
7394 + // Append requestData.
7395 + _this2.data = Object.assign({
7396 + __requestData__: requestData
7397 + }, _this2.data);
7398 + return _this2.data;
7399 + });
7400 + }
7401 +
7402 + /**
7403 + * @param {*} [args={}]
7404 + * @return {{}} filtered args
7405 + */
7406 + }, {
7407 + key: "applyBeforeCreate",
7408 + value: function applyBeforeCreate() {
7409 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7410 + return args;
7411 + }
7412 +
7413 + /**
7414 + * @param {{}} data
7415 + * @param {*} [args={}]
7416 + * @return {{}} filtered result
7417 + */
7418 + }, {
7419 + key: "applyAfterCreate",
7420 + value: function applyAfterCreate(data) {
7421 + var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
7422 + // eslint-disable-line no-unused-vars
7423 + return data;
7424 + }
7425 +
7426 + /**
7427 + * @param {*} [args={}]
7428 + * @return {{}} filtered args
7429 + */
7430 + }, {
7431 + key: "applyBeforeDelete",
7432 + value: function applyBeforeDelete() {
7433 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7434 + return args;
7435 + }
7436 +
7437 + /**
7438 + * @param {{}} data
7439 + * @param {*} [args={}]
7440 + * @return {{}} filtered result
7441 + */
7442 + }, {
7443 + key: "applyAfterDelete",
7444 + value: function applyAfterDelete(data) {
7445 + var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
7446 + // eslint-disable-line no-unused-vars
7447 + return data;
7448 + }
7449 +
7450 + /**
7451 + * @param {*} [args={}]
7452 + * @return {{}} filtered args
7453 + */
7454 + }, {
7455 + key: "applyBeforeGet",
7456 + value: function applyBeforeGet() {
7457 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7458 + return args;
7459 + }
7460 +
7461 + /**
7462 + * @param {{}} data
7463 + * @param {*} [args={}]
7464 + * @return {{}} filtered result
7465 + */
7466 + }, {
7467 + key: "applyAfterGet",
7468 + value: function applyAfterGet(data) {
7469 + var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
7470 + // eslint-disable-line no-unused-vars
7471 + return data;
7472 + }
7473 +
7474 + /**
7475 + * @param {*} [args={}]
7476 + * @return {{}} filtered args
7477 + */
7478 + }, {
7479 + key: "applyBeforeUpdate",
7480 + value: function applyBeforeUpdate() {
7481 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7482 + return args;
7483 + }
7484 +
7485 + /**
7486 + * @param {{}} data
7487 + * @param {*} [args={}]
7488 + * @return {{}} filtered result
7489 + */
7490 + }, {
7491 + key: "applyAfterUpdate",
7492 + value: function applyAfterUpdate(data) {
7493 + var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
7494 + // eslint-disable-line no-unused-vars
7495 + return data;
7496 + }
7497 +
7498 + /**
7499 + * @param {*} [args={}]
7500 + * @return {{}} filtered args
7501 + */
7502 + }, {
7503 + key: "applyBeforeOptions",
7504 + value: function applyBeforeOptions() {
7505 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7506 + return args;
7507 + }
7508 +
7509 + /**
7510 + * @param {{}} data
7511 + * @param {*} [args={}]
7512 + * @return {{}} filtered result
7513 + */
7514 + }, {
7515 + key: "applyAfterOptions",
7516 + value: function applyAfterOptions(data) {
7517 + var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
7518 + // eslint-disable-line no-unused-vars
7519 + return data;
7520 + }
7521 +
7522 + /**
7523 + * @param {BaseError} e
7524 + */
7525 + }, {
7526 + key: "applyAfterCatch",
7527 + value: function applyAfterCatch(e) {
7528 + e.notify();
7529 + }
7530 + }, {
7531 + key: "onCatchApply",
7532 + value: function onCatchApply(e) {
7533 + var _e, _e$data;
7534 + // TODO: If the errors that returns from the server is consistent remove the '?' from 'e'
7535 + 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;
7536 + var dataError = Object.values(errors).find(function (error) {
7537 + return error.getHTTPErrorCode() === httpErrorCode;
7538 + });
7539 + if (!dataError) {
7540 + dataError = errors.DefaultError;
7541 + }
7542 + e = dataError.create(e.message, e.code, e.data || []);
7543 + this.runCatchHooks(e);
7544 + this.applyAfterCatch(e);
7545 + }
7546 + }], [{
7547 + key: "getInstanceType",
7548 + value: function getInstanceType() {
7549 + return 'CommandData';
7550 + }
7551 + }, {
7552 + key: "getEndpointFormat",
7553 + value: function getEndpointFormat() {
7554 + return null;
7555 + }
7556 + }]);
7557 + return CommandData;
7558 +}(_commandBase.default);
7559 +exports["default"] = CommandData;
7560 +
7561 +/***/ }),
7562 +
7563 +/***/ "../modules/web-cli/assets/js/modules/command-infra.js":
7564 +/*!*************************************************************!*\
7565 + !*** ../modules/web-cli/assets/js/modules/command-infra.js ***!
7566 + \*************************************************************/
7567 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
7568 +
7569 +"use strict";
7570 +
7571 +
7572 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
7573 +Object.defineProperty(exports, "__esModule", ({
7574 + value: true
7575 +}));
7576 +exports["default"] = void 0;
7577 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
7578 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
7579 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
7580 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
7581 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
7582 +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
7583 +var _argsObject = _interopRequireDefault(__webpack_require__(/*! elementor-assets-js/modules/imports/args-object */ "../assets/dev/js/modules/imports/args-object.js"));
7584 +var _deprecation = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/deprecation */ "../modules/web-cli/assets/js/utils/deprecation.js"));
7585 +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); }; }
7586 +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; } }
7587 +/**
7588 + * @typedef {import('../modules/component-base')} ComponentBase
7589 + */
7590 +var CommandInfra = /*#__PURE__*/function (_ArgsObject) {
7591 + (0, _inherits2.default)(CommandInfra, _ArgsObject);
7592 + var _super = _createSuper(CommandInfra);
7593 + /**
7594 + * Function constructor().
7595 + *
7596 + * Create Commands Base.
7597 + *
7598 + * @param {{}} args
7599 + */
7600 + function CommandInfra() {
7601 + var _this;
7602 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7603 + (0, _classCallCheck2.default)(this, CommandInfra);
7604 + _this = _super.call(this, args);
7605 + if (!_this.constructor.registerConfig) {
7606 + throw RangeError('Doing it wrong: Each command type should have `registerConfig`.');
7607 + }
7608 +
7609 + // Acknowledge self about which command it run.
7610 + _this.command = _this.constructor.getCommand();
7611 +
7612 + // Assign instance of current component.
7613 + _this.component = _this.constructor.getComponent();
7614 +
7615 + // Who ever need do something before without `super` the constructor can use `initialize` method.
7616 + _this.initialize(args);
7617 +
7618 + // Refresh args, maybe the changed via `initialize`.
7619 + args = _this.args;
7620 +
7621 + // Validate args before run.
7622 + _this.validateArgs(args);
7623 + return _this;
7624 + }
7625 +
7626 + /**
7627 + * Function initialize().
7628 + *
7629 + * Initialize command, called after construction.
7630 + *
7631 + * @param {{}} args
7632 + */
7633 + (0, _createClass2.default)(CommandInfra, [{
7634 + key: "currentCommand",
7635 + get:
7636 + // TODO - Remove backwards compatibility.
7637 + function get() {
7638 + _deprecation.default.deprecated('this.currentCommand', '3.7.0', 'this.command');
7639 + return this.command;
7640 + }
7641 + }, {
7642 + key: "initialize",
7643 + value: function initialize() {
7644 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7645 + } // eslint-disable-line no-unused-vars
7646 +
7647 + /**
7648 + * Function validateArgs().
7649 + *
7650 + * Validate command arguments.
7651 + *
7652 + * @param {{}} args
7653 + */
7654 + }, {
7655 + key: "validateArgs",
7656 + value: function validateArgs() {
7657 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7658 + } // eslint-disable-line no-unused-vars
7659 +
7660 + // eslint-disable-next-line jsdoc/require-returns-check
7661 + /**
7662 + * Function apply().
7663 + *
7664 + * Do the actual command.
7665 + *
7666 + * @param {{}} args
7667 + *
7668 + * @return {*} Command results.
7669 + */
7670 + }, {
7671 + key: "apply",
7672 + value: function apply() {
7673 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7674 + // eslint-disable-line no-unused-vars
7675 + elementorModules.ForceMethodImplementation();
7676 + }
7677 +
7678 + /**
7679 + * Function run().
7680 + *
7681 + * Run command with history & hooks.
7682 + *
7683 + * @return {*} Command results.
7684 + */
7685 + }, {
7686 + key: "run",
7687 + value: function run() {
7688 + return this.apply(this.args);
7689 + }
7690 +
7691 + /**
7692 + * Function onBeforeRun.
7693 + *
7694 + * Called before run().
7695 + *
7696 + * @param {{}} args
7697 + */
7698 + }, {
7699 + key: "onBeforeRun",
7700 + value: function onBeforeRun() {
7701 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7702 + } // eslint-disable-line no-unused-vars
7703 +
7704 + /**
7705 + * Function onAfterRun.
7706 + *
7707 + * Called after run().
7708 + *
7709 + * @param {{}} args
7710 + * @param {*} result
7711 + */
7712 + }, {
7713 + key: "onAfterRun",
7714 + value: function onAfterRun() {
7715 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7716 + var result = arguments.length > 1 ? arguments[1] : undefined;
7717 + } // eslint-disable-line no-unused-vars
7718 +
7719 + /**
7720 + * Function onBeforeApply.
7721 + *
7722 + * Called before apply().
7723 + *
7724 + * @param {{}} args
7725 + */
7726 + }, {
7727 + key: "onBeforeApply",
7728 + value: function onBeforeApply() {
7729 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7730 + } // eslint-disable-line no-unused-vars
7731 +
7732 + /**
7733 + * Function onAfterApply.
7734 + *
7735 + * Called after apply().
7736 + *
7737 + * @param {{}} args
7738 + * @param {*} result
7739 + */
7740 + }, {
7741 + key: "onAfterApply",
7742 + value: function onAfterApply() {
7743 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
7744 + var result = arguments.length > 1 ? arguments[1] : undefined;
7745 + } // eslint-disable-line no-unused-vars
7746 +
7747 + /**
7748 + * Function onCatchApply.
7749 + *
7750 + * Called after apply() failed.
7751 + *
7752 + * @param {Error} e
7753 + */
7754 + }, {
7755 + key: "onCatchApply",
7756 + value: function onCatchApply(e) {} // eslint-disable-line no-unused-vars
7757 + }], [{
7758 + key: "getInstanceType",
7759 + value: function getInstanceType() {
7760 + return 'CommandInfra';
7761 + }
7762 +
7763 + /**
7764 + * Get info of command.
7765 + *
7766 + * @return {Object} Extra information about the command.
7767 + */
7768 + }, {
7769 + key: "getInfo",
7770 + value: function getInfo() {
7771 + return {};
7772 + }
7773 +
7774 + /**
7775 + * @return {string} Self command name.
7776 + */
7777 + }, {
7778 + key: "getCommand",
7779 + value: function getCommand() {
7780 + return this.registerConfig.command;
7781 + }
7782 +
7783 + /**
7784 + * @return {ComponentBase} Self component
7785 + */
7786 + }, {
7787 + key: "getComponent",
7788 + value: function getComponent() {
7789 + return this.registerConfig.component;
7790 + }
7791 + }, {
7792 + key: "setRegisterConfig",
7793 + value: function setRegisterConfig(config) {
7794 + this.registerConfig = Object.freeze(config);
7795 + }
7796 + }]);
7797 + return CommandInfra;
7798 +}(_argsObject.default);
7799 +exports["default"] = CommandInfra;
7800 +/**
7801 + * @type {Object}
7802 + */
7803 +(0, _defineProperty2.default)(CommandInfra, "registerConfig", null);
7804 +
7805 +/***/ }),
7806 +
7807 +/***/ "../modules/web-cli/assets/js/modules/command-internal-base.js":
7808 +/*!*********************************************************************!*\
7809 + !*** ../modules/web-cli/assets/js/modules/command-internal-base.js ***!
7810 + \*********************************************************************/
7811 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
7812 +
7813 +"use strict";
7814 +
7815 +
7816 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
7817 +Object.defineProperty(exports, "__esModule", ({
7818 + value: true
7819 +}));
7820 +exports["default"] = void 0;
7821 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
7822 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
7823 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
7824 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
7825 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
7826 +var _commandBase = _interopRequireDefault(__webpack_require__(/*! ./command-base */ "../modules/web-cli/assets/js/modules/command-base.js"));
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 + * @name $e.modules.CommandInternalBase
7831 + */
7832 +var CommandInternalBase = /*#__PURE__*/function (_CommandBase) {
7833 + (0, _inherits2.default)(CommandInternalBase, _CommandBase);
7834 + var _super = _createSuper(CommandInternalBase);
7835 + function CommandInternalBase(args) {
7836 + var commandsAPI = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : $e.commandsInternal;
7837 + (0, _classCallCheck2.default)(this, CommandInternalBase);
7838 + return _super.call(this, args, commandsAPI);
7839 + }
7840 + (0, _createClass2.default)(CommandInternalBase, null, [{
7841 + key: "getInstanceType",
7842 + value: function getInstanceType() {
7843 + return 'CommandInternalBase';
7844 + }
7845 + }]);
7846 + return CommandInternalBase;
7847 +}(_commandBase.default);
7848 +exports["default"] = CommandInternalBase;
7849 +
7850 +/***/ }),
7851 +
7852 +/***/ "../modules/web-cli/assets/js/modules/commands/close.js":
7853 +/*!**************************************************************!*\
7854 + !*** ../modules/web-cli/assets/js/modules/commands/close.js ***!
7855 + \**************************************************************/
7856 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
7857 +
7858 +"use strict";
7859 +
7860 +
7861 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
7862 +Object.defineProperty(exports, "__esModule", ({
7863 + value: true
7864 +}));
7865 +exports["default"] = exports.Close = void 0;
7866 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
7867 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
7868 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
7869 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
7870 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
7871 +var _commandBase = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/command-base */ "../modules/web-cli/assets/js/modules/command-base.js"));
7872 +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); }; }
7873 +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; } }
7874 +var Close = /*#__PURE__*/function (_CommandBase) {
7875 + (0, _inherits2.default)(Close, _CommandBase);
7876 + var _super = _createSuper(Close);
7877 + function Close() {
7878 + (0, _classCallCheck2.default)(this, Close);
7879 + return _super.apply(this, arguments);
7880 + }
7881 + (0, _createClass2.default)(Close, [{
7882 + key: "apply",
7883 + value: function apply() {
7884 + this.component.close();
7885 + }
7886 + }]);
7887 + return Close;
7888 +}(_commandBase.default);
7889 +exports.Close = Close;
7890 +var _default = Close;
7891 +exports["default"] = _default;
7892 +
7893 +/***/ }),
7894 +
7895 +/***/ "../modules/web-cli/assets/js/modules/commands/index.js":
7896 +/*!**************************************************************!*\
7897 + !*** ../modules/web-cli/assets/js/modules/commands/index.js ***!
7898 + \**************************************************************/
7899 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
7900 +
7901 +"use strict";
7902 +
7903 +
7904 +Object.defineProperty(exports, "__esModule", ({
7905 + value: true
7906 +}));
7907 +Object.defineProperty(exports, "Close", ({
7908 + enumerable: true,
7909 + get: function get() {
7910 + return _close.Close;
7911 + }
7912 +}));
7913 +Object.defineProperty(exports, "Open", ({
7914 + enumerable: true,
7915 + get: function get() {
7916 + return _open.Open;
7917 + }
7918 +}));
7919 +Object.defineProperty(exports, "Toggle", ({
7920 + enumerable: true,
7921 + get: function get() {
7922 + return _toggle.Toggle;
7923 + }
7924 +}));
7925 +var _close = __webpack_require__(/*! ./close */ "../modules/web-cli/assets/js/modules/commands/close.js");
7926 +var _open = __webpack_require__(/*! ./open */ "../modules/web-cli/assets/js/modules/commands/open.js");
7927 +var _toggle = __webpack_require__(/*! ./toggle */ "../modules/web-cli/assets/js/modules/commands/toggle.js");
7928 +
7929 +/***/ }),
7930 +
7931 +/***/ "../modules/web-cli/assets/js/modules/commands/open.js":
7932 +/*!*************************************************************!*\
7933 + !*** ../modules/web-cli/assets/js/modules/commands/open.js ***!
7934 + \*************************************************************/
7935 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
7936 +
7937 +"use strict";
7938 +
7939 +
7940 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
7941 +Object.defineProperty(exports, "__esModule", ({
7942 + value: true
7943 +}));
7944 +exports["default"] = exports.Open = void 0;
7945 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
7946 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
7947 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
7948 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
7949 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
7950 +var _commandBase = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/command-base */ "../modules/web-cli/assets/js/modules/command-base.js"));
7951 +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); }; }
7952 +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; } }
7953 +var Open = /*#__PURE__*/function (_CommandBase) {
7954 + (0, _inherits2.default)(Open, _CommandBase);
7955 + var _super = _createSuper(Open);
7956 + function Open() {
7957 + (0, _classCallCheck2.default)(this, Open);
7958 + return _super.apply(this, arguments);
7959 + }
7960 + (0, _createClass2.default)(Open, [{
7961 + key: "apply",
7962 + value: function apply() {
7963 + $e.route(this.component.getNamespace());
7964 + }
7965 + }]);
7966 + return Open;
7967 +}(_commandBase.default);
7968 +exports.Open = Open;
7969 +var _default = Open;
7970 +exports["default"] = _default;
7971 +
7972 +/***/ }),
7973 +
7974 +/***/ "../modules/web-cli/assets/js/modules/commands/toggle.js":
7975 +/*!***************************************************************!*\
7976 + !*** ../modules/web-cli/assets/js/modules/commands/toggle.js ***!
7977 + \***************************************************************/
7978 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
7979 +
7980 +"use strict";
7981 +
7982 +
7983 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
7984 +Object.defineProperty(exports, "__esModule", ({
7985 + value: true
7986 +}));
7987 +exports["default"] = exports.Toggle = void 0;
7988 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
7989 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
7990 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
7991 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
7992 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
7993 +var _commandBase = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/command-base */ "../modules/web-cli/assets/js/modules/command-base.js"));
7994 +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); }; }
7995 +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; } }
7996 +var Toggle = /*#__PURE__*/function (_CommandBase) {
7997 + (0, _inherits2.default)(Toggle, _CommandBase);
7998 + var _super = _createSuper(Toggle);
7999 + function Toggle() {
8000 + (0, _classCallCheck2.default)(this, Toggle);
8001 + return _super.apply(this, arguments);
8002 + }
8003 + (0, _createClass2.default)(Toggle, [{
8004 + key: "apply",
8005 + value: function apply() {
8006 + if (this.component.isOpen) {
8007 + this.component.close();
8008 + } else {
8009 + $e.route(this.component.getNamespace());
8010 + }
8011 + }
8012 + }]);
8013 + return Toggle;
8014 +}(_commandBase.default);
8015 +exports.Toggle = Toggle;
8016 +var _default = Toggle;
8017 +exports["default"] = _default;
8018 +
8019 +/***/ }),
8020 +
8021 +/***/ "../modules/web-cli/assets/js/modules/component-base.js":
8022 +/*!**************************************************************!*\
8023 + !*** ../modules/web-cli/assets/js/modules/component-base.js ***!
8024 + \**************************************************************/
8025 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
8026 +
8027 +"use strict";
8028 +
8029 +
8030 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
8031 +Object.defineProperty(exports, "__esModule", ({
8032 + value: true
8033 +}));
8034 +exports["default"] = void 0;
8035 +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
8036 +var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js"));
8037 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
8038 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
8039 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
8040 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
8041 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
8042 +var _commandCallbackBase = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/command-callback-base */ "../modules/web-cli/assets/js/modules/command-callback-base.js"));
8043 +var _toolkit = __webpack_require__(/*! @reduxjs/toolkit */ "../node_modules/@reduxjs/toolkit/dist/redux-toolkit.esm.js");
8044 +var _module = _interopRequireDefault(__webpack_require__(/*! elementor/assets/dev/js/modules/imports/module.js */ "../assets/dev/js/modules/imports/module.js"));
8045 +var _forceMethodImplementation = _interopRequireDefault(__webpack_require__(/*! ../utils/force-method-implementation */ "../modules/web-cli/assets/js/utils/force-method-implementation.js"));
8046 +var _deprecation = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/deprecation */ "../modules/web-cli/assets/js/utils/deprecation.js"));
8047 +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; }
8048 +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; }
8049 +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); }; }
8050 +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; } }
8051 +/**
8052 + * @typedef {import('./command-infra')} CommandInfra
8053 + * @typedef {import('./hook-base')} HookBase
8054 + * @typedef {import('../core/states/ui-state-base')} UiStateBase
8055 + */
8056 +var ComponentBase = /*#__PURE__*/function (_Module) {
8057 + (0, _inherits2.default)(ComponentBase, _Module);
8058 + var _super = _createSuper(ComponentBase);
8059 + function ComponentBase() {
8060 + (0, _classCallCheck2.default)(this, ComponentBase);
8061 + return _super.apply(this, arguments);
8062 + }
8063 + (0, _createClass2.default)(ComponentBase, [{
8064 + key: "__construct",
8065 + value: function __construct() {
8066 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
8067 + if (args.manager) {
8068 + this.manager = args.manager;
8069 + }
8070 + this.commands = this.defaultCommands();
8071 + this.commandsInternal = this.defaultCommandsInternal();
8072 + this.hooks = this.defaultHooks();
8073 + this.routes = this.defaultRoutes();
8074 + this.tabs = this.defaultTabs();
8075 + this.shortcuts = this.defaultShortcuts();
8076 + this.utils = this.defaultUtils();
8077 + this.data = this.defaultData();
8078 + this.uiStates = this.defaultUiStates();
8079 + this.states = this.defaultStates();
8080 + this.defaultRoute = '';
8081 + this.currentTab = '';
8082 + }
8083 + }, {
8084 + key: "registerAPI",
8085 + value: function registerAPI() {
8086 + var _this = this;
8087 + Object.entries(this.getTabs()).forEach(function (tab) {
8088 + return _this.registerTabRoute(tab[0]);
8089 + });
8090 + Object.entries(this.getRoutes()).forEach(function (_ref) {
8091 + var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
8092 + route = _ref2[0],
8093 + callback = _ref2[1];
8094 + return _this.registerRoute(route, callback);
8095 + });
8096 + Object.entries(this.getCommands()).forEach(function (_ref3) {
8097 + var _ref4 = (0, _slicedToArray2.default)(_ref3, 2),
8098 + command = _ref4[0],
8099 + callback = _ref4[1];
8100 + return _this.registerCommand(command, callback);
8101 + });
8102 + Object.entries(this.getCommandsInternal()).forEach(function (_ref5) {
8103 + var _ref6 = (0, _slicedToArray2.default)(_ref5, 2),
8104 + command = _ref6[0],
8105 + callback = _ref6[1];
8106 + return _this.registerCommandInternal(command, callback);
8107 + });
8108 + Object.values(this.getHooks()).forEach(function (instance) {
8109 + return _this.registerHook(instance);
8110 + });
8111 + Object.entries(this.getData()).forEach(function (_ref7) {
8112 + var _ref8 = (0, _slicedToArray2.default)(_ref7, 2),
8113 + command = _ref8[0],
8114 + callback = _ref8[1];
8115 + return _this.registerData(command, callback);
8116 + });
8117 + Object.values(this.getUiStates()).forEach(function (instance) {
8118 + return _this.registerUiState(instance);
8119 + });
8120 + Object.entries(this.getStates()).forEach(function (_ref9) {
8121 + var _ref10 = (0, _slicedToArray2.default)(_ref9, 2),
8122 + id = _ref10[0],
8123 + state = _ref10[1];
8124 + return _this.registerState(id, state);
8125 + });
8126 + }
8127 +
8128 + // eslint-disable-next-line jsdoc/require-returns-check
8129 + /**
8130 + * @return {string} namespace
8131 + */
8132 + }, {
8133 + key: "getNamespace",
8134 + value: function getNamespace() {
8135 + (0, _forceMethodImplementation.default)();
8136 + }
8137 + }, {
8138 + key: "getRootContainer",
8139 + value: function getRootContainer() {
8140 + _deprecation.default.deprecated('getRootContainer()', '3.7.0', 'getServiceName()');
8141 + return this.getServiceName();
8142 + }
8143 + }, {
8144 + key: "getServiceName",
8145 + value: function getServiceName() {
8146 + return this.getNamespace().split('/')[0];
8147 + }
8148 + }, {
8149 + key: "store",
8150 + get: function get() {
8151 + return $e.store.get(this.getNamespace());
8152 + }
8153 + }, {
8154 + key: "defaultTabs",
8155 + value: function defaultTabs() {
8156 + return {};
8157 + }
8158 + }, {
8159 + key: "defaultRoutes",
8160 + value: function defaultRoutes() {
8161 + return {};
8162 + }
8163 + }, {
8164 + key: "defaultCommands",
8165 + value: function defaultCommands() {
8166 + return {};
8167 + }
8168 + }, {
8169 + key: "defaultCommandsInternal",
8170 + value: function defaultCommandsInternal() {
8171 + return {};
8172 + }
8173 + }, {
8174 + key: "defaultHooks",
8175 + value: function defaultHooks() {
8176 + return {};
8177 + }
8178 +
8179 + /**
8180 + * Get the component's default UI states.
8181 + *
8182 + * @return {Object} default UI states
8183 + */
8184 + }, {
8185 + key: "defaultUiStates",
8186 + value: function defaultUiStates() {
8187 + return {};
8188 + }
8189 +
8190 + /**
8191 + * Get the component's Redux slice settings.
8192 + *
8193 + * @return {Object} Redux slice settings
8194 + */
8195 + }, {
8196 + key: "defaultStates",
8197 + value: function defaultStates() {
8198 + return {};
8199 + }
8200 + }, {
8201 + key: "defaultShortcuts",
8202 + value: function defaultShortcuts() {
8203 + return {};
8204 + }
8205 + }, {
8206 + key: "defaultUtils",
8207 + value: function defaultUtils() {
8208 + return {};
8209 + }
8210 + }, {
8211 + key: "defaultData",
8212 + value: function defaultData() {
8213 + return {};
8214 + }
8215 + }, {
8216 + key: "getCommands",
8217 + value: function getCommands() {
8218 + return this.commands;
8219 + }
8220 + }, {
8221 + key: "getCommandsInternal",
8222 + value: function getCommandsInternal() {
8223 + return this.commandsInternal;
8224 + }
8225 + }, {
8226 + key: "getHooks",
8227 + value: function getHooks() {
8228 + return this.hooks;
8229 + }
8230 +
8231 + /**
8232 + * Retrieve the component's UI states.
8233 + *
8234 + * @return {Object} UI states
8235 + */
8236 + }, {
8237 + key: "getUiStates",
8238 + value: function getUiStates() {
8239 + return this.uiStates;
8240 + }
8241 +
8242 + /**
8243 + * Retrieve the component's Redux Slice.
8244 + *
8245 + * @return {Object} Redux Slice
8246 + */
8247 + }, {
8248 + key: "getStates",
8249 + value: function getStates() {
8250 + return this.states;
8251 + }
8252 + }, {
8253 + key: "getRoutes",
8254 + value: function getRoutes() {
8255 + return this.routes;
8256 + }
8257 + }, {
8258 + key: "getTabs",
8259 + value: function getTabs() {
8260 + return this.tabs;
8261 + }
8262 + }, {
8263 + key: "getShortcuts",
8264 + value: function getShortcuts() {
8265 + return this.shortcuts;
8266 + }
8267 + }, {
8268 + key: "getData",
8269 + value: function getData() {
8270 + return this.data;
8271 + }
8272 +
8273 + /**
8274 + * @param {string} command
8275 + * @param {(()=>{}|CommandInfra)} context
8276 + * @param {'default'|'internal'|'data'} commandsType
8277 + */
8278 + }, {
8279 + key: "registerCommand",
8280 + value: function registerCommand(command, context) {
8281 + var commandsType = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'default';
8282 + var commandsManager;
8283 + switch (commandsType) {
8284 + case 'default':
8285 + commandsManager = $e.commands;
8286 + break;
8287 + case 'internal':
8288 + commandsManager = $e.commandsInternal;
8289 + break;
8290 + case 'data':
8291 + commandsManager = $e.data;
8292 + break;
8293 + default:
8294 + throw new Error("Invalid commands type: '".concat(command, "'"));
8295 + }
8296 + var fullCommand = this.getNamespace() + '/' + command,
8297 + instanceType = context.getInstanceType ? context.getInstanceType() : false,
8298 + registerConfig = {
8299 + command: fullCommand,
8300 + component: this
8301 + };
8302 +
8303 + // Support pure callback.
8304 + if (!instanceType) {
8305 + if ($e.devTools) {
8306 + $e.devTools.log.warn("Attach command-callback-base, on command: '".concat(fullCommand, "', context is unknown type."));
8307 + }
8308 + registerConfig.callback = context;
8309 +
8310 + // Unique class.
8311 + context = /*#__PURE__*/function (_CommandCallbackBase) {
8312 + (0, _inherits2.default)(context, _CommandCallbackBase);
8313 + var _super2 = _createSuper(context);
8314 + function context() {
8315 + (0, _classCallCheck2.default)(this, context);
8316 + return _super2.apply(this, arguments);
8317 + }
8318 + return (0, _createClass2.default)(context);
8319 + }(_commandCallbackBase.default);
8320 + }
8321 + context.setRegisterConfig(registerConfig);
8322 + commandsManager.register(this, command, context);
8323 + }
8324 +
8325 + /**
8326 + * @param {HookBase} instance
8327 + */
8328 + }, {
8329 + key: "registerHook",
8330 + value: function registerHook(instance) {
8331 + return instance.register();
8332 + }
8333 + }, {
8334 + key: "registerCommandInternal",
8335 + value: function registerCommandInternal(command, context) {
8336 + this.registerCommand(command, context, 'internal');
8337 + }
8338 +
8339 + /**
8340 + * Register a UI state.
8341 + *
8342 + * @param {UiStateBase} instance - UI state instance.
8343 + *
8344 + * @return {void}
8345 + */
8346 + }, {
8347 + key: "registerUiState",
8348 + value: function registerUiState(instance) {
8349 + $e.uiStates.register(instance);
8350 + }
8351 +
8352 + /**
8353 + * Register a Redux Slice.
8354 + *
8355 + * @param {string} id - State id.
8356 + * @param {Object} stateConfig - The state config.
8357 + *
8358 + * @return {void}
8359 + */
8360 + }, {
8361 + key: "registerState",
8362 + value: function registerState(id, stateConfig) {
8363 + id = this.getNamespace() + (id ? "/".concat(id) : '');
8364 + var slice = (0, _toolkit.createSlice)(_objectSpread(_objectSpread({}, stateConfig), {}, {
8365 + name: id
8366 + }));
8367 + $e.store.register(id, slice);
8368 + }
8369 + }, {
8370 + key: "registerRoute",
8371 + value: function registerRoute(route, callback) {
8372 + $e.routes.register(this, route, callback);
8373 + }
8374 + }, {
8375 + key: "registerData",
8376 + value: function registerData(command, context) {
8377 + this.registerCommand(command, context, 'data');
8378 + }
8379 + }, {
8380 + key: "unregisterRoute",
8381 + value: function unregisterRoute(route) {
8382 + $e.routes.unregister(this, route);
8383 + }
8384 + }, {
8385 + key: "registerTabRoute",
8386 + value: function registerTabRoute(tab) {
8387 + var _this2 = this;
8388 + this.registerRoute(tab, function (args) {
8389 + return _this2.activateTab(tab, args);
8390 + });
8391 + }
8392 + }, {
8393 + key: "dependency",
8394 + value: function dependency() {
8395 + return true;
8396 + }
8397 + }, {
8398 + key: "open",
8399 + value: function open() {
8400 + return true;
8401 + }
8402 + }, {
8403 + key: "close",
8404 + value: function close() {
8405 + if (!this.isOpen) {
8406 + return false;
8407 + }
8408 + this.isOpen = false;
8409 + this.inactivate();
8410 + $e.routes.clearCurrent(this.getNamespace());
8411 + $e.routes.clearHistory(this.getServiceName());
8412 + return true;
8413 + }
8414 + }, {
8415 + key: "activate",
8416 + value: function activate() {
8417 + $e.components.activate(this.getNamespace());
8418 + }
8419 + }, {
8420 + key: "inactivate",
8421 + value: function inactivate() {
8422 + $e.components.inactivate(this.getNamespace());
8423 + }
8424 + }, {
8425 + key: "isActive",
8426 + value: function isActive() {
8427 + return $e.components.isActive(this.getNamespace());
8428 + }
8429 + }, {
8430 + key: "onRoute",
8431 + value: function onRoute(route) {
8432 + this.toggleRouteClass(route, true);
8433 + this.toggleHistoryClass();
8434 + this.activate();
8435 + this.trigger('route/open', route);
8436 + }
8437 + }, {
8438 + key: "onCloseRoute",
8439 + value: function onCloseRoute(route) {
8440 + this.toggleRouteClass(route, false);
8441 + this.inactivate();
8442 + this.trigger('route/close', route);
8443 + }
8444 + }, {
8445 + key: "setDefaultRoute",
8446 + value: function setDefaultRoute(route) {
8447 + this.defaultRoute = this.getNamespace() + '/' + route;
8448 + }
8449 + }, {
8450 + key: "getDefaultRoute",
8451 + value: function getDefaultRoute() {
8452 + return this.defaultRoute;
8453 + }
8454 + }, {
8455 + key: "removeTab",
8456 + value: function removeTab(tab) {
8457 + delete this.tabs[tab];
8458 + this.unregisterRoute(tab);
8459 + }
8460 + }, {
8461 + key: "hasTab",
8462 + value: function hasTab(tab) {
8463 + return !!this.tabs[tab];
8464 + }
8465 + }, {
8466 + key: "addTab",
8467 + value: function addTab(tab, args, position) {
8468 + var _this3 = this;
8469 + this.tabs[tab] = args;
8470 + // It can be 0.
8471 + if ('undefined' !== typeof position) {
8472 + var newTabs = {};
8473 + var ids = Object.keys(this.tabs);
8474 + // Remove new tab
8475 + ids.pop();
8476 +
8477 + // Add it to position.
8478 + ids.splice(position, 0, tab);
8479 + ids.forEach(function (id) {
8480 + newTabs[id] = _this3.tabs[id];
8481 + });
8482 + this.tabs = newTabs;
8483 + }
8484 + this.registerTabRoute(tab);
8485 + }
8486 + }, {
8487 + key: "getTabsWrapperSelector",
8488 + value: function getTabsWrapperSelector() {
8489 + return '';
8490 + }
8491 + }, {
8492 + key: "getTabRoute",
8493 + value: function getTabRoute(tab) {
8494 + return this.getNamespace() + '/' + tab;
8495 + }
8496 + }, {
8497 + key: "renderTab",
8498 + value: function renderTab(tab) {} // eslint-disable-line
8499 + }, {
8500 + key: "activateTab",
8501 + value: function activateTab(tab, args) {
8502 + var _this4 = this;
8503 + this.currentTab = tab;
8504 + this.renderTab(tab, args);
8505 + jQuery(this.getTabsWrapperSelector() + ' .elementor-component-tab').off('click').on('click', function (event) {
8506 + $e.route(_this4.getTabRoute(event.currentTarget.dataset.tab), args);
8507 + }).removeClass('elementor-active').filter('[data-tab="' + tab + '"]').addClass('elementor-active');
8508 + }
8509 + }, {
8510 + key: "getActiveTabConfig",
8511 + value: function getActiveTabConfig() {
8512 + return this.tabs[this.currentTab] || {};
8513 + }
8514 + }, {
8515 + key: "getBodyClass",
8516 + value: function getBodyClass(route) {
8517 + return 'e-route-' + route.replace(/\//g, '-');
8518 + }
8519 +
8520 + /**
8521 + * If command includes uppercase character convert it to lowercase and add `-`.
8522 + * e.g: `CopyAll` is converted to `copy-all`.
8523 + *
8524 + * @param {string} commandName
8525 + */
8526 + }, {
8527 + key: "normalizeCommandName",
8528 + value: function normalizeCommandName(commandName) {
8529 + return commandName.replace(/[A-Z]/g, function (match, offset) {
8530 + return (offset > 0 ? '-' : '') + match.toLowerCase();
8531 + });
8532 + }
8533 +
8534 + /**
8535 + * @param {{}} commandsFromImport
8536 + * @return {{}} imported commands
8537 + */
8538 + }, {
8539 + key: "importCommands",
8540 + value: function importCommands(commandsFromImport) {
8541 + var _this5 = this;
8542 + var commands = {};
8543 +
8544 + // Convert `Commands` to `ComponentBase` workable format.
8545 + Object.entries(commandsFromImport).forEach(function (_ref11) {
8546 + var _ref12 = (0, _slicedToArray2.default)(_ref11, 2),
8547 + className = _ref12[0],
8548 + Class = _ref12[1];
8549 + var command = _this5.normalizeCommandName(className);
8550 + commands[command] = Class;
8551 + });
8552 + return commands;
8553 + }
8554 + }, {
8555 + key: "importHooks",
8556 + value: function importHooks(hooksFromImport) {
8557 + var hooks = {};
8558 + for (var key in hooksFromImport) {
8559 + var hook = new hooksFromImport[key]();
8560 + hooks[hook.getId()] = hook;
8561 + }
8562 + return hooks;
8563 + }
8564 +
8565 + /**
8566 + * Import & initialize the component's UI states.
8567 + * Should be used inside `defaultUiState()`.
8568 + *
8569 + * @param {Object} statesFromImport - UI states from import.
8570 + *
8571 + * @return {Object} UI States
8572 + */
8573 + }, {
8574 + key: "importUiStates",
8575 + value: function importUiStates(statesFromImport) {
8576 + var _this6 = this;
8577 + var uiStates = {};
8578 + Object.values(statesFromImport).forEach(function (className) {
8579 + var uiState = new className(_this6);
8580 + uiStates[uiState.getId()] = uiState;
8581 + });
8582 + return uiStates;
8583 + }
8584 +
8585 + /**
8586 + * Set a UI state value.
8587 + * TODO: Should we provide such function? Maybe the developer should implicitly pass the full state ID?
8588 + *
8589 + * @param {string} state - Non-prefixed state ID.
8590 + * @param {*} value - New state value.
8591 + *
8592 + * @return {void}
8593 + */
8594 + }, {
8595 + key: "setUiState",
8596 + value: function setUiState(state, value) {
8597 + $e.uiStates.set("".concat(this.getNamespace(), "/").concat(state), value);
8598 + }
8599 + }, {
8600 + key: "toggleRouteClass",
8601 + value: function toggleRouteClass(route, state) {
8602 + document.body.classList.toggle(this.getBodyClass(route), state);
8603 + }
8604 + }, {
8605 + key: "toggleHistoryClass",
8606 + value: function toggleHistoryClass() {
8607 + document.body.classList.toggle('e-routes-has-history', !!$e.routes.getHistory(this.getServiceName()).length);
8608 + }
8609 + }]);
8610 + return ComponentBase;
8611 +}(_module.default);
8612 +exports["default"] = ComponentBase;
8613 +
8614 +/***/ }),
8615 +
8616 +/***/ "../modules/web-cli/assets/js/modules/component-modal-base.js":
8617 +/*!********************************************************************!*\
8618 + !*** ../modules/web-cli/assets/js/modules/component-modal-base.js ***!
8619 + \********************************************************************/
8620 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
8621 +
8622 +"use strict";
8623 +
8624 +
8625 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
8626 +var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js");
8627 +Object.defineProperty(exports, "__esModule", ({
8628 + value: true
8629 +}));
8630 +exports["default"] = void 0;
8631 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
8632 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
8633 +var _get2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/get */ "../node_modules/@babel/runtime/helpers/get.js"));
8634 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
8635 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
8636 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
8637 +var _componentBase = _interopRequireDefault(__webpack_require__(/*! ./component-base */ "../modules/web-cli/assets/js/modules/component-base.js"));
8638 +var commands = _interopRequireWildcard(__webpack_require__(/*! ./commands/ */ "../modules/web-cli/assets/js/modules/commands/index.js"));
8639 +var _forceMethodImplementation = _interopRequireDefault(__webpack_require__(/*! ../utils/force-method-implementation */ "../modules/web-cli/assets/js/utils/force-method-implementation.js"));
8640 +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); }
8641 +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; }
8642 +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); }; }
8643 +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; } }
8644 +var ComponentModalBase = /*#__PURE__*/function (_ComponentBase) {
8645 + (0, _inherits2.default)(ComponentModalBase, _ComponentBase);
8646 + var _super = _createSuper(ComponentModalBase);
8647 + function ComponentModalBase() {
8648 + (0, _classCallCheck2.default)(this, ComponentModalBase);
8649 + return _super.apply(this, arguments);
8650 + }
8651 + (0, _createClass2.default)(ComponentModalBase, [{
8652 + key: "registerAPI",
8653 + value: function registerAPI() {
8654 + var _this = this;
8655 + (0, _get2.default)((0, _getPrototypeOf2.default)(ComponentModalBase.prototype), "registerAPI", this).call(this);
8656 + $e.shortcuts.register('esc', {
8657 + scopes: [this.getNamespace()],
8658 + callback: function callback() {
8659 + return _this.close();
8660 + }
8661 + });
8662 + }
8663 + }, {
8664 + key: "defaultCommands",
8665 + value: function defaultCommands() {
8666 + return this.importCommands(commands);
8667 + }
8668 + }, {
8669 + key: "defaultRoutes",
8670 + value: function defaultRoutes() {
8671 + return {
8672 + '': function _() {/* Nothing to do, it's already rendered. */}
8673 + };
8674 + }
8675 + }, {
8676 + key: "open",
8677 + value: function open() {
8678 + var _this2 = this;
8679 + if (!this.layout) {
8680 + var layout = this.getModalLayout();
8681 + this.layout = new layout({
8682 + component: this
8683 + });
8684 + this.layout.getModal().on('hide', function () {
8685 + return _this2.close();
8686 + });
8687 + }
8688 + this.layout.showModal();
8689 + return true;
8690 + }
8691 + }, {
8692 + key: "close",
8693 + value: function close() {
8694 + if (!(0, _get2.default)((0, _getPrototypeOf2.default)(ComponentModalBase.prototype), "close", this).call(this)) {
8695 + return false;
8696 + }
8697 + this.layout.getModal().hide();
8698 + return true;
8699 + }
8700 + }, {
8701 + key: "getModalLayout",
8702 + value: function getModalLayout() {
8703 + (0, _forceMethodImplementation.default)();
8704 + }
8705 + }]);
8706 + return ComponentModalBase;
8707 +}(_componentBase.default);
8708 +exports["default"] = ComponentModalBase;
8709 +
8710 +/***/ }),
8711 +
8712 +/***/ "../modules/web-cli/assets/js/modules/hook-base.js":
8713 +/*!*********************************************************!*\
8714 + !*** ../modules/web-cli/assets/js/modules/hook-base.js ***!
8715 + \*********************************************************/
8716 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
8717 +
8718 +"use strict";
8719 +
8720 +
8721 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
8722 +Object.defineProperty(exports, "__esModule", ({
8723 + value: true
8724 +}));
8725 +exports["default"] = void 0;
8726 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
8727 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
8728 +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
8729 +var _forceMethodImplementation = _interopRequireDefault(__webpack_require__(/*! ../utils/force-method-implementation */ "../modules/web-cli/assets/js/utils/force-method-implementation.js"));
8730 +var HookBase = /*#__PURE__*/function () {
8731 + /**
8732 + * Function constructor().
8733 + *
8734 + * Create callback base.
8735 + */
8736 + function HookBase() {
8737 + (0, _classCallCheck2.default)(this, HookBase);
8738 + /**
8739 + * Callback type, eg ( hook, event ).
8740 + *
8741 + * @type {string}
8742 + */
8743 + (0, _defineProperty2.default)(this, "type", void 0);
8744 + /**
8745 + * Full command address, that will hook the callback.
8746 + *
8747 + * @type {string}
8748 + */
8749 + (0, _defineProperty2.default)(this, "command", void 0);
8750 + /**
8751 + * Unique id of the callback.
8752 + *
8753 + * @type {string}
8754 + */
8755 + (0, _defineProperty2.default)(this, "id", void 0);
8756 + this.initialize();
8757 + this.type = this.getType();
8758 + this.command = this.getCommand();
8759 + this.id = this.getId();
8760 + }
8761 +
8762 + /**
8763 + * Function initialize().
8764 + *
8765 + * Called after creation of the base, used for initialize extras.
8766 + * Without expending constructor.
8767 + */
8768 + (0, _createClass2.default)(HookBase, [{
8769 + key: "initialize",
8770 + value: function initialize() {}
8771 +
8772 + /**
8773 + * Function register().
8774 + *
8775 + * Used to register the callback.
8776 + *
8777 + * @throws {Error}
8778 + */
8779 + }, {
8780 + key: "register",
8781 + value: function register() {
8782 + (0, _forceMethodImplementation.default)();
8783 + }
8784 +
8785 + // eslint-disable-next-line jsdoc/require-returns-check
8786 + /**
8787 + * Function getType().
8788 + *
8789 + * Get type eg: ( hook, event, etc ... ).
8790 + *
8791 + * @return {string} type
8792 + *
8793 + * @throws {Error}
8794 + */
8795 + }, {
8796 + key: "getType",
8797 + value: function getType() {
8798 + (0, _forceMethodImplementation.default)();
8799 + }
8800 +
8801 + // eslint-disable-next-line jsdoc/require-returns-check
8802 + /**
8803 + * Function getCommand().
8804 + *
8805 + * Returns the full command path for callback binding.
8806 + *
8807 + * Supports array of strings ( commands ).
8808 + *
8809 + * @return {string} command
8810 + *
8811 + * @throws {Error}
8812 + */
8813 + }, {
8814 + key: "getCommand",
8815 + value: function getCommand() {
8816 + (0, _forceMethodImplementation.default)();
8817 + }
8818 +
8819 + // eslint-disable-next-line jsdoc/require-returns-check
8820 + /**
8821 + * Function getId().
8822 + *
8823 + * Returns command id for the hook (should be unique).
8824 + *
8825 + * @return {string} id
8826 + *
8827 + * @throws {Error}
8828 + */
8829 + }, {
8830 + key: "getId",
8831 + value: function getId() {
8832 + (0, _forceMethodImplementation.default)();
8833 + }
8834 +
8835 + // eslint-disable-next-line jsdoc/require-returns-check
8836 + /**
8837 + * Function getContainerType().
8838 + *
8839 + * Bind eContainer type to callback.
8840 + *
8841 + * Used to gain performance.
8842 + *
8843 + * @return {string} type
8844 + */
8845 + }, {
8846 + key: "getContainerType",
8847 + value: function getContainerType() {}
8848 +
8849 + /**
8850 + * Function getConditions().
8851 + *
8852 + * Condition for running the callback, if true, call to apply().
8853 + *
8854 + * @param {*} [args={}]
8855 + * @param {*} [result=*]
8856 + *
8857 + * @return {boolean} conditions
8858 + */
8859 + }, {
8860 + key: "getConditions",
8861 + value: function getConditions() {
8862 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
8863 + var result = arguments.length > 1 ? arguments[1] : undefined;
8864 + // eslint-disable-line no-unused-vars
8865 + return true;
8866 + }
8867 +
8868 + // eslint-disable-next-line jsdoc/require-returns-check
8869 + /**
8870 + * Function apply().
8871 + *
8872 + * Apply the callback, ( The actual affect of the callback ).
8873 + *
8874 + * @param {*} [args={}]
8875 + *
8876 + * @return {*} results
8877 + */
8878 + }, {
8879 + key: "apply",
8880 + value: function apply(args) {
8881 + // eslint-disable-line no-unused-vars
8882 + (0, _forceMethodImplementation.default)();
8883 + }
8884 +
8885 + /**
8886 + * Function run().
8887 + *
8888 + * Run the callback.
8889 + *
8890 + * @param {*} args
8891 + *
8892 + * @return {*} results
8893 + */
8894 + }, {
8895 + key: "run",
8896 + value: function run() {
8897 + var _ref = arguments.length <= 0 ? undefined : arguments[0],
8898 + _ref$options = _ref.options,
8899 + options = _ref$options === void 0 ? {} : _ref$options;
8900 +
8901 + // Disable callback if requested by args.options.
8902 + if (options.callbacks && false === options.callbacks[this.id]) {
8903 + return true;
8904 + }
8905 + if (this.getConditions.apply(this, arguments)) {
8906 + if ($e.devTools) {
8907 + $e.devTools.log.callbacks().active(this.type, this.command, this.id);
8908 + }
8909 + return this.apply.apply(this, arguments);
8910 + }
8911 + return true;
8912 + }
8913 + }]);
8914 + return HookBase;
8915 +}();
8916 +exports["default"] = HookBase;
8917 +
8918 +/***/ }),
8919 +
8920 +/***/ "../modules/web-cli/assets/js/modules/hook-break.js":
8921 +/*!**********************************************************!*\
8922 + !*** ../modules/web-cli/assets/js/modules/hook-break.js ***!
8923 + \**********************************************************/
8924 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
8925 +
8926 +"use strict";
8927 +
8928 +
8929 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
8930 +Object.defineProperty(exports, "__esModule", ({
8931 + value: true
8932 +}));
8933 +exports["default"] = void 0;
8934 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
8935 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
8936 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
8937 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
8938 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
8939 +var _wrapNativeSuper2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/wrapNativeSuper */ "../node_modules/@babel/runtime/helpers/wrapNativeSuper.js"));
8940 +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); }; }
8941 +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; } }
8942 +var HookBreak = /*#__PURE__*/function (_Error) {
8943 + (0, _inherits2.default)(HookBreak, _Error);
8944 + var _super = _createSuper(HookBreak);
8945 + function HookBreak() {
8946 + (0, _classCallCheck2.default)(this, HookBreak);
8947 + return _super.call(this, 'HookBreak');
8948 + }
8949 + return (0, _createClass2.default)(HookBreak);
8950 +}( /*#__PURE__*/(0, _wrapNativeSuper2.default)(Error));
8951 +exports["default"] = HookBreak;
8952 +
8953 +/***/ }),
8954 +
8955 +/***/ "../modules/web-cli/assets/js/modules/hooks/data/after.js":
8956 +/*!****************************************************************!*\
8957 + !*** ../modules/web-cli/assets/js/modules/hooks/data/after.js ***!
8958 + \****************************************************************/
8959 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
8960 +
8961 +"use strict";
8962 +
8963 +
8964 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
8965 +Object.defineProperty(exports, "__esModule", ({
8966 + value: true
8967 +}));
8968 +exports["default"] = exports.After = void 0;
8969 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
8970 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
8971 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
8972 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
8973 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
8974 +var _base = _interopRequireDefault(__webpack_require__(/*! ./base */ "../modules/web-cli/assets/js/modules/hooks/data/base.js"));
8975 +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); }; }
8976 +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; } }
8977 +var After = /*#__PURE__*/function (_Base) {
8978 + (0, _inherits2.default)(After, _Base);
8979 + var _super = _createSuper(After);
8980 + function After() {
8981 + (0, _classCallCheck2.default)(this, After);
8982 + return _super.apply(this, arguments);
8983 + }
8984 + (0, _createClass2.default)(After, [{
8985 + key: "register",
8986 + value: function register() {
8987 + $e.hooks.registerDataAfter(this);
8988 + }
8989 + }]);
8990 + return After;
8991 +}(_base.default);
8992 +exports.After = After;
8993 +var _default = After;
8994 +exports["default"] = _default;
8995 +
8996 +/***/ }),
8997 +
8998 +/***/ "../modules/web-cli/assets/js/modules/hooks/data/base.js":
8999 +/*!***************************************************************!*\
9000 + !*** ../modules/web-cli/assets/js/modules/hooks/data/base.js ***!
9001 + \***************************************************************/
9002 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
9003 +
9004 +"use strict";
9005 +
9006 +
9007 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
9008 +Object.defineProperty(exports, "__esModule", ({
9009 + value: true
9010 +}));
9011 +exports["default"] = exports.Base = void 0;
9012 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
9013 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
9014 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
9015 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
9016 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
9017 +var _hookBase = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/hook-base */ "../modules/web-cli/assets/js/modules/hook-base.js"));
9018 +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); }; }
9019 +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; } }
9020 +var Base = /*#__PURE__*/function (_HookBase) {
9021 + (0, _inherits2.default)(Base, _HookBase);
9022 + var _super = _createSuper(Base);
9023 + function Base() {
9024 + (0, _classCallCheck2.default)(this, Base);
9025 + return _super.apply(this, arguments);
9026 + }
9027 + (0, _createClass2.default)(Base, [{
9028 + key: "getType",
9029 + value: function getType() {
9030 + return 'data';
9031 + }
9032 + }]);
9033 + return Base;
9034 +}(_hookBase.default);
9035 +exports.Base = Base;
9036 +var _default = Base;
9037 +exports["default"] = _default;
9038 +
9039 +/***/ }),
9040 +
9041 +/***/ "../modules/web-cli/assets/js/modules/hooks/data/catch.js":
9042 +/*!****************************************************************!*\
9043 + !*** ../modules/web-cli/assets/js/modules/hooks/data/catch.js ***!
9044 + \****************************************************************/
9045 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
9046 +
9047 +"use strict";
9048 +
9049 +
9050 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
9051 +Object.defineProperty(exports, "__esModule", ({
9052 + value: true
9053 +}));
9054 +exports["default"] = exports.Catch = void 0;
9055 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
9056 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
9057 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
9058 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
9059 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
9060 +var _base = _interopRequireDefault(__webpack_require__(/*! ./base */ "../modules/web-cli/assets/js/modules/hooks/data/base.js"));
9061 +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); }; }
9062 +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; } }
9063 +var Catch = /*#__PURE__*/function (_Base) {
9064 + (0, _inherits2.default)(Catch, _Base);
9065 + var _super = _createSuper(Catch);
9066 + function Catch() {
9067 + (0, _classCallCheck2.default)(this, Catch);
9068 + return _super.apply(this, arguments);
9069 + }
9070 + (0, _createClass2.default)(Catch, [{
9071 + key: "register",
9072 + value: function register() {
9073 + $e.hooks.registerDataCatch(this);
9074 + }
9075 + }]);
9076 + return Catch;
9077 +}(_base.default);
9078 +exports.Catch = Catch;
9079 +var _default = Catch;
9080 +exports["default"] = _default;
9081 +
9082 +/***/ }),
9083 +
9084 +/***/ "../modules/web-cli/assets/js/modules/hooks/data/dependency.js":
9085 +/*!*********************************************************************!*\
9086 + !*** ../modules/web-cli/assets/js/modules/hooks/data/dependency.js ***!
9087 + \*********************************************************************/
9088 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
9089 +
9090 +"use strict";
9091 +
9092 +
9093 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
9094 +Object.defineProperty(exports, "__esModule", ({
9095 + value: true
9096 +}));
9097 +exports["default"] = exports.Dependency = void 0;
9098 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
9099 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
9100 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
9101 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
9102 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
9103 +var _base = _interopRequireDefault(__webpack_require__(/*! ./base */ "../modules/web-cli/assets/js/modules/hooks/data/base.js"));
9104 +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); }; }
9105 +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; } }
9106 +var Dependency = /*#__PURE__*/function (_Base) {
9107 + (0, _inherits2.default)(Dependency, _Base);
9108 + var _super = _createSuper(Dependency);
9109 + function Dependency() {
9110 + (0, _classCallCheck2.default)(this, Dependency);
9111 + return _super.apply(this, arguments);
9112 + }
9113 + (0, _createClass2.default)(Dependency, [{
9114 + key: "register",
9115 + value: function register() {
9116 + $e.hooks.registerDataDependency(this);
9117 + }
9118 + }]);
9119 + return Dependency;
9120 +}(_base.default);
9121 +exports.Dependency = Dependency;
9122 +var _default = Dependency;
9123 +exports["default"] = _default;
9124 +
9125 +/***/ }),
9126 +
9127 +/***/ "../modules/web-cli/assets/js/modules/hooks/data/index.js":
9128 +/*!****************************************************************!*\
9129 + !*** ../modules/web-cli/assets/js/modules/hooks/data/index.js ***!
9130 + \****************************************************************/
9131 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
9132 +
9133 +"use strict";
9134 +
9135 +
9136 +Object.defineProperty(exports, "__esModule", ({
9137 + value: true
9138 +}));
9139 +Object.defineProperty(exports, "After", ({
9140 + enumerable: true,
9141 + get: function get() {
9142 + return _after.After;
9143 + }
9144 +}));
9145 +Object.defineProperty(exports, "Base", ({
9146 + enumerable: true,
9147 + get: function get() {
9148 + return _base.Base;
9149 + }
9150 +}));
9151 +Object.defineProperty(exports, "Catch", ({
9152 + enumerable: true,
9153 + get: function get() {
9154 + return _catch.Catch;
9155 + }
9156 +}));
9157 +Object.defineProperty(exports, "Dependency", ({
9158 + enumerable: true,
9159 + get: function get() {
9160 + return _dependency.Dependency;
9161 + }
9162 +}));
9163 +var _after = __webpack_require__(/*! ./after */ "../modules/web-cli/assets/js/modules/hooks/data/after.js");
9164 +var _base = __webpack_require__(/*! ./base */ "../modules/web-cli/assets/js/modules/hooks/data/base.js");
9165 +var _catch = __webpack_require__(/*! ./catch */ "../modules/web-cli/assets/js/modules/hooks/data/catch.js");
9166 +var _dependency = __webpack_require__(/*! ./dependency */ "../modules/web-cli/assets/js/modules/hooks/data/dependency.js");
9167 +
9168 +/***/ }),
9169 +
9170 +/***/ "../modules/web-cli/assets/js/modules/hooks/ui/after.js":
9171 +/*!**************************************************************!*\
9172 + !*** ../modules/web-cli/assets/js/modules/hooks/ui/after.js ***!
9173 + \**************************************************************/
9174 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
9175 +
9176 +"use strict";
9177 +
9178 +
9179 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
9180 +Object.defineProperty(exports, "__esModule", ({
9181 + value: true
9182 +}));
9183 +exports["default"] = exports.After = void 0;
9184 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
9185 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
9186 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
9187 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
9188 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
9189 +var _base = _interopRequireDefault(__webpack_require__(/*! ./base */ "../modules/web-cli/assets/js/modules/hooks/ui/base.js"));
9190 +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); }; }
9191 +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; } }
9192 +var After = /*#__PURE__*/function (_Base) {
9193 + (0, _inherits2.default)(After, _Base);
9194 + var _super = _createSuper(After);
9195 + function After() {
9196 + (0, _classCallCheck2.default)(this, After);
9197 + return _super.apply(this, arguments);
9198 + }
9199 + (0, _createClass2.default)(After, [{
9200 + key: "register",
9201 + value: function register() {
9202 + $e.hooks.registerUIAfter(this);
9203 + }
9204 + }]);
9205 + return After;
9206 +}(_base.default);
9207 +exports.After = After;
9208 +var _default = After;
9209 +exports["default"] = _default;
9210 +
9211 +/***/ }),
9212 +
9213 +/***/ "../modules/web-cli/assets/js/modules/hooks/ui/base.js":
9214 +/*!*************************************************************!*\
9215 + !*** ../modules/web-cli/assets/js/modules/hooks/ui/base.js ***!
9216 + \*************************************************************/
9217 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
9218 +
9219 +"use strict";
9220 +
9221 +
9222 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
9223 +Object.defineProperty(exports, "__esModule", ({
9224 + value: true
9225 +}));
9226 +exports["default"] = exports.Base = void 0;
9227 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
9228 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
9229 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
9230 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
9231 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
9232 +var _hookBase = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/hook-base */ "../modules/web-cli/assets/js/modules/hook-base.js"));
9233 +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); }; }
9234 +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; } }
9235 +var Base = /*#__PURE__*/function (_HookBase) {
9236 + (0, _inherits2.default)(Base, _HookBase);
9237 + var _super = _createSuper(Base);
9238 + function Base() {
9239 + (0, _classCallCheck2.default)(this, Base);
9240 + return _super.apply(this, arguments);
9241 + }
9242 + (0, _createClass2.default)(Base, [{
9243 + key: "getType",
9244 + value: function getType() {
9245 + return 'ui';
9246 + }
9247 + }]);
9248 + return Base;
9249 +}(_hookBase.default);
9250 +exports.Base = Base;
9251 +var _default = Base;
9252 +exports["default"] = _default;
9253 +
9254 +/***/ }),
9255 +
9256 +/***/ "../modules/web-cli/assets/js/modules/hooks/ui/before.js":
9257 +/*!***************************************************************!*\
9258 + !*** ../modules/web-cli/assets/js/modules/hooks/ui/before.js ***!
9259 + \***************************************************************/
9260 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
9261 +
9262 +"use strict";
9263 +
9264 +
9265 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
9266 +Object.defineProperty(exports, "__esModule", ({
9267 + value: true
9268 +}));
9269 +exports["default"] = exports.Before = void 0;
9270 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
9271 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
9272 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
9273 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
9274 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
9275 +var _base = _interopRequireDefault(__webpack_require__(/*! ./base */ "../modules/web-cli/assets/js/modules/hooks/ui/base.js"));
9276 +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); }; }
9277 +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; } }
9278 +var Before = /*#__PURE__*/function (_Base) {
9279 + (0, _inherits2.default)(Before, _Base);
9280 + var _super = _createSuper(Before);
9281 + function Before() {
9282 + (0, _classCallCheck2.default)(this, Before);
9283 + return _super.apply(this, arguments);
9284 + }
9285 + (0, _createClass2.default)(Before, [{
9286 + key: "register",
9287 + value: function register() {
9288 + $e.hooks.registerUIBefore(this);
9289 + }
9290 + }]);
9291 + return Before;
9292 +}(_base.default);
9293 +exports.Before = Before;
9294 +var _default = Before;
9295 +exports["default"] = _default;
9296 +
9297 +/***/ }),
9298 +
9299 +/***/ "../modules/web-cli/assets/js/modules/hooks/ui/catch.js":
9300 +/*!**************************************************************!*\
9301 + !*** ../modules/web-cli/assets/js/modules/hooks/ui/catch.js ***!
9302 + \**************************************************************/
9303 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
9304 +
9305 +"use strict";
9306 +
9307 +
9308 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
9309 +Object.defineProperty(exports, "__esModule", ({
9310 + value: true
9311 +}));
9312 +exports["default"] = exports.Catch = void 0;
9313 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
9314 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
9315 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
9316 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
9317 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
9318 +var _base = _interopRequireDefault(__webpack_require__(/*! ./base */ "../modules/web-cli/assets/js/modules/hooks/ui/base.js"));
9319 +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); }; }
9320 +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; } }
9321 +var Catch = /*#__PURE__*/function (_Base) {
9322 + (0, _inherits2.default)(Catch, _Base);
9323 + var _super = _createSuper(Catch);
9324 + function Catch() {
9325 + (0, _classCallCheck2.default)(this, Catch);
9326 + return _super.apply(this, arguments);
9327 + }
9328 + (0, _createClass2.default)(Catch, [{
9329 + key: "register",
9330 + value: function register() {
9331 + $e.hooks.registerUICatch(this);
9332 + }
9333 + }]);
9334 + return Catch;
9335 +}(_base.default);
9336 +exports.Catch = Catch;
9337 +var _default = Catch;
9338 +exports["default"] = _default;
9339 +
9340 +/***/ }),
9341 +
9342 +/***/ "../modules/web-cli/assets/js/modules/hooks/ui/index.js":
9343 +/*!**************************************************************!*\
9344 + !*** ../modules/web-cli/assets/js/modules/hooks/ui/index.js ***!
9345 + \**************************************************************/
9346 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
9347 +
9348 +"use strict";
9349 +
9350 +
9351 +Object.defineProperty(exports, "__esModule", ({
9352 + value: true
9353 +}));
9354 +Object.defineProperty(exports, "After", ({
9355 + enumerable: true,
9356 + get: function get() {
9357 + return _after.After;
9358 + }
9359 +}));
9360 +Object.defineProperty(exports, "Base", ({
9361 + enumerable: true,
9362 + get: function get() {
9363 + return _base.Base;
9364 + }
9365 +}));
9366 +Object.defineProperty(exports, "Before", ({
9367 + enumerable: true,
9368 + get: function get() {
9369 + return _before.Before;
9370 + }
9371 +}));
9372 +Object.defineProperty(exports, "Catch", ({
9373 + enumerable: true,
9374 + get: function get() {
9375 + return _catch.Catch;
9376 + }
9377 +}));
9378 +var _after = __webpack_require__(/*! ./after */ "../modules/web-cli/assets/js/modules/hooks/ui/after.js");
9379 +var _base = __webpack_require__(/*! ./base */ "../modules/web-cli/assets/js/modules/hooks/ui/base.js");
9380 +var _before = __webpack_require__(/*! ./before */ "../modules/web-cli/assets/js/modules/hooks/ui/before.js");
9381 +var _catch = __webpack_require__(/*! ./catch */ "../modules/web-cli/assets/js/modules/hooks/ui/catch.js");
9382 +
9383 +/***/ }),
9384 +
9385 +/***/ "../modules/web-cli/assets/js/utils/console.js":
9386 +/*!*****************************************************!*\
9387 + !*** ../modules/web-cli/assets/js/utils/console.js ***!
9388 + \*****************************************************/
9389 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
9390 +
9391 +"use strict";
9392 +
9393 +
9394 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
9395 +Object.defineProperty(exports, "__esModule", ({
9396 + value: true
9397 +}));
9398 +exports["default"] = void 0;
9399 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
9400 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
9401 +var Console = /*#__PURE__*/function () {
9402 + function Console() {
9403 + (0, _classCallCheck2.default)(this, Console);
9404 + }
9405 + (0, _createClass2.default)(Console, null, [{
9406 + key: "error",
9407 + value: function error(message) {
9408 + // Show an error if devTools is available.
9409 + if ($e.devTools) {
9410 + $e.devTools.log.error(message);
9411 + }
9412 +
9413 + // If not a 'Hook-Break' then show error.
9414 + if (!(message instanceof $e.modules.HookBreak)) {
9415 + // eslint-disable-next-line no-console
9416 + console.error(message);
9417 + }
9418 + }
9419 + }, {
9420 + key: "warn",
9421 + value: function warn() {
9422 + var _console;
9423 + var style = "font-size: 12px; background-image: url(\"".concat(elementorWebCliConfig.urls.assets, "images/logo-icon.png\"); background-repeat: no-repeat; background-size: contain;");
9424 + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
9425 + args[_key] = arguments[_key];
9426 + }
9427 + args.unshift('%c %c', style, '');
9428 + (_console = console).warn.apply(_console, args); // eslint-disable-line no-console
9429 + }
9430 + }]);
9431 + return Console;
9432 +}();
9433 +exports["default"] = Console;
9434 +
9435 +/***/ }),
9436 +
9437 +/***/ "../modules/web-cli/assets/js/utils/deprecation.js":
9438 +/*!*********************************************************!*\
9439 + !*** ../modules/web-cli/assets/js/utils/deprecation.js ***!
9440 + \*********************************************************/
9441 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
9442 +
9443 +"use strict";
9444 +
9445 +
9446 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
9447 +Object.defineProperty(exports, "__esModule", ({
9448 + value: true
9449 +}));
9450 +exports["default"] = void 0;
9451 +var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js"));
9452 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
9453 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
9454 +var _console = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/console */ "../modules/web-cli/assets/js/utils/console.js"));
9455 +// Copied from `modules/dev-tools/assets/js/deprecation.js`
9456 +/**
9457 + * @typedef {Object} Version
9458 + * @property {number} major1 The first number
9459 + * @property {number} major2 The second number
9460 + * @property {number} minor The third number
9461 + * @property {string} build The fourth number
9462 + */
9463 +var softDeprecated = function softDeprecated(name, version, replacement) {
9464 + if (elementorWebCliConfig.isDebug) {
9465 + deprecatedMessage('soft', name, version, replacement);
9466 + }
9467 +};
9468 +var hardDeprecated = function hardDeprecated(name, version, replacement) {
9469 + deprecatedMessage('hard', name, version, replacement);
9470 +};
9471 +var deprecatedMessage = function deprecatedMessage(type, name, version, replacement) {
9472 + var message = "`".concat(name, "` is ").concat(type, " deprecated since ").concat(version);
9473 + if (replacement) {
9474 + message += " - Use `".concat(replacement, "` instead");
9475 + }
9476 + _console.default.warn(message);
9477 +};
9478 +var Deprecation = /*#__PURE__*/function () {
9479 + function Deprecation() {
9480 + (0, _classCallCheck2.default)(this, Deprecation);
9481 + }
9482 + (0, _createClass2.default)(Deprecation, null, [{
9483 + key: "deprecated",
9484 + value: function deprecated(name, version, replacement) {
9485 + if (this.isHardDeprecated(version)) {
9486 + hardDeprecated(name, version, replacement);
9487 + } else {
9488 + softDeprecated(name, version, replacement);
9489 + }
9490 + }
9491 +
9492 + /**
9493 + * @param {string} version
9494 + *
9495 + * @return {Version}
9496 + */
9497 + }, {
9498 + key: "parseVersion",
9499 + value: function parseVersion(version) {
9500 + var versionParts = version.split('.');
9501 + if (versionParts.length < 3 || versionParts.length > 4) {
9502 + throw new RangeError('Invalid Semantic Version string provided');
9503 + }
9504 + var _versionParts = (0, _slicedToArray2.default)(versionParts, 4),
9505 + major1 = _versionParts[0],
9506 + major2 = _versionParts[1],
9507 + minor = _versionParts[2],
9508 + _versionParts$ = _versionParts[3],
9509 + build = _versionParts$ === void 0 ? '' : _versionParts$;
9510 + return {
9511 + major1: parseInt(major1),
9512 + major2: parseInt(major2),
9513 + minor: parseInt(minor),
9514 + build: build
9515 + };
9516 + }
9517 +
9518 + /**
9519 + * Get total of major.
9520 + *
9521 + * 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,
9522 + * versions with major2 more then 9 will be added to total.
9523 + *
9524 + * @param {Version} versionObj
9525 + *
9526 + * @return {number}
9527 + */
9528 + }, {
9529 + key: "getTotalMajor",
9530 + value: function getTotalMajor(versionObj) {
9531 + var total = parseInt("".concat(versionObj.major1).concat(versionObj.major2, "0"));
9532 + total = Number((total / 10).toFixed(0));
9533 + if (versionObj.major2 > 9) {
9534 + total = versionObj.major2 - 9;
9535 + }
9536 + return total;
9537 + }
9538 +
9539 + /**
9540 + * @param {string} version1
9541 + * @param {string} version2
9542 + *
9543 + * @return {number}
9544 + */
9545 + }, {
9546 + key: "compareVersion",
9547 + value: function compareVersion(version1, version2) {
9548 + var _this = this;
9549 + return [this.parseVersion(version1), this.parseVersion(version2)].map(function (versionObj) {
9550 + return _this.getTotalMajor(versionObj);
9551 + }).reduce(function (acc, major) {
9552 + return acc - major;
9553 + });
9554 + }
9555 +
9556 + /**
9557 + * @param {string} version
9558 + *
9559 + * @return {boolean}
9560 + */
9561 + }, {
9562 + key: "isSoftDeprecated",
9563 + value: function isSoftDeprecated(version) {
9564 + var total = this.compareVersion(version, elementorWebCliConfig.version);
9565 + return total <= 4;
9566 + }
9567 +
9568 + /**
9569 + * @param {string} version
9570 + * @return {boolean}
9571 + */
9572 + }, {
9573 + key: "isHardDeprecated",
9574 + value: function isHardDeprecated(version) {
9575 + var total = this.compareVersion(version, elementorWebCliConfig.version);
9576 + return total < 0 || total >= 8;
9577 + }
9578 + }]);
9579 + return Deprecation;
9580 +}();
9581 +exports["default"] = Deprecation;
9582 +
9583 +/***/ }),
9584 +
9585 +/***/ "../modules/web-cli/assets/js/utils/environment.js":
9586 +/*!*********************************************************!*\
9587 + !*** ../modules/web-cli/assets/js/utils/environment.js ***!
9588 + \*********************************************************/
9589 +/***/ ((__unused_webpack_module, exports) => {
9590 +
9591 +"use strict";
9592 +
9593 +
9594 +Object.defineProperty(exports, "__esModule", ({
9595 + value: true
9596 +}));
9597 +exports["default"] = void 0;
9598 +// TODO: Copied from `core/common/assets/js/utils/environment.js`.
9599 +var matchUserAgent = function matchUserAgent(UserAgentStr) {
9600 + return userAgent.indexOf(UserAgentStr) >= 0;
9601 + },
9602 + userAgent = navigator.userAgent,
9603 + // Solution influenced by https://stackoverflow.com/questions/9847580/how-to-detect-safari-chrome-ie-firefox-and-opera-browser
9604 +
9605 + // Opera 8.0+
9606 + isOpera = !!window.opr && !!opr.addons || !!window.opera || matchUserAgent(' OPR/'),
9607 + // Firefox 1.0+
9608 + isFirefox = matchUserAgent('Firefox'),
9609 + // Safari 3.0+ "[object HTMLElementConstructor]"
9610 + isSafari = /^((?!chrome|android).)*safari/i.test(userAgent) || /constructor/i.test(window.HTMLElement) || function (p) {
9611 + return '[object SafariRemoteNotification]' === p.toString();
9612 + }(!window.safari || typeof safari !== 'undefined' && safari.pushNotification),
9613 + // Internet Explorer 6-11
9614 + isIE = /Trident|MSIE/.test(userAgent) && ( /* @cc_on!@*/ false || !!document.documentMode),
9615 + // Edge 20+
9616 + isEdge = !isIE && !!window.StyleMedia || matchUserAgent('Edg'),
9617 + // Google Chrome (Not accurate)
9618 + isChrome = !!window.chrome && matchUserAgent('Chrome') && !(isEdge || isOpera),
9619 + // Blink engine
9620 + isBlink = matchUserAgent('Chrome') && !!window.CSS,
9621 + // Apple Webkit engine
9622 + isAppleWebkit = matchUserAgent('AppleWebKit') && !isBlink,
9623 + environment = {
9624 + appleWebkit: isAppleWebkit,
9625 + blink: isBlink,
9626 + chrome: isChrome,
9627 + edge: isEdge,
9628 + firefox: isFirefox,
9629 + ie: isIE,
9630 + mac: matchUserAgent('Macintosh'),
9631 + opera: isOpera,
9632 + safari: isSafari,
9633 + webkit: matchUserAgent('AppleWebKit')
9634 + };
9635 +var _default = environment;
9636 +exports["default"] = _default;
9637 +
9638 +/***/ }),
9639 +
9640 +/***/ "../modules/web-cli/assets/js/utils/force-method-implementation.js":
9641 +/*!*************************************************************************!*\
9642 + !*** ../modules/web-cli/assets/js/utils/force-method-implementation.js ***!
9643 + \*************************************************************************/
9644 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
9645 +
9646 +"use strict";
9647 +
9648 +
9649 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
9650 +Object.defineProperty(exports, "__esModule", ({
9651 + value: true
9652 +}));
9653 +exports["default"] = exports.ForceMethodImplementation = void 0;
9654 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
9655 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
9656 +var _assertThisInitialized2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ "../node_modules/@babel/runtime/helpers/assertThisInitialized.js"));
9657 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
9658 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
9659 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
9660 +var _wrapNativeSuper2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/wrapNativeSuper */ "../node_modules/@babel/runtime/helpers/wrapNativeSuper.js"));
9661 +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); }; }
9662 +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; } }
9663 +// TODO: Copied from `assets/dev/js/modules/imports/force-method-implementation.js`;
9664 +var ForceMethodImplementation = /*#__PURE__*/function (_Error) {
9665 + (0, _inherits2.default)(ForceMethodImplementation, _Error);
9666 + var _super = _createSuper(ForceMethodImplementation);
9667 + function ForceMethodImplementation() {
9668 + var _this;
9669 + var info = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
9670 + (0, _classCallCheck2.default)(this, ForceMethodImplementation);
9671 + _this = _super.call(this, "".concat(info.isStatic ? 'static ' : '').concat(info.fullName, "() should be implemented, please provide '").concat(info.functionName || info.fullName, "' functionality."));
9672 + Error.captureStackTrace((0, _assertThisInitialized2.default)(_this), ForceMethodImplementation);
9673 + return _this;
9674 + }
9675 + return (0, _createClass2.default)(ForceMethodImplementation);
9676 +}( /*#__PURE__*/(0, _wrapNativeSuper2.default)(Error));
9677 +exports.ForceMethodImplementation = ForceMethodImplementation;
9678 +var _default = function _default() {
9679 + var stack = Error().stack,
9680 + caller = stack.split('\n')[2].trim(),
9681 + callerName = caller.startsWith('at new') ? 'constructor' : caller.split(' ')[1],
9682 + info = {};
9683 + info.functionName = callerName;
9684 + info.fullName = callerName;
9685 + if (info.functionName.includes('.')) {
9686 + var parts = info.functionName.split('.');
9687 + info.className = parts[0];
9688 + info.functionName = parts[1];
9689 + } else {
9690 + info.isStatic = true;
9691 + }
9692 + throw new ForceMethodImplementation(info);
9693 +};
9694 +exports["default"] = _default;
9695 +
9696 +/***/ }),
9697 +
9698 +/***/ "../node_modules/redux-thunk/es/index.js":
9699 +/*!***********************************************!*\
9700 + !*** ../node_modules/redux-thunk/es/index.js ***!
9701 + \***********************************************/
9702 +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
9703 +
9704 +"use strict";
9705 +__webpack_require__.r(__webpack_exports__);
9706 +/* harmony export */ __webpack_require__.d(__webpack_exports__, {
9707 +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
9708 +/* harmony export */ });
9709 +/** A function that accepts a potential "extra argument" value to be injected later,
9710 + * and returns an instance of the thunk middleware that uses that value
9711 + */
9712 +function createThunkMiddleware(extraArgument) {
9713 + // Standard Redux middleware definition pattern:
9714 + // See: https://redux.js.org/tutorials/fundamentals/part-4-store#writing-custom-middleware
9715 + var middleware = function middleware(_ref) {
9716 + var dispatch = _ref.dispatch,
9717 + getState = _ref.getState;
9718 + return function (next) {
9719 + return function (action) {
9720 + // The thunk middleware looks for any functions that were passed to `store.dispatch`.
9721 + // If this "action" is really a function, call it and return the result.
9722 + if (typeof action === 'function') {
9723 + // Inject the store's `dispatch` and `getState` methods, as well as any "extra arg"
9724 + return action(dispatch, getState, extraArgument);
9725 + } // Otherwise, pass the action down the middleware chain as usual
9726 +
9727 +
9728 + return next(action);
9729 + };
9730 + };
9731 + };
9732 +
9733 + return middleware;
9734 +}
9735 +
9736 +var thunk = createThunkMiddleware(); // Attach the factory function so users can create a customized version
9737 +// with whatever "extra arg" they want to inject into their thunks
9738 +
9739 +thunk.withExtraArgument = createThunkMiddleware;
9740 +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (thunk);
9741 +
9742 +/***/ }),
9743 +
9744 +/***/ "../node_modules/redux/es/redux.js":
9745 +/*!*****************************************!*\
9746 + !*** ../node_modules/redux/es/redux.js ***!
9747 + \*****************************************/
9748 +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
9749 +
9750 +"use strict";
9751 +__webpack_require__.r(__webpack_exports__);
9752 +/* harmony export */ __webpack_require__.d(__webpack_exports__, {
9753 +/* harmony export */ "__DO_NOT_USE__ActionTypes": () => (/* binding */ ActionTypes),
9754 +/* harmony export */ "applyMiddleware": () => (/* binding */ applyMiddleware),
9755 +/* harmony export */ "bindActionCreators": () => (/* binding */ bindActionCreators),
9756 +/* harmony export */ "combineReducers": () => (/* binding */ combineReducers),
9757 +/* harmony export */ "compose": () => (/* binding */ compose),
9758 +/* harmony export */ "createStore": () => (/* binding */ createStore),
9759 +/* harmony export */ "legacy_createStore": () => (/* binding */ legacy_createStore)
9760 +/* harmony export */ });
9761 +/* 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");
9762 +
9763 +
9764 +/**
9765 + * Adapted from React: https://github.com/facebook/react/blob/master/packages/shared/formatProdErrorMessage.js
9766 + *
9767 + * Do not require this module directly! Use normal throw error calls. These messages will be replaced with error codes
9768 + * during build.
9769 + * @param {number} code
9770 + */
9771 +function formatProdErrorMessage(code) {
9772 + 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. ';
9773 +}
9774 +
9775 +// Inlined version of the `symbol-observable` polyfill
9776 +var $$observable = (function () {
9777 + return typeof Symbol === 'function' && Symbol.observable || '@@observable';
9778 +})();
9779 +
9780 +/**
9781 + * These are private action types reserved by Redux.
9782 + * For any unknown actions, you must return the current state.
9783 + * If the current state is undefined, you must return the initial state.
9784 + * Do not reference these action types directly in your code.
9785 + */
9786 +var randomString = function randomString() {
9787 + return Math.random().toString(36).substring(7).split('').join('.');
9788 +};
9789 +
9790 +var ActionTypes = {
9791 + INIT: "@@redux/INIT" + randomString(),
9792 + REPLACE: "@@redux/REPLACE" + randomString(),
9793 + PROBE_UNKNOWN_ACTION: function PROBE_UNKNOWN_ACTION() {
9794 + return "@@redux/PROBE_UNKNOWN_ACTION" + randomString();
9795 + }
9796 +};
9797 +
9798 +/**
9799 + * @param {any} obj The object to inspect.
9800 + * @returns {boolean} True if the argument appears to be a plain object.
9801 + */
9802 +function isPlainObject(obj) {
9803 + if (typeof obj !== 'object' || obj === null) return false;
9804 + var proto = obj;
9805 +
9806 + while (Object.getPrototypeOf(proto) !== null) {
9807 + proto = Object.getPrototypeOf(proto);
9808 + }
9809 +
9810 + return Object.getPrototypeOf(obj) === proto;
9811 +}
9812 +
9813 +// Inlined / shortened version of `kindOf` from https://github.com/jonschlinkert/kind-of
9814 +function miniKindOf(val) {
9815 + if (val === void 0) return 'undefined';
9816 + if (val === null) return 'null';
9817 + var type = typeof val;
9818 +
9819 + switch (type) {
9820 + case 'boolean':
9821 + case 'string':
9822 + case 'number':
9823 + case 'symbol':
9824 + case 'function':
9825 + {
9826 + return type;
9827 + }
9828 + }
9829 +
9830 + if (Array.isArray(val)) return 'array';
9831 + if (isDate(val)) return 'date';
9832 + if (isError(val)) return 'error';
9833 + var constructorName = ctorName(val);
9834 +
9835 + switch (constructorName) {
9836 + case 'Symbol':
9837 + case 'Promise':
9838 + case 'WeakMap':
9839 + case 'WeakSet':
9840 + case 'Map':
9841 + case 'Set':
9842 + return constructorName;
9843 + } // other
9844 +
9845 +
9846 + return type.slice(8, -1).toLowerCase().replace(/\s/g, '');
9847 +}
9848 +
9849 +function ctorName(val) {
9850 + return typeof val.constructor === 'function' ? val.constructor.name : null;
9851 +}
9852 +
9853 +function isError(val) {
9854 + return val instanceof Error || typeof val.message === 'string' && val.constructor && typeof val.constructor.stackTraceLimit === 'number';
9855 +}
9856 +
9857 +function isDate(val) {
9858 + if (val instanceof Date) return true;
9859 + return typeof val.toDateString === 'function' && typeof val.getDate === 'function' && typeof val.setDate === 'function';
9860 +}
9861 +
9862 +function kindOf(val) {
9863 + var typeOfVal = typeof val;
9864 +
9865 + if (true) {
9866 + typeOfVal = miniKindOf(val);
9867 + }
9868 +
9869 + return typeOfVal;
9870 +}
9871 +
9872 +/**
9873 + * @deprecated
9874 + *
9875 + * **We recommend using the `configureStore` method
9876 + * of the `@reduxjs/toolkit` package**, which replaces `createStore`.
9877 + *
9878 + * Redux Toolkit is our recommended approach for writing Redux logic today,
9879 + * including store setup, reducers, data fetching, and more.
9880 + *
9881 + * **For more details, please read this Redux docs page:**
9882 + * **https://redux.js.org/introduction/why-rtk-is-redux-today**
9883 + *
9884 + * `configureStore` from Redux Toolkit is an improved version of `createStore` that
9885 + * simplifies setup and helps avoid common bugs.
9886 + *
9887 + * You should not be using the `redux` core package by itself today, except for learning purposes.
9888 + * The `createStore` method from the core `redux` package will not be removed, but we encourage
9889 + * all users to migrate to using Redux Toolkit for all Redux code.
9890 + *
9891 + * If you want to use `createStore` without this visual deprecation warning, use
9892 + * the `legacy_createStore` import instead:
9893 + *
9894 + * `import { legacy_createStore as createStore} from 'redux'`
9895 + *
9896 + */
9897 +
9898 +function createStore(reducer, preloadedState, enhancer) {
9899 + var _ref2;
9900 +
9901 + if (typeof preloadedState === 'function' && typeof enhancer === 'function' || typeof enhancer === 'function' && typeof arguments[3] === 'function') {
9902 + 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.');
9903 + }
9904 +
9905 + if (typeof preloadedState === 'function' && typeof enhancer === 'undefined') {
9906 + enhancer = preloadedState;
9907 + preloadedState = undefined;
9908 + }
9909 +
9910 + if (typeof enhancer !== 'undefined') {
9911 + if (typeof enhancer !== 'function') {
9912 + throw new Error( false ? 0 : "Expected the enhancer to be a function. Instead, received: '" + kindOf(enhancer) + "'");
9913 + }
9914 +
9915 + return enhancer(createStore)(reducer, preloadedState);
9916 + }
9917 +
9918 + if (typeof reducer !== 'function') {
9919 + throw new Error( false ? 0 : "Expected the root reducer to be a function. Instead, received: '" + kindOf(reducer) + "'");
9920 + }
9921 +
9922 + var currentReducer = reducer;
9923 + var currentState = preloadedState;
9924 + var currentListeners = [];
9925 + var nextListeners = currentListeners;
9926 + var isDispatching = false;
9927 + /**
9928 + * This makes a shallow copy of currentListeners so we can use
9929 + * nextListeners as a temporary list while dispatching.
9930 + *
9931 + * This prevents any bugs around consumers calling
9932 + * subscribe/unsubscribe in the middle of a dispatch.
9933 + */
9934 +
9935 + function ensureCanMutateNextListeners() {
9936 + if (nextListeners === currentListeners) {
9937 + nextListeners = currentListeners.slice();
9938 + }
9939 + }
9940 + /**
9941 + * Reads the state tree managed by the store.
9942 + *
9943 + * @returns {any} The current state tree of your application.
9944 + */
9945 +
9946 +
9947 + function getState() {
9948 + if (isDispatching) {
9949 + 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.');
9950 + }
9951 +
9952 + return currentState;
9953 + }
9954 + /**
9955 + * Adds a change listener. It will be called any time an action is dispatched,
9956 + * and some part of the state tree may potentially have changed. You may then
9957 + * call `getState()` to read the current state tree inside the callback.
9958 + *
9959 + * You may call `dispatch()` from a change listener, with the following
9960 + * caveats:
9961 + *
9962 + * 1. The subscriptions are snapshotted just before every `dispatch()` call.
9963 + * If you subscribe or unsubscribe while the listeners are being invoked, this
9964 + * will not have any effect on the `dispatch()` that is currently in progress.
9965 + * However, the next `dispatch()` call, whether nested or not, will use a more
9966 + * recent snapshot of the subscription list.
9967 + *
9968 + * 2. The listener should not expect to see all state changes, as the state
9969 + * might have been updated multiple times during a nested `dispatch()` before
9970 + * the listener is called. It is, however, guaranteed that all subscribers
9971 + * registered before the `dispatch()` started will be called with the latest
9972 + * state by the time it exits.
9973 + *
9974 + * @param {Function} listener A callback to be invoked on every dispatch.
9975 + * @returns {Function} A function to remove this change listener.
9976 + */
9977 +
9978 +
9979 + function subscribe(listener) {
9980 + if (typeof listener !== 'function') {
9981 + throw new Error( false ? 0 : "Expected the listener to be a function. Instead, received: '" + kindOf(listener) + "'");
9982 + }
9983 +
9984 + if (isDispatching) {
9985 + 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.');
9986 + }
9987 +
9988 + var isSubscribed = true;
9989 + ensureCanMutateNextListeners();
9990 + nextListeners.push(listener);
9991 + return function unsubscribe() {
9992 + if (!isSubscribed) {
9993 + return;
9994 + }
9995 +
9996 + if (isDispatching) {
9997 + 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.');
9998 + }
9999 +
10000 + isSubscribed = false;
10001 + ensureCanMutateNextListeners();
10002 + var index = nextListeners.indexOf(listener);
10003 + nextListeners.splice(index, 1);
10004 + currentListeners = null;
10005 + };
10006 + }
10007 + /**
10008 + * Dispatches an action. It is the only way to trigger a state change.
10009 + *
10010 + * The `reducer` function, used to create the store, will be called with the
10011 + * current state tree and the given `action`. Its return value will
10012 + * be considered the **next** state of the tree, and the change listeners
10013 + * will be notified.
10014 + *
10015 + * The base implementation only supports plain object actions. If you want to
10016 + * dispatch a Promise, an Observable, a thunk, or something else, you need to
10017 + * wrap your store creating function into the corresponding middleware. For
10018 + * example, see the documentation for the `redux-thunk` package. Even the
10019 + * middleware will eventually dispatch plain object actions using this method.
10020 + *
10021 + * @param {Object} action A plain object representing “what changed”. It is
10022 + * a good idea to keep actions serializable so you can record and replay user
10023 + * sessions, or use the time travelling `redux-devtools`. An action must have
10024 + * a `type` property which may not be `undefined`. It is a good idea to use
10025 + * string constants for action types.
10026 + *
10027 + * @returns {Object} For convenience, the same action object you dispatched.
10028 + *
10029 + * Note that, if you use a custom middleware, it may wrap `dispatch()` to
10030 + * return something else (for example, a Promise you can await).
10031 + */
10032 +
10033 +
10034 + function dispatch(action) {
10035 + if (!isPlainObject(action)) {
10036 + 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.");
10037 + }
10038 +
10039 + if (typeof action.type === 'undefined') {
10040 + throw new Error( false ? 0 : 'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');
10041 + }
10042 +
10043 + if (isDispatching) {
10044 + throw new Error( false ? 0 : 'Reducers may not dispatch actions.');
10045 + }
10046 +
10047 + try {
10048 + isDispatching = true;
10049 + currentState = currentReducer(currentState, action);
10050 + } finally {
10051 + isDispatching = false;
10052 + }
10053 +
10054 + var listeners = currentListeners = nextListeners;
10055 +
10056 + for (var i = 0; i < listeners.length; i++) {
10057 + var listener = listeners[i];
10058 + listener();
10059 + }
10060 +
10061 + return action;
10062 + }
10063 + /**
10064 + * Replaces the reducer currently used by the store to calculate the state.
10065 + *
10066 + * You might need this if your app implements code splitting and you want to
10067 + * load some of the reducers dynamically. You might also need this if you
10068 + * implement a hot reloading mechanism for Redux.
10069 + *
10070 + * @param {Function} nextReducer The reducer for the store to use instead.
10071 + * @returns {void}
10072 + */
10073 +
10074 +
10075 + function replaceReducer(nextReducer) {
10076 + if (typeof nextReducer !== 'function') {
10077 + throw new Error( false ? 0 : "Expected the nextReducer to be a function. Instead, received: '" + kindOf(nextReducer));
10078 + }
10079 +
10080 + currentReducer = nextReducer; // This action has a similiar effect to ActionTypes.INIT.
10081 + // Any reducers that existed in both the new and old rootReducer
10082 + // will receive the previous state. This effectively populates
10083 + // the new state tree with any relevant data from the old one.
10084 +
10085 + dispatch({
10086 + type: ActionTypes.REPLACE
10087 + });
10088 + }
10089 + /**
10090 + * Interoperability point for observable/reactive libraries.
10091 + * @returns {observable} A minimal observable of state changes.
10092 + * For more information, see the observable proposal:
10093 + * https://github.com/tc39/proposal-observable
10094 + */
10095 +
10096 +
10097 + function observable() {
10098 + var _ref;
10099 +
10100 + var outerSubscribe = subscribe;
10101 + return _ref = {
10102 + /**
10103 + * The minimal observable subscription method.
10104 + * @param {Object} observer Any object that can be used as an observer.
10105 + * The observer object should have a `next` method.
10106 + * @returns {subscription} An object with an `unsubscribe` method that can
10107 + * be used to unsubscribe the observable from the store, and prevent further
10108 + * emission of values from the observable.
10109 + */
10110 + subscribe: function subscribe(observer) {
10111 + if (typeof observer !== 'object' || observer === null) {
10112 + throw new Error( false ? 0 : "Expected the observer to be an object. Instead, received: '" + kindOf(observer) + "'");
10113 + }
10114 +
10115 + function observeState() {
10116 + if (observer.next) {
10117 + observer.next(getState());
10118 + }
10119 + }
10120 +
10121 + observeState();
10122 + var unsubscribe = outerSubscribe(observeState);
10123 + return {
10124 + unsubscribe: unsubscribe
10125 + };
10126 + }
10127 + }, _ref[$$observable] = function () {
10128 + return this;
10129 + }, _ref;
10130 + } // When a store is created, an "INIT" action is dispatched so that every
10131 + // reducer returns their initial state. This effectively populates
10132 + // the initial state tree.
10133 +
10134 +
10135 + dispatch({
10136 + type: ActionTypes.INIT
10137 + });
10138 + return _ref2 = {
10139 + dispatch: dispatch,
10140 + subscribe: subscribe,
10141 + getState: getState,
10142 + replaceReducer: replaceReducer
10143 + }, _ref2[$$observable] = observable, _ref2;
10144 +}
10145 +/**
10146 + * Creates a Redux store that holds the state tree.
10147 + *
10148 + * **We recommend using `configureStore` from the
10149 + * `@reduxjs/toolkit` package**, which replaces `createStore`:
10150 + * **https://redux.js.org/introduction/why-rtk-is-redux-today**
10151 + *
10152 + * The only way to change the data in the store is to call `dispatch()` on it.
10153 + *
10154 + * There should only be a single store in your app. To specify how different
10155 + * parts of the state tree respond to actions, you may combine several reducers
10156 + * into a single reducer function by using `combineReducers`.
10157 + *
10158 + * @param {Function} reducer A function that returns the next state tree, given
10159 + * the current state tree and the action to handle.
10160 + *
10161 + * @param {any} [preloadedState] The initial state. You may optionally specify it
10162 + * to hydrate the state from the server in universal apps, or to restore a
10163 + * previously serialized user session.
10164 + * If you use `combineReducers` to produce the root reducer function, this must be
10165 + * an object with the same shape as `combineReducers` keys.
10166 + *
10167 + * @param {Function} [enhancer] The store enhancer. You may optionally specify it
10168 + * to enhance the store with third-party capabilities such as middleware,
10169 + * time travel, persistence, etc. The only store enhancer that ships with Redux
10170 + * is `applyMiddleware()`.
10171 + *
10172 + * @returns {Store} A Redux store that lets you read the state, dispatch actions
10173 + * and subscribe to changes.
10174 + */
10175 +
10176 +var legacy_createStore = createStore;
10177 +
10178 +/**
10179 + * Prints a warning in the console if it exists.
10180 + *
10181 + * @param {String} message The warning message.
10182 + * @returns {void}
10183 + */
10184 +function warning(message) {
10185 + /* eslint-disable no-console */
10186 + if (typeof console !== 'undefined' && typeof console.error === 'function') {
10187 + console.error(message);
10188 + }
10189 + /* eslint-enable no-console */
10190 +
10191 +
10192 + try {
10193 + // This error was thrown as a convenience so that if you enable
10194 + // "break on all exceptions" in your console,
10195 + // it would pause the execution at this line.
10196 + throw new Error(message);
10197 + } catch (e) {} // eslint-disable-line no-empty
10198 +
10199 +}
10200 +
10201 +function getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) {
10202 + var reducerKeys = Object.keys(reducers);
10203 + var argumentName = action && action.type === ActionTypes.INIT ? 'preloadedState argument passed to createStore' : 'previous state received by the reducer';
10204 +
10205 + if (reducerKeys.length === 0) {
10206 + return 'Store does not have a valid reducer. Make sure the argument passed ' + 'to combineReducers is an object whose values are reducers.';
10207 + }
10208 +
10209 + if (!isPlainObject(inputState)) {
10210 + return "The " + argumentName + " has unexpected type of \"" + kindOf(inputState) + "\". Expected argument to be an object with the following " + ("keys: \"" + reducerKeys.join('", "') + "\"");
10211 + }
10212 +
10213 + var unexpectedKeys = Object.keys(inputState).filter(function (key) {
10214 + return !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key];
10215 + });
10216 + unexpectedKeys.forEach(function (key) {
10217 + unexpectedKeyCache[key] = true;
10218 + });
10219 + if (action && action.type === ActionTypes.REPLACE) return;
10220 +
10221 + if (unexpectedKeys.length > 0) {
10222 + 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.");
10223 + }
10224 +}
10225 +
10226 +function assertReducerShape(reducers) {
10227 + Object.keys(reducers).forEach(function (key) {
10228 + var reducer = reducers[key];
10229 + var initialState = reducer(undefined, {
10230 + type: ActionTypes.INIT
10231 + });
10232 +
10233 + if (typeof initialState === 'undefined') {
10234 + 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.");
10235 + }
10236 +
10237 + if (typeof reducer(undefined, {
10238 + type: ActionTypes.PROBE_UNKNOWN_ACTION()
10239 + }) === 'undefined') {
10240 + 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.");
10241 + }
10242 + });
10243 +}
10244 +/**
10245 + * Turns an object whose values are different reducer functions, into a single
10246 + * reducer function. It will call every child reducer, and gather their results
10247 + * into a single state object, whose keys correspond to the keys of the passed
10248 + * reducer functions.
10249 + *
10250 + * @param {Object} reducers An object whose values correspond to different
10251 + * reducer functions that need to be combined into one. One handy way to obtain
10252 + * it is to use ES6 `import * as reducers` syntax. The reducers may never return
10253 + * undefined for any action. Instead, they should return their initial state
10254 + * if the state passed to them was undefined, and the current state for any
10255 + * unrecognized action.
10256 + *
10257 + * @returns {Function} A reducer function that invokes every reducer inside the
10258 + * passed object, and builds a state object with the same shape.
10259 + */
10260 +
10261 +
10262 +function combineReducers(reducers) {
10263 + var reducerKeys = Object.keys(reducers);
10264 + var finalReducers = {};
10265 +
10266 + for (var i = 0; i < reducerKeys.length; i++) {
10267 + var key = reducerKeys[i];
10268 +
10269 + if (true) {
10270 + if (typeof reducers[key] === 'undefined') {
10271 + warning("No reducer provided for key \"" + key + "\"");
10272 + }
10273 + }
10274 +
10275 + if (typeof reducers[key] === 'function') {
10276 + finalReducers[key] = reducers[key];
10277 + }
10278 + }
10279 +
10280 + var finalReducerKeys = Object.keys(finalReducers); // This is used to make sure we don't warn about the same
10281 + // keys multiple times.
10282 +
10283 + var unexpectedKeyCache;
10284 +
10285 + if (true) {
10286 + unexpectedKeyCache = {};
10287 + }
10288 +
10289 + var shapeAssertionError;
10290 +
10291 + try {
10292 + assertReducerShape(finalReducers);
10293 + } catch (e) {
10294 + shapeAssertionError = e;
10295 + }
10296 +
10297 + return function combination(state, action) {
10298 + if (state === void 0) {
10299 + state = {};
10300 + }
10301 +
10302 + if (shapeAssertionError) {
10303 + throw shapeAssertionError;
10304 + }
10305 +
10306 + if (true) {
10307 + var warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action, unexpectedKeyCache);
10308 +
10309 + if (warningMessage) {
10310 + warning(warningMessage);
10311 + }
10312 + }
10313 +
10314 + var hasChanged = false;
10315 + var nextState = {};
10316 +
10317 + for (var _i = 0; _i < finalReducerKeys.length; _i++) {
10318 + var _key = finalReducerKeys[_i];
10319 + var reducer = finalReducers[_key];
10320 + var previousStateForKey = state[_key];
10321 + var nextStateForKey = reducer(previousStateForKey, action);
10322 +
10323 + if (typeof nextStateForKey === 'undefined') {
10324 + var actionType = action && action.type;
10325 + 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.");
10326 + }
10327 +
10328 + nextState[_key] = nextStateForKey;
10329 + hasChanged = hasChanged || nextStateForKey !== previousStateForKey;
10330 + }
10331 +
10332 + hasChanged = hasChanged || finalReducerKeys.length !== Object.keys(state).length;
10333 + return hasChanged ? nextState : state;
10334 + };
10335 +}
10336 +
10337 +function bindActionCreator(actionCreator, dispatch) {
10338 + return function () {
10339 + return dispatch(actionCreator.apply(this, arguments));
10340 + };
10341 +}
10342 +/**
10343 + * Turns an object whose values are action creators, into an object with the
10344 + * same keys, but with every function wrapped into a `dispatch` call so they
10345 + * may be invoked directly. This is just a convenience method, as you can call
10346 + * `store.dispatch(MyActionCreators.doSomething())` yourself just fine.
10347 + *
10348 + * For convenience, you can also pass an action creator as the first argument,
10349 + * and get a dispatch wrapped function in return.
10350 + *
10351 + * @param {Function|Object} actionCreators An object whose values are action
10352 + * creator functions. One handy way to obtain it is to use ES6 `import * as`
10353 + * syntax. You may also pass a single function.
10354 + *
10355 + * @param {Function} dispatch The `dispatch` function available on your Redux
10356 + * store.
10357 + *
10358 + * @returns {Function|Object} The object mimicking the original object, but with
10359 + * every action creator wrapped into the `dispatch` call. If you passed a
10360 + * function as `actionCreators`, the return value will also be a single
10361 + * function.
10362 + */
10363 +
10364 +
10365 +function bindActionCreators(actionCreators, dispatch) {
10366 + if (typeof actionCreators === 'function') {
10367 + return bindActionCreator(actionCreators, dispatch);
10368 + }
10369 +
10370 + if (typeof actionCreators !== 'object' || actionCreators === null) {
10371 + 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\"?");
10372 + }
10373 +
10374 + var boundActionCreators = {};
10375 +
10376 + for (var key in actionCreators) {
10377 + var actionCreator = actionCreators[key];
10378 +
10379 + if (typeof actionCreator === 'function') {
10380 + boundActionCreators[key] = bindActionCreator(actionCreator, dispatch);
10381 + }
10382 + }
10383 +
10384 + return boundActionCreators;
10385 +}
10386 +
10387 +/**
10388 + * Composes single-argument functions from right to left. The rightmost
10389 + * function can take multiple arguments as it provides the signature for
10390 + * the resulting composite function.
10391 + *
10392 + * @param {...Function} funcs The functions to compose.
10393 + * @returns {Function} A function obtained by composing the argument functions
10394 + * from right to left. For example, compose(f, g, h) is identical to doing
10395 + * (...args) => f(g(h(...args))).
10396 + */
10397 +function compose() {
10398 + for (var _len = arguments.length, funcs = new Array(_len), _key = 0; _key < _len; _key++) {
10399 + funcs[_key] = arguments[_key];
10400 + }
10401 +
10402 + if (funcs.length === 0) {
10403 + return function (arg) {
10404 + return arg;
10405 + };
10406 + }
10407 +
10408 + if (funcs.length === 1) {
10409 + return funcs[0];
10410 + }
10411 +
10412 + return funcs.reduce(function (a, b) {
10413 + return function () {
10414 + return a(b.apply(void 0, arguments));
10415 + };
10416 + });
10417 +}
10418 +
10419 +/**
10420 + * Creates a store enhancer that applies middleware to the dispatch method
10421 + * of the Redux store. This is handy for a variety of tasks, such as expressing
10422 + * asynchronous actions in a concise manner, or logging every action payload.
10423 + *
10424 + * See `redux-thunk` package as an example of the Redux middleware.
10425 + *
10426 + * Because middleware is potentially asynchronous, this should be the first
10427 + * store enhancer in the composition chain.
10428 + *
10429 + * Note that each middleware will be given the `dispatch` and `getState` functions
10430 + * as named arguments.
10431 + *
10432 + * @param {...Function} middlewares The middleware chain to be applied.
10433 + * @returns {Function} A store enhancer applying the middleware.
10434 + */
10435 +
10436 +function applyMiddleware() {
10437 + for (var _len = arguments.length, middlewares = new Array(_len), _key = 0; _key < _len; _key++) {
10438 + middlewares[_key] = arguments[_key];
10439 + }
10440 +
10441 + return function (createStore) {
10442 + return function () {
10443 + var store = createStore.apply(void 0, arguments);
10444 +
10445 + var _dispatch = function dispatch() {
10446 + throw new Error( false ? 0 : 'Dispatching while constructing your middleware is not allowed. ' + 'Other middleware would not be applied to this dispatch.');
10447 + };
10448 +
10449 + var middlewareAPI = {
10450 + getState: store.getState,
10451 + dispatch: function dispatch() {
10452 + return _dispatch.apply(void 0, arguments);
10453 + }
10454 + };
10455 + var chain = middlewares.map(function (middleware) {
10456 + return middleware(middlewareAPI);
10457 + });
10458 + _dispatch = compose.apply(void 0, chain)(store.dispatch);
10459 + return (0,_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_0__["default"])((0,_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_0__["default"])({}, store), {}, {
10460 + dispatch: _dispatch
10461 + });
10462 + };
10463 + };
10464 +}
10465 +
10466 +
10467 +
10468 +
10469 +/***/ }),
10470 +
10471 +/***/ "../node_modules/reselect/es/defaultMemoize.js":
10472 +/*!*****************************************************!*\
10473 + !*** ../node_modules/reselect/es/defaultMemoize.js ***!
10474 + \*****************************************************/
10475 +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
10476 +
10477 +"use strict";
10478 +__webpack_require__.r(__webpack_exports__);
10479 +/* harmony export */ __webpack_require__.d(__webpack_exports__, {
10480 +/* harmony export */ "createCacheKeyComparator": () => (/* binding */ createCacheKeyComparator),
10481 +/* harmony export */ "defaultEqualityCheck": () => (/* binding */ defaultEqualityCheck),
10482 +/* harmony export */ "defaultMemoize": () => (/* binding */ defaultMemoize)
10483 +/* harmony export */ });
10484 +// Cache implementation based on Erik Rasmussen's `lru-memoize`:
10485 +// https://github.com/erikras/lru-memoize
10486 +var NOT_FOUND = 'NOT_FOUND';
10487 +
10488 +function createSingletonCache(equals) {
10489 + var entry;
10490 + return {
10491 + get: function get(key) {
10492 + if (entry && equals(entry.key, key)) {
10493 + return entry.value;
10494 + }
10495 +
10496 + return NOT_FOUND;
10497 + },
10498 + put: function put(key, value) {
10499 + entry = {
10500 + key: key,
10501 + value: value
10502 + };
10503 + },
10504 + getEntries: function getEntries() {
10505 + return entry ? [entry] : [];
10506 + },
10507 + clear: function clear() {
10508 + entry = undefined;
10509 + }
10510 + };
10511 +}
10512 +
10513 +function createLruCache(maxSize, equals) {
10514 + var entries = [];
10515 +
10516 + function get(key) {
10517 + var cacheIndex = entries.findIndex(function (entry) {
10518 + return equals(key, entry.key);
10519 + }); // We found a cached entry
10520 +
10521 + if (cacheIndex > -1) {
10522 + var entry = entries[cacheIndex]; // Cached entry not at top of cache, move it to the top
10523 +
10524 + if (cacheIndex > 0) {
10525 + entries.splice(cacheIndex, 1);
10526 + entries.unshift(entry);
10527 + }
10528 +
10529 + return entry.value;
10530 + } // No entry found in cache, return sentinel
10531 +
10532 +
10533 + return NOT_FOUND;
10534 + }
10535 +
10536 + function put(key, value) {
10537 + if (get(key) === NOT_FOUND) {
10538 + // TODO Is unshift slow?
10539 + entries.unshift({
10540 + key: key,
10541 + value: value
10542 + });
10543 +
10544 + if (entries.length > maxSize) {
10545 + entries.pop();
10546 + }
10547 + }
10548 + }
10549 +
10550 + function getEntries() {
10551 + return entries;
10552 + }
10553 +
10554 + function clear() {
10555 + entries = [];
10556 + }
10557 +
10558 + return {
10559 + get: get,
10560 + put: put,
10561 + getEntries: getEntries,
10562 + clear: clear
10563 + };
10564 +}
10565 +
10566 +var defaultEqualityCheck = function defaultEqualityCheck(a, b) {
10567 + return a === b;
10568 +};
10569 +function createCacheKeyComparator(equalityCheck) {
10570 + return function areArgumentsShallowlyEqual(prev, next) {
10571 + if (prev === null || next === null || prev.length !== next.length) {
10572 + return false;
10573 + } // Do this in a for loop (and not a `forEach` or an `every`) so we can determine equality as fast as possible.
10574 +
10575 +
10576 + var length = prev.length;
10577 +
10578 + for (var i = 0; i < length; i++) {
10579 + if (!equalityCheck(prev[i], next[i])) {
10580 + return false;
10581 + }
10582 + }
10583 +
10584 + return true;
10585 + };
10586 +}
10587 +// defaultMemoize now supports a configurable cache size with LRU behavior,
10588 +// and optional comparison of the result value with existing values
10589 +function defaultMemoize(func, equalityCheckOrOptions) {
10590 + var providedOptions = typeof equalityCheckOrOptions === 'object' ? equalityCheckOrOptions : {
10591 + equalityCheck: equalityCheckOrOptions
10592 + };
10593 + var _providedOptions$equa = providedOptions.equalityCheck,
10594 + equalityCheck = _providedOptions$equa === void 0 ? defaultEqualityCheck : _providedOptions$equa,
10595 + _providedOptions$maxS = providedOptions.maxSize,
10596 + maxSize = _providedOptions$maxS === void 0 ? 1 : _providedOptions$maxS,
10597 + resultEqualityCheck = providedOptions.resultEqualityCheck;
10598 + var comparator = createCacheKeyComparator(equalityCheck);
10599 + var cache = maxSize === 1 ? createSingletonCache(comparator) : createLruCache(maxSize, comparator); // we reference arguments instead of spreading them for performance reasons
10600 +
10601 + function memoized() {
10602 + var value = cache.get(arguments);
10603 +
10604 + if (value === NOT_FOUND) {
10605 + // @ts-ignore
10606 + value = func.apply(null, arguments);
10607 +
10608 + if (resultEqualityCheck) {
10609 + var entries = cache.getEntries();
10610 + var matchingEntry = entries.find(function (entry) {
10611 + return resultEqualityCheck(entry.value, value);
10612 + });
10613 +
10614 + if (matchingEntry) {
10615 + value = matchingEntry.value;
10616 + }
10617 + }
10618 +
10619 + cache.put(arguments, value);
10620 + }
10621 +
10622 + return value;
10623 + }
10624 +
10625 + memoized.clearCache = function () {
10626 + return cache.clear();
10627 + };
10628 +
10629 + return memoized;
10630 +}
10631 +
10632 +/***/ }),
10633 +
10634 +/***/ "../node_modules/reselect/es/index.js":
10635 +/*!********************************************!*\
10636 + !*** ../node_modules/reselect/es/index.js ***!
10637 + \********************************************/
10638 +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
10639 +
10640 +"use strict";
10641 +__webpack_require__.r(__webpack_exports__);
10642 +/* harmony export */ __webpack_require__.d(__webpack_exports__, {
10643 +/* harmony export */ "createSelector": () => (/* binding */ createSelector),
10644 +/* harmony export */ "createSelectorCreator": () => (/* binding */ createSelectorCreator),
10645 +/* harmony export */ "createStructuredSelector": () => (/* binding */ createStructuredSelector),
10646 +/* harmony export */ "defaultEqualityCheck": () => (/* reexport safe */ _defaultMemoize__WEBPACK_IMPORTED_MODULE_0__.defaultEqualityCheck),
10647 +/* harmony export */ "defaultMemoize": () => (/* reexport safe */ _defaultMemoize__WEBPACK_IMPORTED_MODULE_0__.defaultMemoize)
10648 +/* harmony export */ });
10649 +/* harmony import */ var _defaultMemoize__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./defaultMemoize */ "../node_modules/reselect/es/defaultMemoize.js");
10650 +
10651 +
10652 +
10653 +function getDependencies(funcs) {
10654 + var dependencies = Array.isArray(funcs[0]) ? funcs[0] : funcs;
10655 +
10656 + if (!dependencies.every(function (dep) {
10657 + return typeof dep === 'function';
10658 + })) {
10659 + var dependencyTypes = dependencies.map(function (dep) {
10660 + return typeof dep === 'function' ? "function " + (dep.name || 'unnamed') + "()" : typeof dep;
10661 + }).join(', ');
10662 + throw new Error("createSelector expects all input-selectors to be functions, but received the following types: [" + dependencyTypes + "]");
10663 + }
10664 +
10665 + return dependencies;
10666 +}
10667 +
10668 +function createSelectorCreator(memoize) {
10669 + for (var _len = arguments.length, memoizeOptionsFromArgs = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
10670 + memoizeOptionsFromArgs[_key - 1] = arguments[_key];
10671 + }
10672 +
10673 + var createSelector = function createSelector() {
10674 + for (var _len2 = arguments.length, funcs = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
10675 + funcs[_key2] = arguments[_key2];
10676 + }
10677 +
10678 + var _recomputations = 0;
10679 +
10680 + var _lastResult; // Due to the intricacies of rest params, we can't do an optional arg after `...funcs`.
10681 + // So, start by declaring the default value here.
10682 + // (And yes, the words 'memoize' and 'options' appear too many times in this next sequence.)
10683 +
10684 +
10685 + var directlyPassedOptions = {
10686 + memoizeOptions: undefined
10687 + }; // Normally, the result func or "output selector" is the last arg
10688 +
10689 + var resultFunc = funcs.pop(); // If the result func is actually an _object_, assume it's our options object
10690 +
10691 + if (typeof resultFunc === 'object') {
10692 + directlyPassedOptions = resultFunc; // and pop the real result func off
10693 +
10694 + resultFunc = funcs.pop();
10695 + }
10696 +
10697 + if (typeof resultFunc !== 'function') {
10698 + throw new Error("createSelector expects an output function after the inputs, but received: [" + typeof resultFunc + "]");
10699 + } // Determine which set of options we're using. Prefer options passed directly,
10700 + // but fall back to options given to createSelectorCreator.
10701 +
10702 +
10703 + var _directlyPassedOption = directlyPassedOptions,
10704 + _directlyPassedOption2 = _directlyPassedOption.memoizeOptions,
10705 + memoizeOptions = _directlyPassedOption2 === void 0 ? memoizeOptionsFromArgs : _directlyPassedOption2; // Simplifying assumption: it's unlikely that the first options arg of the provided memoizer
10706 + // is an array. In most libs I've looked at, it's an equality function or options object.
10707 + // Based on that, if `memoizeOptions` _is_ an array, we assume it's a full
10708 + // user-provided array of options. Otherwise, it must be just the _first_ arg, and so
10709 + // we wrap it in an array so we can apply it.
10710 +
10711 + var finalMemoizeOptions = Array.isArray(memoizeOptions) ? memoizeOptions : [memoizeOptions];
10712 + var dependencies = getDependencies(funcs);
10713 + var memoizedResultFunc = memoize.apply(void 0, [function recomputationWrapper() {
10714 + _recomputations++; // apply arguments instead of spreading for performance.
10715 +
10716 + return resultFunc.apply(null, arguments);
10717 + }].concat(finalMemoizeOptions)); // If a selector is called with the exact same arguments we don't need to traverse our dependencies again.
10718 +
10719 + var selector = memoize(function dependenciesChecker() {
10720 + var params = [];
10721 + var length = dependencies.length;
10722 +
10723 + for (var i = 0; i < length; i++) {
10724 + // apply arguments instead of spreading and mutate a local list of params for performance.
10725 + // @ts-ignore
10726 + params.push(dependencies[i].apply(null, arguments));
10727 + } // apply arguments instead of spreading for performance.
10728 +
10729 +
10730 + _lastResult = memoizedResultFunc.apply(null, params);
10731 + return _lastResult;
10732 + });
10733 + Object.assign(selector, {
10734 + resultFunc: resultFunc,
10735 + memoizedResultFunc: memoizedResultFunc,
10736 + dependencies: dependencies,
10737 + lastResult: function lastResult() {
10738 + return _lastResult;
10739 + },
10740 + recomputations: function recomputations() {
10741 + return _recomputations;
10742 + },
10743 + resetRecomputations: function resetRecomputations() {
10744 + return _recomputations = 0;
10745 + }
10746 + });
10747 + return selector;
10748 + }; // @ts-ignore
10749 +
10750 +
10751 + return createSelector;
10752 +}
10753 +var createSelector = /* #__PURE__ */createSelectorCreator(_defaultMemoize__WEBPACK_IMPORTED_MODULE_0__.defaultMemoize);
10754 +// Manual definition of state and output arguments
10755 +var createStructuredSelector = function createStructuredSelector(selectors, selectorCreator) {
10756 + if (selectorCreator === void 0) {
10757 + selectorCreator = createSelector;
10758 + }
10759 +
10760 + if (typeof selectors !== 'object') {
10761 + throw new Error('createStructuredSelector expects first argument to be an object ' + ("where each property is a selector, instead received a " + typeof selectors));
10762 + }
10763 +
10764 + var objectKeys = Object.keys(selectors);
10765 + var resultSelector = selectorCreator( // @ts-ignore
10766 + objectKeys.map(function (key) {
10767 + return selectors[key];
10768 + }), function () {
10769 + for (var _len3 = arguments.length, values = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
10770 + values[_key3] = arguments[_key3];
10771 + }
10772 +
10773 + return values.reduce(function (composition, value, index) {
10774 + composition[objectKeys[index]] = value;
10775 + return composition;
10776 + }, {});
10777 + });
10778 + return resultSelector;
10779 +};
10780 +
10781 +/***/ }),
10782 +
10783 +/***/ "../node_modules/@babel/runtime/helpers/arrayLikeToArray.js":
10784 +/*!******************************************************************!*\
10785 + !*** ../node_modules/@babel/runtime/helpers/arrayLikeToArray.js ***!
10786 + \******************************************************************/
10787 +/***/ ((module) => {
10788 +
10789 +function _arrayLikeToArray(arr, len) {
10790 + if (len == null || len > arr.length) len = arr.length;
10791 + for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
10792 + return arr2;
10793 +}
10794 +module.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
10795 +
10796 +/***/ }),
10797 +
10798 +/***/ "../node_modules/@babel/runtime/helpers/arrayWithHoles.js":
10799 +/*!****************************************************************!*\
10800 + !*** ../node_modules/@babel/runtime/helpers/arrayWithHoles.js ***!
10801 + \****************************************************************/
10802 +/***/ ((module) => {
10803 +
10804 +function _arrayWithHoles(arr) {
10805 + if (Array.isArray(arr)) return arr;
10806 +}
10807 +module.exports = _arrayWithHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
10808 +
10809 +/***/ }),
10810 +
10811 +/***/ "../node_modules/@babel/runtime/helpers/assertThisInitialized.js":
10812 +/*!***********************************************************************!*\
10813 + !*** ../node_modules/@babel/runtime/helpers/assertThisInitialized.js ***!
10814 + \***********************************************************************/
10815 +/***/ ((module) => {
10816 +
10817 +function _assertThisInitialized(self) {
10818 + if (self === void 0) {
10819 + throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
10820 + }
10821 + return self;
10822 +}
10823 +module.exports = _assertThisInitialized, module.exports.__esModule = true, module.exports["default"] = module.exports;
10824 +
10825 +/***/ }),
10826 +
10827 +/***/ "../node_modules/@babel/runtime/helpers/asyncToGenerator.js":
10828 +/*!******************************************************************!*\
10829 + !*** ../node_modules/@babel/runtime/helpers/asyncToGenerator.js ***!
10830 + \******************************************************************/
10831 +/***/ ((module) => {
10832 +
10833 +function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
10834 + try {
10835 + var info = gen[key](arg);
10836 + var value = info.value;
10837 + } catch (error) {
10838 + reject(error);
10839 + return;
10840 + }
10841 + if (info.done) {
10842 + resolve(value);
10843 + } else {
10844 + Promise.resolve(value).then(_next, _throw);
10845 + }
10846 +}
10847 +function _asyncToGenerator(fn) {
10848 + return function () {
10849 + var self = this,
10850 + args = arguments;
10851 + return new Promise(function (resolve, reject) {
10852 + var gen = fn.apply(self, args);
10853 + function _next(value) {
10854 + asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
10855 + }
10856 + function _throw(err) {
10857 + asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
10858 + }
10859 + _next(undefined);
10860 + });
10861 + };
10862 +}
10863 +module.exports = _asyncToGenerator, module.exports.__esModule = true, module.exports["default"] = module.exports;
10864 +
10865 +/***/ }),
10866 +
10867 +/***/ "../node_modules/@babel/runtime/helpers/classCallCheck.js":
10868 +/*!****************************************************************!*\
10869 + !*** ../node_modules/@babel/runtime/helpers/classCallCheck.js ***!
10870 + \****************************************************************/
10871 +/***/ ((module) => {
10872 +
10873 +function _classCallCheck(instance, Constructor) {
10874 + if (!(instance instanceof Constructor)) {
10875 + throw new TypeError("Cannot call a class as a function");
10876 + }
10877 +}
10878 +module.exports = _classCallCheck, module.exports.__esModule = true, module.exports["default"] = module.exports;
10879 +
10880 +/***/ }),
10881 +
10882 +/***/ "../node_modules/@babel/runtime/helpers/construct.js":
10883 +/*!***********************************************************!*\
10884 + !*** ../node_modules/@babel/runtime/helpers/construct.js ***!
10885 + \***********************************************************/
10886 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
10887 +
10888 +var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ "../node_modules/@babel/runtime/helpers/setPrototypeOf.js");
10889 +var isNativeReflectConstruct = __webpack_require__(/*! ./isNativeReflectConstruct.js */ "../node_modules/@babel/runtime/helpers/isNativeReflectConstruct.js");
10890 +function _construct(Parent, args, Class) {
10891 + if (isNativeReflectConstruct()) {
10892 + module.exports = _construct = Reflect.construct.bind(), module.exports.__esModule = true, module.exports["default"] = module.exports;
10893 + } else {
10894 + module.exports = _construct = function _construct(Parent, args, Class) {
10895 + var a = [null];
10896 + a.push.apply(a, args);
10897 + var Constructor = Function.bind.apply(Parent, a);
10898 + var instance = new Constructor();
10899 + if (Class) setPrototypeOf(instance, Class.prototype);
10900 + return instance;
10901 + }, module.exports.__esModule = true, module.exports["default"] = module.exports;
10902 + }
10903 + return _construct.apply(null, arguments);
10904 +}
10905 +module.exports = _construct, module.exports.__esModule = true, module.exports["default"] = module.exports;
10906 +
10907 +/***/ }),
10908 +
10909 +/***/ "../node_modules/@babel/runtime/helpers/createClass.js":
10910 +/*!*************************************************************!*\
10911 + !*** ../node_modules/@babel/runtime/helpers/createClass.js ***!
10912 + \*************************************************************/
10913 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
10914 +
10915 +var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ "../node_modules/@babel/runtime/helpers/toPropertyKey.js");
10916 +function _defineProperties(target, props) {
10917 + for (var i = 0; i < props.length; i++) {
10918 + var descriptor = props[i];
10919 + descriptor.enumerable = descriptor.enumerable || false;
10920 + descriptor.configurable = true;
10921 + if ("value" in descriptor) descriptor.writable = true;
10922 + Object.defineProperty(target, toPropertyKey(descriptor.key), descriptor);
10923 + }
10924 +}
10925 +function _createClass(Constructor, protoProps, staticProps) {
10926 + if (protoProps) _defineProperties(Constructor.prototype, protoProps);
10927 + if (staticProps) _defineProperties(Constructor, staticProps);
10928 + Object.defineProperty(Constructor, "prototype", {
10929 + writable: false
10930 + });
10931 + return Constructor;
10932 +}
10933 +module.exports = _createClass, module.exports.__esModule = true, module.exports["default"] = module.exports;
10934 +
10935 +/***/ }),
10936 +
10937 +/***/ "../node_modules/@babel/runtime/helpers/defineProperty.js":
10938 +/*!****************************************************************!*\
10939 + !*** ../node_modules/@babel/runtime/helpers/defineProperty.js ***!
10940 + \****************************************************************/
10941 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
10942 +
10943 +var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ "../node_modules/@babel/runtime/helpers/toPropertyKey.js");
10944 +function _defineProperty(obj, key, value) {
10945 + key = toPropertyKey(key);
10946 + if (key in obj) {
10947 + Object.defineProperty(obj, key, {
10948 + value: value,
10949 + enumerable: true,
10950 + configurable: true,
10951 + writable: true
10952 + });
10953 + } else {
10954 + obj[key] = value;
10955 + }
10956 + return obj;
10957 +}
10958 +module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports;
10959 +
10960 +/***/ }),
10961 +
10962 +/***/ "../node_modules/@babel/runtime/helpers/get.js":
10963 +/*!*****************************************************!*\
10964 + !*** ../node_modules/@babel/runtime/helpers/get.js ***!
10965 + \*****************************************************/
10966 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
10967 +
10968 +var superPropBase = __webpack_require__(/*! ./superPropBase.js */ "../node_modules/@babel/runtime/helpers/superPropBase.js");
10969 +function _get() {
10970 + if (typeof Reflect !== "undefined" && Reflect.get) {
10971 + module.exports = _get = Reflect.get.bind(), module.exports.__esModule = true, module.exports["default"] = module.exports;
10972 + } else {
10973 + module.exports = _get = function _get(target, property, receiver) {
10974 + var base = superPropBase(target, property);
10975 + if (!base) return;
10976 + var desc = Object.getOwnPropertyDescriptor(base, property);
10977 + if (desc.get) {
10978 + return desc.get.call(arguments.length < 3 ? target : receiver);
10979 + }
10980 + return desc.value;
10981 + }, module.exports.__esModule = true, module.exports["default"] = module.exports;
10982 + }
10983 + return _get.apply(this, arguments);
10984 +}
10985 +module.exports = _get, module.exports.__esModule = true, module.exports["default"] = module.exports;
10986 +
10987 +/***/ }),
10988 +
10989 +/***/ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js":
10990 +/*!****************************************************************!*\
10991 + !*** ../node_modules/@babel/runtime/helpers/getPrototypeOf.js ***!
10992 + \****************************************************************/
10993 +/***/ ((module) => {
10994 +
10995 +function _getPrototypeOf(o) {
10996 + module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
10997 + return o.__proto__ || Object.getPrototypeOf(o);
10998 + }, module.exports.__esModule = true, module.exports["default"] = module.exports;
10999 + return _getPrototypeOf(o);
11000 +}
11001 +module.exports = _getPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
11002 +
11003 +/***/ }),
11004 +
11005 +/***/ "../node_modules/@babel/runtime/helpers/inherits.js":
11006 +/*!**********************************************************!*\
11007 + !*** ../node_modules/@babel/runtime/helpers/inherits.js ***!
11008 + \**********************************************************/
11009 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
11010 +
11011 +var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ "../node_modules/@babel/runtime/helpers/setPrototypeOf.js");
11012 +function _inherits(subClass, superClass) {
11013 + if (typeof superClass !== "function" && superClass !== null) {
11014 + throw new TypeError("Super expression must either be null or a function");
11015 + }
11016 + subClass.prototype = Object.create(superClass && superClass.prototype, {
11017 + constructor: {
11018 + value: subClass,
11019 + writable: true,
11020 + configurable: true
11021 + }
11022 + });
11023 + Object.defineProperty(subClass, "prototype", {
11024 + writable: false
11025 + });
11026 + if (superClass) setPrototypeOf(subClass, superClass);
11027 +}
11028 +module.exports = _inherits, module.exports.__esModule = true, module.exports["default"] = module.exports;
11029 +
11030 +/***/ }),
11031 +
11032 +/***/ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js":
11033 +/*!***********************************************************************!*\
11034 + !*** ../node_modules/@babel/runtime/helpers/interopRequireDefault.js ***!
11035 + \***********************************************************************/
11036 +/***/ ((module) => {
11037 +
11038 +function _interopRequireDefault(obj) {
11039 + return obj && obj.__esModule ? obj : {
11040 + "default": obj
11041 + };
11042 +}
11043 +module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
11044 +
11045 +/***/ }),
11046 +
11047 +/***/ "../node_modules/@babel/runtime/helpers/isNativeFunction.js":
11048 +/*!******************************************************************!*\
11049 + !*** ../node_modules/@babel/runtime/helpers/isNativeFunction.js ***!
11050 + \******************************************************************/
11051 +/***/ ((module) => {
11052 +
11053 +function _isNativeFunction(fn) {
11054 + return Function.toString.call(fn).indexOf("[native code]") !== -1;
11055 +}
11056 +module.exports = _isNativeFunction, module.exports.__esModule = true, module.exports["default"] = module.exports;
11057 +
11058 +/***/ }),
11059 +
11060 +/***/ "../node_modules/@babel/runtime/helpers/isNativeReflectConstruct.js":
11061 +/*!**************************************************************************!*\
11062 + !*** ../node_modules/@babel/runtime/helpers/isNativeReflectConstruct.js ***!
11063 + \**************************************************************************/
11064 +/***/ ((module) => {
11065 +
11066 +function _isNativeReflectConstruct() {
11067 + if (typeof Reflect === "undefined" || !Reflect.construct) return false;
11068 + if (Reflect.construct.sham) return false;
11069 + if (typeof Proxy === "function") return true;
11070 + try {
11071 + Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
11072 + return true;
11073 + } catch (e) {
11074 + return false;
11075 + }
11076 +}
11077 +module.exports = _isNativeReflectConstruct, module.exports.__esModule = true, module.exports["default"] = module.exports;
11078 +
11079 +/***/ }),
11080 +
11081 +/***/ "../node_modules/@babel/runtime/helpers/iterableToArrayLimit.js":
11082 +/*!**********************************************************************!*\
11083 + !*** ../node_modules/@babel/runtime/helpers/iterableToArrayLimit.js ***!
11084 + \**********************************************************************/
11085 +/***/ ((module) => {
11086 +
11087 +function _iterableToArrayLimit(arr, i) {
11088 + var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"];
11089 + if (null != _i) {
11090 + var _s,
11091 + _e,
11092 + _x,
11093 + _r,
11094 + _arr = [],
11095 + _n = !0,
11096 + _d = !1;
11097 + try {
11098 + if (_x = (_i = _i.call(arr)).next, 0 === i) {
11099 + if (Object(_i) !== _i) return;
11100 + _n = !1;
11101 + } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0);
11102 + } catch (err) {
11103 + _d = !0, _e = err;
11104 + } finally {
11105 + try {
11106 + if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return;
11107 + } finally {
11108 + if (_d) throw _e;
11109 + }
11110 + }
11111 + return _arr;
11112 + }
11113 +}
11114 +module.exports = _iterableToArrayLimit, module.exports.__esModule = true, module.exports["default"] = module.exports;
11115 +
11116 +/***/ }),
11117 +
11118 +/***/ "../node_modules/@babel/runtime/helpers/nonIterableRest.js":
11119 +/*!*****************************************************************!*\
11120 + !*** ../node_modules/@babel/runtime/helpers/nonIterableRest.js ***!
11121 + \*****************************************************************/
11122 +/***/ ((module) => {
11123 +
11124 +function _nonIterableRest() {
11125 + throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
11126 +}
11127 +module.exports = _nonIterableRest, module.exports.__esModule = true, module.exports["default"] = module.exports;
11128 +
11129 +/***/ }),
11130 +
11131 +/***/ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js":
11132 +/*!***************************************************************************!*\
11133 + !*** ../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js ***!
11134 + \***************************************************************************/
11135 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
11136 +
11137 +var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]);
11138 +var assertThisInitialized = __webpack_require__(/*! ./assertThisInitialized.js */ "../node_modules/@babel/runtime/helpers/assertThisInitialized.js");
11139 +function _possibleConstructorReturn(self, call) {
11140 + if (call && (_typeof(call) === "object" || typeof call === "function")) {
11141 + return call;
11142 + } else if (call !== void 0) {
11143 + throw new TypeError("Derived constructors may only return object or undefined");
11144 + }
11145 + return assertThisInitialized(self);
11146 +}
11147 +module.exports = _possibleConstructorReturn, module.exports.__esModule = true, module.exports["default"] = module.exports;
11148 +
11149 +/***/ }),
11150 +
11151 +/***/ "../node_modules/@babel/runtime/helpers/regeneratorRuntime.js":
11152 +/*!********************************************************************!*\
11153 + !*** ../node_modules/@babel/runtime/helpers/regeneratorRuntime.js ***!
11154 + \********************************************************************/
11155 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
11156 +
11157 +var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]);
11158 +function _regeneratorRuntime() {
11159 + "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
11160 + module.exports = _regeneratorRuntime = function _regeneratorRuntime() {
11161 + return exports;
11162 + }, module.exports.__esModule = true, module.exports["default"] = module.exports;
11163 + var exports = {},
11164 + Op = Object.prototype,
11165 + hasOwn = Op.hasOwnProperty,
11166 + defineProperty = Object.defineProperty || function (obj, key, desc) {
11167 + obj[key] = desc.value;
11168 + },
11169 + $Symbol = "function" == typeof Symbol ? Symbol : {},
11170 + iteratorSymbol = $Symbol.iterator || "@@iterator",
11171 + asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator",
11172 + toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
11173 + function define(obj, key, value) {
11174 + return Object.defineProperty(obj, key, {
11175 + value: value,
11176 + enumerable: !0,
11177 + configurable: !0,
11178 + writable: !0
11179 + }), obj[key];
11180 + }
11181 + try {
11182 + define({}, "");
11183 + } catch (err) {
11184 + define = function define(obj, key, value) {
11185 + return obj[key] = value;
11186 + };
11187 + }
11188 + function wrap(innerFn, outerFn, self, tryLocsList) {
11189 + var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,
11190 + generator = Object.create(protoGenerator.prototype),
11191 + context = new Context(tryLocsList || []);
11192 + return defineProperty(generator, "_invoke", {
11193 + value: makeInvokeMethod(innerFn, self, context)
11194 + }), generator;
11195 + }
11196 + function tryCatch(fn, obj, arg) {
11197 + try {
11198 + return {
11199 + type: "normal",
11200 + arg: fn.call(obj, arg)
11201 + };
11202 + } catch (err) {
11203 + return {
11204 + type: "throw",
11205 + arg: err
11206 + };
11207 + }
11208 + }
11209 + exports.wrap = wrap;
11210 + var ContinueSentinel = {};
11211 + function Generator() {}
11212 + function GeneratorFunction() {}
11213 + function GeneratorFunctionPrototype() {}
11214 + var IteratorPrototype = {};
11215 + define(IteratorPrototype, iteratorSymbol, function () {
11216 + return this;
11217 + });
11218 + var getProto = Object.getPrototypeOf,
11219 + NativeIteratorPrototype = getProto && getProto(getProto(values([])));
11220 + NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);
11221 + var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);
11222 + function defineIteratorMethods(prototype) {
11223 + ["next", "throw", "return"].forEach(function (method) {
11224 + define(prototype, method, function (arg) {
11225 + return this._invoke(method, arg);
11226 + });
11227 + });
11228 + }
11229 + function AsyncIterator(generator, PromiseImpl) {
11230 + function invoke(method, arg, resolve, reject) {
11231 + var record = tryCatch(generator[method], generator, arg);
11232 + if ("throw" !== record.type) {
11233 + var result = record.arg,
11234 + value = result.value;
11235 + return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) {
11236 + invoke("next", value, resolve, reject);
11237 + }, function (err) {
11238 + invoke("throw", err, resolve, reject);
11239 + }) : PromiseImpl.resolve(value).then(function (unwrapped) {
11240 + result.value = unwrapped, resolve(result);
11241 + }, function (error) {
11242 + return invoke("throw", error, resolve, reject);
11243 + });
11244 + }
11245 + reject(record.arg);
11246 + }
11247 + var previousPromise;
11248 + defineProperty(this, "_invoke", {
11249 + value: function value(method, arg) {
11250 + function callInvokeWithMethodAndArg() {
11251 + return new PromiseImpl(function (resolve, reject) {
11252 + invoke(method, arg, resolve, reject);
11253 + });
11254 + }
11255 + return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();
11256 + }
11257 + });
11258 + }
11259 + function makeInvokeMethod(innerFn, self, context) {
11260 + var state = "suspendedStart";
11261 + return function (method, arg) {
11262 + if ("executing" === state) throw new Error("Generator is already running");
11263 + if ("completed" === state) {
11264 + if ("throw" === method) throw arg;
11265 + return doneResult();
11266 + }
11267 + for (context.method = method, context.arg = arg;;) {
11268 + var delegate = context.delegate;
11269 + if (delegate) {
11270 + var delegateResult = maybeInvokeDelegate(delegate, context);
11271 + if (delegateResult) {
11272 + if (delegateResult === ContinueSentinel) continue;
11273 + return delegateResult;
11274 + }
11275 + }
11276 + if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) {
11277 + if ("suspendedStart" === state) throw state = "completed", context.arg;
11278 + context.dispatchException(context.arg);
11279 + } else "return" === context.method && context.abrupt("return", context.arg);
11280 + state = "executing";
11281 + var record = tryCatch(innerFn, self, context);
11282 + if ("normal" === record.type) {
11283 + if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue;
11284 + return {
11285 + value: record.arg,
11286 + done: context.done
11287 + };
11288 + }
11289 + "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg);
11290 + }
11291 + };
11292 + }
11293 + function maybeInvokeDelegate(delegate, context) {
11294 + var methodName = context.method,
11295 + method = delegate.iterator[methodName];
11296 + if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel;
11297 + var record = tryCatch(method, delegate.iterator, context.arg);
11298 + if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel;
11299 + var info = record.arg;
11300 + 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);
11301 + }
11302 + function pushTryEntry(locs) {
11303 + var entry = {
11304 + tryLoc: locs[0]
11305 + };
11306 + 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);
11307 + }
11308 + function resetTryEntry(entry) {
11309 + var record = entry.completion || {};
11310 + record.type = "normal", delete record.arg, entry.completion = record;
11311 + }
11312 + function Context(tryLocsList) {
11313 + this.tryEntries = [{
11314 + tryLoc: "root"
11315 + }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);
11316 + }
11317 + function values(iterable) {
11318 + if (iterable) {
11319 + var iteratorMethod = iterable[iteratorSymbol];
11320 + if (iteratorMethod) return iteratorMethod.call(iterable);
11321 + if ("function" == typeof iterable.next) return iterable;
11322 + if (!isNaN(iterable.length)) {
11323 + var i = -1,
11324 + next = function next() {
11325 + for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;
11326 + return next.value = undefined, next.done = !0, next;
11327 + };
11328 + return next.next = next;
11329 + }
11330 + }
11331 + return {
11332 + next: doneResult
11333 + };
11334 + }
11335 + function doneResult() {
11336 + return {
11337 + value: undefined,
11338 + done: !0
11339 + };
11340 + }
11341 + return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", {
11342 + value: GeneratorFunctionPrototype,
11343 + configurable: !0
11344 + }), defineProperty(GeneratorFunctionPrototype, "constructor", {
11345 + value: GeneratorFunction,
11346 + configurable: !0
11347 + }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) {
11348 + var ctor = "function" == typeof genFun && genFun.constructor;
11349 + return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name));
11350 + }, exports.mark = function (genFun) {
11351 + return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun;
11352 + }, exports.awrap = function (arg) {
11353 + return {
11354 + __await: arg
11355 + };
11356 + }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
11357 + return this;
11358 + }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {
11359 + void 0 === PromiseImpl && (PromiseImpl = Promise);
11360 + var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);
11361 + return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {
11362 + return result.done ? result.value : iter.next();
11363 + });
11364 + }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () {
11365 + return this;
11366 + }), define(Gp, "toString", function () {
11367 + return "[object Generator]";
11368 + }), exports.keys = function (val) {
11369 + var object = Object(val),
11370 + keys = [];
11371 + for (var key in object) keys.push(key);
11372 + return keys.reverse(), function next() {
11373 + for (; keys.length;) {
11374 + var key = keys.pop();
11375 + if (key in object) return next.value = key, next.done = !1, next;
11376 + }
11377 + return next.done = !0, next;
11378 + };
11379 + }, exports.values = values, Context.prototype = {
11380 + constructor: Context,
11381 + reset: function reset(skipTempReset) {
11382 + 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) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);
11383 + },
11384 + stop: function stop() {
11385 + this.done = !0;
11386 + var rootRecord = this.tryEntries[0].completion;
11387 + if ("throw" === rootRecord.type) throw rootRecord.arg;
11388 + return this.rval;
11389 + },
11390 + dispatchException: function dispatchException(exception) {
11391 + if (this.done) throw exception;
11392 + var context = this;
11393 + function handle(loc, caught) {
11394 + return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught;
11395 + }
11396 + for (var i = this.tryEntries.length - 1; i >= 0; --i) {
11397 + var entry = this.tryEntries[i],
11398 + record = entry.completion;
11399 + if ("root" === entry.tryLoc) return handle("end");
11400 + if (entry.tryLoc <= this.prev) {
11401 + var hasCatch = hasOwn.call(entry, "catchLoc"),
11402 + hasFinally = hasOwn.call(entry, "finallyLoc");
11403 + if (hasCatch && hasFinally) {
11404 + if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
11405 + if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
11406 + } else if (hasCatch) {
11407 + if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);
11408 + } else {
11409 + if (!hasFinally) throw new Error("try statement without catch or finally");
11410 + if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);
11411 + }
11412 + }
11413 + }
11414 + },
11415 + abrupt: function abrupt(type, arg) {
11416 + for (var i = this.tryEntries.length - 1; i >= 0; --i) {
11417 + var entry = this.tryEntries[i];
11418 + if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) {
11419 + var finallyEntry = entry;
11420 + break;
11421 + }
11422 + }
11423 + finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);
11424 + var record = finallyEntry ? finallyEntry.completion : {};
11425 + return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);
11426 + },
11427 + complete: function complete(record, afterLoc) {
11428 + if ("throw" === record.type) throw record.arg;
11429 + 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;
11430 + },
11431 + finish: function finish(finallyLoc) {
11432 + for (var i = this.tryEntries.length - 1; i >= 0; --i) {
11433 + var entry = this.tryEntries[i];
11434 + if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;
11435 + }
11436 + },
11437 + "catch": function _catch(tryLoc) {
11438 + for (var i = this.tryEntries.length - 1; i >= 0; --i) {
11439 + var entry = this.tryEntries[i];
11440 + if (entry.tryLoc === tryLoc) {
11441 + var record = entry.completion;
11442 + if ("throw" === record.type) {
11443 + var thrown = record.arg;
11444 + resetTryEntry(entry);
11445 + }
11446 + return thrown;
11447 + }
11448 + }
11449 + throw new Error("illegal catch attempt");
11450 + },
11451 + delegateYield: function delegateYield(iterable, resultName, nextLoc) {
11452 + return this.delegate = {
11453 + iterator: values(iterable),
11454 + resultName: resultName,
11455 + nextLoc: nextLoc
11456 + }, "next" === this.method && (this.arg = undefined), ContinueSentinel;
11457 + }
11458 + }, exports;
11459 +}
11460 +module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;
11461 +
11462 +/***/ }),
11463 +
11464 +/***/ "../node_modules/@babel/runtime/helpers/setPrototypeOf.js":
11465 +/*!****************************************************************!*\
11466 + !*** ../node_modules/@babel/runtime/helpers/setPrototypeOf.js ***!
11467 + \****************************************************************/
11468 +/***/ ((module) => {
11469 +
11470 +function _setPrototypeOf(o, p) {
11471 + module.exports = _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
11472 + o.__proto__ = p;
11473 + return o;
11474 + }, module.exports.__esModule = true, module.exports["default"] = module.exports;
11475 + return _setPrototypeOf(o, p);
11476 +}
11477 +module.exports = _setPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
11478 +
11479 +/***/ }),
11480 +
11481 +/***/ "../node_modules/@babel/runtime/helpers/slicedToArray.js":
11482 +/*!***************************************************************!*\
11483 + !*** ../node_modules/@babel/runtime/helpers/slicedToArray.js ***!
11484 + \***************************************************************/
11485 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
11486 +
11487 +var arrayWithHoles = __webpack_require__(/*! ./arrayWithHoles.js */ "../node_modules/@babel/runtime/helpers/arrayWithHoles.js");
11488 +var iterableToArrayLimit = __webpack_require__(/*! ./iterableToArrayLimit.js */ "../node_modules/@babel/runtime/helpers/iterableToArrayLimit.js");
11489 +var unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray.js */ "../node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js");
11490 +var nonIterableRest = __webpack_require__(/*! ./nonIterableRest.js */ "../node_modules/@babel/runtime/helpers/nonIterableRest.js");
11491 +function _slicedToArray(arr, i) {
11492 + return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();
11493 +}
11494 +module.exports = _slicedToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
11495 +
11496 +/***/ }),
11497 +
11498 +/***/ "../node_modules/@babel/runtime/helpers/superPropBase.js":
11499 +/*!***************************************************************!*\
11500 + !*** ../node_modules/@babel/runtime/helpers/superPropBase.js ***!
11501 + \***************************************************************/
11502 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
11503 +
11504 +var getPrototypeOf = __webpack_require__(/*! ./getPrototypeOf.js */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js");
11505 +function _superPropBase(object, property) {
11506 + while (!Object.prototype.hasOwnProperty.call(object, property)) {
11507 + object = getPrototypeOf(object);
11508 + if (object === null) break;
11509 + }
11510 + return object;
11511 +}
11512 +module.exports = _superPropBase, module.exports.__esModule = true, module.exports["default"] = module.exports;
11513 +
11514 +/***/ }),
11515 +
11516 +/***/ "../node_modules/@babel/runtime/helpers/toPrimitive.js":
11517 +/*!*************************************************************!*\
11518 + !*** ../node_modules/@babel/runtime/helpers/toPrimitive.js ***!
11519 + \*************************************************************/
11520 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
11521 +
11522 +var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]);
11523 +function _toPrimitive(input, hint) {
11524 + if (_typeof(input) !== "object" || input === null) return input;
11525 + var prim = input[Symbol.toPrimitive];
11526 + if (prim !== undefined) {
11527 + var res = prim.call(input, hint || "default");
11528 + if (_typeof(res) !== "object") return res;
11529 + throw new TypeError("@@toPrimitive must return a primitive value.");
11530 + }
11531 + return (hint === "string" ? String : Number)(input);
11532 +}
11533 +module.exports = _toPrimitive, module.exports.__esModule = true, module.exports["default"] = module.exports;
11534 +
11535 +/***/ }),
11536 +
11537 +/***/ "../node_modules/@babel/runtime/helpers/toPropertyKey.js":
11538 +/*!***************************************************************!*\
11539 + !*** ../node_modules/@babel/runtime/helpers/toPropertyKey.js ***!
11540 + \***************************************************************/
11541 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
11542 +
11543 +var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]);
11544 +var toPrimitive = __webpack_require__(/*! ./toPrimitive.js */ "../node_modules/@babel/runtime/helpers/toPrimitive.js");
11545 +function _toPropertyKey(arg) {
11546 + var key = toPrimitive(arg, "string");
11547 + return _typeof(key) === "symbol" ? key : String(key);
11548 +}
11549 +module.exports = _toPropertyKey, module.exports.__esModule = true, module.exports["default"] = module.exports;
11550 +
11551 +/***/ }),
11552 +
11553 +/***/ "../node_modules/@babel/runtime/helpers/typeof.js":
11554 +/*!********************************************************!*\
11555 + !*** ../node_modules/@babel/runtime/helpers/typeof.js ***!
11556 + \********************************************************/
11557 +/***/ ((module) => {
11558 +
11559 +function _typeof(obj) {
11560 + "@babel/helpers - typeof";
11561 +
11562 + return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
11563 + return typeof obj;
11564 + } : function (obj) {
11565 + return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
11566 + }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(obj);
11567 +}
11568 +module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
11569 +
11570 +/***/ }),
11571 +
11572 +/***/ "../node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js":
11573 +/*!****************************************************************************!*\
11574 + !*** ../node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js ***!
11575 + \****************************************************************************/
11576 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
11577 +
11578 +var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray.js */ "../node_modules/@babel/runtime/helpers/arrayLikeToArray.js");
11579 +function _unsupportedIterableToArray(o, minLen) {
11580 + if (!o) return;
11581 + if (typeof o === "string") return arrayLikeToArray(o, minLen);
11582 + var n = Object.prototype.toString.call(o).slice(8, -1);
11583 + if (n === "Object" && o.constructor) n = o.constructor.name;
11584 + if (n === "Map" || n === "Set") return Array.from(o);
11585 + if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);
11586 +}
11587 +module.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
11588 +
11589 +/***/ }),
11590 +
11591 +/***/ "../node_modules/@babel/runtime/helpers/wrapNativeSuper.js":
11592 +/*!*****************************************************************!*\
11593 + !*** ../node_modules/@babel/runtime/helpers/wrapNativeSuper.js ***!
11594 + \*****************************************************************/
11595 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
11596 +
11597 +var getPrototypeOf = __webpack_require__(/*! ./getPrototypeOf.js */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js");
11598 +var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ "../node_modules/@babel/runtime/helpers/setPrototypeOf.js");
11599 +var isNativeFunction = __webpack_require__(/*! ./isNativeFunction.js */ "../node_modules/@babel/runtime/helpers/isNativeFunction.js");
11600 +var construct = __webpack_require__(/*! ./construct.js */ "../node_modules/@babel/runtime/helpers/construct.js");
11601 +function _wrapNativeSuper(Class) {
11602 + var _cache = typeof Map === "function" ? new Map() : undefined;
11603 + module.exports = _wrapNativeSuper = function _wrapNativeSuper(Class) {
11604 + if (Class === null || !isNativeFunction(Class)) return Class;
11605 + if (typeof Class !== "function") {
11606 + throw new TypeError("Super expression must either be null or a function");
11607 + }
11608 + if (typeof _cache !== "undefined") {
11609 + if (_cache.has(Class)) return _cache.get(Class);
11610 + _cache.set(Class, Wrapper);
11611 + }
11612 + function Wrapper() {
11613 + return construct(Class, arguments, getPrototypeOf(this).constructor);
11614 + }
11615 + Wrapper.prototype = Object.create(Class.prototype, {
11616 + constructor: {
11617 + value: Wrapper,
11618 + enumerable: false,
11619 + writable: true,
11620 + configurable: true
11621 + }
11622 + });
11623 + return setPrototypeOf(Wrapper, Class);
11624 + }, module.exports.__esModule = true, module.exports["default"] = module.exports;
11625 + return _wrapNativeSuper(Class);
11626 +}
11627 +module.exports = _wrapNativeSuper, module.exports.__esModule = true, module.exports["default"] = module.exports;
11628 +
11629 +/***/ }),
11630 +
11631 +/***/ "../node_modules/@babel/runtime/regenerator/index.js":
11632 +/*!***********************************************************!*\
11633 + !*** ../node_modules/@babel/runtime/regenerator/index.js ***!
11634 + \***********************************************************/
11635 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
11636 +
11637 +// TODO(Babel 8): Remove this file.
11638 +
11639 +var runtime = __webpack_require__(/*! ../helpers/regeneratorRuntime */ "../node_modules/@babel/runtime/helpers/regeneratorRuntime.js")();
11640 +module.exports = runtime;
11641 +
11642 +// Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736=
11643 +try {
11644 + regeneratorRuntime = runtime;
11645 +} catch (accidentalStrictMode) {
11646 + if (typeof globalThis === "object") {
11647 + globalThis.regeneratorRuntime = runtime;
11648 + } else {
11649 + Function("r", "regeneratorRuntime = r")(runtime);
11650 + }
11651 +}
11652 +
11653 +
11654 +/***/ }),
11655 +
11656 +/***/ "../node_modules/@babel/runtime/helpers/esm/defineProperty.js":
11657 +/*!********************************************************************!*\
11658 + !*** ../node_modules/@babel/runtime/helpers/esm/defineProperty.js ***!
11659 + \********************************************************************/
11660 +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
11661 +
11662 +"use strict";
11663 +__webpack_require__.r(__webpack_exports__);
11664 +/* harmony export */ __webpack_require__.d(__webpack_exports__, {
11665 +/* harmony export */ "default": () => (/* binding */ _defineProperty)
11666 +/* harmony export */ });
11667 +/* harmony import */ var _toPropertyKey_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toPropertyKey.js */ "../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js");
11668 +
11669 +function _defineProperty(obj, key, value) {
11670 + key = (0,_toPropertyKey_js__WEBPACK_IMPORTED_MODULE_0__["default"])(key);
11671 + if (key in obj) {
11672 + Object.defineProperty(obj, key, {
11673 + value: value,
11674 + enumerable: true,
11675 + configurable: true,
11676 + writable: true
11677 + });
11678 + } else {
11679 + obj[key] = value;
11680 + }
11681 + return obj;
11682 +}
11683 +
11684 +/***/ }),
11685 +
11686 +/***/ "../node_modules/@babel/runtime/helpers/esm/objectSpread2.js":
11687 +/*!*******************************************************************!*\
11688 + !*** ../node_modules/@babel/runtime/helpers/esm/objectSpread2.js ***!
11689 + \*******************************************************************/
11690 +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
11691 +
11692 +"use strict";
11693 +__webpack_require__.r(__webpack_exports__);
11694 +/* harmony export */ __webpack_require__.d(__webpack_exports__, {
11695 +/* harmony export */ "default": () => (/* binding */ _objectSpread2)
11696 +/* harmony export */ });
11697 +/* harmony import */ var _defineProperty_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./defineProperty.js */ "../node_modules/@babel/runtime/helpers/esm/defineProperty.js");
11698 +
11699 +function ownKeys(object, enumerableOnly) {
11700 + var keys = Object.keys(object);
11701 + if (Object.getOwnPropertySymbols) {
11702 + var symbols = Object.getOwnPropertySymbols(object);
11703 + enumerableOnly && (symbols = symbols.filter(function (sym) {
11704 + return Object.getOwnPropertyDescriptor(object, sym).enumerable;
11705 + })), keys.push.apply(keys, symbols);
11706 + }
11707 + return keys;
11708 +}
11709 +function _objectSpread2(target) {
11710 + for (var i = 1; i < arguments.length; i++) {
11711 + var source = null != arguments[i] ? arguments[i] : {};
11712 + i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
11713 + (0,_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(target, key, source[key]);
11714 + }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
11715 + Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
11716 + });
11717 + }
11718 + return target;
11719 +}
11720 +
11721 +/***/ }),
11722 +
11723 +/***/ "../node_modules/@babel/runtime/helpers/esm/toPrimitive.js":
11724 +/*!*****************************************************************!*\
11725 + !*** ../node_modules/@babel/runtime/helpers/esm/toPrimitive.js ***!
11726 + \*****************************************************************/
11727 +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
11728 +
11729 +"use strict";
11730 +__webpack_require__.r(__webpack_exports__);
11731 +/* harmony export */ __webpack_require__.d(__webpack_exports__, {
11732 +/* harmony export */ "default": () => (/* binding */ _toPrimitive)
11733 +/* harmony export */ });
11734 +/* harmony import */ var _typeof_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/esm/typeof.js");
11735 +
11736 +function _toPrimitive(input, hint) {
11737 + if ((0,_typeof_js__WEBPACK_IMPORTED_MODULE_0__["default"])(input) !== "object" || input === null) return input;
11738 + var prim = input[Symbol.toPrimitive];
11739 + if (prim !== undefined) {
11740 + var res = prim.call(input, hint || "default");
11741 + if ((0,_typeof_js__WEBPACK_IMPORTED_MODULE_0__["default"])(res) !== "object") return res;
11742 + throw new TypeError("@@toPrimitive must return a primitive value.");
11743 + }
11744 + return (hint === "string" ? String : Number)(input);
11745 +}
11746 +
11747 +/***/ }),
11748 +
11749 +/***/ "../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js":
11750 +/*!*******************************************************************!*\
11751 + !*** ../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js ***!
11752 + \*******************************************************************/
11753 +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
11754 +
11755 +"use strict";
11756 +__webpack_require__.r(__webpack_exports__);
11757 +/* harmony export */ __webpack_require__.d(__webpack_exports__, {
11758 +/* harmony export */ "default": () => (/* binding */ _toPropertyKey)
11759 +/* harmony export */ });
11760 +/* harmony import */ var _typeof_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/esm/typeof.js");
11761 +/* harmony import */ var _toPrimitive_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toPrimitive.js */ "../node_modules/@babel/runtime/helpers/esm/toPrimitive.js");
11762 +
11763 +
11764 +function _toPropertyKey(arg) {
11765 + var key = (0,_toPrimitive_js__WEBPACK_IMPORTED_MODULE_1__["default"])(arg, "string");
11766 + return (0,_typeof_js__WEBPACK_IMPORTED_MODULE_0__["default"])(key) === "symbol" ? key : String(key);
11767 +}
11768 +
11769 +/***/ }),
11770 +
11771 +/***/ "../node_modules/@babel/runtime/helpers/esm/typeof.js":
11772 +/*!************************************************************!*\
11773 + !*** ../node_modules/@babel/runtime/helpers/esm/typeof.js ***!
11774 + \************************************************************/
11775 +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
11776 +
11777 +"use strict";
11778 +__webpack_require__.r(__webpack_exports__);
11779 +/* harmony export */ __webpack_require__.d(__webpack_exports__, {
11780 +/* harmony export */ "default": () => (/* binding */ _typeof)
11781 +/* harmony export */ });
11782 +function _typeof(obj) {
11783 + "@babel/helpers - typeof";
11784 +
11785 + return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
11786 + return typeof obj;
11787 + } : function (obj) {
11788 + return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
11789 + }, _typeof(obj);
11790 +}
11791 +
11792 +/***/ }),
11793 +
11794 +/***/ "../node_modules/immer/dist/immer.esm.mjs":
11795 +/*!************************************************!*\
11796 + !*** ../node_modules/immer/dist/immer.esm.mjs ***!
11797 + \************************************************/
11798 +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
11799 +
11800 +"use strict";
11801 +__webpack_require__.r(__webpack_exports__);
11802 +/* harmony export */ __webpack_require__.d(__webpack_exports__, {
11803 +/* harmony export */ "Immer": () => (/* binding */ un),
11804 +/* harmony export */ "applyPatches": () => (/* binding */ pn),
11805 +/* harmony export */ "castDraft": () => (/* binding */ K),
11806 +/* harmony export */ "castImmutable": () => (/* binding */ $),
11807 +/* harmony export */ "createDraft": () => (/* binding */ ln),
11808 +/* harmony export */ "current": () => (/* binding */ R),
11809 +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
11810 +/* harmony export */ "enableAllPlugins": () => (/* binding */ J),
11811 +/* harmony export */ "enableES5": () => (/* binding */ F),
11812 +/* harmony export */ "enableMapSet": () => (/* binding */ C),
11813 +/* harmony export */ "enablePatches": () => (/* binding */ T),
11814 +/* harmony export */ "finishDraft": () => (/* binding */ dn),
11815 +/* harmony export */ "freeze": () => (/* binding */ d),
11816 +/* harmony export */ "immerable": () => (/* binding */ L),
11817 +/* harmony export */ "isDraft": () => (/* binding */ r),
11818 +/* harmony export */ "isDraftable": () => (/* binding */ t),
11819 +/* harmony export */ "nothing": () => (/* binding */ H),
11820 +/* harmony export */ "original": () => (/* binding */ e),
11821 +/* harmony export */ "produce": () => (/* binding */ fn),
11822 +/* harmony export */ "produceWithPatches": () => (/* binding */ cn),
11823 +/* harmony export */ "setAutoFreeze": () => (/* binding */ sn),
11824 +/* harmony export */ "setUseProxies": () => (/* binding */ vn)
11825 +/* harmony export */ });
11826 +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.add(t):n[r]=t}function c(n,r){return n===r?0!==n||1/n==1/r:n!=n&&r!=r}function s(n){return X&&n instanceof Map}function v(n){return q&&n instanceof Set}function p(n){return n.o||n.t}function l(n){if(Array.isArray(n))return Array.prototype.slice.call(n);var r=rn(n);delete r[Q];for(var t=nn(r),e=0;e<t.length;e++){var i=t[e],o=r[i];!1===o.writable&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(r[i]={configurable:!0,writable:!0,enumerable:o.enumerable,value:n[i]})}return Object.create(Object.getPrototypeOf(n),r)}function d(n,e){return void 0===e&&(e=!1),y(n)||r(n)||!t(n)||(o(n)>1&&(n.set=n.add=n.clear=n.delete=h),Object.freeze(n),e&&i(n,(function(n,r){return d(r,!0)}),!0)),n}function h(){n(2)}function y(n){return null==n||"object"!=typeof n||Object.isFrozen(n)}function b(r){var t=tn[r];return t||n(18,r),t}function m(n,r){tn[n]||(tn[n]=r)}function _(){return false||U||n(0),U}function j(n,r){r&&(b("Patches"),n.u=[],n.s=[],n.v=r)}function g(n){O(n),n.p.forEach(S),n.p=null}function O(n){n===U&&(U=n.l)}function w(n){return U={p:[],l:U,h:n,m:!0,_:0}}function S(n){var r=n[Q];0===r.i||1===r.i?r.j():r.g=!0}function P(r,e){e._=e.p.length;var i=e.p[0],o=void 0!==r&&r!==i;return e.h.O||b("ES5").S(e,r,o),o?(i[Q].P&&(g(e),n(4)),t(r)&&(r=M(e,r),e.l||x(e,r)),e.u&&b("Patches").M(i[Q].t,r,e.u,e.s)):r=M(e,i,[]),g(e),e.u&&e.v(e.u,e.s),r!==H?r:void 0}function M(n,r,t){if(y(r))return r;var e=r[Q];if(!e)return i(r,(function(i,o){return A(n,e,r,i,o,t)}),!0),r;if(e.A!==n)return r;if(!e.P)return x(n,e.t,!0),e.t;if(!e.I){e.I=!0,e.A._--;var o=4===e.i||5===e.i?e.o=l(e.k):e.o,u=o,a=!1;3===e.i&&(u=new Set(o),o.clear(),a=!0),i(u,(function(r,i){return A(n,e,o,r,i,t,a)})),x(n,o,!1),t&&n.u&&b("Patches").N(e,t,n.u,n.s)}return e.o}function A(e,i,o,a,c,s,v){if( true&&c===o&&n(5),r(c)){var p=M(e,c,s&&i&&3!==i.i&&!u(i.R,a)?s.concat(a):void 0);if(f(o,a,p),!r(p))return;e.m=!1}else v&&o.add(c);if(t(c)&&!y(c)){if(!e.h.D&&e._<1)return;M(e,c),i&&i.A.l||x(e,c)}}function x(n,r,t){void 0===t&&(t=!1),!n.l&&n.h.D&&n.m&&d(r,t)}function z(n,r){var t=n[Q];return(t?p(t):n)[r]}function I(n,r){if(r in n)for(var t=Object.getPrototypeOf(n);t;){var e=Object.getOwnPropertyDescriptor(t,r);if(e)return e;t=Object.getPrototypeOf(t)}}function k(n){n.P||(n.P=!0,n.l&&k(n.l))}function E(n){n.o||(n.o=l(n.t))}function N(n,r,t){var e=s(r)?b("MapSet").F(r,t):v(r)?b("MapSet").T(r,t):n.O?function(n,r){var t=Array.isArray(n),e={i:t?1:0,A:r?r.A:_(),P:!1,I:!1,R:{},l:r,t:n,k:null,o:null,j:null,C:!1},i=e,o=en;t&&(i=[e],o=on);var u=Proxy.revocable(i,o),a=u.revoke,f=u.proxy;return e.k=f,e.j=a,f}(r,t):b("ES5").J(r,t);return(t?t.A:_()).p.push(e),e}function R(e){return r(e)||n(22,e),function n(r){if(!t(r))return r;var e,u=r[Q],c=o(r);if(u){if(!u.P&&(u.i<4||!b("ES5").K(u)))return u.t;u.I=!0,e=D(r,c),u.I=!1}else e=D(r,c);return i(e,(function(r,t){u&&a(u.t,r)===t||f(e,r,n(t))})),3===c?new Set(e):e}(e)}function D(n,r){switch(r){case 2:return new Map(n);case 3:return Array.from(n)}return l(n)}function F(){function t(n,r){var t=s[n];return t?t.enumerable=r:s[n]=t={configurable:!0,enumerable:r,get:function(){var r=this[Q];return true&&f(r),en.get(r,n)},set:function(r){var t=this[Q]; true&&f(t),en.set(t,n,r)}},t}function e(n){for(var r=n.length-1;r>=0;r--){var t=n[r][Q];if(!t.P)switch(t.i){case 5:a(t)&&k(t);break;case 4:o(t)&&k(t)}}}function o(n){for(var r=n.t,t=n.k,e=nn(t),i=e.length-1;i>=0;i--){var o=e[i];if(o!==Q){var a=r[o];if(void 0===a&&!u(r,o))return!0;var f=t[o],s=f&&f[Q];if(s?s.t!==a:!c(f,a))return!0}}var v=!!r[Q];return e.length!==nn(r).length+(v?0:1)}function a(n){var r=n.k;if(r.length!==n.t.length)return!0;var t=Object.getOwnPropertyDescriptor(r,r.length-1);if(t&&!t.get)return!0;for(var e=0;e<r.length;e++)if(!r.hasOwnProperty(e))return!0;return!1}function f(r){r.g&&n(3,JSON.stringify(p(r)))}var s={};m("ES5",{J:function(n,r){var e=Array.isArray(n),i=function(n,r){if(n){for(var e=Array(r.length),i=0;i<r.length;i++)Object.defineProperty(e,""+i,t(i,!0));return e}var o=rn(r);delete o[Q];for(var u=nn(o),a=0;a<u.length;a++){var f=u[a];o[f]=t(f,n||!!o[f].enumerable)}return Object.create(Object.getPrototypeOf(r),o)}(e,n),o={i:e?5:4,A:r?r.A:_(),P:!1,I:!1,R:{},l:r,t:n,k:i,o:null,g:!1,C:!1};return Object.defineProperty(i,Q,{value:o,writable:!0}),i},S:function(n,t,o){o?r(t)&&t[Q].A===n&&e(n.p):(n.u&&function n(r){if(r&&"object"==typeof r){var t=r[Q];if(t){var e=t.t,o=t.k,f=t.R,c=t.i;if(4===c)i(o,(function(r){r!==Q&&(void 0!==e[r]||u(e,r)?f[r]||n(o[r]):(f[r]=!0,k(t)))})),i(e,(function(n){void 0!==o[n]||u(o,n)||(f[n]=!1,k(t))}));else if(5===c){if(a(t)&&(k(t),f.length=!0),o.length<e.length)for(var s=o.length;s<e.length;s++)f[s]=!1;else for(var v=e.length;v<o.length;v++)f[v]=!0;for(var p=Math.min(o.length,e.length),l=0;l<p;l++)o.hasOwnProperty(l)||(f[l]=!0),void 0===f[l]&&n(o[l])}}}}(n.p[0]),e(n.p))},K:function(n){return 4===n.i?o(n):a(n)}})}function T(){function e(n){if(!t(n))return n;if(Array.isArray(n))return n.map(e);if(s(n))return new Map(Array.from(n.entries()).map((function(n){return[n[0],e(n[1])]})));if(v(n))return new Set(Array.from(n).map(e));var r=Object.create(Object.getPrototypeOf(n));for(var i in n)r[i]=e(n[i]);return u(n,L)&&(r[L]=n[L]),r}function f(n){return r(n)?e(n):n}var c="add";m("Patches",{$:function(r,t){return t.forEach((function(t){for(var i=t.path,u=t.op,f=r,s=0;s<i.length-1;s++){var v=o(f),p=i[s];"string"!=typeof p&&"number"!=typeof p&&(p=""+p),0!==v&&1!==v||"__proto__"!==p&&"constructor"!==p||n(24),"function"==typeof f&&"prototype"===p&&n(24),"object"!=typeof(f=a(f,p))&&n(15,i.join("/"))}var l=o(f),d=e(t.value),h=i[i.length-1];switch(u){case"replace":switch(l){case 2:return f.set(h,d);case 3:n(16);default:return f[h]=d}case c:switch(l){case 1:return"-"===h?f.push(d):f.splice(h,0,d);case 2:return f.set(h,d);case 3:return f.add(d);default:return f[h]=d}case"remove":switch(l){case 1:return f.splice(h,1);case 2:return f.delete(h);case 3:return f.delete(t.value);default:return delete f[h]}default:n(17,u)}})),r},N:function(n,r,t,e){switch(n.i){case 0:case 4:case 2:return function(n,r,t,e){var o=n.t,s=n.o;i(n.R,(function(n,i){var v=a(o,n),p=a(s,n),l=i?u(o,n)?"replace":c:"remove";if(v!==p||"replace"!==l){var d=r.concat(n);t.push("remove"===l?{op:l,path:d}:{op:l,path:d,value:p}),e.push(l===c?{op:"remove",path:d}:"remove"===l?{op:c,path:d,value:f(v)}:{op:"replace",path:d,value:f(v)})}}))}(n,r,t,e);case 5:case 1:return function(n,r,t,e){var i=n.t,o=n.R,u=n.o;if(u.length<i.length){var a=[u,i];i=a[0],u=a[1];var s=[e,t];t=s[0],e=s[1]}for(var v=0;v<i.length;v++)if(o[v]&&u[v]!==i[v]){var p=r.concat([v]);t.push({op:"replace",path:p,value:f(u[v])}),e.push({op:"replace",path:p,value:f(i[v])})}for(var l=i.length;l<u.length;l++){var d=r.concat([l]);t.push({op:c,path:d,value:f(u[l])})}i.length<u.length&&e.push({op:"replace",path:r.concat(["length"]),value:i.length})}(n,r,t,e);case 3:return function(n,r,t,e){var i=n.t,o=n.o,u=0;i.forEach((function(n){if(!o.has(n)){var i=r.concat([u]);t.push({op:"remove",path:i,value:n}),e.unshift({op:c,path:i,value:n})}u++})),u=0,o.forEach((function(n){if(!i.has(n)){var o=r.concat([u]);t.push({op:c,path:o,value:n}),e.unshift({op:"remove",path:o,value:n})}u++}))}(n,r,t,e)}},M:function(n,r,t,e){t.push({op:"replace",path:[],value:r===H?void 0:r}),e.push({op:"replace",path:[],value:n})}})}function C(){function r(n,r){function t(){this.constructor=n}a(n,r),n.prototype=(t.prototype=r.prototype,new t)}function e(n){n.o||(n.R=new Map,n.o=new Map(n.t))}function o(n){n.o||(n.o=new Set,n.t.forEach((function(r){if(t(r)){var e=N(n.A.h,r,n);n.p.set(r,e),n.o.add(e)}else n.o.add(r)})))}function u(r){r.g&&n(3,JSON.stringify(p(r)))}var a=function(n,r){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var t in r)r.hasOwnProperty(t)&&(n[t]=r[t])})(n,r)},f=function(){function n(n,r){return this[Q]={i:2,l:r,A:r?r.A:_(),P:!1,I:!1,o:void 0,R:void 0,t:n,k:this,C:!1,g:!1},this}r(n,Map);var o=n.prototype;return Object.defineProperty(o,"size",{get:function(){return p(this[Q]).size}}),o.has=function(n){return p(this[Q]).has(n)},o.set=function(n,r){var t=this[Q];return u(t),p(t).has(n)&&p(t).get(n)===r||(e(t),k(t),t.R.set(n,!0),t.o.set(n,r),t.R.set(n,!0)),this},o.delete=function(n){if(!this.has(n))return!1;var r=this[Q];return u(r),e(r),k(r),r.t.has(n)?r.R.set(n,!1):r.R.delete(n),r.o.delete(n),!0},o.clear=function(){var n=this[Q];u(n),p(n).size&&(e(n),k(n),n.R=new Map,i(n.t,(function(r){n.R.set(r,!1)})),n.o.clear())},o.forEach=function(n,r){var t=this;p(this[Q]).forEach((function(e,i){n.call(r,t.get(i),i,t)}))},o.get=function(n){var r=this[Q];u(r);var i=p(r).get(n);if(r.I||!t(i))return i;if(i!==r.t.get(n))return i;var o=N(r.A.h,i,r);return e(r),r.o.set(n,o),o},o.keys=function(){return p(this[Q]).keys()},o.values=function(){var n,r=this,t=this.keys();return(n={})[V]=function(){return r.values()},n.next=function(){var n=t.next();return n.done?n:{done:!1,value:r.get(n.value)}},n},o.entries=function(){var n,r=this,t=this.keys();return(n={})[V]=function(){return r.entries()},n.next=function(){var n=t.next();if(n.done)return n;var e=r.get(n.value);return{done:!1,value:[n.value,e]}},n},o[V]=function(){return this.entries()},n}(),c=function(){function n(n,r){return this[Q]={i:3,l:r,A:r?r.A:_(),P:!1,I:!1,o:void 0,t:n,k:this,p:new Map,g:!1,C:!1},this}r(n,Set);var t=n.prototype;return Object.defineProperty(t,"size",{get:function(){return p(this[Q]).size}}),t.has=function(n){var r=this[Q];return u(r),r.o?!!r.o.has(n)||!(!r.p.has(n)||!r.o.has(r.p.get(n))):r.t.has(n)},t.add=function(n){var r=this[Q];return u(r),this.has(n)||(o(r),k(r),r.o.add(n)),this},t.delete=function(n){if(!this.has(n))return!1;var r=this[Q];return u(r),o(r),k(r),r.o.delete(n)||!!r.p.has(n)&&r.o.delete(r.p.get(n))},t.clear=function(){var n=this[Q];u(n),p(n).size&&(o(n),k(n),n.o.clear())},t.values=function(){var n=this[Q];return u(n),o(n),n.o.values()},t.entries=function(){var n=this[Q];return u(n),o(n),n.o.entries()},t.keys=function(){return this.values()},t[V]=function(){return this.values()},t.forEach=function(n,r){for(var t=this.values(),e=t.next();!e.done;)n.call(r,e.value,e.value,this),e=t.next()},n}();m("MapSet",{F:function(n,r){return new f(n,r)},T:function(n,r){return new c(n,r)}})}function J(){F(),C(),T()}function K(n){return n}function $(n){return n}var G,U,W="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),X="undefined"!=typeof Map,q="undefined"!=typeof Set,B="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,H=W?Symbol.for("immer-nothing"):((G={})["immer-nothing"]=!0,G),L=W?Symbol.for("immer-draftable"):"__$immer_draftable",Q=W?Symbol.for("immer-state"):"__$immer_state",V="undefined"!=typeof Symbol&&Symbol.iterator||"@@iterator",Y={0:"Illegal state",1:"Immer drafts cannot have computed properties",2:"This object has been frozen and should not be mutated",3:function(n){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+n},4:"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.",5:"Immer forbids circular references",6:"The first or second argument to `produce` must be a function",7:"The third argument to `produce` must be a function or undefined",8:"First argument to `createDraft` must be a plain object, an array, or an immerable object",9:"First argument to `finishDraft` must be a draft returned by `createDraft`",10:"The given draft is already finalized",11:"Object.defineProperty() cannot be used on an Immer draft",12:"Object.setPrototypeOf() cannot be used on an Immer draft",13:"Immer only supports deleting array indices",14:"Immer only supports setting array indices and the 'length' property",15:function(n){return"Cannot apply patch, path doesn't resolve: "+n},16:'Sets cannot have "replace" patches.',17:function(n){return"Unsupported patch operation: "+n},18:function(n){return"The plugin for '"+n+"' has not been loaded into Immer. To enable the plugin, import and call `enable"+n+"()` when initializing your application."},20:"Cannot use proxies if Proxy, Proxy.revocable or Reflect are not available",21:function(n){return"produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '"+n+"'"},22:function(n){return"'current' expects a draft, got: "+n},23:function(n){return"'original' expects a draft, got: "+n},24:"Patching reserved attributes like __proto__, prototype and constructor is not allowed"},Z=""+Object.prototype.constructor,nn="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(n){return Object.getOwnPropertyNames(n).concat(Object.getOwnPropertySymbols(n))}:Object.getOwnPropertyNames,rn=Object.getOwnPropertyDescriptors||function(n){var r={};return nn(n).forEach((function(t){r[t]=Object.getOwnPropertyDescriptor(n,t)})),r},tn={},en={get:function(n,r){if(r===Q)return n;var e=p(n);if(!u(e,r))return function(n,r,t){var e,i=I(r,t);return i?"value"in i?i.value:null===(e=i.get)||void 0===e?void 0:e.call(n.k):void 0}(n,e,r);var i=e[r];return n.I||!t(i)?i:i===z(n.t,r)?(E(n),n.o[r]=N(n.A.h,i,n)):i},has:function(n,r){return r in p(n)},ownKeys:function(n){return Reflect.ownKeys(p(n))},set:function(n,r,t){var e=I(p(n),r);if(null==e?void 0:e.set)return e.set.call(n.k,t),!0;if(!n.P){var i=z(p(n),r),o=null==i?void 0:i[Q];if(o&&o.t===t)return n.o[r]=t,n.R[r]=!1,!0;if(c(t,i)&&(void 0!==t||u(n.t,r)))return!0;E(n),k(n)}return n.o[r]===t&&(void 0!==t||r in n.o)||Number.isNaN(t)&&Number.isNaN(n.o[r])||(n.o[r]=t,n.R[r]=!0),!0},deleteProperty:function(n,r){return void 0!==z(n.t,r)||r in n.t?(n.R[r]=!1,E(n),k(n)):delete n.R[r],n.o&&delete n.o[r],!0},getOwnPropertyDescriptor:function(n,r){var t=p(n),e=Reflect.getOwnPropertyDescriptor(t,r);return e?{writable:!0,configurable:1!==n.i||"length"!==r,enumerable:e.enumerable,value:t[r]}:e},defineProperty:function(){n(11)},getPrototypeOf:function(n){return Object.getPrototypeOf(n.t)},setPrototypeOf:function(){n(12)}},on={};i(en,(function(n,r){on[n]=function(){return arguments[0]=arguments[0][0],r.apply(this,arguments)}})),on.deleteProperty=function(r,t){return true&&isNaN(parseInt(t))&&n(13),on.set.call(this,r,t,void 0)},on.set=function(r,t,e){return true&&"length"!==t&&isNaN(parseInt(t))&&n(14),en.set.call(this,r[0],t,e,r[0])};var un=function(){function e(r){var e=this;this.O=B,this.D=!0,this.produce=function(r,i,o){if("function"==typeof r&&"function"!=typeof i){var u=i;i=r;var a=e;return function(n){var r=this;void 0===n&&(n=u);for(var t=arguments.length,e=Array(t>1?t-1:0),o=1;o<t;o++)e[o-1]=arguments[o];return a.produce(n,(function(n){var t;return(t=i).call.apply(t,[r,n].concat(e))}))}}var f;if("function"!=typeof i&&n(6),void 0!==o&&"function"!=typeof o&&n(7),t(r)){var c=w(e),s=N(e,r,void 0),v=!0;try{f=i(s),v=!1}finally{v?g(c):O(c)}return"undefined"!=typeof Promise&&f instanceof Promise?f.then((function(n){return j(c,o),P(n,c)}),(function(n){throw g(c),n})):(j(c,o),P(f,c))}if(!r||"object"!=typeof r){if(void 0===(f=i(r))&&(f=r),f===H&&(f=void 0),e.D&&d(f,!0),o){var p=[],l=[];b("Patches").M(r,f,p,l),o(p,l)}return f}n(21,r)},this.produceWithPatches=function(n,r){if("function"==typeof n)return function(r){for(var t=arguments.length,i=Array(t>1?t-1:0),o=1;o<t;o++)i[o-1]=arguments[o];return e.produceWithPatches(r,(function(r){return n.apply(void 0,[r].concat(i))}))};var t,i,o=e.produce(n,r,(function(n,r){t=n,i=r}));return"undefined"!=typeof Promise&&o instanceof Promise?o.then((function(n){return[n,t,i]})):[o,t,i]},"boolean"==typeof(null==r?void 0:r.useProxies)&&this.setUseProxies(r.useProxies),"boolean"==typeof(null==r?void 0:r.autoFreeze)&&this.setAutoFreeze(r.autoFreeze)}var i=e.prototype;return i.createDraft=function(e){t(e)||n(8),r(e)&&(e=R(e));var i=w(this),o=N(this,e,void 0);return o[Q].C=!0,O(i),o},i.finishDraft=function(r,t){var e=r&&r[Q]; true&&(e&&e.C||n(9),e.I&&n(10));var i=e.A;return j(i,t),P(void 0,i)},i.setAutoFreeze=function(n){this.D=n},i.setUseProxies=function(r){r&&!B&&n(20),this.O=r},i.applyPatches=function(n,t){var e;for(e=t.length-1;e>=0;e--){var i=t[e];if(0===i.path.length&&"replace"===i.op){n=i.value;break}}e>-1&&(t=t.slice(e+1));var o=b("Patches").$;return r(n)?o(n,t):this.produce(n,(function(n){return o(n,t)}))},e}(),an=new un,fn=an.produce,cn=an.produceWithPatches.bind(an),sn=an.setAutoFreeze.bind(an),vn=an.setUseProxies.bind(an),pn=an.applyPatches.bind(an),ln=an.createDraft.bind(an),dn=an.finishDraft.bind(an);/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (fn);
11827 +//# sourceMappingURL=immer.esm.js.map
11828 +
11829 +
11830 +/***/ })
11831 +
11832 +/******/ });
11833 +/************************************************************************/
11834 +/******/ // The module cache
11835 +/******/ var __webpack_module_cache__ = {};
11836 +/******/
11837 +/******/ // The require function
11838 +/******/ function __webpack_require__(moduleId) {
11839 +/******/ // Check if module is in cache
11840 +/******/ var cachedModule = __webpack_module_cache__[moduleId];
11841 +/******/ if (cachedModule !== undefined) {
11842 +/******/ return cachedModule.exports;
11843 +/******/ }
11844 +/******/ // Create a new module (and put it into the cache)
11845 +/******/ var module = __webpack_module_cache__[moduleId] = {
11846 +/******/ // no module.id needed
11847 +/******/ // no module.loaded needed
11848 +/******/ exports: {}
11849 +/******/ };
11850 +/******/
11851 +/******/ // Execute the module function
11852 +/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
11853 +/******/
11854 +/******/ // Return the exports of the module
11855 +/******/ return module.exports;
11856 +/******/ }
11857 +/******/
11858 +/************************************************************************/
11859 +/******/ /* webpack/runtime/define property getters */
11860 +/******/ (() => {
11861 +/******/ // define getter functions for harmony exports
11862 +/******/ __webpack_require__.d = (exports, definition) => {
11863 +/******/ for(var key in definition) {
11864 +/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
11865 +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
11866 +/******/ }
11867 +/******/ }
11868 +/******/ };
11869 +/******/ })();
11870 +/******/
11871 +/******/ /* webpack/runtime/global */
11872 +/******/ (() => {
11873 +/******/ __webpack_require__.g = (function() {
11874 +/******/ if (typeof globalThis === 'object') return globalThis;
11875 +/******/ try {
11876 +/******/ return this || new Function('return this')();
11877 +/******/ } catch (e) {
11878 +/******/ if (typeof window === 'object') return window;
11879 +/******/ }
11880 +/******/ })();
11881 +/******/ })();
11882 +/******/
11883 +/******/ /* webpack/runtime/hasOwnProperty shorthand */
11884 +/******/ (() => {
11885 +/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
11886 +/******/ })();
11887 +/******/
11888 +/******/ /* webpack/runtime/make namespace object */
11889 +/******/ (() => {
11890 +/******/ // define __esModule on exports
11891 +/******/ __webpack_require__.r = (exports) => {
11892 +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
11893 +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
11894 +/******/ }
11895 +/******/ Object.defineProperty(exports, '__esModule', { value: true });
11896 +/******/ };
11897 +/******/ })();
11898 +/******/
11899 +/************************************************************************/
11900 +var __webpack_exports__ = {};
11901 +// This entry need to be wrapped in an IIFE because it need to be in strict mode.
11902 +(() => {
11903 +"use strict";
11904 +/*!*********************************************!*\
11905 + !*** ../modules/web-cli/assets/js/index.js ***!
11906 + \*********************************************/
11907 +
11908 +
11909 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
11910 +var _api = _interopRequireDefault(__webpack_require__(/*! ./api */ "../modules/web-cli/assets/js/api.js"));
11911 +window.$e = new _api.default();
11912 +})();
11913 +
11914 +/******/ })()
11915 +;
5912 11916 //# sourceMappingURL=web-cli.js.map