PluginProbe
Elementor Website Builder – more than just a page builder / 3.24.8
Elementor Website Builder – more than just a page builder v3.24.8
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/atomic-widgets-editor.js +5643 -2216 4.2.0-dev23.24.8 View file →
@@ -1,301 +1,2532 @@
1 +/*! elementor - v3.24.0 - 28-10-2024 */
1 2 /******/ (() => { // webpackBootstrap
2 3 /******/ var __webpack_modules__ = ({
3 4
4 -/***/ "../assets/dev/js/editor/elements/views/behaviors/sortable.js":
5 -/*!********************************************************************!*\
6 - !*** ../assets/dev/js/editor/elements/views/behaviors/sortable.js ***!
7 - \********************************************************************/
8 -/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
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__) => {
9 10
10 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 */ createActionCreatorInvariantMiddleware: () => (/* binding */ createActionCreatorInvariantMiddleware),
29 +/* harmony export */ createAsyncThunk: () => (/* binding */ createAsyncThunk),
30 +/* harmony export */ createDraftSafeSelector: () => (/* binding */ createDraftSafeSelector),
31 +/* harmony export */ createEntityAdapter: () => (/* binding */ createEntityAdapter),
32 +/* harmony export */ createImmutableStateInvariantMiddleware: () => (/* binding */ createImmutableStateInvariantMiddleware),
33 +/* harmony export */ createListenerMiddleware: () => (/* binding */ createListenerMiddleware),
34 +/* harmony export */ createNextState: () => (/* reexport safe */ immer__WEBPACK_IMPORTED_MODULE_2__["default"]),
35 +/* harmony export */ createReducer: () => (/* binding */ createReducer),
36 +/* harmony export */ createSelector: () => (/* reexport safe */ reselect__WEBPACK_IMPORTED_MODULE_1__.createSelector),
37 +/* harmony export */ createSerializableStateInvariantMiddleware: () => (/* binding */ createSerializableStateInvariantMiddleware),
38 +/* harmony export */ createSlice: () => (/* binding */ createSlice),
39 +/* harmony export */ createStore: () => (/* reexport safe */ redux__WEBPACK_IMPORTED_MODULE_0__.createStore),
40 +/* harmony export */ current: () => (/* reexport safe */ immer__WEBPACK_IMPORTED_MODULE_2__.current),
41 +/* harmony export */ findNonSerializableValue: () => (/* binding */ findNonSerializableValue),
42 +/* harmony export */ freeze: () => (/* reexport safe */ immer__WEBPACK_IMPORTED_MODULE_2__.freeze),
43 +/* harmony export */ getDefaultMiddleware: () => (/* binding */ getDefaultMiddleware),
44 +/* harmony export */ getType: () => (/* binding */ getType),
45 +/* harmony export */ isAction: () => (/* binding */ isAction),
46 +/* harmony export */ isActionCreator: () => (/* binding */ isActionCreator),
47 +/* harmony export */ isAllOf: () => (/* binding */ isAllOf),
48 +/* harmony export */ isAnyOf: () => (/* binding */ isAnyOf),
49 +/* harmony export */ isAsyncThunkAction: () => (/* binding */ isAsyncThunkAction),
50 +/* harmony export */ isDraft: () => (/* reexport safe */ immer__WEBPACK_IMPORTED_MODULE_2__.isDraft),
51 +/* harmony export */ isFluxStandardAction: () => (/* binding */ isFSA),
52 +/* harmony export */ isFulfilled: () => (/* binding */ isFulfilled),
53 +/* harmony export */ isImmutableDefault: () => (/* binding */ isImmutableDefault),
54 +/* harmony export */ isPending: () => (/* binding */ isPending),
55 +/* harmony export */ isPlain: () => (/* binding */ isPlain),
56 +/* harmony export */ isPlainObject: () => (/* binding */ isPlainObject),
57 +/* harmony export */ isRejected: () => (/* binding */ isRejected),
58 +/* harmony export */ isRejectedWithValue: () => (/* binding */ isRejectedWithValue),
59 +/* harmony export */ legacy_createStore: () => (/* reexport safe */ redux__WEBPACK_IMPORTED_MODULE_0__.legacy_createStore),
60 +/* harmony export */ miniSerializeError: () => (/* binding */ miniSerializeError),
61 +/* harmony export */ nanoid: () => (/* binding */ nanoid),
62 +/* harmony export */ original: () => (/* reexport safe */ immer__WEBPACK_IMPORTED_MODULE_2__.original),
63 +/* harmony export */ prepareAutoBatched: () => (/* binding */ prepareAutoBatched),
64 +/* harmony export */ removeListener: () => (/* binding */ removeListener),
65 +/* harmony export */ unwrapResult: () => (/* binding */ unwrapResult)
66 +/* harmony export */ });
67 +/* harmony import */ var immer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! immer */ "../node_modules/@reduxjs/toolkit/node_modules/immer/dist/immer.esm.mjs");
68 +/* harmony import */ var redux__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! redux */ "../node_modules/redux/es/redux.js");
69 +/* harmony import */ var reselect__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! reselect */ "../node_modules/reselect/es/index.js");
70 +/* harmony import */ var redux_thunk__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! redux-thunk */ "../node_modules/redux-thunk/es/index.js");
71 +var __extends = (undefined && undefined.__extends) || (function () {
72 + var extendStatics = function (d, b) {
73 + extendStatics = Object.setPrototypeOf ||
74 + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
75 + function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
76 + return extendStatics(d, b);
77 + };
78 + return function (d, b) {
79 + if (typeof b !== "function" && b !== null)
80 + throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
81 + extendStatics(d, b);
82 + function __() { this.constructor = d; }
83 + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
84 + };
85 +})();
86 +var __generator = (undefined && undefined.__generator) || function (thisArg, body) {
87 + var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
88 + return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
89 + function verb(n) { return function (v) { return step([n, v]); }; }
90 + function step(op) {
91 + if (f) throw new TypeError("Generator is already executing.");
92 + while (_) try {
93 + 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;
94 + if (y = 0, t) op = [op[0] & 2, t.value];
95 + switch (op[0]) {
96 + case 0: case 1: t = op; break;
97 + case 4: _.label++; return { value: op[1], done: false };
98 + case 5: _.label++; y = op[1]; op = [0]; continue;
99 + case 7: op = _.ops.pop(); _.trys.pop(); continue;
100 + default:
101 + if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
102 + if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
103 + if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
104 + if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
105 + if (t[2]) _.ops.pop();
106 + _.trys.pop(); continue;
107 + }
108 + op = body.call(thisArg, _);
109 + } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
110 + if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
111 + }
112 +};
113 +var __spreadArray = (undefined && undefined.__spreadArray) || function (to, from) {
114 + for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)
115 + to[j] = from[i];
116 + return to;
117 +};
118 +var __defProp = Object.defineProperty;
119 +var __defProps = Object.defineProperties;
120 +var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
121 +var __getOwnPropSymbols = Object.getOwnPropertySymbols;
122 +var __hasOwnProp = Object.prototype.hasOwnProperty;
123 +var __propIsEnum = Object.prototype.propertyIsEnumerable;
124 +var __defNormalProp = function (obj, key, value) { return key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value: value }) : obj[key] = value; };
125 +var __spreadValues = function (a, b) {
126 + for (var prop in b || (b = {}))
127 + if (__hasOwnProp.call(b, prop))
128 + __defNormalProp(a, prop, b[prop]);
129 + if (__getOwnPropSymbols)
130 + for (var _i = 0, _c = __getOwnPropSymbols(b); _i < _c.length; _i++) {
131 + var prop = _c[_i];
132 + if (__propIsEnum.call(b, prop))
133 + __defNormalProp(a, prop, b[prop]);
134 + }
135 + return a;
136 +};
137 +var __spreadProps = function (a, b) { return __defProps(a, __getOwnPropDescs(b)); };
138 +var __async = function (__this, __arguments, generator) {
139 + return new Promise(function (resolve, reject) {
140 + var fulfilled = function (value) {
141 + try {
142 + step(generator.next(value));
143 + }
144 + catch (e) {
145 + reject(e);
146 + }
147 + };
148 + var rejected = function (value) {
149 + try {
150 + step(generator.throw(value));
151 + }
152 + catch (e) {
153 + reject(e);
154 + }
155 + };
156 + var step = function (x) { return x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected); };
157 + step((generator = generator.apply(__this, __arguments)).next());
158 + });
159 +};
160 +// src/index.ts
161 +
162 +
163 +
164 +
165 +// src/createDraftSafeSelector.ts
166 +
167 +
168 +var createDraftSafeSelector = function () {
169 + var args = [];
170 + for (var _i = 0; _i < arguments.length; _i++) {
171 + args[_i] = arguments[_i];
172 + }
173 + var selector = reselect__WEBPACK_IMPORTED_MODULE_1__.createSelector.apply(void 0, args);
174 + var wrappedSelector = function (value) {
175 + var rest = [];
176 + for (var _i = 1; _i < arguments.length; _i++) {
177 + rest[_i - 1] = arguments[_i];
178 + }
179 + return selector.apply(void 0, __spreadArray([(0,immer__WEBPACK_IMPORTED_MODULE_2__.isDraft)(value) ? (0,immer__WEBPACK_IMPORTED_MODULE_2__.current)(value) : value], rest));
180 + };
181 + return wrappedSelector;
182 +};
183 +// src/configureStore.ts
184 +
185 +// src/devtoolsExtension.ts
186 +
187 +var composeWithDevTools = typeof window !== "undefined" && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ ? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ : function () {
188 + if (arguments.length === 0)
189 + return void 0;
190 + if (typeof arguments[0] === "object")
191 + return redux__WEBPACK_IMPORTED_MODULE_0__.compose;
192 + return redux__WEBPACK_IMPORTED_MODULE_0__.compose.apply(null, arguments);
193 +};
194 +var devToolsEnhancer = typeof window !== "undefined" && window.__REDUX_DEVTOOLS_EXTENSION__ ? window.__REDUX_DEVTOOLS_EXTENSION__ : function () {
195 + return function (noop2) {
196 + return noop2;
197 + };
198 +};
199 +// src/isPlainObject.ts
200 +function isPlainObject(value) {
201 + if (typeof value !== "object" || value === null)
202 + return false;
203 + var proto = Object.getPrototypeOf(value);
204 + if (proto === null)
205 + return true;
206 + var baseProto = proto;
207 + while (Object.getPrototypeOf(baseProto) !== null) {
208 + baseProto = Object.getPrototypeOf(baseProto);
209 + }
210 + return proto === baseProto;
211 +}
212 +// src/getDefaultMiddleware.ts
213 +
214 +// src/tsHelpers.ts
215 +var hasMatchFunction = function (v) {
216 + return v && typeof v.match === "function";
217 +};
218 +// src/createAction.ts
219 +function createAction(type, prepareAction) {
220 + function actionCreator() {
221 + var args = [];
222 + for (var _i = 0; _i < arguments.length; _i++) {
223 + args[_i] = arguments[_i];
224 + }
225 + if (prepareAction) {
226 + var prepared = prepareAction.apply(void 0, args);
227 + if (!prepared) {
228 + throw new Error("prepareAction did not return an object");
229 + }
230 + return __spreadValues(__spreadValues({
231 + type: type,
232 + payload: prepared.payload
233 + }, "meta" in prepared && { meta: prepared.meta }), "error" in prepared && { error: prepared.error });
234 + }
235 + return { type: type, payload: args[0] };
236 + }
237 + actionCreator.toString = function () { return "" + type; };
238 + actionCreator.type = type;
239 + actionCreator.match = function (action) { return action.type === type; };
240 + return actionCreator;
241 +}
242 +function isAction(action) {
243 + return isPlainObject(action) && "type" in action;
244 +}
245 +function isActionCreator(action) {
246 + return typeof action === "function" && "type" in action && hasMatchFunction(action);
247 +}
248 +function isFSA(action) {
249 + return isAction(action) && typeof action.type === "string" && Object.keys(action).every(isValidKey);
250 +}
251 +function isValidKey(key) {
252 + return ["type", "payload", "error", "meta"].indexOf(key) > -1;
253 +}
254 +function getType(actionCreator) {
255 + return "" + actionCreator;
256 +}
257 +// src/actionCreatorInvariantMiddleware.ts
258 +function getMessage(type) {
259 + var splitType = type ? ("" + type).split("/") : [];
260 + var actionName = splitType[splitType.length - 1] || "actionCreator";
261 + return "Detected an action creator with type \"" + (type || "unknown") + "\" being dispatched. \nMake sure you're calling the action creator before dispatching, i.e. `dispatch(" + actionName + "())` instead of `dispatch(" + actionName + ")`. This is necessary even if the action has no payload.";
262 +}
263 +function createActionCreatorInvariantMiddleware(options) {
264 + if (options === void 0) { options = {}; }
265 + if (false) {}
266 + var _c = options.isActionCreator, isActionCreator2 = _c === void 0 ? isActionCreator : _c;
267 + return function () { return function (next) { return function (action) {
268 + if (isActionCreator2(action)) {
269 + console.warn(getMessage(action.type));
270 + }
271 + return next(action);
272 + }; }; };
273 +}
274 +// src/utils.ts
275 +
276 +function getTimeMeasureUtils(maxDelay, fnName) {
277 + var elapsed = 0;
278 + return {
279 + measureTime: function (fn) {
280 + var started = Date.now();
281 + try {
282 + return fn();
283 + }
284 + finally {
285 + var finished = Date.now();
286 + elapsed += finished - started;
287 + }
288 + },
289 + warnIfExceeded: function () {
290 + if (elapsed > maxDelay) {
291 + 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.");
292 + }
293 + }
294 + };
295 +}
296 +var MiddlewareArray = /** @class */ (function (_super) {
297 + __extends(MiddlewareArray, _super);
298 + function MiddlewareArray() {
299 + var args = [];
300 + for (var _i = 0; _i < arguments.length; _i++) {
301 + args[_i] = arguments[_i];
302 + }
303 + var _this = _super.apply(this, args) || this;
304 + Object.setPrototypeOf(_this, MiddlewareArray.prototype);
305 + return _this;
306 + }
307 + Object.defineProperty(MiddlewareArray, Symbol.species, {
308 + get: function () {
309 + return MiddlewareArray;
310 + },
311 + enumerable: false,
312 + configurable: true
313 + });
314 + MiddlewareArray.prototype.concat = function () {
315 + var arr = [];
316 + for (var _i = 0; _i < arguments.length; _i++) {
317 + arr[_i] = arguments[_i];
318 + }
319 + return _super.prototype.concat.apply(this, arr);
320 + };
321 + MiddlewareArray.prototype.prepend = function () {
322 + var arr = [];
323 + for (var _i = 0; _i < arguments.length; _i++) {
324 + arr[_i] = arguments[_i];
325 + }
326 + if (arr.length === 1 && Array.isArray(arr[0])) {
327 + return new (MiddlewareArray.bind.apply(MiddlewareArray, __spreadArray([void 0], arr[0].concat(this))))();
328 + }
329 + return new (MiddlewareArray.bind.apply(MiddlewareArray, __spreadArray([void 0], arr.concat(this))))();
330 + };
331 + return MiddlewareArray;
332 +}(Array));
333 +var EnhancerArray = /** @class */ (function (_super) {
334 + __extends(EnhancerArray, _super);
335 + function EnhancerArray() {
336 + var args = [];
337 + for (var _i = 0; _i < arguments.length; _i++) {
338 + args[_i] = arguments[_i];
339 + }
340 + var _this = _super.apply(this, args) || this;
341 + Object.setPrototypeOf(_this, EnhancerArray.prototype);
342 + return _this;
343 + }
344 + Object.defineProperty(EnhancerArray, Symbol.species, {
345 + get: function () {
346 + return EnhancerArray;
347 + },
348 + enumerable: false,
349 + configurable: true
350 + });
351 + EnhancerArray.prototype.concat = function () {
352 + var arr = [];
353 + for (var _i = 0; _i < arguments.length; _i++) {
354 + arr[_i] = arguments[_i];
355 + }
356 + return _super.prototype.concat.apply(this, arr);
357 + };
358 + EnhancerArray.prototype.prepend = function () {
359 + var arr = [];
360 + for (var _i = 0; _i < arguments.length; _i++) {
361 + arr[_i] = arguments[_i];
362 + }
363 + if (arr.length === 1 && Array.isArray(arr[0])) {
364 + return new (EnhancerArray.bind.apply(EnhancerArray, __spreadArray([void 0], arr[0].concat(this))))();
365 + }
366 + return new (EnhancerArray.bind.apply(EnhancerArray, __spreadArray([void 0], arr.concat(this))))();
367 + };
368 + return EnhancerArray;
369 +}(Array));
370 +function freezeDraftable(val) {
371 + return (0,immer__WEBPACK_IMPORTED_MODULE_2__.isDraftable)(val) ? (0,immer__WEBPACK_IMPORTED_MODULE_2__["default"])(val, function () {
372 + }) : val;
373 +}
374 +// src/immutableStateInvariantMiddleware.ts
375 +var isProduction = "development" === "production";
376 +var prefix = "Invariant failed";
377 +function invariant(condition, message) {
378 + if (condition) {
379 + return;
380 + }
381 + if (isProduction) {
382 + throw new Error(prefix);
383 + }
384 + throw new Error(prefix + ": " + (message || ""));
385 +}
386 +function stringify(obj, serializer, indent, decycler) {
387 + return JSON.stringify(obj, getSerialize(serializer, decycler), indent);
388 +}
389 +function getSerialize(serializer, decycler) {
390 + var stack = [], keys = [];
391 + if (!decycler)
392 + decycler = function (_, value) {
393 + if (stack[0] === value)
394 + return "[Circular ~]";
395 + return "[Circular ~." + keys.slice(0, stack.indexOf(value)).join(".") + "]";
396 + };
397 + return function (key, value) {
398 + if (stack.length > 0) {
399 + var thisPos = stack.indexOf(this);
400 + ~thisPos ? stack.splice(thisPos + 1) : stack.push(this);
401 + ~thisPos ? keys.splice(thisPos, Infinity, key) : keys.push(key);
402 + if (~stack.indexOf(value))
403 + value = decycler.call(this, key, value);
404 + }
405 + else
406 + stack.push(value);
407 + return serializer == null ? value : serializer.call(this, key, value);
408 + };
409 +}
410 +function isImmutableDefault(value) {
411 + return typeof value !== "object" || value == null || Object.isFrozen(value);
412 +}
413 +function trackForMutations(isImmutable, ignorePaths, obj) {
414 + var trackedProperties = trackProperties(isImmutable, ignorePaths, obj);
415 + return {
416 + detectMutations: function () {
417 + return detectMutations(isImmutable, ignorePaths, trackedProperties, obj);
418 + }
419 + };
420 +}
421 +function trackProperties(isImmutable, ignorePaths, obj, path, checkedObjects) {
422 + if (ignorePaths === void 0) { ignorePaths = []; }
423 + if (path === void 0) { path = ""; }
424 + if (checkedObjects === void 0) { checkedObjects = new Set(); }
425 + var tracked = { value: obj };
426 + if (!isImmutable(obj) && !checkedObjects.has(obj)) {
427 + checkedObjects.add(obj);
428 + tracked.children = {};
429 + for (var key in obj) {
430 + var childPath = path ? path + "." + key : key;
431 + if (ignorePaths.length && ignorePaths.indexOf(childPath) !== -1) {
432 + continue;
433 + }
434 + tracked.children[key] = trackProperties(isImmutable, ignorePaths, obj[key], childPath);
435 + }
436 + }
437 + return tracked;
438 +}
439 +function detectMutations(isImmutable, ignoredPaths, trackedProperty, obj, sameParentRef, path) {
440 + if (ignoredPaths === void 0) { ignoredPaths = []; }
441 + if (sameParentRef === void 0) { sameParentRef = false; }
442 + if (path === void 0) { path = ""; }
443 + var prevObj = trackedProperty ? trackedProperty.value : void 0;
444 + var sameRef = prevObj === obj;
445 + if (sameParentRef && !sameRef && !Number.isNaN(obj)) {
446 + return { wasMutated: true, path: path };
447 + }
448 + if (isImmutable(prevObj) || isImmutable(obj)) {
449 + return { wasMutated: false };
450 + }
451 + var keysToDetect = {};
452 + for (var key in trackedProperty.children) {
453 + keysToDetect[key] = true;
454 + }
455 + for (var key in obj) {
456 + keysToDetect[key] = true;
457 + }
458 + var hasIgnoredPaths = ignoredPaths.length > 0;
459 + var _loop_1 = function (key) {
460 + var nestedPath = path ? path + "." + key : key;
461 + if (hasIgnoredPaths) {
462 + var hasMatches = ignoredPaths.some(function (ignored) {
463 + if (ignored instanceof RegExp) {
464 + return ignored.test(nestedPath);
465 + }
466 + return nestedPath === ignored;
467 + });
468 + if (hasMatches) {
469 + return "continue";
470 + }
471 + }
472 + var result = detectMutations(isImmutable, ignoredPaths, trackedProperty.children[key], obj[key], sameRef, nestedPath);
473 + if (result.wasMutated) {
474 + return { value: result };
475 + }
476 + };
477 + for (var key in keysToDetect) {
478 + var state_1 = _loop_1(key);
479 + if (typeof state_1 === "object")
480 + return state_1.value;
481 + }
482 + return { wasMutated: false };
483 +}
484 +function createImmutableStateInvariantMiddleware(options) {
485 + if (options === void 0) { options = {}; }
486 + if (false) {}
487 + 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;
488 + ignoredPaths = ignoredPaths || ignore;
489 + var track = trackForMutations.bind(null, isImmutable, ignoredPaths);
490 + return function (_c) {
491 + var getState = _c.getState;
492 + var state = getState();
493 + var tracker = track(state);
494 + var result;
495 + return function (next) { return function (action) {
496 + var measureUtils = getTimeMeasureUtils(warnAfter, "ImmutableStateInvariantMiddleware");
497 + measureUtils.measureTime(function () {
498 + state = getState();
499 + result = tracker.detectMutations();
500 + tracker = track(state);
501 + 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)");
502 + });
503 + var dispatchedAction = next(action);
504 + measureUtils.measureTime(function () {
505 + state = getState();
506 + result = tracker.detectMutations();
507 + tracker = track(state);
508 + 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)");
509 + });
510 + measureUtils.warnIfExceeded();
511 + return dispatchedAction;
512 + }; };
513 + };
514 +}
515 +// src/serializableStateInvariantMiddleware.ts
516 +function isPlain(val) {
517 + var type = typeof val;
518 + return val == null || type === "string" || type === "boolean" || type === "number" || Array.isArray(val) || isPlainObject(val);
519 +}
520 +function findNonSerializableValue(value, path, isSerializable, getEntries, ignoredPaths, cache) {
521 + if (path === void 0) { path = ""; }
522 + if (isSerializable === void 0) { isSerializable = isPlain; }
523 + if (ignoredPaths === void 0) { ignoredPaths = []; }
524 + var foundNestedSerializable;
525 + if (!isSerializable(value)) {
526 + return {
527 + keyPath: path || "<root>",
528 + value: value
529 + };
530 + }
531 + if (typeof value !== "object" || value === null) {
532 + return false;
533 + }
534 + if (cache == null ? void 0 : cache.has(value))
535 + return false;
536 + var entries = getEntries != null ? getEntries(value) : Object.entries(value);
537 + var hasIgnoredPaths = ignoredPaths.length > 0;
538 + var _loop_2 = function (key, nestedValue) {
539 + var nestedPath = path ? path + "." + key : key;
540 + if (hasIgnoredPaths) {
541 + var hasMatches = ignoredPaths.some(function (ignored) {
542 + if (ignored instanceof RegExp) {
543 + return ignored.test(nestedPath);
544 + }
545 + return nestedPath === ignored;
546 + });
547 + if (hasMatches) {
548 + return "continue";
549 + }
550 + }
551 + if (!isSerializable(nestedValue)) {
552 + return { value: {
553 + keyPath: nestedPath,
554 + value: nestedValue
555 + } };
556 + }
557 + if (typeof nestedValue === "object") {
558 + foundNestedSerializable = findNonSerializableValue(nestedValue, nestedPath, isSerializable, getEntries, ignoredPaths, cache);
559 + if (foundNestedSerializable) {
560 + return { value: foundNestedSerializable };
561 + }
562 + }
563 + };
564 + for (var _i = 0, entries_1 = entries; _i < entries_1.length; _i++) {
565 + var _c = entries_1[_i], key = _c[0], nestedValue = _c[1];
566 + var state_2 = _loop_2(key, nestedValue);
567 + if (typeof state_2 === "object")
568 + return state_2.value;
569 + }
570 + if (cache && isNestedFrozen(value))
571 + cache.add(value);
572 + return false;
573 +}
574 +function isNestedFrozen(value) {
575 + if (!Object.isFrozen(value))
576 + return false;
577 + for (var _i = 0, _c = Object.values(value); _i < _c.length; _i++) {
578 + var nestedValue = _c[_i];
579 + if (typeof nestedValue !== "object" || nestedValue === null)
580 + continue;
581 + if (!isNestedFrozen(nestedValue))
582 + return false;
583 + }
584 + return true;
585 +}
586 +function createSerializableStateInvariantMiddleware(options) {
587 + if (options === void 0) { options = {}; }
588 + if (false) {}
589 + 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;
590 + var cache = !disableCache && WeakSet ? new WeakSet() : void 0;
591 + return function (storeAPI) { return function (next) { return function (action) {
592 + var result = next(action);
593 + var measureUtils = getTimeMeasureUtils(warnAfter, "SerializableStateInvariantMiddleware");
594 + if (!ignoreActions && !(ignoredActions.length && ignoredActions.indexOf(action.type) !== -1)) {
595 + measureUtils.measureTime(function () {
596 + var foundActionNonSerializableValue = findNonSerializableValue(action, "", isSerializable, getEntries, ignoredActionPaths, cache);
597 + if (foundActionNonSerializableValue) {
598 + var keyPath = foundActionNonSerializableValue.keyPath, value = foundActionNonSerializableValue.value;
599 + 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)");
600 + }
601 + });
602 + }
603 + if (!ignoreState) {
604 + measureUtils.measureTime(function () {
605 + var state = storeAPI.getState();
606 + var foundStateNonSerializableValue = findNonSerializableValue(state, "", isSerializable, getEntries, ignoredPaths, cache);
607 + if (foundStateNonSerializableValue) {
608 + var keyPath = foundStateNonSerializableValue.keyPath, value = foundStateNonSerializableValue.value;
609 + 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)");
610 + }
611 + });
612 + measureUtils.warnIfExceeded();
613 + }
614 + return result;
615 + }; }; };
616 +}
617 +// src/getDefaultMiddleware.ts
618 +function isBoolean(x) {
619 + return typeof x === "boolean";
620 +}
621 +function curryGetDefaultMiddleware() {
622 + return function curriedGetDefaultMiddleware(options) {
623 + return getDefaultMiddleware(options);
624 + };
625 +}
626 +function getDefaultMiddleware(options) {
627 + if (options === void 0) { options = {}; }
628 + var _c = options.thunk, thunk = _c === void 0 ? true : _c, _d = options.immutableCheck, immutableCheck = _d === void 0 ? true : _d, _e = options.serializableCheck, serializableCheck = _e === void 0 ? true : _e, _f = options.actionCreatorCheck, actionCreatorCheck = _f === void 0 ? true : _f;
629 + var middlewareArray = new MiddlewareArray();
630 + if (thunk) {
631 + if (isBoolean(thunk)) {
632 + middlewareArray.push(redux_thunk__WEBPACK_IMPORTED_MODULE_3__["default"]);
633 + }
634 + else {
635 + middlewareArray.push(redux_thunk__WEBPACK_IMPORTED_MODULE_3__["default"].withExtraArgument(thunk.extraArgument));
636 + }
637 + }
638 + if (true) {
639 + if (immutableCheck) {
640 + var immutableOptions = {};
641 + if (!isBoolean(immutableCheck)) {
642 + immutableOptions = immutableCheck;
643 + }
644 + middlewareArray.unshift(createImmutableStateInvariantMiddleware(immutableOptions));
645 + }
646 + if (serializableCheck) {
647 + var serializableOptions = {};
648 + if (!isBoolean(serializableCheck)) {
649 + serializableOptions = serializableCheck;
650 + }
651 + middlewareArray.push(createSerializableStateInvariantMiddleware(serializableOptions));
652 + }
653 + if (actionCreatorCheck) {
654 + var actionCreatorOptions = {};
655 + if (!isBoolean(actionCreatorCheck)) {
656 + actionCreatorOptions = actionCreatorCheck;
657 + }
658 + middlewareArray.unshift(createActionCreatorInvariantMiddleware(actionCreatorOptions));
659 + }
660 + }
661 + return middlewareArray;
662 +}
663 +// src/configureStore.ts
664 +var IS_PRODUCTION = "development" === "production";
665 +function configureStore(options) {
666 + var curriedGetDefaultMiddleware = curryGetDefaultMiddleware();
667 + 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;
668 + var rootReducer;
669 + if (typeof reducer === "function") {
670 + rootReducer = reducer;
671 + }
672 + else if (isPlainObject(reducer)) {
673 + rootReducer = (0,redux__WEBPACK_IMPORTED_MODULE_0__.combineReducers)(reducer);
674 + }
675 + else {
676 + throw new Error('"reducer" is a required argument, and must be a function or an object of functions that can be passed to combineReducers');
677 + }
678 + var finalMiddleware = middleware;
679 + if (typeof finalMiddleware === "function") {
680 + finalMiddleware = finalMiddleware(curriedGetDefaultMiddleware);
681 + if (!IS_PRODUCTION && !Array.isArray(finalMiddleware)) {
682 + throw new Error("when using a middleware builder function, an array of middleware must be returned");
683 + }
684 + }
685 + if (!IS_PRODUCTION && finalMiddleware.some(function (item) { return typeof item !== "function"; })) {
686 + throw new Error("each middleware provided to configureStore must be a function");
687 + }
688 + var middlewareEnhancer = redux__WEBPACK_IMPORTED_MODULE_0__.applyMiddleware.apply(void 0, finalMiddleware);
689 + var finalCompose = redux__WEBPACK_IMPORTED_MODULE_0__.compose;
690 + if (devTools) {
691 + finalCompose = composeWithDevTools(__spreadValues({
692 + trace: !IS_PRODUCTION
693 + }, typeof devTools === "object" && devTools));
694 + }
695 + var defaultEnhancers = new EnhancerArray(middlewareEnhancer);
696 + var storeEnhancers = defaultEnhancers;
697 + if (Array.isArray(enhancers)) {
698 + storeEnhancers = __spreadArray([middlewareEnhancer], enhancers);
699 + }
700 + else if (typeof enhancers === "function") {
701 + storeEnhancers = enhancers(defaultEnhancers);
702 + }
703 + var composedEnhancer = finalCompose.apply(void 0, storeEnhancers);
704 + return (0,redux__WEBPACK_IMPORTED_MODULE_0__.createStore)(rootReducer, preloadedState, composedEnhancer);
705 +}
706 +// src/createReducer.ts
707 +
708 +// src/mapBuilders.ts
709 +function executeReducerBuilderCallback(builderCallback) {
710 + var actionsMap = {};
711 + var actionMatchers = [];
712 + var defaultCaseReducer;
713 + var builder = {
714 + addCase: function (typeOrActionCreator, reducer) {
715 + if (true) {
716 + if (actionMatchers.length > 0) {
717 + throw new Error("`builder.addCase` should only be called before calling `builder.addMatcher`");
718 + }
719 + if (defaultCaseReducer) {
720 + throw new Error("`builder.addCase` should only be called before calling `builder.addDefaultCase`");
721 + }
722 + }
723 + var type = typeof typeOrActionCreator === "string" ? typeOrActionCreator : typeOrActionCreator.type;
724 + if (!type) {
725 + throw new Error("`builder.addCase` cannot be called with an empty action type");
726 + }
727 + if (type in actionsMap) {
728 + throw new Error("`builder.addCase` cannot be called with two reducers for the same action type");
729 + }
730 + actionsMap[type] = reducer;
731 + return builder;
732 + },
733 + addMatcher: function (matcher, reducer) {
734 + if (true) {
735 + if (defaultCaseReducer) {
736 + throw new Error("`builder.addMatcher` should only be called before calling `builder.addDefaultCase`");
737 + }
738 + }
739 + actionMatchers.push({ matcher: matcher, reducer: reducer });
740 + return builder;
741 + },
742 + addDefaultCase: function (reducer) {
743 + if (true) {
744 + if (defaultCaseReducer) {
745 + throw new Error("`builder.addDefaultCase` can only be called once");
746 + }
747 + }
748 + defaultCaseReducer = reducer;
749 + return builder;
750 + }
751 + };
752 + builderCallback(builder);
753 + return [actionsMap, actionMatchers, defaultCaseReducer];
754 +}
755 +// src/createReducer.ts
756 +function isStateFunction(x) {
757 + return typeof x === "function";
758 +}
759 +var hasWarnedAboutObjectNotation = false;
760 +function createReducer(initialState, mapOrBuilderCallback, actionMatchers, defaultCaseReducer) {
761 + if (actionMatchers === void 0) { actionMatchers = []; }
762 + if (true) {
763 + if (typeof mapOrBuilderCallback === "object") {
764 + if (!hasWarnedAboutObjectNotation) {
765 + hasWarnedAboutObjectNotation = true;
766 + 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");
767 + }
768 + }
769 + }
770 + var _c = typeof mapOrBuilderCallback === "function" ? executeReducerBuilderCallback(mapOrBuilderCallback) : [mapOrBuilderCallback, actionMatchers, defaultCaseReducer], actionsMap = _c[0], finalActionMatchers = _c[1], finalDefaultCaseReducer = _c[2];
771 + var getInitialState;
772 + if (isStateFunction(initialState)) {
773 + getInitialState = function () { return freezeDraftable(initialState()); };
774 + }
775 + else {
776 + var frozenInitialState_1 = freezeDraftable(initialState);
777 + getInitialState = function () { return frozenInitialState_1; };
778 + }
779 + function reducer(state, action) {
780 + if (state === void 0) { state = getInitialState(); }
781 + var caseReducers = __spreadArray([
782 + actionsMap[action.type]
783 + ], finalActionMatchers.filter(function (_c) {
784 + var matcher = _c.matcher;
785 + return matcher(action);
786 + }).map(function (_c) {
787 + var reducer2 = _c.reducer;
788 + return reducer2;
789 + }));
790 + if (caseReducers.filter(function (cr) { return !!cr; }).length === 0) {
791 + caseReducers = [finalDefaultCaseReducer];
792 + }
793 + return caseReducers.reduce(function (previousState, caseReducer) {
794 + if (caseReducer) {
795 + if ((0,immer__WEBPACK_IMPORTED_MODULE_2__.isDraft)(previousState)) {
796 + var draft = previousState;
797 + var result = caseReducer(draft, action);
798 + if (result === void 0) {
799 + return previousState;
800 + }
801 + return result;
802 + }
803 + else if (!(0,immer__WEBPACK_IMPORTED_MODULE_2__.isDraftable)(previousState)) {
804 + var result = caseReducer(previousState, action);
805 + if (result === void 0) {
806 + if (previousState === null) {
807 + return previousState;
808 + }
809 + throw Error("A case reducer on a non-draftable value must not return undefined");
810 + }
811 + return result;
812 + }
813 + else {
814 + return (0,immer__WEBPACK_IMPORTED_MODULE_2__["default"])(previousState, function (draft) {
815 + return caseReducer(draft, action);
816 + });
817 + }
818 + }
819 + return previousState;
820 + }, state);
821 + }
822 + reducer.getInitialState = getInitialState;
823 + return reducer;
824 +}
825 +// src/createSlice.ts
826 +var hasWarnedAboutObjectNotation2 = false;
827 +function getType2(slice, actionKey) {
828 + return slice + "/" + actionKey;
829 +}
830 +function createSlice(options) {
831 + var name = options.name;
832 + if (!name) {
833 + throw new Error("`name` is a required option for createSlice");
834 + }
835 + if (typeof process !== "undefined" && "development" === "development") {
836 + if (options.initialState === void 0) {
837 + console.error("You must provide an `initialState` value that is not `undefined`. You may have misspelled `initialState`");
838 + }
839 + }
840 + var initialState = typeof options.initialState == "function" ? options.initialState : freezeDraftable(options.initialState);
841 + var reducers = options.reducers || {};
842 + var reducerNames = Object.keys(reducers);
843 + var sliceCaseReducersByName = {};
844 + var sliceCaseReducersByType = {};
845 + var actionCreators = {};
846 + reducerNames.forEach(function (reducerName) {
847 + var maybeReducerWithPrepare = reducers[reducerName];
848 + var type = getType2(name, reducerName);
849 + var caseReducer;
850 + var prepareCallback;
851 + if ("reducer" in maybeReducerWithPrepare) {
852 + caseReducer = maybeReducerWithPrepare.reducer;
853 + prepareCallback = maybeReducerWithPrepare.prepare;
854 + }
855 + else {
856 + caseReducer = maybeReducerWithPrepare;
857 + }
858 + sliceCaseReducersByName[reducerName] = caseReducer;
859 + sliceCaseReducersByType[type] = caseReducer;
860 + actionCreators[reducerName] = prepareCallback ? createAction(type, prepareCallback) : createAction(type);
861 + });
862 + function buildReducer() {
863 + if (true) {
864 + if (typeof options.extraReducers === "object") {
865 + if (!hasWarnedAboutObjectNotation2) {
866 + hasWarnedAboutObjectNotation2 = true;
867 + 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");
868 + }
869 + }
870 + }
871 + 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;
872 + var finalCaseReducers = __spreadValues(__spreadValues({}, extraReducers), sliceCaseReducersByType);
873 + return createReducer(initialState, function (builder) {
874 + for (var key in finalCaseReducers) {
875 + builder.addCase(key, finalCaseReducers[key]);
876 + }
877 + for (var _i = 0, actionMatchers_1 = actionMatchers; _i < actionMatchers_1.length; _i++) {
878 + var m = actionMatchers_1[_i];
879 + builder.addMatcher(m.matcher, m.reducer);
880 + }
881 + if (defaultCaseReducer) {
882 + builder.addDefaultCase(defaultCaseReducer);
883 + }
884 + });
885 + }
886 + var _reducer;
887 + return {
888 + name: name,
889 + reducer: function (state, action) {
890 + if (!_reducer)
891 + _reducer = buildReducer();
892 + return _reducer(state, action);
893 + },
894 + actions: actionCreators,
895 + caseReducers: sliceCaseReducersByName,
896 + getInitialState: function () {
897 + if (!_reducer)
898 + _reducer = buildReducer();
899 + return _reducer.getInitialState();
900 + }
901 + };
902 +}
903 +// src/entities/entity_state.ts
904 +function getInitialEntityState() {
905 + return {
906 + ids: [],
907 + entities: {}
908 + };
909 +}
910 +function createInitialStateFactory() {
911 + function getInitialState(additionalState) {
912 + if (additionalState === void 0) { additionalState = {}; }
913 + return Object.assign(getInitialEntityState(), additionalState);
914 + }
915 + return { getInitialState: getInitialState };
916 +}
917 +// src/entities/state_selectors.ts
918 +function createSelectorsFactory() {
919 + function getSelectors(selectState) {
920 + var selectIds = function (state) { return state.ids; };
921 + var selectEntities = function (state) { return state.entities; };
922 + var selectAll = createDraftSafeSelector(selectIds, selectEntities, function (ids, entities) { return ids.map(function (id) { return entities[id]; }); });
923 + var selectId = function (_, id) { return id; };
924 + var selectById = function (entities, id) { return entities[id]; };
925 + var selectTotal = createDraftSafeSelector(selectIds, function (ids) { return ids.length; });
926 + if (!selectState) {
927 + return {
928 + selectIds: selectIds,
929 + selectEntities: selectEntities,
930 + selectAll: selectAll,
931 + selectTotal: selectTotal,
932 + selectById: createDraftSafeSelector(selectEntities, selectId, selectById)
933 + };
934 + }
935 + var selectGlobalizedEntities = createDraftSafeSelector(selectState, selectEntities);
936 + return {
937 + selectIds: createDraftSafeSelector(selectState, selectIds),
938 + selectEntities: selectGlobalizedEntities,
939 + selectAll: createDraftSafeSelector(selectState, selectAll),
940 + selectTotal: createDraftSafeSelector(selectState, selectTotal),
941 + selectById: createDraftSafeSelector(selectGlobalizedEntities, selectId, selectById)
942 + };
943 + }
944 + return { getSelectors: getSelectors };
945 +}
946 +// src/entities/state_adapter.ts
947 +
948 +function createSingleArgumentStateOperator(mutator) {
949 + var operator = createStateOperator(function (_, state) { return mutator(state); });
950 + return function operation(state) {
951 + return operator(state, void 0);
952 + };
953 +}
954 +function createStateOperator(mutator) {
955 + return function operation(state, arg) {
956 + function isPayloadActionArgument(arg2) {
957 + return isFSA(arg2);
958 + }
959 + var runMutator = function (draft) {
960 + if (isPayloadActionArgument(arg)) {
961 + mutator(arg.payload, draft);
962 + }
963 + else {
964 + mutator(arg, draft);
965 + }
966 + };
967 + if ((0,immer__WEBPACK_IMPORTED_MODULE_2__.isDraft)(state)) {
968 + runMutator(state);
969 + return state;
970 + }
971 + else {
972 + return (0,immer__WEBPACK_IMPORTED_MODULE_2__["default"])(state, runMutator);
973 + }
974 + };
975 +}
976 +// src/entities/utils.ts
977 +function selectIdValue(entity, selectId) {
978 + var key = selectId(entity);
979 + if ( true && key === void 0) {
980 + 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());
981 + }
982 + return key;
983 +}
984 +function ensureEntitiesArray(entities) {
985 + if (!Array.isArray(entities)) {
986 + entities = Object.values(entities);
987 + }
988 + return entities;
989 +}
990 +function splitAddedUpdatedEntities(newEntities, selectId, state) {
991 + newEntities = ensureEntitiesArray(newEntities);
992 + var added = [];
993 + var updated = [];
994 + for (var _i = 0, newEntities_1 = newEntities; _i < newEntities_1.length; _i++) {
995 + var entity = newEntities_1[_i];
996 + var id = selectIdValue(entity, selectId);
997 + if (id in state.entities) {
998 + updated.push({ id: id, changes: entity });
999 + }
1000 + else {
1001 + added.push(entity);
1002 + }
1003 + }
1004 + return [added, updated];
1005 +}
1006 +// src/entities/unsorted_state_adapter.ts
1007 +function createUnsortedStateAdapter(selectId) {
1008 + function addOneMutably(entity, state) {
1009 + var key = selectIdValue(entity, selectId);
1010 + if (key in state.entities) {
1011 + return;
1012 + }
1013 + state.ids.push(key);
1014 + state.entities[key] = entity;
1015 + }
1016 + function addManyMutably(newEntities, state) {
1017 + newEntities = ensureEntitiesArray(newEntities);
1018 + for (var _i = 0, newEntities_2 = newEntities; _i < newEntities_2.length; _i++) {
1019 + var entity = newEntities_2[_i];
1020 + addOneMutably(entity, state);
1021 + }
1022 + }
1023 + function setOneMutably(entity, state) {
1024 + var key = selectIdValue(entity, selectId);
1025 + if (!(key in state.entities)) {
1026 + state.ids.push(key);
1027 + }
1028 + state.entities[key] = entity;
1029 + }
1030 + function setManyMutably(newEntities, state) {
1031 + newEntities = ensureEntitiesArray(newEntities);
1032 + for (var _i = 0, newEntities_3 = newEntities; _i < newEntities_3.length; _i++) {
1033 + var entity = newEntities_3[_i];
1034 + setOneMutably(entity, state);
1035 + }
1036 + }
1037 + function setAllMutably(newEntities, state) {
1038 + newEntities = ensureEntitiesArray(newEntities);
1039 + state.ids = [];
1040 + state.entities = {};
1041 + addManyMutably(newEntities, state);
1042 + }
1043 + function removeOneMutably(key, state) {
1044 + return removeManyMutably([key], state);
1045 + }
1046 + function removeManyMutably(keys, state) {
1047 + var didMutate = false;
1048 + keys.forEach(function (key) {
1049 + if (key in state.entities) {
1050 + delete state.entities[key];
1051 + didMutate = true;
1052 + }
1053 + });
1054 + if (didMutate) {
1055 + state.ids = state.ids.filter(function (id) { return id in state.entities; });
1056 + }
1057 + }
1058 + function removeAllMutably(state) {
1059 + Object.assign(state, {
1060 + ids: [],
1061 + entities: {}
1062 + });
1063 + }
1064 + function takeNewKey(keys, update, state) {
1065 + var original2 = state.entities[update.id];
1066 + var updated = Object.assign({}, original2, update.changes);
1067 + var newKey = selectIdValue(updated, selectId);
1068 + var hasNewKey = newKey !== update.id;
1069 + if (hasNewKey) {
1070 + keys[update.id] = newKey;
1071 + delete state.entities[update.id];
1072 + }
1073 + state.entities[newKey] = updated;
1074 + return hasNewKey;
1075 + }
1076 + function updateOneMutably(update, state) {
1077 + return updateManyMutably([update], state);
1078 + }
1079 + function updateManyMutably(updates, state) {
1080 + var newKeys = {};
1081 + var updatesPerEntity = {};
1082 + updates.forEach(function (update) {
1083 + if (update.id in state.entities) {
1084 + updatesPerEntity[update.id] = {
1085 + id: update.id,
1086 + changes: __spreadValues(__spreadValues({}, updatesPerEntity[update.id] ? updatesPerEntity[update.id].changes : null), update.changes)
1087 + };
1088 + }
1089 + });
1090 + updates = Object.values(updatesPerEntity);
1091 + var didMutateEntities = updates.length > 0;
1092 + if (didMutateEntities) {
1093 + var didMutateIds = updates.filter(function (update) { return takeNewKey(newKeys, update, state); }).length > 0;
1094 + if (didMutateIds) {
1095 + state.ids = Object.keys(state.entities);
1096 + }
1097 + }
1098 + }
1099 + function upsertOneMutably(entity, state) {
1100 + return upsertManyMutably([entity], state);
1101 + }
1102 + function upsertManyMutably(newEntities, state) {
1103 + var _c = splitAddedUpdatedEntities(newEntities, selectId, state), added = _c[0], updated = _c[1];
1104 + updateManyMutably(updated, state);
1105 + addManyMutably(added, state);
1106 + }
1107 + return {
1108 + removeAll: createSingleArgumentStateOperator(removeAllMutably),
1109 + addOne: createStateOperator(addOneMutably),
1110 + addMany: createStateOperator(addManyMutably),
1111 + setOne: createStateOperator(setOneMutably),
1112 + setMany: createStateOperator(setManyMutably),
1113 + setAll: createStateOperator(setAllMutably),
1114 + updateOne: createStateOperator(updateOneMutably),
1115 + updateMany: createStateOperator(updateManyMutably),
1116 + upsertOne: createStateOperator(upsertOneMutably),
1117 + upsertMany: createStateOperator(upsertManyMutably),
1118 + removeOne: createStateOperator(removeOneMutably),
1119 + removeMany: createStateOperator(removeManyMutably)
1120 + };
1121 +}
1122 +// src/entities/sorted_state_adapter.ts
1123 +function createSortedStateAdapter(selectId, sort) {
1124 + var _c = createUnsortedStateAdapter(selectId), removeOne = _c.removeOne, removeMany = _c.removeMany, removeAll = _c.removeAll;
1125 + function addOneMutably(entity, state) {
1126 + return addManyMutably([entity], state);
1127 + }
1128 + function addManyMutably(newEntities, state) {
1129 + newEntities = ensureEntitiesArray(newEntities);
1130 + var models = newEntities.filter(function (model) { return !(selectIdValue(model, selectId) in state.entities); });
1131 + if (models.length !== 0) {
1132 + merge(models, state);
1133 + }
1134 + }
1135 + function setOneMutably(entity, state) {
1136 + return setManyMutably([entity], state);
1137 + }
1138 + function setManyMutably(newEntities, state) {
1139 + newEntities = ensureEntitiesArray(newEntities);
1140 + if (newEntities.length !== 0) {
1141 + merge(newEntities, state);
1142 + }
1143 + }
1144 + function setAllMutably(newEntities, state) {
1145 + newEntities = ensureEntitiesArray(newEntities);
1146 + state.entities = {};
1147 + state.ids = [];
1148 + addManyMutably(newEntities, state);
1149 + }
1150 + function updateOneMutably(update, state) {
1151 + return updateManyMutably([update], state);
1152 + }
1153 + function updateManyMutably(updates, state) {
1154 + var appliedUpdates = false;
1155 + for (var _i = 0, updates_1 = updates; _i < updates_1.length; _i++) {
1156 + var update = updates_1[_i];
1157 + var entity = state.entities[update.id];
1158 + if (!entity) {
1159 + continue;
1160 + }
1161 + appliedUpdates = true;
1162 + Object.assign(entity, update.changes);
1163 + var newId = selectId(entity);
1164 + if (update.id !== newId) {
1165 + delete state.entities[update.id];
1166 + state.entities[newId] = entity;
1167 + }
1168 + }
1169 + if (appliedUpdates) {
1170 + resortEntities(state);
1171 + }
1172 + }
1173 + function upsertOneMutably(entity, state) {
1174 + return upsertManyMutably([entity], state);
1175 + }
1176 + function upsertManyMutably(newEntities, state) {
1177 + var _c = splitAddedUpdatedEntities(newEntities, selectId, state), added = _c[0], updated = _c[1];
1178 + updateManyMutably(updated, state);
1179 + addManyMutably(added, state);
1180 + }
1181 + function areArraysEqual(a, b) {
1182 + if (a.length !== b.length) {
1183 + return false;
1184 + }
1185 + for (var i = 0; i < a.length && i < b.length; i++) {
1186 + if (a[i] === b[i]) {
1187 + continue;
1188 + }
1189 + return false;
1190 + }
1191 + return true;
1192 + }
1193 + function merge(models, state) {
1194 + models.forEach(function (model) {
1195 + state.entities[selectId(model)] = model;
1196 + });
1197 + resortEntities(state);
1198 + }
1199 + function resortEntities(state) {
1200 + var allEntities = Object.values(state.entities);
1201 + allEntities.sort(sort);
1202 + var newSortedIds = allEntities.map(selectId);
1203 + var ids = state.ids;
1204 + if (!areArraysEqual(ids, newSortedIds)) {
1205 + state.ids = newSortedIds;
1206 + }
1207 + }
1208 + return {
1209 + removeOne: removeOne,
1210 + removeMany: removeMany,
1211 + removeAll: removeAll,
1212 + addOne: createStateOperator(addOneMutably),
1213 + updateOne: createStateOperator(updateOneMutably),
1214 + upsertOne: createStateOperator(upsertOneMutably),
1215 + setOne: createStateOperator(setOneMutably),
1216 + setMany: createStateOperator(setManyMutably),
1217 + setAll: createStateOperator(setAllMutably),
1218 + addMany: createStateOperator(addManyMutably),
1219 + updateMany: createStateOperator(updateManyMutably),
1220 + upsertMany: createStateOperator(upsertManyMutably)
1221 + };
1222 +}
1223 +// src/entities/create_adapter.ts
1224 +function createEntityAdapter(options) {
1225 + if (options === void 0) { options = {}; }
1226 + var _c = __spreadValues({
1227 + sortComparer: false,
1228 + selectId: function (instance) { return instance.id; }
1229 + }, options), selectId = _c.selectId, sortComparer = _c.sortComparer;
1230 + var stateFactory = createInitialStateFactory();
1231 + var selectorsFactory = createSelectorsFactory();
1232 + var stateAdapter = sortComparer ? createSortedStateAdapter(selectId, sortComparer) : createUnsortedStateAdapter(selectId);
1233 + return __spreadValues(__spreadValues(__spreadValues({
1234 + selectId: selectId,
1235 + sortComparer: sortComparer
1236 + }, stateFactory), selectorsFactory), stateAdapter);
1237 +}
1238 +// src/nanoid.ts
1239 +var urlAlphabet = "ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW";
1240 +var nanoid = function (size) {
1241 + if (size === void 0) { size = 21; }
1242 + var id = "";
1243 + var i = size;
1244 + while (i--) {
1245 + id += urlAlphabet[Math.random() * 64 | 0];
1246 + }
1247 + return id;
1248 +};
1249 +// src/createAsyncThunk.ts
1250 +var commonProperties = [
1251 + "name",
1252 + "message",
1253 + "stack",
1254 + "code"
1255 +];
1256 +var RejectWithValue = /** @class */ (function () {
1257 + function RejectWithValue(payload, meta) {
1258 + this.payload = payload;
1259 + this.meta = meta;
1260 + }
1261 + return RejectWithValue;
1262 +}());
1263 +var FulfillWithMeta = /** @class */ (function () {
1264 + function FulfillWithMeta(payload, meta) {
1265 + this.payload = payload;
1266 + this.meta = meta;
1267 + }
1268 + return FulfillWithMeta;
1269 +}());
1270 +var miniSerializeError = function (value) {
1271 + if (typeof value === "object" && value !== null) {
1272 + var simpleError = {};
1273 + for (var _i = 0, commonProperties_1 = commonProperties; _i < commonProperties_1.length; _i++) {
1274 + var property = commonProperties_1[_i];
1275 + if (typeof value[property] === "string") {
1276 + simpleError[property] = value[property];
1277 + }
1278 + }
1279 + return simpleError;
1280 + }
1281 + return { message: String(value) };
1282 +};
1283 +var createAsyncThunk = (function () {
1284 + function createAsyncThunk2(typePrefix, payloadCreator, options) {
1285 + var fulfilled = createAction(typePrefix + "/fulfilled", function (payload, requestId, arg, meta) { return ({
1286 + payload: payload,
1287 + meta: __spreadProps(__spreadValues({}, meta || {}), {
1288 + arg: arg,
1289 + requestId: requestId,
1290 + requestStatus: "fulfilled"
1291 + })
1292 + }); });
1293 + var pending = createAction(typePrefix + "/pending", function (requestId, arg, meta) { return ({
1294 + payload: void 0,
1295 + meta: __spreadProps(__spreadValues({}, meta || {}), {
1296 + arg: arg,
1297 + requestId: requestId,
1298 + requestStatus: "pending"
1299 + })
1300 + }); });
1301 + var rejected = createAction(typePrefix + "/rejected", function (error, requestId, arg, payload, meta) { return ({
1302 + payload: payload,
1303 + error: (options && options.serializeError || miniSerializeError)(error || "Rejected"),
1304 + meta: __spreadProps(__spreadValues({}, meta || {}), {
1305 + arg: arg,
1306 + requestId: requestId,
1307 + rejectedWithValue: !!payload,
1308 + requestStatus: "rejected",
1309 + aborted: (error == null ? void 0 : error.name) === "AbortError",
1310 + condition: (error == null ? void 0 : error.name) === "ConditionError"
1311 + })
1312 + }); });
1313 + var displayedWarning = false;
1314 + var AC = typeof AbortController !== "undefined" ? AbortController : /** @class */ (function () {
1315 + function class_1() {
1316 + this.signal = {
1317 + aborted: false,
1318 + addEventListener: function () {
1319 + },
1320 + dispatchEvent: function () {
1321 + return false;
1322 + },
1323 + onabort: function () {
1324 + },
1325 + removeEventListener: function () {
1326 + },
1327 + reason: void 0,
1328 + throwIfAborted: function () {
1329 + }
1330 + };
1331 + }
1332 + class_1.prototype.abort = function () {
1333 + if (true) {
1334 + if (!displayedWarning) {
1335 + displayedWarning = true;
1336 + 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'.");
1337 + }
1338 + }
1339 + };
1340 + return class_1;
1341 + }());
1342 + function actionCreator(arg) {
1343 + return function (dispatch, getState, extra) {
1344 + var requestId = (options == null ? void 0 : options.idGenerator) ? options.idGenerator(arg) : nanoid();
1345 + var abortController = new AC();
1346 + var abortReason;
1347 + var started = false;
1348 + function abort(reason) {
1349 + abortReason = reason;
1350 + abortController.abort();
1351 + }
1352 + var promise2 = function () {
1353 + return __async(this, null, function () {
1354 + var _a, _b, finalAction, conditionResult, abortedPromise, err_1, skipDispatch;
1355 + return __generator(this, function (_c) {
1356 + switch (_c.label) {
1357 + case 0:
1358 + _c.trys.push([0, 4, , 5]);
1359 + conditionResult = (_a = options == null ? void 0 : options.condition) == null ? void 0 : _a.call(options, arg, { getState: getState, extra: extra });
1360 + if (!isThenable(conditionResult)) return [3 /*break*/, 2];
1361 + return [4 /*yield*/, conditionResult];
1362 + case 1:
1363 + conditionResult = _c.sent();
1364 + _c.label = 2;
1365 + case 2:
1366 + if (conditionResult === false || abortController.signal.aborted) {
1367 + throw {
1368 + name: "ConditionError",
1369 + message: "Aborted due to condition callback returning false."
1370 + };
1371 + }
1372 + started = true;
1373 + abortedPromise = new Promise(function (_, reject) { return abortController.signal.addEventListener("abort", function () { return reject({
1374 + name: "AbortError",
1375 + message: abortReason || "Aborted"
1376 + }); }); });
1377 + 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 })));
1378 + return [4 /*yield*/, Promise.race([
1379 + abortedPromise,
1380 + Promise.resolve(payloadCreator(arg, {
1381 + dispatch: dispatch,
1382 + getState: getState,
1383 + extra: extra,
1384 + requestId: requestId,
1385 + signal: abortController.signal,
1386 + abort: abort,
1387 + rejectWithValue: function (value, meta) {
1388 + return new RejectWithValue(value, meta);
1389 + },
1390 + fulfillWithValue: function (value, meta) {
1391 + return new FulfillWithMeta(value, meta);
1392 + }
1393 + })).then(function (result) {
1394 + if (result instanceof RejectWithValue) {
1395 + throw result;
1396 + }
1397 + if (result instanceof FulfillWithMeta) {
1398 + return fulfilled(result.payload, requestId, arg, result.meta);
1399 + }
1400 + return fulfilled(result, requestId, arg);
1401 + })
1402 + ])];
1403 + case 3:
1404 + finalAction = _c.sent();
1405 + return [3 /*break*/, 5];
1406 + case 4:
1407 + err_1 = _c.sent();
1408 + finalAction = err_1 instanceof RejectWithValue ? rejected(null, requestId, arg, err_1.payload, err_1.meta) : rejected(err_1, requestId, arg);
1409 + return [3 /*break*/, 5];
1410 + case 5:
1411 + skipDispatch = options && !options.dispatchConditionRejection && rejected.match(finalAction) && finalAction.meta.condition;
1412 + if (!skipDispatch) {
1413 + dispatch(finalAction);
1414 + }
1415 + return [2 /*return*/, finalAction];
1416 + }
1417 + });
1418 + });
1419 + }();
1420 + return Object.assign(promise2, {
1421 + abort: abort,
1422 + requestId: requestId,
1423 + arg: arg,
1424 + unwrap: function () {
1425 + return promise2.then(unwrapResult);
1426 + }
1427 + });
1428 + };
1429 + }
1430 + return Object.assign(actionCreator, {
1431 + pending: pending,
1432 + rejected: rejected,
1433 + fulfilled: fulfilled,
1434 + typePrefix: typePrefix
1435 + });
1436 + }
1437 + createAsyncThunk2.withTypes = function () { return createAsyncThunk2; };
1438 + return createAsyncThunk2;
1439 +})();
1440 +function unwrapResult(action) {
1441 + if (action.meta && action.meta.rejectedWithValue) {
1442 + throw action.payload;
1443 + }
1444 + if (action.error) {
1445 + throw action.error;
1446 + }
1447 + return action.payload;
1448 +}
1449 +function isThenable(value) {
1450 + return value !== null && typeof value === "object" && typeof value.then === "function";
1451 +}
1452 +// src/matchers.ts
1453 +var matches = function (matcher, action) {
1454 + if (hasMatchFunction(matcher)) {
1455 + return matcher.match(action);
1456 + }
1457 + else {
1458 + return matcher(action);
1459 + }
1460 +};
1461 +function isAnyOf() {
1462 + var matchers = [];
1463 + for (var _i = 0; _i < arguments.length; _i++) {
1464 + matchers[_i] = arguments[_i];
1465 + }
1466 + return function (action) {
1467 + return matchers.some(function (matcher) { return matches(matcher, action); });
1468 + };
1469 +}
1470 +function isAllOf() {
1471 + var matchers = [];
1472 + for (var _i = 0; _i < arguments.length; _i++) {
1473 + matchers[_i] = arguments[_i];
1474 + }
1475 + return function (action) {
1476 + return matchers.every(function (matcher) { return matches(matcher, action); });
1477 + };
1478 +}
1479 +function hasExpectedRequestMetadata(action, validStatus) {
1480 + if (!action || !action.meta)
1481 + return false;
1482 + var hasValidRequestId = typeof action.meta.requestId === "string";
1483 + var hasValidRequestStatus = validStatus.indexOf(action.meta.requestStatus) > -1;
1484 + return hasValidRequestId && hasValidRequestStatus;
1485 +}
1486 +function isAsyncThunkArray(a) {
1487 + return typeof a[0] === "function" && "pending" in a[0] && "fulfilled" in a[0] && "rejected" in a[0];
1488 +}
1489 +function isPending() {
1490 + var asyncThunks = [];
1491 + for (var _i = 0; _i < arguments.length; _i++) {
1492 + asyncThunks[_i] = arguments[_i];
1493 + }
1494 + if (asyncThunks.length === 0) {
1495 + return function (action) { return hasExpectedRequestMetadata(action, ["pending"]); };
1496 + }
1497 + if (!isAsyncThunkArray(asyncThunks)) {
1498 + return isPending()(asyncThunks[0]);
1499 + }
1500 + return function (action) {
1501 + var matchers = asyncThunks.map(function (asyncThunk) { return asyncThunk.pending; });
1502 + var combinedMatcher = isAnyOf.apply(void 0, matchers);
1503 + return combinedMatcher(action);
1504 + };
1505 +}
1506 +function isRejected() {
1507 + var asyncThunks = [];
1508 + for (var _i = 0; _i < arguments.length; _i++) {
1509 + asyncThunks[_i] = arguments[_i];
1510 + }
1511 + if (asyncThunks.length === 0) {
1512 + return function (action) { return hasExpectedRequestMetadata(action, ["rejected"]); };
1513 + }
1514 + if (!isAsyncThunkArray(asyncThunks)) {
1515 + return isRejected()(asyncThunks[0]);
1516 + }
1517 + return function (action) {
1518 + var matchers = asyncThunks.map(function (asyncThunk) { return asyncThunk.rejected; });
1519 + var combinedMatcher = isAnyOf.apply(void 0, matchers);
1520 + return combinedMatcher(action);
1521 + };
1522 +}
1523 +function isRejectedWithValue() {
1524 + var asyncThunks = [];
1525 + for (var _i = 0; _i < arguments.length; _i++) {
1526 + asyncThunks[_i] = arguments[_i];
1527 + }
1528 + var hasFlag = function (action) {
1529 + return action && action.meta && action.meta.rejectedWithValue;
1530 + };
1531 + if (asyncThunks.length === 0) {
1532 + return function (action) {
1533 + var combinedMatcher = isAllOf(isRejected.apply(void 0, asyncThunks), hasFlag);
1534 + return combinedMatcher(action);
1535 + };
1536 + }
1537 + if (!isAsyncThunkArray(asyncThunks)) {
1538 + return isRejectedWithValue()(asyncThunks[0]);
1539 + }
1540 + return function (action) {
1541 + var combinedMatcher = isAllOf(isRejected.apply(void 0, asyncThunks), hasFlag);
1542 + return combinedMatcher(action);
1543 + };
1544 +}
1545 +function isFulfilled() {
1546 + var asyncThunks = [];
1547 + for (var _i = 0; _i < arguments.length; _i++) {
1548 + asyncThunks[_i] = arguments[_i];
1549 + }
1550 + if (asyncThunks.length === 0) {
1551 + return function (action) { return hasExpectedRequestMetadata(action, ["fulfilled"]); };
1552 + }
1553 + if (!isAsyncThunkArray(asyncThunks)) {
1554 + return isFulfilled()(asyncThunks[0]);
1555 + }
1556 + return function (action) {
1557 + var matchers = asyncThunks.map(function (asyncThunk) { return asyncThunk.fulfilled; });
1558 + var combinedMatcher = isAnyOf.apply(void 0, matchers);
1559 + return combinedMatcher(action);
1560 + };
1561 +}
1562 +function isAsyncThunkAction() {
1563 + var asyncThunks = [];
1564 + for (var _i = 0; _i < arguments.length; _i++) {
1565 + asyncThunks[_i] = arguments[_i];
1566 + }
1567 + if (asyncThunks.length === 0) {
1568 + return function (action) { return hasExpectedRequestMetadata(action, ["pending", "fulfilled", "rejected"]); };
1569 + }
1570 + if (!isAsyncThunkArray(asyncThunks)) {
1571 + return isAsyncThunkAction()(asyncThunks[0]);
1572 + }
1573 + return function (action) {
1574 + var matchers = [];
1575 + for (var _i = 0, asyncThunks_1 = asyncThunks; _i < asyncThunks_1.length; _i++) {
1576 + var asyncThunk = asyncThunks_1[_i];
1577 + matchers.push(asyncThunk.pending, asyncThunk.rejected, asyncThunk.fulfilled);
1578 + }
1579 + var combinedMatcher = isAnyOf.apply(void 0, matchers);
1580 + return combinedMatcher(action);
1581 + };
1582 +}
1583 +// src/listenerMiddleware/utils.ts
1584 +var assertFunction = function (func, expected) {
1585 + if (typeof func !== "function") {
1586 + throw new TypeError(expected + " is not a function");
1587 + }
1588 +};
1589 +var noop = function () {
1590 +};
1591 +var catchRejection = function (promise2, onError) {
1592 + if (onError === void 0) { onError = noop; }
1593 + promise2.catch(onError);
1594 + return promise2;
1595 +};
1596 +var addAbortSignalListener = function (abortSignal, callback) {
1597 + abortSignal.addEventListener("abort", callback, { once: true });
1598 + return function () { return abortSignal.removeEventListener("abort", callback); };
1599 +};
1600 +var abortControllerWithReason = function (abortController, reason) {
1601 + var signal = abortController.signal;
1602 + if (signal.aborted) {
1603 + return;
1604 + }
1605 + if (!("reason" in signal)) {
1606 + Object.defineProperty(signal, "reason", {
1607 + enumerable: true,
1608 + value: reason,
1609 + configurable: true,
1610 + writable: true
1611 + });
1612 + }
1613 + ;
1614 + abortController.abort(reason);
1615 +};
1616 +// src/listenerMiddleware/exceptions.ts
1617 +var task = "task";
1618 +var listener = "listener";
1619 +var completed = "completed";
1620 +var cancelled = "cancelled";
1621 +var taskCancelled = "task-" + cancelled;
1622 +var taskCompleted = "task-" + completed;
1623 +var listenerCancelled = listener + "-" + cancelled;
1624 +var listenerCompleted = listener + "-" + completed;
1625 +var TaskAbortError = /** @class */ (function () {
1626 + function TaskAbortError(code) {
1627 + this.code = code;
1628 + this.name = "TaskAbortError";
1629 + this.message = task + " " + cancelled + " (reason: " + code + ")";
1630 + }
1631 + return TaskAbortError;
1632 +}());
1633 +// src/listenerMiddleware/task.ts
1634 +var validateActive = function (signal) {
1635 + if (signal.aborted) {
1636 + throw new TaskAbortError(signal.reason);
1637 + }
1638 +};
1639 +function raceWithSignal(signal, promise2) {
1640 + var cleanup = noop;
1641 + return new Promise(function (resolve, reject) {
1642 + var notifyRejection = function () { return reject(new TaskAbortError(signal.reason)); };
1643 + if (signal.aborted) {
1644 + notifyRejection();
1645 + return;
1646 + }
1647 + cleanup = addAbortSignalListener(signal, notifyRejection);
1648 + promise2.finally(function () { return cleanup(); }).then(resolve, reject);
1649 + }).finally(function () {
1650 + cleanup = noop;
1651 + });
1652 +}
1653 +var runTask = function (task2, cleanUp) { return __async(void 0, null, function () {
1654 + var value, error_1;
1655 + return __generator(this, function (_c) {
1656 + switch (_c.label) {
1657 + case 0:
1658 + _c.trys.push([0, 3, 4, 5]);
1659 + return [4 /*yield*/, Promise.resolve()];
1660 + case 1:
1661 + _c.sent();
1662 + return [4 /*yield*/, task2()];
1663 + case 2:
1664 + value = _c.sent();
1665 + return [2 /*return*/, {
1666 + status: "ok",
1667 + value: value
1668 + }];
1669 + case 3:
1670 + error_1 = _c.sent();
1671 + return [2 /*return*/, {
1672 + status: error_1 instanceof TaskAbortError ? "cancelled" : "rejected",
1673 + error: error_1
1674 + }];
1675 + case 4:
1676 + cleanUp == null ? void 0 : cleanUp();
1677 + return [7 /*endfinally*/];
1678 + case 5: return [2 /*return*/];
1679 + }
1680 + });
1681 +}); };
1682 +var createPause = function (signal) {
1683 + return function (promise2) {
1684 + return catchRejection(raceWithSignal(signal, promise2).then(function (output) {
1685 + validateActive(signal);
1686 + return output;
1687 + }));
1688 + };
1689 +};
1690 +var createDelay = function (signal) {
1691 + var pause = createPause(signal);
1692 + return function (timeoutMs) {
1693 + return pause(new Promise(function (resolve) { return setTimeout(resolve, timeoutMs); }));
1694 + };
1695 +};
1696 +// src/listenerMiddleware/index.ts
1697 +var assign = Object.assign;
1698 +var INTERNAL_NIL_TOKEN = {};
1699 +var alm = "listenerMiddleware";
1700 +var createFork = function (parentAbortSignal, parentBlockingPromises) {
1701 + var linkControllers = function (controller) { return addAbortSignalListener(parentAbortSignal, function () { return abortControllerWithReason(controller, parentAbortSignal.reason); }); };
1702 + return function (taskExecutor, opts) {
1703 + assertFunction(taskExecutor, "taskExecutor");
1704 + var childAbortController = new AbortController();
1705 + linkControllers(childAbortController);
1706 + var result = runTask(function () { return __async(void 0, null, function () {
1707 + var result2;
1708 + return __generator(this, function (_c) {
1709 + switch (_c.label) {
1710 + case 0:
1711 + validateActive(parentAbortSignal);
1712 + validateActive(childAbortController.signal);
1713 + return [4 /*yield*/, taskExecutor({
1714 + pause: createPause(childAbortController.signal),
1715 + delay: createDelay(childAbortController.signal),
1716 + signal: childAbortController.signal
1717 + })];
1718 + case 1:
1719 + result2 = _c.sent();
1720 + validateActive(childAbortController.signal);
1721 + return [2 /*return*/, result2];
1722 + }
1723 + });
1724 + }); }, function () { return abortControllerWithReason(childAbortController, taskCompleted); });
1725 + if (opts == null ? void 0 : opts.autoJoin) {
1726 + parentBlockingPromises.push(result);
1727 + }
1728 + return {
1729 + result: createPause(parentAbortSignal)(result),
1730 + cancel: function () {
1731 + abortControllerWithReason(childAbortController, taskCancelled);
1732 + }
1733 + };
1734 + };
1735 +};
1736 +var createTakePattern = function (startListening, signal) {
1737 + var take = function (predicate, timeout) { return __async(void 0, null, function () {
1738 + var unsubscribe, tuplePromise, promises, output;
1739 + return __generator(this, function (_c) {
1740 + switch (_c.label) {
1741 + case 0:
1742 + validateActive(signal);
1743 + unsubscribe = function () {
1744 + };
1745 + tuplePromise = new Promise(function (resolve, reject) {
1746 + var stopListening = startListening({
1747 + predicate: predicate,
1748 + effect: function (action, listenerApi) {
1749 + listenerApi.unsubscribe();
1750 + resolve([
1751 + action,
1752 + listenerApi.getState(),
1753 + listenerApi.getOriginalState()
1754 + ]);
1755 + }
1756 + });
1757 + unsubscribe = function () {
1758 + stopListening();
1759 + reject();
1760 + };
1761 + });
1762 + promises = [
1763 + tuplePromise
1764 + ];
1765 + if (timeout != null) {
1766 + promises.push(new Promise(function (resolve) { return setTimeout(resolve, timeout, null); }));
1767 + }
1768 + _c.label = 1;
1769 + case 1:
1770 + _c.trys.push([1, , 3, 4]);
1771 + return [4 /*yield*/, raceWithSignal(signal, Promise.race(promises))];
1772 + case 2:
1773 + output = _c.sent();
1774 + validateActive(signal);
1775 + return [2 /*return*/, output];
1776 + case 3:
1777 + unsubscribe();
1778 + return [7 /*endfinally*/];
1779 + case 4: return [2 /*return*/];
1780 + }
1781 + });
1782 + }); };
1783 + return function (predicate, timeout) { return catchRejection(take(predicate, timeout)); };
1784 +};
1785 +var getListenerEntryPropsFrom = function (options) {
1786 + var type = options.type, actionCreator = options.actionCreator, matcher = options.matcher, predicate = options.predicate, effect = options.effect;
1787 + if (type) {
1788 + predicate = createAction(type).match;
1789 + }
1790 + else if (actionCreator) {
1791 + type = actionCreator.type;
1792 + predicate = actionCreator.match;
1793 + }
1794 + else if (matcher) {
1795 + predicate = matcher;
1796 + }
1797 + else if (predicate) {
1798 + }
1799 + else {
1800 + throw new Error("Creating or removing a listener requires one of the known fields for matching an action");
1801 + }
1802 + assertFunction(effect, "options.listener");
1803 + return { predicate: predicate, type: type, effect: effect };
1804 +};
1805 +var createListenerEntry = function (options) {
1806 + var _c = getListenerEntryPropsFrom(options), type = _c.type, predicate = _c.predicate, effect = _c.effect;
1807 + var id = nanoid();
1808 + var entry = {
1809 + id: id,
1810 + effect: effect,
1811 + type: type,
1812 + predicate: predicate,
1813 + pending: new Set(),
1814 + unsubscribe: function () {
1815 + throw new Error("Unsubscribe not initialized");
1816 + }
1817 + };
1818 + return entry;
1819 +};
1820 +var cancelActiveListeners = function (entry) {
1821 + entry.pending.forEach(function (controller) {
1822 + abortControllerWithReason(controller, listenerCancelled);
1823 + });
1824 +};
1825 +var createClearListenerMiddleware = function (listenerMap) {
1826 + return function () {
1827 + listenerMap.forEach(cancelActiveListeners);
1828 + listenerMap.clear();
1829 + };
1830 +};
1831 +var safelyNotifyError = function (errorHandler, errorToNotify, errorInfo) {
1832 + try {
1833 + errorHandler(errorToNotify, errorInfo);
1834 + }
1835 + catch (errorHandlerError) {
1836 + setTimeout(function () {
1837 + throw errorHandlerError;
1838 + }, 0);
1839 + }
1840 +};
1841 +var addListener = createAction(alm + "/add");
1842 +var clearAllListeners = createAction(alm + "/removeAll");
1843 +var removeListener = createAction(alm + "/remove");
1844 +var defaultErrorHandler = function () {
1845 + var args = [];
1846 + for (var _i = 0; _i < arguments.length; _i++) {
1847 + args[_i] = arguments[_i];
1848 + }
1849 + console.error.apply(console, __spreadArray([alm + "/error"], args));
1850 +};
1851 +function createListenerMiddleware(middlewareOptions) {
1852 + var _this = this;
1853 + if (middlewareOptions === void 0) { middlewareOptions = {}; }
1854 + var listenerMap = new Map();
1855 + var extra = middlewareOptions.extra, _c = middlewareOptions.onError, onError = _c === void 0 ? defaultErrorHandler : _c;
1856 + assertFunction(onError, "onError");
1857 + var insertEntry = function (entry) {
1858 + entry.unsubscribe = function () { return listenerMap.delete(entry.id); };
1859 + listenerMap.set(entry.id, entry);
1860 + return function (cancelOptions) {
1861 + entry.unsubscribe();
1862 + if (cancelOptions == null ? void 0 : cancelOptions.cancelActive) {
1863 + cancelActiveListeners(entry);
1864 + }
1865 + };
1866 + };
1867 + var findListenerEntry = function (comparator) {
1868 + for (var _i = 0, _c = Array.from(listenerMap.values()); _i < _c.length; _i++) {
1869 + var entry = _c[_i];
1870 + if (comparator(entry)) {
1871 + return entry;
1872 + }
1873 + }
1874 + return void 0;
1875 + };
1876 + var startListening = function (options) {
1877 + var entry = findListenerEntry(function (existingEntry) { return existingEntry.effect === options.effect; });
1878 + if (!entry) {
1879 + entry = createListenerEntry(options);
1880 + }
1881 + return insertEntry(entry);
1882 + };
1883 + var stopListening = function (options) {
1884 + var _c = getListenerEntryPropsFrom(options), type = _c.type, effect = _c.effect, predicate = _c.predicate;
1885 + var entry = findListenerEntry(function (entry2) {
1886 + var matchPredicateOrType = typeof type === "string" ? entry2.type === type : entry2.predicate === predicate;
1887 + return matchPredicateOrType && entry2.effect === effect;
1888 + });
1889 + if (entry) {
1890 + entry.unsubscribe();
1891 + if (options.cancelActive) {
1892 + cancelActiveListeners(entry);
1893 + }
1894 + }
1895 + return !!entry;
1896 + };
1897 + var notifyListener = function (entry, action, api, getOriginalState) { return __async(_this, null, function () {
1898 + var internalTaskController, take, autoJoinPromises, listenerError_1;
1899 + return __generator(this, function (_c) {
1900 + switch (_c.label) {
1901 + case 0:
1902 + internalTaskController = new AbortController();
1903 + take = createTakePattern(startListening, internalTaskController.signal);
1904 + autoJoinPromises = [];
1905 + _c.label = 1;
1906 + case 1:
1907 + _c.trys.push([1, 3, 4, 6]);
1908 + entry.pending.add(internalTaskController);
1909 + return [4 /*yield*/, Promise.resolve(entry.effect(action, assign({}, api, {
1910 + getOriginalState: getOriginalState,
1911 + condition: function (predicate, timeout) { return take(predicate, timeout).then(Boolean); },
1912 + take: take,
1913 + delay: createDelay(internalTaskController.signal),
1914 + pause: createPause(internalTaskController.signal),
1915 + extra: extra,
1916 + signal: internalTaskController.signal,
1917 + fork: createFork(internalTaskController.signal, autoJoinPromises),
1918 + unsubscribe: entry.unsubscribe,
1919 + subscribe: function () {
1920 + listenerMap.set(entry.id, entry);
1921 + },
1922 + cancelActiveListeners: function () {
1923 + entry.pending.forEach(function (controller, _, set) {
1924 + if (controller !== internalTaskController) {
1925 + abortControllerWithReason(controller, listenerCancelled);
1926 + set.delete(controller);
1927 + }
1928 + });
1929 + }
1930 + })))];
1931 + case 2:
1932 + _c.sent();
1933 + return [3 /*break*/, 6];
1934 + case 3:
1935 + listenerError_1 = _c.sent();
1936 + if (!(listenerError_1 instanceof TaskAbortError)) {
1937 + safelyNotifyError(onError, listenerError_1, {
1938 + raisedBy: "effect"
1939 + });
1940 + }
1941 + return [3 /*break*/, 6];
1942 + case 4: return [4 /*yield*/, Promise.allSettled(autoJoinPromises)];
1943 + case 5:
1944 + _c.sent();
1945 + abortControllerWithReason(internalTaskController, listenerCompleted);
1946 + entry.pending.delete(internalTaskController);
1947 + return [7 /*endfinally*/];
1948 + case 6: return [2 /*return*/];
1949 + }
1950 + });
1951 + }); };
1952 + var clearListenerMiddleware = createClearListenerMiddleware(listenerMap);
1953 + var middleware = function (api) { return function (next) { return function (action) {
1954 + if (!isAction(action)) {
1955 + return next(action);
1956 + }
1957 + if (addListener.match(action)) {
1958 + return startListening(action.payload);
1959 + }
1960 + if (clearAllListeners.match(action)) {
1961 + clearListenerMiddleware();
1962 + return;
1963 + }
1964 + if (removeListener.match(action)) {
1965 + return stopListening(action.payload);
1966 + }
1967 + var originalState = api.getState();
1968 + var getOriginalState = function () {
1969 + if (originalState === INTERNAL_NIL_TOKEN) {
1970 + throw new Error(alm + ": getOriginalState can only be called synchronously");
1971 + }
1972 + return originalState;
1973 + };
1974 + var result;
1975 + try {
1976 + result = next(action);
1977 + if (listenerMap.size > 0) {
1978 + var currentState = api.getState();
1979 + var listenerEntries = Array.from(listenerMap.values());
1980 + for (var _i = 0, listenerEntries_1 = listenerEntries; _i < listenerEntries_1.length; _i++) {
1981 + var entry = listenerEntries_1[_i];
1982 + var runListener = false;
1983 + try {
1984 + runListener = entry.predicate(action, currentState, originalState);
1985 + }
1986 + catch (predicateError) {
1987 + runListener = false;
1988 + safelyNotifyError(onError, predicateError, {
1989 + raisedBy: "predicate"
1990 + });
1991 + }
1992 + if (!runListener) {
1993 + continue;
1994 + }
1995 + notifyListener(entry, action, api, getOriginalState);
1996 + }
1997 + }
1998 + }
1999 + finally {
2000 + originalState = INTERNAL_NIL_TOKEN;
2001 + }
2002 + return result;
2003 + }; }; };
2004 + return {
2005 + middleware: middleware,
2006 + startListening: startListening,
2007 + stopListening: stopListening,
2008 + clearListeners: clearListenerMiddleware
2009 + };
2010 +}
2011 +// src/autoBatchEnhancer.ts
2012 +var SHOULD_AUTOBATCH = "RTK_autoBatch";
2013 +var prepareAutoBatched = function () { return function (payload) {
2014 + var _c;
2015 + return ({
2016 + payload: payload,
2017 + meta: (_c = {}, _c[SHOULD_AUTOBATCH] = true, _c)
2018 + });
2019 +}; };
2020 +var promise;
2021 +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 () {
2022 + throw err;
2023 +}, 0); }); };
2024 +var createQueueWithTimer = function (timeout) {
2025 + return function (notify) {
2026 + setTimeout(notify, timeout);
2027 + };
2028 +};
2029 +var rAF = typeof window !== "undefined" && window.requestAnimationFrame ? window.requestAnimationFrame : createQueueWithTimer(10);
2030 +var autoBatchEnhancer = function (options) {
2031 + if (options === void 0) { options = { type: "raf" }; }
2032 + return function (next) { return function () {
2033 + var args = [];
2034 + for (var _i = 0; _i < arguments.length; _i++) {
2035 + args[_i] = arguments[_i];
2036 + }
2037 + var store = next.apply(void 0, args);
2038 + var notifying = true;
2039 + var shouldNotifyAtEndOfTick = false;
2040 + var notificationQueued = false;
2041 + var listeners = new Set();
2042 + var queueCallback = options.type === "tick" ? queueMicrotaskShim : options.type === "raf" ? rAF : options.type === "callback" ? options.queueNotification : createQueueWithTimer(options.timeout);
2043 + var notifyListeners = function () {
2044 + notificationQueued = false;
2045 + if (shouldNotifyAtEndOfTick) {
2046 + shouldNotifyAtEndOfTick = false;
2047 + listeners.forEach(function (l) { return l(); });
2048 + }
2049 + };
2050 + return Object.assign({}, store, {
2051 + subscribe: function (listener2) {
2052 + var wrappedListener = function () { return notifying && listener2(); };
2053 + var unsubscribe = store.subscribe(wrappedListener);
2054 + listeners.add(listener2);
2055 + return function () {
2056 + unsubscribe();
2057 + listeners.delete(listener2);
2058 + };
2059 + },
2060 + dispatch: function (action) {
2061 + var _a;
2062 + try {
2063 + notifying = !((_a = action == null ? void 0 : action.meta) == null ? void 0 : _a[SHOULD_AUTOBATCH]);
2064 + shouldNotifyAtEndOfTick = !notifying;
2065 + if (shouldNotifyAtEndOfTick) {
2066 + if (!notificationQueued) {
2067 + notificationQueued = true;
2068 + queueCallback(notifyListeners);
2069 + }
2070 + }
2071 + return store.dispatch(action);
2072 + }
2073 + finally {
2074 + notifying = true;
2075 + }
2076 + }
2077 + });
2078 + }; };
2079 +};
2080 +// src/index.ts
2081 +(0,immer__WEBPACK_IMPORTED_MODULE_2__.enableES5)();
2082 +
2083 +//# sourceMappingURL=redux-toolkit.esm.js.map
11 2084
2085 +/***/ }),
12 2086
13 -var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
14 -var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
15 -function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
16 -function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
17 -var SortableBehavior;
2087 +/***/ "../assets/dev/js/editor/utils/is-instanceof.js":
2088 +/*!******************************************************!*\
2089 + !*** ../assets/dev/js/editor/utils/is-instanceof.js ***!
2090 + \******************************************************/
2091 +/***/ ((__unused_webpack_module, exports) => {
18 2092
2093 +"use strict";
2094 +
2095 +
2096 +Object.defineProperty(exports, "__esModule", ({
2097 + value: true
2098 +}));
2099 +exports["default"] = void 0;
2100 +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; } } }; }
2101 +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); }
2102 +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; }
19 2103 /**
20 - * @typedef {import('../../../container/container')} Container
2104 + * Some FileAPI objects such as FileList, DataTransferItem and DataTransferItemList has inconsistency with the retrieved
2105 + * object (from events, etc.) and the actual JavaScript object so a regular instanceof doesn't work. This function can
2106 + * check whether it's instanceof by using the objects constructor and prototype names.
2107 + *
2108 + * @param object
2109 + * @param constructors
2110 + * @return {boolean}
21 2111 */
22 -SortableBehavior = Marionette.Behavior.extend({
23 - defaults: {
24 - elChildType: 'widget'
25 - },
26 - events: {
27 - sortstart: 'onSortStart',
28 - sortreceive: 'onSortReceive',
29 - sortupdate: 'onSortUpdate',
30 - sortover: 'onSortOver',
31 - sortout: 'onSortOut'
32 - },
33 - initialize: function initialize() {
34 - this.listenTo(elementor.channels.dataEditMode, 'switch', this.onEditModeSwitched).listenTo(this.view.options.model, 'request:sort:start', this.startSort).listenTo(this.view.options.model, 'request:sort:update', this.updateSort).listenTo(this.view.options.model, 'request:sort:receive', this.receiveSort);
35 - },
36 - onEditModeSwitched: function onEditModeSwitched(activeMode) {
37 - this.onToggleSortMode('edit' === activeMode);
38 - },
39 - refresh: function refresh() {
40 - this.onEditModeSwitched(elementor.channels.dataEditMode.request('activeMode'));
41 - },
42 - onRender: function onRender() {
43 - var _this = this;
44 - this.view.collection.on('update', function () {
45 - return _this.refresh();
46 - });
47 - _.defer(function () {
48 - return _this.refresh();
49 - });
50 - },
51 - onDestroy: function onDestroy() {
52 - this.deactivate();
53 - },
2112 +var _default = function _default(object, constructors) {
2113 + constructors = Array.isArray(constructors) ? constructors : [constructors];
2114 + var _iterator = _createForOfIteratorHelper(constructors),
2115 + _step;
2116 + try {
2117 + for (_iterator.s(); !(_step = _iterator.n()).done;) {
2118 + var _constructor = _step.value;
2119 + if (object.constructor.name === _constructor.prototype[Symbol.toStringTag]) {
2120 + return true;
2121 + }
2122 + }
2123 + } catch (err) {
2124 + _iterator.e(err);
2125 + } finally {
2126 + _iterator.f();
2127 + }
2128 + return false;
2129 +};
2130 +exports["default"] = _default;
2131 +
2132 +/***/ }),
2133 +
2134 +/***/ "../assets/dev/js/modules/imports/args-object.js":
2135 +/*!*******************************************************!*\
2136 + !*** ../assets/dev/js/modules/imports/args-object.js ***!
2137 + \*******************************************************/
2138 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
2139 +
2140 +"use strict";
2141 +
2142 +
2143 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
2144 +Object.defineProperty(exports, "__esModule", ({
2145 + value: true
2146 +}));
2147 +exports["default"] = void 0;
2148 +var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js"));
2149 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
2150 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
2151 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
2152 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
2153 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
2154 +var _instanceType = _interopRequireDefault(__webpack_require__(/*! ./instance-type */ "../assets/dev/js/modules/imports/instance-type.js"));
2155 +var _isInstanceof = _interopRequireDefault(__webpack_require__(/*! ../../editor/utils/is-instanceof */ "../assets/dev/js/editor/utils/is-instanceof.js"));
2156 +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); }; }
2157 +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; } }
2158 +var ArgsObject = /*#__PURE__*/function (_InstanceType) {
2159 + (0, _inherits2.default)(ArgsObject, _InstanceType);
2160 + var _super = _createSuper(ArgsObject);
54 2161 /**
55 - * Create an item placeholder in order to avoid UI jumps due to flex.
2162 + * Function constructor().
56 2163 *
57 - * @param {Object} $element - jQuery element instance to create placeholder for.
58 - * @param {string} className - Placeholder class.
59 - * @param {boolean} hide - Whether to hide the original element.
2164 + * Create ArgsObject.
60 2165 *
61 - * @return {void}
2166 + * @param {{}} args
62 2167 */
63 - createPlaceholder: function createPlaceholder($element) {
64 - var className = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
65 - var hide = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
66 - // Get the actual item size.
67 - $element.css('display', '');
68 - var _$element$ = $element[0],
69 - width = _$element$.clientWidth,
70 - height = _$element$.clientHeight;
71 - if (hide) {
72 - $element.css('display', 'none');
73 - }
74 - jQuery('<div />').css(_objectSpread(_objectSpread({}, $element.css(['flex-basis', 'flex-grow', 'flex-shrink', 'position'])), {}, {
75 - width: width,
76 - height: height
77 - })).addClass(className).insertAfter($element);
78 - },
2168 + function ArgsObject(args) {
2169 + var _this;
2170 + (0, _classCallCheck2.default)(this, ArgsObject);
2171 + _this = _super.call(this);
2172 + _this.args = args;
2173 + return _this;
2174 + }
2175 +
79 2176 /**
80 - * Return a settings object for jQuery UI sortable to make it swappable.
2177 + * Function requireArgument().
81 2178 *
82 - * @return {{stop: Function, start: Function}} options
2179 + * Validate property in args.
2180 + *
2181 + * @param {string} property
2182 + * @param {{}} args
2183 + *
2184 + * @throws {Error}
83 2185 */
84 - getSwappableOptions: function getSwappableOptions() {
85 - var _this2 = this;
86 - var $childViewContainer = this.getChildViewContainer(),
87 - placeholderClass = 'e-swappable--item-placeholder';
88 - return {
89 - start: function start(event, ui) {
90 - $childViewContainer.sortable('refreshPositions');
2186 + (0, _createClass2.default)(ArgsObject, [{
2187 + key: "requireArgument",
2188 + value: function requireArgument(property) {
2189 + var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.args;
2190 + if (!Object.prototype.hasOwnProperty.call(args, property)) {
2191 + throw Error("".concat(property, " is required."));
2192 + }
2193 + }
91 2194
92 - // TODO: Find a better solution than this hack.
93 - // Used in order to prevent dragging a container into itself.
94 - _this2.createPlaceholder(ui.item, placeholderClass);
95 - },
96 - stop: function stop() {
97 - // Cleanup.
98 - $childViewContainer.find(".".concat(placeholderClass)).remove();
2195 + /**
2196 + * Function requireArgumentType().
2197 + *
2198 + * Validate property in args using `type === typeof(args.whatever)`.
2199 + *
2200 + * @param {string} property
2201 + * @param {string} type
2202 + * @param {{}} args
2203 + *
2204 + * @throws {Error}
2205 + */
2206 + }, {
2207 + key: "requireArgumentType",
2208 + value: function requireArgumentType(property, type) {
2209 + var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.args;
2210 + this.requireArgument(property, args);
2211 + if ((0, _typeof2.default)(args[property]) !== type) {
2212 + throw Error("".concat(property, " invalid type: ").concat(type, "."));
99 2213 }
100 - };
101 - },
102 - onToggleSortMode: function onToggleSortMode(isActive) {
103 - if (isActive) {
104 - this.activate();
105 - } else {
106 - this.deactivate();
107 2214 }
108 - },
109 - applySortable: function applySortable() {
110 - if (!elementor.userCan('design')) {
111 - return;
2215 +
2216 + /**
2217 + * Function requireArgumentInstance().
2218 + *
2219 + * Validate property in args using `args.whatever instanceof instance`.
2220 + *
2221 + * @param {string} property
2222 + * @param {*} instance
2223 + * @param {{}} args
2224 + *
2225 + * @throws {Error}
2226 + */
2227 + }, {
2228 + key: "requireArgumentInstance",
2229 + value: function requireArgumentInstance(property, instance) {
2230 + var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.args;
2231 + this.requireArgument(property, args);
2232 + if (!(args[property] instanceof instance) && !(0, _isInstanceof.default)(args[property], instance)) {
2233 + throw Error("".concat(property, " invalid instance."));
2234 + }
112 2235 }
113 - var $childViewContainer = this.getChildViewContainer(),
114 - defaultSortableOptions = {
115 - placeholder: 'elementor-sortable-placeholder elementor-' + this.getOption('elChildType') + '-placeholder',
116 - cursorAt: {
117 - top: 20,
118 - left: 25
119 - },
120 - helper: this._getSortableHelper.bind(this),
121 - cancel: 'input, textarea, button, select, option, .elementor-inline-editing, .elementor-tab-title',
122 - // Fix: Sortable - Unable to drag and drop sections with huge height.
123 - start: function start() {
124 - $childViewContainer.sortable('refreshPositions');
125 - }
126 - };
127 - var sortableOptions = _.extend(defaultSortableOptions, this.view.getSortableOptions());
128 2236
129 - // Add a swappable behavior (used for flex containers).
130 - if (this.isSwappable()) {
131 - $childViewContainer.addClass('e-swappable');
132 - sortableOptions = _.extend(sortableOptions, this.getSwappableOptions());
2237 + /**
2238 + * Function requireArgumentConstructor().
2239 + *
2240 + * Validate property in args using `type === args.whatever.constructor`.
2241 + *
2242 + * @param {string} property
2243 + * @param {*} type
2244 + * @param {{}} args
2245 + *
2246 + * @throws {Error}
2247 + */
2248 + }, {
2249 + key: "requireArgumentConstructor",
2250 + value: function requireArgumentConstructor(property, type) {
2251 + var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.args;
2252 + this.requireArgument(property, args);
2253 +
2254 + // Note: Converting the constructor to string in order to avoid equation issues
2255 + // due to different memory addresses between iframes (window.Object !== window.top.Object).
2256 + if (args[property].constructor.toString() !== type.prototype.constructor.toString()) {
2257 + throw Error("".concat(property, " invalid constructor type."));
2258 + }
133 2259 }
2260 + }], [{
2261 + key: "getInstanceType",
2262 + value: function getInstanceType() {
2263 + return 'ArgsObject';
2264 + }
2265 + }]);
2266 + return ArgsObject;
2267 +}(_instanceType.default);
2268 +exports["default"] = ArgsObject;
134 2269
135 - // TODO: Temporary hack for Container.
136 - // Will be removed in the future when the Navigator will use React.
137 - if (sortableOptions.preventInit) {
138 - return;
2270 +/***/ }),
2271 +
2272 +/***/ "../assets/dev/js/modules/imports/instance-type.js":
2273 +/*!*********************************************************!*\
2274 + !*** ../assets/dev/js/modules/imports/instance-type.js ***!
2275 + \*********************************************************/
2276 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
2277 +
2278 +"use strict";
2279 +
2280 +
2281 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
2282 +Object.defineProperty(exports, "__esModule", ({
2283 + value: true
2284 +}));
2285 +exports["default"] = void 0;
2286 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
2287 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
2288 +var _get2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/get */ "../node_modules/@babel/runtime/helpers/get.js"));
2289 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
2290 +var InstanceType = /*#__PURE__*/function (_Symbol$hasInstance) {
2291 + function InstanceType() {
2292 + var _this = this;
2293 + (0, _classCallCheck2.default)(this, InstanceType);
2294 + // Since anonymous classes sometimes do not get validated by babel, do it manually.
2295 + var target = this instanceof InstanceType ? this.constructor : void 0;
2296 + var prototypes = [];
2297 + while (target.__proto__ && target.__proto__.name) {
2298 + prototypes.push(target.__proto__);
2299 + target = target.__proto__;
139 2300 }
140 - $childViewContainer.sortable(sortableOptions);
141 - },
142 - /**
143 - * Enable sorting for this element, and generate sortable instance for it unless already generated.
144 - */
145 - activate: function activate() {
146 - if (!this.getChildViewContainer().sortable('instance')) {
147 - // Generate sortable instance for this element. Since fresh instances of sortable already allowing sorting,
148 - // we can return.
149 - this.applySortable();
150 - return;
2301 + prototypes.reverse().forEach(function (proto) {
2302 + return _this instanceof proto;
2303 + });
2304 + }
2305 + (0, _createClass2.default)(InstanceType, null, [{
2306 + key: _Symbol$hasInstance,
2307 + value: function value(target) {
2308 + /**
2309 + * This is function extending being called each time JS uses instanceOf, since babel use it each time it create new class
2310 + * its give's opportunity to mange capabilities of instanceOf operator.
2311 + * saving current class each time will give option later to handle instanceOf manually.
2312 + */
2313 + var result = (0, _get2.default)((0, _getPrototypeOf2.default)(InstanceType), Symbol.hasInstance, this).call(this, target);
2314 +
2315 + // Act normal when validate a class, which does not have instance type.
2316 + if (target && !target.constructor.getInstanceType) {
2317 + return result;
2318 + }
2319 + if (target) {
2320 + if (!target.instanceTypes) {
2321 + target.instanceTypes = [];
2322 + }
2323 + if (!result) {
2324 + if (this.getInstanceType() === target.constructor.getInstanceType()) {
2325 + result = true;
2326 + }
2327 + }
2328 + if (result) {
2329 + var name = this.getInstanceType === InstanceType.getInstanceType ? 'BaseInstanceType' : this.getInstanceType();
2330 + if (-1 === target.instanceTypes.indexOf(name)) {
2331 + target.instanceTypes.push(name);
2332 + }
2333 + }
2334 + }
2335 + if (!result && target) {
2336 + // Check if the given 'target', is instance of known types.
2337 + result = target.instanceTypes && Array.isArray(target.instanceTypes) && -1 !== target.instanceTypes.indexOf(this.getInstanceType());
2338 + }
2339 + return result;
151 2340 }
152 - this.getChildViewContainer().sortable('enable');
153 - },
154 - _getSortableHelper: function _getSortableHelper(event, $item) {
155 - var model = this.view.collection.get({
156 - cid: $item.data('model-cid')
2341 + }, {
2342 + key: "getInstanceType",
2343 + value: function getInstanceType() {
2344 + elementorModules.ForceMethodImplementation();
2345 + }
2346 + }]);
2347 + return InstanceType;
2348 +}(Symbol.hasInstance);
2349 +exports["default"] = InstanceType;
2350 +
2351 +/***/ }),
2352 +
2353 +/***/ "../assets/dev/js/modules/imports/module.js":
2354 +/*!**************************************************!*\
2355 + !*** ../assets/dev/js/modules/imports/module.js ***!
2356 + \**************************************************/
2357 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2358 +
2359 +"use strict";
2360 +
2361 +
2362 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
2363 +var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js"));
2364 +var Module = function Module() {
2365 + var $ = jQuery,
2366 + instanceParams = arguments,
2367 + self = this,
2368 + events = {};
2369 + var settings;
2370 + var ensureClosureMethods = function ensureClosureMethods() {
2371 + $.each(self, function (methodName) {
2372 + var oldMethod = self[methodName];
2373 + if ('function' !== typeof oldMethod) {
2374 + return;
2375 + }
2376 + self[methodName] = function () {
2377 + return oldMethod.apply(self, arguments);
2378 + };
157 2379 });
158 - return '<div style="height: 84px; width: 125px;" class="elementor-sortable-helper elementor-sortable-helper-' + model.get('elType') + '"><div class="icon"><i class="' + model.getIcon() + '"></i></div><div class="title-wrapper"><div class="title">' + model.getTitle() + '</div></div></div>';
159 - },
160 - getChildViewContainer: function getChildViewContainer() {
161 - return this.view.getChildViewContainer(this.view);
162 - },
163 - // The natural widget index in the column is wrong, since there are other elements
164 - // at the beginning of the column (background-overlay, element-overlay, resizeable-handle)
165 - getSortedElementNewIndex: function getSortedElementNewIndex($element) {
166 - var widgets = Object.values($element.parent().find('> .elementor-element'));
167 - return widgets.indexOf($element[0]);
168 - },
169 - /**
170 - * Disable sorting of the element unless no sortable instance exists, in which case there is already no option to
171 - * sort.
172 - */
173 - deactivate: function deactivate() {
174 - var childViewContainer = this.getChildViewContainer();
175 - if (childViewContainer.sortable('instance')) {
176 - childViewContainer.sortable('disable');
2380 + };
2381 + var initSettings = function initSettings() {
2382 + settings = self.getDefaultSettings();
2383 + var instanceSettings = instanceParams[0];
2384 + if (instanceSettings) {
2385 + $.extend(true, settings, instanceSettings);
177 2386 }
178 - },
179 - /**
180 - * Determine if the current instance of Sortable is swappable.
181 - *
182 - * @return {boolean} is swappable
183 - */
184 - isSwappable: function isSwappable() {
185 - return !!this.view.getSortableOptions().swappable;
186 - },
187 - startSort: function startSort(event, ui) {
188 - event.stopPropagation();
189 - var container = elementor.getContainer(ui.item.attr('data-id'));
190 - elementor.channels.data.reply('dragging:model', container.model).reply('dragging:view', container.view).reply('dragging:parent:view', this.view).trigger('drag:start', container.model).trigger(container.model.get('elType') + ':drag:start');
191 - },
192 - // On sorting element
193 - updateSort: function updateSort(ui, newIndex) {
194 - if (undefined === newIndex) {
195 - newIndex = ui.item.index();
2387 + };
2388 + var init = function init() {
2389 + self.__construct.apply(self, instanceParams);
2390 + ensureClosureMethods();
2391 + initSettings();
2392 + self.trigger('init');
2393 + };
2394 + this.getItems = function (items, itemKey) {
2395 + if (itemKey) {
2396 + var keyStack = itemKey.split('.'),
2397 + currentKey = keyStack.splice(0, 1);
2398 + if (!keyStack.length) {
2399 + return items[currentKey];
2400 + }
2401 + if (!items[currentKey]) {
2402 + return;
2403 + }
2404 + return this.getItems(items[currentKey], keyStack.join('.'));
196 2405 }
197 - var child = elementor.channels.data.request('dragging:view').getContainer();
198 - var result = this.moveChild(child, newIndex);
199 - if (!result) {
200 - jQuery(ui.sender).sortable('cancel');
2406 + return items;
2407 + };
2408 + this.getSettings = function (setting) {
2409 + return this.getItems(settings, setting);
2410 + };
2411 + this.setSettings = function (settingKey, value, settingsContainer) {
2412 + if (!settingsContainer) {
2413 + settingsContainer = settings;
201 2414 }
202 - },
203 - // On receiving element from another container
204 - receiveSort: function receiveSort(event, ui, newIndex) {
205 - event.stopPropagation();
206 - if (this.view.isCollectionFilled()) {
207 - jQuery(ui.sender).sortable('cancel');
208 - return;
2415 + if ('object' === (0, _typeof2.default)(settingKey)) {
2416 + $.extend(settingsContainer, settingKey);
2417 + return self;
209 2418 }
210 - var model = elementor.channels.data.request('dragging:model'),
211 - draggedElType = model.get('elType'),
212 - draggedIsInnerSection = 'section' === draggedElType && model.get('isInner'),
213 - targetIsInnerColumn = 'column' === this.view.getElementType() && this.view.isInner();
214 - if (draggedIsInnerSection && targetIsInnerColumn) {
215 - jQuery(ui.sender).sortable('cancel');
216 - return;
2419 + var keyStack = settingKey.split('.'),
2420 + currentKey = keyStack.splice(0, 1);
2421 + if (!keyStack.length) {
2422 + settingsContainer[currentKey] = value;
2423 + return self;
217 2424 }
218 - if (undefined === newIndex) {
219 - newIndex = ui.item.index();
2425 + if (!settingsContainer[currentKey]) {
2426 + settingsContainer[currentKey] = {};
220 2427 }
221 - var child = elementor.channels.data.request('dragging:view').getContainer();
222 - var result = this.moveChild(child, newIndex);
223 - if (!result) {
224 - jQuery(ui.sender).sortable('cancel');
2428 + return self.setSettings(keyStack.join('.'), value, settingsContainer[currentKey]);
2429 + };
2430 + this.getErrorMessage = function (type, functionName) {
2431 + var message;
2432 + switch (type) {
2433 + case 'forceMethodImplementation':
2434 + message = "The method '".concat(functionName, "' must to be implemented in the inheritor child.");
2435 + break;
2436 + default:
2437 + message = 'An error occurs';
225 2438 }
226 - },
227 - onSortStart: function onSortStart(event, ui) {
228 - if ('column' === this.options.elChildType) {
229 - var uiData = ui.item.data('sortableItem'),
230 - uiItems = uiData.items,
231 - itemHeight = 0;
232 - uiItems.forEach(function (item) {
233 - if (item.item[0] === ui.item[0]) {
234 - itemHeight = item.height;
235 - return false;
236 - }
2439 + return message;
2440 + };
2441 +
2442 + // TODO: This function should be deleted ?.
2443 + this.forceMethodImplementation = function (functionName) {
2444 + throw new Error(this.getErrorMessage('forceMethodImplementation', functionName));
2445 + };
2446 + this.on = function (eventName, callback) {
2447 + if ('object' === (0, _typeof2.default)(eventName)) {
2448 + $.each(eventName, function (singleEventName) {
2449 + self.on(singleEventName, this);
237 2450 });
238 - ui.placeholder.height(itemHeight);
2451 + return self;
239 2452 }
240 - this.startSort(event, ui);
241 - },
242 - onSortOver: function onSortOver(event) {
243 - event.stopPropagation();
244 - var model = elementor.channels.data.request('dragging:model');
245 - jQuery(event.target).addClass('elementor-draggable-over').attr({
246 - 'data-dragged-element': model.get('elType'),
247 - 'data-dragged-is-inner': model.get('isInner')
2453 + var eventNames = eventName.split(' ');
2454 + eventNames.forEach(function (singleEventName) {
2455 + if (!events[singleEventName]) {
2456 + events[singleEventName] = [];
2457 + }
2458 + events[singleEventName].push(callback);
248 2459 });
249 - this.$el.addClass('elementor-dragging-on-child');
250 - },
251 - onSortOut: function onSortOut(event) {
252 - event.stopPropagation();
253 - jQuery(event.target).removeClass('elementor-draggable-over').removeAttr('data-dragged-element data-dragged-is-inner');
254 - this.$el.removeClass('elementor-dragging-on-child');
255 - },
256 - onSortReceive: function onSortReceive(event, ui) {
257 - this.receiveSort(event, ui, this.getSortedElementNewIndex(ui.item));
258 - },
259 - onSortUpdate: function onSortUpdate(event, ui) {
260 - event.stopPropagation();
261 - if (this.getChildViewContainer()[0] !== ui.item.parent()[0]) {
262 - return;
2460 + return self;
2461 + };
2462 + this.off = function (eventName, callback) {
2463 + if (!events[eventName]) {
2464 + return self;
263 2465 }
264 - this.updateSort(ui, this.getSortedElementNewIndex(ui.item));
265 - },
266 - onAddChild: function onAddChild(view) {
267 - view.$el.attr('data-model-cid', view.model.cid);
268 - },
269 - /**
270 - * Move a child container to another position.
271 - *
272 - * @param {Container} child - The child container to move.
273 - * @param {number|string} index - New index.
274 - *
275 - * @return {Container|boolean}
276 - */
277 - moveChild: function moveChild(child, index) {
278 - return $e.run('document/elements/move', {
279 - container: child,
280 - target: this.view.getContainer(),
281 - options: {
282 - at: index
283 - }
2466 + if (!callback) {
2467 + delete events[eventName];
2468 + return self;
2469 + }
2470 + var callbackIndex = events[eventName].indexOf(callback);
2471 + if (-1 !== callbackIndex) {
2472 + delete events[eventName][callbackIndex];
2473 +
2474 + // Reset array index (for next off on same event).
2475 + events[eventName] = events[eventName].filter(function (val) {
2476 + return val;
2477 + });
2478 + }
2479 + return self;
2480 + };
2481 + this.trigger = function (eventName) {
2482 + var methodName = 'on' + eventName[0].toUpperCase() + eventName.slice(1),
2483 + params = Array.prototype.slice.call(arguments, 1);
2484 + if (self[methodName]) {
2485 + self[methodName].apply(self, params);
2486 + }
2487 + var callbacks = events[eventName];
2488 + if (!callbacks) {
2489 + return self;
2490 + }
2491 + $.each(callbacks, function (index, callback) {
2492 + callback.apply(self, params);
284 2493 });
285 - }
286 -});
287 -module.exports = SortableBehavior;
2494 + return self;
2495 + };
2496 + init();
2497 +};
2498 +Module.prototype.__construct = function () {};
2499 +Module.prototype.getDefaultSettings = function () {
2500 + return {};
2501 +};
2502 +Module.prototype.getConstructorID = function () {
2503 + return this.constructor.name;
2504 +};
2505 +Module.extend = function (properties) {
2506 + var $ = jQuery,
2507 + parent = this;
2508 + var child = function child() {
2509 + return parent.apply(this, arguments);
2510 + };
2511 + $.extend(child, parent);
2512 + child.prototype = Object.create($.extend({}, parent.prototype, properties));
2513 + child.prototype.constructor = child;
2514 + child.__super__ = parent.prototype;
2515 + return child;
2516 +};
2517 +module.exports = Module;
288 2518
289 2519 /***/ }),
290 2520
291 -/***/ "../assets/dev/js/editor/elements/views/container/empty-component.js":
292 -/*!***************************************************************************!*\
293 - !*** ../assets/dev/js/editor/elements/views/container/empty-component.js ***!
294 - \***************************************************************************/
2521 +/***/ "../modules/atomic-widgets/assets/js/editor/commands-internal/create-style.js":
2522 +/*!************************************************************************************!*\
2523 + !*** ../modules/atomic-widgets/assets/js/editor/commands-internal/create-style.js ***!
2524 + \************************************************************************************/
295 2525 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
296 2526
297 2527 "use strict";
2528 +/* provided dependency */ var sprintf = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["sprintf"];
298 2529
299 2530
300 2531 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
301 2532 Object.defineProperty(exports, "__esModule", ({
@@ -300,35 +2531,93 @@
300 2531 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
301 2532 Object.defineProperty(exports, "__esModule", ({
302 2533 value: true
303 2534 }));
304 -exports["default"] = EmptyComponent;
305 -var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react"));
306 -var _editorOneEvents = __webpack_require__(/*! elementor-editor-utils/editor-one-events */ "../assets/dev/js/editor/utils/editor-one-events.js");
307 -/* eslint-disable jsx-a11y/no-static-element-interactions */
308 -/* eslint-disable jsx-a11y/click-events-have-key-events */
2535 +exports["default"] = exports.CreateStyle = void 0;
2536 +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
2537 +var _toConsumableArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ "../node_modules/@babel/runtime/helpers/toConsumableArray.js"));
2538 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
2539 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
2540 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
2541 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
2542 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
2543 +var _i18n = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
2544 +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; }
2545 +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; }
2546 +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); }; }
2547 +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; } }
2548 +var PROP_TYPE_CLASSES = 'classes';
309 2549
310 -function EmptyComponent() {
311 - var handleClick = function handleClick() {
312 - _editorOneEvents.EditorOneEventManager.sendCanvasEmptyBoxAction({
313 - targetName: 'add_container'
314 - });
315 - $e.route('panel/elements/categories');
316 - };
317 - return /*#__PURE__*/_react.default.createElement("div", {
318 - className: "elementor-first-add"
319 - }, /*#__PURE__*/_react.default.createElement("div", {
320 - className: "elementor-icon eicon-plus",
321 - onClick: handleClick
322 - }));
323 -}
2550 +/**
2551 + * @typedef {import('elementor/assets/dev/js/editor/container/container')} Container
2552 + */
2553 +var CreateStyle = /*#__PURE__*/function (_$e$modules$editor$Co) {
2554 + (0, _inherits2.default)(CreateStyle, _$e$modules$editor$Co);
2555 + var _super = _createSuper(CreateStyle);
2556 + function CreateStyle() {
2557 + (0, _classCallCheck2.default)(this, CreateStyle);
2558 + return _super.apply(this, arguments);
2559 + }
2560 + (0, _createClass2.default)(CreateStyle, [{
2561 + key: "validateArgs",
2562 + value: function validateArgs(args) {
2563 + this.requireContainer(args);
2564 + this.requireArgumentConstructor('bind', String, args);
2565 + }
2566 + }, {
2567 + key: "randomId",
2568 + value: function randomId(containerId) {
2569 + return "s-".concat(containerId, "-").concat(elementorCommon.helpers.getUniqueId());
2570 + }
2571 + }, {
2572 + key: "apply",
2573 + value: function apply(args) {
2574 + var _container$settings$g;
2575 + var container = args.container,
2576 + styleDefID = args.styleDefID,
2577 + bind = args.bind;
2578 + var oldStyles = container.model.get('styles') || {};
324 2579
2580 + /* Translators: 1: container label, 2: number of old styles */
2581 + var label = sprintf((0, _i18n.__)('%1$s Style %2$s', 'elementor'), container.label, Object.keys(oldStyles).length + 1);
2582 + var newStyle = {
2583 + id: styleDefID !== null && styleDefID !== void 0 ? styleDefID : this.randomId(container.id),
2584 + label: label,
2585 + type: 'class',
2586 + variants: []
2587 + };
2588 + var oldBindSetting = (_container$settings$g = container.settings.get(bind)) !== null && _container$settings$g !== void 0 ? _container$settings$g : {
2589 + $$type: PROP_TYPE_CLASSES,
2590 + value: []
2591 + };
2592 + if (oldBindSetting.$$type !== PROP_TYPE_CLASSES || !Array.isArray(oldBindSetting.value)) {
2593 + throw new Error('Invalid bind setting prop type');
2594 + }
2595 + var newBindSetting = (0, _defineProperty2.default)({}, bind, {
2596 + $$type: PROP_TYPE_CLASSES,
2597 + value: [].concat((0, _toConsumableArray2.default)(oldBindSetting.value), [newStyle.id])
2598 + });
2599 + $e.internal('document/elements/set-settings', {
2600 + container: container,
2601 + settings: newBindSetting
2602 + });
2603 + var newStyles = _objectSpread(_objectSpread({}, oldStyles), {}, (0, _defineProperty2.default)({}, newStyle.id, newStyle));
2604 + container.model.set('styles', newStyles);
2605 + return newStyle;
2606 + }
2607 + }]);
2608 + return CreateStyle;
2609 +}($e.modules.editor.CommandContainerInternalBase);
2610 +exports.CreateStyle = CreateStyle;
2611 +var _default = CreateStyle;
2612 +exports["default"] = _default;
2613 +
325 2614 /***/ }),
326 2615
327 -/***/ "../assets/dev/js/editor/utils/editor-one-events.js":
328 -/*!**********************************************************!*\
329 - !*** ../assets/dev/js/editor/utils/editor-one-events.js ***!
330 - \**********************************************************/
2616 +/***/ "../modules/atomic-widgets/assets/js/editor/commands-internal/create-variant.js":
2617 +/*!**************************************************************************************!*\
2618 + !*** ../modules/atomic-widgets/assets/js/editor/commands-internal/create-variant.js ***!
2619 + \**************************************************************************************/
331 2620 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
332 2621
333 2622 "use strict";
334 2623
@@ -336,509 +2625,273 @@
336 2625 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
337 2626 Object.defineProperty(exports, "__esModule", ({
338 2627 value: true
339 2628 }));
340 -exports["default"] = exports.createDebouncedWidgetPanelSearch = exports.createDebouncedFinderSearch = exports.EditorOneEventManager = void 0;
2629 +exports["default"] = exports.CreateVariant = void 0;
341 2630 var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
342 2631 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
343 2632 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
344 -function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
345 -function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
346 -var EditorOneEventManager = exports.EditorOneEventManager = /*#__PURE__*/function () {
347 - function EditorOneEventManager() {
348 - (0, _classCallCheck2.default)(this, EditorOneEventManager);
2633 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
2634 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
2635 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
2636 +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; }
2637 +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; }
2638 +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); }; }
2639 +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; } }
2640 +/**
2641 + * @typedef {import('elementor/assets/dev/js/editor/container/container')} Container
2642 + */
2643 +var CreateVariant = /*#__PURE__*/function (_$e$modules$editor$Co) {
2644 + (0, _inherits2.default)(CreateVariant, _$e$modules$editor$Co);
2645 + var _super = _createSuper(CreateVariant);
2646 + function CreateVariant() {
2647 + (0, _classCallCheck2.default)(this, CreateVariant);
2648 + return _super.apply(this, arguments);
349 2649 }
350 - return (0, _createClass2.default)(EditorOneEventManager, null, [{
351 - key: "getEventsManager",
352 - value: function getEventsManager() {
353 - var _elementorCommon;
354 - return (_elementorCommon = elementorCommon) === null || _elementorCommon === void 0 ? void 0 : _elementorCommon.eventsManager;
355 - }
356 - }, {
357 - key: "getConfig",
358 - value: function getConfig() {
359 - var _this$getEventsManage;
360 - return (_this$getEventsManage = this.getEventsManager()) === null || _this$getEventsManage === void 0 ? void 0 : _this$getEventsManage.config;
361 - }
362 - }, {
363 - key: "canSendEvents",
364 - value: function canSendEvents() {
365 - var _elementorCommon2;
366 - return ((_elementorCommon2 = elementorCommon) === null || _elementorCommon2 === void 0 || (_elementorCommon2 = _elementorCommon2.config) === null || _elementorCommon2 === void 0 || (_elementorCommon2 = _elementorCommon2.editor_events) === null || _elementorCommon2 === void 0 ? void 0 : _elementorCommon2.can_send_events) || false;
367 - }
368 - }, {
369 - key: "isEventsManagerAvailable",
370 - value: function isEventsManagerAvailable() {
371 - var eventsManager = this.getEventsManager();
372 - return eventsManager && 'function' === typeof eventsManager.dispatchEvent;
373 - }
374 - }, {
375 - key: "dispatchEvent",
376 - value: function dispatchEvent(eventName, payload) {
377 - if (!this.isEventsManagerAvailable() || !this.canSendEvents()) {
378 - return false;
2650 + (0, _createClass2.default)(CreateVariant, [{
2651 + key: "validateArgs",
2652 + value: function validateArgs(args) {
2653 + this.requireContainer(args);
2654 + this.requireArgumentConstructor('styleDefID', String, args);
2655 + this.requireArgumentConstructor('meta', Object, args);
2656 + if (!('breakpoint' in args.meta && 'state' in args.meta)) {
2657 + throw new Error('Invalid meta arg');
379 2658 }
380 - this.getEventsManager().dispatchEvent(eventName, payload);
381 2659 }
382 2660 }, {
383 - key: "toLowerSnake",
384 - value: function toLowerSnake(value) {
385 - if (!value || 'string' !== typeof value) {
386 - return value;
387 - }
388 - return value.replace(/\s+/g, '_').toLowerCase();
2661 + key: "variantExists",
2662 + value: function variantExists(style, meta) {
2663 + return style.variants.some(function (variant) {
2664 + return variant.meta.breakpoint === meta.breakpoint && variant.meta.state === meta.state;
2665 + });
389 2666 }
390 2667 }, {
391 - key: "decodeHtmlEntities",
392 - value: function decodeHtmlEntities(text) {
393 - if (!text || 'string' !== typeof text) {
394 - return text;
2668 + key: "apply",
2669 + value: function apply(args) {
2670 + var container = args.container,
2671 + styleDefID = args.styleDefID,
2672 + meta = args.meta;
2673 + var oldStyles = container.model.get('styles') || {};
2674 + if (!oldStyles[styleDefID]) {
2675 + throw new Error('Style Def not found');
395 2676 }
396 - var doc = new DOMParser().parseFromString(text, 'text/html');
397 - return doc.body.textContent || text;
398 - }
399 - }, {
400 - key: "isInEditorContext",
401 - value: function isInEditorContext() {
402 - var _window$elementor;
403 - return 'undefined' !== typeof window.elementor && !!((_window$elementor = window.elementor) !== null && _window$elementor !== void 0 && _window$elementor.documents);
404 - }
405 - }, {
406 - key: "getFinderContext",
407 - value: function getFinderContext() {
408 - var _config$appTypes, _config$appTypes2, _config$locations, _config$locations2;
409 - var config = this.getConfig();
410 - var isEditor = this.isInEditorContext();
411 - return {
412 - windowName: isEditor ? config === null || config === void 0 || (_config$appTypes = config.appTypes) === null || _config$appTypes === void 0 ? void 0 : _config$appTypes.editor : config === null || config === void 0 || (_config$appTypes2 = config.appTypes) === null || _config$appTypes2 === void 0 ? void 0 : _config$appTypes2.wpAdmin,
413 - targetLocation: this.toLowerSnake(isEditor ? config === null || config === void 0 || (_config$locations = config.locations) === null || _config$locations === void 0 ? void 0 : _config$locations.topBar : config === null || config === void 0 || (_config$locations2 = config.locations) === null || _config$locations2 === void 0 ? void 0 : _config$locations2.sidebar)
414 - };
415 - }
416 - }, {
417 - key: "createBasePayload",
418 - value: function createBasePayload() {
419 - var _config$appTypes$edit, _config$appTypes3, _config$appTypes$edit2, _config$appTypes4;
420 - var overrides = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
421 - var config = this.getConfig();
422 - return _objectSpread({
423 - app_type: (_config$appTypes$edit = config === null || config === void 0 || (_config$appTypes3 = config.appTypes) === null || _config$appTypes3 === void 0 ? void 0 : _config$appTypes3.editor) !== null && _config$appTypes$edit !== void 0 ? _config$appTypes$edit : 'editor',
424 - window_name: (_config$appTypes$edit2 = config === null || config === void 0 || (_config$appTypes4 = config.appTypes) === null || _config$appTypes4 === void 0 ? void 0 : _config$appTypes4.editor) !== null && _config$appTypes$edit2 !== void 0 ? _config$appTypes$edit2 : 'editor'
425 - }, overrides);
426 - }
427 - }, {
428 - key: "sendTopBarPublishDropdown",
429 - value: function sendTopBarPublishDropdown(targetName) {
430 - var _config$names, _config$triggers, _config$targetTypes, _config$interactionRe, _config$locations3, _config$secondaryLoca, _config$targetTypes2;
431 - var config = this.getConfig();
432 - return this.dispatchEvent(config === null || config === void 0 || (_config$names = config.names) === null || _config$names === void 0 || (_config$names = _config$names.editorOne) === null || _config$names === void 0 ? void 0 : _config$names.topBarPublishDropdown, this.createBasePayload({
433 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers = config.triggers) === null || _config$triggers === void 0 ? void 0 : _config$triggers.click),
434 - target_type: config === null || config === void 0 || (_config$targetTypes = config.targetTypes) === null || _config$targetTypes === void 0 ? void 0 : _config$targetTypes.dropdownItem,
435 - target_name: targetName,
436 - interaction_result: config === null || config === void 0 || (_config$interactionRe = config.interactionResults) === null || _config$interactionRe === void 0 ? void 0 : _config$interactionRe.actionSelected,
437 - target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations3 = config.locations) === null || _config$locations3 === void 0 ? void 0 : _config$locations3.topBar),
438 - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca = config.secondaryLocations) === null || _config$secondaryLoca === void 0 ? void 0 : _config$secondaryLoca.publishDropdown),
439 - location_l2: config === null || config === void 0 || (_config$targetTypes2 = config.targetTypes) === null || _config$targetTypes2 === void 0 ? void 0 : _config$targetTypes2.dropdownItem,
440 - interaction_description: 'User selected an action from the publish dropdown'
441 - }));
442 - }
443 - }, {
444 - key: "sendTopBarPageList",
445 - value: function sendTopBarPageList(targetName) {
446 - var _config$names2, _config$triggers2, _config$targetTypes3, _config$interactionRe2, _config$interactionRe3, _config$locations4, _config$secondaryLoca2, _config$targetTypes4;
447 - var isCreate = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
448 - var config = this.getConfig();
449 - return this.dispatchEvent(config === null || config === void 0 || (_config$names2 = config.names) === null || _config$names2 === void 0 || (_config$names2 = _config$names2.editorOne) === null || _config$names2 === void 0 ? void 0 : _config$names2.topBarPageList, this.createBasePayload({
450 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers2 = config.triggers) === null || _config$triggers2 === void 0 ? void 0 : _config$triggers2.click),
451 - target_type: config === null || config === void 0 || (_config$targetTypes3 = config.targetTypes) === null || _config$targetTypes3 === void 0 ? void 0 : _config$targetTypes3.dropdownItem,
452 - target_name: targetName,
453 - interaction_result: isCreate ? config === null || config === void 0 || (_config$interactionRe2 = config.interactionResults) === null || _config$interactionRe2 === void 0 ? void 0 : _config$interactionRe2.create : config === null || config === void 0 || (_config$interactionRe3 = config.interactionResults) === null || _config$interactionRe3 === void 0 ? void 0 : _config$interactionRe3.navigate,
454 - target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations4 = config.locations) === null || _config$locations4 === void 0 ? void 0 : _config$locations4.topBar),
455 - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca2 = config.secondaryLocations) === null || _config$secondaryLoca2 === void 0 ? void 0 : _config$secondaryLoca2.pageListDropdown),
456 - location_l2: config === null || config === void 0 || (_config$targetTypes4 = config.targetTypes) === null || _config$targetTypes4 === void 0 ? void 0 : _config$targetTypes4.dropdownItem,
457 - interaction_description: 'User selected an action from the page list dropdown'
458 - }));
459 - }
460 - }, {
461 - key: "sendSiteSettingsSession",
462 - value: function sendSiteSettingsSession(_ref) {
463 - var _config$names3, _config$triggers3, _config$interactionRe4, _config$locations5, _config$secondaryLoca3;
464 - var targetType = _ref.targetType,
465 - _ref$visitedItems = _ref.visitedItems,
466 - visitedItems = _ref$visitedItems === void 0 ? [] : _ref$visitedItems,
467 - _ref$savedItems = _ref.savedItems,
468 - savedItems = _ref$savedItems === void 0 ? [] : _ref$savedItems,
469 - state = _ref.state;
470 - var config = this.getConfig();
471 - return this.dispatchEvent(config === null || config === void 0 || (_config$names3 = config.names) === null || _config$names3 === void 0 || (_config$names3 = _config$names3.editorOne) === null || _config$names3 === void 0 ? void 0 : _config$names3.siteSettingsSession, this.createBasePayload({
472 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers3 = config.triggers) === null || _config$triggers3 === void 0 ? void 0 : _config$triggers3.click),
473 - target_type: targetType,
474 - target_name: 'site_settings',
475 - interaction_result: config === null || config === void 0 || (_config$interactionRe4 = config.interactionResults) === null || _config$interactionRe4 === void 0 ? void 0 : _config$interactionRe4.sessionEnd,
476 - target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations5 = config.locations) === null || _config$locations5 === void 0 ? void 0 : _config$locations5.leftPanel),
477 - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca3 = config.secondaryLocations) === null || _config$secondaryLoca3 === void 0 ? void 0 : _config$secondaryLoca3.siteSettings),
478 - interaction_description: 'Records areas visited as part of the site setting session',
479 - metadata: {
480 - visited_items: visitedItems,
481 - saved_items: savedItems
482 - },
483 - state: state
484 - }));
485 - }
486 - }, {
487 - key: "sendELibraryNav",
488 - value: function sendELibraryNav(tabName) {
489 - var _config$names4, _config$triggers4, _config$targetTypes5, _config$interactionRe5, _config$locations6, _config$secondaryLoca4;
490 - var config = this.getConfig();
491 - return this.dispatchEvent(config === null || config === void 0 || (_config$names4 = config.names) === null || _config$names4 === void 0 || (_config$names4 = _config$names4.editorOne) === null || _config$names4 === void 0 ? void 0 : _config$names4.eLibraryNav, this.createBasePayload({
492 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers4 = config.triggers) === null || _config$triggers4 === void 0 ? void 0 : _config$triggers4.tabSelect),
493 - target_type: config === null || config === void 0 || (_config$targetTypes5 = config.targetTypes) === null || _config$targetTypes5 === void 0 ? void 0 : _config$targetTypes5.tab,
494 - target_name: this.toLowerSnake(tabName),
495 - interaction_result: config === null || config === void 0 || (_config$interactionRe5 = config.interactionResults) === null || _config$interactionRe5 === void 0 ? void 0 : _config$interactionRe5.tabChanged,
496 - target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations6 = config.locations) === null || _config$locations6 === void 0 ? void 0 : _config$locations6.elementorLibrary),
497 - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca4 = config.secondaryLocations) === null || _config$secondaryLoca4 === void 0 ? void 0 : _config$secondaryLoca4.libraryTabs),
498 - interaction_description: 'User navigates within elementor library'
499 - }));
500 - }
501 - }, {
502 - key: "sendELibraryInsert",
503 - value: function sendELibraryInsert(_ref2) {
504 - var _config$triggers5, _config$targetTypes6, _config$interactionRe6, _config$locations7, _config$secondaryLoca5, _config$names5;
505 - var assetId = _ref2.assetId,
506 - assetName = _ref2.assetName,
507 - libraryType = _ref2.libraryType,
508 - _ref2$proRequired = _ref2.proRequired,
509 - proRequired = _ref2$proRequired === void 0 ? false : _ref2$proRequired;
510 - var config = this.getConfig();
511 - var payload = this.createBasePayload({
512 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers5 = config.triggers) === null || _config$triggers5 === void 0 ? void 0 : _config$triggers5.insert),
513 - target_type: config === null || config === void 0 || (_config$targetTypes6 = config.targetTypes) === null || _config$targetTypes6 === void 0 ? void 0 : _config$targetTypes6.button,
514 - target_name: String(assetId),
515 - interaction_result: config === null || config === void 0 || (_config$interactionRe6 = config.interactionResults) === null || _config$interactionRe6 === void 0 ? void 0 : _config$interactionRe6.assetInserted,
516 - target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations7 = config.locations) === null || _config$locations7 === void 0 ? void 0 : _config$locations7.elementorLibrary),
517 - location_l1: this.toLowerSnake(libraryType),
518 - location_l2: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca5 = config.secondaryLocations) === null || _config$secondaryLoca5 === void 0 ? void 0 : _config$secondaryLoca5.assetCard),
519 - interaction_description: 'User inserts block/pages from elementor library',
520 - metadata: {
521 - template_id: String(assetId),
522 - template_name: this.decodeHtmlEntities(assetName) || ''
523 - }
524 - });
525 - if (proRequired) {
526 - payload.state = 'pro_plan_required';
2677 + var style = oldStyles[styleDefID];
2678 + if (this.variantExists(style, meta)) {
2679 + throw new Error('Style Variant already exits');
527 2680 }
528 - return this.dispatchEvent(config === null || config === void 0 || (_config$names5 = config.names) === null || _config$names5 === void 0 || (_config$names5 = _config$names5.editorOne) === null || _config$names5 === void 0 ? void 0 : _config$names5.eLibraryInsert, payload);
529 - }
530 - }, {
531 - key: "sendELibraryFavorite",
532 - value: function sendELibraryFavorite(_ref3) {
533 - var _config$triggers6, _config$targetTypes7, _config$interactionRe7, _config$locations8, _config$secondaryLoca6, _config$names6;
534 - var assetId = _ref3.assetId,
535 - assetName = _ref3.assetName,
536 - libraryType = _ref3.libraryType,
537 - isFavorite = _ref3.isFavorite,
538 - _ref3$proRequired = _ref3.proRequired,
539 - proRequired = _ref3$proRequired === void 0 ? false : _ref3$proRequired;
540 - var config = this.getConfig();
541 - var payload = this.createBasePayload({
542 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers6 = config.triggers) === null || _config$triggers6 === void 0 ? void 0 : _config$triggers6.click),
543 - target_type: config === null || config === void 0 || (_config$targetTypes7 = config.targetTypes) === null || _config$targetTypes7 === void 0 ? void 0 : _config$targetTypes7.toggle,
544 - target_name: String(assetId),
545 - interaction_result: config === null || config === void 0 || (_config$interactionRe7 = config.interactionResults) === null || _config$interactionRe7 === void 0 ? void 0 : _config$interactionRe7.assetFavorite,
546 - target_value: Boolean(isFavorite),
547 - target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations8 = config.locations) === null || _config$locations8 === void 0 ? void 0 : _config$locations8.elementorLibrary),
548 - location_l1: this.toLowerSnake(libraryType),
549 - location_l2: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca6 = config.secondaryLocations) === null || _config$secondaryLoca6 === void 0 ? void 0 : _config$secondaryLoca6.assetCard),
550 - interaction_description: 'User favorite block/pages from elementor library',
551 - metadata: {
552 - template_id: String(assetId),
553 - template_name: this.decodeHtmlEntities(assetName) || ''
554 - }
2681 + style.variants.push({
2682 + meta: meta,
2683 + props: {}
555 2684 });
556 - if (proRequired) {
557 - payload.state = 'pro_plan_required';
558 - }
559 - return this.dispatchEvent(config === null || config === void 0 || (_config$names6 = config.names) === null || _config$names6 === void 0 || (_config$names6 = _config$names6.editorOne) === null || _config$names6 === void 0 ? void 0 : _config$names6.eLibraryFavorite, payload);
2685 + var newStyles = _objectSpread(_objectSpread({}, oldStyles), {}, (0, _defineProperty2.default)({}, styleDefID, style));
2686 + container.model.set('styles', newStyles);
560 2687 }
561 - }, {
562 - key: "sendELibraryGenerateAi",
563 - value: function sendELibraryGenerateAi(_ref4) {
564 - var _config$names7, _config$triggers7, _config$targetTypes8, _config$interactionRe8, _config$locations9, _config$secondaryLoca7;
565 - var assetId = _ref4.assetId,
566 - assetName = _ref4.assetName,
567 - libraryType = _ref4.libraryType;
568 - var config = this.getConfig();
569 - return this.dispatchEvent(config === null || config === void 0 || (_config$names7 = config.names) === null || _config$names7 === void 0 || (_config$names7 = _config$names7.editorOne) === null || _config$names7 === void 0 ? void 0 : _config$names7.eLibraryGenerateAi, this.createBasePayload({
570 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers7 = config.triggers) === null || _config$triggers7 === void 0 ? void 0 : _config$triggers7.click),
571 - target_type: config === null || config === void 0 || (_config$targetTypes8 = config.targetTypes) === null || _config$targetTypes8 === void 0 ? void 0 : _config$targetTypes8.button,
572 - target_name: String(assetId),
573 - interaction_result: config === null || config === void 0 || (_config$interactionRe8 = config.interactionResults) === null || _config$interactionRe8 === void 0 ? void 0 : _config$interactionRe8.aiGenerate,
574 - target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations9 = config.locations) === null || _config$locations9 === void 0 ? void 0 : _config$locations9.elementorLibrary),
575 - location_l1: this.toLowerSnake(libraryType),
576 - location_l2: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca7 = config.secondaryLocations) === null || _config$secondaryLoca7 === void 0 ? void 0 : _config$secondaryLoca7.assetCard),
577 - interaction_description: 'User generated block/page based on a library asset',
578 - metadata: {
579 - template_id: String(assetId),
580 - template_name: this.decodeHtmlEntities(assetName) || ''
581 - }
582 - }));
2688 + }]);
2689 + return CreateVariant;
2690 +}($e.modules.editor.CommandContainerInternalBase);
2691 +exports.CreateVariant = CreateVariant;
2692 +var _default = CreateVariant;
2693 +exports["default"] = _default;
2694 +
2695 +/***/ }),
2696 +
2697 +/***/ "../modules/atomic-widgets/assets/js/editor/commands-internal/delete-style.js":
2698 +/*!************************************************************************************!*\
2699 + !*** ../modules/atomic-widgets/assets/js/editor/commands-internal/delete-style.js ***!
2700 + \************************************************************************************/
2701 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
2702 +
2703 +"use strict";
2704 +
2705 +
2706 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
2707 +Object.defineProperty(exports, "__esModule", ({
2708 + value: true
2709 +}));
2710 +exports["default"] = exports.DeleteStyle = void 0;
2711 +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
2712 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
2713 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
2714 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
2715 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
2716 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
2717 +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); }; }
2718 +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; } }
2719 +/**
2720 + * @typedef {import('elementor/assets/dev/js/editor/container/container')} Container
2721 + */
2722 +var DeleteStyle = /*#__PURE__*/function (_$e$modules$editor$Co) {
2723 + (0, _inherits2.default)(DeleteStyle, _$e$modules$editor$Co);
2724 + var _super = _createSuper(DeleteStyle);
2725 + function DeleteStyle() {
2726 + (0, _classCallCheck2.default)(this, DeleteStyle);
2727 + return _super.apply(this, arguments);
2728 + }
2729 + (0, _createClass2.default)(DeleteStyle, [{
2730 + key: "validateArgs",
2731 + value: function validateArgs(args) {
2732 + this.requireContainer(args);
2733 + this.requireArgumentConstructor('styleDefID', String, args);
2734 + this.requireArgumentConstructor('bind', String, args);
583 2735 }
584 2736 }, {
585 - key: "sendFinderSearchInput",
586 - value: function sendFinderSearchInput(_ref5) {
587 - var _config$triggers8, _config$targetTypes9, _config$interactionRe9, _config$interactionRe0, _config$secondaryLoca8, _config$names8;
588 - var resultsCount = _ref5.resultsCount,
589 - _ref5$searchTerm = _ref5.searchTerm,
590 - searchTerm = _ref5$searchTerm === void 0 ? null : _ref5$searchTerm;
591 - var config = this.getConfig();
592 - var hasResults = resultsCount > 0;
593 - var finderContext = this.getFinderContext();
594 - var payload = this.createBasePayload({
595 - window_name: finderContext.windowName,
596 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers8 = config.triggers) === null || _config$triggers8 === void 0 ? void 0 : _config$triggers8.typing),
597 - target_type: config === null || config === void 0 || (_config$targetTypes9 = config.targetTypes) === null || _config$targetTypes9 === void 0 ? void 0 : _config$targetTypes9.searchInput,
598 - target_name: 'finder',
599 - interaction_result: hasResults ? config === null || config === void 0 || (_config$interactionRe9 = config.interactionResults) === null || _config$interactionRe9 === void 0 ? void 0 : _config$interactionRe9.resultsUpdated : config === null || config === void 0 || (_config$interactionRe0 = config.interactionResults) === null || _config$interactionRe0 === void 0 ? void 0 : _config$interactionRe0.noResults,
600 - target_location: finderContext.targetLocation,
601 - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca8 = config.secondaryLocations) === null || _config$secondaryLoca8 === void 0 ? void 0 : _config$secondaryLoca8.finder),
602 - interaction_description: 'Finder search input, follows debounce behavior',
603 - metadata: {
604 - results_count: resultsCount
605 - }
606 - });
607 - if (!hasResults && searchTerm) {
608 - payload.metadata.search_term = searchTerm;
2737 + key: "apply",
2738 + value: function apply(args) {
2739 + var container = args.container,
2740 + styleDefID = args.styleDefID,
2741 + bind = args.bind;
2742 + var oldBindSetting = container.settings.get(bind);
2743 + if (!oldBindSetting) {
2744 + throw new Error('Setting not found');
609 2745 }
610 - return this.dispatchEvent(config === null || config === void 0 || (_config$names8 = config.names) === null || _config$names8 === void 0 || (_config$names8 = _config$names8.editorOne) === null || _config$names8 === void 0 ? void 0 : _config$names8.finderSearchInput, payload);
611 - }
612 - }, {
613 - key: "sendFinderResultSelect",
614 - value: function sendFinderResultSelect(choice) {
615 - var _config$names9, _config$triggers9, _config$targetTypes0, _config$interactionRe1, _config$secondaryLoca9, _config$secondaryLoca0;
616 - var config = this.getConfig();
617 - var finderContext = this.getFinderContext();
618 - return this.dispatchEvent(config === null || config === void 0 || (_config$names9 = config.names) === null || _config$names9 === void 0 || (_config$names9 = _config$names9.editorOne) === null || _config$names9 === void 0 ? void 0 : _config$names9.finderResultSelect, this.createBasePayload({
619 - window_name: finderContext.windowName,
620 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers9 = config.triggers) === null || _config$triggers9 === void 0 ? void 0 : _config$triggers9.click),
621 - target_type: config === null || config === void 0 || (_config$targetTypes0 = config.targetTypes) === null || _config$targetTypes0 === void 0 ? void 0 : _config$targetTypes0.searchResult,
622 - target_name: choice,
623 - interaction_result: config === null || config === void 0 || (_config$interactionRe1 = config.interactionResults) === null || _config$interactionRe1 === void 0 ? void 0 : _config$interactionRe1.selected,
624 - target_location: finderContext.targetLocation,
625 - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca9 = config.secondaryLocations) === null || _config$secondaryLoca9 === void 0 ? void 0 : _config$secondaryLoca9.finder),
626 - location_l2: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca0 = config.secondaryLocations) === null || _config$secondaryLoca0 === void 0 ? void 0 : _config$secondaryLoca0.finderResults),
627 - interaction_description: 'Finder search results was selected'
628 - }));
629 - }
630 - }, {
631 - key: "sendCanvasEmptyBoxAction",
632 - value: function sendCanvasEmptyBoxAction(_ref6) {
633 - var _config$triggers0, _config$targetTypes1, _config$interactionRe10, _config$locations0, _config$secondaryLoca1, _config$names0;
634 - var targetName = _ref6.targetName,
635 - _ref6$metadata = _ref6.metadata,
636 - metadata = _ref6$metadata === void 0 ? {} : _ref6$metadata,
637 - _ref6$containerCreate = _ref6.containerCreated,
638 - containerCreated = _ref6$containerCreate === void 0 ? null : _ref6$containerCreate;
639 - var config = this.getConfig();
640 - var payload = this.createBasePayload({
641 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers0 = config.triggers) === null || _config$triggers0 === void 0 ? void 0 : _config$triggers0.click),
642 - target_type: config === null || config === void 0 || (_config$targetTypes1 = config.targetTypes) === null || _config$targetTypes1 === void 0 ? void 0 : _config$targetTypes1.buttons,
643 - target_name: targetName,
644 - interaction_result: config === null || config === void 0 || (_config$interactionRe10 = config.interactionResults) === null || _config$interactionRe10 === void 0 ? void 0 : _config$interactionRe10.selected,
645 - target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations0 = config.locations) === null || _config$locations0 === void 0 ? void 0 : _config$locations0.canvas),
646 - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca1 = config.secondaryLocations) === null || _config$secondaryLoca1 === void 0 ? void 0 : _config$secondaryLoca1.emptyBox),
647 - interaction_description: 'Empty box on canvas actions'
2746 + var newBindSetting = (0, _defineProperty2.default)({}, bind, {
2747 + $$type: 'classes',
2748 + value: oldBindSetting.value.filter(function (id) {
2749 + return id !== styleDefID;
2750 + })
648 2751 });
649 - if (Object.keys(metadata).length > 0) {
650 - payload.metadata = metadata;
651 - }
652 - if (containerCreated !== null) {
653 - payload.state = containerCreated;
654 - }
655 - return this.dispatchEvent(config === null || config === void 0 || (_config$names0 = config.names) === null || _config$names0 === void 0 || (_config$names0 = _config$names0.editorOne) === null || _config$names0 === void 0 ? void 0 : _config$names0.canvasEmptyBoxAction, payload);
656 - }
657 - }, {
658 - key: "sendWidgetPanelSearch",
659 - value: function sendWidgetPanelSearch(_ref7) {
660 - var _config$triggers1, _config$targetTypes10, _config$interactionRe11, _config$interactionRe12, _config$locations1, _config$locations10, _config$secondaryLoca10, _config$names1;
661 - var resultsCount = _ref7.resultsCount,
662 - _ref7$userInput = _ref7.userInput,
663 - userInput = _ref7$userInput === void 0 ? null : _ref7$userInput;
664 - var config = this.getConfig();
665 - var hasResults = resultsCount > 0;
666 - var payload = this.createBasePayload({
667 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers1 = config.triggers) === null || _config$triggers1 === void 0 ? void 0 : _config$triggers1.typing),
668 - target_type: config === null || config === void 0 || (_config$targetTypes10 = config.targetTypes) === null || _config$targetTypes10 === void 0 ? void 0 : _config$targetTypes10.searchWidget,
669 - target_name: 'search_widget',
670 - interaction_result: hasResults ? config === null || config === void 0 || (_config$interactionRe11 = config.interactionResults) === null || _config$interactionRe11 === void 0 ? void 0 : _config$interactionRe11.resultsUpdated : config === null || config === void 0 || (_config$interactionRe12 = config.interactionResults) === null || _config$interactionRe12 === void 0 ? void 0 : _config$interactionRe12.noResults,
671 - target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations1 = config.locations) === null || _config$locations1 === void 0 ? void 0 : _config$locations1.leftPanel),
672 - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$locations10 = config.locations) === null || _config$locations10 === void 0 ? void 0 : _config$locations10.widgetPanel),
673 - location_l2: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca10 = config.secondaryLocations) === null || _config$secondaryLoca10 === void 0 ? void 0 : _config$secondaryLoca10.searchBar),
674 - interaction_description: 'Widget search input, follows debounce behavior'
2752 + $e.internal('document/elements/set-settings', {
2753 + container: container,
2754 + settings: newBindSetting
675 2755 });
676 - if (!hasResults && userInput) {
677 - payload.metadata = {
678 - user_input: userInput
679 - };
680 - }
681 - return this.dispatchEvent(config === null || config === void 0 || (_config$names1 = config.names) === null || _config$names1 === void 0 || (_config$names1 = _config$names1.editorOne) === null || _config$names1 === void 0 ? void 0 : _config$names1.widgetPanelSearch, payload);
2756 + var styles = container.model.get('styles') || {};
2757 + delete styles[styleDefID];
2758 + container.model.set('styles', styles);
682 2759 }
683 - }, {
684 - key: "createWpDashPayload",
685 - value: function createWpDashPayload() {
686 - var _config$appTypes$wpDa, _config$appTypes5, _config$locations11;
687 - var overrides = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
688 - var config = this.getConfig();
689 - return this.createBasePayload(_objectSpread({
690 - window_name: (_config$appTypes$wpDa = config === null || config === void 0 || (_config$appTypes5 = config.appTypes) === null || _config$appTypes5 === void 0 ? void 0 : _config$appTypes5.wpDash) !== null && _config$appTypes$wpDa !== void 0 ? _config$appTypes$wpDa : 'wpdash',
691 - target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations11 = config.locations) === null || _config$locations11 === void 0 ? void 0 : _config$locations11.wpDashAdmin),
692 - location_l2: ''
693 - }, overrides));
694 - }
695 - }, {
696 - key: "sendWpDashElementorMenuClick",
697 - value: function sendWpDashElementorMenuClick() {
698 - var _config$names10, _config$triggers10, _config$targetTypes11, _config$interactionRe13, _config$secondaryLoca11;
699 - var config = this.getConfig();
700 - return this.dispatchEvent(config === null || config === void 0 || (_config$names10 = config.names) === null || _config$names10 === void 0 || (_config$names10 = _config$names10.editorOne) === null || _config$names10 === void 0 ? void 0 : _config$names10.wpDashElementorMenuClick, this.createWpDashPayload({
701 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers10 = config.triggers) === null || _config$triggers10 === void 0 ? void 0 : _config$triggers10.click),
702 - target_type: config === null || config === void 0 || (_config$targetTypes11 = config.targetTypes) === null || _config$targetTypes11 === void 0 ? void 0 : _config$targetTypes11.wpDashAdminMenuItem,
703 - target_name: 'elementor_menu_item',
704 - interaction_result: config === null || config === void 0 || (_config$interactionRe13 = config.interactionResults) === null || _config$interactionRe13 === void 0 ? void 0 : _config$interactionRe13.elementorSideMenuOpened,
705 - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca11 = config.secondaryLocations) === null || _config$secondaryLoca11 === void 0 ? void 0 : _config$secondaryLoca11.wpDashElementorCoreMenu),
706 - interaction_description: 'core_user_clicked_elementor_menu_item'
707 - }));
708 - }
709 - }, {
710 - key: "sendWpDashEditorSubMenuHover",
711 - value: function sendWpDashEditorSubMenuHover() {
712 - var _config$names11, _config$triggers11, _config$targetTypes12, _config$interactionRe14, _config$secondaryLoca12;
713 - var config = this.getConfig();
714 - return this.dispatchEvent(config === null || config === void 0 || (_config$names11 = config.names) === null || _config$names11 === void 0 || (_config$names11 = _config$names11.editorOne) === null || _config$names11 === void 0 ? void 0 : _config$names11.wpDashEditorSubMenuHover, this.createWpDashPayload({
715 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers11 = config.triggers) === null || _config$triggers11 === void 0 ? void 0 : _config$triggers11.hover),
716 - target_type: config === null || config === void 0 || (_config$targetTypes12 = config.targetTypes) === null || _config$targetTypes12 === void 0 ? void 0 : _config$targetTypes12.wpDashEditorMenu,
717 - target_name: 'wpdash_editor_sub_menu',
718 - interaction_result: config === null || config === void 0 || (_config$interactionRe14 = config.interactionResults) === null || _config$interactionRe14 === void 0 ? void 0 : _config$interactionRe14.editorSubMenuOpened,
719 - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca12 = config.secondaryLocations) === null || _config$secondaryLoca12 === void 0 ? void 0 : _config$secondaryLoca12.wpDashElementorCoreSubMenu),
720 - interaction_description: 'core_user_hovered_sub_menu'
721 - }));
722 - }
723 - }, {
724 - key: "sendWpDashThemeBuilderClick",
725 - value: function sendWpDashThemeBuilderClick() {
726 - var _config$names12, _config$triggers12, _config$targetTypes13, _config$interactionRe15, _config$secondaryLoca13;
727 - var config = this.getConfig();
728 - return this.dispatchEvent(config === null || config === void 0 || (_config$names12 = config.names) === null || _config$names12 === void 0 || (_config$names12 = _config$names12.editorOne) === null || _config$names12 === void 0 ? void 0 : _config$names12.wpDashThemeBuilderClick, this.createWpDashPayload({
729 - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers12 = config.triggers) === null || _config$triggers12 === void 0 ? void 0 : _config$triggers12.click),
730 - target_type: config === null || config === void 0 || (_config$targetTypes13 = config.targetTypes) === null || _config$targetTypes13 === void 0 ? void 0 : _config$targetTypes13.wpDashSubMenuItem,
731 - target_name: 'theme_builder_menu_item',
732 - interaction_result: config === null || config === void 0 || (_config$interactionRe15 = config.interactionResults) === null || _config$interactionRe15 === void 0 ? void 0 : _config$interactionRe15.themeBuilderPromotionWindow,
733 - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca13 = config.secondaryLocations) === null || _config$secondaryLoca13 === void 0 ? void 0 : _config$secondaryLoca13.wpDashThemeBuilder),
734 - interaction_description: 'core_user_clicked_theme_builder_menu_item'
735 - }));
736 - }
737 2760 }]);
738 -}();
739 -var createDebouncedFinderSearch = exports.createDebouncedFinderSearch = function createDebouncedFinderSearch() {
740 - var delay = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 300;
741 - return _.debounce(function (resultsCount, searchTerm) {
742 - EditorOneEventManager.sendFinderSearchInput({
743 - resultsCount: resultsCount,
744 - searchTerm: searchTerm
745 - });
746 - }, delay);
747 -};
748 -var createDebouncedWidgetPanelSearch = exports.createDebouncedWidgetPanelSearch = function createDebouncedWidgetPanelSearch() {
749 - var delay = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 2000;
750 - return _.debounce(function (resultsCount, userInput) {
751 - EditorOneEventManager.sendWidgetPanelSearch({
752 - resultsCount: resultsCount,
753 - userInput: userInput
754 - });
755 - }, delay);
756 -};
757 -var _default = exports["default"] = EditorOneEventManager;
2761 + return DeleteStyle;
2762 +}($e.modules.editor.CommandContainerInternalBase);
2763 +exports.DeleteStyle = DeleteStyle;
2764 +var _default = DeleteStyle;
2765 +exports["default"] = _default;
758 2766
759 2767 /***/ }),
760 2768
761 -/***/ "../assets/dev/js/editor/utils/element-types.js":
762 -/*!******************************************************!*\
763 - !*** ../assets/dev/js/editor/utils/element-types.js ***!
764 - \******************************************************/
765 -/***/ ((module) => {
2769 +/***/ "../modules/atomic-widgets/assets/js/editor/commands-internal/delete-variant.js":
2770 +/*!**************************************************************************************!*\
2771 + !*** ../modules/atomic-widgets/assets/js/editor/commands-internal/delete-variant.js ***!
2772 + \**************************************************************************************/
2773 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
766 2774
767 2775 "use strict";
768 2776
769 2777
2778 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
2779 +Object.defineProperty(exports, "__esModule", ({
2780 + value: true
2781 +}));
2782 +exports["default"] = exports.DeleteVariant = void 0;
2783 +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
2784 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
2785 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
2786 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
2787 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
2788 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
2789 +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; }
2790 +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; }
2791 +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); }; }
2792 +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; } }
770 2793 /**
771 - * Returns an array of all available element types.
772 - *
773 - * @return {string[]} Array of element type strings.
2794 + * @typedef {import('elementor/assets/dev/js/editor/container/container')} Container
774 2795 */
775 -var getAllElementTypes = function getAllElementTypes() {
776 - return Object.keys(elementor.getConfig().elements);
777 -};
778 -module.exports = {
779 - getAllElementTypes: getAllElementTypes
780 -};
2796 +var DeleteVariant = /*#__PURE__*/function (_$e$modules$editor$Co) {
2797 + (0, _inherits2.default)(DeleteVariant, _$e$modules$editor$Co);
2798 + var _super = _createSuper(DeleteVariant);
2799 + function DeleteVariant() {
2800 + (0, _classCallCheck2.default)(this, DeleteVariant);
2801 + return _super.apply(this, arguments);
2802 + }
2803 + (0, _createClass2.default)(DeleteVariant, [{
2804 + key: "validateArgs",
2805 + value: function validateArgs(args) {
2806 + this.requireContainer(args);
2807 + this.requireArgumentConstructor('styleDefID', String, args);
2808 + this.requireArgumentConstructor('meta', Object, args);
2809 + if (!('breakpoint' in args.meta && 'state' in args.meta)) {
2810 + throw new Error('Invalid meta arg');
2811 + }
2812 + }
2813 + }, {
2814 + key: "apply",
2815 + value: function apply(args) {
2816 + var container = args.container,
2817 + styleDefID = args.styleDefID,
2818 + meta = args.meta;
2819 + var oldStyles = container.model.get('styles') || {};
2820 + var style = {};
2821 + if (!oldStyles[styleDefID]) {
2822 + throw new Error('Style Def not found');
2823 + }
2824 + style = oldStyles[styleDefID];
2825 + style.variants = style.variants.filter(function (variant) {
2826 + return variant.meta.breakpoint !== meta.breakpoint || variant.meta.state !== meta.state;
2827 + });
2828 + var newStyles = _objectSpread(_objectSpread({}, oldStyles), {}, (0, _defineProperty2.default)({}, style.id, style));
2829 + container.model.set('styles', newStyles);
2830 + }
2831 + }]);
2832 + return DeleteVariant;
2833 +}($e.modules.editor.CommandContainerInternalBase);
2834 +exports.DeleteVariant = DeleteVariant;
2835 +var _default = DeleteVariant;
2836 +exports["default"] = _default;
781 2837
782 2838 /***/ }),
783 2839
784 -/***/ "../assets/dev/js/utils/react.js":
785 -/*!***************************************!*\
786 - !*** ../assets/dev/js/utils/react.js ***!
787 - \***************************************/
2840 +/***/ "../modules/atomic-widgets/assets/js/editor/commands-internal/index.js":
2841 +/*!*****************************************************************************!*\
2842 + !*** ../modules/atomic-widgets/assets/js/editor/commands-internal/index.js ***!
2843 + \*****************************************************************************/
788 2844 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
789 2845
790 2846 "use strict";
791 2847
792 2848
793 -var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js");
794 2849 Object.defineProperty(exports, "__esModule", ({
795 2850 value: true
796 2851 }));
797 -exports["default"] = void 0;
798 -var React = _interopRequireWildcard(__webpack_require__(/*! react */ "react"));
799 -var ReactDOM = _interopRequireWildcard(__webpack_require__(/*! react-dom */ "react-dom"));
800 -var _client = __webpack_require__(/*! react-dom/client */ "../node_modules/react-dom/client.js");
801 -function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
802 -/**
803 - * Support conditional rendering of a React App to the DOM, based on the React version.
804 - * We use `createRoot` when available, but fallback to `ReactDOM.render` for older versions.
805 - *
806 - * @param { React.ReactElement } app The app to render.
807 - * @param { HTMLElement } domElement The DOM element to render the app into.
808 - *
809 - * @return {{ unmount: () => void }} The unmount function.
810 - */
811 -function render(app, domElement) {
812 - var unmountFunction;
813 - try {
814 - var root = (0, _client.createRoot)(domElement);
815 - root.render(app);
816 - unmountFunction = function unmountFunction() {
817 - root.unmount();
818 - };
819 - } catch (e) {
820 - // eslint-disable-next-line react/no-deprecated
821 - ReactDOM.render(app, domElement);
822 - unmountFunction = function unmountFunction() {
823 - // eslint-disable-next-line react/no-deprecated
824 - ReactDOM.unmountComponentAtNode(domElement);
825 - };
2852 +Object.defineProperty(exports, "CreateStyle", ({
2853 + enumerable: true,
2854 + get: function get() {
2855 + return _createStyle.CreateStyle;
826 2856 }
827 - return {
828 - unmount: unmountFunction
829 - };
830 -}
831 -var _default = exports["default"] = {
832 - render: render
833 -};
2857 +}));
2858 +Object.defineProperty(exports, "CreateVariant", ({
2859 + enumerable: true,
2860 + get: function get() {
2861 + return _createVariant.CreateVariant;
2862 + }
2863 +}));
2864 +Object.defineProperty(exports, "DeleteStyle", ({
2865 + enumerable: true,
2866 + get: function get() {
2867 + return _deleteStyle.DeleteStyle;
2868 + }
2869 +}));
2870 +Object.defineProperty(exports, "DeleteVariant", ({
2871 + enumerable: true,
2872 + get: function get() {
2873 + return _deleteVariant.DeleteVariant;
2874 + }
2875 +}));
2876 +Object.defineProperty(exports, "UpdateProps", ({
2877 + enumerable: true,
2878 + get: function get() {
2879 + return _updateProps.UpdateProps;
2880 + }
2881 +}));
2882 +var _updateProps = __webpack_require__(/*! ./update-props */ "../modules/atomic-widgets/assets/js/editor/commands-internal/update-props.js");
2883 +var _createStyle = __webpack_require__(/*! ./create-style */ "../modules/atomic-widgets/assets/js/editor/commands-internal/create-style.js");
2884 +var _deleteStyle = __webpack_require__(/*! ./delete-style */ "../modules/atomic-widgets/assets/js/editor/commands-internal/delete-style.js");
2885 +var _createVariant = __webpack_require__(/*! ./create-variant */ "../modules/atomic-widgets/assets/js/editor/commands-internal/create-variant.js");
2886 +var _deleteVariant = __webpack_require__(/*! ./delete-variant */ "../modules/atomic-widgets/assets/js/editor/commands-internal/delete-variant.js");
834 2887
835 2888 /***/ }),
836 2889
837 -/***/ "../modules/atomic-widgets/assets/js/editor/atomic-element-base-model.js":
838 -/*!*******************************************************************************!*\
839 - !*** ../modules/atomic-widgets/assets/js/editor/atomic-element-base-model.js ***!
840 - \*******************************************************************************/
2890 +/***/ "../modules/atomic-widgets/assets/js/editor/commands-internal/update-props.js":
2891 +/*!************************************************************************************!*\
2892 + !*** ../modules/atomic-widgets/assets/js/editor/commands-internal/update-props.js ***!
2893 + \************************************************************************************/
841 2894 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
842 2895
843 2896 "use strict";
844 2897
@@ -846,228 +2899,480 @@
846 2899 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
847 2900 Object.defineProperty(exports, "__esModule", ({
848 2901 value: true
849 2902 }));
850 -exports["default"] = void 0;
2903 +exports["default"] = exports.UpdateProps = void 0;
2904 +var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js"));
2905 +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
851 2906 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
852 2907 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
2908 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
853 2909 var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
854 2910 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
855 -var _get2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/get */ "../node_modules/@babel/runtime/helpers/get.js"));
856 -var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
857 -function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
858 -function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
859 -function _superPropGet(t, o, e, r) { var p = (0, _get2.default)((0, _getPrototypeOf2.default)(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; }
860 -var AtomicElementBaseModel = exports["default"] = /*#__PURE__*/function (_elementor$modules$el) {
861 - function AtomicElementBaseModel() {
862 - (0, _classCallCheck2.default)(this, AtomicElementBaseModel);
863 - return _callSuper(this, AtomicElementBaseModel, arguments);
2911 +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; }
2912 +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; }
2913 +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); }; }
2914 +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; } }
2915 +/**
2916 + * @typedef {import('elementor/assets/dev/js/editor/container/container')} Container
2917 + */
2918 +var UpdateProps = /*#__PURE__*/function (_$e$modules$editor$Co) {
2919 + (0, _inherits2.default)(UpdateProps, _$e$modules$editor$Co);
2920 + var _super = _createSuper(UpdateProps);
2921 + function UpdateProps() {
2922 + (0, _classCallCheck2.default)(this, UpdateProps);
2923 + return _super.apply(this, arguments);
864 2924 }
865 - (0, _inherits2.default)(AtomicElementBaseModel, _elementor$modules$el);
866 - return (0, _createClass2.default)(AtomicElementBaseModel, [{
867 - key: "isValidChild",
868 - value:
869 - /**
870 - * Do not allow section, column or container be placed in the Atomic container.
871 - *
872 - * @param {*} childModel
873 - */
874 - function isValidChild(childModel) {
875 - var elType = childModel.get('elType');
876 - return 'section' !== elType && 'column' !== elType;
877 - }
878 - }, {
879 - key: "initialize",
880 - value: function initialize(attributes, options) {
881 - var _this$config;
882 - var elementType = this.get('elType');
883 - this.config = elementor.config.elements[elementType];
884 - if ((_this$config = this.config) !== null && _this$config !== void 0 && (_this$config = _this$config.meta) !== null && _this$config !== void 0 && _this$config.permanently_locked) {
885 - this.set('isLocked', true);
2925 + (0, _createClass2.default)(UpdateProps, [{
2926 + key: "validateArgs",
2927 + value: function validateArgs(args) {
2928 + this.requireContainer(args);
2929 + this.requireArgumentConstructor('styleDefID', String, args);
2930 + this.requireArgumentConstructor('meta', Object, args);
2931 + this.requireArgumentConstructor('props', Object, args);
2932 + if (!('breakpoint' in args.meta && 'state' in args.meta)) {
2933 + throw new Error('Invalid meta arg');
886 2934 }
887 - var isNewElementCreate = 0 === this.get('elements').length && $e.commands.currentTrace.includes('document/elements/create');
888 - if (isNewElementCreate) {
889 - this.onElementCreate();
2935 + if (0 === Object.keys(args.props).length) {
2936 + throw new Error('Props are empty');
890 2937 }
891 - _superPropGet(AtomicElementBaseModel, "initialize", this, 3)([attributes, options]);
892 2938 }
893 2939 }, {
894 - key: "getDefaultChildren",
895 - value: function getDefaultChildren() {
896 - var defaultChildren = this.config.default_children;
897 - return this.modifyDefaultChildren(defaultChildren);
2940 + key: "getVariantByMeta",
2941 + value: function getVariantByMeta(variants, meta) {
2942 + return variants.find(function (variant) {
2943 + return variant.meta.breakpoint === meta.breakpoint && variant.meta.state === meta.state;
2944 + });
898 2945 }
899 2946 }, {
900 - key: "onElementCreate",
901 - value: function onElementCreate() {
902 - var _this = this;
903 - if (this.get('skipDefaultChildren')) {
904 - this.unset('skipDefaultChildren', {
905 - silent: true
906 - });
907 - return;
908 - }
909 - this.set('elements', this.getDefaultChildren().map(function (element) {
910 - return _this.buildElement(element);
911 - }));
2947 + key: "updateExistingVariant",
2948 + value: function updateExistingVariant(style, variant, props) {
2949 + variant.props = _objectSpread(_objectSpread({}, variant.props), props);
2950 + Object.entries(variant.props).forEach(function (_ref) {
2951 + var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
2952 + key = _ref2[0],
2953 + value = _ref2[1];
2954 + if (null === value || undefined === value) {
2955 + delete variant.props[key];
2956 + }
2957 + });
2958 + return _objectSpread(_objectSpread({}, style), {}, {
2959 + variants: style.variants.map(function (v) {
2960 + return variant.meta.breakpoint === v.breakpoint && variant.meta.state === v.state ? variant : v;
2961 + })
2962 + });
912 2963 }
913 2964 }, {
914 - key: "modifyDefaultChildren",
915 - value: function modifyDefaultChildren(element) {
916 - return element;
2965 + key: "apply",
2966 + value: function apply(args) {
2967 + var container = args.container,
2968 + styleDefID = args.styleDefID,
2969 + meta = args.meta,
2970 + props = args.props;
2971 + var oldStyles = container.model.get('styles') || {};
2972 + var style = oldStyles[styleDefID];
2973 + if (!style) {
2974 + throw new Error('Style Def not found');
2975 + }
2976 + var variant = this.getVariantByMeta(style.variants, meta);
2977 + if (!variant) {
2978 + throw new Error('Style Variant not found');
2979 + }
2980 + style = this.updateExistingVariant(style, variant, props);
2981 + var newStyles = _objectSpread(_objectSpread({}, oldStyles), {}, (0, _defineProperty2.default)({}, style.id, style));
2982 + container.model.set('styles', newStyles);
917 2983 }
918 - }, {
919 - key: "buildElement",
920 - value: function buildElement(element) {
921 - var _this2 = this,
922 - _element$settings;
923 - var id = elementorCommon.helpers.getUniqueId();
924 - var elements = (element.elements || []).map(function (el) {
925 - return _this2.buildElement(el);
926 - });
927 - return {
928 - elType: element.elType,
929 - widgetType: element.widgetType,
930 - id: id,
931 - settings: (_element$settings = element.settings) !== null && _element$settings !== void 0 ? _element$settings : {},
932 - elements: elements,
933 - isLocked: element.isLocked || false,
934 - editor_settings: element.editor_settings || {},
935 - meta: element.meta || {}
936 - };
937 - }
938 2984 }]);
939 -}(elementor.modules.elements.models.Element);
2985 + return UpdateProps;
2986 +}($e.modules.editor.CommandContainerInternalBase);
2987 +exports.UpdateProps = UpdateProps;
2988 +var _default = UpdateProps;
2989 +exports["default"] = _default;
940 2990
941 2991 /***/ }),
942 2992
943 -/***/ "../modules/atomic-widgets/assets/js/editor/atomic-element-base-type.js":
944 -/*!******************************************************************************!*\
945 - !*** ../modules/atomic-widgets/assets/js/editor/atomic-element-base-type.js ***!
946 - \******************************************************************************/
2993 +/***/ "../modules/atomic-widgets/assets/js/editor/commands/index.js":
2994 +/*!********************************************************************!*\
2995 + !*** ../modules/atomic-widgets/assets/js/editor/commands/index.js ***!
2996 + \********************************************************************/
947 2997 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
948 2998
949 2999 "use strict";
950 3000
951 3001
3002 +Object.defineProperty(exports, "__esModule", ({
3003 + value: true
3004 +}));
3005 +Object.defineProperty(exports, "Styles", ({
3006 + enumerable: true,
3007 + get: function get() {
3008 + return _styles.Styles;
3009 + }
3010 +}));
3011 +var _styles = __webpack_require__(/*! ./styles */ "../modules/atomic-widgets/assets/js/editor/commands/styles.js");
3012 +
3013 +/***/ }),
3014 +
3015 +/***/ "../modules/atomic-widgets/assets/js/editor/commands/styles.js":
3016 +/*!*********************************************************************!*\
3017 + !*** ../modules/atomic-widgets/assets/js/editor/commands/styles.js ***!
3018 + \*********************************************************************/
3019 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
3020 +
3021 +"use strict";
3022 +/* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"];
3023 +
3024 +
952 3025 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
953 3026 Object.defineProperty(exports, "__esModule", ({
954 3027 value: true
955 3028 }));
956 -exports["default"] = void 0;
3029 +exports["default"] = exports.Styles = void 0;
3030 +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
957 3031 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
958 3032 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
3033 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
959 3034 var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
960 3035 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
961 -var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
962 -function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
963 -function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
964 -var AtomicElementBaseType = exports["default"] = /*#__PURE__*/function (_elementor$modules$el) {
965 - function AtomicElementBaseType(elementType, viewClass) {
966 - var _this;
967 - var modelClass = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
968 - var emptyViewClass = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
969 - (0, _classCallCheck2.default)(this, AtomicElementBaseType);
970 - _this = _callSuper(this, AtomicElementBaseType);
971 - _this.elementType = elementType;
972 - _this.viewClass = viewClass;
973 - _this.modelClass = modelClass;
974 - _this.emptyViewClass = emptyViewClass;
975 - return _this;
3036 +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); }; }
3037 +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; } }
3038 +/**
3039 + * @typedef {import('elementor/assets/dev/js/editor/container/container')} Container
3040 + */
3041 +var Styles = /*#__PURE__*/function (_$e$modules$editor$do) {
3042 + (0, _inherits2.default)(Styles, _$e$modules$editor$do);
3043 + var _super = _createSuper(Styles);
3044 + function Styles() {
3045 + (0, _classCallCheck2.default)(this, Styles);
3046 + return _super.apply(this, arguments);
976 3047 }
977 - (0, _inherits2.default)(AtomicElementBaseType, _elementor$modules$el);
978 - return (0, _createClass2.default)(AtomicElementBaseType, [{
979 - key: "getType",
980 - value: function getType() {
981 - return this.elementType;
3048 + (0, _createClass2.default)(Styles, [{
3049 + key: "validateArgs",
3050 + value: function validateArgs(args) {
3051 + this.requireContainer(args);
3052 + if (!args.bind && !args.styleDefID) {
3053 + throw new Error('Missing bind or styleDefID');
3054 + }
3055 + if (args.bind && 'string' !== typeof args.bind) {
3056 + throw new Error('Invalid bind arg');
3057 + }
3058 + if (args.styleDefID && 'string' !== typeof args.styleDefID) {
3059 + throw new Error('Invalid styleDefID arg');
3060 + }
982 3061 }
3062 +
3063 + /**
3064 + * Function restore().
3065 + *
3066 + * Redo/Restore.
3067 + *
3068 + * @param {{}} historyItem
3069 + * @param {boolean} isRedo
3070 + */
983 3071 }, {
984 - key: "getView",
985 - value: function getView() {
986 - return this.viewClass;
3072 + key: "addToHistory",
3073 + value:
3074 + /**
3075 + * Function addToHistory().
3076 + *
3077 + * @param {Container} container
3078 + * @param {{}} oldSettings
3079 + * @param {{}} newSettings
3080 + * @param {{}} oldStyles
3081 + * @param {{}} newStyles
3082 + */
3083 + function addToHistory(container, oldSettings, newSettings, oldStyles, newStyles) {
3084 + var changes = (0, _defineProperty2.default)({}, container.id, {
3085 + old: {
3086 + settings: oldSettings,
3087 + styles: oldStyles
3088 + },
3089 + new: {
3090 + settings: newSettings,
3091 + styles: newStyles
3092 + }
3093 + }),
3094 + historyItem = {
3095 + container: container,
3096 + data: {
3097 + changes: changes
3098 + },
3099 + type: 'change',
3100 + restore: Styles.restore
3101 + };
3102 + $e.internal('document/history/add-transaction', historyItem);
987 3103 }
988 3104 }, {
989 - key: "getEmptyView",
990 - value: function getEmptyView() {
991 - return this.emptyViewClass || elementor.modules.elements.views.EmptyComponent;
3105 + key: "getHistory",
3106 + value: function getHistory(args) {
3107 + var container = args.container,
3108 + subTitle = this.constructor.getSubTitle(args);
3109 + return {
3110 + container: container,
3111 + subTitle: subTitle,
3112 + type: 'change'
3113 + };
992 3114 }
993 3115 }, {
994 - key: "getModel",
995 - value: function getModel() {
996 - return this.modelClass || elementor.modules.elements.models.AtomicElementBase;
3116 + key: "variantExists",
3117 + value: function variantExists(style, meta) {
3118 + return style.variants.some(function (variant) {
3119 + return variant.meta.breakpoint === meta.breakpoint && variant.meta.state === meta.state;
3120 + });
997 3121 }
3122 + }, {
3123 + key: "apply",
3124 + value: function apply(args) {
3125 + var _args$styleDefID, _structuredClone;
3126 + var container = args.container,
3127 + bind = args.bind,
3128 + meta = args.meta,
3129 + props = args.props;
3130 + var styleDefID = (_args$styleDefID = args.styleDefID) !== null && _args$styleDefID !== void 0 ? _args$styleDefID : null;
3131 + var oldStyles = (_structuredClone = structuredClone(container.model.get('styles'))) !== null && _structuredClone !== void 0 ? _structuredClone : {};
3132 + var oldBindSetting = container.settings.get(bind);
3133 + var style = {};
3134 + if (!styleDefID) {
3135 + style = $e.internal('document/atomic-widgets/create-style', {
3136 + container: container,
3137 + bind: bind
3138 + });
3139 + styleDefID = style.id;
3140 + } else if (oldStyles[styleDefID]) {
3141 + style = oldStyles[styleDefID];
3142 + } else {
3143 + throw new Error('Style Def not found');
3144 + }
3145 + if (!this.variantExists(style, meta)) {
3146 + $e.internal('document/atomic-widgets/create-variant', {
3147 + container: container,
3148 + styleDefID: styleDefID,
3149 + meta: meta
3150 + });
3151 + }
3152 + $e.internal('document/atomic-widgets/update-props', {
3153 + container: container,
3154 + styleDefID: styleDefID,
3155 + bind: bind,
3156 + meta: meta,
3157 + props: props
3158 + });
3159 + if (this.isHistoryActive()) {
3160 + var newStyles = container.model.get('styles');
3161 + var newBindSetting = container.settings.get(bind);
3162 + var oldSettings = (0, _defineProperty2.default)({}, bind, oldBindSetting !== null && oldBindSetting !== void 0 ? oldBindSetting : null);
3163 + var newSettings = (0, _defineProperty2.default)({}, bind, newBindSetting);
3164 + this.addToHistory(container, oldSettings, newSettings, oldStyles, newStyles);
3165 + }
3166 + }
3167 + }], [{
3168 + key: "getSubTitle",
3169 + value: function getSubTitle() {
3170 + return __('Style', 'elementor');
3171 + }
3172 + }, {
3173 + key: "restore",
3174 + value: function restore(historyItem, isRedo) {
3175 + var container = historyItem.get('container');
3176 + var changes = historyItem.get('data').changes[container.id];
3177 + $e.internal('document/elements/set-settings', {
3178 + container: container,
3179 + options: {
3180 + render: false
3181 + },
3182 + settings: isRedo ? changes.new.settings : changes.old.settings
3183 + });
3184 + container.model.set('styles', isRedo ? changes.new.styles : changes.old.styles);
3185 + }
998 3186 }]);
999 -}(elementor.modules.elements.types.Base);
3187 + return Styles;
3188 +}($e.modules.editor.document.CommandHistoryDebounceBase);
3189 +exports.Styles = Styles;
3190 +var _default = Styles;
3191 +exports["default"] = _default;
1000 3192
1001 3193 /***/ }),
1002 3194
1003 -/***/ "../modules/atomic-widgets/assets/js/editor/atomic-element-types/create-div-block-type.js":
1004 -/*!************************************************************************************************!*\
1005 - !*** ../modules/atomic-widgets/assets/js/editor/atomic-element-types/create-div-block-type.js ***!
1006 - \************************************************************************************************/
1007 -/***/ ((__unused_webpack_module, exports) => {
3195 +/***/ "../modules/atomic-widgets/assets/js/editor/component.js":
3196 +/*!***************************************************************!*\
3197 + !*** ../modules/atomic-widgets/assets/js/editor/component.js ***!
3198 + \***************************************************************/
3199 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1008 3200
1009 3201 "use strict";
1010 3202
1011 3203
3204 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
3205 +var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js");
1012 3206 Object.defineProperty(exports, "__esModule", ({
1013 3207 value: true
1014 3208 }));
1015 3209 exports["default"] = void 0;
1016 -var createDivBlockType = function createDivBlockType() {
1017 - var DivBlockView = elementor.modules.elements.views.createAtomicElementBase('e-div-block');
1018 - return new elementor.modules.elements.types.AtomicElementBase('e-div-block', DivBlockView);
1019 -};
1020 -var _default = exports["default"] = createDivBlockType;
3210 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
3211 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
3212 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
3213 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
3214 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
3215 +var _componentBase = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/component-base */ "../modules/web-cli/assets/js/modules/component-base.js"));
3216 +var commands = _interopRequireWildcard(__webpack_require__(/*! ./commands/ */ "../modules/atomic-widgets/assets/js/editor/commands/index.js"));
3217 +var commandsInternal = _interopRequireWildcard(__webpack_require__(/*! ./commands-internal/ */ "../modules/atomic-widgets/assets/js/editor/commands-internal/index.js"));
3218 +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); }
3219 +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; }
3220 +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); }; }
3221 +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; } }
3222 +var Component = /*#__PURE__*/function (_ComponentBase) {
3223 + (0, _inherits2.default)(Component, _ComponentBase);
3224 + var _super = _createSuper(Component);
3225 + function Component() {
3226 + (0, _classCallCheck2.default)(this, Component);
3227 + return _super.apply(this, arguments);
3228 + }
3229 + (0, _createClass2.default)(Component, [{
3230 + key: "getNamespace",
3231 + value: function getNamespace() {
3232 + return 'document/atomic-widgets';
3233 + }
3234 + }, {
3235 + key: "defaultCommands",
3236 + value: function defaultCommands() {
3237 + return this.importCommands(commands);
3238 + }
3239 + }, {
3240 + key: "defaultCommandsInternal",
3241 + value: function defaultCommandsInternal() {
3242 + return this.importCommands(commandsInternal);
3243 + }
3244 + }]);
3245 + return Component;
3246 +}(_componentBase.default);
3247 +exports["default"] = Component;
1021 3248
1022 3249 /***/ }),
1023 3250
1024 -/***/ "../modules/atomic-widgets/assets/js/editor/atomic-element-types/create-flexbox-type.js":
1025 -/*!**********************************************************************************************!*\
1026 - !*** ../modules/atomic-widgets/assets/js/editor/atomic-element-types/create-flexbox-type.js ***!
1027 - \**********************************************************************************************/
1028 -/***/ ((__unused_webpack_module, exports) => {
3251 +/***/ "../modules/web-cli/assets/js/modules/command-base.js":
3252 +/*!************************************************************!*\
3253 + !*** ../modules/web-cli/assets/js/modules/command-base.js ***!
3254 + \************************************************************/
3255 +/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1029 3256
1030 3257 "use strict";
1031 3258
1032 3259
3260 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
1033 3261 Object.defineProperty(exports, "__esModule", ({
1034 3262 value: true
1035 3263 }));
1036 3264 exports["default"] = void 0;
1037 -var createFlexboxType = function createFlexboxType() {
1038 - var FlexboxView = elementor.modules.elements.views.createAtomicElementBase('e-flexbox');
1039 - return new elementor.modules.elements.types.AtomicElementBase('e-flexbox', FlexboxView);
1040 -};
1041 -var _default = exports["default"] = createFlexboxType;
3265 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
3266 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
3267 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
3268 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
3269 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
3270 +var _commandInfra = _interopRequireDefault(__webpack_require__(/*! ./command-infra */ "../modules/web-cli/assets/js/modules/command-infra.js"));
3271 +var _deprecation = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/deprecation */ "../modules/web-cli/assets/js/utils/deprecation.js"));
3272 +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); }; }
3273 +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; } }
3274 +/**
3275 + * @name $e.modules.CommandBase
3276 + */
3277 +var CommandBase = /*#__PURE__*/function (_CommandInfra) {
3278 + (0, _inherits2.default)(CommandBase, _CommandInfra);
3279 + var _super = _createSuper(CommandBase);
3280 + function CommandBase() {
3281 + (0, _classCallCheck2.default)(this, CommandBase);
3282 + return _super.apply(this, arguments);
3283 + }
3284 + (0, _createClass2.default)(CommandBase, [{
3285 + key: "onBeforeRun",
3286 + value: function onBeforeRun() {
3287 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
3288 + $e.hooks.runUIBefore(this.command, args);
3289 + }
3290 + }, {
3291 + key: "onAfterRun",
3292 + value: function onAfterRun() {
3293 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
3294 + var result = arguments.length > 1 ? arguments[1] : undefined;
3295 + $e.hooks.runUIAfter(this.command, args, result);
3296 + }
3297 + }, {
3298 + key: "onBeforeApply",
3299 + value: function onBeforeApply() {
3300 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
3301 + $e.hooks.runDataDependency(this.command, args);
3302 + }
3303 + }, {
3304 + key: "onAfterApply",
3305 + value: function onAfterApply() {
3306 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
3307 + var result = arguments.length > 1 ? arguments[1] : undefined;
3308 + $e.hooks.runDataAfter(this.command, args, result);
3309 + }
3310 + }, {
3311 + key: "onCatchApply",
3312 + value: function onCatchApply(e) {
3313 + this.runCatchHooks(e);
3314 + }
1042 3315
1043 -/***/ }),
3316 + /**
3317 + * Run all the catch hooks.
3318 + *
3319 + * @param {Error} e
3320 + */
3321 + }, {
3322 + key: "runCatchHooks",
3323 + value: function runCatchHooks(e) {
3324 + $e.hooks.runDataCatch(this.command, this.args, e);
3325 + $e.hooks.runUICatch(this.command, this.args, e);
3326 + }
1044 3327
1045 -/***/ "../modules/atomic-widgets/assets/js/editor/atomic-element-types/create-grid-type.js":
1046 -/*!*******************************************************************************************!*\
1047 - !*** ../modules/atomic-widgets/assets/js/editor/atomic-element-types/create-grid-type.js ***!
1048 - \*******************************************************************************************/
1049 -/***/ ((__unused_webpack_module, exports) => {
3328 + /**
3329 + * TODO - Remove - Backwards compatibility.
3330 + *
3331 + * Function requireContainer().
3332 + *
3333 + * Validate `arg.container` & `arg.containers`.
3334 + *
3335 + * @param {{}} args
3336 + * @deprecated since 3.7.0, extend `$e.modules.editor.CommandContainerBase` or `$e.modules.editor.CommandContainerInternalBase` instead.
3337 + *
3338 + * @throws {Error}
3339 + */
3340 + }, {
3341 + key: "requireContainer",
3342 + value: function requireContainer() {
3343 + var _this = this;
3344 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.args;
3345 + _deprecation.default.deprecated('requireContainer()', '3.7.0', 'Extend `$e.modules.editor.CommandContainerBase` or `$e.modules.editor.CommandContainerInternalBase`');
3346 + if (!args.container && !args.containers) {
3347 + throw Error('container or containers are required.');
3348 + }
3349 + if (args.container && args.containers) {
3350 + throw Error('container and containers cannot go together please select one of them.');
3351 + }
3352 + var containers = args.containers || [args.container];
3353 + containers.forEach(function (container) {
3354 + _this.requireArgumentInstance('container', elementorModules.editor.Container, {
3355 + container: container
3356 + });
3357 + });
3358 + }
3359 + }], [{
3360 + key: "getInstanceType",
3361 + value: function getInstanceType() {
3362 + return 'CommandBase';
3363 + }
3364 + }]);
3365 + return CommandBase;
3366 +}(_commandInfra.default);
3367 +exports["default"] = CommandBase;
1050 3368
1051 -"use strict";
1052 -
1053 -
1054 -Object.defineProperty(exports, "__esModule", ({
1055 - value: true
1056 -}));
1057 -exports["default"] = void 0;
1058 -var createGridType = function createGridType() {
1059 - var GridView = elementor.modules.elements.views.createAtomicElementBase('e-grid');
1060 - return new elementor.modules.elements.types.AtomicElementBase('e-grid', GridView);
1061 -};
1062 -var _default = exports["default"] = createGridType;
1063 -
1064 3369 /***/ }),
1065 3370
1066 -/***/ "../modules/atomic-widgets/assets/js/editor/component.js":
1067 -/*!***************************************************************!*\
1068 - !*** ../modules/atomic-widgets/assets/js/editor/component.js ***!
1069 - \***************************************************************/
3371 +/***/ "../modules/web-cli/assets/js/modules/command-callback-base.js":
3372 +/*!*********************************************************************!*\
3373 + !*** ../modules/web-cli/assets/js/modules/command-callback-base.js ***!
3374 + \*********************************************************************/
1070 3375 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1071 3376
1072 3377 "use strict";
1073 3378
@@ -1072,9 +3377,8 @@
1072 3377 "use strict";
1073 3378
1074 3379
1075 3380 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
1076 -var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js");
1077 3381 Object.defineProperty(exports, "__esModule", ({
1078 3382 value: true
1079 3383 }));
1080 3384 exports["default"] = void 0;
@@ -1079,40 +3383,59 @@
1079 3383 }));
1080 3384 exports["default"] = void 0;
1081 3385 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
1082 3386 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
3387 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
1083 3388 var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
1084 3389 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
1085 -var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
1086 -var hooks = _interopRequireWildcard(__webpack_require__(/*! ./hooks */ "../modules/atomic-widgets/assets/js/editor/hooks/index.js"));
1087 -function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
1088 -function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
1089 -function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
1090 -var Component = exports["default"] = /*#__PURE__*/function (_$e$modules$Component) {
1091 - function Component() {
1092 - (0, _classCallCheck2.default)(this, Component);
1093 - return _callSuper(this, Component, arguments);
3390 +var _commandBase = _interopRequireDefault(__webpack_require__(/*! ./command-base */ "../modules/web-cli/assets/js/modules/command-base.js"));
3391 +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); }; }
3392 +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; } }
3393 +/**
3394 + * To support pure callbacks in the API(commands.js), to ensure they have registered with the proper context.
3395 + */
3396 +var CommandCallbackBase = /*#__PURE__*/function (_CommandBase) {
3397 + (0, _inherits2.default)(CommandCallbackBase, _CommandBase);
3398 + var _super = _createSuper(CommandCallbackBase);
3399 + function CommandCallbackBase() {
3400 + (0, _classCallCheck2.default)(this, CommandCallbackBase);
3401 + return _super.apply(this, arguments);
1094 3402 }
1095 - (0, _inherits2.default)(Component, _$e$modules$Component);
1096 - return (0, _createClass2.default)(Component, [{
1097 - key: "getNamespace",
1098 - value: function getNamespace() {
1099 - return 'document/atomic-widgets';
3403 + (0, _createClass2.default)(CommandCallbackBase, [{
3404 + key: "apply",
3405 + value: function apply() {
3406 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
3407 + return this.constructor.getCallback()(args);
1100 3408 }
3409 + }], [{
3410 + key: "getInstanceType",
3411 + value: function getInstanceType() {
3412 + return 'CommandCallbackBase';
3413 + }
3414 +
3415 + /**
3416 + * Get original callback of the command.
3417 + *
3418 + * Support pure callbacks ( Non command-base ).
3419 + *
3420 + * @return {()=>{}} Command Results.
3421 + */
1101 3422 }, {
1102 - key: "defaultHooks",
1103 - value: function defaultHooks() {
1104 - return this.importHooks(hooks);
3423 + key: "getCallback",
3424 + value: function getCallback() {
3425 + return this.registerConfig.callback;
1105 3426 }
1106 3427 }]);
1107 -}($e.modules.ComponentBase);
3428 + return CommandCallbackBase;
3429 +}(_commandBase.default);
3430 +exports["default"] = CommandCallbackBase;
1108 3431
1109 3432 /***/ }),
1110 3433
1111 -/***/ "../modules/atomic-widgets/assets/js/editor/container/atomic-element-empty-view.js":
1112 -/*!*****************************************************************************************!*\
1113 - !*** ../modules/atomic-widgets/assets/js/editor/container/atomic-element-empty-view.js ***!
1114 - \*****************************************************************************************/
3434 +/***/ "../modules/web-cli/assets/js/modules/command-infra.js":
3435 +/*!*************************************************************!*\
3436 + !*** ../modules/web-cli/assets/js/modules/command-infra.js ***!
3437 + \*************************************************************/
1115 3438 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1116 3439
1117 3440 "use strict";
1118 3441
@@ -1121,77 +3444,247 @@
1121 3444 Object.defineProperty(exports, "__esModule", ({
1122 3445 value: true
1123 3446 }));
1124 3447 exports["default"] = void 0;
1125 -var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react"));
1126 3448 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
1127 3449 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
3450 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
1128 3451 var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
1129 3452 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
1130 -var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
1131 3453 var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
1132 -var _react2 = _interopRequireDefault(__webpack_require__(/*! elementor-utils/react */ "../assets/dev/js/utils/react.js"));
1133 -var _emptyComponent = _interopRequireDefault(__webpack_require__(/*! elementor-elements/views/container/empty-component */ "../assets/dev/js/editor/elements/views/container/empty-component.js"));
1134 -function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
1135 -function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
1136 -var AtomicElementEmptyView = exports["default"] = /*#__PURE__*/function (_Marionette$ItemView) {
1137 - function AtomicElementEmptyView() {
3454 +var _argsObject = _interopRequireDefault(__webpack_require__(/*! elementor-assets-js/modules/imports/args-object */ "../assets/dev/js/modules/imports/args-object.js"));
3455 +var _deprecation = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/deprecation */ "../modules/web-cli/assets/js/utils/deprecation.js"));
3456 +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); }; }
3457 +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; } }
3458 +/**
3459 + * @typedef {import('../modules/component-base')} ComponentBase
3460 + */
3461 +var CommandInfra = /*#__PURE__*/function (_ArgsObject) {
3462 + (0, _inherits2.default)(CommandInfra, _ArgsObject);
3463 + var _super = _createSuper(CommandInfra);
3464 + /**
3465 + * Function constructor().
3466 + *
3467 + * Create Commands Base.
3468 + *
3469 + * @param {{}} args
3470 + */
3471 + function CommandInfra() {
1138 3472 var _this;
1139 - (0, _classCallCheck2.default)(this, AtomicElementEmptyView);
1140 - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
1141 - args[_key] = arguments[_key];
3473 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
3474 + (0, _classCallCheck2.default)(this, CommandInfra);
3475 + _this = _super.call(this, args);
3476 + if (!_this.constructor.registerConfig) {
3477 + throw RangeError('Doing it wrong: Each command type should have `registerConfig`.');
1142 3478 }
1143 - _this = _callSuper(this, AtomicElementEmptyView, [].concat(args));
1144 - (0, _defineProperty2.default)(_this, "template", '<div></div>');
1145 - (0, _defineProperty2.default)(_this, "className", 'elementor-empty-view');
1146 - (0, _defineProperty2.default)(_this, "unmount", null);
3479 +
3480 + // Acknowledge self about which command it run.
3481 + _this.command = _this.constructor.getCommand();
3482 +
3483 + // Assign instance of current component.
3484 + _this.component = _this.constructor.getComponent();
3485 +
3486 + // Who ever need do something before without `super` the constructor can use `initialize` method.
3487 + _this.initialize(args);
3488 +
3489 + // Refresh args, maybe the changed via `initialize`.
3490 + args = _this.args;
3491 +
3492 + // Validate args before run.
3493 + _this.validateArgs(args);
1147 3494 return _this;
1148 3495 }
1149 - (0, _inherits2.default)(AtomicElementEmptyView, _Marionette$ItemView);
1150 - return (0, _createClass2.default)(AtomicElementEmptyView, [{
1151 - key: "renderReactDefaultElement",
1152 - value: function renderReactDefaultElement(container) {
1153 - var _ReactUtils$render = _react2.default.render(/*#__PURE__*/_react.default.createElement(_emptyComponent.default, {
1154 - container: container
1155 - }), this.el),
1156 - unmount = _ReactUtils$render.unmount;
1157 - this.unmount = unmount;
3496 +
3497 + /**
3498 + * Function initialize().
3499 + *
3500 + * Initialize command, called after construction.
3501 + *
3502 + * @param {{}} args
3503 + */
3504 + (0, _createClass2.default)(CommandInfra, [{
3505 + key: "currentCommand",
3506 + get:
3507 + /**
3508 + * @deprecated since 3.7.0, use `this.command` instead.
3509 + */
3510 + function get() {
3511 + _deprecation.default.deprecated('this.currentCommand', '3.7.0', 'this.command');
3512 + return this.command;
1158 3513 }
1159 3514 }, {
1160 - key: "onBeforeRender",
1161 - value: function onBeforeRender() {
1162 - // In case the element is being rendered again, we need to unmount the previous React component.
1163 - if (this.unmount) {
1164 - this.unmount();
1165 - this.unmount = null;
1166 - }
3515 + key: "initialize",
3516 + value: function initialize() {
3517 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
3518 + } // eslint-disable-line no-unused-vars
3519 +
3520 + /**
3521 + * Function validateArgs().
3522 + *
3523 + * Validate command arguments.
3524 + *
3525 + * @param {{}} args
3526 + */
3527 + }, {
3528 + key: "validateArgs",
3529 + value: function validateArgs() {
3530 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
3531 + } // eslint-disable-line no-unused-vars
3532 +
3533 + // eslint-disable-next-line jsdoc/require-returns-check
3534 + /**
3535 + * Function apply().
3536 + *
3537 + * Do the actual command.
3538 + *
3539 + * @param {{}} args
3540 + *
3541 + * @return {*} Command results.
3542 + */
3543 + }, {
3544 + key: "apply",
3545 + value: function apply() {
3546 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
3547 + // eslint-disable-line no-unused-vars
3548 + elementorModules.ForceMethodImplementation();
1167 3549 }
3550 +
3551 + /**
3552 + * Function run().
3553 + *
3554 + * Run command with history & hooks.
3555 + *
3556 + * @return {*} Command results.
3557 + */
1168 3558 }, {
1169 - key: "onRender",
1170 - value: function onRender() {
1171 - this.$el.addClass(this.className);
1172 - this.renderReactDefaultElement();
3559 + key: "run",
3560 + value: function run() {
3561 + return this.apply(this.args);
1173 3562 }
3563 +
3564 + /**
3565 + * Function onBeforeRun.
3566 + *
3567 + * Called before run().
3568 + *
3569 + * @param {{}} args
3570 + */
1174 3571 }, {
1175 - key: "onDestroy",
1176 - value: function onDestroy() {
1177 - var _this$unmount;
1178 - (_this$unmount = this.unmount) === null || _this$unmount === void 0 || _this$unmount.call(this);
3572 + key: "onBeforeRun",
3573 + value: function onBeforeRun() {
3574 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
3575 + } // eslint-disable-line no-unused-vars
3576 +
3577 + /**
3578 + * Function onAfterRun.
3579 + *
3580 + * Called after run().
3581 + *
3582 + * @param {{}} args
3583 + * @param {*} result
3584 + */
3585 + }, {
3586 + key: "onAfterRun",
3587 + value: function onAfterRun() {
3588 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
3589 + var result = arguments.length > 1 ? arguments[1] : undefined;
3590 + } // eslint-disable-line no-unused-vars
3591 +
3592 + /**
3593 + * Function onBeforeApply.
3594 + *
3595 + * Called before apply().
3596 + *
3597 + * @param {{}} args
3598 + */
3599 + }, {
3600 + key: "onBeforeApply",
3601 + value: function onBeforeApply() {
3602 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
3603 + } // eslint-disable-line no-unused-vars
3604 +
3605 + /**
3606 + * Function onAfterApply.
3607 + *
3608 + * Called after apply().
3609 + *
3610 + * @param {{}} args
3611 + * @param {*} result
3612 + */
3613 + }, {
3614 + key: "onAfterApply",
3615 + value: function onAfterApply() {
3616 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
3617 + var result = arguments.length > 1 ? arguments[1] : undefined;
3618 + } // eslint-disable-line no-unused-vars
3619 +
3620 + /**
3621 + * Function onCatchApply.
3622 + *
3623 + * Called after apply() failed.
3624 + *
3625 + * @param {Error} e
3626 + */
3627 + }, {
3628 + key: "onCatchApply",
3629 + value: function onCatchApply(e) {} // eslint-disable-line no-unused-vars
3630 + }], [{
3631 + key: "getInstanceType",
3632 + value: function getInstanceType() {
3633 + return 'CommandInfra';
1179 3634 }
3635 +
3636 + /**
3637 + * Get info of command.
3638 + *
3639 + * @return {Object} Extra information about the command.
3640 + */
3641 + }, {
3642 + key: "getInfo",
3643 + value: function getInfo() {
3644 + return {};
3645 + }
3646 +
3647 + /**
3648 + * @return {string} Self command name.
3649 + */
3650 + }, {
3651 + key: "getCommand",
3652 + value: function getCommand() {
3653 + return this.registerConfig.command;
3654 + }
3655 +
3656 + /**
3657 + * @return {ComponentBase} Self component
3658 + */
3659 + }, {
3660 + key: "getComponent",
3661 + value: function getComponent() {
3662 + return this.registerConfig.component;
3663 + }
3664 + }, {
3665 + key: "setRegisterConfig",
3666 + value: function setRegisterConfig(config) {
3667 + this.registerConfig = Object.freeze(config);
3668 + }
1180 3669 }]);
1181 -}(Marionette.ItemView);
3670 + return CommandInfra;
3671 +}(_argsObject.default);
3672 +exports["default"] = CommandInfra;
3673 +/**
3674 + * @type {Object}
3675 + */
3676 +(0, _defineProperty2.default)(CommandInfra, "registerConfig", null);
1182 3677
1183 3678 /***/ }),
1184 3679
1185 -/***/ "../modules/atomic-widgets/assets/js/editor/create-atomic-element-base-view.js":
1186 -/*!*************************************************************************************!*\
1187 - !*** ../modules/atomic-widgets/assets/js/editor/create-atomic-element-base-view.js ***!
1188 - \*************************************************************************************/
3680 +/***/ "../modules/web-cli/assets/js/modules/component-base.js":
3681 +/*!**************************************************************!*\
3682 + !*** ../modules/web-cli/assets/js/modules/component-base.js ***!
3683 + \**************************************************************/
1189 3684 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1190 3685
1191 3686 "use strict";
1192 -/* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"];
1193 -/* provided dependency */ var sprintf = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["sprintf"];
1194 3687
1195 3688
1196 3689 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
1197 3690 Object.defineProperty(exports, "__esModule", ({
@@ -1196,560 +3689,597 @@
1196 3689 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
1197 3690 Object.defineProperty(exports, "__esModule", ({
1198 3691 value: true
1199 3692 }));
1200 -exports["default"] = createAtomicElementBaseView;
1201 -var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ "../node_modules/@babel/runtime/regenerator/index.js"));
1202 -var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "../node_modules/@babel/runtime/helpers/asyncToGenerator.js"));
1203 -var _toConsumableArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ "../node_modules/@babel/runtime/helpers/toConsumableArray.js"));
3693 +exports["default"] = void 0;
3694 +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
1204 3695 var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js"));
1205 -var _elementTypes = __webpack_require__(/*! elementor-editor/utils/element-types */ "../assets/dev/js/editor/utils/element-types.js");
1206 -var _atomicElementEmptyView = _interopRequireDefault(__webpack_require__(/*! ./container/atomic-element-empty-view */ "../modules/atomic-widgets/assets/js/editor/container/atomic-element-empty-view.js"));
1207 -var BaseElementView = elementor.modules.elements.views.BaseElement;
1208 -function createAtomicElementBaseView(type) {
1209 - var AtomicElementView = BaseElementView.extend({
1210 - template: Marionette.TemplateCache.get("#tmpl-elementor-".concat(type, "-content")),
1211 - emptyView: _atomicElementEmptyView.default,
1212 - _childrenRenderPromises: [],
1213 - _createElement: function _createElement(tag) {
1214 - var _elementor$$preview;
1215 - var previewDocument = (_elementor$$preview = elementor.$preview) === null || _elementor$$preview === void 0 || (_elementor$$preview = _elementor$$preview[0]) === null || _elementor$$preview === void 0 ? void 0 : _elementor$$preview.contentDocument;
1216 - if (previewDocument) {
1217 - return previewDocument.createElement(tag);
3696 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
3697 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
3698 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
3699 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
3700 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
3701 +var _commandCallbackBase = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/command-callback-base */ "../modules/web-cli/assets/js/modules/command-callback-base.js"));
3702 +var _toolkit = __webpack_require__(/*! @reduxjs/toolkit */ "../node_modules/@reduxjs/toolkit/dist/redux-toolkit.esm.js");
3703 +var _module = _interopRequireDefault(__webpack_require__(/*! elementor/assets/dev/js/modules/imports/module.js */ "../assets/dev/js/modules/imports/module.js"));
3704 +var _forceMethodImplementation = _interopRequireDefault(__webpack_require__(/*! ../utils/force-method-implementation */ "../modules/web-cli/assets/js/utils/force-method-implementation.js"));
3705 +var _deprecation = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/deprecation */ "../modules/web-cli/assets/js/utils/deprecation.js"));
3706 +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; }
3707 +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; }
3708 +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); }; }
3709 +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; } }
3710 +/**
3711 + * @typedef {import('./command-infra')} CommandInfra
3712 + * @typedef {import('./hook-base')} HookBase
3713 + * @typedef {import('../core/states/ui-state-base')} UiStateBase
3714 + */
3715 +var ComponentBase = /*#__PURE__*/function (_Module) {
3716 + (0, _inherits2.default)(ComponentBase, _Module);
3717 + var _super = _createSuper(ComponentBase);
3718 + function ComponentBase() {
3719 + (0, _classCallCheck2.default)(this, ComponentBase);
3720 + return _super.apply(this, arguments);
3721 + }
3722 + (0, _createClass2.default)(ComponentBase, [{
3723 + key: "__construct",
3724 + value: function __construct() {
3725 + var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
3726 + if (args.manager) {
3727 + this.manager = args.manager;
1218 3728 }
1219 - return document.createElement(tag);
1220 - },
1221 - getChildViewContainer: function getChildViewContainer() {
1222 - this.childViewContainer = '';
1223 - return Marionette.CompositeView.prototype.getChildViewContainer.apply(this, arguments);
1224 - },
1225 - getChildType: function getChildType() {
1226 - var atomicElements = Object.entries(elementor.config.elements).filter(function (_ref) {
3729 + this.commands = this.defaultCommands();
3730 + this.commandsInternal = this.defaultCommandsInternal();
3731 + this.hooks = this.defaultHooks();
3732 + this.routes = this.defaultRoutes();
3733 + this.tabs = this.defaultTabs();
3734 + this.shortcuts = this.defaultShortcuts();
3735 + this.utils = this.defaultUtils();
3736 + this.data = this.defaultData();
3737 + this.uiStates = this.defaultUiStates();
3738 + this.states = this.defaultStates();
3739 + this.defaultRoute = '';
3740 + this.currentTab = '';
3741 + }
3742 + }, {
3743 + key: "registerAPI",
3744 + value: function registerAPI() {
3745 + var _this = this;
3746 + Object.entries(this.getTabs()).forEach(function (tab) {
3747 + return _this.registerTabRoute(tab[0]);
3748 + });
3749 + Object.entries(this.getRoutes()).forEach(function (_ref) {
1227 3750 var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
1228 - element = _ref2[1];
1229 - return !!(element !== null && element !== void 0 && element.atomic_props_schema);
1230 - }).map(function (_ref3) {
1231 - var _ref4 = (0, _slicedToArray2.default)(_ref3, 1),
1232 - elType = _ref4[0];
1233 - return elType;
3751 + route = _ref2[0],
3752 + callback = _ref2[1];
3753 + return _this.registerRoute(route, callback);
1234 3754 });
1235 - return ['widget', 'container'].concat((0, _toConsumableArray2.default)(atomicElements));
1236 - },
1237 - getRenderContext: function getRenderContext() {
1238 - var _this$_parent, _this$_parent$getRend;
1239 - return (_this$_parent = this._parent) === null || _this$_parent === void 0 || (_this$_parent$getRend = _this$_parent.getRenderContext) === null || _this$_parent$getRend === void 0 ? void 0 : _this$_parent$getRend.call(_this$_parent);
1240 - },
1241 - getResolverRenderContext: function getResolverRenderContext() {
1242 - var _this$_parent2, _this$_parent2$getRes;
1243 - return (_this$_parent2 = this._parent) === null || _this$_parent2 === void 0 || (_this$_parent2$getRes = _this$_parent2.getResolverRenderContext) === null || _this$_parent2$getRes === void 0 ? void 0 : _this$_parent2$getRes.call(_this$_parent2);
1244 - },
1245 - render: function render() {
1246 - var _this = this;
1247 - this._currentRenderPromise = new Promise(function (resolve) {
1248 - // Optimize rendering by reusing existing child views instead of recreating them.
1249 - if (_this._shouldSkipFullRender()) {
1250 - _this._renderWithoutDomRecreation(resolve);
1251 - } else {
1252 - _this._renderWithDomRecreation(resolve);
1253 - }
3755 + Object.entries(this.getCommands()).forEach(function (_ref3) {
3756 + var _ref4 = (0, _slicedToArray2.default)(_ref3, 2),
3757 + command = _ref4[0],
3758 + callback = _ref4[1];
3759 + return _this.registerCommand(command, callback);
1254 3760 });
1255 - return this;
1256 - },
1257 - _shouldSkipFullRender: function _shouldSkipFullRender() {
1258 - return this.isRendered && this._hasConnectedChildren();
1259 - },
1260 - _hasConnectedChildren: function _hasConnectedChildren() {
1261 - var _this$children, _firstChild$$el$get$i, _firstChild$$el;
1262 - if (!((_this$children = this.children) !== null && _this$children !== void 0 && _this$children.length)) {
1263 - return false;
1264 - }
1265 -
1266 - // If the parent's innerHTML was replaced, all children are detached together.
1267 - var firstChild = this.children.findByIndex(0);
1268 - return (_firstChild$$el$get$i = firstChild === null || firstChild === void 0 || (_firstChild$$el = firstChild.$el) === null || _firstChild$$el === void 0 || (_firstChild$$el = _firstChild$$el.get(0)) === null || _firstChild$$el === void 0 ? void 0 : _firstChild$$el.isConnected) !== null && _firstChild$$el$get$i !== void 0 ? _firstChild$$el$get$i : false;
1269 - },
1270 - _renderWithoutDomRecreation: function _renderWithoutDomRecreation(resolve) {
1271 - var _this2 = this;
1272 - this._beforeRender();
1273 - this._renderChildren();
1274 - this._waitForChildrenToComplete().then(function () {
1275 - _this2._afterRender();
1276 - resolve();
3761 + Object.entries(this.getCommandsInternal()).forEach(function (_ref5) {
3762 + var _ref6 = (0, _slicedToArray2.default)(_ref5, 2),
3763 + command = _ref6[0],
3764 + callback = _ref6[1];
3765 + return _this.registerCommandInternal(command, callback);
1277 3766 });
1278 - },
1279 - _renderWithDomRecreation: function _renderWithDomRecreation(resolve) {
1280 - BaseElementView.prototype.render.apply(this, arguments);
1281 - this._waitForChildrenToComplete().then(function () {
1282 - resolve();
3767 + Object.values(this.getHooks()).forEach(function (instance) {
3768 + return _this.registerHook(instance);
1283 3769 });
1284 - },
1285 - _beforeRender: function _beforeRender() {
1286 - this._isRendering = true;
1287 - this.triggerMethod('before:render', this);
1288 - },
1289 - _afterRender: function _afterRender() {
1290 - this._isRendering = false;
1291 - this.isRendered = true;
1292 - this.triggerMethod('render', this);
1293 - },
1294 - _waitForChildrenToComplete: function _waitForChildrenToComplete() {
1295 - var _this3 = this;
1296 - return (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee() {
1297 - return _regenerator.default.wrap(function (_context) {
1298 - while (1) switch (_context.prev = _context.next) {
1299 - case 0:
1300 - if (!(_this3._childrenRenderPromises.length > 0)) {
1301 - _context.next = 1;
1302 - break;
1303 - }
1304 - _context.next = 1;
1305 - return Promise.all(_this3._childrenRenderPromises);
1306 - case 1:
1307 - case "end":
1308 - return _context.stop();
1309 - }
1310 - }, _callee);
1311 - }))();
1312 - },
1313 - _renderChildren: function _renderChildren() {
1314 - if (this._shouldSkipFullRender()) {
1315 - var _this$children2;
1316 - (_this$children2 = this.children) === null || _this$children2 === void 0 || _this$children2.each(function (childView) {
1317 - return childView.render();
1318 - });
1319 - } else {
1320 - BaseElementView.prototype._renderChildren.apply(this, arguments);
1321 - }
1322 - this._collectChildrenRenderPromises();
1323 - },
1324 - _collectChildrenRenderPromises: function _collectChildrenRenderPromises() {
1325 - var _this$children3,
1326 - _this4 = this;
1327 - this._childrenRenderPromises = [];
1328 - (_this$children3 = this.children) === null || _this$children3 === void 0 || _this$children3.each(function (childView) {
1329 - if (childView._currentRenderPromise) {
1330 - _this4._childrenRenderPromises.push(childView._currentRenderPromise);
1331 - }
3770 + Object.entries(this.getData()).forEach(function (_ref7) {
3771 + var _ref8 = (0, _slicedToArray2.default)(_ref7, 2),
3772 + command = _ref8[0],
3773 + callback = _ref8[1];
3774 + return _this.registerData(command, callback);
1332 3775 });
1333 - },
1334 - onRender: function onRender() {
1335 - var _this5 = this;
1336 - this.dispatchPreviewEvent('elementor/element/render');
1337 - BaseElementView.prototype.onRender.apply(this, arguments);
3776 + Object.values(this.getUiStates()).forEach(function (instance) {
3777 + return _this.registerUiState(instance);
3778 + });
3779 + Object.entries(this.getStates()).forEach(function (_ref9) {
3780 + var _ref10 = (0, _slicedToArray2.default)(_ref9, 2),
3781 + id = _ref10[0],
3782 + state = _ref10[1];
3783 + return _this.registerState(id, state);
3784 + });
3785 + }
1338 3786
1339 - // Defer to wait for everything to render.
1340 - setTimeout(function () {
1341 - if (_this5.isAtomicGridContainer()) {
1342 - _this5.reInitEmptyView();
1343 - }
1344 - _this5.droppableInitialize();
1345 - _this5.updateHandlesPosition();
1346 - });
1347 - },
1348 - destroyEmptyView: function destroyEmptyView() {
1349 - if (this.isAtomicGridContainer()) {
1350 - return;
1351 - }
1352 - return Marionette.CompositeView.prototype.destroyEmptyView.apply(this, arguments);
1353 - },
1354 - isAtomicGridContainer: function isAtomicGridContainer() {
1355 - return 'e-grid' === type;
1356 - },
1357 - reInitEmptyView: function reInitEmptyView() {
1358 - var _this$el;
1359 - if ((_this$el = this.el) !== null && _this$el !== void 0 && _this$el.querySelector(':scope > .elementor-empty-view')) {
1360 - return;
1361 - }
1362 - delete this._showingEmptyView;
1363 - this.showEmptyView();
1364 - },
1365 - onDestroy: function onDestroy() {
1366 - BaseElementView.prototype.onDestroy.apply(this, arguments);
1367 - this.dispatchPreviewEvent('elementor/element/destroy');
1368 - },
1369 - dispatchPreviewEvent: function dispatchPreviewEvent(eventType) {
1370 - var _elementor;
1371 - (_elementor = elementor) === null || _elementor === void 0 || (_elementor = _elementor.$preview) === null || _elementor === void 0 || (_elementor = _elementor[0]) === null || _elementor === void 0 || _elementor.contentWindow.dispatchEvent(new CustomEvent(eventType, {
1372 - detail: {
1373 - id: this.model.get('id'),
1374 - type: this.model.get('elType'),
1375 - element: this.getDomElement().get(0)
1376 - }
1377 - }));
1378 - },
1379 - droppableInitialize: function droppableInitialize() {
1380 - this.$el.html5Droppable(this.getDroppableOptions());
1381 - },
3787 + // eslint-disable-next-line jsdoc/require-returns-check
1382 3788 /**
1383 - * Add a `Save as a Template` button to the context menu.
3789 + * @return {string} namespace
3790 + */
3791 + }, {
3792 + key: "getNamespace",
3793 + value: function getNamespace() {
3794 + (0, _forceMethodImplementation.default)();
3795 + }
3796 +
3797 + /**
3798 + * @deprecated since 3.7.0, use `getServiceName()` instead.
3799 + */
3800 + }, {
3801 + key: "getRootContainer",
3802 + value: function getRootContainer() {
3803 + _deprecation.default.deprecated('getRootContainer()', '3.7.0', 'getServiceName()');
3804 + return this.getServiceName();
3805 + }
3806 + }, {
3807 + key: "getServiceName",
3808 + value: function getServiceName() {
3809 + return this.getNamespace().split('/')[0];
3810 + }
3811 + }, {
3812 + key: "store",
3813 + get: function get() {
3814 + return $e.store.get(this.getNamespace());
3815 + }
3816 + }, {
3817 + key: "defaultTabs",
3818 + value: function defaultTabs() {
3819 + return {};
3820 + }
3821 + }, {
3822 + key: "defaultRoutes",
3823 + value: function defaultRoutes() {
3824 + return {};
3825 + }
3826 + }, {
3827 + key: "defaultCommands",
3828 + value: function defaultCommands() {
3829 + return {};
3830 + }
3831 + }, {
3832 + key: "defaultCommandsInternal",
3833 + value: function defaultCommandsInternal() {
3834 + return {};
3835 + }
3836 + }, {
3837 + key: "defaultHooks",
3838 + value: function defaultHooks() {
3839 + return {};
3840 + }
3841 +
3842 + /**
3843 + * Get the component's default UI states.
1384 3844 *
1385 - * @return {Object} groups
3845 + * @return {Object} default UI states
1386 3846 */
1387 - getContextMenuGroups: function getContextMenuGroups() {
1388 - var _this6 = this,
1389 - _elementorCommon$conf;
1390 - var saveActions = [{
1391 - name: 'save',
1392 - title: __('Save as a template', 'elementor'),
1393 - callback: this.saveAsTemplate.bind(this),
1394 - isEnabled: function isEnabled() {
1395 - return !_this6.getContainer().isLocked();
1396 - }
1397 - }];
1398 - var isAdministrator = elementor.config.user.is_administrator;
1399 - var isExperimentalFeaturesEnabled = (_elementorCommon$conf = elementorCommon.config.experimentalFeatures) === null || _elementorCommon$conf === void 0 ? void 0 : _elementorCommon$conf.e_components;
1400 - if (isExperimentalFeaturesEnabled && isAdministrator) {
1401 - var _window$elementorV2$u, _window$elementorV, _window$elementorV$is, _window$elementorV2$u2, _window$elementorV2, _window$elementorV2$h, _window$elementorV2$u3, _window$elementorV3, _window$elementorV3$i;
1402 - var isProActive = (_window$elementorV2$u = (_window$elementorV = window.elementorV2) === null || _window$elementorV === void 0 || (_window$elementorV = _window$elementorV.utils) === null || _window$elementorV === void 0 || (_window$elementorV$is = _window$elementorV.isProActive) === null || _window$elementorV$is === void 0 ? void 0 : _window$elementorV$is.call(_window$elementorV)) !== null && _window$elementorV2$u !== void 0 ? _window$elementorV2$u : true;
1403 - var hasProInstalled = (_window$elementorV2$u2 = (_window$elementorV2 = window.elementorV2) === null || _window$elementorV2 === void 0 || (_window$elementorV2 = _window$elementorV2.utils) === null || _window$elementorV2 === void 0 || (_window$elementorV2$h = _window$elementorV2.hasProInstalled) === null || _window$elementorV2$h === void 0 ? void 0 : _window$elementorV2$h.call(_window$elementorV2)) !== null && _window$elementorV2$u2 !== void 0 ? _window$elementorV2$u2 : false;
1404 - var isProOutdated = hasProInstalled && !((_window$elementorV2$u3 = (_window$elementorV3 = window.elementorV2) === null || _window$elementorV3 === void 0 || (_window$elementorV3 = _window$elementorV3.utils) === null || _window$elementorV3 === void 0 || (_window$elementorV3$i = _window$elementorV3.isProAtLeast) === null || _window$elementorV3$i === void 0 ? void 0 : _window$elementorV3$i.call(_window$elementorV3, '4.0')) !== null && _window$elementorV2$u3 !== void 0 ? _window$elementorV2$u3 : false);
1405 - var showPromoBadge = !isProActive && !isProOutdated;
1406 - var newBadge = "<span class=\"elementor-context-menu-list__item__shortcut__new-badge\">".concat(__('New', 'elementor'), "</span>");
1407 - var badgeClass = 'elementor-context-menu-list__item__shortcut__promotion-badge';
1408 - var proBadge = "<a href=\"https://go.elementor.com/go-pro-components-Instance-create-context-menu/\" target=\"_blank\" onclick=\"event.stopPropagation()\" class=\"".concat(badgeClass, "\"><i class=\"eicon-upgrade-crown\"></i></a>");
1409 - saveActions.unshift({
1410 - name: 'save-component',
1411 - title: __('Create component', 'elementor'),
1412 - shortcut: isProActive || isProOutdated ? newBadge : proBadge,
1413 - hasShortcutAction: showPromoBadge,
1414 - callback: this.saveAsComponent.bind(this),
1415 - isEnabled: function isEnabled() {
1416 - return (isProActive || isProOutdated) && !_this6.getContainer().isLocked();
1417 - }
1418 - });
1419 - }
1420 - var groups = BaseElementView.prototype.getContextMenuGroups.apply(this, arguments),
1421 - transferGroupClipboardIndex = groups.indexOf(_.findWhere(groups, {
1422 - name: 'clipboard'
1423 - }));
1424 - groups.splice(transferGroupClipboardIndex + 1, 0, {
1425 - name: 'save',
1426 - actions: saveActions
1427 - });
1428 - return groups;
1429 - },
1430 - saveAsTemplate: function saveAsTemplate() {
1431 - elementor.templates.eventManager.sendNewSaveTemplateClickedEvent();
1432 - $e.route('library/save-template', {
1433 - model: this.model
1434 - });
1435 - },
1436 - saveAsComponent: function saveAsComponent(openContextMenuEvent, options) {
1437 - var _window$elementorV2$u4, _window$elementorV4, _window$elementorV4$h, _window$elementorV2$u5, _window$elementorV5, _window$elementorV5$i, _window$elementorV2$u6, _window$elementorV7, _window$elementorV7$i;
1438 - var hasProInstalled = (_window$elementorV2$u4 = (_window$elementorV4 = window.elementorV2) === null || _window$elementorV4 === void 0 || (_window$elementorV4 = _window$elementorV4.utils) === null || _window$elementorV4 === void 0 || (_window$elementorV4$h = _window$elementorV4.hasProInstalled) === null || _window$elementorV4$h === void 0 ? void 0 : _window$elementorV4$h.call(_window$elementorV4)) !== null && _window$elementorV2$u4 !== void 0 ? _window$elementorV2$u4 : false;
1439 - var isProOutdated = hasProInstalled && !((_window$elementorV2$u5 = (_window$elementorV5 = window.elementorV2) === null || _window$elementorV5 === void 0 || (_window$elementorV5 = _window$elementorV5.utils) === null || _window$elementorV5 === void 0 || (_window$elementorV5$i = _window$elementorV5.isProAtLeast) === null || _window$elementorV5$i === void 0 ? void 0 : _window$elementorV5$i.call(_window$elementorV5, '4.0')) !== null && _window$elementorV2$u5 !== void 0 ? _window$elementorV2$u5 : false);
1440 - if (isProOutdated) {
1441 - var _window$elementorV6, _window$elementorV6$n;
1442 - (_window$elementorV6 = window.elementorV2) === null || _window$elementorV6 === void 0 || (_window$elementorV6 = _window$elementorV6.editorNotifications) === null || _window$elementorV6 === void 0 || (_window$elementorV6$n = _window$elementorV6.notify) === null || _window$elementorV6$n === void 0 || _window$elementorV6$n.call(_window$elementorV6, {
1443 - type: 'info',
1444 - id: 'component-create-update',
1445 - message: __('To create new components, update Elementor Pro to the latest version.', 'elementor'),
1446 - additionalActionProps: [{
1447 - size: 'small',
1448 - variant: 'contained',
1449 - color: 'info',
1450 - href: '/wp-admin/plugins.php',
1451 - target: '_blank',
1452 - children: __('Update Now', 'elementor')
1453 - }]
1454 - });
1455 - return;
1456 - }
1457 - var isProActive = (_window$elementorV2$u6 = (_window$elementorV7 = window.elementorV2) === null || _window$elementorV7 === void 0 || (_window$elementorV7 = _window$elementorV7.utils) === null || _window$elementorV7 === void 0 || (_window$elementorV7$i = _window$elementorV7.isProActive) === null || _window$elementorV7$i === void 0 ? void 0 : _window$elementorV7$i.call(_window$elementorV7)) !== null && _window$elementorV2$u6 !== void 0 ? _window$elementorV2$u6 : true;
1458 - if (!isProActive) {
1459 - return;
1460 - }
3847 + }, {
3848 + key: "defaultUiStates",
3849 + value: function defaultUiStates() {
3850 + return {};
3851 + }
1461 3852
1462 - // Calculate the absolute position where the context menu was opened.
1463 - var openMenuOriginalEvent = openContextMenuEvent.originalEvent;
1464 - var iframeRect = elementor.$preview[0].getBoundingClientRect();
1465 - var anchorPosition = {
1466 - left: openMenuOriginalEvent.clientX + iframeRect.left,
1467 - top: openMenuOriginalEvent.clientY + iframeRect.top
1468 - };
1469 - window.dispatchEvent(new CustomEvent('elementor/editor/open-save-as-component-form', {
1470 - detail: {
1471 - element: elementor.getContainer(this.model.id).model.toJSON({
1472 - remove: ['default']
1473 - }),
1474 - anchorPosition: anchorPosition,
1475 - options: options
1476 - }
1477 - }));
1478 - },
1479 - isDroppingAllowed: function isDroppingAllowed() {
1480 - return this.getContainer().isEditable();
1481 - },
1482 - behaviors: function behaviors() {
1483 - var behaviors = BaseElementView.prototype.behaviors.apply(this, arguments);
1484 - _.extend(behaviors, {
1485 - Sortable: {
1486 - behaviorClass: __webpack_require__(/*! elementor-behaviors/sortable */ "../assets/dev/js/editor/elements/views/behaviors/sortable.js"),
1487 - elChildType: 'widget'
1488 - }
1489 - });
1490 - return elementor.hooks.applyFilters("elements/".concat(type, "/behaviors"), behaviors, this);
1491 - },
1492 3853 /**
1493 - * @return {{}} options
3854 + * Get the component's Redux slice settings.
3855 + *
3856 + * @return {Object} Redux slice settings
1494 3857 */
1495 - getSortableOptions: function getSortableOptions() {
1496 - return {
1497 - preventInit: true
1498 - };
1499 - },
1500 - getDroppableOptions: function getDroppableOptions() {
1501 - var _this7 = this;
1502 - var items = '> .elementor-element, > .elementor-empty-view .elementor-first-add';
1503 - return {
1504 - axis: this.isAtomicGridContainer() ? 'vertical' : null,
1505 - items: items,
1506 - groups: ['elementor-element'],
1507 - horizontalThreshold: 0,
1508 - isDroppingAllowed: this.isDroppingAllowed.bind(this),
1509 - currentElementClass: 'elementor-html5dnd-current-element',
1510 - placeholderClass: 'elementor-sortable-placeholder elementor-widget-placeholder',
1511 - hasDraggingOnChildClass: 'e-dragging-over',
1512 - getDropContainer: function getDropContainer() {
1513 - return _this7.getContainer();
1514 - },
1515 - onDropping: function onDropping(side, event) {
1516 - event.stopPropagation();
3858 + }, {
3859 + key: "defaultStates",
3860 + value: function defaultStates() {
3861 + return {};
3862 + }
3863 + }, {
3864 + key: "defaultShortcuts",
3865 + value: function defaultShortcuts() {
3866 + return {};
3867 + }
3868 + }, {
3869 + key: "defaultUtils",
3870 + value: function defaultUtils() {
3871 + return {};
3872 + }
3873 + }, {
3874 + key: "defaultData",
3875 + value: function defaultData() {
3876 + return {};
3877 + }
3878 + }, {
3879 + key: "getCommands",
3880 + value: function getCommands() {
3881 + return this.commands;
3882 + }
3883 + }, {
3884 + key: "getCommandsInternal",
3885 + value: function getCommandsInternal() {
3886 + return this.commandsInternal;
3887 + }
3888 + }, {
3889 + key: "getHooks",
3890 + value: function getHooks() {
3891 + return this.hooks;
3892 + }
1517 3893
1518 - // Triggering the drag end manually, since it won't fire above the iframe
1519 - elementor.getPreviewView().onPanelElementDragEnd();
1520 - var draggedView = elementor.channels.editor.request('element:dragged'),
1521 - draggedElement = draggedView === null || draggedView === void 0 ? void 0 : draggedView.getContainer().view.el,
1522 - isEmptyViewTarget = _this7.emptyViewIsCurrentlyBeingDraggedOver(),
1523 - containerElement = isEmptyViewTarget ? _this7.el : event.currentTarget.parentElement,
1524 - elements = Array.from((containerElement === null || containerElement === void 0 ? void 0 : containerElement.querySelectorAll(':scope > .elementor-element')) || []);
1525 - var targetIndex = isEmptyViewTarget ? elements.length : elements.indexOf(event.currentTarget);
1526 - if (_this7.isPanelElement(draggedView, draggedElement)) {
1527 - if (_this7.draggingOnBottomOrRightSide(side) && !isEmptyViewTarget) {
1528 - targetIndex++;
1529 - }
1530 - _this7.onDrop(event, {
1531 - at: targetIndex
1532 - });
1533 - return;
1534 - }
1535 - if (_this7.isParentElement(draggedView.getContainer().id)) {
1536 - return;
1537 - }
1538 - if (isEmptyViewTarget) {
1539 - _this7.moveDroppedItem(draggedView, targetIndex);
1540 - return;
1541 - }
1542 - _this7.moveExistingElement(side, draggedView, containerElement, elements, targetIndex, draggedElement);
1543 - }
1544 - };
1545 - },
1546 - moveExistingElement: function moveExistingElement(side, draggedView, containerElement, elements, targetIndex, draggedElement) {
1547 - var selfIndex = elements.indexOf(draggedElement);
1548 - if (targetIndex === selfIndex) {
1549 - return;
1550 - }
1551 - var dropIndex = this.getDropIndex(containerElement, side, targetIndex, selfIndex);
1552 - this.moveDroppedItem(draggedView, dropIndex);
1553 - },
1554 - isPanelElement: function isPanelElement(draggedView, draggedElement) {
1555 - return !draggedView || !draggedElement;
1556 - },
1557 - isParentElement: function isParentElement(draggedId) {
1558 - var current = this.container;
1559 - while (current) {
1560 - if (current.id === draggedId) {
1561 - return true;
1562 - }
1563 - current = current.parent;
1564 - }
1565 - return false;
1566 - },
1567 - getDropIndex: function getDropIndex(container, side, index, selfIndex) {
1568 - var styles = window.getComputedStyle(container);
1569 - var isFlex = ['flex', 'inline-flex'].includes(styles.display);
1570 - var isFlexReverse = isFlex && ['column-reverse', 'row-reverse'].includes(styles.flexDirection);
1571 - var isRow = isFlex && ['row-reverse', 'row'].includes(styles.flexDirection);
1572 - var isRtl = elementorCommon.config.isRTL;
1573 - var isReverse = isRow ? isFlexReverse !== isRtl : isFlexReverse;
3894 + /**
3895 + * Retrieve the component's UI states.
3896 + *
3897 + * @return {Object} UI states
3898 + */
3899 + }, {
3900 + key: "getUiStates",
3901 + value: function getUiStates() {
3902 + return this.uiStates;
3903 + }
1574 3904
1575 - // The element should be placed BEFORE the current target
1576 - // if is reversed + side is bottom/right OR not is reversed + side is top/left
1577 - if (isReverse === this.draggingOnBottomOrRightSide(side)) {
1578 - if (-1 === selfIndex || selfIndex >= index - 1) {
1579 - return index;
1580 - }
1581 - return index > 0 ? index - 1 : 0;
3905 + /**
3906 + * Retrieve the component's Redux Slice.
3907 + *
3908 + * @return {Object} Redux Slice
3909 + */
3910 + }, {
3911 + key: "getStates",
3912 + value: function getStates() {
3913 + return this.states;
3914 + }
3915 + }, {
3916 + key: "getRoutes",
3917 + value: function getRoutes() {
3918 + return this.routes;
3919 + }
3920 + }, {
3921 + key: "getTabs",
3922 + value: function getTabs() {
3923 + return this.tabs;
3924 + }
3925 + }, {
3926 + key: "getShortcuts",
3927 + value: function getShortcuts() {
3928 + return this.shortcuts;
3929 + }
3930 + }, {
3931 + key: "getData",
3932 + value: function getData() {
3933 + return this.data;
3934 + }
3935 +
3936 + /**
3937 + * @param {string} command
3938 + * @param {(()=>{}|CommandInfra)} context
3939 + * @param {'default'|'internal'|'data'} commandsType
3940 + */
3941 + }, {
3942 + key: "registerCommand",
3943 + value: function registerCommand(command, context) {
3944 + var commandsType = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'default';
3945 + var commandsManager;
3946 + switch (commandsType) {
3947 + case 'default':
3948 + commandsManager = $e.commands;
3949 + break;
3950 + case 'internal':
3951 + commandsManager = $e.commandsInternal;
3952 + break;
3953 + case 'data':
3954 + commandsManager = $e.data;
3955 + break;
3956 + default:
3957 + throw new Error("Invalid commands type: '".concat(command, "'"));
1582 3958 }
1583 - if (0 <= selfIndex && selfIndex < index) {
1584 - return index;
1585 - }
1586 - return index + 1;
1587 - },
1588 - moveDroppedItem: function moveDroppedItem(draggedView, dropIndex) {
1589 - // Reset the dragged element cache.
1590 - elementor.channels.editor.reply('element:dragged', null);
1591 - $e.run('document/elements/move', {
1592 - container: draggedView.getContainer(),
1593 - target: this.getContainer(),
1594 - options: {
1595 - at: dropIndex
1596 - }
1597 - });
1598 - },
1599 - getEditButtons: function getEditButtons() {
1600 - var elementData = elementor.getElementData(this.model),
1601 - editTools = {};
1602 - if ($e.components.get('document/elements').utils.allowAddingWidgets()) {
1603 - editTools.add = {
1604 - /* Translators: %s: Element Name. */
1605 - title: sprintf(__('Add %s', 'elementor'), elementData.title),
1606 - icon: 'plus'
3959 + var fullCommand = this.getNamespace() + '/' + command,
3960 + instanceType = context.getInstanceType ? context.getInstanceType() : false,
3961 + registerConfig = {
3962 + command: fullCommand,
3963 + component: this
1607 3964 };
1608 - editTools.edit = {
1609 - /* Translators: %s: Element Name. */
1610 - title: sprintf(__('Edit %s', 'elementor'), elementData.title),
1611 - icon: 'handle'
1612 - };
1613 - }
1614 - if (!this.getContainer().isLocked()) {
1615 - if (elementor.getPreferences('edit_buttons') && $e.components.get('document/elements').utils.allowAddingWidgets()) {
1616 - editTools.duplicate = {
1617 - /* Translators: %s: Element Name. */
1618 - title: sprintf(__('Duplicate %s', 'elementor'), elementData.title),
1619 - icon: 'clone'
1620 - };
3965 +
3966 + // Support pure callback.
3967 + if (!instanceType) {
3968 + if ($e.devTools) {
3969 + $e.devTools.log.warn("Attach command-callback-base, on command: '".concat(fullCommand, "', context is unknown type."));
1621 3970 }
1622 - editTools.remove = {
1623 - /* Translators: %s: Element Name. */
1624 - title: sprintf(__('Delete %s', 'elementor'), elementData.title),
1625 - icon: 'close'
1626 - };
3971 + registerConfig.callback = context;
3972 +
3973 + // Unique class.
3974 + context = /*#__PURE__*/function (_CommandCallbackBase) {
3975 + (0, _inherits2.default)(context, _CommandCallbackBase);
3976 + var _super2 = _createSuper(context);
3977 + function context() {
3978 + (0, _classCallCheck2.default)(this, context);
3979 + return _super2.apply(this, arguments);
3980 + }
3981 + return (0, _createClass2.default)(context);
3982 + }(_commandCallbackBase.default);
1627 3983 }
1628 - return editTools;
1629 - },
1630 - draggingOnBottomOrRightSide: function draggingOnBottomOrRightSide(side) {
1631 - return ['bottom', 'right'].includes(side);
1632 - },
1633 - emptyViewIsCurrentlyBeingDraggedOver: function emptyViewIsCurrentlyBeingDraggedOver() {
1634 - return this.$el.find('> .elementor-empty-view > .elementor-first-add.elementor-html5dnd-current-element').length > 0;
1635 - },
3984 + context.setRegisterConfig(registerConfig);
3985 + commandsManager.register(this, command, context);
3986 + }
3987 +
1636 3988 /**
1637 - * Toggle the `New Section` view when clicking the `add` button in the edit tools.
3989 + * @param {HookBase} instance
3990 + */
3991 + }, {
3992 + key: "registerHook",
3993 + value: function registerHook(instance) {
3994 + return instance.register();
3995 + }
3996 + }, {
3997 + key: "registerCommandInternal",
3998 + value: function registerCommandInternal(command, context) {
3999 + this.registerCommand(command, context, 'internal');
4000 + }
4001 +
4002 + /**
4003 + * Register a UI state.
1638 4004 *
4005 + * @param {UiStateBase} instance - UI state instance.
4006 + *
1639 4007 * @return {void}
1640 4008 */
1641 - onAddButtonClick: function onAddButtonClick() {
1642 - if (this.addSectionView && !this.addSectionView.isDestroyed) {
1643 - this.addSectionView.fadeToDeath();
1644 - return;
4009 + }, {
4010 + key: "registerUiState",
4011 + value: function registerUiState(instance) {
4012 + $e.uiStates.register(instance);
4013 + }
4014 +
4015 + /**
4016 + * Register a Redux Slice.
4017 + *
4018 + * @param {string} id - State id.
4019 + * @param {Object} stateConfig - The state config.
4020 + *
4021 + * @return {void}
4022 + */
4023 + }, {
4024 + key: "registerState",
4025 + value: function registerState(id, stateConfig) {
4026 + id = this.getNamespace() + (id ? "/".concat(id) : '');
4027 + var slice = (0, _toolkit.createSlice)(_objectSpread(_objectSpread({}, stateConfig), {}, {
4028 + name: id
4029 + }));
4030 + $e.store.register(id, slice);
4031 + }
4032 + }, {
4033 + key: "registerRoute",
4034 + value: function registerRoute(route, callback) {
4035 + $e.routes.register(this, route, callback);
4036 + }
4037 + }, {
4038 + key: "registerData",
4039 + value: function registerData(command, context) {
4040 + this.registerCommand(command, context, 'data');
4041 + }
4042 + }, {
4043 + key: "unregisterRoute",
4044 + value: function unregisterRoute(route) {
4045 + $e.routes.unregister(this, route);
4046 + }
4047 + }, {
4048 + key: "registerTabRoute",
4049 + value: function registerTabRoute(tab) {
4050 + var _this2 = this;
4051 + this.registerRoute(tab, function (args) {
4052 + return _this2.activateTab(tab, args);
4053 + });
4054 + }
4055 + }, {
4056 + key: "dependency",
4057 + value: function dependency() {
4058 + return true;
4059 + }
4060 + }, {
4061 + key: "open",
4062 + value: function open() {
4063 + return true;
4064 + }
4065 + }, {
4066 + key: "close",
4067 + value: function close() {
4068 + if (!this.isOpen) {
4069 + return false;
1645 4070 }
1646 - var addSectionView = new elementor.modules.elements.components.AddSectionView({
1647 - at: this.model.collection.indexOf(this.model)
1648 - });
1649 - addSectionView.render();
1650 - this.$el.before(addSectionView.$el);
1651 - addSectionView.$el.hide();
4071 + this.isOpen = false;
4072 + this.inactivate();
4073 + $e.routes.clearCurrent(this.getNamespace());
4074 + $e.routes.clearHistory(this.getServiceName());
4075 + return true;
4076 + }
4077 + }, {
4078 + key: "activate",
4079 + value: function activate() {
4080 + $e.components.activate(this.getNamespace());
4081 + }
4082 + }, {
4083 + key: "inactivate",
4084 + value: function inactivate() {
4085 + $e.components.inactivate(this.getNamespace());
4086 + }
4087 + }, {
4088 + key: "isActive",
4089 + value: function isActive() {
4090 + return $e.components.isActive(this.getNamespace());
4091 + }
4092 + }, {
4093 + key: "onRoute",
4094 + value: function onRoute(route) {
4095 + this.toggleRouteClass(route, true);
4096 + this.toggleHistoryClass();
4097 + this.activate();
4098 + this.trigger('route/open', route);
4099 + }
4100 + }, {
4101 + key: "onCloseRoute",
4102 + value: function onCloseRoute(route) {
4103 + this.toggleRouteClass(route, false);
4104 + this.inactivate();
4105 + this.trigger('route/close', route);
4106 + }
4107 + }, {
4108 + key: "setDefaultRoute",
4109 + value: function setDefaultRoute(route) {
4110 + this.defaultRoute = this.getNamespace() + '/' + route;
4111 + }
4112 + }, {
4113 + key: "getDefaultRoute",
4114 + value: function getDefaultRoute() {
4115 + return this.defaultRoute;
4116 + }
4117 + }, {
4118 + key: "removeTab",
4119 + value: function removeTab(tab) {
4120 + delete this.tabs[tab];
4121 + this.unregisterRoute(tab);
4122 + }
4123 + }, {
4124 + key: "hasTab",
4125 + value: function hasTab(tab) {
4126 + return !!this.tabs[tab];
4127 + }
4128 + }, {
4129 + key: "addTab",
4130 + value: function addTab(tab, args, position) {
4131 + var _this3 = this;
4132 + this.tabs[tab] = args;
4133 + // It can be 0.
4134 + if ('undefined' !== typeof position) {
4135 + var newTabs = {};
4136 + var ids = Object.keys(this.tabs);
4137 + // Remove new tab
4138 + ids.pop();
1652 4139
1653 - // Delaying the slide down for slow-render browsers (such as FF)
1654 - setTimeout(function () {
1655 - addSectionView.$el.slideDown(null, function () {
1656 - // Remove inline style, for preview mode.
1657 - jQuery(this).css('display', '');
4140 + // Add it to position.
4141 + ids.splice(position, 0, tab);
4142 + ids.forEach(function (id) {
4143 + newTabs[id] = _this3.tabs[id];
1658 4144 });
1659 - });
1660 - this.addSectionView = addSectionView;
1661 - },
1662 - isOverflowHidden: function isOverflowHidden() {
1663 - var elementStyles = window.getComputedStyle(this.el);
1664 - var overflowStyles = [elementStyles.overflowX, elementStyles.overflowY, elementStyles.overflow];
1665 - return overflowStyles.includes('hidden') || overflowStyles.includes('auto');
1666 - },
1667 - updateHandlesPosition: function updateHandlesPosition() {
1668 - var elementType = this.$el.data('element_type');
1669 - var isElement = (0, _elementTypes.getAllElementTypes)().includes(elementType);
1670 - if (!isElement) {
1671 - return;
4145 + this.tabs = newTabs;
1672 4146 }
1673 - var shouldPlaceInside = this.isOverflowHidden();
1674 - if (!shouldPlaceInside && this.isTopLevelElement() && this.isFirstElementInStructure()) {
1675 - shouldPlaceInside = true;
1676 - }
1677 - this.$el.toggleClass('e-handles-inside', shouldPlaceInside);
1678 - },
1679 - isTopLevelElement: function isTopLevelElement() {
1680 - return this.container.parent && 'document' === this.container.parent.id;
1681 - },
1682 - isFirstElementInStructure: function isFirstElementInStructure() {
1683 - if (!this.model.collection) {
1684 - return true;
1685 - }
1686 - return 0 === this.model.collection.indexOf(this.model);
1687 - },
1688 - getInteractionId: function getInteractionId() {
1689 - var originId = this.model.get('originId');
1690 - var id = this.model.get('id');
1691 - return originId !== null && originId !== void 0 ? originId : id;
4147 + this.registerTabRoute(tab);
1692 4148 }
1693 - });
1694 - return AtomicElementView;
1695 -}
4149 + }, {
4150 + key: "getTabsWrapperSelector",
4151 + value: function getTabsWrapperSelector() {
4152 + return '';
4153 + }
4154 + }, {
4155 + key: "getTabRoute",
4156 + value: function getTabRoute(tab) {
4157 + return this.getNamespace() + '/' + tab;
4158 + }
4159 + }, {
4160 + key: "renderTab",
4161 + value: function renderTab(tab) {} // eslint-disable-line
4162 + }, {
4163 + key: "activateTab",
4164 + value: function activateTab(tab, args) {
4165 + var _this4 = this;
4166 + this.renderTab(tab, args);
4167 + jQuery(this.getTabsWrapperSelector() + ' .elementor-component-tab').off('click').on('click', function (event) {
4168 + $e.route(_this4.getTabRoute(event.currentTarget.dataset.tab), args);
4169 + }).removeClass('elementor-active').filter('[data-tab="' + tab + '"]').addClass('elementor-active');
4170 + }
4171 + }, {
4172 + key: "getActiveTabConfig",
4173 + value: function getActiveTabConfig() {
4174 + return this.tabs[this.currentTab] || {};
4175 + }
4176 + }, {
4177 + key: "getBodyClass",
4178 + value: function getBodyClass(route) {
4179 + return 'e-route-' + route.replace(/\//g, '-');
4180 + }
1696 4181
1697 -/***/ }),
4182 + /**
4183 + * If command includes uppercase character convert it to lowercase and add `-`.
4184 + * e.g: `CopyAll` is converted to `copy-all`.
4185 + *
4186 + * @param {string} commandName
4187 + */
4188 + }, {
4189 + key: "normalizeCommandName",
4190 + value: function normalizeCommandName(commandName) {
4191 + return commandName.replace(/[A-Z]/g, function (match, offset) {
4192 + return (offset > 0 ? '-' : '') + match.toLowerCase();
4193 + });
4194 + }
1698 4195
1699 -/***/ "../modules/atomic-widgets/assets/js/editor/hooks/data/regenerate-local-style-ids/duplicate-element.js":
1700 -/*!*************************************************************************************************************!*\
1701 - !*** ../modules/atomic-widgets/assets/js/editor/hooks/data/regenerate-local-style-ids/duplicate-element.js ***!
1702 - \*************************************************************************************************************/
1703 -/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
4196 + /**
4197 + * @param {{}} commandsFromImport
4198 + * @return {{}} imported commands
4199 + */
4200 + }, {
4201 + key: "importCommands",
4202 + value: function importCommands(commandsFromImport) {
4203 + var _this5 = this;
4204 + var commands = {};
1704 4205
1705 -"use strict";
4206 + // Convert `Commands` to `ComponentBase` workable format.
4207 + Object.entries(commandsFromImport).forEach(function (_ref11) {
4208 + var _ref12 = (0, _slicedToArray2.default)(_ref11, 2),
4209 + className = _ref12[0],
4210 + Class = _ref12[1];
4211 + var command = _this5.normalizeCommandName(className);
4212 + commands[command] = Class;
4213 + });
4214 + return commands;
4215 + }
4216 + }, {
4217 + key: "importHooks",
4218 + value: function importHooks(hooksFromImport) {
4219 + var hooks = {};
4220 + for (var key in hooksFromImport) {
4221 + var hook = new hooksFromImport[key]();
4222 + hooks[hook.getId()] = hook;
4223 + }
4224 + return hooks;
4225 + }
1706 4226
4227 + /**
4228 + * Import & initialize the component's UI states.
4229 + * Should be used inside `defaultUiState()`.
4230 + *
4231 + * @param {Object} statesFromImport - UI states from import.
4232 + *
4233 + * @return {Object} UI States
4234 + */
4235 + }, {
4236 + key: "importUiStates",
4237 + value: function importUiStates(statesFromImport) {
4238 + var _this6 = this;
4239 + var uiStates = {};
4240 + Object.values(statesFromImport).forEach(function (className) {
4241 + var uiState = new className(_this6);
4242 + uiStates[uiState.getId()] = uiState;
4243 + });
4244 + return uiStates;
4245 + }
1707 4246
1708 -var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
1709 -Object.defineProperty(exports, "__esModule", ({
1710 - value: true
1711 -}));
1712 -exports.DuplicateElement = void 0;
1713 -var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
1714 -var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
1715 -var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
1716 -var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
1717 -var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
1718 -var _regenerateLocalStyleIds = __webpack_require__(/*! ../../../utils/regenerate-local-style-ids */ "../modules/atomic-widgets/assets/js/editor/utils/regenerate-local-style-ids.js");
1719 -function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
1720 -function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
1721 -var DuplicateElement = exports.DuplicateElement = /*#__PURE__*/function (_$e$modules$hookData$) {
1722 - function DuplicateElement() {
1723 - (0, _classCallCheck2.default)(this, DuplicateElement);
1724 - return _callSuper(this, DuplicateElement, arguments);
1725 - }
1726 - (0, _inherits2.default)(DuplicateElement, _$e$modules$hookData$);
1727 - return (0, _createClass2.default)(DuplicateElement, [{
1728 - key: "getCommand",
1729 - value: function getCommand() {
1730 - return 'document/elements/duplicate';
4247 + /**
4248 + * Set a UI state value.
4249 + * TODO: Should we provide such function? Maybe the developer should implicitly pass the full state ID?
4250 + *
4251 + * @param {string} state - Non-prefixed state ID.
4252 + * @param {*} value - New state value.
4253 + *
4254 + * @return {void}
4255 + */
4256 + }, {
4257 + key: "setUiState",
4258 + value: function setUiState(state, value) {
4259 + $e.uiStates.set("".concat(this.getNamespace(), "/").concat(state), value);
1731 4260 }
1732 4261 }, {
1733 - key: "getId",
1734 - value: function getId() {
1735 - return 'regenerate-local-style-ids--document/elements/duplicate';
4262 + key: "toggleRouteClass",
4263 + value: function toggleRouteClass(route, state) {
4264 + document.body.classList.toggle(this.getBodyClass(route), state);
1736 4265 }
1737 4266 }, {
1738 - key: "apply",
1739 - value: function apply(args, result) {
1740 - var containers = Array.isArray(result) ? result : [result];
1741 - containers.forEach(_regenerateLocalStyleIds.regenerateLocalStyleIds);
4267 + key: "toggleHistoryClass",
4268 + value: function toggleHistoryClass() {
4269 + document.body.classList.toggle('e-routes-has-history', !!$e.routes.getHistory(this.getServiceName()).length);
1742 4270 }
1743 4271 }]);
1744 -}($e.modules.hookData.After);
4272 + return ComponentBase;
4273 +}(_module.default);
4274 +exports["default"] = ComponentBase;
1745 4275
1746 4276 /***/ }),
1747 4277
1748 -/***/ "../modules/atomic-widgets/assets/js/editor/hooks/data/regenerate-local-style-ids/import-element.js":
1749 -/*!**********************************************************************************************************!*\
1750 - !*** ../modules/atomic-widgets/assets/js/editor/hooks/data/regenerate-local-style-ids/import-element.js ***!
1751 - \**********************************************************************************************************/
4278 +/***/ "../modules/web-cli/assets/js/utils/console.js":
4279 +/*!*****************************************************!*\
4280 + !*** ../modules/web-cli/assets/js/utils/console.js ***!
4281 + \*****************************************************/
1752 4282 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1753 4283
1754 4284 "use strict";
1755 4285
@@ -1757,48 +4287,51 @@
1757 4287 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
1758 4288 Object.defineProperty(exports, "__esModule", ({
1759 4289 value: true
1760 4290 }));
1761 -exports.ImportElement = void 0;
4291 +exports["default"] = void 0;
1762 4292 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
1763 4293 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
1764 -var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
1765 -var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
1766 -var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
1767 -var _regenerateLocalStyleIds = __webpack_require__(/*! ../../../utils/regenerate-local-style-ids */ "../modules/atomic-widgets/assets/js/editor/utils/regenerate-local-style-ids.js");
1768 -function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
1769 -function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
1770 -var ImportElement = exports.ImportElement = /*#__PURE__*/function (_$e$modules$hookData$) {
1771 - function ImportElement() {
1772 - (0, _classCallCheck2.default)(this, ImportElement);
1773 - return _callSuper(this, ImportElement, arguments);
4294 +var Console = /*#__PURE__*/function () {
4295 + function Console() {
4296 + (0, _classCallCheck2.default)(this, Console);
1774 4297 }
1775 - (0, _inherits2.default)(ImportElement, _$e$modules$hookData$);
1776 - return (0, _createClass2.default)(ImportElement, [{
1777 - key: "getCommand",
1778 - value: function getCommand() {
1779 - return 'document/elements/import';
4298 + (0, _createClass2.default)(Console, null, [{
4299 + key: "error",
4300 + value: function error(message) {
4301 + // Show an error if devTools is available.
4302 + if ($e.devTools) {
4303 + $e.devTools.log.error(message);
4304 + }
4305 +
4306 + // If not a 'Hook-Break' then show error.
4307 + if (!(message instanceof $e.modules.HookBreak)) {
4308 + // eslint-disable-next-line no-console
4309 + console.error(message);
4310 + }
1780 4311 }
1781 4312 }, {
1782 - key: "getId",
1783 - value: function getId() {
1784 - return 'regenerate-local-style-ids--document/elements/import';
4313 + key: "warn",
4314 + value: function warn() {
4315 + var _console;
4316 + var style = "font-size: 12px; background-image: url(\"".concat(elementorWebCliConfig.urls.assets, "images/logo-icon.png\"); background-repeat: no-repeat; background-size: contain;");
4317 + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
4318 + args[_key] = arguments[_key];
4319 + }
4320 + args.unshift('%c %c', style, '');
4321 + (_console = console).warn.apply(_console, args); // eslint-disable-line no-console
1785 4322 }
1786 - }, {
1787 - key: "apply",
1788 - value: function apply(args, result) {
1789 - var containers = Array.isArray(result) ? result : [result];
1790 - containers.forEach(_regenerateLocalStyleIds.regenerateLocalStyleIds);
1791 - }
1792 4323 }]);
1793 -}($e.modules.hookData.After);
4324 + return Console;
4325 +}();
4326 +exports["default"] = Console;
1794 4327
1795 4328 /***/ }),
1796 4329
1797 -/***/ "../modules/atomic-widgets/assets/js/editor/hooks/data/regenerate-local-style-ids/paste-element.js":
1798 -/*!*********************************************************************************************************!*\
1799 - !*** ../modules/atomic-widgets/assets/js/editor/hooks/data/regenerate-local-style-ids/paste-element.js ***!
1800 - \*********************************************************************************************************/
4330 +/***/ "../modules/web-cli/assets/js/utils/deprecation.js":
4331 +/*!*********************************************************!*\
4332 + !*** ../modules/web-cli/assets/js/utils/deprecation.js ***!
4333 + \*********************************************************/
1801 4334 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1802 4335
1803 4336 "use strict";
1804 4337
@@ -1806,257 +4339,1294 @@
1806 4339 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
1807 4340 Object.defineProperty(exports, "__esModule", ({
1808 4341 value: true
1809 4342 }));
1810 -exports.PasteElement = void 0;
4343 +exports["default"] = void 0;
4344 +var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js"));
1811 4345 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
1812 4346 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
1813 -var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
1814 -var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
1815 -var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
1816 -var _regenerateLocalStyleIds = __webpack_require__(/*! ../../../utils/regenerate-local-style-ids */ "../modules/atomic-widgets/assets/js/editor/utils/regenerate-local-style-ids.js");
1817 -function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
1818 -function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
1819 -var PasteElement = exports.PasteElement = /*#__PURE__*/function (_$e$modules$hookData$) {
1820 - function PasteElement() {
1821 - (0, _classCallCheck2.default)(this, PasteElement);
1822 - return _callSuper(this, PasteElement, arguments);
4347 +var _console = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/console */ "../modules/web-cli/assets/js/utils/console.js"));
4348 +// Copied from `modules/dev-tools/assets/js/deprecation.js`
4349 +/**
4350 + * @typedef {Object} Version
4351 + * @property {number} major1 The first number
4352 + * @property {number} major2 The second number
4353 + * @property {number} minor The third number
4354 + * @property {string} build The fourth number
4355 + */
4356 +var softDeprecated = function softDeprecated(name, version, replacement) {
4357 + if (elementorWebCliConfig.isDebug) {
4358 + deprecatedMessage('soft', name, version, replacement);
1823 4359 }
1824 - (0, _inherits2.default)(PasteElement, _$e$modules$hookData$);
1825 - return (0, _createClass2.default)(PasteElement, [{
1826 - key: "getCommand",
1827 - value: function getCommand() {
1828 - return 'document/elements/paste';
4360 +};
4361 +var hardDeprecated = function hardDeprecated(name, version, replacement) {
4362 + deprecatedMessage('hard', name, version, replacement);
4363 +};
4364 +var deprecatedMessage = function deprecatedMessage(type, name, version, replacement) {
4365 + var message = "`".concat(name, "` is ").concat(type, " deprecated since ").concat(version);
4366 + if (replacement) {
4367 + message += " - Use `".concat(replacement, "` instead");
4368 + }
4369 + _console.default.warn(message);
4370 +};
4371 +var Deprecation = /*#__PURE__*/function () {
4372 + function Deprecation() {
4373 + (0, _classCallCheck2.default)(this, Deprecation);
4374 + }
4375 + (0, _createClass2.default)(Deprecation, null, [{
4376 + key: "deprecated",
4377 + value: function deprecated(name, version, replacement) {
4378 + if (this.isHardDeprecated(version)) {
4379 + hardDeprecated(name, version, replacement);
4380 + } else {
4381 + softDeprecated(name, version, replacement);
4382 + }
1829 4383 }
4384 +
4385 + /**
4386 + * @param {string} version
4387 + *
4388 + * @return {Version}
4389 + */
1830 4390 }, {
1831 - key: "getId",
1832 - value: function getId() {
1833 - return 'regenerate-local-style-ids--document/elements/paste';
4391 + key: "parseVersion",
4392 + value: function parseVersion(version) {
4393 + var versionParts = version.split('.');
4394 + if (versionParts.length < 3 || versionParts.length > 4) {
4395 + throw new RangeError('Invalid Semantic Version string provided');
4396 + }
4397 + var _versionParts = (0, _slicedToArray2.default)(versionParts, 4),
4398 + major1 = _versionParts[0],
4399 + major2 = _versionParts[1],
4400 + minor = _versionParts[2],
4401 + _versionParts$ = _versionParts[3],
4402 + build = _versionParts$ === void 0 ? '' : _versionParts$;
4403 + return {
4404 + major1: parseInt(major1),
4405 + major2: parseInt(major2),
4406 + minor: parseInt(minor),
4407 + build: build
4408 + };
1834 4409 }
4410 +
4411 + /**
4412 + * Get total of major.
4413 + *
4414 + * 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,
4415 + * versions with major2 more then 9 will be added to total.
4416 + *
4417 + * @param {Version} versionObj
4418 + *
4419 + * @return {number}
4420 + */
1835 4421 }, {
1836 - key: "apply",
1837 - value: function apply(args, result) {
1838 - var containers = Array.isArray(result) ? result : [result];
1839 - containers.forEach(_regenerateLocalStyleIds.regenerateLocalStyleIds);
4422 + key: "getTotalMajor",
4423 + value: function getTotalMajor(versionObj) {
4424 + var total = parseInt("".concat(versionObj.major1).concat(versionObj.major2, "0"));
4425 + total = Number((total / 10).toFixed(0));
4426 + if (versionObj.major2 > 9) {
4427 + total = versionObj.major2 - 9;
4428 + }
4429 + return total;
1840 4430 }
4431 +
4432 + /**
4433 + * @param {string} version1
4434 + * @param {string} version2
4435 + *
4436 + * @return {number}
4437 + */
4438 + }, {
4439 + key: "compareVersion",
4440 + value: function compareVersion(version1, version2) {
4441 + var _this = this;
4442 + return [this.parseVersion(version1), this.parseVersion(version2)].map(function (versionObj) {
4443 + return _this.getTotalMajor(versionObj);
4444 + }).reduce(function (acc, major) {
4445 + return acc - major;
4446 + });
4447 + }
4448 +
4449 + /**
4450 + * @param {string} version
4451 + *
4452 + * @return {boolean}
4453 + */
4454 + }, {
4455 + key: "isSoftDeprecated",
4456 + value: function isSoftDeprecated(version) {
4457 + var total = this.compareVersion(version, elementorWebCliConfig.version);
4458 + return total <= 4;
4459 + }
4460 +
4461 + /**
4462 + * @param {string} version
4463 + * @return {boolean}
4464 + */
4465 + }, {
4466 + key: "isHardDeprecated",
4467 + value: function isHardDeprecated(version) {
4468 + var total = this.compareVersion(version, elementorWebCliConfig.version);
4469 + return total < 0 || total >= 8;
4470 + }
1841 4471 }]);
1842 -}($e.modules.hookData.After);
4472 + return Deprecation;
4473 +}();
4474 +exports["default"] = Deprecation;
1843 4475
1844 4476 /***/ }),
1845 4477
1846 -/***/ "../modules/atomic-widgets/assets/js/editor/hooks/index.js":
1847 -/*!*****************************************************************!*\
1848 - !*** ../modules/atomic-widgets/assets/js/editor/hooks/index.js ***!
1849 - \*****************************************************************/
4478 +/***/ "../modules/web-cli/assets/js/utils/force-method-implementation.js":
4479 +/*!*************************************************************************!*\
4480 + !*** ../modules/web-cli/assets/js/utils/force-method-implementation.js ***!
4481 + \*************************************************************************/
1850 4482 /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
1851 4483
1852 4484 "use strict";
1853 4485
1854 4486
4487 +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
1855 4488 Object.defineProperty(exports, "__esModule", ({
1856 4489 value: true
1857 4490 }));
1858 -Object.defineProperty(exports, "DuplicateElement", ({
1859 - enumerable: true,
1860 - get: function get() {
1861 - return _duplicateElement.DuplicateElement;
4491 +exports["default"] = exports.ForceMethodImplementation = void 0;
4492 +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
4493 +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
4494 +var _assertThisInitialized2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ "../node_modules/@babel/runtime/helpers/assertThisInitialized.js"));
4495 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
4496 +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
4497 +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
4498 +var _wrapNativeSuper2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/wrapNativeSuper */ "../node_modules/@babel/runtime/helpers/wrapNativeSuper.js"));
4499 +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); }; }
4500 +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; } }
4501 +// TODO: Copied from `assets/dev/js/modules/imports/force-method-implementation.js`;
4502 +var ForceMethodImplementation = /*#__PURE__*/function (_Error) {
4503 + (0, _inherits2.default)(ForceMethodImplementation, _Error);
4504 + var _super = _createSuper(ForceMethodImplementation);
4505 + function ForceMethodImplementation() {
4506 + var _this;
4507 + var info = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
4508 + (0, _classCallCheck2.default)(this, ForceMethodImplementation);
4509 + _this = _super.call(this, "".concat(info.isStatic ? 'static ' : '').concat(info.fullName, "() should be implemented, please provide '").concat(info.functionName || info.fullName, "' functionality."));
4510 + Error.captureStackTrace((0, _assertThisInitialized2.default)(_this), ForceMethodImplementation);
4511 + return _this;
1862 4512 }
1863 -}));
1864 -Object.defineProperty(exports, "ImportElement", ({
1865 - enumerable: true,
1866 - get: function get() {
1867 - return _importElement.ImportElement;
4513 + return (0, _createClass2.default)(ForceMethodImplementation);
4514 +}( /*#__PURE__*/(0, _wrapNativeSuper2.default)(Error));
4515 +exports.ForceMethodImplementation = ForceMethodImplementation;
4516 +var _default = function _default() {
4517 + var stack = Error().stack,
4518 + caller = stack.split('\n')[2].trim(),
4519 + callerName = caller.startsWith('at new') ? 'constructor' : caller.split(' ')[1],
4520 + info = {};
4521 + info.functionName = callerName;
4522 + info.fullName = callerName;
4523 + if (info.functionName.includes('.')) {
4524 + var parts = info.functionName.split('.');
4525 + info.className = parts[0];
4526 + info.functionName = parts[1];
4527 + } else {
4528 + info.isStatic = true;
1868 4529 }
1869 -}));
1870 -Object.defineProperty(exports, "PasteElement", ({
1871 - enumerable: true,
1872 - get: function get() {
1873 - return _pasteElement.PasteElement;
1874 - }
1875 -}));
1876 -var _duplicateElement = __webpack_require__(/*! ./data/regenerate-local-style-ids/duplicate-element */ "../modules/atomic-widgets/assets/js/editor/hooks/data/regenerate-local-style-ids/duplicate-element.js");
1877 -var _pasteElement = __webpack_require__(/*! ./data/regenerate-local-style-ids/paste-element */ "../modules/atomic-widgets/assets/js/editor/hooks/data/regenerate-local-style-ids/paste-element.js");
1878 -var _importElement = __webpack_require__(/*! ./data/regenerate-local-style-ids/import-element */ "../modules/atomic-widgets/assets/js/editor/hooks/data/regenerate-local-style-ids/import-element.js");
4530 + throw new ForceMethodImplementation(info);
4531 +};
4532 +exports["default"] = _default;
1879 4533
1880 4534 /***/ }),
1881 4535
1882 -/***/ "../modules/atomic-widgets/assets/js/editor/utils/get-element-children.js":
1883 -/*!********************************************************************************!*\
1884 - !*** ../modules/atomic-widgets/assets/js/editor/utils/get-element-children.js ***!
1885 - \********************************************************************************/
1886 -/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
4536 +/***/ "../node_modules/redux-thunk/es/index.js":
4537 +/*!***********************************************!*\
4538 + !*** ../node_modules/redux-thunk/es/index.js ***!
4539 + \***********************************************/
4540 +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1887 4541
1888 4542 "use strict";
4543 +__webpack_require__.r(__webpack_exports__);
4544 +/* harmony export */ __webpack_require__.d(__webpack_exports__, {
4545 +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
4546 +/* harmony export */ });
4547 +/** A function that accepts a potential "extra argument" value to be injected later,
4548 + * and returns an instance of the thunk middleware that uses that value
4549 + */
4550 +function createThunkMiddleware(extraArgument) {
4551 + // Standard Redux middleware definition pattern:
4552 + // See: https://redux.js.org/tutorials/fundamentals/part-4-store#writing-custom-middleware
4553 + var middleware = function middleware(_ref) {
4554 + var dispatch = _ref.dispatch,
4555 + getState = _ref.getState;
4556 + return function (next) {
4557 + return function (action) {
4558 + // The thunk middleware looks for any functions that were passed to `store.dispatch`.
4559 + // If this "action" is really a function, call it and return the result.
4560 + if (typeof action === 'function') {
4561 + // Inject the store's `dispatch` and `getState` methods, as well as any "extra arg"
4562 + return action(dispatch, getState, extraArgument);
4563 + } // Otherwise, pass the action down the middleware chain as usual
1889 4564
1890 4565
1891 -var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
1892 -Object.defineProperty(exports, "__esModule", ({
1893 - value: true
1894 -}));
1895 -exports.getElementChildren = getElementChildren;
1896 -var _toConsumableArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ "../node_modules/@babel/runtime/helpers/toConsumableArray.js"));
1897 -function getElementChildren(model) {
1898 - var _model$get$models, _model$get;
1899 - if (!model) {
1900 - return [];
1901 - }
1902 - var childModels = (_model$get$models = (_model$get = model.get('elements')) === null || _model$get === void 0 ? void 0 : _model$get.models) !== null && _model$get$models !== void 0 ? _model$get$models : [];
1903 - var children = childModels.flatMap(getElementChildren);
1904 - return [model].concat((0, _toConsumableArray2.default)(children));
4566 + return next(action);
4567 + };
4568 + };
4569 + };
4570 +
4571 + return middleware;
1905 4572 }
1906 4573
4574 +var thunk = createThunkMiddleware(); // Attach the factory function so users can create a customized version
4575 +// with whatever "extra arg" they want to inject into their thunks
4576 +
4577 +thunk.withExtraArgument = createThunkMiddleware;
4578 +/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (thunk);
4579 +
1907 4580 /***/ }),
1908 4581
1909 -/***/ "../modules/atomic-widgets/assets/js/editor/utils/get-random-style-id.js":
1910 -/*!*******************************************************************************!*\
1911 - !*** ../modules/atomic-widgets/assets/js/editor/utils/get-random-style-id.js ***!
1912 - \*******************************************************************************/
1913 -/***/ ((__unused_webpack_module, exports) => {
4582 +/***/ "../node_modules/redux/es/redux.js":
4583 +/*!*****************************************!*\
4584 + !*** ../node_modules/redux/es/redux.js ***!
4585 + \*****************************************/
4586 +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
1914 4587
1915 4588 "use strict";
4589 +__webpack_require__.r(__webpack_exports__);
4590 +/* harmony export */ __webpack_require__.d(__webpack_exports__, {
4591 +/* harmony export */ __DO_NOT_USE__ActionTypes: () => (/* binding */ ActionTypes),
4592 +/* harmony export */ applyMiddleware: () => (/* binding */ applyMiddleware),
4593 +/* harmony export */ bindActionCreators: () => (/* binding */ bindActionCreators),
4594 +/* harmony export */ combineReducers: () => (/* binding */ combineReducers),
4595 +/* harmony export */ compose: () => (/* binding */ compose),
4596 +/* harmony export */ createStore: () => (/* binding */ createStore),
4597 +/* harmony export */ legacy_createStore: () => (/* binding */ legacy_createStore)
4598 +/* harmony export */ });
4599 +/* 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");
1916 4600
1917 4601
1918 -Object.defineProperty(exports, "__esModule", ({
1919 - value: true
1920 -}));
1921 -exports.getRandomStyleId = getRandomStyleId;
1922 4602 /**
1923 - * @typedef {import('elementor/assets/dev/js/editor/container/container')} Container
4603 + * Adapted from React: https://github.com/facebook/react/blob/master/packages/shared/formatProdErrorMessage.js
4604 + *
4605 + * Do not require this module directly! Use normal throw error calls. These messages will be replaced with error codes
4606 + * during build.
4607 + * @param {number} code
1924 4608 */
4609 +function formatProdErrorMessage(code) {
4610 + 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. ';
4611 +}
1925 4612
4613 +// Inlined version of the `symbol-observable` polyfill
4614 +var $$observable = (function () {
4615 + return typeof Symbol === 'function' && Symbol.observable || '@@observable';
4616 +})();
4617 +
1926 4618 /**
1927 - * @param {Container} container
1928 - * @param {Object} existingStyleIds
1929 - * @return {string}
4619 + * These are private action types reserved by Redux.
4620 + * For any unknown actions, you must return the current state.
4621 + * If the current state is undefined, you must return the initial state.
4622 + * Do not reference these action types directly in your code.
1930 4623 */
1931 -function getRandomStyleId(container) {
1932 - var existingStyleIds = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
1933 - var id;
1934 - do {
1935 - id = "e-".concat(container.id, "-").concat(elementorCommon.helpers.getUniqueId());
1936 - } while (existingStyleIds.hasOwnProperty(id));
1937 - return id;
4624 +var randomString = function randomString() {
4625 + return Math.random().toString(36).substring(7).split('').join('.');
4626 +};
4627 +
4628 +var ActionTypes = {
4629 + INIT: "@@redux/INIT" + randomString(),
4630 + REPLACE: "@@redux/REPLACE" + randomString(),
4631 + PROBE_UNKNOWN_ACTION: function PROBE_UNKNOWN_ACTION() {
4632 + return "@@redux/PROBE_UNKNOWN_ACTION" + randomString();
4633 + }
4634 +};
4635 +
4636 +/**
4637 + * @param {any} obj The object to inspect.
4638 + * @returns {boolean} True if the argument appears to be a plain object.
4639 + */
4640 +function isPlainObject(obj) {
4641 + if (typeof obj !== 'object' || obj === null) return false;
4642 + var proto = obj;
4643 +
4644 + while (Object.getPrototypeOf(proto) !== null) {
4645 + proto = Object.getPrototypeOf(proto);
4646 + }
4647 +
4648 + return Object.getPrototypeOf(obj) === proto;
1938 4649 }
1939 4650
1940 -/***/ }),
4651 +// Inlined / shortened version of `kindOf` from https://github.com/jonschlinkert/kind-of
4652 +function miniKindOf(val) {
4653 + if (val === void 0) return 'undefined';
4654 + if (val === null) return 'null';
4655 + var type = typeof val;
1941 4656
1942 -/***/ "../modules/atomic-widgets/assets/js/editor/utils/regenerate-local-style-ids.js":
1943 -/*!**************************************************************************************!*\
1944 - !*** ../modules/atomic-widgets/assets/js/editor/utils/regenerate-local-style-ids.js ***!
1945 - \**************************************************************************************/
1946 -/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
4657 + switch (type) {
4658 + case 'boolean':
4659 + case 'string':
4660 + case 'number':
4661 + case 'symbol':
4662 + case 'function':
4663 + {
4664 + return type;
4665 + }
4666 + }
1947 4667
1948 -"use strict";
4668 + if (Array.isArray(val)) return 'array';
4669 + if (isDate(val)) return 'date';
4670 + if (isError(val)) return 'error';
4671 + var constructorName = ctorName(val);
1949 4672
4673 + switch (constructorName) {
4674 + case 'Symbol':
4675 + case 'Promise':
4676 + case 'WeakMap':
4677 + case 'WeakSet':
4678 + case 'Map':
4679 + case 'Set':
4680 + return constructorName;
4681 + } // other
1950 4682
1951 -var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
1952 -Object.defineProperty(exports, "__esModule", ({
1953 - value: true
1954 -}));
1955 -exports.regenerateLocalStyleIds = regenerateLocalStyleIds;
1956 -var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js"));
1957 -var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js"));
1958 -var _getElementChildren = __webpack_require__(/*! ./get-element-children */ "../modules/atomic-widgets/assets/js/editor/utils/get-element-children.js");
1959 -var _getRandomStyleId = __webpack_require__(/*! ./get-random-style-id */ "../modules/atomic-widgets/assets/js/editor/utils/get-random-style-id.js");
1960 -function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
1961 -function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
1962 -function regenerateLocalStyleIds(container) {
1963 - if (!(container !== null && container !== void 0 && container.model)) {
1964 - return;
4683 +
4684 + return type.slice(8, -1).toLowerCase().replace(/\s/g, '');
4685 +}
4686 +
4687 +function ctorName(val) {
4688 + return typeof val.constructor === 'function' ? val.constructor.name : null;
4689 +}
4690 +
4691 +function isError(val) {
4692 + return val instanceof Error || typeof val.message === 'string' && val.constructor && typeof val.constructor.stackTraceLimit === 'number';
4693 +}
4694 +
4695 +function isDate(val) {
4696 + if (val instanceof Date) return true;
4697 + return typeof val.toDateString === 'function' && typeof val.getDate === 'function' && typeof val.setDate === 'function';
4698 +}
4699 +
4700 +function kindOf(val) {
4701 + var typeOfVal = typeof val;
4702 +
4703 + if (true) {
4704 + typeOfVal = miniKindOf(val);
1965 4705 }
1966 - var allElements = (0, _getElementChildren.getElementChildren)(container.model);
1967 - var styledElements = allElements.filter(function (model) {
1968 - var _model$get;
1969 - return model && Object.keys((_model$get = model.get('styles')) !== null && _model$get !== void 0 ? _model$get : {}).length > 0;
4706 +
4707 + return typeOfVal;
4708 +}
4709 +
4710 +/**
4711 + * @deprecated
4712 + *
4713 + * **We recommend using the `configureStore` method
4714 + * of the `@reduxjs/toolkit` package**, which replaces `createStore`.
4715 + *
4716 + * Redux Toolkit is our recommended approach for writing Redux logic today,
4717 + * including store setup, reducers, data fetching, and more.
4718 + *
4719 + * **For more details, please read this Redux docs page:**
4720 + * **https://redux.js.org/introduction/why-rtk-is-redux-today**
4721 + *
4722 + * `configureStore` from Redux Toolkit is an improved version of `createStore` that
4723 + * simplifies setup and helps avoid common bugs.
4724 + *
4725 + * You should not be using the `redux` core package by itself today, except for learning purposes.
4726 + * The `createStore` method from the core `redux` package will not be removed, but we encourage
4727 + * all users to migrate to using Redux Toolkit for all Redux code.
4728 + *
4729 + * If you want to use `createStore` without this visual deprecation warning, use
4730 + * the `legacy_createStore` import instead:
4731 + *
4732 + * `import { legacy_createStore as createStore} from 'redux'`
4733 + *
4734 + */
4735 +
4736 +function createStore(reducer, preloadedState, enhancer) {
4737 + var _ref2;
4738 +
4739 + if (typeof preloadedState === 'function' && typeof enhancer === 'function' || typeof enhancer === 'function' && typeof arguments[3] === 'function') {
4740 + 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.');
4741 + }
4742 +
4743 + if (typeof preloadedState === 'function' && typeof enhancer === 'undefined') {
4744 + enhancer = preloadedState;
4745 + preloadedState = undefined;
4746 + }
4747 +
4748 + if (typeof enhancer !== 'undefined') {
4749 + if (typeof enhancer !== 'function') {
4750 + throw new Error( false ? 0 : "Expected the enhancer to be a function. Instead, received: '" + kindOf(enhancer) + "'");
4751 + }
4752 +
4753 + return enhancer(createStore)(reducer, preloadedState);
4754 + }
4755 +
4756 + if (typeof reducer !== 'function') {
4757 + throw new Error( false ? 0 : "Expected the root reducer to be a function. Instead, received: '" + kindOf(reducer) + "'");
4758 + }
4759 +
4760 + var currentReducer = reducer;
4761 + var currentState = preloadedState;
4762 + var currentListeners = [];
4763 + var nextListeners = currentListeners;
4764 + var isDispatching = false;
4765 + /**
4766 + * This makes a shallow copy of currentListeners so we can use
4767 + * nextListeners as a temporary list while dispatching.
4768 + *
4769 + * This prevents any bugs around consumers calling
4770 + * subscribe/unsubscribe in the middle of a dispatch.
4771 + */
4772 +
4773 + function ensureCanMutateNextListeners() {
4774 + if (nextListeners === currentListeners) {
4775 + nextListeners = currentListeners.slice();
4776 + }
4777 + }
4778 + /**
4779 + * Reads the state tree managed by the store.
4780 + *
4781 + * @returns {any} The current state tree of your application.
4782 + */
4783 +
4784 +
4785 + function getState() {
4786 + if (isDispatching) {
4787 + 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.');
4788 + }
4789 +
4790 + return currentState;
4791 + }
4792 + /**
4793 + * Adds a change listener. It will be called any time an action is dispatched,
4794 + * and some part of the state tree may potentially have changed. You may then
4795 + * call `getState()` to read the current state tree inside the callback.
4796 + *
4797 + * You may call `dispatch()` from a change listener, with the following
4798 + * caveats:
4799 + *
4800 + * 1. The subscriptions are snapshotted just before every `dispatch()` call.
4801 + * If you subscribe or unsubscribe while the listeners are being invoked, this
4802 + * will not have any effect on the `dispatch()` that is currently in progress.
4803 + * However, the next `dispatch()` call, whether nested or not, will use a more
4804 + * recent snapshot of the subscription list.
4805 + *
4806 + * 2. The listener should not expect to see all state changes, as the state
4807 + * might have been updated multiple times during a nested `dispatch()` before
4808 + * the listener is called. It is, however, guaranteed that all subscribers
4809 + * registered before the `dispatch()` started will be called with the latest
4810 + * state by the time it exits.
4811 + *
4812 + * @param {Function} listener A callback to be invoked on every dispatch.
4813 + * @returns {Function} A function to remove this change listener.
4814 + */
4815 +
4816 +
4817 + function subscribe(listener) {
4818 + if (typeof listener !== 'function') {
4819 + throw new Error( false ? 0 : "Expected the listener to be a function. Instead, received: '" + kindOf(listener) + "'");
4820 + }
4821 +
4822 + if (isDispatching) {
4823 + 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.');
4824 + }
4825 +
4826 + var isSubscribed = true;
4827 + ensureCanMutateNextListeners();
4828 + nextListeners.push(listener);
4829 + return function unsubscribe() {
4830 + if (!isSubscribed) {
4831 + return;
4832 + }
4833 +
4834 + if (isDispatching) {
4835 + 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.');
4836 + }
4837 +
4838 + isSubscribed = false;
4839 + ensureCanMutateNextListeners();
4840 + var index = nextListeners.indexOf(listener);
4841 + nextListeners.splice(index, 1);
4842 + currentListeners = null;
4843 + };
4844 + }
4845 + /**
4846 + * Dispatches an action. It is the only way to trigger a state change.
4847 + *
4848 + * The `reducer` function, used to create the store, will be called with the
4849 + * current state tree and the given `action`. Its return value will
4850 + * be considered the **next** state of the tree, and the change listeners
4851 + * will be notified.
4852 + *
4853 + * The base implementation only supports plain object actions. If you want to
4854 + * dispatch a Promise, an Observable, a thunk, or something else, you need to
4855 + * wrap your store creating function into the corresponding middleware. For
4856 + * example, see the documentation for the `redux-thunk` package. Even the
4857 + * middleware will eventually dispatch plain object actions using this method.
4858 + *
4859 + * @param {Object} action A plain object representing “what changed”. It is
4860 + * a good idea to keep actions serializable so you can record and replay user
4861 + * sessions, or use the time travelling `redux-devtools`. An action must have
4862 + * a `type` property which may not be `undefined`. It is a good idea to use
4863 + * string constants for action types.
4864 + *
4865 + * @returns {Object} For convenience, the same action object you dispatched.
4866 + *
4867 + * Note that, if you use a custom middleware, it may wrap `dispatch()` to
4868 + * return something else (for example, a Promise you can await).
4869 + */
4870 +
4871 +
4872 + function dispatch(action) {
4873 + if (!isPlainObject(action)) {
4874 + 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.");
4875 + }
4876 +
4877 + if (typeof action.type === 'undefined') {
4878 + throw new Error( false ? 0 : 'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');
4879 + }
4880 +
4881 + if (isDispatching) {
4882 + throw new Error( false ? 0 : 'Reducers may not dispatch actions.');
4883 + }
4884 +
4885 + try {
4886 + isDispatching = true;
4887 + currentState = currentReducer(currentState, action);
4888 + } finally {
4889 + isDispatching = false;
4890 + }
4891 +
4892 + var listeners = currentListeners = nextListeners;
4893 +
4894 + for (var i = 0; i < listeners.length; i++) {
4895 + var listener = listeners[i];
4896 + listener();
4897 + }
4898 +
4899 + return action;
4900 + }
4901 + /**
4902 + * Replaces the reducer currently used by the store to calculate the state.
4903 + *
4904 + * You might need this if your app implements code splitting and you want to
4905 + * load some of the reducers dynamically. You might also need this if you
4906 + * implement a hot reloading mechanism for Redux.
4907 + *
4908 + * @param {Function} nextReducer The reducer for the store to use instead.
4909 + * @returns {void}
4910 + */
4911 +
4912 +
4913 + function replaceReducer(nextReducer) {
4914 + if (typeof nextReducer !== 'function') {
4915 + throw new Error( false ? 0 : "Expected the nextReducer to be a function. Instead, received: '" + kindOf(nextReducer));
4916 + }
4917 +
4918 + currentReducer = nextReducer; // This action has a similiar effect to ActionTypes.INIT.
4919 + // Any reducers that existed in both the new and old rootReducer
4920 + // will receive the previous state. This effectively populates
4921 + // the new state tree with any relevant data from the old one.
4922 +
4923 + dispatch({
4924 + type: ActionTypes.REPLACE
4925 + });
4926 + }
4927 + /**
4928 + * Interoperability point for observable/reactive libraries.
4929 + * @returns {observable} A minimal observable of state changes.
4930 + * For more information, see the observable proposal:
4931 + * https://github.com/tc39/proposal-observable
4932 + */
4933 +
4934 +
4935 + function observable() {
4936 + var _ref;
4937 +
4938 + var outerSubscribe = subscribe;
4939 + return _ref = {
4940 + /**
4941 + * The minimal observable subscription method.
4942 + * @param {Object} observer Any object that can be used as an observer.
4943 + * The observer object should have a `next` method.
4944 + * @returns {subscription} An object with an `unsubscribe` method that can
4945 + * be used to unsubscribe the observable from the store, and prevent further
4946 + * emission of values from the observable.
4947 + */
4948 + subscribe: function subscribe(observer) {
4949 + if (typeof observer !== 'object' || observer === null) {
4950 + throw new Error( false ? 0 : "Expected the observer to be an object. Instead, received: '" + kindOf(observer) + "'");
4951 + }
4952 +
4953 + function observeState() {
4954 + if (observer.next) {
4955 + observer.next(getState());
4956 + }
4957 + }
4958 +
4959 + observeState();
4960 + var unsubscribe = outerSubscribe(observeState);
4961 + return {
4962 + unsubscribe: unsubscribe
4963 + };
4964 + }
4965 + }, _ref[$$observable] = function () {
4966 + return this;
4967 + }, _ref;
4968 + } // When a store is created, an "INIT" action is dispatched so that every
4969 + // reducer returns their initial state. This effectively populates
4970 + // the initial state tree.
4971 +
4972 +
4973 + dispatch({
4974 + type: ActionTypes.INIT
1970 4975 });
1971 - updateElementsStyleIdsInsideOut(styledElements);
4976 + return _ref2 = {
4977 + dispatch: dispatch,
4978 + subscribe: subscribe,
4979 + getState: getState,
4980 + replaceReducer: replaceReducer
4981 + }, _ref2[$$observable] = observable, _ref2;
1972 4982 }
1973 -function isClassesProp(prop) {
1974 - return prop.$$type && 'classes' === prop.$$type && Array.isArray(prop.value) && prop.value.length > 0;
4983 +/**
4984 + * Creates a Redux store that holds the state tree.
4985 + *
4986 + * **We recommend using `configureStore` from the
4987 + * `@reduxjs/toolkit` package**, which replaces `createStore`:
4988 + * **https://redux.js.org/introduction/why-rtk-is-redux-today**
4989 + *
4990 + * The only way to change the data in the store is to call `dispatch()` on it.
4991 + *
4992 + * There should only be a single store in your app. To specify how different
4993 + * parts of the state tree respond to actions, you may combine several reducers
4994 + * into a single reducer function by using `combineReducers`.
4995 + *
4996 + * @param {Function} reducer A function that returns the next state tree, given
4997 + * the current state tree and the action to handle.
4998 + *
4999 + * @param {any} [preloadedState] The initial state. You may optionally specify it
5000 + * to hydrate the state from the server in universal apps, or to restore a
5001 + * previously serialized user session.
5002 + * If you use `combineReducers` to produce the root reducer function, this must be
5003 + * an object with the same shape as `combineReducers` keys.
5004 + *
5005 + * @param {Function} [enhancer] The store enhancer. You may optionally specify it
5006 + * to enhance the store with third-party capabilities such as middleware,
5007 + * time travel, persistence, etc. The only store enhancer that ships with Redux
5008 + * is `applyMiddleware()`.
5009 + *
5010 + * @returns {Store} A Redux store that lets you read the state, dispatch actions
5011 + * and subscribe to changes.
5012 + */
5013 +
5014 +var legacy_createStore = createStore;
5015 +
5016 +/**
5017 + * Prints a warning in the console if it exists.
5018 + *
5019 + * @param {String} message The warning message.
5020 + * @returns {void}
5021 + */
5022 +function warning(message) {
5023 + /* eslint-disable no-console */
5024 + if (typeof console !== 'undefined' && typeof console.error === 'function') {
5025 + console.error(message);
5026 + }
5027 + /* eslint-enable no-console */
5028 +
5029 +
5030 + try {
5031 + // This error was thrown as a convenience so that if you enable
5032 + // "break on all exceptions" in your console,
5033 + // it would pause the execution at this line.
5034 + throw new Error(message);
5035 + } catch (e) {} // eslint-disable-line no-empty
5036 +
1975 5037 }
1976 -function calculateNewStylesAndSettings(element, model, settings) {
1977 - var _settings$toJSON;
1978 - var originalStyles = model.get('styles');
1979 - var settingsJson = (_settings$toJSON = settings === null || settings === void 0 ? void 0 : settings.toJSON()) !== null && _settings$toJSON !== void 0 ? _settings$toJSON : {};
1980 - var classesProps = Object.entries(settingsJson).filter(function (_ref) {
1981 - var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
1982 - propValue = _ref2[1];
1983 - return isClassesProp(propValue);
5038 +
5039 +function getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) {
5040 + var reducerKeys = Object.keys(reducers);
5041 + var argumentName = action && action.type === ActionTypes.INIT ? 'preloadedState argument passed to createStore' : 'previous state received by the reducer';
5042 +
5043 + if (reducerKeys.length === 0) {
5044 + return 'Store does not have a valid reducer. Make sure the argument passed ' + 'to combineReducers is an object whose values are reducers.';
5045 + }
5046 +
5047 + if (!isPlainObject(inputState)) {
5048 + return "The " + argumentName + " has unexpected type of \"" + kindOf(inputState) + "\". Expected argument to be an object with the following " + ("keys: \"" + reducerKeys.join('", "') + "\"");
5049 + }
5050 +
5051 + var unexpectedKeys = Object.keys(inputState).filter(function (key) {
5052 + return !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key];
1984 5053 });
1985 - var newStyles = {};
1986 - var changedIds = {};
1987 - Object.entries(originalStyles).forEach(function (_ref3) {
1988 - var _ref4 = (0, _slicedToArray2.default)(_ref3, 2),
1989 - originalStyleId = _ref4[0],
1990 - style = _ref4[1];
1991 - var newStyleId = (0, _getRandomStyleId.getRandomStyleId)(element, newStyles);
1992 - newStyles[newStyleId] = structuredClone(_objectSpread(_objectSpread({}, style), {}, {
1993 - id: newStyleId
1994 - }));
1995 - changedIds[originalStyleId] = newStyleId;
5054 + unexpectedKeys.forEach(function (key) {
5055 + unexpectedKeyCache[key] = true;
1996 5056 });
1997 - var newClassesProps = classesProps.map(function (_ref5) {
1998 - var _ref6 = (0, _slicedToArray2.default)(_ref5, 2),
1999 - key = _ref6[0],
2000 - value = _ref6[1];
2001 - return [key, _objectSpread(_objectSpread({}, value), {}, {
2002 - value: value.value.map(function (className) {
2003 - var _changedIds$className;
2004 - return (_changedIds$className = changedIds[className]) !== null && _changedIds$className !== void 0 ? _changedIds$className : className;
2005 - })
2006 - })];
2007 - }, {});
5057 + if (action && action.type === ActionTypes.REPLACE) return;
5058 +
5059 + if (unexpectedKeys.length > 0) {
5060 + 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.");
5061 + }
5062 +}
5063 +
5064 +function assertReducerShape(reducers) {
5065 + Object.keys(reducers).forEach(function (key) {
5066 + var reducer = reducers[key];
5067 + var initialState = reducer(undefined, {
5068 + type: ActionTypes.INIT
5069 + });
5070 +
5071 + if (typeof initialState === 'undefined') {
5072 + 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.");
5073 + }
5074 +
5075 + if (typeof reducer(undefined, {
5076 + type: ActionTypes.PROBE_UNKNOWN_ACTION()
5077 + }) === 'undefined') {
5078 + 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.");
5079 + }
5080 + });
5081 +}
5082 +/**
5083 + * Turns an object whose values are different reducer functions, into a single
5084 + * reducer function. It will call every child reducer, and gather their results
5085 + * into a single state object, whose keys correspond to the keys of the passed
5086 + * reducer functions.
5087 + *
5088 + * @param {Object} reducers An object whose values correspond to different
5089 + * reducer functions that need to be combined into one. One handy way to obtain
5090 + * it is to use ES6 `import * as reducers` syntax. The reducers may never return
5091 + * undefined for any action. Instead, they should return their initial state
5092 + * if the state passed to them was undefined, and the current state for any
5093 + * unrecognized action.
5094 + *
5095 + * @returns {Function} A reducer function that invokes every reducer inside the
5096 + * passed object, and builds a state object with the same shape.
5097 + */
5098 +
5099 +
5100 +function combineReducers(reducers) {
5101 + var reducerKeys = Object.keys(reducers);
5102 + var finalReducers = {};
5103 +
5104 + for (var i = 0; i < reducerKeys.length; i++) {
5105 + var key = reducerKeys[i];
5106 +
5107 + if (true) {
5108 + if (typeof reducers[key] === 'undefined') {
5109 + warning("No reducer provided for key \"" + key + "\"");
5110 + }
5111 + }
5112 +
5113 + if (typeof reducers[key] === 'function') {
5114 + finalReducers[key] = reducers[key];
5115 + }
5116 + }
5117 +
5118 + var finalReducerKeys = Object.keys(finalReducers); // This is used to make sure we don't warn about the same
5119 + // keys multiple times.
5120 +
5121 + var unexpectedKeyCache;
5122 +
5123 + if (true) {
5124 + unexpectedKeyCache = {};
5125 + }
5126 +
5127 + var shapeAssertionError;
5128 +
5129 + try {
5130 + assertReducerShape(finalReducers);
5131 + } catch (e) {
5132 + shapeAssertionError = e;
5133 + }
5134 +
5135 + return function combination(state, action) {
5136 + if (state === void 0) {
5137 + state = {};
5138 + }
5139 +
5140 + if (shapeAssertionError) {
5141 + throw shapeAssertionError;
5142 + }
5143 +
5144 + if (true) {
5145 + var warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action, unexpectedKeyCache);
5146 +
5147 + if (warningMessage) {
5148 + warning(warningMessage);
5149 + }
5150 + }
5151 +
5152 + var hasChanged = false;
5153 + var nextState = {};
5154 +
5155 + for (var _i = 0; _i < finalReducerKeys.length; _i++) {
5156 + var _key = finalReducerKeys[_i];
5157 + var reducer = finalReducers[_key];
5158 + var previousStateForKey = state[_key];
5159 + var nextStateForKey = reducer(previousStateForKey, action);
5160 +
5161 + if (typeof nextStateForKey === 'undefined') {
5162 + var actionType = action && action.type;
5163 + 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.");
5164 + }
5165 +
5166 + nextState[_key] = nextStateForKey;
5167 + hasChanged = hasChanged || nextStateForKey !== previousStateForKey;
5168 + }
5169 +
5170 + hasChanged = hasChanged || finalReducerKeys.length !== Object.keys(state).length;
5171 + return hasChanged ? nextState : state;
5172 + };
5173 +}
5174 +
5175 +function bindActionCreator(actionCreator, dispatch) {
5176 + return function () {
5177 + return dispatch(actionCreator.apply(this, arguments));
5178 + };
5179 +}
5180 +/**
5181 + * Turns an object whose values are action creators, into an object with the
5182 + * same keys, but with every function wrapped into a `dispatch` call so they
5183 + * may be invoked directly. This is just a convenience method, as you can call
5184 + * `store.dispatch(MyActionCreators.doSomething())` yourself just fine.
5185 + *
5186 + * For convenience, you can also pass an action creator as the first argument,
5187 + * and get a dispatch wrapped function in return.
5188 + *
5189 + * @param {Function|Object} actionCreators An object whose values are action
5190 + * creator functions. One handy way to obtain it is to use ES6 `import * as`
5191 + * syntax. You may also pass a single function.
5192 + *
5193 + * @param {Function} dispatch The `dispatch` function available on your Redux
5194 + * store.
5195 + *
5196 + * @returns {Function|Object} The object mimicking the original object, but with
5197 + * every action creator wrapped into the `dispatch` call. If you passed a
5198 + * function as `actionCreators`, the return value will also be a single
5199 + * function.
5200 + */
5201 +
5202 +
5203 +function bindActionCreators(actionCreators, dispatch) {
5204 + if (typeof actionCreators === 'function') {
5205 + return bindActionCreator(actionCreators, dispatch);
5206 + }
5207 +
5208 + if (typeof actionCreators !== 'object' || actionCreators === null) {
5209 + 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\"?");
5210 + }
5211 +
5212 + var boundActionCreators = {};
5213 +
5214 + for (var key in actionCreators) {
5215 + var actionCreator = actionCreators[key];
5216 +
5217 + if (typeof actionCreator === 'function') {
5218 + boundActionCreators[key] = bindActionCreator(actionCreator, dispatch);
5219 + }
5220 + }
5221 +
5222 + return boundActionCreators;
5223 +}
5224 +
5225 +/**
5226 + * Composes single-argument functions from right to left. The rightmost
5227 + * function can take multiple arguments as it provides the signature for
5228 + * the resulting composite function.
5229 + *
5230 + * @param {...Function} funcs The functions to compose.
5231 + * @returns {Function} A function obtained by composing the argument functions
5232 + * from right to left. For example, compose(f, g, h) is identical to doing
5233 + * (...args) => f(g(h(...args))).
5234 + */
5235 +function compose() {
5236 + for (var _len = arguments.length, funcs = new Array(_len), _key = 0; _key < _len; _key++) {
5237 + funcs[_key] = arguments[_key];
5238 + }
5239 +
5240 + if (funcs.length === 0) {
5241 + return function (arg) {
5242 + return arg;
5243 + };
5244 + }
5245 +
5246 + if (funcs.length === 1) {
5247 + return funcs[0];
5248 + }
5249 +
5250 + return funcs.reduce(function (a, b) {
5251 + return function () {
5252 + return a(b.apply(void 0, arguments));
5253 + };
5254 + });
5255 +}
5256 +
5257 +/**
5258 + * Creates a store enhancer that applies middleware to the dispatch method
5259 + * of the Redux store. This is handy for a variety of tasks, such as expressing
5260 + * asynchronous actions in a concise manner, or logging every action payload.
5261 + *
5262 + * See `redux-thunk` package as an example of the Redux middleware.
5263 + *
5264 + * Because middleware is potentially asynchronous, this should be the first
5265 + * store enhancer in the composition chain.
5266 + *
5267 + * Note that each middleware will be given the `dispatch` and `getState` functions
5268 + * as named arguments.
5269 + *
5270 + * @param {...Function} middlewares The middleware chain to be applied.
5271 + * @returns {Function} A store enhancer applying the middleware.
5272 + */
5273 +
5274 +function applyMiddleware() {
5275 + for (var _len = arguments.length, middlewares = new Array(_len), _key = 0; _key < _len; _key++) {
5276 + middlewares[_key] = arguments[_key];
5277 + }
5278 +
5279 + return function (createStore) {
5280 + return function () {
5281 + var store = createStore.apply(void 0, arguments);
5282 +
5283 + var _dispatch = function dispatch() {
5284 + throw new Error( false ? 0 : 'Dispatching while constructing your middleware is not allowed. ' + 'Other middleware would not be applied to this dispatch.');
5285 + };
5286 +
5287 + var middlewareAPI = {
5288 + getState: store.getState,
5289 + dispatch: function dispatch() {
5290 + return _dispatch.apply(void 0, arguments);
5291 + }
5292 + };
5293 + var chain = middlewares.map(function (middleware) {
5294 + return middleware(middlewareAPI);
5295 + });
5296 + _dispatch = compose.apply(void 0, chain)(store.dispatch);
5297 + return (0,_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_0__["default"])((0,_babel_runtime_helpers_esm_objectSpread2__WEBPACK_IMPORTED_MODULE_0__["default"])({}, store), {}, {
5298 + dispatch: _dispatch
5299 + });
5300 + };
5301 + };
5302 +}
5303 +
5304 +
5305 +
5306 +
5307 +/***/ }),
5308 +
5309 +/***/ "../node_modules/reselect/es/defaultMemoize.js":
5310 +/*!*****************************************************!*\
5311 + !*** ../node_modules/reselect/es/defaultMemoize.js ***!
5312 + \*****************************************************/
5313 +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
5314 +
5315 +"use strict";
5316 +__webpack_require__.r(__webpack_exports__);
5317 +/* harmony export */ __webpack_require__.d(__webpack_exports__, {
5318 +/* harmony export */ createCacheKeyComparator: () => (/* binding */ createCacheKeyComparator),
5319 +/* harmony export */ defaultEqualityCheck: () => (/* binding */ defaultEqualityCheck),
5320 +/* harmony export */ defaultMemoize: () => (/* binding */ defaultMemoize)
5321 +/* harmony export */ });
5322 +// Cache implementation based on Erik Rasmussen's `lru-memoize`:
5323 +// https://github.com/erikras/lru-memoize
5324 +var NOT_FOUND = 'NOT_FOUND';
5325 +
5326 +function createSingletonCache(equals) {
5327 + var entry;
2008 5328 return {
2009 - newStyles: newStyles,
2010 - newSettings: Object.fromEntries(newClassesProps)
5329 + get: function get(key) {
5330 + if (entry && equals(entry.key, key)) {
5331 + return entry.value;
5332 + }
5333 +
5334 + return NOT_FOUND;
5335 + },
5336 + put: function put(key, value) {
5337 + entry = {
5338 + key: key,
5339 + value: value
5340 + };
5341 + },
5342 + getEntries: function getEntries() {
5343 + return entry ? [entry] : [];
5344 + },
5345 + clear: function clear() {
5346 + entry = undefined;
5347 + }
2011 5348 };
2012 5349 }
2013 -function updateStyleIdForContainer(container) {
2014 - var model = container.model,
2015 - settings = container.settings;
2016 - var _calculateNewStylesAn = calculateNewStylesAndSettings(container, model, settings),
2017 - newStyles = _calculateNewStylesAn.newStyles,
2018 - newSettings = _calculateNewStylesAn.newSettings;
2019 - $e.internal('document/elements/set-settings', {
2020 - container: container,
2021 - settings: newSettings
2022 - });
2023 - model.set('styles', newStyles);
5350 +
5351 +function createLruCache(maxSize, equals) {
5352 + var entries = [];
5353 +
5354 + function get(key) {
5355 + var cacheIndex = entries.findIndex(function (entry) {
5356 + return equals(key, entry.key);
5357 + }); // We found a cached entry
5358 +
5359 + if (cacheIndex > -1) {
5360 + var entry = entries[cacheIndex]; // Cached entry not at top of cache, move it to the top
5361 +
5362 + if (cacheIndex > 0) {
5363 + entries.splice(cacheIndex, 1);
5364 + entries.unshift(entry);
5365 + }
5366 +
5367 + return entry.value;
5368 + } // No entry found in cache, return sentinel
5369 +
5370 +
5371 + return NOT_FOUND;
5372 + }
5373 +
5374 + function put(key, value) {
5375 + if (get(key) === NOT_FOUND) {
5376 + // TODO Is unshift slow?
5377 + entries.unshift({
5378 + key: key,
5379 + value: value
5380 + });
5381 +
5382 + if (entries.length > maxSize) {
5383 + entries.pop();
5384 + }
5385 + }
5386 + }
5387 +
5388 + function getEntries() {
5389 + return entries;
5390 + }
5391 +
5392 + function clear() {
5393 + entries = [];
5394 + }
5395 +
5396 + return {
5397 + get: get,
5398 + put: put,
5399 + getEntries: getEntries,
5400 + clear: clear
5401 + };
2024 5402 }
2025 -function updateStyleIdForModel(model) {
2026 - var settings = model.get('settings');
2027 - var _calculateNewStylesAn2 = calculateNewStylesAndSettings(model, model, settings),
2028 - newStyles = _calculateNewStylesAn2.newStyles,
2029 - newSettings = _calculateNewStylesAn2.newSettings;
2030 - settings.set(newSettings);
2031 - model.set('styles', newStyles);
5403 +
5404 +var defaultEqualityCheck = function defaultEqualityCheck(a, b) {
5405 + return a === b;
5406 +};
5407 +function createCacheKeyComparator(equalityCheck) {
5408 + return function areArgumentsShallowlyEqual(prev, next) {
5409 + if (prev === null || next === null || prev.length !== next.length) {
5410 + return false;
5411 + } // Do this in a for loop (and not a `forEach` or an `every`) so we can determine equality as fast as possible.
5412 +
5413 +
5414 + var length = prev.length;
5415 +
5416 + for (var i = 0; i < length; i++) {
5417 + if (!equalityCheck(prev[i], next[i])) {
5418 + return false;
5419 + }
5420 + }
5421 +
5422 + return true;
5423 + };
2032 5424 }
2033 -function updateStyleId(model) {
2034 - var container = window.elementor.getContainer(model.get('id'));
5425 +// defaultMemoize now supports a configurable cache size with LRU behavior,
5426 +// and optional comparison of the result value with existing values
5427 +function defaultMemoize(func, equalityCheckOrOptions) {
5428 + var providedOptions = typeof equalityCheckOrOptions === 'object' ? equalityCheckOrOptions : {
5429 + equalityCheck: equalityCheckOrOptions
5430 + };
5431 + var _providedOptions$equa = providedOptions.equalityCheck,
5432 + equalityCheck = _providedOptions$equa === void 0 ? defaultEqualityCheck : _providedOptions$equa,
5433 + _providedOptions$maxS = providedOptions.maxSize,
5434 + maxSize = _providedOptions$maxS === void 0 ? 1 : _providedOptions$maxS,
5435 + resultEqualityCheck = providedOptions.resultEqualityCheck;
5436 + var comparator = createCacheKeyComparator(equalityCheck);
5437 + var cache = maxSize === 1 ? createSingletonCache(comparator) : createLruCache(maxSize, comparator); // we reference arguments instead of spreading them for performance reasons
2035 5438
2036 - // If view exists, update the styles via the container
2037 - if (container) {
2038 - updateStyleIdForContainer(container);
2039 - return;
5439 + function memoized() {
5440 + var value = cache.get(arguments);
5441 +
5442 + if (value === NOT_FOUND) {
5443 + // @ts-ignore
5444 + value = func.apply(null, arguments);
5445 +
5446 + if (resultEqualityCheck) {
5447 + var entries = cache.getEntries();
5448 + var matchingEntry = entries.find(function (entry) {
5449 + return resultEqualityCheck(entry.value, value);
5450 + });
5451 +
5452 + if (matchingEntry) {
5453 + value = matchingEntry.value;
5454 + }
5455 + }
5456 +
5457 + cache.put(arguments, value);
5458 + }
5459 +
5460 + return value;
2040 5461 }
2041 - updateStyleIdForModel(model);
5462 +
5463 + memoized.clearCache = function () {
5464 + return cache.clear();
5465 + };
5466 +
5467 + return memoized;
2042 5468 }
2043 -function updateElementsStyleIdsInsideOut(styledElements) {
2044 - styledElements === null || styledElements === void 0 || styledElements.reverse().forEach(updateStyleId);
5469 +
5470 +/***/ }),
5471 +
5472 +/***/ "../node_modules/reselect/es/index.js":
5473 +/*!********************************************!*\
5474 + !*** ../node_modules/reselect/es/index.js ***!
5475 + \********************************************/
5476 +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
5477 +
5478 +"use strict";
5479 +__webpack_require__.r(__webpack_exports__);
5480 +/* harmony export */ __webpack_require__.d(__webpack_exports__, {
5481 +/* harmony export */ createSelector: () => (/* binding */ createSelector),
5482 +/* harmony export */ createSelectorCreator: () => (/* binding */ createSelectorCreator),
5483 +/* harmony export */ createStructuredSelector: () => (/* binding */ createStructuredSelector),
5484 +/* harmony export */ defaultEqualityCheck: () => (/* reexport safe */ _defaultMemoize__WEBPACK_IMPORTED_MODULE_0__.defaultEqualityCheck),
5485 +/* harmony export */ defaultMemoize: () => (/* reexport safe */ _defaultMemoize__WEBPACK_IMPORTED_MODULE_0__.defaultMemoize)
5486 +/* harmony export */ });
5487 +/* harmony import */ var _defaultMemoize__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./defaultMemoize */ "../node_modules/reselect/es/defaultMemoize.js");
5488 +
5489 +
5490 +
5491 +function getDependencies(funcs) {
5492 + var dependencies = Array.isArray(funcs[0]) ? funcs[0] : funcs;
5493 +
5494 + if (!dependencies.every(function (dep) {
5495 + return typeof dep === 'function';
5496 + })) {
5497 + var dependencyTypes = dependencies.map(function (dep) {
5498 + return typeof dep === 'function' ? "function " + (dep.name || 'unnamed') + "()" : typeof dep;
5499 + }).join(', ');
5500 + throw new Error("createSelector expects all input-selectors to be functions, but received the following types: [" + dependencyTypes + "]");
5501 + }
5502 +
5503 + return dependencies;
2045 5504 }
2046 5505
5506 +function createSelectorCreator(memoize) {
5507 + for (var _len = arguments.length, memoizeOptionsFromArgs = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
5508 + memoizeOptionsFromArgs[_key - 1] = arguments[_key];
5509 + }
5510 +
5511 + var createSelector = function createSelector() {
5512 + for (var _len2 = arguments.length, funcs = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
5513 + funcs[_key2] = arguments[_key2];
5514 + }
5515 +
5516 + var _recomputations = 0;
5517 +
5518 + var _lastResult; // Due to the intricacies of rest params, we can't do an optional arg after `...funcs`.
5519 + // So, start by declaring the default value here.
5520 + // (And yes, the words 'memoize' and 'options' appear too many times in this next sequence.)
5521 +
5522 +
5523 + var directlyPassedOptions = {
5524 + memoizeOptions: undefined
5525 + }; // Normally, the result func or "output selector" is the last arg
5526 +
5527 + var resultFunc = funcs.pop(); // If the result func is actually an _object_, assume it's our options object
5528 +
5529 + if (typeof resultFunc === 'object') {
5530 + directlyPassedOptions = resultFunc; // and pop the real result func off
5531 +
5532 + resultFunc = funcs.pop();
5533 + }
5534 +
5535 + if (typeof resultFunc !== 'function') {
5536 + throw new Error("createSelector expects an output function after the inputs, but received: [" + typeof resultFunc + "]");
5537 + } // Determine which set of options we're using. Prefer options passed directly,
5538 + // but fall back to options given to createSelectorCreator.
5539 +
5540 +
5541 + var _directlyPassedOption = directlyPassedOptions,
5542 + _directlyPassedOption2 = _directlyPassedOption.memoizeOptions,
5543 + memoizeOptions = _directlyPassedOption2 === void 0 ? memoizeOptionsFromArgs : _directlyPassedOption2; // Simplifying assumption: it's unlikely that the first options arg of the provided memoizer
5544 + // is an array. In most libs I've looked at, it's an equality function or options object.
5545 + // Based on that, if `memoizeOptions` _is_ an array, we assume it's a full
5546 + // user-provided array of options. Otherwise, it must be just the _first_ arg, and so
5547 + // we wrap it in an array so we can apply it.
5548 +
5549 + var finalMemoizeOptions = Array.isArray(memoizeOptions) ? memoizeOptions : [memoizeOptions];
5550 + var dependencies = getDependencies(funcs);
5551 + var memoizedResultFunc = memoize.apply(void 0, [function recomputationWrapper() {
5552 + _recomputations++; // apply arguments instead of spreading for performance.
5553 +
5554 + return resultFunc.apply(null, arguments);
5555 + }].concat(finalMemoizeOptions)); // If a selector is called with the exact same arguments we don't need to traverse our dependencies again.
5556 +
5557 + var selector = memoize(function dependenciesChecker() {
5558 + var params = [];
5559 + var length = dependencies.length;
5560 +
5561 + for (var i = 0; i < length; i++) {
5562 + // apply arguments instead of spreading and mutate a local list of params for performance.
5563 + // @ts-ignore
5564 + params.push(dependencies[i].apply(null, arguments));
5565 + } // apply arguments instead of spreading for performance.
5566 +
5567 +
5568 + _lastResult = memoizedResultFunc.apply(null, params);
5569 + return _lastResult;
5570 + });
5571 + Object.assign(selector, {
5572 + resultFunc: resultFunc,
5573 + memoizedResultFunc: memoizedResultFunc,
5574 + dependencies: dependencies,
5575 + lastResult: function lastResult() {
5576 + return _lastResult;
5577 + },
5578 + recomputations: function recomputations() {
5579 + return _recomputations;
5580 + },
5581 + resetRecomputations: function resetRecomputations() {
5582 + return _recomputations = 0;
5583 + }
5584 + });
5585 + return selector;
5586 + }; // @ts-ignore
5587 +
5588 +
5589 + return createSelector;
5590 +}
5591 +var createSelector = /* #__PURE__ */createSelectorCreator(_defaultMemoize__WEBPACK_IMPORTED_MODULE_0__.defaultMemoize);
5592 +// Manual definition of state and output arguments
5593 +var createStructuredSelector = function createStructuredSelector(selectors, selectorCreator) {
5594 + if (selectorCreator === void 0) {
5595 + selectorCreator = createSelector;
5596 + }
5597 +
5598 + if (typeof selectors !== 'object') {
5599 + throw new Error('createStructuredSelector expects first argument to be an object ' + ("where each property is a selector, instead received a " + typeof selectors));
5600 + }
5601 +
5602 + var objectKeys = Object.keys(selectors);
5603 + var resultSelector = selectorCreator( // @ts-ignore
5604 + objectKeys.map(function (key) {
5605 + return selectors[key];
5606 + }), function () {
5607 + for (var _len3 = arguments.length, values = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
5608 + values[_key3] = arguments[_key3];
5609 + }
5610 +
5611 + return values.reduce(function (composition, value, index) {
5612 + composition[objectKeys[index]] = value;
5613 + return composition;
5614 + }, {});
5615 + });
5616 + return resultSelector;
5617 +};
5618 +
2047 5619 /***/ }),
2048 5620
2049 -/***/ "../node_modules/@babel/runtime/helpers/OverloadYield.js":
2050 -/*!***************************************************************!*\
2051 - !*** ../node_modules/@babel/runtime/helpers/OverloadYield.js ***!
2052 - \***************************************************************/
5621 +/***/ "@wordpress/i18n":
5622 +/*!**************************!*\
5623 + !*** external "wp.i18n" ***!
5624 + \**************************/
2053 5625 /***/ ((module) => {
2054 5626
2055 -function _OverloadYield(e, d) {
2056 - this.v = e, this.k = d;
2057 -}
2058 -module.exports = _OverloadYield, module.exports.__esModule = true, module.exports["default"] = module.exports;
5627 +"use strict";
5628 +module.exports = wp.i18n;
2059 5629
2060 5630 /***/ }),
2061 5631
2062 5632 /***/ "../node_modules/@babel/runtime/helpers/arrayLikeToArray.js":
@@ -2064,12 +5634,12 @@
2064 5634 !*** ../node_modules/@babel/runtime/helpers/arrayLikeToArray.js ***!
2065 5635 \******************************************************************/
2066 5636 /***/ ((module) => {
2067 5637
2068 -function _arrayLikeToArray(r, a) {
2069 - (null == a || a > r.length) && (a = r.length);
2070 - for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
2071 - return n;
5638 +function _arrayLikeToArray(arr, len) {
5639 + if (len == null || len > arr.length) len = arr.length;
5640 + for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
5641 + return arr2;
2072 5642 }
2073 5643 module.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
2074 5644
2075 5645 /***/ }),
@@ -2079,10 +5649,10 @@
2079 5649 !*** ../node_modules/@babel/runtime/helpers/arrayWithHoles.js ***!
2080 5650 \****************************************************************/
2081 5651 /***/ ((module) => {
2082 5652
2083 -function _arrayWithHoles(r) {
2084 - if (Array.isArray(r)) return r;
5653 +function _arrayWithHoles(arr) {
5654 + if (Array.isArray(arr)) return arr;
2085 5655 }
2086 5656 module.exports = _arrayWithHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
2087 5657
2088 5658 /***/ }),
@@ -2093,10 +5663,10 @@
2093 5663 \*******************************************************************/
2094 5664 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2095 5665
2096 5666 var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray.js */ "../node_modules/@babel/runtime/helpers/arrayLikeToArray.js");
2097 -function _arrayWithoutHoles(r) {
2098 - if (Array.isArray(r)) return arrayLikeToArray(r);
5667 +function _arrayWithoutHoles(arr) {
5668 + if (Array.isArray(arr)) return arrayLikeToArray(arr);
2099 5669 }
2100 5670 module.exports = _arrayWithoutHoles, module.exports.__esModule = true, module.exports["default"] = module.exports;
2101 5671
2102 5672 /***/ }),
@@ -2106,61 +5676,49 @@
2106 5676 !*** ../node_modules/@babel/runtime/helpers/assertThisInitialized.js ***!
2107 5677 \***********************************************************************/
2108 5678 /***/ ((module) => {
2109 5679
2110 -function _assertThisInitialized(e) {
2111 - if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
2112 - return e;
5680 +function _assertThisInitialized(self) {
5681 + if (self === void 0) {
5682 + throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
5683 + }
5684 + return self;
2113 5685 }
2114 5686 module.exports = _assertThisInitialized, module.exports.__esModule = true, module.exports["default"] = module.exports;
2115 5687
2116 5688 /***/ }),
2117 5689
2118 -/***/ "../node_modules/@babel/runtime/helpers/asyncToGenerator.js":
2119 -/*!******************************************************************!*\
2120 - !*** ../node_modules/@babel/runtime/helpers/asyncToGenerator.js ***!
2121 - \******************************************************************/
5690 +/***/ "../node_modules/@babel/runtime/helpers/classCallCheck.js":
5691 +/*!****************************************************************!*\
5692 + !*** ../node_modules/@babel/runtime/helpers/classCallCheck.js ***!
5693 + \****************************************************************/
2122 5694 /***/ ((module) => {
2123 5695
2124 -function asyncGeneratorStep(n, t, e, r, o, a, c) {
2125 - try {
2126 - var i = n[a](c),
2127 - u = i.value;
2128 - } catch (n) {
2129 - return void e(n);
5696 +function _classCallCheck(instance, Constructor) {
5697 + if (!(instance instanceof Constructor)) {
5698 + throw new TypeError("Cannot call a class as a function");
2130 5699 }
2131 - i.done ? t(u) : Promise.resolve(u).then(r, o);
2132 5700 }
2133 -function _asyncToGenerator(n) {
2134 - return function () {
2135 - var t = this,
2136 - e = arguments;
2137 - return new Promise(function (r, o) {
2138 - var a = n.apply(t, e);
2139 - function _next(n) {
2140 - asyncGeneratorStep(a, r, o, _next, _throw, "next", n);
2141 - }
2142 - function _throw(n) {
2143 - asyncGeneratorStep(a, r, o, _next, _throw, "throw", n);
2144 - }
2145 - _next(void 0);
2146 - });
2147 - };
2148 -}
2149 -module.exports = _asyncToGenerator, module.exports.__esModule = true, module.exports["default"] = module.exports;
5701 +module.exports = _classCallCheck, module.exports.__esModule = true, module.exports["default"] = module.exports;
2150 5702
2151 5703 /***/ }),
2152 5704
2153 -/***/ "../node_modules/@babel/runtime/helpers/classCallCheck.js":
2154 -/*!****************************************************************!*\
2155 - !*** ../node_modules/@babel/runtime/helpers/classCallCheck.js ***!
2156 - \****************************************************************/
2157 -/***/ ((module) => {
5705 +/***/ "../node_modules/@babel/runtime/helpers/construct.js":
5706 +/*!***********************************************************!*\
5707 + !*** ../node_modules/@babel/runtime/helpers/construct.js ***!
5708 + \***********************************************************/
5709 +/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2158 5710
2159 -function _classCallCheck(a, n) {
2160 - if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
5711 +var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ "../node_modules/@babel/runtime/helpers/setPrototypeOf.js");
5712 +var isNativeReflectConstruct = __webpack_require__(/*! ./isNativeReflectConstruct.js */ "../node_modules/@babel/runtime/helpers/isNativeReflectConstruct.js");
5713 +function _construct(t, e, r) {
5714 + if (isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments);
5715 + var o = [null];
5716 + o.push.apply(o, e);
5717 + var p = new (t.bind.apply(t, o))();
5718 + return r && setPrototypeOf(p, r.prototype), p;
2161 5719 }
2162 -module.exports = _classCallCheck, module.exports.__esModule = true, module.exports["default"] = module.exports;
5720 +module.exports = _construct, module.exports.__esModule = true, module.exports["default"] = module.exports;
2163 5721
2164 5722 /***/ }),
2165 5723
2166 5724 /***/ "../node_modules/@babel/runtime/helpers/createClass.js":
@@ -2169,18 +5727,24 @@
2169 5727 \*************************************************************/
2170 5728 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2171 5729
2172 5730 var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ "../node_modules/@babel/runtime/helpers/toPropertyKey.js");
2173 -function _defineProperties(e, r) {
2174 - for (var t = 0; t < r.length; t++) {
2175 - var o = r[t];
2176 - o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, toPropertyKey(o.key), o);
5731 +function _defineProperties(target, props) {
5732 + for (var i = 0; i < props.length; i++) {
5733 + var descriptor = props[i];
5734 + descriptor.enumerable = descriptor.enumerable || false;
5735 + descriptor.configurable = true;
5736 + if ("value" in descriptor) descriptor.writable = true;
5737 + Object.defineProperty(target, toPropertyKey(descriptor.key), descriptor);
2177 5738 }
2178 5739 }
2179 -function _createClass(e, r, t) {
2180 - return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", {
2181 - writable: !1
2182 - }), e;
5740 +function _createClass(Constructor, protoProps, staticProps) {
5741 + if (protoProps) _defineProperties(Constructor.prototype, protoProps);
5742 + if (staticProps) _defineProperties(Constructor, staticProps);
5743 + Object.defineProperty(Constructor, "prototype", {
5744 + writable: false
5745 + });
5746 + return Constructor;
2183 5747 }
2184 5748 module.exports = _createClass, module.exports.__esModule = true, module.exports["default"] = module.exports;
2185 5749
2186 5750 /***/ }),
@@ -2191,15 +5755,21 @@
2191 5755 \****************************************************************/
2192 5756 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2193 5757
2194 5758 var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ "../node_modules/@babel/runtime/helpers/toPropertyKey.js");
2195 -function _defineProperty(e, r, t) {
2196 - return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
2197 - value: t,
2198 - enumerable: !0,
2199 - configurable: !0,
2200 - writable: !0
2201 - }) : e[r] = t, e;
5759 +function _defineProperty(obj, key, value) {
5760 + key = toPropertyKey(key);
5761 + if (key in obj) {
5762 + Object.defineProperty(obj, key, {
5763 + value: value,
5764 + enumerable: true,
5765 + configurable: true,
5766 + writable: true
5767 + });
5768 + } else {
5769 + obj[key] = value;
5770 + }
5771 + return obj;
2202 5772 }
2203 5773 module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports;
2204 5774
2205 5775 /***/ }),
@@ -2211,15 +5781,22 @@
2211 5781 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2212 5782
2213 5783 var superPropBase = __webpack_require__(/*! ./superPropBase.js */ "../node_modules/@babel/runtime/helpers/superPropBase.js");
2214 5784 function _get() {
2215 - return module.exports = _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) {
2216 - var p = superPropBase(e, t);
2217 - if (p) {
2218 - var n = Object.getOwnPropertyDescriptor(p, t);
2219 - return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value;
2220 - }
2221 - }, module.exports.__esModule = true, module.exports["default"] = module.exports, _get.apply(null, arguments);
5785 + if (typeof Reflect !== "undefined" && Reflect.get) {
5786 + module.exports = _get = Reflect.get.bind(), module.exports.__esModule = true, module.exports["default"] = module.exports;
5787 + } else {
5788 + module.exports = _get = function _get(target, property, receiver) {
5789 + var base = superPropBase(target, property);
5790 + if (!base) return;
5791 + var desc = Object.getOwnPropertyDescriptor(base, property);
5792 + if (desc.get) {
5793 + return desc.get.call(arguments.length < 3 ? target : receiver);
5794 + }
5795 + return desc.value;
5796 + }, module.exports.__esModule = true, module.exports["default"] = module.exports;
5797 + }
5798 + return _get.apply(this, arguments);
2222 5799 }
2223 5800 module.exports = _get, module.exports.__esModule = true, module.exports["default"] = module.exports;
2224 5801
2225 5802 /***/ }),
@@ -2229,12 +5806,13 @@
2229 5806 !*** ../node_modules/@babel/runtime/helpers/getPrototypeOf.js ***!
2230 5807 \****************************************************************/
2231 5808 /***/ ((module) => {
2232 5809
2233 -function _getPrototypeOf(t) {
2234 - return module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {
2235 - return t.__proto__ || Object.getPrototypeOf(t);
2236 - }, module.exports.__esModule = true, module.exports["default"] = module.exports, _getPrototypeOf(t);
5810 +function _getPrototypeOf(o) {
5811 + module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {
5812 + return o.__proto__ || Object.getPrototypeOf(o);
5813 + }, module.exports.__esModule = true, module.exports["default"] = module.exports;
5814 + return _getPrototypeOf(o);
2237 5815 }
2238 5816 module.exports = _getPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
2239 5817
2240 5818 /***/ }),
@@ -2245,19 +5823,23 @@
2245 5823 \**********************************************************/
2246 5824 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2247 5825
2248 5826 var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ "../node_modules/@babel/runtime/helpers/setPrototypeOf.js");
2249 -function _inherits(t, e) {
2250 - if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
2251 - t.prototype = Object.create(e && e.prototype, {
5827 +function _inherits(subClass, superClass) {
5828 + if (typeof superClass !== "function" && superClass !== null) {
5829 + throw new TypeError("Super expression must either be null or a function");
5830 + }
5831 + subClass.prototype = Object.create(superClass && superClass.prototype, {
2252 5832 constructor: {
2253 - value: t,
2254 - writable: !0,
2255 - configurable: !0
5833 + value: subClass,
5834 + writable: true,
5835 + configurable: true
2256 5836 }
2257 - }), Object.defineProperty(t, "prototype", {
2258 - writable: !1
2259 - }), e && setPrototypeOf(t, e);
5837 + });
5838 + Object.defineProperty(subClass, "prototype", {
5839 + writable: false
5840 + });
5841 + if (superClass) setPrototypeOf(subClass, superClass);
2260 5842 }
2261 5843 module.exports = _inherits, module.exports.__esModule = true, module.exports["default"] = module.exports;
2262 5844
2263 5845 /***/ }),
@@ -2267,11 +5849,11 @@
2267 5849 !*** ../node_modules/@babel/runtime/helpers/interopRequireDefault.js ***!
2268 5850 \***********************************************************************/
2269 5851 /***/ ((module) => {
2270 5852
2271 -function _interopRequireDefault(e) {
2272 - return e && e.__esModule ? e : {
2273 - "default": e
5853 +function _interopRequireDefault(obj) {
5854 + return obj && obj.__esModule ? obj : {
5855 + "default": obj
2274 5856 };
2275 5857 }
2276 5858 module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
2277 5859
@@ -2276,8 +5858,43 @@
2276 5858 module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports;
2277 5859
2278 5860 /***/ }),
2279 5861
5862 +/***/ "../node_modules/@babel/runtime/helpers/isNativeFunction.js":
5863 +/*!******************************************************************!*\
5864 + !*** ../node_modules/@babel/runtime/helpers/isNativeFunction.js ***!
5865 + \******************************************************************/
5866 +/***/ ((module) => {
5867 +
5868 +function _isNativeFunction(fn) {
5869 + try {
5870 + return Function.toString.call(fn).indexOf("[native code]") !== -1;
5871 + } catch (e) {
5872 + return typeof fn === "function";
5873 + }
5874 +}
5875 +module.exports = _isNativeFunction, module.exports.__esModule = true, module.exports["default"] = module.exports;
5876 +
5877 +/***/ }),
5878 +
5879 +/***/ "../node_modules/@babel/runtime/helpers/isNativeReflectConstruct.js":
5880 +/*!**************************************************************************!*\
5881 + !*** ../node_modules/@babel/runtime/helpers/isNativeReflectConstruct.js ***!
5882 + \**************************************************************************/
5883 +/***/ ((module) => {
5884 +
5885 +function _isNativeReflectConstruct() {
5886 + try {
5887 + var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
5888 + } catch (t) {}
5889 + return (module.exports = _isNativeReflectConstruct = function _isNativeReflectConstruct() {
5890 + return !!t;
5891 + }, module.exports.__esModule = true, module.exports["default"] = module.exports)();
5892 +}
5893 +module.exports = _isNativeReflectConstruct, module.exports.__esModule = true, module.exports["default"] = module.exports;
5894 +
5895 +/***/ }),
5896 +
2280 5897 /***/ "../node_modules/@babel/runtime/helpers/iterableToArray.js":
2281 5898 /*!*****************************************************************!*\
2282 5899 !*** ../node_modules/@babel/runtime/helpers/iterableToArray.js ***!
2283 5900 \*****************************************************************/
@@ -2282,10 +5899,10 @@
2282 5899 !*** ../node_modules/@babel/runtime/helpers/iterableToArray.js ***!
2283 5900 \*****************************************************************/
2284 5901 /***/ ((module) => {
2285 5902
2286 -function _iterableToArray(r) {
2287 - if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
5903 +function _iterableToArray(iter) {
5904 + if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
2288 5905 }
2289 5906 module.exports = _iterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
2290 5907
2291 5908 /***/ }),
@@ -2360,353 +5977,20 @@
2360 5977 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2361 5978
2362 5979 var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]);
2363 5980 var assertThisInitialized = __webpack_require__(/*! ./assertThisInitialized.js */ "../node_modules/@babel/runtime/helpers/assertThisInitialized.js");
2364 -function _possibleConstructorReturn(t, e) {
2365 - if (e && ("object" == _typeof(e) || "function" == typeof e)) return e;
2366 - if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
2367 - return assertThisInitialized(t);
5981 +function _possibleConstructorReturn(self, call) {
5982 + if (call && (_typeof(call) === "object" || typeof call === "function")) {
5983 + return call;
5984 + } else if (call !== void 0) {
5985 + throw new TypeError("Derived constructors may only return object or undefined");
5986 + }
5987 + return assertThisInitialized(self);
2368 5988 }
2369 5989 module.exports = _possibleConstructorReturn, module.exports.__esModule = true, module.exports["default"] = module.exports;
2370 5990
2371 5991 /***/ }),
2372 5992
2373 -/***/ "../node_modules/@babel/runtime/helpers/regenerator.js":
2374 -/*!*************************************************************!*\
2375 - !*** ../node_modules/@babel/runtime/helpers/regenerator.js ***!
2376 - \*************************************************************/
2377 -/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2378 -
2379 -var regeneratorDefine = __webpack_require__(/*! ./regeneratorDefine.js */ "../node_modules/@babel/runtime/helpers/regeneratorDefine.js");
2380 -function _regenerator() {
2381 - /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
2382 - var e,
2383 - t,
2384 - r = "function" == typeof Symbol ? Symbol : {},
2385 - n = r.iterator || "@@iterator",
2386 - o = r.toStringTag || "@@toStringTag";
2387 - function i(r, n, o, i) {
2388 - var c = n && n.prototype instanceof Generator ? n : Generator,
2389 - u = Object.create(c.prototype);
2390 - return regeneratorDefine(u, "_invoke", function (r, n, o) {
2391 - var i,
2392 - c,
2393 - u,
2394 - f = 0,
2395 - p = o || [],
2396 - y = !1,
2397 - G = {
2398 - p: 0,
2399 - n: 0,
2400 - v: e,
2401 - a: d,
2402 - f: d.bind(e, 4),
2403 - d: function d(t, r) {
2404 - return i = t, c = 0, u = e, G.n = r, a;
2405 - }
2406 - };
2407 - function d(r, n) {
2408 - for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) {
2409 - var o,
2410 - i = p[t],
2411 - d = G.p,
2412 - l = i[2];
2413 - 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));
2414 - }
2415 - if (o || r > 1) return a;
2416 - throw y = !0, n;
2417 - }
2418 - return function (o, p, l) {
2419 - if (f > 1) throw TypeError("Generator is already running");
2420 - for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) {
2421 - i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u);
2422 - try {
2423 - if (f = 2, i) {
2424 - if (c || (o = "next"), t = i[o]) {
2425 - if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object");
2426 - if (!t.done) return t;
2427 - u = t.value, c < 2 && (c = 0);
2428 - } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1);
2429 - i = e;
2430 - } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break;
2431 - } catch (t) {
2432 - i = e, c = 1, u = t;
2433 - } finally {
2434 - f = 1;
2435 - }
2436 - }
2437 - return {
2438 - value: t,
2439 - done: y
2440 - };
2441 - };
2442 - }(r, o, i), !0), u;
2443 - }
2444 - var a = {};
2445 - function Generator() {}
2446 - function GeneratorFunction() {}
2447 - function GeneratorFunctionPrototype() {}
2448 - t = Object.getPrototypeOf;
2449 - var c = [][n] ? t(t([][n]())) : (regeneratorDefine(t = {}, n, function () {
2450 - return this;
2451 - }), t),
2452 - u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c);
2453 - function f(e) {
2454 - return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, regeneratorDefine(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e;
2455 - }
2456 - 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 () {
2457 - return this;
2458 - }), regeneratorDefine(u, "toString", function () {
2459 - return "[object Generator]";
2460 - }), (module.exports = _regenerator = function _regenerator() {
2461 - return {
2462 - w: i,
2463 - m: f
2464 - };
2465 - }, module.exports.__esModule = true, module.exports["default"] = module.exports)();
2466 -}
2467 -module.exports = _regenerator, module.exports.__esModule = true, module.exports["default"] = module.exports;
2468 -
2469 -/***/ }),
2470 -
2471 -/***/ "../node_modules/@babel/runtime/helpers/regeneratorAsync.js":
2472 -/*!******************************************************************!*\
2473 - !*** ../node_modules/@babel/runtime/helpers/regeneratorAsync.js ***!
2474 - \******************************************************************/
2475 -/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2476 -
2477 -var regeneratorAsyncGen = __webpack_require__(/*! ./regeneratorAsyncGen.js */ "../node_modules/@babel/runtime/helpers/regeneratorAsyncGen.js");
2478 -function _regeneratorAsync(n, e, r, t, o) {
2479 - var a = regeneratorAsyncGen(n, e, r, t, o);
2480 - return a.next().then(function (n) {
2481 - return n.done ? n.value : a.next();
2482 - });
2483 -}
2484 -module.exports = _regeneratorAsync, module.exports.__esModule = true, module.exports["default"] = module.exports;
2485 -
2486 -/***/ }),
2487 -
2488 -/***/ "../node_modules/@babel/runtime/helpers/regeneratorAsyncGen.js":
2489 -/*!*********************************************************************!*\
2490 - !*** ../node_modules/@babel/runtime/helpers/regeneratorAsyncGen.js ***!
2491 - \*********************************************************************/
2492 -/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2493 -
2494 -var regenerator = __webpack_require__(/*! ./regenerator.js */ "../node_modules/@babel/runtime/helpers/regenerator.js");
2495 -var regeneratorAsyncIterator = __webpack_require__(/*! ./regeneratorAsyncIterator.js */ "../node_modules/@babel/runtime/helpers/regeneratorAsyncIterator.js");
2496 -function _regeneratorAsyncGen(r, e, t, o, n) {
2497 - return new regeneratorAsyncIterator(regenerator().w(r, e, t, o), n || Promise);
2498 -}
2499 -module.exports = _regeneratorAsyncGen, module.exports.__esModule = true, module.exports["default"] = module.exports;
2500 -
2501 -/***/ }),
2502 -
2503 -/***/ "../node_modules/@babel/runtime/helpers/regeneratorAsyncIterator.js":
2504 -/*!**************************************************************************!*\
2505 - !*** ../node_modules/@babel/runtime/helpers/regeneratorAsyncIterator.js ***!
2506 - \**************************************************************************/
2507 -/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2508 -
2509 -var OverloadYield = __webpack_require__(/*! ./OverloadYield.js */ "../node_modules/@babel/runtime/helpers/OverloadYield.js");
2510 -var regeneratorDefine = __webpack_require__(/*! ./regeneratorDefine.js */ "../node_modules/@babel/runtime/helpers/regeneratorDefine.js");
2511 -function AsyncIterator(t, e) {
2512 - function n(r, o, i, f) {
2513 - try {
2514 - var c = t[r](o),
2515 - u = c.value;
2516 - return u instanceof OverloadYield ? e.resolve(u.v).then(function (t) {
2517 - n("next", t, i, f);
2518 - }, function (t) {
2519 - n("throw", t, i, f);
2520 - }) : e.resolve(u).then(function (t) {
2521 - c.value = t, i(c);
2522 - }, function (t) {
2523 - return n("throw", t, i, f);
2524 - });
2525 - } catch (t) {
2526 - f(t);
2527 - }
2528 - }
2529 - var r;
2530 - this.next || (regeneratorDefine(AsyncIterator.prototype), regeneratorDefine(AsyncIterator.prototype, "function" == typeof Symbol && Symbol.asyncIterator || "@asyncIterator", function () {
2531 - return this;
2532 - })), regeneratorDefine(this, "_invoke", function (t, o, i) {
2533 - function f() {
2534 - return new e(function (e, r) {
2535 - n(t, i, e, r);
2536 - });
2537 - }
2538 - return r = r ? r.then(f, f) : f();
2539 - }, !0);
2540 -}
2541 -module.exports = AsyncIterator, module.exports.__esModule = true, module.exports["default"] = module.exports;
2542 -
2543 -/***/ }),
2544 -
2545 -/***/ "../node_modules/@babel/runtime/helpers/regeneratorDefine.js":
2546 -/*!*******************************************************************!*\
2547 - !*** ../node_modules/@babel/runtime/helpers/regeneratorDefine.js ***!
2548 - \*******************************************************************/
2549 -/***/ ((module) => {
2550 -
2551 -function _regeneratorDefine(e, r, n, t) {
2552 - var i = Object.defineProperty;
2553 - try {
2554 - i({}, "", {});
2555 - } catch (e) {
2556 - i = 0;
2557 - }
2558 - module.exports = _regeneratorDefine = function regeneratorDefine(e, r, n, t) {
2559 - function o(r, n) {
2560 - _regeneratorDefine(e, r, function (e) {
2561 - return this._invoke(r, n, e);
2562 - });
2563 - }
2564 - r ? i ? i(e, r, {
2565 - value: n,
2566 - enumerable: !t,
2567 - configurable: !t,
2568 - writable: !t
2569 - }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2));
2570 - }, module.exports.__esModule = true, module.exports["default"] = module.exports, _regeneratorDefine(e, r, n, t);
2571 -}
2572 -module.exports = _regeneratorDefine, module.exports.__esModule = true, module.exports["default"] = module.exports;
2573 -
2574 -/***/ }),
2575 -
2576 -/***/ "../node_modules/@babel/runtime/helpers/regeneratorKeys.js":
2577 -/*!*****************************************************************!*\
2578 - !*** ../node_modules/@babel/runtime/helpers/regeneratorKeys.js ***!
2579 - \*****************************************************************/
2580 -/***/ ((module) => {
2581 -
2582 -function _regeneratorKeys(e) {
2583 - var n = Object(e),
2584 - r = [];
2585 - for (var t in n) r.unshift(t);
2586 - return function e() {
2587 - for (; r.length;) if ((t = r.pop()) in n) return e.value = t, e.done = !1, e;
2588 - return e.done = !0, e;
2589 - };
2590 -}
2591 -module.exports = _regeneratorKeys, module.exports.__esModule = true, module.exports["default"] = module.exports;
2592 -
2593 -/***/ }),
2594 -
2595 -/***/ "../node_modules/@babel/runtime/helpers/regeneratorRuntime.js":
2596 -/*!********************************************************************!*\
2597 - !*** ../node_modules/@babel/runtime/helpers/regeneratorRuntime.js ***!
2598 - \********************************************************************/
2599 -/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2600 -
2601 -var OverloadYield = __webpack_require__(/*! ./OverloadYield.js */ "../node_modules/@babel/runtime/helpers/OverloadYield.js");
2602 -var regenerator = __webpack_require__(/*! ./regenerator.js */ "../node_modules/@babel/runtime/helpers/regenerator.js");
2603 -var regeneratorAsync = __webpack_require__(/*! ./regeneratorAsync.js */ "../node_modules/@babel/runtime/helpers/regeneratorAsync.js");
2604 -var regeneratorAsyncGen = __webpack_require__(/*! ./regeneratorAsyncGen.js */ "../node_modules/@babel/runtime/helpers/regeneratorAsyncGen.js");
2605 -var regeneratorAsyncIterator = __webpack_require__(/*! ./regeneratorAsyncIterator.js */ "../node_modules/@babel/runtime/helpers/regeneratorAsyncIterator.js");
2606 -var regeneratorKeys = __webpack_require__(/*! ./regeneratorKeys.js */ "../node_modules/@babel/runtime/helpers/regeneratorKeys.js");
2607 -var regeneratorValues = __webpack_require__(/*! ./regeneratorValues.js */ "../node_modules/@babel/runtime/helpers/regeneratorValues.js");
2608 -function _regeneratorRuntime() {
2609 - "use strict";
2610 -
2611 - var r = regenerator(),
2612 - e = r.m(_regeneratorRuntime),
2613 - t = (Object.getPrototypeOf ? Object.getPrototypeOf(e) : e.__proto__).constructor;
2614 - function n(r) {
2615 - var e = "function" == typeof r && r.constructor;
2616 - return !!e && (e === t || "GeneratorFunction" === (e.displayName || e.name));
2617 - }
2618 - var o = {
2619 - "throw": 1,
2620 - "return": 2,
2621 - "break": 3,
2622 - "continue": 3
2623 - };
2624 - function a(r) {
2625 - var e, t;
2626 - return function (n) {
2627 - e || (e = {
2628 - stop: function stop() {
2629 - return t(n.a, 2);
2630 - },
2631 - "catch": function _catch() {
2632 - return n.v;
2633 - },
2634 - abrupt: function abrupt(r, e) {
2635 - return t(n.a, o[r], e);
2636 - },
2637 - delegateYield: function delegateYield(r, o, a) {
2638 - return e.resultName = o, t(n.d, regeneratorValues(r), a);
2639 - },
2640 - finish: function finish(r) {
2641 - return t(n.f, r);
2642 - }
2643 - }, t = function t(r, _t, o) {
2644 - n.p = e.prev, n.n = e.next;
2645 - try {
2646 - return r(_t, o);
2647 - } finally {
2648 - e.next = n.n;
2649 - }
2650 - }), e.resultName && (e[e.resultName] = n.v, e.resultName = void 0), e.sent = n.v, e.next = n.n;
2651 - try {
2652 - return r.call(this, e);
2653 - } finally {
2654 - n.p = e.prev, n.n = e.next;
2655 - }
2656 - };
2657 - }
2658 - return (module.exports = _regeneratorRuntime = function _regeneratorRuntime() {
2659 - return {
2660 - wrap: function wrap(e, t, n, o) {
2661 - return r.w(a(e), t, n, o && o.reverse());
2662 - },
2663 - isGeneratorFunction: n,
2664 - mark: r.m,
2665 - awrap: function awrap(r, e) {
2666 - return new OverloadYield(r, e);
2667 - },
2668 - AsyncIterator: regeneratorAsyncIterator,
2669 - async: function async(r, e, t, o, u) {
2670 - return (n(e) ? regeneratorAsyncGen : regeneratorAsync)(a(r), e, t, o, u);
2671 - },
2672 - keys: regeneratorKeys,
2673 - values: regeneratorValues
2674 - };
2675 - }, module.exports.__esModule = true, module.exports["default"] = module.exports)();
2676 -}
2677 -module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;
2678 -
2679 -/***/ }),
2680 -
2681 -/***/ "../node_modules/@babel/runtime/helpers/regeneratorValues.js":
2682 -/*!*******************************************************************!*\
2683 - !*** ../node_modules/@babel/runtime/helpers/regeneratorValues.js ***!
2684 - \*******************************************************************/
2685 -/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2686 -
2687 -var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]);
2688 -function _regeneratorValues(e) {
2689 - if (null != e) {
2690 - var t = e["function" == typeof Symbol && Symbol.iterator || "@@iterator"],
2691 - r = 0;
2692 - if (t) return t.call(e);
2693 - if ("function" == typeof e.next) return e;
2694 - if (!isNaN(e.length)) return {
2695 - next: function next() {
2696 - return e && r >= e.length && (e = void 0), {
2697 - value: e && e[r++],
2698 - done: !e
2699 - };
2700 - }
2701 - };
2702 - }
2703 - throw new TypeError(_typeof(e) + " is not iterable");
2704 -}
2705 -module.exports = _regeneratorValues, module.exports.__esModule = true, module.exports["default"] = module.exports;
2706 -
2707 -/***/ }),
2708 -
2709 5993 /***/ "../node_modules/@babel/runtime/helpers/setPrototypeOf.js":
2710 5994 /*!****************************************************************!*\
2711 5995 !*** ../node_modules/@babel/runtime/helpers/setPrototypeOf.js ***!
2712 5996 \****************************************************************/
@@ -2711,12 +5995,14 @@
2711 5995 !*** ../node_modules/@babel/runtime/helpers/setPrototypeOf.js ***!
2712 5996 \****************************************************************/
2713 5997 /***/ ((module) => {
2714 5998
2715 -function _setPrototypeOf(t, e) {
2716 - return module.exports = _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {
2717 - return t.__proto__ = e, t;
2718 - }, module.exports.__esModule = true, module.exports["default"] = module.exports, _setPrototypeOf(t, e);
5999 +function _setPrototypeOf(o, p) {
6000 + module.exports = _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {
6001 + o.__proto__ = p;
6002 + return o;
6003 + }, module.exports.__esModule = true, module.exports["default"] = module.exports;
6004 + return _setPrototypeOf(o, p);
2719 6005 }
2720 6006 module.exports = _setPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports;
2721 6007
2722 6008 /***/ }),
@@ -2730,10 +6016,10 @@
2730 6016 var arrayWithHoles = __webpack_require__(/*! ./arrayWithHoles.js */ "../node_modules/@babel/runtime/helpers/arrayWithHoles.js");
2731 6017 var iterableToArrayLimit = __webpack_require__(/*! ./iterableToArrayLimit.js */ "../node_modules/@babel/runtime/helpers/iterableToArrayLimit.js");
2732 6018 var unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray.js */ "../node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js");
2733 6019 var nonIterableRest = __webpack_require__(/*! ./nonIterableRest.js */ "../node_modules/@babel/runtime/helpers/nonIterableRest.js");
2734 -function _slicedToArray(r, e) {
2735 - return arrayWithHoles(r) || iterableToArrayLimit(r, e) || unsupportedIterableToArray(r, e) || nonIterableRest();
6020 +function _slicedToArray(arr, i) {
6021 + return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();
2736 6022 }
2737 6023 module.exports = _slicedToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
2738 6024
2739 6025 /***/ }),
@@ -2744,11 +6030,14 @@
2744 6030 \***************************************************************/
2745 6031 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2746 6032
2747 6033 var getPrototypeOf = __webpack_require__(/*! ./getPrototypeOf.js */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js");
2748 -function _superPropBase(t, o) {
2749 - for (; !{}.hasOwnProperty.call(t, o) && null !== (t = getPrototypeOf(t)););
2750 - return t;
6034 +function _superPropBase(object, property) {
6035 + while (!Object.prototype.hasOwnProperty.call(object, property)) {
6036 + object = getPrototypeOf(object);
6037 + if (object === null) break;
6038 + }
6039 + return object;
2751 6040 }
2752 6041 module.exports = _superPropBase, module.exports.__esModule = true, module.exports["default"] = module.exports;
2753 6042
2754 6043 /***/ }),
@@ -2762,10 +6051,10 @@
2762 6051 var arrayWithoutHoles = __webpack_require__(/*! ./arrayWithoutHoles.js */ "../node_modules/@babel/runtime/helpers/arrayWithoutHoles.js");
2763 6052 var iterableToArray = __webpack_require__(/*! ./iterableToArray.js */ "../node_modules/@babel/runtime/helpers/iterableToArray.js");
2764 6053 var unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray.js */ "../node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js");
2765 6054 var nonIterableSpread = __webpack_require__(/*! ./nonIterableSpread.js */ "../node_modules/@babel/runtime/helpers/nonIterableSpread.js");
2766 -function _toConsumableArray(r) {
2767 - return arrayWithoutHoles(r) || iterableToArray(r) || unsupportedIterableToArray(r) || nonIterableSpread();
6055 +function _toConsumableArray(arr) {
6056 + return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread();
2768 6057 }
2769 6058 module.exports = _toConsumableArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
2770 6059
2771 6060 /***/ }),
@@ -2800,9 +6089,9 @@
2800 6089 var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]);
2801 6090 var toPrimitive = __webpack_require__(/*! ./toPrimitive.js */ "../node_modules/@babel/runtime/helpers/toPrimitive.js");
2802 6091 function toPropertyKey(t) {
2803 6092 var i = toPrimitive(t, "string");
2804 - return "symbol" == _typeof(i) ? i : i + "";
6093 + return "symbol" == _typeof(i) ? i : String(i);
2805 6094 }
2806 6095 module.exports = toPropertyKey, module.exports.__esModule = true, module.exports["default"] = module.exports;
2807 6096
2808 6097 /***/ }),
@@ -2815,13 +6104,13 @@
2815 6104
2816 6105 function _typeof(o) {
2817 6106 "@babel/helpers - typeof";
2818 6107
2819 - return module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
6108 + return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
2820 6109 return typeof o;
2821 6110 } : function (o) {
2822 6111 return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
2823 - }, module.exports.__esModule = true, module.exports["default"] = module.exports, _typeof(o);
6112 + }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(o);
2824 6113 }
2825 6114 module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
2826 6115
2827 6116 /***/ }),
@@ -2832,109 +6121,234 @@
2832 6121 \****************************************************************************/
2833 6122 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2834 6123
2835 6124 var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray.js */ "../node_modules/@babel/runtime/helpers/arrayLikeToArray.js");
2836 -function _unsupportedIterableToArray(r, a) {
2837 - if (r) {
2838 - if ("string" == typeof r) return arrayLikeToArray(r, a);
2839 - var t = {}.toString.call(r).slice(8, -1);
2840 - 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;
2841 - }
6125 +function _unsupportedIterableToArray(o, minLen) {
6126 + if (!o) return;
6127 + if (typeof o === "string") return arrayLikeToArray(o, minLen);
6128 + var n = Object.prototype.toString.call(o).slice(8, -1);
6129 + if (n === "Object" && o.constructor) n = o.constructor.name;
6130 + if (n === "Map" || n === "Set") return Array.from(o);
6131 + if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);
2842 6132 }
2843 6133 module.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports;
2844 6134
2845 6135 /***/ }),
2846 6136
2847 -/***/ "../node_modules/@babel/runtime/regenerator/index.js":
2848 -/*!***********************************************************!*\
2849 - !*** ../node_modules/@babel/runtime/regenerator/index.js ***!
2850 - \***********************************************************/
6137 +/***/ "../node_modules/@babel/runtime/helpers/wrapNativeSuper.js":
6138 +/*!*****************************************************************!*\
6139 + !*** ../node_modules/@babel/runtime/helpers/wrapNativeSuper.js ***!
6140 + \*****************************************************************/
2851 6141 /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
2852 6142
2853 -// TODO(Babel 8): Remove this file.
6143 +var getPrototypeOf = __webpack_require__(/*! ./getPrototypeOf.js */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js");
6144 +var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ "../node_modules/@babel/runtime/helpers/setPrototypeOf.js");
6145 +var isNativeFunction = __webpack_require__(/*! ./isNativeFunction.js */ "../node_modules/@babel/runtime/helpers/isNativeFunction.js");
6146 +var construct = __webpack_require__(/*! ./construct.js */ "../node_modules/@babel/runtime/helpers/construct.js");
6147 +function _wrapNativeSuper(Class) {
6148 + var _cache = typeof Map === "function" ? new Map() : undefined;
6149 + module.exports = _wrapNativeSuper = function _wrapNativeSuper(Class) {
6150 + if (Class === null || !isNativeFunction(Class)) return Class;
6151 + if (typeof Class !== "function") {
6152 + throw new TypeError("Super expression must either be null or a function");
6153 + }
6154 + if (typeof _cache !== "undefined") {
6155 + if (_cache.has(Class)) return _cache.get(Class);
6156 + _cache.set(Class, Wrapper);
6157 + }
6158 + function Wrapper() {
6159 + return construct(Class, arguments, getPrototypeOf(this).constructor);
6160 + }
6161 + Wrapper.prototype = Object.create(Class.prototype, {
6162 + constructor: {
6163 + value: Wrapper,
6164 + enumerable: false,
6165 + writable: true,
6166 + configurable: true
6167 + }
6168 + });
6169 + return setPrototypeOf(Wrapper, Class);
6170 + }, module.exports.__esModule = true, module.exports["default"] = module.exports;
6171 + return _wrapNativeSuper(Class);
6172 +}
6173 +module.exports = _wrapNativeSuper, module.exports.__esModule = true, module.exports["default"] = module.exports;
2854 6174
2855 -var runtime = __webpack_require__(/*! ../helpers/regeneratorRuntime */ "../node_modules/@babel/runtime/helpers/regeneratorRuntime.js")();
2856 -module.exports = runtime;
6175 +/***/ }),
2857 6176
2858 -// Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736=
2859 -try {
2860 - regeneratorRuntime = runtime;
2861 -} catch (accidentalStrictMode) {
2862 - if (typeof globalThis === "object") {
2863 - globalThis.regeneratorRuntime = runtime;
6177 +/***/ "../node_modules/@babel/runtime/helpers/esm/defineProperty.js":
6178 +/*!********************************************************************!*\
6179 + !*** ../node_modules/@babel/runtime/helpers/esm/defineProperty.js ***!
6180 + \********************************************************************/
6181 +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
6182 +
6183 +"use strict";
6184 +__webpack_require__.r(__webpack_exports__);
6185 +/* harmony export */ __webpack_require__.d(__webpack_exports__, {
6186 +/* harmony export */ "default": () => (/* binding */ _defineProperty)
6187 +/* harmony export */ });
6188 +/* harmony import */ var _toPropertyKey_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toPropertyKey.js */ "../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js");
6189 +
6190 +function _defineProperty(obj, key, value) {
6191 + key = (0,_toPropertyKey_js__WEBPACK_IMPORTED_MODULE_0__["default"])(key);
6192 + if (key in obj) {
6193 + Object.defineProperty(obj, key, {
6194 + value: value,
6195 + enumerable: true,
6196 + configurable: true,
6197 + writable: true
6198 + });
2864 6199 } else {
2865 - Function("r", "regeneratorRuntime = r")(runtime);
6200 + obj[key] = value;
2866 6201 }
6202 + return obj;
2867 6203 }
2868 6204
6205 +/***/ }),
2869 6206
6207 +/***/ "../node_modules/@babel/runtime/helpers/esm/objectSpread2.js":
6208 +/*!*******************************************************************!*\
6209 + !*** ../node_modules/@babel/runtime/helpers/esm/objectSpread2.js ***!
6210 + \*******************************************************************/
6211 +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
6212 +
6213 +"use strict";
6214 +__webpack_require__.r(__webpack_exports__);
6215 +/* harmony export */ __webpack_require__.d(__webpack_exports__, {
6216 +/* harmony export */ "default": () => (/* binding */ _objectSpread2)
6217 +/* harmony export */ });
6218 +/* harmony import */ var _defineProperty_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./defineProperty.js */ "../node_modules/@babel/runtime/helpers/esm/defineProperty.js");
6219 +
6220 +function ownKeys(e, r) {
6221 + var t = Object.keys(e);
6222 + if (Object.getOwnPropertySymbols) {
6223 + var o = Object.getOwnPropertySymbols(e);
6224 + r && (o = o.filter(function (r) {
6225 + return Object.getOwnPropertyDescriptor(e, r).enumerable;
6226 + })), t.push.apply(t, o);
6227 + }
6228 + return t;
6229 +}
6230 +function _objectSpread2(e) {
6231 + for (var r = 1; r < arguments.length; r++) {
6232 + var t = null != arguments[r] ? arguments[r] : {};
6233 + r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
6234 + (0,_defineProperty_js__WEBPACK_IMPORTED_MODULE_0__["default"])(e, r, t[r]);
6235 + }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
6236 + Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
6237 + });
6238 + }
6239 + return e;
6240 +}
6241 +
2870 6242 /***/ }),
2871 6243
2872 -/***/ "../node_modules/react-dom/client.js":
2873 -/*!*******************************************!*\
2874 - !*** ../node_modules/react-dom/client.js ***!
2875 - \*******************************************/
2876 -/***/ ((__unused_webpack_module, exports, __webpack_require__) => {
6244 +/***/ "../node_modules/@babel/runtime/helpers/esm/toPrimitive.js":
6245 +/*!*****************************************************************!*\
6246 + !*** ../node_modules/@babel/runtime/helpers/esm/toPrimitive.js ***!
6247 + \*****************************************************************/
6248 +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
2877 6249
2878 6250 "use strict";
6251 +__webpack_require__.r(__webpack_exports__);
6252 +/* harmony export */ __webpack_require__.d(__webpack_exports__, {
6253 +/* harmony export */ "default": () => (/* binding */ toPrimitive)
6254 +/* harmony export */ });
6255 +/* harmony import */ var _typeof_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/esm/typeof.js");
2879 6256
2880 -
2881 -var m = __webpack_require__(/*! react-dom */ "react-dom");
2882 -if (false) // removed by dead control flow
2883 -{} else {
2884 - var i = m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
2885 - exports.createRoot = function(c, o) {
2886 - i.usingClientEntryPoint = true;
2887 - try {
2888 - return m.createRoot(c, o);
2889 - } finally {
2890 - i.usingClientEntryPoint = false;
2891 - }
2892 - };
2893 - exports.hydrateRoot = function(c, h, o) {
2894 - i.usingClientEntryPoint = true;
2895 - try {
2896 - return m.hydrateRoot(c, h, o);
2897 - } finally {
2898 - i.usingClientEntryPoint = false;
2899 - }
2900 - };
6257 +function toPrimitive(t, r) {
6258 + if ("object" != (0,_typeof_js__WEBPACK_IMPORTED_MODULE_0__["default"])(t) || !t) return t;
6259 + var e = t[Symbol.toPrimitive];
6260 + if (void 0 !== e) {
6261 + var i = e.call(t, r || "default");
6262 + if ("object" != (0,_typeof_js__WEBPACK_IMPORTED_MODULE_0__["default"])(i)) return i;
6263 + throw new TypeError("@@toPrimitive must return a primitive value.");
6264 + }
6265 + return ("string" === r ? String : Number)(t);
2901 6266 }
2902 6267
2903 -
2904 6268 /***/ }),
2905 6269
2906 -/***/ "@wordpress/i18n":
2907 -/*!**************************!*\
2908 - !*** external "wp.i18n" ***!
2909 - \**************************/
2910 -/***/ ((module) => {
6270 +/***/ "../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js":
6271 +/*!*******************************************************************!*\
6272 + !*** ../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js ***!
6273 + \*******************************************************************/
6274 +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
2911 6275
2912 6276 "use strict";
2913 -module.exports = wp.i18n;
6277 +__webpack_require__.r(__webpack_exports__);
6278 +/* harmony export */ __webpack_require__.d(__webpack_exports__, {
6279 +/* harmony export */ "default": () => (/* binding */ toPropertyKey)
6280 +/* harmony export */ });
6281 +/* harmony import */ var _typeof_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/esm/typeof.js");
6282 +/* harmony import */ var _toPrimitive_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toPrimitive.js */ "../node_modules/@babel/runtime/helpers/esm/toPrimitive.js");
2914 6283
6284 +
6285 +function toPropertyKey(t) {
6286 + var i = (0,_toPrimitive_js__WEBPACK_IMPORTED_MODULE_1__["default"])(t, "string");
6287 + return "symbol" == (0,_typeof_js__WEBPACK_IMPORTED_MODULE_0__["default"])(i) ? i : String(i);
6288 +}
6289 +
2915 6290 /***/ }),
2916 6291
2917 -/***/ "react":
2918 -/*!************************!*\
2919 - !*** external "React" ***!
2920 - \************************/
2921 -/***/ ((module) => {
6292 +/***/ "../node_modules/@babel/runtime/helpers/esm/typeof.js":
6293 +/*!************************************************************!*\
6294 + !*** ../node_modules/@babel/runtime/helpers/esm/typeof.js ***!
6295 + \************************************************************/
6296 +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
2922 6297
2923 6298 "use strict";
2924 -module.exports = React;
6299 +__webpack_require__.r(__webpack_exports__);
6300 +/* harmony export */ __webpack_require__.d(__webpack_exports__, {
6301 +/* harmony export */ "default": () => (/* binding */ _typeof)
6302 +/* harmony export */ });
6303 +function _typeof(o) {
6304 + "@babel/helpers - typeof";
2925 6305
6306 + return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
6307 + return typeof o;
6308 + } : function (o) {
6309 + return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
6310 + }, _typeof(o);
6311 +}
6312 +
2926 6313 /***/ }),
2927 6314
2928 -/***/ "react-dom":
2929 -/*!***************************!*\
2930 - !*** external "ReactDOM" ***!
2931 - \***************************/
2932 -/***/ ((module) => {
6315 +/***/ "../node_modules/@reduxjs/toolkit/node_modules/immer/dist/immer.esm.mjs":
6316 +/*!******************************************************************************!*\
6317 + !*** ../node_modules/@reduxjs/toolkit/node_modules/immer/dist/immer.esm.mjs ***!
6318 + \******************************************************************************/
6319 +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
2933 6320
2934 6321 "use strict";
2935 -module.exports = ReactDOM;
6322 +__webpack_require__.r(__webpack_exports__);
6323 +/* harmony export */ __webpack_require__.d(__webpack_exports__, {
6324 +/* harmony export */ Immer: () => (/* binding */ un),
6325 +/* harmony export */ applyPatches: () => (/* binding */ pn),
6326 +/* harmony export */ castDraft: () => (/* binding */ K),
6327 +/* harmony export */ castImmutable: () => (/* binding */ $),
6328 +/* harmony export */ createDraft: () => (/* binding */ ln),
6329 +/* harmony export */ current: () => (/* binding */ R),
6330 +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
6331 +/* harmony export */ enableAllPlugins: () => (/* binding */ J),
6332 +/* harmony export */ enableES5: () => (/* binding */ F),
6333 +/* harmony export */ enableMapSet: () => (/* binding */ C),
6334 +/* harmony export */ enablePatches: () => (/* binding */ T),
6335 +/* harmony export */ finishDraft: () => (/* binding */ dn),
6336 +/* harmony export */ freeze: () => (/* binding */ d),
6337 +/* harmony export */ immerable: () => (/* binding */ L),
6338 +/* harmony export */ isDraft: () => (/* binding */ r),
6339 +/* harmony export */ isDraftable: () => (/* binding */ t),
6340 +/* harmony export */ nothing: () => (/* binding */ H),
6341 +/* harmony export */ original: () => (/* binding */ e),
6342 +/* harmony export */ produce: () => (/* binding */ fn),
6343 +/* harmony export */ produceWithPatches: () => (/* binding */ cn),
6344 +/* harmony export */ setAutoFreeze: () => (/* binding */ sn),
6345 +/* harmony export */ setUseProxies: () => (/* binding */ vn)
6346 +/* harmony export */ });
6347 +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);
6348 +//# sourceMappingURL=immer.esm.js.map
2936 6349
6350 +
2937 6351 /***/ })
2938 6352
2939 6353 /******/ });
2940 6354 /************************************************************************/
@@ -2962,10 +6376,51 @@
2962 6376 /******/ return module.exports;
2963 6377 /******/ }
2964 6378 /******/
2965 6379 /************************************************************************/
6380 +/******/ /* webpack/runtime/define property getters */
6381 +/******/ (() => {
6382 +/******/ // define getter functions for harmony exports
6383 +/******/ __webpack_require__.d = (exports, definition) => {
6384 +/******/ for(var key in definition) {
6385 +/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
6386 +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
6387 +/******/ }
6388 +/******/ }
6389 +/******/ };
6390 +/******/ })();
6391 +/******/
6392 +/******/ /* webpack/runtime/global */
6393 +/******/ (() => {
6394 +/******/ __webpack_require__.g = (function() {
6395 +/******/ if (typeof globalThis === 'object') return globalThis;
6396 +/******/ try {
6397 +/******/ return this || new Function('return this')();
6398 +/******/ } catch (e) {
6399 +/******/ if (typeof window === 'object') return window;
6400 +/******/ }
6401 +/******/ })();
6402 +/******/ })();
6403 +/******/
6404 +/******/ /* webpack/runtime/hasOwnProperty shorthand */
6405 +/******/ (() => {
6406 +/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
6407 +/******/ })();
6408 +/******/
6409 +/******/ /* webpack/runtime/make namespace object */
6410 +/******/ (() => {
6411 +/******/ // define __esModule on exports
6412 +/******/ __webpack_require__.r = (exports) => {
6413 +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
6414 +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
6415 +/******/ }
6416 +/******/ Object.defineProperty(exports, '__esModule', { value: true });
6417 +/******/ };
6418 +/******/ })();
6419 +/******/
6420 +/************************************************************************/
2966 6421 var __webpack_exports__ = {};
2967 -// This entry needs to be wrapped in an IIFE because it needs to be in strict mode.
6422 +// This entry need to be wrapped in an IIFE because it need to be in strict mode.
2968 6423 (() => {
2969 6424 "use strict";
2970 6425 /*!************************************************************!*\
2971 6426 !*** ../modules/atomic-widgets/assets/js/editor/module.js ***!
@@ -2974,56 +6429,28 @@
2974 6429
2975 6430 var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js");
2976 6431 var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js"));
2977 6432 var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js"));
6433 +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
2978 6434 var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js"));
2979 6435 var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"));
2980 -var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js"));
2981 6436 var _component = _interopRequireDefault(__webpack_require__(/*! ./component */ "../modules/atomic-widgets/assets/js/editor/component.js"));
2982 -var _atomicElementBaseType = _interopRequireDefault(__webpack_require__(/*! ./atomic-element-base-type */ "../modules/atomic-widgets/assets/js/editor/atomic-element-base-type.js"));
2983 -var _createAtomicElementBaseView = _interopRequireDefault(__webpack_require__(/*! ./create-atomic-element-base-view */ "../modules/atomic-widgets/assets/js/editor/create-atomic-element-base-view.js"));
2984 -var _atomicElementBaseModel = _interopRequireDefault(__webpack_require__(/*! ./atomic-element-base-model */ "../modules/atomic-widgets/assets/js/editor/atomic-element-base-model.js"));
2985 -var _createDivBlockType = _interopRequireDefault(__webpack_require__(/*! ./atomic-element-types/create-div-block-type */ "../modules/atomic-widgets/assets/js/editor/atomic-element-types/create-div-block-type.js"));
2986 -var _createFlexboxType = _interopRequireDefault(__webpack_require__(/*! ./atomic-element-types/create-flexbox-type */ "../modules/atomic-widgets/assets/js/editor/atomic-element-types/create-flexbox-type.js"));
2987 -var _createGridType = _interopRequireDefault(__webpack_require__(/*! ./atomic-element-types/create-grid-type */ "../modules/atomic-widgets/assets/js/editor/atomic-element-types/create-grid-type.js"));
2988 -function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
2989 -function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
6437 +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); }; }
6438 +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; } }
2990 6439 var Module = /*#__PURE__*/function (_elementorModules$edi) {
6440 + (0, _inherits2.default)(Module, _elementorModules$edi);
6441 + var _super = _createSuper(Module);
2991 6442 function Module() {
2992 6443 (0, _classCallCheck2.default)(this, Module);
2993 - return _callSuper(this, Module, arguments);
6444 + return _super.apply(this, arguments);
2994 6445 }
2995 - (0, _inherits2.default)(Module, _elementorModules$edi);
2996 - return (0, _createClass2.default)(Module, [{
6446 + (0, _createClass2.default)(Module, [{
2997 6447 key: "onInit",
2998 6448 value: function onInit() {
2999 6449 $e.components.register(new _component.default());
3000 - this.exposeAtomicElementClasses();
3001 - this.registerAtomicElements();
3002 6450 }
3003 - }, {
3004 - key: "exposeAtomicElementClasses",
3005 - value: function exposeAtomicElementClasses() {
3006 - elementor.modules.elements.types.AtomicElementBase = _atomicElementBaseType.default;
3007 - elementor.modules.elements.views.createAtomicElementBase = _createAtomicElementBaseView.default;
3008 - elementor.modules.elements.models.AtomicElementBase = _atomicElementBaseModel.default;
3009 - }
3010 - }, {
3011 - key: "registerAtomicElements",
3012 - value: function registerAtomicElements() {
3013 - this.registerAtomicElementTypeIfAbsent((0, _createDivBlockType.default)());
3014 - this.registerAtomicElementTypeIfAbsent((0, _createFlexboxType.default)());
3015 - this.registerAtomicElementTypeIfAbsent((0, _createGridType.default)());
3016 - }
3017 - }, {
3018 - key: "registerAtomicElementTypeIfAbsent",
3019 - value: function registerAtomicElementTypeIfAbsent(elementType) {
3020 - if (elementor.elementsManager.getElementTypeClass(elementType.getType())) {
3021 - return;
3022 - }
3023 - elementor.elementsManager.registerElementType(elementType);
3024 - }
3025 6451 }]);
6452 + return Module;
3026 6453 }(elementorModules.editor.utils.Module);
3027 6454 new Module();
3028 6455 })();
3029 6456