PluginProbe
Elementor Website Builder – more than just a page builder / 4.3.1
Elementor Website Builder – more than just a page builder v4.3.1
4.3.1 4.3.0 4.3.0-beta3 4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 4.0.8 All 454 releases
elementor / assets / js / common-modules.js

common-modules.js in Elementor Website Builder – more than just a page builder 4.3.1, at assets/js/common-modules.js

2,621 lines 82.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 (function(_reduxjs_toolkit) {
2
3 //#region \0rolldown/runtime.js
4 var __create = Object.create;
5 var __defProp = Object.defineProperty;
6 var __name = (target, value) => __defProp(target, "name", {
7 value,
8 configurable: true
9 });
10 var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
11 var __getOwnPropNames = Object.getOwnPropertyNames;
12 var __getProtoOf = Object.getPrototypeOf;
13 var __hasOwnProp = Object.prototype.hasOwnProperty;
14 var __esmMin = (fn, res, err) => () => {
15 if (err) throw err[0];
16 try {
17 return fn && (res = fn(fn = 0)), res;
18 } catch (e) {
19 throw err = [e], e;
20 }
21 };
22 var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
23 var __exportAll = (all, no_symbols) => {
24 let target = {};
25 for (var name in all) {
26 __defProp(target, name, {
27 get: all[name],
28 enumerable: true
29 });
30 }
31 if (!no_symbols) {
32 __defProp(target, Symbol.toStringTag, { value: "Module" });
33 }
34 return target;
35 };
36 var __copyProps = (to, from, except, desc) => {
37 if (from && typeof from === "object" || typeof from === "function") {
38 for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
39 key = keys[i];
40 if (!__hasOwnProp.call(to, key) && key !== except) {
41 __defProp(to, key, {
42 get: ((k) => from[k]).bind(null, key),
43 enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
44 });
45 }
46 }
47 }
48 return to;
49 };
50 var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
51 value: mod,
52 enumerable: true
53 }) : target, mod));
54
55 //#endregion
56
57 //#region node_modules/@babel/runtime/helpers/esm/typeof.js
58 function _typeof(o) {
59 "@babel/helpers - typeof";
60 return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
61 return typeof o;
62 } : function(o) {
63 return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
64 }, _typeof(o);
65 }
66 var init_typeof = __esmMin((() => {}));
67
68 //#endregion
69 //#region assets/dev/js/modules/imports/module.js
70 var require_module = /* @__PURE__ */ __commonJSMin(((exports, module) => {
71 init_typeof();
72 var Module = function Module() {
73 var $ = jQuery;
74 var instanceParams = arguments;
75 var self = this;
76 var events = {};
77 var settings;
78 var ensureClosureMethods = function ensureClosureMethods() {
79 $.each(self, function(methodName) {
80 var oldMethod = self[methodName];
81 if ("function" !== typeof oldMethod) return;
82 self[methodName] = function() {
83 return oldMethod.apply(self, arguments);
84 };
85 });
86 };
87 var initSettings = function initSettings() {
88 settings = self.getDefaultSettings();
89 var instanceSettings = instanceParams[0];
90 if (instanceSettings) $.extend(true, settings, instanceSettings);
91 };
92 var init = function init() {
93 self.__construct.apply(self, instanceParams);
94 ensureClosureMethods();
95 initSettings();
96 self.trigger("init");
97 };
98 this.getItems = function(items, itemKey) {
99 if (itemKey) {
100 var keyStack = itemKey.split(".");
101 var currentKey = keyStack.splice(0, 1);
102 if (!keyStack.length) return items[currentKey];
103 if (!items[currentKey]) return;
104 return this.getItems(items[currentKey], keyStack.join("."));
105 }
106 return items;
107 };
108 this.getSettings = function(setting) {
109 return this.getItems(settings, setting);
110 };
111 this.setSettings = function(settingKey, value, settingsContainer) {
112 if (!settingsContainer) settingsContainer = settings;
113 if ("object" === _typeof(settingKey)) {
114 $.extend(settingsContainer, settingKey);
115 return self;
116 }
117 var keyStack = settingKey.split(".");
118 var currentKey = keyStack.splice(0, 1);
119 if (!keyStack.length) {
120 settingsContainer[currentKey] = value;
121 return self;
122 }
123 if (!settingsContainer[currentKey]) settingsContainer[currentKey] = {};
124 return self.setSettings(keyStack.join("."), value, settingsContainer[currentKey]);
125 };
126 this.getErrorMessage = function(type, functionName) {
127 var message;
128 switch (type) {
129 case "forceMethodImplementation":
130 message = "The method '".concat(functionName, "' must to be implemented in the inheritor child.");
131 break;
132 default: message = "An error occurs";
133 }
134 return message;
135 };
136 this.forceMethodImplementation = function(functionName) {
137 throw new Error(this.getErrorMessage("forceMethodImplementation", functionName));
138 };
139 this.on = function(eventName, callback) {
140 if ("object" === _typeof(eventName)) {
141 $.each(eventName, function(singleEventName) {
142 self.on(singleEventName, this);
143 });
144 return self;
145 }
146 eventName.split(" ").forEach(function(singleEventName) {
147 if (!events[singleEventName]) events[singleEventName] = [];
148 events[singleEventName].push(callback);
149 });
150 return self;
151 };
152 this.off = function(eventName, callback) {
153 if (!events[eventName]) return self;
154 if (!callback) {
155 delete events[eventName];
156 return self;
157 }
158 var callbackIndex = events[eventName].indexOf(callback);
159 if (-1 !== callbackIndex) {
160 delete events[eventName][callbackIndex];
161 events[eventName] = events[eventName].filter(function(val) {
162 return val;
163 });
164 }
165 return self;
166 };
167 this.trigger = function(eventName) {
168 var methodName = "on" + eventName[0].toUpperCase() + eventName.slice(1);
169 var params = Array.prototype.slice.call(arguments, 1);
170 if (self[methodName]) self[methodName].apply(self, params);
171 var callbacks = events[eventName];
172 if (!callbacks) return self;
173 $.each(callbacks, function(index, callback) {
174 callback.apply(self, params);
175 });
176 return self;
177 };
178 init();
179 };
180 Module.prototype.__construct = function() {};
181 Module.prototype.getDefaultSettings = function() {
182 return {};
183 };
184 Module.prototype.getConstructorID = function() {
185 return this.constructor.name;
186 };
187 Module.extend = function(properties) {
188 var $ = jQuery;
189 var parent = this;
190 var child = function child() {
191 return parent.apply(this, arguments);
192 };
193 $.extend(child, parent);
194 child.prototype = Object.create($.extend({}, parent.prototype, properties));
195 child.prototype.constructor = child;
196 child.__super__ = parent.prototype;
197 return child;
198 };
199 module.exports = Module;
200 }));
201
202 //#endregion
203 //#region assets/dev/js/modules/imports/view-module.js
204 var import_module = /* @__PURE__ */ __toESM(require_module());
205 var view_module_default = import_module.default.extend({
206 elements: null,
207 getDefaultElements: function getDefaultElements() {
208 return {};
209 },
210 bindEvents: function bindEvents() {},
211 onInit: function onInit() {
212 this.initElements();
213 this.bindEvents();
214 },
215 initElements: function initElements() {
216 this.elements = this.getDefaultElements();
217 }
218 });
219
220 //#endregion
221 //#region node_modules/@babel/runtime/helpers/esm/classCallCheck.js
222 function _classCallCheck(a, n) {
223 if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function");
224 }
225
226 //#endregion
227 //#region node_modules/@babel/runtime/helpers/esm/toPrimitive.js
228 init_typeof();
229 function toPrimitive(t, r) {
230 if ("object" != _typeof(t) || !t) return t;
231 var e = t[Symbol.toPrimitive];
232 if (void 0 !== e) {
233 var i = e.call(t, r || "default");
234 if ("object" != _typeof(i)) return i;
235 throw new TypeError("@@toPrimitive must return a primitive value.");
236 }
237 return ("string" === r ? String : Number)(t);
238 }
239
240 //#endregion
241 //#region node_modules/@babel/runtime/helpers/esm/toPropertyKey.js
242 init_typeof();
243 function toPropertyKey(t) {
244 var i = toPrimitive(t, "string");
245 return "symbol" == _typeof(i) ? i : i + "";
246 }
247
248 //#endregion
249 //#region node_modules/@babel/runtime/helpers/esm/createClass.js
250 function _defineProperties(e, r) {
251 for (var t = 0; t < r.length; t++) {
252 var o = r[t];
253 o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, toPropertyKey(o.key), o);
254 }
255 }
256 function _createClass(e, r, t) {
257 return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e;
258 }
259
260 //#endregion
261 //#region node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js
262 function _assertThisInitialized(e) {
263 if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
264 return e;
265 }
266
267 //#endregion
268 //#region node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js
269 init_typeof();
270 function _possibleConstructorReturn(t, e) {
271 if (e && ("object" == _typeof(e) || "function" == typeof e)) return e;
272 if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined");
273 return _assertThisInitialized(t);
274 }
275
276 //#endregion
277 //#region node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js
278 function _getPrototypeOf(t) {
279 return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(t) {
280 return t.__proto__ || Object.getPrototypeOf(t);
281 }, _getPrototypeOf(t);
282 }
283
284 //#endregion
285 //#region node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js
286 function _setPrototypeOf(t, e) {
287 return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t, e) {
288 return t.__proto__ = e, t;
289 }, _setPrototypeOf(t, e);
290 }
291
292 //#endregion
293 //#region node_modules/@babel/runtime/helpers/esm/inherits.js
294 function _inherits(t, e) {
295 if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function");
296 t.prototype = Object.create(e && e.prototype, { constructor: {
297 value: t,
298 writable: !0,
299 configurable: !0
300 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e);
301 }
302
303 //#endregion
304 //#region node_modules/@babel/runtime/helpers/esm/superPropBase.js
305 function _superPropBase(t, o) {
306 for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t)););
307 return t;
308 }
309
310 //#endregion
311 //#region node_modules/@babel/runtime/helpers/esm/get.js
312 function _get() {
313 return _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function(e, t, r) {
314 var p = _superPropBase(e, t);
315 if (p) {
316 var n = Object.getOwnPropertyDescriptor(p, t);
317 return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value;
318 }
319 }, _get.apply(null, arguments);
320 }
321
322 //#endregion
323 //#region assets/dev/js/modules/imports/instance-type.js
324 function _superPropGet$1(t, o, e, r) {
325 var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e);
326 return 2 & r && "function" == typeof p ? function(t) {
327 return p.apply(e, t);
328 } : p;
329 }
330 __name(_superPropGet$1, "_superPropGet");
331 var InstanceType = /*#__PURE__*/ function() {
332 function InstanceType() {
333 var _this = this;
334 _classCallCheck(this, InstanceType);
335 var target = this instanceof InstanceType ? this.constructor : void 0;
336 var prototypes = [];
337 while (target.__proto__ && target.__proto__.name) {
338 prototypes.push(target.__proto__);
339 target = target.__proto__;
340 }
341 prototypes.reverse().forEach(function(proto) {
342 return _this instanceof proto;
343 });
344 }
345 return _createClass(InstanceType, null, [{
346 key: Symbol.hasInstance,
347 value: function value(target) {
348 /**
349 * This is function extending being called each time JS uses instanceOf, since babel use it each time it create new class
350 * its give's opportunity to mange capabilities of instanceOf operator.
351 * saving current class each time will give option later to handle instanceOf manually.
352 */
353 var result = _superPropGet$1(InstanceType, Symbol.hasInstance, this, 2)([target]);
354 if (target && !target.constructor.getInstanceType) return result;
355 if (target) {
356 if (!target.instanceTypes) target.instanceTypes = [];
357 if (!result) {
358 if (this.getInstanceType() === target.constructor.getInstanceType()) result = true;
359 }
360 if (result) {
361 var name = this.getInstanceType === InstanceType.getInstanceType ? "BaseInstanceType" : this.getInstanceType();
362 if (-1 === target.instanceTypes.indexOf(name)) target.instanceTypes.push(name);
363 }
364 }
365 if (!result && target) result = target.instanceTypes && Array.isArray(target.instanceTypes) && -1 !== target.instanceTypes.indexOf(this.getInstanceType());
366 return result;
367 }
368 }, {
369 key: "getInstanceType",
370 value: function getInstanceType() {
371 elementorModules.ForceMethodImplementation();
372 }
373 }]);
374 }();
375
376 //#endregion
377 //#region assets/dev/js/editor/utils/is-instanceof.js
378 function _createForOfIteratorHelper(r, e) {
379 var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
380 if (!t) {
381 if (Array.isArray(r) || (t = _unsupportedIterableToArray$1(r)) || e && r && "number" == typeof r.length) {
382 t && (r = t);
383 var _n = 0;
384 var F = function F() {};
385 return {
386 s: F,
387 n: function n() {
388 return _n >= r.length ? { done: !0 } : {
389 done: !1,
390 value: r[_n++]
391 };
392 },
393 e: function e(r) {
394 throw r;
395 },
396 f: F
397 };
398 }
399 throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
400 }
401 var o;
402 var a = !0;
403 var u = !1;
404 return {
405 s: function s() {
406 t = t.call(r);
407 },
408 n: function n() {
409 var r = t.next();
410 return a = r.done, r;
411 },
412 e: function e(r) {
413 u = !0, o = r;
414 },
415 f: function f() {
416 try {
417 a || null == t.return || t.return();
418 } finally {
419 if (u) throw o;
420 }
421 }
422 };
423 }
424 function _unsupportedIterableToArray$1(r, a) {
425 if (r) {
426 if ("string" == typeof r) return _arrayLikeToArray$1(r, a);
427 var t = {}.toString.call(r).slice(8, -1);
428 return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$1(r, a) : void 0;
429 }
430 }
431 __name(_unsupportedIterableToArray$1, "_unsupportedIterableToArray");
432 function _arrayLikeToArray$1(r, a) {
433 (null == a || a > r.length) && (a = r.length);
434 for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
435 return n;
436 }
437 __name(_arrayLikeToArray$1, "_arrayLikeToArray");
438 /**
439 * Some FileAPI objects such as FileList, DataTransferItem and DataTransferItemList has inconsistency with the retrieved
440 * object (from events, etc.) and the actual JavaScript object so a regular instanceof doesn't work. This function can
441 * check whether it's instanceof by using the objects constructor and prototype names.
442 *
443 * @param object
444 * @param constructors
445 * @return {boolean}
446 */
447 var is_instanceof_default = /* @__PURE__ */ __name((function(object, constructors) {
448 constructors = Array.isArray(constructors) ? constructors : [constructors];
449 var _iterator = _createForOfIteratorHelper(constructors);
450 var _step;
451 try {
452 for (_iterator.s(); !(_step = _iterator.n()).done;) {
453 var constructor = _step.value;
454 if (object.constructor.name === constructor.prototype[Symbol.toStringTag]) return true;
455 }
456 } catch (err) {
457 _iterator.e(err);
458 } finally {
459 _iterator.f();
460 }
461 return false;
462 }), "default");
463
464 //#endregion
465 //#region assets/dev/js/modules/imports/args-object.js
466 init_typeof();
467 function _callSuper$15(t, o, e) {
468 return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$16() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
469 }
470 __name(_callSuper$15, "_callSuper");
471 function _isNativeReflectConstruct$16() {
472 try {
473 var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
474 } catch (t) {}
475 return (_isNativeReflectConstruct$16 = function _isNativeReflectConstruct() {
476 return !!t;
477 })();
478 }
479 __name(_isNativeReflectConstruct$16, "_isNativeReflectConstruct");
480 var ArgsObject = /*#__PURE__*/ function(_InstanceType) {
481 /**
482 * Function constructor().
483 *
484 * Create ArgsObject.
485 *
486 * @param {{}} args
487 */
488 function ArgsObject(args) {
489 var _this;
490 _classCallCheck(this, ArgsObject);
491 _this = _callSuper$15(this, ArgsObject);
492 _this.args = args;
493 return _this;
494 }
495 /**
496 * Function requireArgument().
497 *
498 * Validate property in args.
499 *
500 * @param {string} property
501 * @param {{}} args
502 *
503 * @throws {Error}
504 */
505 _inherits(ArgsObject, _InstanceType);
506 return _createClass(ArgsObject, [
507 {
508 key: "requireArgument",
509 value: function requireArgument(property) {
510 var args = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this.args;
511 if (!Object.prototype.hasOwnProperty.call(args, property)) throw Error("".concat(property, " is required."));
512 }
513 },
514 {
515 key: "requireArgumentType",
516 value: function requireArgumentType(property, type) {
517 var args = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : this.args;
518 this.requireArgument(property, args);
519 if (_typeof(args[property]) !== type) throw Error("".concat(property, " invalid type: ").concat(type, "."));
520 }
521 },
522 {
523 key: "requireArgumentInstance",
524 value: function requireArgumentInstance(property, instance) {
525 var args = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : this.args;
526 this.requireArgument(property, args);
527 if (!(args[property] instanceof instance) && !is_instanceof_default(args[property], instance)) throw Error("".concat(property, " invalid instance."));
528 }
529 },
530 {
531 key: "requireArgumentConstructor",
532 value: function requireArgumentConstructor(property, type) {
533 var args = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : this.args;
534 this.requireArgument(property, args);
535 if (args[property].constructor.toString() !== type.prototype.constructor.toString()) throw Error("".concat(property, " invalid constructor type."));
536 }
537 }
538 ], [{
539 key: "getInstanceType",
540 value: function getInstanceType() {
541 return "ArgsObject";
542 }
543 }]);
544 }(InstanceType);
545
546 //#endregion
547 //#region assets/dev/js/modules/imports/utils/masonry.js
548 var masonry_default = view_module_default.extend({
549 getDefaultSettings: function getDefaultSettings() {
550 return {
551 container: null,
552 items: null,
553 columnsCount: 3,
554 verticalSpaceBetween: 30
555 };
556 },
557 getDefaultElements: function getDefaultElements() {
558 return {
559 $container: jQuery(this.getSettings("container")),
560 $items: jQuery(this.getSettings("items"))
561 };
562 },
563 run: function run() {
564 var heights = [];
565 var distanceFromTop = this.elements.$container.position().top;
566 var settings = this.getSettings();
567 var columnsCount = settings.columnsCount;
568 distanceFromTop += parseInt(this.elements.$container.css("margin-top"), 10);
569 this.elements.$items.each(function(index) {
570 var row = Math.floor(index / columnsCount);
571 var $item = jQuery(this);
572 var itemHeight = $item[0].getBoundingClientRect().height + settings.verticalSpaceBetween;
573 if (row) {
574 var itemPosition = $item.position();
575 var indexAtRow = index % columnsCount;
576 var pullHeight = itemPosition.top - distanceFromTop - heights[indexAtRow];
577 pullHeight -= parseInt($item.css("margin-top"), 10);
578 pullHeight *= -1;
579 $item.css("margin-top", pullHeight + "px");
580 heights[indexAtRow] += itemHeight;
581 } else heights.push(itemHeight);
582 });
583 }
584 });
585
586 //#endregion
587 //#region assets/dev/js/modules/imports/utils/scroll.js
588 var Scroll = /*#__PURE__*/ function() {
589 function Scroll() {
590 _classCallCheck(this, Scroll);
591 }
592 return _createClass(Scroll, null, [
593 {
594 key: "scrollObserver",
595 value: function scrollObserver(obj) {
596 var lastScrollY = 0;
597 var options = {
598 root: obj.root || null,
599 rootMargin: obj.offset || "0px",
600 threshold: function buildThresholds() {
601 var sensitivityPercentage = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 0;
602 var thresholds = [];
603 if (sensitivityPercentage > 0 && sensitivityPercentage <= 100) {
604 var increment = 100 / sensitivityPercentage;
605 for (var i = 0; i <= 100; i += increment) thresholds.push(i / 100);
606 } else thresholds.push(0);
607 return thresholds;
608 }(obj.sensitivity)
609 };
610 function handleIntersect(entries) {
611 var currentScrollY = entries[0].boundingClientRect.y;
612 var isInViewport = entries[0].isIntersecting;
613 var intersectionScrollDirection = currentScrollY < lastScrollY ? "down" : "up";
614 var scrollPercentage = Math.abs(parseFloat((entries[0].intersectionRatio * 100).toFixed(2)));
615 obj.callback({
616 sensitivity: obj.sensitivity,
617 isInViewport,
618 scrollPercentage,
619 intersectionScrollDirection
620 });
621 lastScrollY = currentScrollY;
622 }
623 return new IntersectionObserver(handleIntersect, options);
624 }
625 },
626 {
627 key: "getElementViewportPercentage",
628 value: function getElementViewportPercentage($element) {
629 var offsetObj = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
630 var elementOffset = $element[0].getBoundingClientRect();
631 var offsetStart = offsetObj.start || 0;
632 var offsetEnd = offsetObj.end || 0;
633 var windowStartOffset = window.innerHeight * offsetStart / 100;
634 var windowEndOffset = window.innerHeight * offsetEnd / 100;
635 var y1 = elementOffset.top - window.innerHeight;
636 var y2 = elementOffset.top + windowStartOffset + $element.height();
637 var startPosition = 0 - y1 + windowStartOffset;
638 var endPosition = y2 - y1 + windowEndOffset;
639 var percent = Math.max(0, Math.min(startPosition / endPosition, 1));
640 return parseFloat((percent * 100).toFixed(2));
641 }
642 },
643 {
644 key: "getPageScrollPercentage",
645 value: function getPageScrollPercentage() {
646 var offsetObj = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
647 var limitPageHeight = arguments.length > 1 ? arguments[1] : void 0;
648 var offsetStart = offsetObj.start || 0;
649 var offsetEnd = offsetObj.end || 0;
650 var initialPageHeight = limitPageHeight || document.documentElement.scrollHeight - document.documentElement.clientHeight;
651 var heightOffset = initialPageHeight * offsetStart / 100;
652 var pageRange = initialPageHeight + heightOffset + initialPageHeight * offsetEnd / 100;
653 return (document.documentElement.scrollTop + document.body.scrollTop + heightOffset) / pageRange * 100;
654 }
655 }
656 ]);
657 }();
658
659 //#endregion
660 //#region node_modules/@babel/runtime/helpers/esm/isNativeFunction.js
661 function _isNativeFunction(t) {
662 try {
663 return -1 !== Function.toString.call(t).indexOf("[native code]");
664 } catch (n) {
665 return "function" == typeof t;
666 }
667 }
668
669 //#endregion
670 //#region node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js
671 function _isNativeReflectConstruct$15() {
672 try {
673 var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
674 } catch (t) {}
675 return (_isNativeReflectConstruct$15 = function _isNativeReflectConstruct() {
676 return !!t;
677 })();
678 }
679 __name(_isNativeReflectConstruct$15, "_isNativeReflectConstruct");
680
681 //#endregion
682 //#region node_modules/@babel/runtime/helpers/esm/construct.js
683 function _construct(t, e, r) {
684 if (_isNativeReflectConstruct$15()) return Reflect.construct.apply(null, arguments);
685 var o = [null];
686 o.push.apply(o, e);
687 var p = new (t.bind.apply(t, o))();
688 return r && _setPrototypeOf(p, r.prototype), p;
689 }
690
691 //#endregion
692 //#region node_modules/@babel/runtime/helpers/esm/wrapNativeSuper.js
693 function _wrapNativeSuper(t) {
694 var r = "function" == typeof Map ? /* @__PURE__ */ new Map() : void 0;
695 return _wrapNativeSuper = function _wrapNativeSuper(t) {
696 if (null === t || !_isNativeFunction(t)) return t;
697 if ("function" != typeof t) throw new TypeError("Super expression must either be null or a function");
698 if (void 0 !== r) {
699 if (r.has(t)) return r.get(t);
700 r.set(t, Wrapper);
701 }
702 function Wrapper() {
703 return _construct(t, arguments, _getPrototypeOf(this).constructor);
704 }
705 return Wrapper.prototype = Object.create(t.prototype, { constructor: {
706 value: Wrapper,
707 enumerable: !1,
708 writable: !0,
709 configurable: !0
710 } }), _setPrototypeOf(Wrapper, t);
711 }, _wrapNativeSuper(t);
712 }
713
714 //#endregion
715 //#region assets/dev/js/modules/imports/force-method-implementation.js
716 function _callSuper$14(t, o, e) {
717 return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$14() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
718 }
719 __name(_callSuper$14, "_callSuper");
720 function _isNativeReflectConstruct$14() {
721 try {
722 var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
723 } catch (t) {}
724 return (_isNativeReflectConstruct$14 = function _isNativeReflectConstruct() {
725 return !!t;
726 })();
727 }
728 __name(_isNativeReflectConstruct$14, "_isNativeReflectConstruct");
729 var ForceMethodImplementation$1 = /*#__PURE__*/ function(_Error) {
730 function ForceMethodImplementation() {
731 var _this;
732 var info = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
733 var args = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
734 _classCallCheck(this, ForceMethodImplementation);
735 _this = _callSuper$14(this, ForceMethodImplementation, ["".concat(info.isStatic ? "static " : "").concat(info.fullName, "() should be implemented, please provide '").concat(info.functionName || info.fullName, "' functionality."), args]);
736 if (Object.keys(args).length) console.error(args);
737 Error.captureStackTrace(_this, ForceMethodImplementation);
738 return _this;
739 }
740 _inherits(ForceMethodImplementation, _Error);
741 return _createClass(ForceMethodImplementation);
742 }(/*#__PURE__*/ _wrapNativeSuper(Error));
743 var force_method_implementation_default$1 = /* @__PURE__ */ __name((function(args) {
744 var caller = Error().stack.split("\n")[2].trim();
745 var callerName = caller.startsWith("at new") ? "constructor" : caller.split(" ")[1];
746 var info = {};
747 info.functionName = callerName;
748 info.fullName = callerName;
749 if (info.functionName.includes(".")) {
750 var parts = info.functionName.split(".");
751 info.className = parts[0];
752 info.functionName = parts[1];
753 } else info.isStatic = true;
754 throw new ForceMethodImplementation$1(info, args);
755 }), "default");
756
757 //#endregion
758 //#region node_modules/@babel/runtime/helpers/esm/defineProperty.js
759 function _defineProperty(e, r, t) {
760 return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
761 value: t,
762 enumerable: !0,
763 configurable: !0,
764 writable: !0
765 }) : e[r] = t, e;
766 }
767
768 //#endregion
769 //#region app/modules/import-export-customization/assets/js/shared/utils/template-registry-helpers.js
770 function ownKeys$2(e, r) {
771 var t = Object.keys(e);
772 if (Object.getOwnPropertySymbols) {
773 var o = Object.getOwnPropertySymbols(e);
774 r && (o = o.filter(function(r) {
775 return Object.getOwnPropertyDescriptor(e, r).enumerable;
776 })), t.push.apply(t, o);
777 }
778 return t;
779 }
780 __name(ownKeys$2, "ownKeys");
781 function _objectSpread$2(e) {
782 for (var r = 1; r < arguments.length; r++) {
783 var t = null != arguments[r] ? arguments[r] : {};
784 r % 2 ? ownKeys$2(Object(t), !0).forEach(function(r) {
785 _defineProperty(e, r, t[r]);
786 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function(r) {
787 Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
788 });
789 }
790 return e;
791 }
792 __name(_objectSpread$2, "_objectSpread");
793 function createGetInitialState(exportGroup) {
794 var additionalProps = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
795 return function(data, parentInitialState) {
796 var isEnabled = parentInitialState;
797 if (data.hasOwnProperty("uploadedData")) {
798 var _elementorAppConfig;
799 isEnabled = false;
800 var templates = data.uploadedData.manifest.templates;
801 var exportGroups = ((_elementorAppConfig = elementorAppConfig) === null || _elementorAppConfig === void 0 || (_elementorAppConfig = _elementorAppConfig["import-export-customization"]) === null || _elementorAppConfig === void 0 ? void 0 : _elementorAppConfig.exportGroups) || {};
802 for (var templateId in templates) if (exportGroups[templates[templateId].doc_type] === exportGroup) {
803 isEnabled = true;
804 break;
805 }
806 }
807 return _objectSpread$2({ enabled: isEnabled }, additionalProps);
808 };
809 }
810
811 //#endregion
812 //#region node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
813 function _arrayLikeToArray(r, a) {
814 (null == a || a > r.length) && (a = r.length);
815 for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
816 return n;
817 }
818
819 //#endregion
820 //#region node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js
821 function _arrayWithoutHoles(r) {
822 if (Array.isArray(r)) return _arrayLikeToArray(r);
823 }
824
825 //#endregion
826 //#region node_modules/@babel/runtime/helpers/esm/iterableToArray.js
827 function _iterableToArray(r) {
828 if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
829 }
830
831 //#endregion
832 //#region node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
833 function _unsupportedIterableToArray(r, a) {
834 if (r) {
835 if ("string" == typeof r) return _arrayLikeToArray(r, a);
836 var t = {}.toString.call(r).slice(8, -1);
837 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;
838 }
839 }
840
841 //#endregion
842 //#region node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js
843 function _nonIterableSpread() {
844 throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
845 }
846
847 //#endregion
848 //#region node_modules/@babel/runtime/helpers/esm/toConsumableArray.js
849 function _toConsumableArray(r) {
850 return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
851 }
852
853 //#endregion
854 //#region node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js
855 function _objectWithoutPropertiesLoose(r, e) {
856 if (null == r) return {};
857 var t = {};
858 for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
859 if (-1 !== e.indexOf(n)) continue;
860 t[n] = r[n];
861 }
862 return t;
863 }
864
865 //#endregion
866 //#region node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js
867 function _objectWithoutProperties(e, t) {
868 if (null == e) return {};
869 var o;
870 var r;
871 var i = _objectWithoutPropertiesLoose(e, t);
872 if (Object.getOwnPropertySymbols) {
873 var n = Object.getOwnPropertySymbols(e);
874 for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
875 }
876 return i;
877 }
878
879 //#endregion
880 //#region app/modules/import-export-customization/assets/js/shared/registry/base.js
881 var _excluded = ["children"];
882 function ownKeys$1(e, r) {
883 var t = Object.keys(e);
884 if (Object.getOwnPropertySymbols) {
885 var o = Object.getOwnPropertySymbols(e);
886 r && (o = o.filter(function(r) {
887 return Object.getOwnPropertyDescriptor(e, r).enumerable;
888 })), t.push.apply(t, o);
889 }
890 return t;
891 }
892 __name(ownKeys$1, "ownKeys");
893 function _objectSpread$1(e) {
894 for (var r = 1; r < arguments.length; r++) {
895 var t = null != arguments[r] ? arguments[r] : {};
896 r % 2 ? ownKeys$1(Object(t), !0).forEach(function(r) {
897 _defineProperty(e, r, t[r]);
898 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function(r) {
899 Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
900 });
901 }
902 return e;
903 }
904 __name(_objectSpread$1, "_objectSpread");
905 var BaseRegistry = /*#__PURE__*/ function() {
906 function BaseRegistry() {
907 _classCallCheck(this, BaseRegistry);
908 this.sections = /* @__PURE__ */ new Map();
909 }
910 return _createClass(BaseRegistry, [
911 {
912 key: "register",
913 value: function register(section) {
914 var _this = this;
915 if (!section.key || !section.title) throw new Error("Template type must have key and title");
916 var formattedSection = this.get(section.key) || this.formatSection(section);
917 if (section.children) if (formattedSection.children) {
918 var existingChildrenMap = new Map(formattedSection.children.map(function(child) {
919 return [child.key, child];
920 }));
921 section.children.forEach(function(childSection) {
922 var formattedChild = _this.formatSection(childSection);
923 existingChildrenMap.set(childSection.key, formattedChild);
924 });
925 formattedSection.children = Array.from(existingChildrenMap.values());
926 } else formattedSection.children = section.children.map(function(childSection) {
927 return _this.formatSection(childSection);
928 });
929 this.sections.set(section.key, formattedSection);
930 }
931 },
932 {
933 key: "formatSection",
934 value: function formatSection(_ref) {
935 _ref.children;
936 var section = _objectWithoutProperties(_ref, _excluded);
937 return _objectSpread$1({
938 key: section.key,
939 title: section.title,
940 description: section.description || "",
941 useParentDefault: section.useParentDefault !== false,
942 getInitialState: section.getInitialState || null,
943 component: section.component || null,
944 order: section.order || 10,
945 isAvailable: section.isAvailable || function() {
946 return true;
947 }
948 }, section);
949 }
950 },
951 {
952 key: "getAll",
953 value: function getAll() {
954 return Array.from(this.sections.values()).filter(function(type) {
955 return type.isAvailable();
956 }).map(function(type) {
957 if (type.children) return _objectSpread$1(_objectSpread$1({}, type), {}, { children: _toConsumableArray(type.children).sort(function(a, b) {
958 return a.order - b.order;
959 }) });
960 return type;
961 }).sort(function(a, b) {
962 return a.order - b.order;
963 });
964 }
965 },
966 {
967 key: "get",
968 value: function get(key) {
969 return this.sections.get(key);
970 }
971 }
972 ]);
973 }();
974
975 //#endregion
976 //#region app/modules/import-export-customization/assets/js/shared/registry/customization-dialogs.js
977 var customizationDialogsRegistry = new BaseRegistry();
978
979 //#endregion
980 //#region assets/dev/js/modules/modules.js
981 var baseModules = {
982 Module: import_module.default,
983 ViewModule: view_module_default,
984 ArgsObject,
985 ForceMethodImplementation: force_method_implementation_default$1,
986 utils: {
987 Masonry: masonry_default,
988 Scroll
989 },
990 importExport: {
991 createGetInitialState,
992 customizationDialogsRegistry
993 }
994 };
995 if (!window.elementorModules) window.elementorModules = baseModules;
996 else Object.assign(window.elementorModules, baseModules);
997 var modules_default = window.elementorModules;
998
999 //#endregion
1000 //#region core/common/assets/js/views/modal/header.js
1001 function _callSuper$13(t, o, e) {
1002 return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$13() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
1003 }
1004 __name(_callSuper$13, "_callSuper");
1005 function _isNativeReflectConstruct$13() {
1006 try {
1007 var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
1008 } catch (t) {}
1009 return (_isNativeReflectConstruct$13 = function _isNativeReflectConstruct() {
1010 return !!t;
1011 })();
1012 }
1013 __name(_isNativeReflectConstruct$13, "_isNativeReflectConstruct");
1014 var _default$3 = /*#__PURE__*/ function(_Marionette$LayoutVie) {
1015 function _default() {
1016 _classCallCheck(this, _default);
1017 return _callSuper$13(this, _default, arguments);
1018 }
1019 _inherits(_default, _Marionette$LayoutVie);
1020 return _createClass(_default, [
1021 {
1022 key: "tagName",
1023 value: function tagName() {
1024 return "header";
1025 }
1026 },
1027 {
1028 key: "className",
1029 value: function className() {
1030 return "elementor-templates-modal__header";
1031 }
1032 },
1033 {
1034 key: "getTemplate",
1035 value: function getTemplate() {
1036 return "#tmpl-elementor-templates-modal__header";
1037 }
1038 },
1039 {
1040 key: "regions",
1041 value: function regions() {
1042 return {
1043 logoArea: ".elementor-templates-modal__header__logo-area",
1044 tools: "#elementor-template-library-header-tools",
1045 menuArea: ".elementor-templates-modal__header__menu-area"
1046 };
1047 }
1048 },
1049 {
1050 key: "ui",
1051 value: function ui() {
1052 return { closeModal: ".elementor-templates-modal__header__close" };
1053 }
1054 },
1055 {
1056 key: "events",
1057 value: function events() {
1058 return { "click @ui.closeModal": "onCloseModalClick" };
1059 }
1060 },
1061 {
1062 key: "onRender",
1063 value: function onRender() {
1064 this.bindEscapeKey();
1065 }
1066 },
1067 {
1068 key: "bindEscapeKey",
1069 value: function bindEscapeKey() {
1070 var _this = this;
1071 this.onDocumentKeyDown = function(event) {
1072 if ("Escape" === event.key) _this.onCloseModalClick();
1073 };
1074 document.addEventListener("keydown", this.onDocumentKeyDown);
1075 }
1076 },
1077 {
1078 key: "onDestroy",
1079 value: function onDestroy() {
1080 if (this.onDocumentKeyDown) document.removeEventListener("keydown", this.onDocumentKeyDown);
1081 }
1082 },
1083 {
1084 key: "templateHelpers",
1085 value: function templateHelpers() {
1086 return { closeType: this.getOption("closeType") };
1087 }
1088 },
1089 {
1090 key: "onCloseModalClick",
1091 value: function onCloseModalClick() {
1092 this._parent._parent._parent.hideModal();
1093 var documentType = this.getDocumentType();
1094 var customEvent = new CustomEvent("core/modal/close/".concat(documentType));
1095 window.dispatchEvent(customEvent);
1096 if (this.isFloatingButtonLibraryClose()) {
1097 $e.internal("document/save/set-is-modified", { status: false });
1098 window.location.href = elementor.config.admin_floating_button_admin_url;
1099 }
1100 }
1101 },
1102 {
1103 key: "getDocumentType",
1104 value: function getDocumentType() {
1105 var _elementor$config$doc;
1106 var _elementor;
1107 var DEFAULT_TYPE = "default";
1108 if ("undefined" === typeof window.elementor) return DEFAULT_TYPE;
1109 return (_elementor$config$doc = (_elementor = elementor) === null || _elementor === void 0 || (_elementor = _elementor.config) === null || _elementor === void 0 || (_elementor = _elementor.document) === null || _elementor === void 0 ? void 0 : _elementor.type) !== null && _elementor$config$doc !== void 0 ? _elementor$config$doc : DEFAULT_TYPE;
1110 }
1111 },
1112 {
1113 key: "isFloatingButtonLibraryClose",
1114 value: function isFloatingButtonLibraryClose() {
1115 var _elementor$config;
1116 var _elementor$config2;
1117 return window.elementor && ((_elementor$config = elementor.config) === null || _elementor$config === void 0 ? void 0 : _elementor$config.admin_floating_button_admin_url) && "floating-buttons" === ((_elementor$config2 = elementor.config) === null || _elementor$config2 === void 0 || (_elementor$config2 = _elementor$config2.document) === null || _elementor$config2 === void 0 ? void 0 : _elementor$config2.type) && (this.$el.closest(".dialog-lightbox-widget-content").find(".elementor-template-library-template-floating_button").length || this.$el.closest(".dialog-lightbox-widget-content").find("#elementor-template-library-preview").length || this.$el.closest(".dialog-lightbox-widget-content").find("#elementor-template-library-templates-empty").length);
1118 }
1119 }
1120 ]);
1121 }(Marionette.LayoutView);
1122
1123 //#endregion
1124 //#region core/common/assets/js/views/modal/logo.js
1125 function _callSuper$12(t, o, e) {
1126 return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$12() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
1127 }
1128 __name(_callSuper$12, "_callSuper");
1129 function _isNativeReflectConstruct$12() {
1130 try {
1131 var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
1132 } catch (t) {}
1133 return (_isNativeReflectConstruct$12 = function _isNativeReflectConstruct() {
1134 return !!t;
1135 })();
1136 }
1137 __name(_isNativeReflectConstruct$12, "_isNativeReflectConstruct");
1138 var _default$2 = /*#__PURE__*/ function(_Marionette$ItemView) {
1139 function _default() {
1140 _classCallCheck(this, _default);
1141 return _callSuper$12(this, _default, arguments);
1142 }
1143 _inherits(_default, _Marionette$ItemView);
1144 return _createClass(_default, [
1145 {
1146 key: "getTemplate",
1147 value: function getTemplate() {
1148 return "#tmpl-elementor-templates-modal__header__logo";
1149 }
1150 },
1151 {
1152 key: "className",
1153 value: function className() {
1154 return "elementor-templates-modal__header__logo";
1155 }
1156 },
1157 {
1158 key: "events",
1159 value: function events() {
1160 return { click: "onClick" };
1161 }
1162 },
1163 {
1164 key: "templateHelpers",
1165 value: function templateHelpers() {
1166 return { title: this.getOption("title") };
1167 }
1168 },
1169 {
1170 key: "onClick",
1171 value: function onClick() {
1172 var clickCallback = this.getOption("click");
1173 if (clickCallback) clickCallback();
1174 }
1175 }
1176 ]);
1177 }(Marionette.ItemView);
1178
1179 //#endregion
1180 //#region core/common/assets/js/views/modal/loading.js
1181 function _callSuper$11(t, o, e) {
1182 return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$11() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
1183 }
1184 __name(_callSuper$11, "_callSuper");
1185 function _isNativeReflectConstruct$11() {
1186 try {
1187 var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
1188 } catch (t) {}
1189 return (_isNativeReflectConstruct$11 = function _isNativeReflectConstruct() {
1190 return !!t;
1191 })();
1192 }
1193 __name(_isNativeReflectConstruct$11, "_isNativeReflectConstruct");
1194 var _default$1 = /*#__PURE__*/ function(_Marionette$ItemView) {
1195 function _default() {
1196 _classCallCheck(this, _default);
1197 return _callSuper$11(this, _default, arguments);
1198 }
1199 _inherits(_default, _Marionette$ItemView);
1200 return _createClass(_default, [{
1201 key: "id",
1202 value: function id() {
1203 return "elementor-template-library-loading";
1204 }
1205 }, {
1206 key: "getTemplate",
1207 value: function getTemplate() {
1208 return "#tmpl-elementor-template-library-loading";
1209 }
1210 }]);
1211 }(Marionette.ItemView);
1212
1213 //#endregion
1214 //#region core/common/assets/js/views/modal/layout.js
1215 function _callSuper$10(t, o, e) {
1216 return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$10() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
1217 }
1218 __name(_callSuper$10, "_callSuper");
1219 function _isNativeReflectConstruct$10() {
1220 try {
1221 var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
1222 } catch (t) {}
1223 return (_isNativeReflectConstruct$10 = function _isNativeReflectConstruct() {
1224 return !!t;
1225 })();
1226 }
1227 __name(_isNativeReflectConstruct$10, "_isNativeReflectConstruct");
1228 var _default = /*#__PURE__*/ function(_Marionette$LayoutVie) {
1229 function _default() {
1230 _classCallCheck(this, _default);
1231 return _callSuper$10(this, _default, arguments);
1232 }
1233 _inherits(_default, _Marionette$LayoutVie);
1234 return _createClass(_default, [
1235 {
1236 key: "el",
1237 value: function el() {
1238 return this.getModal().getElements("widget");
1239 }
1240 },
1241 {
1242 key: "regions",
1243 value: function regions() {
1244 return {
1245 modalHeader: ".dialog-header",
1246 modalContent: ".dialog-lightbox-content",
1247 modalLoading: ".dialog-lightbox-loading"
1248 };
1249 }
1250 },
1251 {
1252 key: "initialize",
1253 value: function initialize() {
1254 this.modalHeader.show(new _default$3(this.getHeaderOptions()));
1255 }
1256 },
1257 {
1258 key: "getModal",
1259 value: function getModal() {
1260 if (!this.modal) this.initModal();
1261 return this.modal;
1262 }
1263 },
1264 {
1265 key: "initModal",
1266 value: function initModal() {
1267 var modalOptions = {
1268 className: "elementor-templates-modal",
1269 closeButton: false,
1270 draggable: false,
1271 hide: {
1272 onOutsideClick: false,
1273 onEscKeyPress: false
1274 }
1275 };
1276 jQuery.extend(true, modalOptions, this.getModalOptions());
1277 this.modal = elementorCommon.dialogsManager.createWidget("lightbox", modalOptions);
1278 this.modal.getElements("message").append(this.modal.addElement("content"), this.modal.addElement("loading"));
1279 if (modalOptions.draggable) this.draggableModal();
1280 }
1281 },
1282 {
1283 key: "showModal",
1284 value: function showModal() {
1285 this.getModal().show();
1286 }
1287 },
1288 {
1289 key: "hideModal",
1290 value: function hideModal() {
1291 this.getModal().hide();
1292 }
1293 },
1294 {
1295 key: "draggableModal",
1296 value: function draggableModal() {
1297 var $modalWidgetContent = this.getModal().getElements("widgetContent");
1298 $modalWidgetContent.draggable({
1299 containment: "parent",
1300 stop: function stop() {
1301 $modalWidgetContent.height("");
1302 }
1303 });
1304 $modalWidgetContent.css("position", "absolute");
1305 }
1306 },
1307 {
1308 key: "getModalOptions",
1309 value: function getModalOptions() {
1310 return {};
1311 }
1312 },
1313 {
1314 key: "getLogoOptions",
1315 value: function getLogoOptions() {
1316 return {};
1317 }
1318 },
1319 {
1320 key: "getHeaderOptions",
1321 value: function getHeaderOptions() {
1322 return { closeType: "normal" };
1323 }
1324 },
1325 {
1326 key: "getHeaderView",
1327 value: function getHeaderView() {
1328 return this.modalHeader.currentView;
1329 }
1330 },
1331 {
1332 key: "showLoadingView",
1333 value: function showLoadingView() {
1334 this.modalLoading.show(new _default$1());
1335 this.modalLoading.$el.show();
1336 this.modalContent.$el.hide();
1337 }
1338 },
1339 {
1340 key: "hideLoadingView",
1341 value: function hideLoadingView() {
1342 this.modalContent.$el.show();
1343 this.modalLoading.$el.hide();
1344 }
1345 },
1346 {
1347 key: "showLogo",
1348 value: function showLogo() {
1349 this.getHeaderView().logoArea.show(new _default$2(this.getLogoOptions()));
1350 }
1351 }
1352 ]);
1353 }(Marionette.LayoutView);
1354
1355 //#endregion
1356 //#region node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js
1357 function _arrayWithHoles(r) {
1358 if (Array.isArray(r)) return r;
1359 }
1360
1361 //#endregion
1362 //#region node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js
1363 function _iterableToArrayLimit(r, l) {
1364 var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
1365 if (null != t) {
1366 var e;
1367 var n;
1368 var i;
1369 var u;
1370 var a = [];
1371 var f = !0;
1372 var o = !1;
1373 try {
1374 if (i = (t = t.call(r)).next, 0 === l) {
1375 if (Object(t) !== t) return;
1376 f = !1;
1377 } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
1378 } catch (r) {
1379 o = !0, n = r;
1380 } finally {
1381 try {
1382 if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
1383 } finally {
1384 if (o) throw n;
1385 }
1386 }
1387 return a;
1388 }
1389 }
1390
1391 //#endregion
1392 //#region node_modules/@babel/runtime/helpers/esm/nonIterableRest.js
1393 function _nonIterableRest() {
1394 throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
1395 }
1396
1397 //#endregion
1398 //#region node_modules/@babel/runtime/helpers/esm/slicedToArray.js
1399 function _slicedToArray(r, e) {
1400 return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
1401 }
1402
1403 //#endregion
1404 //#region modules/web-cli/assets/js/utils/console.js
1405 var Console = /*#__PURE__*/ function() {
1406 function Console() {
1407 _classCallCheck(this, Console);
1408 }
1409 return _createClass(Console, null, [{
1410 key: "error",
1411 value: function error(message) {
1412 if ($e.devTools) $e.devTools.log.error(message);
1413 if (!(message instanceof $e.modules.HookBreak)) console.error(message);
1414 }
1415 }, {
1416 key: "warn",
1417 value: function warn() {
1418 var _console;
1419 var style = "font-size: 12px; background-image: url(\"".concat(elementorWebCliConfig.urls.assets, "images/logo-icon.png\"); background-repeat: no-repeat; background-size: contain;");
1420 for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key];
1421 args.unshift("%c %c", style, "");
1422 (_console = console).warn.apply(_console, args);
1423 }
1424 }]);
1425 }();
1426
1427 //#endregion
1428 //#region modules/web-cli/assets/js/utils/deprecation.js
1429 /**
1430 * @typedef {Object} Version
1431 * @property {number} major1 The first number
1432 * @property {number} major2 The second number
1433 * @property {number} minor The third number
1434 * @property {string} build The fourth number
1435 */
1436 var softDeprecated = function softDeprecated(name, version, replacement) {
1437 if (elementorWebCliConfig.isDebug) deprecatedMessage("soft", name, version, replacement);
1438 };
1439 var hardDeprecated = function hardDeprecated(name, version, replacement) {
1440 deprecatedMessage("hard", name, version, replacement);
1441 };
1442 var deprecatedMessage = function deprecatedMessage(type, name, version, replacement) {
1443 var message = "`".concat(name, "` is ").concat(type, " deprecated since ").concat(version);
1444 if (replacement) message += " - Use `".concat(replacement, "` instead");
1445 Console.warn(message);
1446 };
1447 var Deprecation = /*#__PURE__*/ function() {
1448 function Deprecation() {
1449 _classCallCheck(this, Deprecation);
1450 }
1451 return _createClass(Deprecation, null, [
1452 {
1453 key: "deprecated",
1454 value: function deprecated(name, version, replacement) {
1455 if (this.isHardDeprecated(version)) hardDeprecated(name, version, replacement);
1456 else softDeprecated(name, version, replacement);
1457 }
1458 },
1459 {
1460 key: "parseVersion",
1461 value: function parseVersion(version) {
1462 var versionParts = version.split(".");
1463 if (versionParts.length < 3 || versionParts.length > 4) throw new RangeError("Invalid Semantic Version string provided");
1464 var _versionParts = _slicedToArray(versionParts, 4);
1465 var major1 = _versionParts[0];
1466 var major2 = _versionParts[1];
1467 var minor = _versionParts[2];
1468 var _versionParts$ = _versionParts[3];
1469 return {
1470 major1: parseInt(major1),
1471 major2: parseInt(major2),
1472 minor: parseInt(minor),
1473 build: _versionParts$ === void 0 ? "" : _versionParts$
1474 };
1475 }
1476 },
1477 {
1478 key: "getTotalMajor",
1479 value: function getTotalMajor(versionObj) {
1480 var total = parseInt("".concat(versionObj.major1).concat(versionObj.major2, "0"));
1481 total = Number((total / 10).toFixed(0));
1482 if (versionObj.major2 > 9) total = versionObj.major2 - 9;
1483 return total;
1484 }
1485 },
1486 {
1487 key: "compareVersion",
1488 value: function compareVersion(version1, version2) {
1489 var _this = this;
1490 return [this.parseVersion(version1), this.parseVersion(version2)].map(function(versionObj) {
1491 return _this.getTotalMajor(versionObj);
1492 }).reduce(function(acc, major) {
1493 return acc - major;
1494 });
1495 }
1496 },
1497 {
1498 key: "isSoftDeprecated",
1499 value: function isSoftDeprecated(version) {
1500 return this.compareVersion(version, elementorWebCliConfig.version) <= 4;
1501 }
1502 },
1503 {
1504 key: "isHardDeprecated",
1505 value: function isHardDeprecated(version) {
1506 var total = this.compareVersion(version, elementorWebCliConfig.version);
1507 return total < 0 || total >= 8;
1508 }
1509 }
1510 ]);
1511 }();
1512
1513 //#endregion
1514 //#region modules/web-cli/assets/js/modules/command-infra.js
1515 function _callSuper$9(t, o, e) {
1516 return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$9() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
1517 }
1518 __name(_callSuper$9, "_callSuper");
1519 function _isNativeReflectConstruct$9() {
1520 try {
1521 var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
1522 } catch (t) {}
1523 return (_isNativeReflectConstruct$9 = function _isNativeReflectConstruct() {
1524 return !!t;
1525 })();
1526 }
1527 __name(_isNativeReflectConstruct$9, "_isNativeReflectConstruct");
1528 /**
1529 * @typedef {import('../modules/component-base')} ComponentBase
1530 */
1531 var CommandInfra = /*#__PURE__*/ function(_ArgsObject) {
1532 /**
1533 * Function constructor().
1534 *
1535 * Create Commands Base.
1536 *
1537 * @param {{}} args
1538 */
1539 function CommandInfra() {
1540 var _this;
1541 var args = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
1542 _classCallCheck(this, CommandInfra);
1543 _this = _callSuper$9(this, CommandInfra, [args]);
1544 if (!_this.constructor.registerConfig) throw RangeError("Doing it wrong: Each command type should have `registerConfig`.");
1545 _this.command = _this.constructor.getCommand();
1546 _this.component = _this.constructor.getComponent();
1547 _this.initialize(args);
1548 args = _this.args;
1549 _this.validateArgs(args);
1550 return _this;
1551 }
1552 /**
1553 * Function initialize().
1554 *
1555 * Initialize command, called after construction.
1556 *
1557 * @param {{}} args
1558 */
1559 _inherits(CommandInfra, _ArgsObject);
1560 return _createClass(CommandInfra, [
1561 {
1562 key: "currentCommand",
1563 get: function get() {
1564 Deprecation.deprecated("this.currentCommand", "3.7.0", "this.command");
1565 return this.command;
1566 }
1567 },
1568 {
1569 key: "initialize",
1570 value: function initialize() {
1571 arguments.length > 0 && arguments[0] !== void 0 && arguments[0];
1572 }
1573 },
1574 {
1575 key: "validateArgs",
1576 value: function validateArgs() {
1577 arguments.length > 0 && arguments[0] !== void 0 && arguments[0];
1578 }
1579 },
1580 {
1581 key: "apply",
1582 value: function apply() {
1583 arguments.length > 0 && arguments[0] !== void 0 && arguments[0];
1584 elementorModules.ForceMethodImplementation();
1585 }
1586 },
1587 {
1588 key: "run",
1589 value: function run() {
1590 return this.apply(this.args);
1591 }
1592 },
1593 {
1594 key: "onBeforeRun",
1595 value: function onBeforeRun() {
1596 arguments.length > 0 && arguments[0] !== void 0 && arguments[0];
1597 }
1598 },
1599 {
1600 key: "onAfterRun",
1601 value: function onAfterRun() {
1602 arguments.length > 0 && arguments[0] !== void 0 && arguments[0];
1603 arguments.length > 1 && arguments[1];
1604 }
1605 },
1606 {
1607 key: "onBeforeApply",
1608 value: function onBeforeApply() {
1609 arguments.length > 0 && arguments[0] !== void 0 && arguments[0];
1610 }
1611 },
1612 {
1613 key: "onAfterApply",
1614 value: function onAfterApply() {
1615 arguments.length > 0 && arguments[0] !== void 0 && arguments[0];
1616 arguments.length > 1 && arguments[1];
1617 }
1618 },
1619 {
1620 key: "onCatchApply",
1621 value: function onCatchApply(e) {}
1622 }
1623 ], [
1624 {
1625 key: "getInstanceType",
1626 value: function getInstanceType() {
1627 return "CommandInfra";
1628 }
1629 },
1630 {
1631 key: "getInfo",
1632 value: function getInfo() {
1633 return {};
1634 }
1635 },
1636 {
1637 key: "getCommand",
1638 value: function getCommand() {
1639 return this.registerConfig.command;
1640 }
1641 },
1642 {
1643 key: "getComponent",
1644 value: function getComponent() {
1645 return this.registerConfig.component;
1646 }
1647 },
1648 {
1649 key: "setRegisterConfig",
1650 value: function setRegisterConfig(config) {
1651 this.registerConfig = Object.freeze(config);
1652 }
1653 }
1654 ]);
1655 }(ArgsObject);
1656 /**
1657 * @type {Object}
1658 */
1659 _defineProperty(CommandInfra, "registerConfig", null);
1660
1661 //#endregion
1662 //#region modules/web-cli/assets/js/modules/command-base.js
1663 function _callSuper$8(t, o, e) {
1664 return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$8() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
1665 }
1666 __name(_callSuper$8, "_callSuper");
1667 function _isNativeReflectConstruct$8() {
1668 try {
1669 var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
1670 } catch (t) {}
1671 return (_isNativeReflectConstruct$8 = function _isNativeReflectConstruct() {
1672 return !!t;
1673 })();
1674 }
1675 __name(_isNativeReflectConstruct$8, "_isNativeReflectConstruct");
1676 /**
1677 * @name $e.modules.CommandBase
1678 */
1679 var CommandBase = /*#__PURE__*/ function(_CommandInfra) {
1680 function CommandBase() {
1681 _classCallCheck(this, CommandBase);
1682 return _callSuper$8(this, CommandBase, arguments);
1683 }
1684 _inherits(CommandBase, _CommandInfra);
1685 return _createClass(CommandBase, [
1686 {
1687 key: "onBeforeRun",
1688 value: function onBeforeRun() {
1689 var args = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
1690 $e.hooks.runUIBefore(this.command, args);
1691 }
1692 },
1693 {
1694 key: "onAfterRun",
1695 value: function onAfterRun() {
1696 var args = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
1697 var result = arguments.length > 1 ? arguments[1] : void 0;
1698 $e.hooks.runUIAfter(this.command, args, result);
1699 }
1700 },
1701 {
1702 key: "onBeforeApply",
1703 value: function onBeforeApply() {
1704 var args = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
1705 $e.hooks.runDataDependency(this.command, args);
1706 }
1707 },
1708 {
1709 key: "onAfterApply",
1710 value: function onAfterApply() {
1711 var args = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
1712 var result = arguments.length > 1 ? arguments[1] : void 0;
1713 return $e.hooks.runDataAfter(this.command, args, result);
1714 }
1715 },
1716 {
1717 key: "onCatchApply",
1718 value: function onCatchApply(e) {
1719 this.runCatchHooks(e);
1720 }
1721 },
1722 {
1723 key: "runCatchHooks",
1724 value: function runCatchHooks(e) {
1725 $e.hooks.runDataCatch(this.command, this.args, e);
1726 $e.hooks.runUICatch(this.command, this.args, e);
1727 }
1728 },
1729 {
1730 key: "requireContainer",
1731 value: function requireContainer() {
1732 var _this = this;
1733 var args = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.args;
1734 Deprecation.deprecated("requireContainer()", "3.7.0", "Extend `$e.modules.editor.CommandContainerBase` or `$e.modules.editor.CommandContainerInternalBase`");
1735 if (!args.container && !args.containers) throw Error("container or containers are required.");
1736 if (args.container && args.containers) throw Error("container and containers cannot go together please select one of them.");
1737 (args.containers || [args.container]).forEach(function(container) {
1738 _this.requireArgumentInstance("container", elementorModules.editor.Container, { container });
1739 });
1740 }
1741 }
1742 ], [{
1743 key: "getInstanceType",
1744 value: function getInstanceType() {
1745 return "CommandBase";
1746 }
1747 }]);
1748 }(CommandInfra);
1749
1750 //#endregion
1751 //#region modules/web-cli/assets/js/modules/command-callback-base.js
1752 function _callSuper$7(t, o, e) {
1753 return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$7() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
1754 }
1755 __name(_callSuper$7, "_callSuper");
1756 function _isNativeReflectConstruct$7() {
1757 try {
1758 var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
1759 } catch (t) {}
1760 return (_isNativeReflectConstruct$7 = function _isNativeReflectConstruct() {
1761 return !!t;
1762 })();
1763 }
1764 __name(_isNativeReflectConstruct$7, "_isNativeReflectConstruct");
1765 /**
1766 * To support pure callbacks in the API(commands.js), to ensure they have registered with the proper context.
1767 */
1768 var CommandCallbackBase = /*#__PURE__*/ function(_CommandBase) {
1769 function CommandCallbackBase() {
1770 _classCallCheck(this, CommandCallbackBase);
1771 return _callSuper$7(this, CommandCallbackBase, arguments);
1772 }
1773 _inherits(CommandCallbackBase, _CommandBase);
1774 return _createClass(CommandCallbackBase, [{
1775 key: "apply",
1776 value: function apply() {
1777 var args = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
1778 return this.constructor.getCallback()(args);
1779 }
1780 }], [{
1781 key: "getInstanceType",
1782 value: function getInstanceType() {
1783 return "CommandCallbackBase";
1784 }
1785 }, {
1786 key: "getCallback",
1787 value: function getCallback() {
1788 return this.registerConfig.callback;
1789 }
1790 }]);
1791 }(CommandBase);
1792
1793 //#endregion
1794 //#region modules/web-cli/assets/js/utils/force-method-implementation.js
1795 function _callSuper$6(t, o, e) {
1796 return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$6() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
1797 }
1798 __name(_callSuper$6, "_callSuper");
1799 function _isNativeReflectConstruct$6() {
1800 try {
1801 var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
1802 } catch (t) {}
1803 return (_isNativeReflectConstruct$6 = function _isNativeReflectConstruct() {
1804 return !!t;
1805 })();
1806 }
1807 __name(_isNativeReflectConstruct$6, "_isNativeReflectConstruct");
1808 var ForceMethodImplementation = /*#__PURE__*/ function(_Error) {
1809 function ForceMethodImplementation() {
1810 var _this;
1811 var info = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
1812 _classCallCheck(this, ForceMethodImplementation);
1813 _this = _callSuper$6(this, ForceMethodImplementation, ["".concat(info.isStatic ? "static " : "").concat(info.fullName, "() should be implemented, please provide '").concat(info.functionName || info.fullName, "' functionality.")]);
1814 Error.captureStackTrace(_this, ForceMethodImplementation);
1815 return _this;
1816 }
1817 _inherits(ForceMethodImplementation, _Error);
1818 return _createClass(ForceMethodImplementation);
1819 }(/*#__PURE__*/ _wrapNativeSuper(Error));
1820 var force_method_implementation_default = /* @__PURE__ */ __name((function() {
1821 var caller = Error().stack.split("\n")[2].trim();
1822 var callerName = caller.startsWith("at new") ? "constructor" : caller.split(" ")[1];
1823 var info = {};
1824 info.functionName = callerName;
1825 info.fullName = callerName;
1826 if (info.functionName.includes(".")) {
1827 var parts = info.functionName.split(".");
1828 info.className = parts[0];
1829 info.functionName = parts[1];
1830 } else info.isStatic = true;
1831 throw new ForceMethodImplementation(info);
1832 }), "default");
1833
1834 //#endregion
1835 //#region modules/web-cli/assets/js/modules/component-base.js
1836 function ownKeys(e, r) {
1837 var t = Object.keys(e);
1838 if (Object.getOwnPropertySymbols) {
1839 var o = Object.getOwnPropertySymbols(e);
1840 r && (o = o.filter(function(r) {
1841 return Object.getOwnPropertyDescriptor(e, r).enumerable;
1842 })), t.push.apply(t, o);
1843 }
1844 return t;
1845 }
1846 function _objectSpread(e) {
1847 for (var r = 1; r < arguments.length; r++) {
1848 var t = null != arguments[r] ? arguments[r] : {};
1849 r % 2 ? ownKeys(Object(t), !0).forEach(function(r) {
1850 _defineProperty(e, r, t[r]);
1851 }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r) {
1852 Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
1853 });
1854 }
1855 return e;
1856 }
1857 function _callSuper$5(t, o, e) {
1858 return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$5() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
1859 }
1860 __name(_callSuper$5, "_callSuper");
1861 function _isNativeReflectConstruct$5() {
1862 try {
1863 var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
1864 } catch (t) {}
1865 return (_isNativeReflectConstruct$5 = function _isNativeReflectConstruct() {
1866 return !!t;
1867 })();
1868 }
1869 __name(_isNativeReflectConstruct$5, "_isNativeReflectConstruct");
1870 /**
1871 * @typedef {import('./command-infra')} CommandInfra
1872 * @typedef {import('./hook-base')} HookBase
1873 * @typedef {import('../core/states/ui-state-base')} UiStateBase
1874 */
1875 var ComponentBase = /*#__PURE__*/ function(_Module) {
1876 function ComponentBase() {
1877 _classCallCheck(this, ComponentBase);
1878 return _callSuper$5(this, ComponentBase, arguments);
1879 }
1880 _inherits(ComponentBase, _Module);
1881 return _createClass(ComponentBase, [
1882 {
1883 key: "__construct",
1884 value: function __construct() {
1885 var args = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
1886 if (args.manager) this.manager = args.manager;
1887 this.commands = this.defaultCommands();
1888 this.commandsInternal = this.defaultCommandsInternal();
1889 this.hooks = this.defaultHooks();
1890 this.routes = this.defaultRoutes();
1891 this.tabs = this.defaultTabs();
1892 this.shortcuts = this.defaultShortcuts();
1893 this.utils = this.defaultUtils();
1894 this.data = this.defaultData();
1895 this.uiStates = this.defaultUiStates();
1896 this.states = this.defaultStates();
1897 this.defaultRoute = "";
1898 this.currentTab = "";
1899 }
1900 },
1901 {
1902 key: "registerAPI",
1903 value: function registerAPI() {
1904 var _this = this;
1905 Object.entries(this.getTabs()).forEach(function(tab) {
1906 return _this.registerTabRoute(tab[0]);
1907 });
1908 Object.entries(this.getRoutes()).forEach(function(_ref) {
1909 var _ref2 = _slicedToArray(_ref, 2);
1910 var route = _ref2[0];
1911 var callback = _ref2[1];
1912 return _this.registerRoute(route, callback);
1913 });
1914 Object.entries(this.getCommands()).forEach(function(_ref3) {
1915 var _ref4 = _slicedToArray(_ref3, 2);
1916 var command = _ref4[0];
1917 var callback = _ref4[1];
1918 return _this.registerCommand(command, callback);
1919 });
1920 Object.entries(this.getCommandsInternal()).forEach(function(_ref5) {
1921 var _ref6 = _slicedToArray(_ref5, 2);
1922 var command = _ref6[0];
1923 var callback = _ref6[1];
1924 return _this.registerCommandInternal(command, callback);
1925 });
1926 Object.values(this.getHooks()).forEach(function(instance) {
1927 return _this.registerHook(instance);
1928 });
1929 Object.entries(this.getData()).forEach(function(_ref7) {
1930 var _ref8 = _slicedToArray(_ref7, 2);
1931 var command = _ref8[0];
1932 var callback = _ref8[1];
1933 return _this.registerData(command, callback);
1934 });
1935 Object.values(this.getUiStates()).forEach(function(instance) {
1936 return _this.registerUiState(instance);
1937 });
1938 Object.entries(this.getStates()).forEach(function(_ref9) {
1939 var _ref0 = _slicedToArray(_ref9, 2);
1940 var id = _ref0[0];
1941 var state = _ref0[1];
1942 return _this.registerState(id, state);
1943 });
1944 }
1945 },
1946 {
1947 key: "getNamespace",
1948 value: function getNamespace() {
1949 force_method_implementation_default();
1950 }
1951 },
1952 {
1953 key: "getRootContainer",
1954 value: function getRootContainer() {
1955 Deprecation.deprecated("getRootContainer()", "3.7.0", "getServiceName()");
1956 return this.getServiceName();
1957 }
1958 },
1959 {
1960 key: "getServiceName",
1961 value: function getServiceName() {
1962 return this.getNamespace().split("/")[0];
1963 }
1964 },
1965 {
1966 key: "store",
1967 get: function get() {
1968 return $e.store.get(this.getNamespace());
1969 }
1970 },
1971 {
1972 key: "defaultTabs",
1973 value: function defaultTabs() {
1974 return {};
1975 }
1976 },
1977 {
1978 key: "defaultRoutes",
1979 value: function defaultRoutes() {
1980 return {};
1981 }
1982 },
1983 {
1984 key: "defaultCommands",
1985 value: function defaultCommands() {
1986 return {};
1987 }
1988 },
1989 {
1990 key: "defaultCommandsInternal",
1991 value: function defaultCommandsInternal() {
1992 return {};
1993 }
1994 },
1995 {
1996 key: "defaultHooks",
1997 value: function defaultHooks() {
1998 return {};
1999 }
2000 },
2001 {
2002 key: "defaultUiStates",
2003 value: function defaultUiStates() {
2004 return {};
2005 }
2006 },
2007 {
2008 key: "defaultStates",
2009 value: function defaultStates() {
2010 return {};
2011 }
2012 },
2013 {
2014 key: "defaultShortcuts",
2015 value: function defaultShortcuts() {
2016 return {};
2017 }
2018 },
2019 {
2020 key: "defaultUtils",
2021 value: function defaultUtils() {
2022 return {};
2023 }
2024 },
2025 {
2026 key: "defaultData",
2027 value: function defaultData() {
2028 return {};
2029 }
2030 },
2031 {
2032 key: "getCommands",
2033 value: function getCommands() {
2034 return this.commands;
2035 }
2036 },
2037 {
2038 key: "getCommandsInternal",
2039 value: function getCommandsInternal() {
2040 return this.commandsInternal;
2041 }
2042 },
2043 {
2044 key: "getHooks",
2045 value: function getHooks() {
2046 return this.hooks;
2047 }
2048 },
2049 {
2050 key: "getUiStates",
2051 value: function getUiStates() {
2052 return this.uiStates;
2053 }
2054 },
2055 {
2056 key: "getStates",
2057 value: function getStates() {
2058 return this.states;
2059 }
2060 },
2061 {
2062 key: "getRoutes",
2063 value: function getRoutes() {
2064 return this.routes;
2065 }
2066 },
2067 {
2068 key: "getTabs",
2069 value: function getTabs() {
2070 return this.tabs;
2071 }
2072 },
2073 {
2074 key: "getShortcuts",
2075 value: function getShortcuts() {
2076 return this.shortcuts;
2077 }
2078 },
2079 {
2080 key: "getData",
2081 value: function getData() {
2082 return this.data;
2083 }
2084 },
2085 {
2086 key: "registerCommand",
2087 value: function registerCommand(command, context) {
2088 var commandsType = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "default";
2089 var commandsManager;
2090 switch (commandsType) {
2091 case "default":
2092 commandsManager = $e.commands;
2093 break;
2094 case "internal":
2095 commandsManager = $e.commandsInternal;
2096 break;
2097 case "data":
2098 commandsManager = $e.data;
2099 break;
2100 default: throw new Error("Invalid commands type: '".concat(command, "'"));
2101 }
2102 var fullCommand = this.getNamespace() + "/" + command;
2103 var instanceType = context.getInstanceType ? context.getInstanceType() : false;
2104 var registerConfig = {
2105 command: fullCommand,
2106 component: this
2107 };
2108 if (!instanceType) {
2109 if ($e.devTools) $e.devTools.log.warn("Attach command-callback-base, on command: '".concat(fullCommand, "', context is unknown type."));
2110 registerConfig.callback = context;
2111 context = /*#__PURE__*/ function(_CommandCallbackBase) {
2112 function context() {
2113 _classCallCheck(this, context);
2114 return _callSuper$5(this, context, arguments);
2115 }
2116 _inherits(context, _CommandCallbackBase);
2117 return _createClass(context);
2118 }(CommandCallbackBase);
2119 }
2120 context.setRegisterConfig(registerConfig);
2121 commandsManager.register(this, command, context);
2122 }
2123 },
2124 {
2125 key: "registerHook",
2126 value: function registerHook(instance) {
2127 return instance.register();
2128 }
2129 },
2130 {
2131 key: "registerCommandInternal",
2132 value: function registerCommandInternal(command, context) {
2133 this.registerCommand(command, context, "internal");
2134 }
2135 },
2136 {
2137 key: "registerUiState",
2138 value: function registerUiState(instance) {
2139 $e.uiStates.register(instance);
2140 }
2141 },
2142 {
2143 key: "registerState",
2144 value: function registerState(id, stateConfig) {
2145 id = this.getNamespace() + (id ? "/".concat(id) : "");
2146 var slice = (0, _reduxjs_toolkit.createSlice)(_objectSpread(_objectSpread({}, stateConfig), {}, { name: id }));
2147 $e.store.register(id, slice);
2148 }
2149 },
2150 {
2151 key: "registerRoute",
2152 value: function registerRoute(route, callback) {
2153 $e.routes.register(this, route, callback);
2154 }
2155 },
2156 {
2157 key: "registerData",
2158 value: function registerData(command, context) {
2159 this.registerCommand(command, context, "data");
2160 }
2161 },
2162 {
2163 key: "unregisterRoute",
2164 value: function unregisterRoute(route) {
2165 $e.routes.unregister(this, route);
2166 }
2167 },
2168 {
2169 key: "registerTabRoute",
2170 value: function registerTabRoute(tab) {
2171 var _this2 = this;
2172 this.registerRoute(tab, function(args) {
2173 return _this2.activateTab(tab, args);
2174 });
2175 }
2176 },
2177 {
2178 key: "dependency",
2179 value: function dependency() {
2180 return true;
2181 }
2182 },
2183 {
2184 key: "open",
2185 value: function open() {
2186 return true;
2187 }
2188 },
2189 {
2190 key: "close",
2191 value: function close() {
2192 if (!this.isOpen) return false;
2193 this.isOpen = false;
2194 this.inactivate();
2195 $e.routes.clearCurrent(this.getNamespace());
2196 $e.routes.clearHistory(this.getServiceName());
2197 return true;
2198 }
2199 },
2200 {
2201 key: "activate",
2202 value: function activate() {
2203 $e.components.activate(this.getNamespace());
2204 }
2205 },
2206 {
2207 key: "inactivate",
2208 value: function inactivate() {
2209 $e.components.inactivate(this.getNamespace());
2210 }
2211 },
2212 {
2213 key: "isActive",
2214 value: function isActive() {
2215 return $e.components.isActive(this.getNamespace());
2216 }
2217 },
2218 {
2219 key: "onRoute",
2220 value: function onRoute(route) {
2221 this.toggleRouteClass(route, true);
2222 this.toggleHistoryClass();
2223 this.activate();
2224 this.trigger("route/open", route);
2225 }
2226 },
2227 {
2228 key: "onCloseRoute",
2229 value: function onCloseRoute(route) {
2230 this.toggleRouteClass(route, false);
2231 this.inactivate();
2232 this.trigger("route/close", route);
2233 }
2234 },
2235 {
2236 key: "setDefaultRoute",
2237 value: function setDefaultRoute(route) {
2238 this.defaultRoute = this.getNamespace() + "/" + route;
2239 }
2240 },
2241 {
2242 key: "getDefaultRoute",
2243 value: function getDefaultRoute() {
2244 return this.defaultRoute;
2245 }
2246 },
2247 {
2248 key: "removeTab",
2249 value: function removeTab(tab) {
2250 delete this.tabs[tab];
2251 this.unregisterRoute(tab);
2252 }
2253 },
2254 {
2255 key: "hasTab",
2256 value: function hasTab(tab) {
2257 return !!this.tabs[tab];
2258 }
2259 },
2260 {
2261 key: "addTab",
2262 value: function addTab(tab, args, position) {
2263 var _this3 = this;
2264 this.tabs[tab] = args;
2265 if ("undefined" !== typeof position) {
2266 var newTabs = {};
2267 var ids = Object.keys(this.tabs);
2268 ids.pop();
2269 ids.splice(position, 0, tab);
2270 ids.forEach(function(id) {
2271 newTabs[id] = _this3.tabs[id];
2272 });
2273 this.tabs = newTabs;
2274 }
2275 this.registerTabRoute(tab);
2276 }
2277 },
2278 {
2279 key: "getTabsWrapperSelector",
2280 value: function getTabsWrapperSelector() {
2281 return "";
2282 }
2283 },
2284 {
2285 key: "getTabRoute",
2286 value: function getTabRoute(tab) {
2287 return this.getNamespace() + "/" + tab;
2288 }
2289 },
2290 {
2291 key: "renderTab",
2292 value: function renderTab(tab) {}
2293 },
2294 {
2295 key: "activateTab",
2296 value: function activateTab(tab, args) {
2297 var _this4 = this;
2298 this.renderTab(tab, args);
2299 jQuery(this.getTabsWrapperSelector() + " .elementor-component-tab").off("click").on("click", function(event) {
2300 $e.route(_this4.getTabRoute(event.currentTarget.dataset.tab), args);
2301 }).removeClass("elementor-active").filter("[data-tab=\"" + tab + "\"]").addClass("elementor-active");
2302 }
2303 },
2304 {
2305 key: "getActiveTabConfig",
2306 value: function getActiveTabConfig() {
2307 return this.tabs[this.currentTab] || {};
2308 }
2309 },
2310 {
2311 key: "getBodyClass",
2312 value: function getBodyClass(route) {
2313 return "e-route-" + route.replace(/\//g, "-");
2314 }
2315 },
2316 {
2317 key: "normalizeCommandName",
2318 value: function normalizeCommandName(commandName) {
2319 return commandName.replace(/[A-Z]/g, function(match, offset) {
2320 return (offset > 0 ? "-" : "") + match.toLowerCase();
2321 });
2322 }
2323 },
2324 {
2325 key: "importCommands",
2326 value: function importCommands(commandsFromImport) {
2327 var _this5 = this;
2328 var commands = {};
2329 Object.entries(commandsFromImport).forEach(function(_ref1) {
2330 var _ref10 = _slicedToArray(_ref1, 2);
2331 var className = _ref10[0];
2332 var Class = _ref10[1];
2333 var command = _this5.normalizeCommandName(className);
2334 commands[command] = Class;
2335 });
2336 return commands;
2337 }
2338 },
2339 {
2340 key: "importHooks",
2341 value: function importHooks(hooksFromImport) {
2342 var hooks = {};
2343 for (var key in hooksFromImport) {
2344 var hook = new hooksFromImport[key]();
2345 hooks[hook.getId()] = hook;
2346 }
2347 return hooks;
2348 }
2349 },
2350 {
2351 key: "importUiStates",
2352 value: function importUiStates(statesFromImport) {
2353 var _this6 = this;
2354 var uiStates = {};
2355 Object.values(statesFromImport).forEach(function(className) {
2356 var uiState = new className(_this6);
2357 uiStates[uiState.getId()] = uiState;
2358 });
2359 return uiStates;
2360 }
2361 },
2362 {
2363 key: "setUiState",
2364 value: function setUiState(state, value) {
2365 $e.uiStates.set("".concat(this.getNamespace(), "/").concat(state), value);
2366 }
2367 },
2368 {
2369 key: "toggleRouteClass",
2370 value: function toggleRouteClass(route, state) {
2371 document.body.classList.toggle(this.getBodyClass(route), state);
2372 }
2373 },
2374 {
2375 key: "toggleHistoryClass",
2376 value: function toggleHistoryClass() {
2377 document.body.classList.toggle("e-routes-has-history", !!$e.routes.getHistory(this.getServiceName()).length);
2378 }
2379 }
2380 ]);
2381 }(import_module.default);
2382
2383 //#endregion
2384 //#region modules/web-cli/assets/js/modules/commands/close.js
2385 function _callSuper$4(t, o, e) {
2386 return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$4() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
2387 }
2388 __name(_callSuper$4, "_callSuper");
2389 function _isNativeReflectConstruct$4() {
2390 try {
2391 var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
2392 } catch (t) {}
2393 return (_isNativeReflectConstruct$4 = function _isNativeReflectConstruct() {
2394 return !!t;
2395 })();
2396 }
2397 __name(_isNativeReflectConstruct$4, "_isNativeReflectConstruct");
2398 var Close = /*#__PURE__*/ function(_CommandBase) {
2399 function Close() {
2400 _classCallCheck(this, Close);
2401 return _callSuper$4(this, Close, arguments);
2402 }
2403 _inherits(Close, _CommandBase);
2404 return _createClass(Close, [{
2405 key: "apply",
2406 value: function apply() {
2407 this.component.close();
2408 }
2409 }]);
2410 }(CommandBase);
2411
2412 //#endregion
2413 //#region modules/web-cli/assets/js/modules/commands/open.js
2414 function _callSuper$3(t, o, e) {
2415 return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$3() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
2416 }
2417 __name(_callSuper$3, "_callSuper");
2418 function _isNativeReflectConstruct$3() {
2419 try {
2420 var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
2421 } catch (t) {}
2422 return (_isNativeReflectConstruct$3 = function _isNativeReflectConstruct() {
2423 return !!t;
2424 })();
2425 }
2426 __name(_isNativeReflectConstruct$3, "_isNativeReflectConstruct");
2427 var Open = /*#__PURE__*/ function(_CommandBase) {
2428 function Open() {
2429 _classCallCheck(this, Open);
2430 return _callSuper$3(this, Open, arguments);
2431 }
2432 _inherits(Open, _CommandBase);
2433 return _createClass(Open, [{
2434 key: "apply",
2435 value: function apply() {
2436 $e.route(this.component.getNamespace());
2437 }
2438 }]);
2439 }(CommandBase);
2440
2441 //#endregion
2442 //#region modules/web-cli/assets/js/modules/commands/toggle.js
2443 function _callSuper$2(t, o, e) {
2444 return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$2() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
2445 }
2446 __name(_callSuper$2, "_callSuper");
2447 function _isNativeReflectConstruct$2() {
2448 try {
2449 var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
2450 } catch (t) {}
2451 return (_isNativeReflectConstruct$2 = function _isNativeReflectConstruct() {
2452 return !!t;
2453 })();
2454 }
2455 __name(_isNativeReflectConstruct$2, "_isNativeReflectConstruct");
2456 var Toggle = /*#__PURE__*/ function(_CommandBase) {
2457 function Toggle() {
2458 _classCallCheck(this, Toggle);
2459 return _callSuper$2(this, Toggle, arguments);
2460 }
2461 _inherits(Toggle, _CommandBase);
2462 return _createClass(Toggle, [{
2463 key: "apply",
2464 value: function apply() {
2465 if (this.component.isOpen) this.component.close();
2466 else $e.route(this.component.getNamespace());
2467 }
2468 }]);
2469 }(CommandBase);
2470
2471 //#endregion
2472 //#region modules/web-cli/assets/js/modules/commands/index.js
2473 var commands_exports = /* @__PURE__ */ __exportAll({
2474 Close: () => Close,
2475 Open: () => Open,
2476 Toggle: () => Toggle
2477 });
2478
2479 //#endregion
2480 //#region modules/web-cli/assets/js/modules/component-modal-base.js
2481 function _callSuper$1(t, o, e) {
2482 return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$1() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
2483 }
2484 __name(_callSuper$1, "_callSuper");
2485 function _isNativeReflectConstruct$1() {
2486 try {
2487 var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
2488 } catch (t) {}
2489 return (_isNativeReflectConstruct$1 = function _isNativeReflectConstruct() {
2490 return !!t;
2491 })();
2492 }
2493 __name(_isNativeReflectConstruct$1, "_isNativeReflectConstruct");
2494 function _superPropGet(t, o, e, r) {
2495 var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e);
2496 return 2 & r && "function" == typeof p ? function(t) {
2497 return p.apply(e, t);
2498 } : p;
2499 }
2500 var ComponentModalBase = /*#__PURE__*/ function(_ComponentBase) {
2501 function ComponentModalBase() {
2502 _classCallCheck(this, ComponentModalBase);
2503 return _callSuper$1(this, ComponentModalBase, arguments);
2504 }
2505 _inherits(ComponentModalBase, _ComponentBase);
2506 return _createClass(ComponentModalBase, [
2507 {
2508 key: "registerAPI",
2509 value: function registerAPI() {
2510 var _this = this;
2511 _superPropGet(ComponentModalBase, "registerAPI", this, 3)([]);
2512 $e.shortcuts.register("esc", {
2513 scopes: [this.getNamespace()],
2514 callback: function callback() {
2515 return _this.close();
2516 }
2517 });
2518 }
2519 },
2520 {
2521 key: "defaultCommands",
2522 value: function defaultCommands() {
2523 return this.importCommands(commands_exports);
2524 }
2525 },
2526 {
2527 key: "defaultRoutes",
2528 value: function defaultRoutes() {
2529 return { "": function _() {} };
2530 }
2531 },
2532 {
2533 key: "open",
2534 value: function open() {
2535 var _this2 = this;
2536 if (!this.layout) {
2537 var layout = this.getModalLayout();
2538 this.layout = new layout({ component: this });
2539 this.layout.getModal().on("hide", function() {
2540 return _this2.close();
2541 });
2542 }
2543 this.layout.showModal();
2544 return true;
2545 }
2546 },
2547 {
2548 key: "close",
2549 value: function close() {
2550 if (!_superPropGet(ComponentModalBase, "close", this, 3)([])) return false;
2551 elementor.hooks.applyFilters("component/modal/close", this.layout.getModal().hide.bind(this.layout.getModal()), this)();
2552 return true;
2553 }
2554 },
2555 {
2556 key: "getModalLayout",
2557 value: function getModalLayout() {
2558 force_method_implementation_default();
2559 }
2560 }
2561 ]);
2562 }(ComponentBase);
2563
2564 //#endregion
2565 //#region modules/web-cli/assets/js/modules/hook-break.js
2566 function _callSuper(t, o, e) {
2567 return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e));
2568 }
2569 function _isNativeReflectConstruct() {
2570 try {
2571 var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {}));
2572 } catch (t) {}
2573 return (_isNativeReflectConstruct = function _isNativeReflectConstruct() {
2574 return !!t;
2575 })();
2576 }
2577 var HookBreak = /*#__PURE__*/ function(_Error) {
2578 function HookBreak() {
2579 _classCallCheck(this, HookBreak);
2580 return _callSuper(this, HookBreak, ["HookBreak"]);
2581 }
2582 _inherits(HookBreak, _Error);
2583 return _createClass(HookBreak);
2584 }(/*#__PURE__*/ _wrapNativeSuper(Error));
2585
2586 //#endregion
2587 //#region core/common/assets/js/modules.js
2588 modules_default.common = {
2589 /**
2590 * @deprecated since 2.9.0, use `$e.modules.ComponentBase` instead.
2591 */
2592 get Component() {
2593 setTimeout(function() {
2594 elementorDevTools.deprecation.deprecated("elementorModules.common.Component", "2.9.0", "$e.modules.ComponentBase");
2595 }, 2e3);
2596 return ComponentBase;
2597 },
2598 /**
2599 * @deprecated since 2.9.0, use `$e.modules.ComponentModalBase` instead.
2600 */
2601 get ComponentModal() {
2602 setTimeout(function() {
2603 elementorDevTools.deprecation.deprecated("elementorModules.common.ComponentModal", "2.9.0", "$e.modules.ComponentModalBase");
2604 }, 2e3);
2605 return ComponentModalBase;
2606 },
2607 /**
2608 * @deprecated since 2.9.0, use `$e.modules.HookBreak` instead.
2609 */
2610 get HookBreak() {
2611 setTimeout(function() {
2612 elementorDevTools.deprecation.deprecated("elementorModules.common.HookBreak", "2.9.0", "$e.modules.HookBreak");
2613 }, 2e3);
2614 return HookBreak;
2615 },
2616 views: { modal: { Layout: _default } }
2617 };
2618
2619 //#endregion
2620 })(elementorVendors.reduxToolkit);
2621 //# sourceMappingURL=common-modules.js.map