| @@ -1,8439 +1,5912 @@ | ||
| 1 | -/******/ (() => { // webpackBootstrap | |
| 2 | -/******/ var __webpack_modules__ = ({ | |
| 1 | +(function(_reduxjs_toolkit) { | |
| 3 | 2 | |
| 4 | -/***/ "../assets/dev/js/editor/utils/is-instanceof.js": | |
| 5 | -/*!******************************************************!*\ | |
| 6 | - !*** ../assets/dev/js/editor/utils/is-instanceof.js ***! | |
| 7 | - \******************************************************/ | |
| 8 | -/***/ ((__unused_webpack_module, exports) => { | |
| 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)); | |
| 9 | 54 | |
| 10 | -"use strict"; | |
| 55 | +//#endregion | |
| 11 | 56 | |
| 57 | +//#region node_modules/@babel/runtime/helpers/esm/classCallCheck.js | |
| 58 | + function _classCallCheck(a, n) { | |
| 59 | + if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); | |
| 60 | + } | |
| 12 | 61 | |
| 13 | -Object.defineProperty(exports, "__esModule", ({ | |
| 14 | - value: true | |
| 15 | -})); | |
| 16 | -exports["default"] = void 0; | |
| 17 | -function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, 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 o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; } | |
| 18 | -function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); 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; } } | |
| 19 | -function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } | |
| 20 | -/** | |
| 21 | - * Some FileAPI objects such as FileList, DataTransferItem and DataTransferItemList has inconsistency with the retrieved | |
| 22 | - * object (from events, etc.) and the actual JavaScript object so a regular instanceof doesn't work. This function can | |
| 23 | - * check whether it's instanceof by using the objects constructor and prototype names. | |
| 24 | - * | |
| 25 | - * @param object | |
| 26 | - * @param constructors | |
| 27 | - * @return {boolean} | |
| 28 | - */ | |
| 29 | -var _default = exports["default"] = function _default(object, constructors) { | |
| 30 | - constructors = Array.isArray(constructors) ? constructors : [constructors]; | |
| 31 | - var _iterator = _createForOfIteratorHelper(constructors), | |
| 32 | - _step; | |
| 33 | - try { | |
| 34 | - for (_iterator.s(); !(_step = _iterator.n()).done;) { | |
| 35 | - var constructor = _step.value; | |
| 36 | - if (object.constructor.name === constructor.prototype[Symbol.toStringTag]) { | |
| 37 | - return true; | |
| 38 | - } | |
| 39 | - } | |
| 40 | - } catch (err) { | |
| 41 | - _iterator.e(err); | |
| 42 | - } finally { | |
| 43 | - _iterator.f(); | |
| 44 | - } | |
| 45 | - return false; | |
| 46 | -}; | |
| 62 | +//#endregion | |
| 63 | +//#region node_modules/@babel/runtime/helpers/esm/typeof.js | |
| 64 | + function _typeof(o) { | |
| 65 | + "@babel/helpers - typeof"; | |
| 66 | + return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) { | |
| 67 | + return typeof o; | |
| 68 | + } : function(o) { | |
| 69 | + return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; | |
| 70 | + }, _typeof(o); | |
| 71 | + } | |
| 72 | + var init_typeof = __esmMin((() => {})); | |
| 47 | 73 | |
| 48 | -/***/ }), | |
| 74 | +//#endregion | |
| 75 | +//#region node_modules/@babel/runtime/helpers/esm/toPrimitive.js | |
| 76 | + init_typeof(); | |
| 77 | + function toPrimitive(t, r) { | |
| 78 | + if ("object" != _typeof(t) || !t) return t; | |
| 79 | + var e = t[Symbol.toPrimitive]; | |
| 80 | + if (void 0 !== e) { | |
| 81 | + var i = e.call(t, r || "default"); | |
| 82 | + if ("object" != _typeof(i)) return i; | |
| 83 | + throw new TypeError("@@toPrimitive must return a primitive value."); | |
| 84 | + } | |
| 85 | + return ("string" === r ? String : Number)(t); | |
| 86 | + } | |
| 49 | 87 | |
| 50 | -/***/ "../assets/dev/js/modules/imports/args-object.js": | |
| 51 | -/*!*******************************************************!*\ | |
| 52 | - !*** ../assets/dev/js/modules/imports/args-object.js ***! | |
| 53 | - \*******************************************************/ | |
| 54 | -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 88 | +//#endregion | |
| 89 | +//#region node_modules/@babel/runtime/helpers/esm/toPropertyKey.js | |
| 90 | + init_typeof(); | |
| 91 | + function toPropertyKey(t) { | |
| 92 | + var i = toPrimitive(t, "string"); | |
| 93 | + return "symbol" == _typeof(i) ? i : i + ""; | |
| 94 | + } | |
| 55 | 95 | |
| 56 | -"use strict"; | |
| 96 | +//#endregion | |
| 97 | +//#region node_modules/@babel/runtime/helpers/esm/createClass.js | |
| 98 | + function _defineProperties(e, r) { | |
| 99 | + for (var t = 0; t < r.length; t++) { | |
| 100 | + var o = r[t]; | |
| 101 | + o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, toPropertyKey(o.key), o); | |
| 102 | + } | |
| 103 | + } | |
| 104 | + function _createClass(e, r, t) { | |
| 105 | + return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; | |
| 106 | + } | |
| 57 | 107 | |
| 108 | +//#endregion | |
| 109 | +//#region node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js | |
| 110 | + function _assertThisInitialized(e) { | |
| 111 | + if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); | |
| 112 | + return e; | |
| 113 | + } | |
| 58 | 114 | |
| 59 | -var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 60 | -Object.defineProperty(exports, "__esModule", ({ | |
| 61 | - value: true | |
| 62 | -})); | |
| 63 | -exports["default"] = void 0; | |
| 64 | -var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js")); | |
| 65 | -var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 66 | -var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 67 | -var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 68 | -var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 69 | -var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 70 | -var _instanceType = _interopRequireDefault(__webpack_require__(/*! ./instance-type */ "../assets/dev/js/modules/imports/instance-type.js")); | |
| 71 | -var _isInstanceof = _interopRequireDefault(__webpack_require__(/*! ../../editor/utils/is-instanceof */ "../assets/dev/js/editor/utils/is-instanceof.js")); | |
| 72 | -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)); } | |
| 73 | -function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } | |
| 74 | -var ArgsObject = exports["default"] = /*#__PURE__*/function (_InstanceType) { | |
| 75 | - /** | |
| 76 | - * Function constructor(). | |
| 77 | - * | |
| 78 | - * Create ArgsObject. | |
| 79 | - * | |
| 80 | - * @param {{}} args | |
| 81 | - */ | |
| 82 | - function ArgsObject(args) { | |
| 83 | - var _this; | |
| 84 | - (0, _classCallCheck2.default)(this, ArgsObject); | |
| 85 | - _this = _callSuper(this, ArgsObject); | |
| 86 | - _this.args = args; | |
| 87 | - return _this; | |
| 88 | - } | |
| 115 | +//#endregion | |
| 116 | +//#region node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js | |
| 117 | + init_typeof(); | |
| 118 | + function _possibleConstructorReturn(t, e) { | |
| 119 | + if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; | |
| 120 | + if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); | |
| 121 | + return _assertThisInitialized(t); | |
| 122 | + } | |
| 89 | 123 | |
| 90 | - /** | |
| 91 | - * Function requireArgument(). | |
| 92 | - * | |
| 93 | - * Validate property in args. | |
| 94 | - * | |
| 95 | - * @param {string} property | |
| 96 | - * @param {{}} args | |
| 97 | - * | |
| 98 | - * @throws {Error} | |
| 99 | - */ | |
| 100 | - (0, _inherits2.default)(ArgsObject, _InstanceType); | |
| 101 | - return (0, _createClass2.default)(ArgsObject, [{ | |
| 102 | - key: "requireArgument", | |
| 103 | - value: function requireArgument(property) { | |
| 104 | - var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : this.args; | |
| 105 | - if (!Object.prototype.hasOwnProperty.call(args, property)) { | |
| 106 | - throw Error("".concat(property, " is required.")); | |
| 107 | - } | |
| 108 | - } | |
| 124 | +//#endregion | |
| 125 | +//#region node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js | |
| 126 | + function _getPrototypeOf(t) { | |
| 127 | + return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(t) { | |
| 128 | + return t.__proto__ || Object.getPrototypeOf(t); | |
| 129 | + }, _getPrototypeOf(t); | |
| 130 | + } | |
| 109 | 131 | |
| 110 | - /** | |
| 111 | - * Function requireArgumentType(). | |
| 112 | - * | |
| 113 | - * Validate property in args using `type === typeof(args.whatever)`. | |
| 114 | - * | |
| 115 | - * @param {string} property | |
| 116 | - * @param {string} type | |
| 117 | - * @param {{}} args | |
| 118 | - * | |
| 119 | - * @throws {Error} | |
| 120 | - */ | |
| 121 | - }, { | |
| 122 | - key: "requireArgumentType", | |
| 123 | - value: function requireArgumentType(property, type) { | |
| 124 | - var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.args; | |
| 125 | - this.requireArgument(property, args); | |
| 126 | - if ((0, _typeof2.default)(args[property]) !== type) { | |
| 127 | - throw Error("".concat(property, " invalid type: ").concat(type, ".")); | |
| 128 | - } | |
| 129 | - } | |
| 132 | +//#endregion | |
| 133 | +//#region node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js | |
| 134 | + function _setPrototypeOf(t, e) { | |
| 135 | + return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t, e) { | |
| 136 | + return t.__proto__ = e, t; | |
| 137 | + }, _setPrototypeOf(t, e); | |
| 138 | + } | |
| 130 | 139 | |
| 131 | - /** | |
| 132 | - * Function requireArgumentInstance(). | |
| 133 | - * | |
| 134 | - * Validate property in args using `args.whatever instanceof instance`. | |
| 135 | - * | |
| 136 | - * @param {string} property | |
| 137 | - * @param {*} instance | |
| 138 | - * @param {{}} args | |
| 139 | - * | |
| 140 | - * @throws {Error} | |
| 141 | - */ | |
| 142 | - }, { | |
| 143 | - key: "requireArgumentInstance", | |
| 144 | - value: function requireArgumentInstance(property, instance) { | |
| 145 | - var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.args; | |
| 146 | - this.requireArgument(property, args); | |
| 147 | - if (!(args[property] instanceof instance) && !(0, _isInstanceof.default)(args[property], instance)) { | |
| 148 | - throw Error("".concat(property, " invalid instance.")); | |
| 149 | - } | |
| 150 | - } | |
| 140 | +//#endregion | |
| 141 | +//#region node_modules/@babel/runtime/helpers/esm/inherits.js | |
| 142 | + function _inherits(t, e) { | |
| 143 | + if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); | |
| 144 | + t.prototype = Object.create(e && e.prototype, { constructor: { | |
| 145 | + value: t, | |
| 146 | + writable: !0, | |
| 147 | + configurable: !0 | |
| 148 | + } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); | |
| 149 | + } | |
| 151 | 150 | |
| 152 | - /** | |
| 153 | - * Function requireArgumentConstructor(). | |
| 154 | - * | |
| 155 | - * Validate property in args using `type === args.whatever.constructor`. | |
| 156 | - * | |
| 157 | - * @param {string} property | |
| 158 | - * @param {*} type | |
| 159 | - * @param {{}} args | |
| 160 | - * | |
| 161 | - * @throws {Error} | |
| 162 | - */ | |
| 163 | - }, { | |
| 164 | - key: "requireArgumentConstructor", | |
| 165 | - value: function requireArgumentConstructor(property, type) { | |
| 166 | - var args = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : this.args; | |
| 167 | - this.requireArgument(property, args); | |
| 151 | +//#endregion | |
| 152 | +//#region node_modules/@babel/runtime/helpers/esm/defineProperty.js | |
| 153 | + function _defineProperty(e, r, t) { | |
| 154 | + return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, { | |
| 155 | + value: t, | |
| 156 | + enumerable: !0, | |
| 157 | + configurable: !0, | |
| 158 | + writable: !0 | |
| 159 | + }) : e[r] = t, e; | |
| 160 | + } | |
| 168 | 161 | |
| 169 | - // Note: Converting the constructor to string in order to avoid equation issues | |
| 170 | - // due to different memory addresses between iframes (window.Object !== window.top.Object). | |
| 171 | - if (args[property].constructor.toString() !== type.prototype.constructor.toString()) { | |
| 172 | - throw Error("".concat(property, " invalid constructor type.")); | |
| 173 | - } | |
| 174 | - } | |
| 175 | - }], [{ | |
| 176 | - key: "getInstanceType", | |
| 177 | - value: function getInstanceType() { | |
| 178 | - return 'ArgsObject'; | |
| 179 | - } | |
| 180 | - }]); | |
| 181 | -}(_instanceType.default); | |
| 162 | +//#endregion | |
| 163 | +//#region node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js | |
| 164 | + function _arrayWithHoles(r) { | |
| 165 | + if (Array.isArray(r)) return r; | |
| 166 | + } | |
| 182 | 167 | |
| 183 | -/***/ }), | |
| 168 | +//#endregion | |
| 169 | +//#region node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js | |
| 170 | + function _iterableToArrayLimit(r, l) { | |
| 171 | + var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; | |
| 172 | + if (null != t) { | |
| 173 | + var e; | |
| 174 | + var n; | |
| 175 | + var i; | |
| 176 | + var u; | |
| 177 | + var a = []; | |
| 178 | + var f = !0; | |
| 179 | + var o = !1; | |
| 180 | + try { | |
| 181 | + if (i = (t = t.call(r)).next, 0 === l) { | |
| 182 | + if (Object(t) !== t) return; | |
| 183 | + f = !1; | |
| 184 | + } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); | |
| 185 | + } catch (r) { | |
| 186 | + o = !0, n = r; | |
| 187 | + } finally { | |
| 188 | + try { | |
| 189 | + if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; | |
| 190 | + } finally { | |
| 191 | + if (o) throw n; | |
| 192 | + } | |
| 193 | + } | |
| 194 | + return a; | |
| 195 | + } | |
| 196 | + } | |
| 184 | 197 | |
| 185 | -/***/ "../assets/dev/js/modules/imports/instance-type.js": | |
| 186 | -/*!*********************************************************!*\ | |
| 187 | - !*** ../assets/dev/js/modules/imports/instance-type.js ***! | |
| 188 | - \*********************************************************/ | |
| 189 | -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 198 | +//#endregion | |
| 199 | +//#region node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js | |
| 200 | + function _arrayLikeToArray$2(r, a) { | |
| 201 | + (null == a || a > r.length) && (a = r.length); | |
| 202 | + for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; | |
| 203 | + return n; | |
| 204 | + } | |
| 205 | + __name(_arrayLikeToArray$2, "_arrayLikeToArray"); | |
| 190 | 206 | |
| 191 | -"use strict"; | |
| 207 | +//#endregion | |
| 208 | +//#region node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js | |
| 209 | + function _unsupportedIterableToArray$2(r, a) { | |
| 210 | + if (r) { | |
| 211 | + if ("string" == typeof r) return _arrayLikeToArray$2(r, a); | |
| 212 | + var t = {}.toString.call(r).slice(8, -1); | |
| 213 | + return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$2(r, a) : void 0; | |
| 214 | + } | |
| 215 | + } | |
| 216 | + __name(_unsupportedIterableToArray$2, "_unsupportedIterableToArray"); | |
| 192 | 217 | |
| 218 | +//#endregion | |
| 219 | +//#region node_modules/@babel/runtime/helpers/esm/nonIterableRest.js | |
| 220 | + function _nonIterableRest() { | |
| 221 | + throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); | |
| 222 | + } | |
| 193 | 223 | |
| 194 | -var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 195 | -Object.defineProperty(exports, "__esModule", ({ | |
| 196 | - value: true | |
| 197 | -})); | |
| 198 | -exports["default"] = void 0; | |
| 199 | -var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 200 | -var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 201 | -var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 202 | -var _get2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/get */ "../node_modules/@babel/runtime/helpers/get.js")); | |
| 203 | -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; } | |
| 204 | -var InstanceType = exports["default"] = /*#__PURE__*/function () { | |
| 205 | - function InstanceType() { | |
| 206 | - var _this = this; | |
| 207 | - (0, _classCallCheck2.default)(this, InstanceType); | |
| 208 | - // Since anonymous classes sometimes do not get validated by babel, do it manually. | |
| 209 | - var target = this instanceof InstanceType ? this.constructor : void 0; | |
| 210 | - var prototypes = []; | |
| 211 | - while (target.__proto__ && target.__proto__.name) { | |
| 212 | - prototypes.push(target.__proto__); | |
| 213 | - target = target.__proto__; | |
| 214 | - } | |
| 215 | - prototypes.reverse().forEach(function (proto) { | |
| 216 | - return _this instanceof proto; | |
| 217 | - }); | |
| 218 | - } | |
| 219 | - return (0, _createClass2.default)(InstanceType, null, [{ | |
| 220 | - key: Symbol.hasInstance, | |
| 221 | - value: function value(target) { | |
| 222 | - /** | |
| 223 | - * This is function extending being called each time JS uses instanceOf, since babel use it each time it create new class | |
| 224 | - * its give's opportunity to mange capabilities of instanceOf operator. | |
| 225 | - * saving current class each time will give option later to handle instanceOf manually. | |
| 226 | - */ | |
| 227 | - var result = _superPropGet(InstanceType, Symbol.hasInstance, this, 2)([target]); | |
| 224 | +//#endregion | |
| 225 | +//#region node_modules/@babel/runtime/helpers/esm/slicedToArray.js | |
| 226 | + function _slicedToArray(r, e) { | |
| 227 | + return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray$2(r, e) || _nonIterableRest(); | |
| 228 | + } | |
| 228 | 229 | |
| 229 | - // Act normal when validate a class, which does not have instance type. | |
| 230 | - if (target && !target.constructor.getInstanceType) { | |
| 231 | - return result; | |
| 232 | - } | |
| 233 | - if (target) { | |
| 234 | - if (!target.instanceTypes) { | |
| 235 | - target.instanceTypes = []; | |
| 236 | - } | |
| 237 | - if (!result) { | |
| 238 | - if (this.getInstanceType() === target.constructor.getInstanceType()) { | |
| 239 | - result = true; | |
| 240 | - } | |
| 241 | - } | |
| 242 | - if (result) { | |
| 243 | - var name = this.getInstanceType === InstanceType.getInstanceType ? 'BaseInstanceType' : this.getInstanceType(); | |
| 244 | - if (-1 === target.instanceTypes.indexOf(name)) { | |
| 245 | - target.instanceTypes.push(name); | |
| 246 | - } | |
| 247 | - } | |
| 248 | - } | |
| 249 | - if (!result && target) { | |
| 250 | - // Check if the given 'target', is instance of known types. | |
| 251 | - result = target.instanceTypes && Array.isArray(target.instanceTypes) && -1 !== target.instanceTypes.indexOf(this.getInstanceType()); | |
| 252 | - } | |
| 253 | - return result; | |
| 254 | - } | |
| 255 | - }, { | |
| 256 | - key: "getInstanceType", | |
| 257 | - value: function getInstanceType() { | |
| 258 | - elementorModules.ForceMethodImplementation(); | |
| 259 | - } | |
| 260 | - }]); | |
| 261 | -}(); | |
| 230 | +//#endregion | |
| 231 | +//#region node_modules/@babel/runtime/helpers/esm/superPropBase.js | |
| 232 | + function _superPropBase(t, o) { | |
| 233 | + for (; !{}.hasOwnProperty.call(t, o) && null !== (t = _getPrototypeOf(t));); | |
| 234 | + return t; | |
| 235 | + } | |
| 262 | 236 | |
| 263 | -/***/ }), | |
| 237 | +//#endregion | |
| 238 | +//#region node_modules/@babel/runtime/helpers/esm/get.js | |
| 239 | + function _get() { | |
| 240 | + return _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function(e, t, r) { | |
| 241 | + var p = _superPropBase(e, t); | |
| 242 | + if (p) { | |
| 243 | + var n = Object.getOwnPropertyDescriptor(p, t); | |
| 244 | + return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value; | |
| 245 | + } | |
| 246 | + }, _get.apply(null, arguments); | |
| 247 | + } | |
| 264 | 248 | |
| 265 | -/***/ "../assets/dev/js/modules/imports/module.js": | |
| 266 | -/*!**************************************************!*\ | |
| 267 | - !*** ../assets/dev/js/modules/imports/module.js ***! | |
| 268 | - \**************************************************/ | |
| 269 | -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 249 | +//#endregion | |
| 250 | +//#region assets/dev/js/modules/imports/instance-type.js | |
| 251 | + function _superPropGet$5(t, o, e, r) { | |
| 252 | + var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e); | |
| 253 | + return 2 & r && "function" == typeof p ? function(t) { | |
| 254 | + return p.apply(e, t); | |
| 255 | + } : p; | |
| 256 | + } | |
| 257 | + __name(_superPropGet$5, "_superPropGet"); | |
| 258 | + var InstanceType = /*#__PURE__*/ function() { | |
| 259 | + function InstanceType() { | |
| 260 | + var _this = this; | |
| 261 | + _classCallCheck(this, InstanceType); | |
| 262 | + var target = this instanceof InstanceType ? this.constructor : void 0; | |
| 263 | + var prototypes = []; | |
| 264 | + while (target.__proto__ && target.__proto__.name) { | |
| 265 | + prototypes.push(target.__proto__); | |
| 266 | + target = target.__proto__; | |
| 267 | + } | |
| 268 | + prototypes.reverse().forEach(function(proto) { | |
| 269 | + return _this instanceof proto; | |
| 270 | + }); | |
| 271 | + } | |
| 272 | + return _createClass(InstanceType, null, [{ | |
| 273 | + key: Symbol.hasInstance, | |
| 274 | + value: function value(target) { | |
| 275 | + /** | |
| 276 | + * This is function extending being called each time JS uses instanceOf, since babel use it each time it create new class | |
| 277 | + * its give's opportunity to mange capabilities of instanceOf operator. | |
| 278 | + * saving current class each time will give option later to handle instanceOf manually. | |
| 279 | + */ | |
| 280 | + var result = _superPropGet$5(InstanceType, Symbol.hasInstance, this, 2)([target]); | |
| 281 | + if (target && !target.constructor.getInstanceType) return result; | |
| 282 | + if (target) { | |
| 283 | + if (!target.instanceTypes) target.instanceTypes = []; | |
| 284 | + if (!result) { | |
| 285 | + if (this.getInstanceType() === target.constructor.getInstanceType()) result = true; | |
| 286 | + } | |
| 287 | + if (result) { | |
| 288 | + var name = this.getInstanceType === InstanceType.getInstanceType ? "BaseInstanceType" : this.getInstanceType(); | |
| 289 | + if (-1 === target.instanceTypes.indexOf(name)) target.instanceTypes.push(name); | |
| 290 | + } | |
| 291 | + } | |
| 292 | + if (!result && target) result = target.instanceTypes && Array.isArray(target.instanceTypes) && -1 !== target.instanceTypes.indexOf(this.getInstanceType()); | |
| 293 | + return result; | |
| 294 | + } | |
| 295 | + }, { | |
| 296 | + key: "getInstanceType", | |
| 297 | + value: function getInstanceType() { | |
| 298 | + elementorModules.ForceMethodImplementation(); | |
| 299 | + } | |
| 300 | + }]); | |
| 301 | + }(); | |
| 270 | 302 | |
| 271 | -"use strict"; | |
| 303 | +//#endregion | |
| 304 | +//#region assets/dev/js/editor/utils/is-instanceof.js | |
| 305 | + function _createForOfIteratorHelper$1(r, e) { | |
| 306 | + var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; | |
| 307 | + if (!t) { | |
| 308 | + if (Array.isArray(r) || (t = _unsupportedIterableToArray$1(r)) || e && r && "number" == typeof r.length) { | |
| 309 | + t && (r = t); | |
| 310 | + var _n = 0; | |
| 311 | + var F = function F() {}; | |
| 312 | + return { | |
| 313 | + s: F, | |
| 314 | + n: function n() { | |
| 315 | + return _n >= r.length ? { done: !0 } : { | |
| 316 | + done: !1, | |
| 317 | + value: r[_n++] | |
| 318 | + }; | |
| 319 | + }, | |
| 320 | + e: function e(r) { | |
| 321 | + throw r; | |
| 322 | + }, | |
| 323 | + f: F | |
| 324 | + }; | |
| 325 | + } | |
| 326 | + throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); | |
| 327 | + } | |
| 328 | + var o; | |
| 329 | + var a = !0; | |
| 330 | + var u = !1; | |
| 331 | + return { | |
| 332 | + s: function s() { | |
| 333 | + t = t.call(r); | |
| 334 | + }, | |
| 335 | + n: function n() { | |
| 336 | + var r = t.next(); | |
| 337 | + return a = r.done, r; | |
| 338 | + }, | |
| 339 | + e: function e(r) { | |
| 340 | + u = !0, o = r; | |
| 341 | + }, | |
| 342 | + f: function f() { | |
| 343 | + try { | |
| 344 | + a || null == t.return || t.return(); | |
| 345 | + } finally { | |
| 346 | + if (u) throw o; | |
| 347 | + } | |
| 348 | + } | |
| 349 | + }; | |
| 350 | + } | |
| 351 | + __name(_createForOfIteratorHelper$1, "_createForOfIteratorHelper"); | |
| 352 | + function _unsupportedIterableToArray$1(r, a) { | |
| 353 | + if (r) { | |
| 354 | + if ("string" == typeof r) return _arrayLikeToArray$1(r, a); | |
| 355 | + var t = {}.toString.call(r).slice(8, -1); | |
| 356 | + return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray$1(r, a) : void 0; | |
| 357 | + } | |
| 358 | + } | |
| 359 | + __name(_unsupportedIterableToArray$1, "_unsupportedIterableToArray"); | |
| 360 | + function _arrayLikeToArray$1(r, a) { | |
| 361 | + (null == a || a > r.length) && (a = r.length); | |
| 362 | + for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; | |
| 363 | + return n; | |
| 364 | + } | |
| 365 | + __name(_arrayLikeToArray$1, "_arrayLikeToArray"); | |
| 366 | + /** | |
| 367 | + * Some FileAPI objects such as FileList, DataTransferItem and DataTransferItemList has inconsistency with the retrieved | |
| 368 | + * object (from events, etc.) and the actual JavaScript object so a regular instanceof doesn't work. This function can | |
| 369 | + * check whether it's instanceof by using the objects constructor and prototype names. | |
| 370 | + * | |
| 371 | + * @param object | |
| 372 | + * @param constructors | |
| 373 | + * @return {boolean} | |
| 374 | + */ | |
| 375 | + var is_instanceof_default = /* @__PURE__ */ __name((function(object, constructors) { | |
| 376 | + constructors = Array.isArray(constructors) ? constructors : [constructors]; | |
| 377 | + var _iterator = _createForOfIteratorHelper$1(constructors); | |
| 378 | + var _step; | |
| 379 | + try { | |
| 380 | + for (_iterator.s(); !(_step = _iterator.n()).done;) { | |
| 381 | + var constructor = _step.value; | |
| 382 | + if (object.constructor.name === constructor.prototype[Symbol.toStringTag]) return true; | |
| 383 | + } | |
| 384 | + } catch (err) { | |
| 385 | + _iterator.e(err); | |
| 386 | + } finally { | |
| 387 | + _iterator.f(); | |
| 388 | + } | |
| 389 | + return false; | |
| 390 | + }), "default"); | |
| 272 | 391 | |
| 392 | +//#endregion | |
| 393 | +//#region assets/dev/js/modules/imports/args-object.js | |
| 394 | + init_typeof(); | |
| 395 | + function _callSuper$35(t, o, e) { | |
| 396 | + return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$36() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); | |
| 397 | + } | |
| 398 | + __name(_callSuper$35, "_callSuper"); | |
| 399 | + function _isNativeReflectConstruct$36() { | |
| 400 | + try { | |
| 401 | + var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); | |
| 402 | + } catch (t) {} | |
| 403 | + return (_isNativeReflectConstruct$36 = function _isNativeReflectConstruct() { | |
| 404 | + return !!t; | |
| 405 | + })(); | |
| 406 | + } | |
| 407 | + __name(_isNativeReflectConstruct$36, "_isNativeReflectConstruct"); | |
| 408 | + var ArgsObject = /*#__PURE__*/ function(_InstanceType) { | |
| 409 | + /** | |
| 410 | + * Function constructor(). | |
| 411 | + * | |
| 412 | + * Create ArgsObject. | |
| 413 | + * | |
| 414 | + * @param {{}} args | |
| 415 | + */ | |
| 416 | + function ArgsObject(args) { | |
| 417 | + var _this; | |
| 418 | + _classCallCheck(this, ArgsObject); | |
| 419 | + _this = _callSuper$35(this, ArgsObject); | |
| 420 | + _this.args = args; | |
| 421 | + return _this; | |
| 422 | + } | |
| 423 | + /** | |
| 424 | + * Function requireArgument(). | |
| 425 | + * | |
| 426 | + * Validate property in args. | |
| 427 | + * | |
| 428 | + * @param {string} property | |
| 429 | + * @param {{}} args | |
| 430 | + * | |
| 431 | + * @throws {Error} | |
| 432 | + */ | |
| 433 | + _inherits(ArgsObject, _InstanceType); | |
| 434 | + return _createClass(ArgsObject, [ | |
| 435 | + { | |
| 436 | + key: "requireArgument", | |
| 437 | + value: function requireArgument(property) { | |
| 438 | + var args = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : this.args; | |
| 439 | + if (!Object.prototype.hasOwnProperty.call(args, property)) throw Error("".concat(property, " is required.")); | |
| 440 | + } | |
| 441 | + }, | |
| 442 | + { | |
| 443 | + key: "requireArgumentType", | |
| 444 | + value: function requireArgumentType(property, type) { | |
| 445 | + var args = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : this.args; | |
| 446 | + this.requireArgument(property, args); | |
| 447 | + if (_typeof(args[property]) !== type) throw Error("".concat(property, " invalid type: ").concat(type, ".")); | |
| 448 | + } | |
| 449 | + }, | |
| 450 | + { | |
| 451 | + key: "requireArgumentInstance", | |
| 452 | + value: function requireArgumentInstance(property, instance) { | |
| 453 | + var args = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : this.args; | |
| 454 | + this.requireArgument(property, args); | |
| 455 | + if (!(args[property] instanceof instance) && !is_instanceof_default(args[property], instance)) throw Error("".concat(property, " invalid instance.")); | |
| 456 | + } | |
| 457 | + }, | |
| 458 | + { | |
| 459 | + key: "requireArgumentConstructor", | |
| 460 | + value: function requireArgumentConstructor(property, type) { | |
| 461 | + var args = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : this.args; | |
| 462 | + this.requireArgument(property, args); | |
| 463 | + if (args[property].constructor.toString() !== type.prototype.constructor.toString()) throw Error("".concat(property, " invalid constructor type.")); | |
| 464 | + } | |
| 465 | + } | |
| 466 | + ], [{ | |
| 467 | + key: "getInstanceType", | |
| 468 | + value: function getInstanceType() { | |
| 469 | + return "ArgsObject"; | |
| 470 | + } | |
| 471 | + }]); | |
| 472 | + }(InstanceType); | |
| 273 | 473 | |
| 274 | -var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 275 | -var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js")); | |
| 276 | -var Module = function Module() { | |
| 277 | - var $ = jQuery, | |
| 278 | - instanceParams = arguments, | |
| 279 | - self = this, | |
| 280 | - events = {}; | |
| 281 | - var settings; | |
| 282 | - var ensureClosureMethods = function ensureClosureMethods() { | |
| 283 | - $.each(self, function (methodName) { | |
| 284 | - var oldMethod = self[methodName]; | |
| 285 | - if ('function' !== typeof oldMethod) { | |
| 286 | - return; | |
| 287 | - } | |
| 288 | - self[methodName] = function () { | |
| 289 | - return oldMethod.apply(self, arguments); | |
| 290 | - }; | |
| 291 | - }); | |
| 292 | - }; | |
| 293 | - var initSettings = function initSettings() { | |
| 294 | - settings = self.getDefaultSettings(); | |
| 295 | - var instanceSettings = instanceParams[0]; | |
| 296 | - if (instanceSettings) { | |
| 297 | - $.extend(true, settings, instanceSettings); | |
| 298 | - } | |
| 299 | - }; | |
| 300 | - var init = function init() { | |
| 301 | - self.__construct.apply(self, instanceParams); | |
| 302 | - ensureClosureMethods(); | |
| 303 | - initSettings(); | |
| 304 | - self.trigger('init'); | |
| 305 | - }; | |
| 306 | - this.getItems = function (items, itemKey) { | |
| 307 | - if (itemKey) { | |
| 308 | - var keyStack = itemKey.split('.'), | |
| 309 | - currentKey = keyStack.splice(0, 1); | |
| 310 | - if (!keyStack.length) { | |
| 311 | - return items[currentKey]; | |
| 312 | - } | |
| 313 | - if (!items[currentKey]) { | |
| 314 | - return; | |
| 315 | - } | |
| 316 | - return this.getItems(items[currentKey], keyStack.join('.')); | |
| 317 | - } | |
| 318 | - return items; | |
| 319 | - }; | |
| 320 | - this.getSettings = function (setting) { | |
| 321 | - return this.getItems(settings, setting); | |
| 322 | - }; | |
| 323 | - this.setSettings = function (settingKey, value, settingsContainer) { | |
| 324 | - if (!settingsContainer) { | |
| 325 | - settingsContainer = settings; | |
| 326 | - } | |
| 327 | - if ('object' === (0, _typeof2.default)(settingKey)) { | |
| 328 | - $.extend(settingsContainer, settingKey); | |
| 329 | - return self; | |
| 330 | - } | |
| 331 | - var keyStack = settingKey.split('.'), | |
| 332 | - currentKey = keyStack.splice(0, 1); | |
| 333 | - if (!keyStack.length) { | |
| 334 | - settingsContainer[currentKey] = value; | |
| 335 | - return self; | |
| 336 | - } | |
| 337 | - if (!settingsContainer[currentKey]) { | |
| 338 | - settingsContainer[currentKey] = {}; | |
| 339 | - } | |
| 340 | - return self.setSettings(keyStack.join('.'), value, settingsContainer[currentKey]); | |
| 341 | - }; | |
| 342 | - this.getErrorMessage = function (type, functionName) { | |
| 343 | - var message; | |
| 344 | - switch (type) { | |
| 345 | - case 'forceMethodImplementation': | |
| 346 | - message = "The method '".concat(functionName, "' must to be implemented in the inheritor child."); | |
| 347 | - break; | |
| 348 | - default: | |
| 349 | - message = 'An error occurs'; | |
| 350 | - } | |
| 351 | - return message; | |
| 352 | - }; | |
| 474 | +//#endregion | |
| 475 | +//#region modules/web-cli/assets/js/utils/console.js | |
| 476 | + var Console = /*#__PURE__*/ function() { | |
| 477 | + function Console() { | |
| 478 | + _classCallCheck(this, Console); | |
| 479 | + } | |
| 480 | + return _createClass(Console, null, [{ | |
| 481 | + key: "error", | |
| 482 | + value: function error(message) { | |
| 483 | + if ($e.devTools) $e.devTools.log.error(message); | |
| 484 | + if (!(message instanceof $e.modules.HookBreak)) console.error(message); | |
| 485 | + } | |
| 486 | + }, { | |
| 487 | + key: "warn", | |
| 488 | + value: function warn() { | |
| 489 | + var _console; | |
| 490 | + var style = "font-size: 12px; background-image: url(\"".concat(elementorWebCliConfig.urls.assets, "images/logo-icon.png\"); background-repeat: no-repeat; background-size: contain;"); | |
| 491 | + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key]; | |
| 492 | + args.unshift("%c %c", style, ""); | |
| 493 | + (_console = console).warn.apply(_console, args); | |
| 494 | + } | |
| 495 | + }]); | |
| 496 | + }(); | |
| 353 | 497 | |
| 354 | - // TODO: This function should be deleted ?. | |
| 355 | - this.forceMethodImplementation = function (functionName) { | |
| 356 | - throw new Error(this.getErrorMessage('forceMethodImplementation', functionName)); | |
| 357 | - }; | |
| 358 | - this.on = function (eventName, callback) { | |
| 359 | - if ('object' === (0, _typeof2.default)(eventName)) { | |
| 360 | - $.each(eventName, function (singleEventName) { | |
| 361 | - self.on(singleEventName, this); | |
| 362 | - }); | |
| 363 | - return self; | |
| 364 | - } | |
| 365 | - var eventNames = eventName.split(' '); | |
| 366 | - eventNames.forEach(function (singleEventName) { | |
| 367 | - if (!events[singleEventName]) { | |
| 368 | - events[singleEventName] = []; | |
| 369 | - } | |
| 370 | - events[singleEventName].push(callback); | |
| 371 | - }); | |
| 372 | - return self; | |
| 373 | - }; | |
| 374 | - this.off = function (eventName, callback) { | |
| 375 | - if (!events[eventName]) { | |
| 376 | - return self; | |
| 377 | - } | |
| 378 | - if (!callback) { | |
| 379 | - delete events[eventName]; | |
| 380 | - return self; | |
| 381 | - } | |
| 382 | - var callbackIndex = events[eventName].indexOf(callback); | |
| 383 | - if (-1 !== callbackIndex) { | |
| 384 | - delete events[eventName][callbackIndex]; | |
| 385 | - | |
| 386 | - // Reset array index (for next off on same event). | |
| 387 | - events[eventName] = events[eventName].filter(function (val) { | |
| 388 | - return val; | |
| 389 | - }); | |
| 390 | - } | |
| 391 | - return self; | |
| 392 | - }; | |
| 393 | - this.trigger = function (eventName) { | |
| 394 | - var methodName = 'on' + eventName[0].toUpperCase() + eventName.slice(1), | |
| 395 | - params = Array.prototype.slice.call(arguments, 1); | |
| 396 | - if (self[methodName]) { | |
| 397 | - self[methodName].apply(self, params); | |
| 398 | - } | |
| 399 | - var callbacks = events[eventName]; | |
| 400 | - if (!callbacks) { | |
| 401 | - return self; | |
| 402 | - } | |
| 403 | - $.each(callbacks, function (index, callback) { | |
| 404 | - callback.apply(self, params); | |
| 405 | - }); | |
| 406 | - return self; | |
| 407 | - }; | |
| 408 | - init(); | |
| 409 | -}; | |
| 410 | -Module.prototype.__construct = function () {}; | |
| 411 | -Module.prototype.getDefaultSettings = function () { | |
| 412 | - return {}; | |
| 413 | -}; | |
| 414 | -Module.prototype.getConstructorID = function () { | |
| 415 | - return this.constructor.name; | |
| 416 | -}; | |
| 417 | -Module.extend = function (properties) { | |
| 418 | - var $ = jQuery, | |
| 419 | - parent = this; | |
| 420 | - var child = function child() { | |
| 421 | - return parent.apply(this, arguments); | |
| 422 | - }; | |
| 423 | - $.extend(child, parent); | |
| 424 | - child.prototype = Object.create($.extend({}, parent.prototype, properties)); | |
| 425 | - child.prototype.constructor = child; | |
| 426 | - child.__super__ = parent.prototype; | |
| 427 | - return child; | |
| 428 | -}; | |
| 429 | -module.exports = Module; | |
| 430 | - | |
| 431 | -/***/ }), | |
| 432 | - | |
| 433 | -/***/ "../modules/web-cli/assets/js/api.js": | |
| 434 | -/*!*******************************************!*\ | |
| 435 | - !*** ../modules/web-cli/assets/js/api.js ***! | |
| 436 | - \*******************************************/ | |
| 437 | -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 438 | - | |
| 439 | -"use strict"; | |
| 440 | - | |
| 441 | - | |
| 442 | -var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 443 | -var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js"); | |
| 444 | -Object.defineProperty(exports, "__esModule", ({ | |
| 445 | - value: true | |
| 446 | -})); | |
| 447 | -exports["default"] = void 0; | |
| 448 | -var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 449 | -var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 450 | -var _backwardsCompatibility = _interopRequireDefault(__webpack_require__(/*! ./core/backwards-compatibility */ "../modules/web-cli/assets/js/core/backwards-compatibility.js")); | |
| 451 | -var _commandBase = _interopRequireDefault(__webpack_require__(/*! ./modules/command-base */ "../modules/web-cli/assets/js/modules/command-base.js")); | |
| 452 | -var _commandInternalBase = _interopRequireDefault(__webpack_require__(/*! ./modules/command-internal-base */ "../modules/web-cli/assets/js/modules/command-internal-base.js")); | |
| 453 | -var _commandData = _interopRequireDefault(__webpack_require__(/*! ./modules/command-data */ "../modules/web-cli/assets/js/modules/command-data.js")); | |
| 454 | -var _commands = _interopRequireDefault(__webpack_require__(/*! ./core/commands */ "../modules/web-cli/assets/js/core/commands.js")); | |
| 455 | -var _commandsInternal = _interopRequireDefault(__webpack_require__(/*! ./core/commands-internal */ "../modules/web-cli/assets/js/core/commands-internal.js")); | |
| 456 | -var _componentBase = _interopRequireDefault(__webpack_require__(/*! ./modules/component-base */ "../modules/web-cli/assets/js/modules/component-base.js")); | |
| 457 | -var _componentModalBase = _interopRequireDefault(__webpack_require__(/*! ./modules/component-modal-base */ "../modules/web-cli/assets/js/modules/component-modal-base.js")); | |
| 458 | -var _components = _interopRequireDefault(__webpack_require__(/*! ./core/components */ "../modules/web-cli/assets/js/core/components.js")); | |
| 459 | -var _data = _interopRequireDefault(__webpack_require__(/*! ./core/data.js */ "../modules/web-cli/assets/js/core/data.js")); | |
| 460 | -var _hashCommands = _interopRequireDefault(__webpack_require__(/*! ./extras/hash-commands */ "../modules/web-cli/assets/js/extras/hash-commands.js")); | |
| 461 | -var _hookBreak = _interopRequireDefault(__webpack_require__(/*! ./modules/hook-break */ "../modules/web-cli/assets/js/modules/hook-break.js")); | |
| 462 | -var _hooks = _interopRequireDefault(__webpack_require__(/*! ./core/hooks */ "../modules/web-cli/assets/js/core/hooks.js")); | |
| 463 | -var _routes = _interopRequireDefault(__webpack_require__(/*! ./core/routes */ "../modules/web-cli/assets/js/core/routes.js")); | |
| 464 | -var _shortcuts = _interopRequireDefault(__webpack_require__(/*! ./core/shortcuts */ "../modules/web-cli/assets/js/core/shortcuts.js")); | |
| 465 | -var _store = _interopRequireDefault(__webpack_require__(/*! ./core/store */ "../modules/web-cli/assets/js/core/store.js")); | |
| 466 | -var _uiStates = _interopRequireDefault(__webpack_require__(/*! ./core/ui-states */ "../modules/web-cli/assets/js/core/ui-states.js")); | |
| 467 | -var hookData = _interopRequireWildcard(__webpack_require__(/*! ./modules/hooks/data/ */ "../modules/web-cli/assets/js/modules/hooks/data/index.js")); | |
| 468 | -var hookUI = _interopRequireWildcard(__webpack_require__(/*! ./modules/hooks/ui */ "../modules/web-cli/assets/js/modules/hooks/ui/index.js")); | |
| 469 | -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); } | |
| 470 | -/* Alphabetical order */ | |
| 471 | -var API = exports["default"] = /*#__PURE__*/function () { | |
| 472 | - /** | |
| 473 | - * Function constructor(). | |
| 474 | - * | |
| 475 | - * Create's 'elementor' api. | |
| 476 | - */ | |
| 477 | - function API() { | |
| 478 | - (0, _classCallCheck2.default)(this, API); | |
| 479 | - this.components = new _components.default(); | |
| 480 | - this.commands = new _commands.default(); | |
| 481 | - this.commandsInternal = new _commandsInternal.default(); | |
| 482 | - this.hooks = new _hooks.default(); | |
| 483 | - this.routes = new _routes.default(); | |
| 484 | - this.shortcuts = new _shortcuts.default(jQuery(window)); | |
| 485 | - this.data = new _data.default(); | |
| 486 | - this.store = new _store.default(); | |
| 487 | - this.uiStates = new _uiStates.default(); | |
| 488 | - this.modules = { | |
| 489 | - CommandBase: _commandBase.default, | |
| 490 | - CommandInternalBase: _commandInternalBase.default, | |
| 491 | - CommandData: _commandData.default, | |
| 492 | - ComponentBase: _componentBase.default, | |
| 493 | - ComponentModalBase: _componentModalBase.default, | |
| 494 | - HookBreak: _hookBreak.default, | |
| 495 | - hookData: hookData, | |
| 496 | - hookUI: hookUI | |
| 497 | - }; | |
| 498 | - this.extras = { | |
| 499 | - hashCommands: new _hashCommands.default() | |
| 500 | - }; | |
| 501 | - | |
| 502 | - // Backwards compatibility should be last, in order to handle others. | |
| 503 | - this.bc = new _backwardsCompatibility.default(); | |
| 504 | - } | |
| 505 | - | |
| 506 | - /** | |
| 507 | - * Function run(). | |
| 508 | - * | |
| 509 | - * Alias of `$e.commands.run()`. | |
| 510 | - * | |
| 511 | - * @param {string} command | |
| 512 | - * @param {*} [args={}] | |
| 513 | - * | |
| 514 | - * @return {*} result | |
| 515 | - */ | |
| 516 | - return (0, _createClass2.default)(API, [{ | |
| 517 | - key: "run", | |
| 518 | - value: function run(command) { | |
| 519 | - var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | |
| 520 | - return $e.commands.run(command, args); | |
| 521 | - } | |
| 522 | - | |
| 523 | - /** | |
| 524 | - * Function internal(). | |
| 525 | - * | |
| 526 | - * Alias of `$e.commandsInternal.run()`. | |
| 527 | - * | |
| 528 | - * @param {string} command | |
| 529 | - * @param {*} [args={}] | |
| 530 | - * | |
| 531 | - * @return {boolean} result | |
| 532 | - */ | |
| 533 | - }, { | |
| 534 | - key: "internal", | |
| 535 | - value: function internal(command) { | |
| 536 | - var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | |
| 537 | - return $e.commandsInternal.run(command, args); | |
| 538 | - } | |
| 539 | - | |
| 540 | - /** | |
| 541 | - * Function route(). | |
| 542 | - * | |
| 543 | - * Alias of `$e.routes.to()`. | |
| 544 | - * | |
| 545 | - * @param {string} route | |
| 546 | - * @param {*} [args={}] | |
| 547 | - * @param {Object} [options] | |
| 548 | - */ | |
| 549 | - }, { | |
| 550 | - key: "route", | |
| 551 | - value: function route(_route) { | |
| 552 | - var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | |
| 553 | - var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : { | |
| 554 | - history: true | |
| 555 | - }; | |
| 556 | - return $e.routes.to(_route, args, options); | |
| 557 | - } | |
| 558 | - | |
| 559 | - // TODO: shortcut(); | |
| 560 | - }]); | |
| 561 | -}(); | |
| 562 | - | |
| 563 | -/***/ }), | |
| 564 | - | |
| 565 | -/***/ "../modules/web-cli/assets/js/core/backwards-compatibility.js": | |
| 566 | -/*!********************************************************************!*\ | |
| 567 | - !*** ../modules/web-cli/assets/js/core/backwards-compatibility.js ***! | |
| 568 | - \********************************************************************/ | |
| 569 | -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 570 | - | |
| 571 | -"use strict"; | |
| 572 | - | |
| 573 | - | |
| 574 | -var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 575 | -Object.defineProperty(exports, "__esModule", ({ | |
| 576 | - value: true | |
| 577 | -})); | |
| 578 | -exports["default"] = void 0; | |
| 579 | -var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 580 | -var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 581 | -var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 582 | -var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 583 | -var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 584 | -var _componentBase = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/component-base */ "../modules/web-cli/assets/js/modules/component-base.js")); | |
| 585 | -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)); } | |
| 586 | -function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } | |
| 587 | -var BackwardsCompatibility = exports["default"] = /*#__PURE__*/function () { | |
| 588 | - function BackwardsCompatibility() { | |
| 589 | - (0, _classCallCheck2.default)(this, BackwardsCompatibility); | |
| 590 | - } | |
| 591 | - return (0, _createClass2.default)(BackwardsCompatibility, [{ | |
| 592 | - key: "ensureTab", | |
| 593 | - value: function ensureTab(namespace, tabSlug) { | |
| 594 | - var page = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : ''; | |
| 595 | - var component = $e.components.get(namespace); | |
| 596 | - if (!component) { | |
| 597 | - var Component = /*#__PURE__*/function (_ComponentBase) { | |
| 598 | - function Component() { | |
| 599 | - (0, _classCallCheck2.default)(this, Component); | |
| 600 | - return _callSuper(this, Component, arguments); | |
| 601 | - } | |
| 602 | - (0, _inherits2.default)(Component, _ComponentBase); | |
| 603 | - return (0, _createClass2.default)(Component, [{ | |
| 604 | - key: "getNamespace", | |
| 605 | - value: function getNamespace() { | |
| 606 | - return namespace; | |
| 607 | - } | |
| 608 | - }, { | |
| 609 | - key: "renderTab", | |
| 610 | - value: function renderTab(tab) { | |
| 611 | - elementor.getPanelView().setPage(page).activateTab(tab); | |
| 612 | - } | |
| 613 | - }]); | |
| 614 | - }(_componentBase.default); | |
| 615 | - component = $e.components.register(new Component()); | |
| 616 | - } | |
| 617 | - if (!component.hasTab(tabSlug) && elementor.config.tabs[tabSlug]) { | |
| 618 | - component.addTab(tabSlug, { | |
| 619 | - title: elementor.config.tabs[tabSlug] | |
| 620 | - }); | |
| 621 | - } | |
| 622 | - } | |
| 623 | - }]); | |
| 624 | -}(); | |
| 625 | - | |
| 626 | -/***/ }), | |
| 627 | - | |
| 628 | -/***/ "../modules/web-cli/assets/js/core/backwards-compatibility/commands.js": | |
| 629 | -/*!*****************************************************************************!*\ | |
| 630 | - !*** ../modules/web-cli/assets/js/core/backwards-compatibility/commands.js ***! | |
| 631 | - \*****************************************************************************/ | |
| 632 | -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 633 | - | |
| 634 | -"use strict"; | |
| 635 | - | |
| 636 | - | |
| 637 | -var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 638 | -Object.defineProperty(exports, "__esModule", ({ | |
| 639 | - value: true | |
| 640 | -})); | |
| 641 | -exports["default"] = void 0; | |
| 642 | -var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 643 | -var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 644 | -var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 645 | -var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 646 | -var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 647 | -var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js")); | |
| 648 | -var _module = _interopRequireDefault(__webpack_require__(/*! elementor-assets-js/modules/imports/module.js */ "../assets/dev/js/modules/imports/module.js")); | |
| 649 | -var _deprecation = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/deprecation */ "../modules/web-cli/assets/js/utils/deprecation.js")); | |
| 650 | -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)); } | |
| 651 | -function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } | |
| 652 | -var CommandsBackwardsCompatibility = exports["default"] = /*#__PURE__*/function (_Module) { | |
| 653 | - function CommandsBackwardsCompatibility() { | |
| 654 | - var _this; | |
| 655 | - (0, _classCallCheck2.default)(this, CommandsBackwardsCompatibility); | |
| 656 | - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { | |
| 657 | - args[_key] = arguments[_key]; | |
| 658 | - } | |
| 659 | - _this = _callSuper(this, CommandsBackwardsCompatibility, [].concat(args)); | |
| 660 | - (0, _defineProperty2.default)(_this, "on", function (eventName, callback) { | |
| 661 | - if ('run' === eventName) { | |
| 662 | - var componentName = _this.getConstructorID(); | |
| 663 | - | |
| 664 | - // Regex takes the first letter and convert it to lower case. | |
| 665 | - componentName = componentName.replace(/^./, function (val) { | |
| 666 | - return val.toLowerCase(); | |
| 667 | - }); | |
| 668 | - _deprecation.default.deprecated("$e.".concat(componentName, ".on( 'run', ... )"), '3.0.0', "$e.".concat(componentName, ".on( 'run:before', ... )")); | |
| 669 | - _this.onOrig('run:before', callback); | |
| 670 | - return; | |
| 671 | - } | |
| 672 | - _this.onOrig(eventName, callback); | |
| 673 | - }); | |
| 674 | - return _this; | |
| 675 | - } | |
| 676 | - (0, _inherits2.default)(CommandsBackwardsCompatibility, _Module); | |
| 677 | - return (0, _createClass2.default)(CommandsBackwardsCompatibility, [{ | |
| 678 | - key: "__construct", | |
| 679 | - value: function __construct() { | |
| 680 | - this.onOrig = this.on; | |
| 681 | - } | |
| 682 | - }]); | |
| 683 | -}(_module.default); | |
| 684 | - | |
| 685 | -/***/ }), | |
| 686 | - | |
| 687 | -/***/ "../modules/web-cli/assets/js/core/commands-internal.js": | |
| 688 | -/*!**************************************************************!*\ | |
| 689 | - !*** ../modules/web-cli/assets/js/core/commands-internal.js ***! | |
| 690 | - \**************************************************************/ | |
| 691 | -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 692 | - | |
| 693 | -"use strict"; | |
| 694 | - | |
| 695 | - | |
| 696 | -var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 697 | -Object.defineProperty(exports, "__esModule", ({ | |
| 698 | - value: true | |
| 699 | -})); | |
| 700 | -exports["default"] = void 0; | |
| 701 | -var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 702 | -var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 703 | -var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 704 | -var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 705 | -var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 706 | -var _commands = _interopRequireDefault(__webpack_require__(/*! ./commands.js */ "../modules/web-cli/assets/js/core/commands.js")); | |
| 707 | -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)); } | |
| 708 | -function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } | |
| 709 | -var CommandsInternal = exports["default"] = /*#__PURE__*/function (_Commands) { | |
| 710 | - function CommandsInternal() { | |
| 711 | - (0, _classCallCheck2.default)(this, CommandsInternal); | |
| 712 | - return _callSuper(this, CommandsInternal, arguments); | |
| 713 | - } | |
| 714 | - (0, _inherits2.default)(CommandsInternal, _Commands); | |
| 715 | - return (0, _createClass2.default)(CommandsInternal, [{ | |
| 716 | - key: "error", | |
| 717 | - value: function error(message) { | |
| 718 | - throw Error('Commands internal: ' + message); | |
| 719 | - } | |
| 720 | - }]); | |
| 721 | -}(_commands.default); | |
| 722 | - | |
| 723 | -/***/ }), | |
| 724 | - | |
| 725 | -/***/ "../modules/web-cli/assets/js/core/commands.js": | |
| 726 | -/*!*****************************************************!*\ | |
| 727 | - !*** ../modules/web-cli/assets/js/core/commands.js ***! | |
| 728 | - \*****************************************************/ | |
| 729 | -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 730 | - | |
| 731 | -"use strict"; | |
| 732 | - | |
| 733 | - | |
| 734 | -var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 735 | -Object.defineProperty(exports, "__esModule", ({ | |
| 736 | - value: true | |
| 737 | -})); | |
| 738 | -exports["default"] = void 0; | |
| 739 | -var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ "../node_modules/@babel/runtime/regenerator/index.js")); | |
| 740 | -var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "../node_modules/@babel/runtime/helpers/asyncToGenerator.js")); | |
| 741 | -var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js")); | |
| 742 | -var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 743 | -var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 744 | -var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 745 | -var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 746 | -var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 747 | -var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js")); | |
| 748 | -var _commands = _interopRequireDefault(__webpack_require__(/*! ./backwards-compatibility/commands */ "../modules/web-cli/assets/js/core/backwards-compatibility/commands.js")); | |
| 749 | -var _commandBase = _interopRequireDefault(__webpack_require__(/*! ../modules/command-base */ "../modules/web-cli/assets/js/modules/command-base.js")); | |
| 750 | -var _console = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/console */ "../modules/web-cli/assets/js/utils/console.js")); | |
| 751 | -var _deprecation = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/deprecation */ "../modules/web-cli/assets/js/utils/deprecation.js")); | |
| 752 | -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; } | |
| 753 | -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; } | |
| 754 | -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)); } | |
| 755 | -function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } | |
| 498 | +//#endregion | |
| 499 | +//#region modules/web-cli/assets/js/utils/deprecation.js | |
| 756 | 500 | /** |
| 757 | - * @typedef {import('../modules/component-base')} ComponentBase | |
| 758 | - */ | |
| 759 | -/** | |
| 760 | - * @typedef {import('../modules/command-base')} CommandBase | |
| 761 | - */ | |
| 762 | -/** | |
| 763 | - * @typedef {{}} Component | |
| 764 | - */ | |
| 765 | -var Commands = exports["default"] = /*#__PURE__*/function (_CommandsBackwardsCom) { | |
| 766 | - /** | |
| 767 | - * Function constructor(). | |
| 768 | - * | |
| 769 | - * Create `$e.commands` API. | |
| 770 | - * | |
| 771 | - * @param {{}} args | |
| 772 | - */ | |
| 773 | - function Commands() { | |
| 774 | - var _this; | |
| 775 | - (0, _classCallCheck2.default)(this, Commands); | |
| 776 | - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { | |
| 777 | - args[_key] = arguments[_key]; | |
| 778 | - } | |
| 779 | - _this = _callSuper(this, Commands, [].concat(args)); | |
| 780 | - _this.current = {}; | |
| 781 | - _this.currentArgs = {}; | |
| 782 | - _this.currentTrace = []; | |
| 783 | - _this.commands = {}; | |
| 784 | - _this.components = {}; | |
| 785 | - Object.defineProperty(_this, 'classes', { | |
| 786 | - get: function get() { | |
| 787 | - _deprecation.default.deprecated('$e.commands.classes', '3.7.0', '$e.commands.getCommandClass(), $e.commandsInternal.getCommandClass(), $e.data.getCommandClass(), $e.routes.getCommandClass() according to the requested command infra-structure,'); | |
| 788 | - return _objectSpread(_objectSpread(_objectSpread(_objectSpread({}, $e.commands.commands), $e.commandsInternal.commands), $e.data.commands), $e.routes.commands); | |
| 789 | - } | |
| 790 | - }); | |
| 791 | - return _this; | |
| 792 | - } | |
| 501 | + * @typedef {Object} Version | |
| 502 | + * @property {number} major1 The first number | |
| 503 | + * @property {number} major2 The second number | |
| 504 | + * @property {number} minor The third number | |
| 505 | + * @property {string} build The fourth number | |
| 506 | + */ | |
| 507 | + var softDeprecated = function softDeprecated(name, version, replacement) { | |
| 508 | + if (elementorWebCliConfig.isDebug) deprecatedMessage("soft", name, version, replacement); | |
| 509 | + }; | |
| 510 | + var hardDeprecated = function hardDeprecated(name, version, replacement) { | |
| 511 | + deprecatedMessage("hard", name, version, replacement); | |
| 512 | + }; | |
| 513 | + var deprecatedMessage = function deprecatedMessage(type, name, version, replacement) { | |
| 514 | + var message = "`".concat(name, "` is ").concat(type, " deprecated since ").concat(version); | |
| 515 | + if (replacement) message += " - Use `".concat(replacement, "` instead"); | |
| 516 | + Console.warn(message); | |
| 517 | + }; | |
| 518 | + var Deprecation = /*#__PURE__*/ function() { | |
| 519 | + function Deprecation() { | |
| 520 | + _classCallCheck(this, Deprecation); | |
| 521 | + } | |
| 522 | + return _createClass(Deprecation, null, [ | |
| 523 | + { | |
| 524 | + key: "deprecated", | |
| 525 | + value: function deprecated(name, version, replacement) { | |
| 526 | + if (this.isHardDeprecated(version)) hardDeprecated(name, version, replacement); | |
| 527 | + else softDeprecated(name, version, replacement); | |
| 528 | + } | |
| 529 | + }, | |
| 530 | + { | |
| 531 | + key: "parseVersion", | |
| 532 | + value: function parseVersion(version) { | |
| 533 | + var versionParts = version.split("."); | |
| 534 | + if (versionParts.length < 3 || versionParts.length > 4) throw new RangeError("Invalid Semantic Version string provided"); | |
| 535 | + var _versionParts = _slicedToArray(versionParts, 4); | |
| 536 | + var major1 = _versionParts[0]; | |
| 537 | + var major2 = _versionParts[1]; | |
| 538 | + var minor = _versionParts[2]; | |
| 539 | + var _versionParts$ = _versionParts[3]; | |
| 540 | + return { | |
| 541 | + major1: parseInt(major1), | |
| 542 | + major2: parseInt(major2), | |
| 543 | + minor: parseInt(minor), | |
| 544 | + build: _versionParts$ === void 0 ? "" : _versionParts$ | |
| 545 | + }; | |
| 546 | + } | |
| 547 | + }, | |
| 548 | + { | |
| 549 | + key: "getTotalMajor", | |
| 550 | + value: function getTotalMajor(versionObj) { | |
| 551 | + var total = parseInt("".concat(versionObj.major1).concat(versionObj.major2, "0")); | |
| 552 | + total = Number((total / 10).toFixed(0)); | |
| 553 | + if (versionObj.major2 > 9) total = versionObj.major2 - 9; | |
| 554 | + return total; | |
| 555 | + } | |
| 556 | + }, | |
| 557 | + { | |
| 558 | + key: "compareVersion", | |
| 559 | + value: function compareVersion(version1, version2) { | |
| 560 | + var _this = this; | |
| 561 | + return [this.parseVersion(version1), this.parseVersion(version2)].map(function(versionObj) { | |
| 562 | + return _this.getTotalMajor(versionObj); | |
| 563 | + }).reduce(function(acc, major) { | |
| 564 | + return acc - major; | |
| 565 | + }); | |
| 566 | + } | |
| 567 | + }, | |
| 568 | + { | |
| 569 | + key: "isSoftDeprecated", | |
| 570 | + value: function isSoftDeprecated(version) { | |
| 571 | + return this.compareVersion(version, elementorWebCliConfig.version) <= 4; | |
| 572 | + } | |
| 573 | + }, | |
| 574 | + { | |
| 575 | + key: "isHardDeprecated", | |
| 576 | + value: function isHardDeprecated(version) { | |
| 577 | + var total = this.compareVersion(version, elementorWebCliConfig.version); | |
| 578 | + return total < 0 || total >= 8; | |
| 579 | + } | |
| 580 | + } | |
| 581 | + ]); | |
| 582 | + }(); | |
| 793 | 583 | |
| 794 | - /** | |
| 795 | - * @param {string} id | |
| 796 | - * @return {CommandBase} command class | |
| 797 | - */ | |
| 798 | - (0, _inherits2.default)(Commands, _CommandsBackwardsCom); | |
| 799 | - return (0, _createClass2.default)(Commands, [{ | |
| 800 | - key: "getCommandClass", | |
| 801 | - value: function getCommandClass(id) { | |
| 802 | - return this.commands[id]; | |
| 803 | - } | |
| 584 | +//#endregion | |
| 585 | +//#region modules/web-cli/assets/js/modules/command-infra.js | |
| 586 | + function _callSuper$34(t, o, e) { | |
| 587 | + return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$35() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); | |
| 588 | + } | |
| 589 | + __name(_callSuper$34, "_callSuper"); | |
| 590 | + function _isNativeReflectConstruct$35() { | |
| 591 | + try { | |
| 592 | + var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); | |
| 593 | + } catch (t) {} | |
| 594 | + return (_isNativeReflectConstruct$35 = function _isNativeReflectConstruct() { | |
| 595 | + return !!t; | |
| 596 | + })(); | |
| 597 | + } | |
| 598 | + __name(_isNativeReflectConstruct$35, "_isNativeReflectConstruct"); | |
| 599 | + /** | |
| 600 | + * @typedef {import('../modules/component-base')} ComponentBase | |
| 601 | + */ | |
| 602 | + var CommandInfra = /*#__PURE__*/ function(_ArgsObject) { | |
| 603 | + /** | |
| 604 | + * Function constructor(). | |
| 605 | + * | |
| 606 | + * Create Commands Base. | |
| 607 | + * | |
| 608 | + * @param {{}} args | |
| 609 | + */ | |
| 610 | + function CommandInfra() { | |
| 611 | + var _this; | |
| 612 | + var args = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; | |
| 613 | + _classCallCheck(this, CommandInfra); | |
| 614 | + _this = _callSuper$34(this, CommandInfra, [args]); | |
| 615 | + if (!_this.constructor.registerConfig) throw RangeError("Doing it wrong: Each command type should have `registerConfig`."); | |
| 616 | + _this.command = _this.constructor.getCommand(); | |
| 617 | + _this.component = _this.constructor.getComponent(); | |
| 618 | + _this.initialize(args); | |
| 619 | + args = _this.args; | |
| 620 | + _this.validateArgs(args); | |
| 621 | + return _this; | |
| 622 | + } | |
| 623 | + /** | |
| 624 | + * Function initialize(). | |
| 625 | + * | |
| 626 | + * Initialize command, called after construction. | |
| 627 | + * | |
| 628 | + * @param {{}} args | |
| 629 | + */ | |
| 630 | + _inherits(CommandInfra, _ArgsObject); | |
| 631 | + return _createClass(CommandInfra, [ | |
| 632 | + { | |
| 633 | + key: "currentCommand", | |
| 634 | + get: function get() { | |
| 635 | + Deprecation.deprecated("this.currentCommand", "3.7.0", "this.command"); | |
| 636 | + return this.command; | |
| 637 | + } | |
| 638 | + }, | |
| 639 | + { | |
| 640 | + key: "initialize", | |
| 641 | + value: function initialize() { | |
| 642 | + arguments.length > 0 && arguments[0] !== void 0 && arguments[0]; | |
| 643 | + } | |
| 644 | + }, | |
| 645 | + { | |
| 646 | + key: "validateArgs", | |
| 647 | + value: function validateArgs() { | |
| 648 | + arguments.length > 0 && arguments[0] !== void 0 && arguments[0]; | |
| 649 | + } | |
| 650 | + }, | |
| 651 | + { | |
| 652 | + key: "apply", | |
| 653 | + value: function apply() { | |
| 654 | + arguments.length > 0 && arguments[0] !== void 0 && arguments[0]; | |
| 655 | + elementorModules.ForceMethodImplementation(); | |
| 656 | + } | |
| 657 | + }, | |
| 658 | + { | |
| 659 | + key: "run", | |
| 660 | + value: function run() { | |
| 661 | + return this.apply(this.args); | |
| 662 | + } | |
| 663 | + }, | |
| 664 | + { | |
| 665 | + key: "onBeforeRun", | |
| 666 | + value: function onBeforeRun() { | |
| 667 | + arguments.length > 0 && arguments[0] !== void 0 && arguments[0]; | |
| 668 | + } | |
| 669 | + }, | |
| 670 | + { | |
| 671 | + key: "onAfterRun", | |
| 672 | + value: function onAfterRun() { | |
| 673 | + arguments.length > 0 && arguments[0] !== void 0 && arguments[0]; | |
| 674 | + arguments.length > 1 && arguments[1]; | |
| 675 | + } | |
| 676 | + }, | |
| 677 | + { | |
| 678 | + key: "onBeforeApply", | |
| 679 | + value: function onBeforeApply() { | |
| 680 | + arguments.length > 0 && arguments[0] !== void 0 && arguments[0]; | |
| 681 | + } | |
| 682 | + }, | |
| 683 | + { | |
| 684 | + key: "onAfterApply", | |
| 685 | + value: function onAfterApply() { | |
| 686 | + arguments.length > 0 && arguments[0] !== void 0 && arguments[0]; | |
| 687 | + arguments.length > 1 && arguments[1]; | |
| 688 | + } | |
| 689 | + }, | |
| 690 | + { | |
| 691 | + key: "onCatchApply", | |
| 692 | + value: function onCatchApply(e) {} | |
| 693 | + } | |
| 694 | + ], [ | |
| 695 | + { | |
| 696 | + key: "getInstanceType", | |
| 697 | + value: function getInstanceType() { | |
| 698 | + return "CommandInfra"; | |
| 699 | + } | |
| 700 | + }, | |
| 701 | + { | |
| 702 | + key: "getInfo", | |
| 703 | + value: function getInfo() { | |
| 704 | + return {}; | |
| 705 | + } | |
| 706 | + }, | |
| 707 | + { | |
| 708 | + key: "getCommand", | |
| 709 | + value: function getCommand() { | |
| 710 | + return this.registerConfig.command; | |
| 711 | + } | |
| 712 | + }, | |
| 713 | + { | |
| 714 | + key: "getComponent", | |
| 715 | + value: function getComponent() { | |
| 716 | + return this.registerConfig.component; | |
| 717 | + } | |
| 718 | + }, | |
| 719 | + { | |
| 720 | + key: "setRegisterConfig", | |
| 721 | + value: function setRegisterConfig(config) { | |
| 722 | + this.registerConfig = Object.freeze(config); | |
| 723 | + } | |
| 724 | + } | |
| 725 | + ]); | |
| 726 | + }(ArgsObject); | |
| 727 | + /** | |
| 728 | + * @type {Object} | |
| 729 | + */ | |
| 730 | + _defineProperty(CommandInfra, "registerConfig", null); | |
| 804 | 731 | |
| 805 | - /** | |
| 806 | - * Function getAll(). | |
| 807 | - * | |
| 808 | - * Receive all loaded commands. | |
| 809 | - * | |
| 810 | - * @return {string[]} commands | |
| 811 | - */ | |
| 812 | - }, { | |
| 813 | - key: "getAll", | |
| 814 | - value: function getAll() { | |
| 815 | - return Object.keys(this.commands).sort(); | |
| 816 | - } | |
| 732 | +//#endregion | |
| 733 | +//#region modules/web-cli/assets/js/modules/command-base.js | |
| 734 | + function _callSuper$33(t, o, e) { | |
| 735 | + return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$34() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); | |
| 736 | + } | |
| 737 | + __name(_callSuper$33, "_callSuper"); | |
| 738 | + function _isNativeReflectConstruct$34() { | |
| 739 | + try { | |
| 740 | + var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); | |
| 741 | + } catch (t) {} | |
| 742 | + return (_isNativeReflectConstruct$34 = function _isNativeReflectConstruct() { | |
| 743 | + return !!t; | |
| 744 | + })(); | |
| 745 | + } | |
| 746 | + __name(_isNativeReflectConstruct$34, "_isNativeReflectConstruct"); | |
| 747 | + /** | |
| 748 | + * @name $e.modules.CommandBase | |
| 749 | + */ | |
| 750 | + var CommandBase = /*#__PURE__*/ function(_CommandInfra) { | |
| 751 | + function CommandBase() { | |
| 752 | + _classCallCheck(this, CommandBase); | |
| 753 | + return _callSuper$33(this, CommandBase, arguments); | |
| 754 | + } | |
| 755 | + _inherits(CommandBase, _CommandInfra); | |
| 756 | + return _createClass(CommandBase, [ | |
| 757 | + { | |
| 758 | + key: "onBeforeRun", | |
| 759 | + value: function onBeforeRun() { | |
| 760 | + var args = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; | |
| 761 | + $e.hooks.runUIBefore(this.command, args); | |
| 762 | + } | |
| 763 | + }, | |
| 764 | + { | |
| 765 | + key: "onAfterRun", | |
| 766 | + value: function onAfterRun() { | |
| 767 | + var args = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; | |
| 768 | + var result = arguments.length > 1 ? arguments[1] : void 0; | |
| 769 | + $e.hooks.runUIAfter(this.command, args, result); | |
| 770 | + } | |
| 771 | + }, | |
| 772 | + { | |
| 773 | + key: "onBeforeApply", | |
| 774 | + value: function onBeforeApply() { | |
| 775 | + var args = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; | |
| 776 | + $e.hooks.runDataDependency(this.command, args); | |
| 777 | + } | |
| 778 | + }, | |
| 779 | + { | |
| 780 | + key: "onAfterApply", | |
| 781 | + value: function onAfterApply() { | |
| 782 | + var args = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; | |
| 783 | + var result = arguments.length > 1 ? arguments[1] : void 0; | |
| 784 | + return $e.hooks.runDataAfter(this.command, args, result); | |
| 785 | + } | |
| 786 | + }, | |
| 787 | + { | |
| 788 | + key: "onCatchApply", | |
| 789 | + value: function onCatchApply(e) { | |
| 790 | + this.runCatchHooks(e); | |
| 791 | + } | |
| 792 | + }, | |
| 793 | + { | |
| 794 | + key: "runCatchHooks", | |
| 795 | + value: function runCatchHooks(e) { | |
| 796 | + $e.hooks.runDataCatch(this.command, this.args, e); | |
| 797 | + $e.hooks.runUICatch(this.command, this.args, e); | |
| 798 | + } | |
| 799 | + }, | |
| 800 | + { | |
| 801 | + key: "requireContainer", | |
| 802 | + value: function requireContainer() { | |
| 803 | + var _this = this; | |
| 804 | + var args = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.args; | |
| 805 | + Deprecation.deprecated("requireContainer()", "3.7.0", "Extend `$e.modules.editor.CommandContainerBase` or `$e.modules.editor.CommandContainerInternalBase`"); | |
| 806 | + if (!args.container && !args.containers) throw Error("container or containers are required."); | |
| 807 | + if (args.container && args.containers) throw Error("container and containers cannot go together please select one of them."); | |
| 808 | + (args.containers || [args.container]).forEach(function(container) { | |
| 809 | + _this.requireArgumentInstance("container", elementorModules.editor.Container, { container }); | |
| 810 | + }); | |
| 811 | + } | |
| 812 | + } | |
| 813 | + ], [{ | |
| 814 | + key: "getInstanceType", | |
| 815 | + value: function getInstanceType() { | |
| 816 | + return "CommandBase"; | |
| 817 | + } | |
| 818 | + }]); | |
| 819 | + }(CommandInfra); | |
| 817 | 820 | |
| 818 | - /** | |
| 819 | - * Function register(). | |
| 820 | - * | |
| 821 | - * Register new command. | |
| 822 | - * | |
| 823 | - * @param {ComponentBase|string} component | |
| 824 | - * @param {string} command | |
| 825 | - * @param {Function} callback | |
| 826 | - * | |
| 827 | - * @return {Commands} commands | |
| 828 | - */ | |
| 829 | - }, { | |
| 830 | - key: "register", | |
| 831 | - value: function register(component, command, callback) { | |
| 832 | - var _this2 = this; | |
| 833 | - var namespace; | |
| 834 | - if ('string' === typeof component) { | |
| 835 | - namespace = component; | |
| 836 | - component = $e.components.get(namespace); | |
| 837 | - if (!component) { | |
| 838 | - this.error("'".concat(namespace, "' component is not exist.")); | |
| 839 | - } | |
| 840 | - } else { | |
| 841 | - namespace = component.getNamespace(); | |
| 842 | - } | |
| 843 | - var fullCommand = namespace + (command ? '/' + command : ''); | |
| 844 | - if (this.commands[fullCommand]) { | |
| 845 | - this.error("`".concat(fullCommand, "` is already registered.")); | |
| 846 | - } | |
| 847 | - this.commands[fullCommand] = callback; | |
| 848 | - this.components[fullCommand] = namespace; | |
| 849 | - var shortcuts = component.getShortcuts(), | |
| 850 | - shortcut = shortcuts[command]; | |
| 851 | - if (shortcut) { | |
| 852 | - shortcut.command = fullCommand; | |
| 853 | - shortcut.callback = function (event) { | |
| 854 | - return _this2.runShortcut(fullCommand, event); | |
| 855 | - }; | |
| 856 | - $e.shortcuts.register(shortcut.keys, shortcut); | |
| 857 | - } | |
| 858 | - return this; | |
| 859 | - } | |
| 860 | - }, { | |
| 861 | - key: "unregister", | |
| 862 | - value: function unregister(component, command) { | |
| 863 | - var namespace; | |
| 864 | - if ('string' === typeof component) { | |
| 865 | - namespace = component; | |
| 866 | - component = $e.components.get(namespace); | |
| 867 | - if (!component) { | |
| 868 | - this.error("'".concat(namespace, "' component is not exist.")); | |
| 869 | - } | |
| 870 | - } else { | |
| 871 | - namespace = component.getNamespace(); | |
| 872 | - } | |
| 873 | - var fullCommand = namespace + (command ? '/' + command : ''); | |
| 874 | - if (!this.commands[fullCommand]) { | |
| 875 | - this.error("`".concat(fullCommand, "` not exist.")); | |
| 876 | - } | |
| 877 | - delete this.commands[fullCommand]; | |
| 878 | - delete this.components[fullCommand]; | |
| 879 | - var shortcuts = component.getShortcuts(), | |
| 880 | - shortcut = shortcuts[command]; | |
| 881 | - if (shortcut) { | |
| 882 | - $e.shortcuts.unregister(shortcut.keys, shortcut); | |
| 883 | - } | |
| 884 | - return this; | |
| 885 | - } | |
| 821 | +//#endregion | |
| 822 | +//#region modules/web-cli/assets/js/modules/command-callback-base.js | |
| 823 | + function _callSuper$32(t, o, e) { | |
| 824 | + return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$33() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); | |
| 825 | + } | |
| 826 | + __name(_callSuper$32, "_callSuper"); | |
| 827 | + function _isNativeReflectConstruct$33() { | |
| 828 | + try { | |
| 829 | + var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); | |
| 830 | + } catch (t) {} | |
| 831 | + return (_isNativeReflectConstruct$33 = function _isNativeReflectConstruct() { | |
| 832 | + return !!t; | |
| 833 | + })(); | |
| 834 | + } | |
| 835 | + __name(_isNativeReflectConstruct$33, "_isNativeReflectConstruct"); | |
| 836 | + /** | |
| 837 | + * To support pure callbacks in the API(commands.js), to ensure they have registered with the proper context. | |
| 838 | + */ | |
| 839 | + var CommandCallbackBase = /*#__PURE__*/ function(_CommandBase) { | |
| 840 | + function CommandCallbackBase() { | |
| 841 | + _classCallCheck(this, CommandCallbackBase); | |
| 842 | + return _callSuper$32(this, CommandCallbackBase, arguments); | |
| 843 | + } | |
| 844 | + _inherits(CommandCallbackBase, _CommandBase); | |
| 845 | + return _createClass(CommandCallbackBase, [{ | |
| 846 | + key: "apply", | |
| 847 | + value: function apply() { | |
| 848 | + var args = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; | |
| 849 | + return this.constructor.getCallback()(args); | |
| 850 | + } | |
| 851 | + }], [{ | |
| 852 | + key: "getInstanceType", | |
| 853 | + value: function getInstanceType() { | |
| 854 | + return "CommandCallbackBase"; | |
| 855 | + } | |
| 856 | + }, { | |
| 857 | + key: "getCallback", | |
| 858 | + value: function getCallback() { | |
| 859 | + return this.registerConfig.callback; | |
| 860 | + } | |
| 861 | + }]); | |
| 862 | + }(CommandBase); | |
| 886 | 863 | |
| 887 | - /** | |
| 888 | - * Function getComponent(). | |
| 889 | - * | |
| 890 | - * Receive Component of the command. | |
| 891 | - * | |
| 892 | - * @param {string} command | |
| 893 | - * | |
| 894 | - * @return {Component} component | |
| 895 | - */ | |
| 896 | - }, { | |
| 897 | - key: "getComponent", | |
| 898 | - value: function getComponent(command) { | |
| 899 | - var namespace = this.components[command]; | |
| 900 | - return $e.components.get(namespace); | |
| 901 | - } | |
| 864 | +//#endregion | |
| 865 | +//#region assets/dev/js/modules/imports/module.js | |
| 866 | + var require_module = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 867 | + init_typeof(); | |
| 868 | + var Module = function Module() { | |
| 869 | + var $ = jQuery; | |
| 870 | + var instanceParams = arguments; | |
| 871 | + var self = this; | |
| 872 | + var events = {}; | |
| 873 | + var settings; | |
| 874 | + var ensureClosureMethods = function ensureClosureMethods() { | |
| 875 | + $.each(self, function(methodName) { | |
| 876 | + var oldMethod = self[methodName]; | |
| 877 | + if ("function" !== typeof oldMethod) return; | |
| 878 | + self[methodName] = function() { | |
| 879 | + return oldMethod.apply(self, arguments); | |
| 880 | + }; | |
| 881 | + }); | |
| 882 | + }; | |
| 883 | + var initSettings = function initSettings() { | |
| 884 | + settings = self.getDefaultSettings(); | |
| 885 | + var instanceSettings = instanceParams[0]; | |
| 886 | + if (instanceSettings) $.extend(true, settings, instanceSettings); | |
| 887 | + }; | |
| 888 | + var init = function init() { | |
| 889 | + self.__construct.apply(self, instanceParams); | |
| 890 | + ensureClosureMethods(); | |
| 891 | + initSettings(); | |
| 892 | + self.trigger("init"); | |
| 893 | + }; | |
| 894 | + this.getItems = function(items, itemKey) { | |
| 895 | + if (itemKey) { | |
| 896 | + var keyStack = itemKey.split("."); | |
| 897 | + var currentKey = keyStack.splice(0, 1); | |
| 898 | + if (!keyStack.length) return items[currentKey]; | |
| 899 | + if (!items[currentKey]) return; | |
| 900 | + return this.getItems(items[currentKey], keyStack.join(".")); | |
| 901 | + } | |
| 902 | + return items; | |
| 903 | + }; | |
| 904 | + this.getSettings = function(setting) { | |
| 905 | + return this.getItems(settings, setting); | |
| 906 | + }; | |
| 907 | + this.setSettings = function(settingKey, value, settingsContainer) { | |
| 908 | + if (!settingsContainer) settingsContainer = settings; | |
| 909 | + if ("object" === _typeof(settingKey)) { | |
| 910 | + $.extend(settingsContainer, settingKey); | |
| 911 | + return self; | |
| 912 | + } | |
| 913 | + var keyStack = settingKey.split("."); | |
| 914 | + var currentKey = keyStack.splice(0, 1); | |
| 915 | + if (!keyStack.length) { | |
| 916 | + settingsContainer[currentKey] = value; | |
| 917 | + return self; | |
| 918 | + } | |
| 919 | + if (!settingsContainer[currentKey]) settingsContainer[currentKey] = {}; | |
| 920 | + return self.setSettings(keyStack.join("."), value, settingsContainer[currentKey]); | |
| 921 | + }; | |
| 922 | + this.getErrorMessage = function(type, functionName) { | |
| 923 | + var message; | |
| 924 | + switch (type) { | |
| 925 | + case "forceMethodImplementation": | |
| 926 | + message = "The method '".concat(functionName, "' must to be implemented in the inheritor child."); | |
| 927 | + break; | |
| 928 | + default: message = "An error occurs"; | |
| 929 | + } | |
| 930 | + return message; | |
| 931 | + }; | |
| 932 | + this.forceMethodImplementation = function(functionName) { | |
| 933 | + throw new Error(this.getErrorMessage("forceMethodImplementation", functionName)); | |
| 934 | + }; | |
| 935 | + this.on = function(eventName, callback) { | |
| 936 | + if ("object" === _typeof(eventName)) { | |
| 937 | + $.each(eventName, function(singleEventName) { | |
| 938 | + self.on(singleEventName, this); | |
| 939 | + }); | |
| 940 | + return self; | |
| 941 | + } | |
| 942 | + eventName.split(" ").forEach(function(singleEventName) { | |
| 943 | + if (!events[singleEventName]) events[singleEventName] = []; | |
| 944 | + events[singleEventName].push(callback); | |
| 945 | + }); | |
| 946 | + return self; | |
| 947 | + }; | |
| 948 | + this.off = function(eventName, callback) { | |
| 949 | + if (!events[eventName]) return self; | |
| 950 | + if (!callback) { | |
| 951 | + delete events[eventName]; | |
| 952 | + return self; | |
| 953 | + } | |
| 954 | + var callbackIndex = events[eventName].indexOf(callback); | |
| 955 | + if (-1 !== callbackIndex) { | |
| 956 | + delete events[eventName][callbackIndex]; | |
| 957 | + events[eventName] = events[eventName].filter(function(val) { | |
| 958 | + return val; | |
| 959 | + }); | |
| 960 | + } | |
| 961 | + return self; | |
| 962 | + }; | |
| 963 | + this.trigger = function(eventName) { | |
| 964 | + var methodName = "on" + eventName[0].toUpperCase() + eventName.slice(1); | |
| 965 | + var params = Array.prototype.slice.call(arguments, 1); | |
| 966 | + if (self[methodName]) self[methodName].apply(self, params); | |
| 967 | + var callbacks = events[eventName]; | |
| 968 | + if (!callbacks) return self; | |
| 969 | + $.each(callbacks, function(index, callback) { | |
| 970 | + callback.apply(self, params); | |
| 971 | + }); | |
| 972 | + return self; | |
| 973 | + }; | |
| 974 | + init(); | |
| 975 | + }; | |
| 976 | + Module.prototype.__construct = function() {}; | |
| 977 | + Module.prototype.getDefaultSettings = function() { | |
| 978 | + return {}; | |
| 979 | + }; | |
| 980 | + Module.prototype.getConstructorID = function() { | |
| 981 | + return this.constructor.name; | |
| 982 | + }; | |
| 983 | + Module.extend = function(properties) { | |
| 984 | + var $ = jQuery; | |
| 985 | + var parent = this; | |
| 986 | + var child = function child() { | |
| 987 | + return parent.apply(this, arguments); | |
| 988 | + }; | |
| 989 | + $.extend(child, parent); | |
| 990 | + child.prototype = Object.create($.extend({}, parent.prototype, properties)); | |
| 991 | + child.prototype.constructor = child; | |
| 992 | + child.__super__ = parent.prototype; | |
| 993 | + return child; | |
| 994 | + }; | |
| 995 | + module.exports = Module; | |
| 996 | + })); | |
| 902 | 997 | |
| 903 | - /** | |
| 904 | - * Function is(). | |
| 905 | - * | |
| 906 | - * Checks if current running command is the same parameter command. | |
| 907 | - * | |
| 908 | - * @param {string} command | |
| 909 | - * | |
| 910 | - * @return {boolean} is this command the same as the one passed in the arguments | |
| 911 | - */ | |
| 912 | - }, { | |
| 913 | - key: "is", | |
| 914 | - value: function is(command) { | |
| 915 | - var component = this.getComponent(command); | |
| 916 | - if (!component) { | |
| 917 | - return false; | |
| 918 | - } | |
| 919 | - return command === this.current[component.getServiceName()]; | |
| 920 | - } | |
| 998 | +//#endregion | |
| 999 | +//#region node_modules/@babel/runtime/helpers/esm/isNativeFunction.js | |
| 1000 | +var import_module = /* @__PURE__ */ __toESM(require_module()); | |
| 1001 | + function _isNativeFunction(t) { | |
| 1002 | + try { | |
| 1003 | + return -1 !== Function.toString.call(t).indexOf("[native code]"); | |
| 1004 | + } catch (n) { | |
| 1005 | + return "function" == typeof t; | |
| 1006 | + } | |
| 1007 | + } | |
| 921 | 1008 | |
| 922 | - /** | |
| 923 | - * Function isCurrentFirstTrace(). | |
| 924 | - * | |
| 925 | - * Checks if parameter command is the first command in trace that currently running. | |
| 926 | - * | |
| 927 | - * @param {string} command | |
| 928 | - * | |
| 929 | - * @return {boolean} is parameter command the first command in trace that currently running | |
| 930 | - */ | |
| 931 | - }, { | |
| 932 | - key: "isCurrentFirstTrace", | |
| 933 | - value: function isCurrentFirstTrace(command) { | |
| 934 | - return command === this.getCurrentFirstTrace(); | |
| 935 | - } | |
| 1009 | +//#endregion | |
| 1010 | +//#region node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js | |
| 1011 | + function _isNativeReflectConstruct$32() { | |
| 1012 | + try { | |
| 1013 | + var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); | |
| 1014 | + } catch (t) {} | |
| 1015 | + return (_isNativeReflectConstruct$32 = function _isNativeReflectConstruct() { | |
| 1016 | + return !!t; | |
| 1017 | + })(); | |
| 1018 | + } | |
| 1019 | + __name(_isNativeReflectConstruct$32, "_isNativeReflectConstruct"); | |
| 936 | 1020 | |
| 937 | - /** | |
| 938 | - * Function getCurrent(). | |
| 939 | - * | |
| 940 | - * Receive currently running components and its commands. | |
| 941 | - * | |
| 942 | - * @param {string} container | |
| 943 | - * | |
| 944 | - * @return {{}|boolean|*} currently running components | |
| 945 | - */ | |
| 946 | - }, { | |
| 947 | - key: "getCurrent", | |
| 948 | - value: function getCurrent() { | |
| 949 | - var container = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; | |
| 950 | - if (container) { | |
| 951 | - if (!this.current[container]) { | |
| 952 | - return false; | |
| 953 | - } | |
| 954 | - return this.current[container]; | |
| 955 | - } | |
| 956 | - return this.current; | |
| 957 | - } | |
| 1021 | +//#endregion | |
| 1022 | +//#region node_modules/@babel/runtime/helpers/esm/construct.js | |
| 1023 | + function _construct(t, e, r) { | |
| 1024 | + if (_isNativeReflectConstruct$32()) return Reflect.construct.apply(null, arguments); | |
| 1025 | + var o = [null]; | |
| 1026 | + o.push.apply(o, e); | |
| 1027 | + var p = new (t.bind.apply(t, o))(); | |
| 1028 | + return r && _setPrototypeOf(p, r.prototype), p; | |
| 1029 | + } | |
| 958 | 1030 | |
| 959 | - /** | |
| 960 | - * Function getCurrentArgs(). | |
| 961 | - * | |
| 962 | - * Receive currently running command args. | |
| 963 | - * | |
| 964 | - * @param {string} container | |
| 965 | - * | |
| 966 | - * @return {{}|boolean|*} current arguments | |
| 967 | - */ | |
| 968 | - }, { | |
| 969 | - key: "getCurrentArgs", | |
| 970 | - value: function getCurrentArgs() { | |
| 971 | - var container = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; | |
| 972 | - if (container) { | |
| 973 | - if (!this.currentArgs[container]) { | |
| 974 | - return false; | |
| 975 | - } | |
| 976 | - return this.currentArgs[container]; | |
| 977 | - } | |
| 978 | - return this.currentArgs; | |
| 979 | - } | |
| 1031 | +//#endregion | |
| 1032 | +//#region node_modules/@babel/runtime/helpers/esm/wrapNativeSuper.js | |
| 1033 | + function _wrapNativeSuper(t) { | |
| 1034 | + var r = "function" == typeof Map ? /* @__PURE__ */ new Map() : void 0; | |
| 1035 | + return _wrapNativeSuper = function _wrapNativeSuper(t) { | |
| 1036 | + if (null === t || !_isNativeFunction(t)) return t; | |
| 1037 | + if ("function" != typeof t) throw new TypeError("Super expression must either be null or a function"); | |
| 1038 | + if (void 0 !== r) { | |
| 1039 | + if (r.has(t)) return r.get(t); | |
| 1040 | + r.set(t, Wrapper); | |
| 1041 | + } | |
| 1042 | + function Wrapper() { | |
| 1043 | + return _construct(t, arguments, _getPrototypeOf(this).constructor); | |
| 1044 | + } | |
| 1045 | + return Wrapper.prototype = Object.create(t.prototype, { constructor: { | |
| 1046 | + value: Wrapper, | |
| 1047 | + enumerable: !1, | |
| 1048 | + writable: !0, | |
| 1049 | + configurable: !0 | |
| 1050 | + } }), _setPrototypeOf(Wrapper, t); | |
| 1051 | + }, _wrapNativeSuper(t); | |
| 1052 | + } | |
| 980 | 1053 | |
| 981 | - /** | |
| 982 | - * Function getCurrentFirst(). | |
| 983 | - * | |
| 984 | - * Receive first command that currently running. | |
| 985 | - * | |
| 986 | - * @return {string} first running command | |
| 987 | - */ | |
| 988 | - }, { | |
| 989 | - key: "getCurrentFirst", | |
| 990 | - value: function getCurrentFirst() { | |
| 991 | - return Object.values(this.current)[0]; | |
| 992 | - } | |
| 1054 | +//#endregion | |
| 1055 | +//#region modules/web-cli/assets/js/utils/force-method-implementation.js | |
| 1056 | + function _callSuper$31(t, o, e) { | |
| 1057 | + return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$31() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); | |
| 1058 | + } | |
| 1059 | + __name(_callSuper$31, "_callSuper"); | |
| 1060 | + function _isNativeReflectConstruct$31() { | |
| 1061 | + try { | |
| 1062 | + var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); | |
| 1063 | + } catch (t) {} | |
| 1064 | + return (_isNativeReflectConstruct$31 = function _isNativeReflectConstruct() { | |
| 1065 | + return !!t; | |
| 1066 | + })(); | |
| 1067 | + } | |
| 1068 | + __name(_isNativeReflectConstruct$31, "_isNativeReflectConstruct"); | |
| 1069 | + var ForceMethodImplementation = /*#__PURE__*/ function(_Error) { | |
| 1070 | + function ForceMethodImplementation() { | |
| 1071 | + var _this; | |
| 1072 | + var info = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; | |
| 1073 | + _classCallCheck(this, ForceMethodImplementation); | |
| 1074 | + _this = _callSuper$31(this, ForceMethodImplementation, ["".concat(info.isStatic ? "static " : "").concat(info.fullName, "() should be implemented, please provide '").concat(info.functionName || info.fullName, "' functionality.")]); | |
| 1075 | + Error.captureStackTrace(_this, ForceMethodImplementation); | |
| 1076 | + return _this; | |
| 1077 | + } | |
| 1078 | + _inherits(ForceMethodImplementation, _Error); | |
| 1079 | + return _createClass(ForceMethodImplementation); | |
| 1080 | + }(/*#__PURE__*/ _wrapNativeSuper(Error)); | |
| 1081 | + var force_method_implementation_default = /* @__PURE__ */ __name((function() { | |
| 1082 | + var caller = Error().stack.split("\n")[2].trim(); | |
| 1083 | + var callerName = caller.startsWith("at new") ? "constructor" : caller.split(" ")[1]; | |
| 1084 | + var info = {}; | |
| 1085 | + info.functionName = callerName; | |
| 1086 | + info.fullName = callerName; | |
| 1087 | + if (info.functionName.includes(".")) { | |
| 1088 | + var parts = info.functionName.split("."); | |
| 1089 | + info.className = parts[0]; | |
| 1090 | + info.functionName = parts[1]; | |
| 1091 | + } else info.isStatic = true; | |
| 1092 | + throw new ForceMethodImplementation(info); | |
| 1093 | + }), "default"); | |
| 993 | 1094 | |
| 994 | - /** | |
| 995 | - * Function getCurrentLast(). | |
| 996 | - * | |
| 997 | - * Receive last command that currently running. | |
| 998 | - * | |
| 999 | - * @return {string} last running command | |
| 1000 | - */ | |
| 1001 | - }, { | |
| 1002 | - key: "getCurrentLast", | |
| 1003 | - value: function getCurrentLast() { | |
| 1004 | - var current = Object.values(this.current); | |
| 1005 | - return current[current.length - 1]; | |
| 1006 | - } | |
| 1095 | +//#endregion | |
| 1096 | +//#region modules/web-cli/assets/js/modules/component-base.js | |
| 1097 | + function ownKeys$3(e, r) { | |
| 1098 | + var t = Object.keys(e); | |
| 1099 | + if (Object.getOwnPropertySymbols) { | |
| 1100 | + var o = Object.getOwnPropertySymbols(e); | |
| 1101 | + r && (o = o.filter(function(r) { | |
| 1102 | + return Object.getOwnPropertyDescriptor(e, r).enumerable; | |
| 1103 | + })), t.push.apply(t, o); | |
| 1104 | + } | |
| 1105 | + return t; | |
| 1106 | + } | |
| 1107 | + __name(ownKeys$3, "ownKeys"); | |
| 1108 | + function _objectSpread$3(e) { | |
| 1109 | + for (var r = 1; r < arguments.length; r++) { | |
| 1110 | + var t = null != arguments[r] ? arguments[r] : {}; | |
| 1111 | + r % 2 ? ownKeys$3(Object(t), !0).forEach(function(r) { | |
| 1112 | + _defineProperty(e, r, t[r]); | |
| 1113 | + }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function(r) { | |
| 1114 | + Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); | |
| 1115 | + }); | |
| 1116 | + } | |
| 1117 | + return e; | |
| 1118 | + } | |
| 1119 | + __name(_objectSpread$3, "_objectSpread"); | |
| 1120 | + function _callSuper$30(t, o, e) { | |
| 1121 | + return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$30() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); | |
| 1122 | + } | |
| 1123 | + __name(_callSuper$30, "_callSuper"); | |
| 1124 | + function _isNativeReflectConstruct$30() { | |
| 1125 | + try { | |
| 1126 | + var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); | |
| 1127 | + } catch (t) {} | |
| 1128 | + return (_isNativeReflectConstruct$30 = function _isNativeReflectConstruct() { | |
| 1129 | + return !!t; | |
| 1130 | + })(); | |
| 1131 | + } | |
| 1132 | + __name(_isNativeReflectConstruct$30, "_isNativeReflectConstruct"); | |
| 1133 | + /** | |
| 1134 | + * @typedef {import('./command-infra')} CommandInfra | |
| 1135 | + * @typedef {import('./hook-base')} HookBase | |
| 1136 | + * @typedef {import('../core/states/ui-state-base')} UiStateBase | |
| 1137 | + */ | |
| 1138 | + var ComponentBase = /*#__PURE__*/ function(_Module) { | |
| 1139 | + function ComponentBase() { | |
| 1140 | + _classCallCheck(this, ComponentBase); | |
| 1141 | + return _callSuper$30(this, ComponentBase, arguments); | |
| 1142 | + } | |
| 1143 | + _inherits(ComponentBase, _Module); | |
| 1144 | + return _createClass(ComponentBase, [ | |
| 1145 | + { | |
| 1146 | + key: "__construct", | |
| 1147 | + value: function __construct() { | |
| 1148 | + var args = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; | |
| 1149 | + if (args.manager) this.manager = args.manager; | |
| 1150 | + this.commands = this.defaultCommands(); | |
| 1151 | + this.commandsInternal = this.defaultCommandsInternal(); | |
| 1152 | + this.hooks = this.defaultHooks(); | |
| 1153 | + this.routes = this.defaultRoutes(); | |
| 1154 | + this.tabs = this.defaultTabs(); | |
| 1155 | + this.shortcuts = this.defaultShortcuts(); | |
| 1156 | + this.utils = this.defaultUtils(); | |
| 1157 | + this.data = this.defaultData(); | |
| 1158 | + this.uiStates = this.defaultUiStates(); | |
| 1159 | + this.states = this.defaultStates(); | |
| 1160 | + this.defaultRoute = ""; | |
| 1161 | + this.currentTab = ""; | |
| 1162 | + } | |
| 1163 | + }, | |
| 1164 | + { | |
| 1165 | + key: "registerAPI", | |
| 1166 | + value: function registerAPI() { | |
| 1167 | + var _this = this; | |
| 1168 | + Object.entries(this.getTabs()).forEach(function(tab) { | |
| 1169 | + return _this.registerTabRoute(tab[0]); | |
| 1170 | + }); | |
| 1171 | + Object.entries(this.getRoutes()).forEach(function(_ref) { | |
| 1172 | + var _ref2 = _slicedToArray(_ref, 2); | |
| 1173 | + var route = _ref2[0]; | |
| 1174 | + var callback = _ref2[1]; | |
| 1175 | + return _this.registerRoute(route, callback); | |
| 1176 | + }); | |
| 1177 | + Object.entries(this.getCommands()).forEach(function(_ref3) { | |
| 1178 | + var _ref4 = _slicedToArray(_ref3, 2); | |
| 1179 | + var command = _ref4[0]; | |
| 1180 | + var callback = _ref4[1]; | |
| 1181 | + return _this.registerCommand(command, callback); | |
| 1182 | + }); | |
| 1183 | + Object.entries(this.getCommandsInternal()).forEach(function(_ref5) { | |
| 1184 | + var _ref6 = _slicedToArray(_ref5, 2); | |
| 1185 | + var command = _ref6[0]; | |
| 1186 | + var callback = _ref6[1]; | |
| 1187 | + return _this.registerCommandInternal(command, callback); | |
| 1188 | + }); | |
| 1189 | + Object.values(this.getHooks()).forEach(function(instance) { | |
| 1190 | + return _this.registerHook(instance); | |
| 1191 | + }); | |
| 1192 | + Object.entries(this.getData()).forEach(function(_ref7) { | |
| 1193 | + var _ref8 = _slicedToArray(_ref7, 2); | |
| 1194 | + var command = _ref8[0]; | |
| 1195 | + var callback = _ref8[1]; | |
| 1196 | + return _this.registerData(command, callback); | |
| 1197 | + }); | |
| 1198 | + Object.values(this.getUiStates()).forEach(function(instance) { | |
| 1199 | + return _this.registerUiState(instance); | |
| 1200 | + }); | |
| 1201 | + Object.entries(this.getStates()).forEach(function(_ref9) { | |
| 1202 | + var _ref0 = _slicedToArray(_ref9, 2); | |
| 1203 | + var id = _ref0[0]; | |
| 1204 | + var state = _ref0[1]; | |
| 1205 | + return _this.registerState(id, state); | |
| 1206 | + }); | |
| 1207 | + } | |
| 1208 | + }, | |
| 1209 | + { | |
| 1210 | + key: "getNamespace", | |
| 1211 | + value: function getNamespace() { | |
| 1212 | + force_method_implementation_default(); | |
| 1213 | + } | |
| 1214 | + }, | |
| 1215 | + { | |
| 1216 | + key: "getRootContainer", | |
| 1217 | + value: function getRootContainer() { | |
| 1218 | + Deprecation.deprecated("getRootContainer()", "3.7.0", "getServiceName()"); | |
| 1219 | + return this.getServiceName(); | |
| 1220 | + } | |
| 1221 | + }, | |
| 1222 | + { | |
| 1223 | + key: "getServiceName", | |
| 1224 | + value: function getServiceName() { | |
| 1225 | + return this.getNamespace().split("/")[0]; | |
| 1226 | + } | |
| 1227 | + }, | |
| 1228 | + { | |
| 1229 | + key: "store", | |
| 1230 | + get: function get() { | |
| 1231 | + return $e.store.get(this.getNamespace()); | |
| 1232 | + } | |
| 1233 | + }, | |
| 1234 | + { | |
| 1235 | + key: "defaultTabs", | |
| 1236 | + value: function defaultTabs() { | |
| 1237 | + return {}; | |
| 1238 | + } | |
| 1239 | + }, | |
| 1240 | + { | |
| 1241 | + key: "defaultRoutes", | |
| 1242 | + value: function defaultRoutes() { | |
| 1243 | + return {}; | |
| 1244 | + } | |
| 1245 | + }, | |
| 1246 | + { | |
| 1247 | + key: "defaultCommands", | |
| 1248 | + value: function defaultCommands() { | |
| 1249 | + return {}; | |
| 1250 | + } | |
| 1251 | + }, | |
| 1252 | + { | |
| 1253 | + key: "defaultCommandsInternal", | |
| 1254 | + value: function defaultCommandsInternal() { | |
| 1255 | + return {}; | |
| 1256 | + } | |
| 1257 | + }, | |
| 1258 | + { | |
| 1259 | + key: "defaultHooks", | |
| 1260 | + value: function defaultHooks() { | |
| 1261 | + return {}; | |
| 1262 | + } | |
| 1263 | + }, | |
| 1264 | + { | |
| 1265 | + key: "defaultUiStates", | |
| 1266 | + value: function defaultUiStates() { | |
| 1267 | + return {}; | |
| 1268 | + } | |
| 1269 | + }, | |
| 1270 | + { | |
| 1271 | + key: "defaultStates", | |
| 1272 | + value: function defaultStates() { | |
| 1273 | + return {}; | |
| 1274 | + } | |
| 1275 | + }, | |
| 1276 | + { | |
| 1277 | + key: "defaultShortcuts", | |
| 1278 | + value: function defaultShortcuts() { | |
| 1279 | + return {}; | |
| 1280 | + } | |
| 1281 | + }, | |
| 1282 | + { | |
| 1283 | + key: "defaultUtils", | |
| 1284 | + value: function defaultUtils() { | |
| 1285 | + return {}; | |
| 1286 | + } | |
| 1287 | + }, | |
| 1288 | + { | |
| 1289 | + key: "defaultData", | |
| 1290 | + value: function defaultData() { | |
| 1291 | + return {}; | |
| 1292 | + } | |
| 1293 | + }, | |
| 1294 | + { | |
| 1295 | + key: "getCommands", | |
| 1296 | + value: function getCommands() { | |
| 1297 | + return this.commands; | |
| 1298 | + } | |
| 1299 | + }, | |
| 1300 | + { | |
| 1301 | + key: "getCommandsInternal", | |
| 1302 | + value: function getCommandsInternal() { | |
| 1303 | + return this.commandsInternal; | |
| 1304 | + } | |
| 1305 | + }, | |
| 1306 | + { | |
| 1307 | + key: "getHooks", | |
| 1308 | + value: function getHooks() { | |
| 1309 | + return this.hooks; | |
| 1310 | + } | |
| 1311 | + }, | |
| 1312 | + { | |
| 1313 | + key: "getUiStates", | |
| 1314 | + value: function getUiStates() { | |
| 1315 | + return this.uiStates; | |
| 1316 | + } | |
| 1317 | + }, | |
| 1318 | + { | |
| 1319 | + key: "getStates", | |
| 1320 | + value: function getStates() { | |
| 1321 | + return this.states; | |
| 1322 | + } | |
| 1323 | + }, | |
| 1324 | + { | |
| 1325 | + key: "getRoutes", | |
| 1326 | + value: function getRoutes() { | |
| 1327 | + return this.routes; | |
| 1328 | + } | |
| 1329 | + }, | |
| 1330 | + { | |
| 1331 | + key: "getTabs", | |
| 1332 | + value: function getTabs() { | |
| 1333 | + return this.tabs; | |
| 1334 | + } | |
| 1335 | + }, | |
| 1336 | + { | |
| 1337 | + key: "getShortcuts", | |
| 1338 | + value: function getShortcuts() { | |
| 1339 | + return this.shortcuts; | |
| 1340 | + } | |
| 1341 | + }, | |
| 1342 | + { | |
| 1343 | + key: "getData", | |
| 1344 | + value: function getData() { | |
| 1345 | + return this.data; | |
| 1346 | + } | |
| 1347 | + }, | |
| 1348 | + { | |
| 1349 | + key: "registerCommand", | |
| 1350 | + value: function registerCommand(command, context) { | |
| 1351 | + var commandsType = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : "default"; | |
| 1352 | + var commandsManager; | |
| 1353 | + switch (commandsType) { | |
| 1354 | + case "default": | |
| 1355 | + commandsManager = $e.commands; | |
| 1356 | + break; | |
| 1357 | + case "internal": | |
| 1358 | + commandsManager = $e.commandsInternal; | |
| 1359 | + break; | |
| 1360 | + case "data": | |
| 1361 | + commandsManager = $e.data; | |
| 1362 | + break; | |
| 1363 | + default: throw new Error("Invalid commands type: '".concat(command, "'")); | |
| 1364 | + } | |
| 1365 | + var fullCommand = this.getNamespace() + "/" + command; | |
| 1366 | + var instanceType = context.getInstanceType ? context.getInstanceType() : false; | |
| 1367 | + var registerConfig = { | |
| 1368 | + command: fullCommand, | |
| 1369 | + component: this | |
| 1370 | + }; | |
| 1371 | + if (!instanceType) { | |
| 1372 | + if ($e.devTools) $e.devTools.log.warn("Attach command-callback-base, on command: '".concat(fullCommand, "', context is unknown type.")); | |
| 1373 | + registerConfig.callback = context; | |
| 1374 | + context = /*#__PURE__*/ function(_CommandCallbackBase) { | |
| 1375 | + function context() { | |
| 1376 | + _classCallCheck(this, context); | |
| 1377 | + return _callSuper$30(this, context, arguments); | |
| 1378 | + } | |
| 1379 | + _inherits(context, _CommandCallbackBase); | |
| 1380 | + return _createClass(context); | |
| 1381 | + }(CommandCallbackBase); | |
| 1382 | + } | |
| 1383 | + context.setRegisterConfig(registerConfig); | |
| 1384 | + commandsManager.register(this, command, context); | |
| 1385 | + } | |
| 1386 | + }, | |
| 1387 | + { | |
| 1388 | + key: "registerHook", | |
| 1389 | + value: function registerHook(instance) { | |
| 1390 | + return instance.register(); | |
| 1391 | + } | |
| 1392 | + }, | |
| 1393 | + { | |
| 1394 | + key: "registerCommandInternal", | |
| 1395 | + value: function registerCommandInternal(command, context) { | |
| 1396 | + this.registerCommand(command, context, "internal"); | |
| 1397 | + } | |
| 1398 | + }, | |
| 1399 | + { | |
| 1400 | + key: "registerUiState", | |
| 1401 | + value: function registerUiState(instance) { | |
| 1402 | + $e.uiStates.register(instance); | |
| 1403 | + } | |
| 1404 | + }, | |
| 1405 | + { | |
| 1406 | + key: "registerState", | |
| 1407 | + value: function registerState(id, stateConfig) { | |
| 1408 | + id = this.getNamespace() + (id ? "/".concat(id) : ""); | |
| 1409 | + var slice = (0, _reduxjs_toolkit.createSlice)(_objectSpread$3(_objectSpread$3({}, stateConfig), {}, { name: id })); | |
| 1410 | + $e.store.register(id, slice); | |
| 1411 | + } | |
| 1412 | + }, | |
| 1413 | + { | |
| 1414 | + key: "registerRoute", | |
| 1415 | + value: function registerRoute(route, callback) { | |
| 1416 | + $e.routes.register(this, route, callback); | |
| 1417 | + } | |
| 1418 | + }, | |
| 1419 | + { | |
| 1420 | + key: "registerData", | |
| 1421 | + value: function registerData(command, context) { | |
| 1422 | + this.registerCommand(command, context, "data"); | |
| 1423 | + } | |
| 1424 | + }, | |
| 1425 | + { | |
| 1426 | + key: "unregisterRoute", | |
| 1427 | + value: function unregisterRoute(route) { | |
| 1428 | + $e.routes.unregister(this, route); | |
| 1429 | + } | |
| 1430 | + }, | |
| 1431 | + { | |
| 1432 | + key: "registerTabRoute", | |
| 1433 | + value: function registerTabRoute(tab) { | |
| 1434 | + var _this2 = this; | |
| 1435 | + this.registerRoute(tab, function(args) { | |
| 1436 | + return _this2.activateTab(tab, args); | |
| 1437 | + }); | |
| 1438 | + } | |
| 1439 | + }, | |
| 1440 | + { | |
| 1441 | + key: "dependency", | |
| 1442 | + value: function dependency() { | |
| 1443 | + return true; | |
| 1444 | + } | |
| 1445 | + }, | |
| 1446 | + { | |
| 1447 | + key: "open", | |
| 1448 | + value: function open() { | |
| 1449 | + return true; | |
| 1450 | + } | |
| 1451 | + }, | |
| 1452 | + { | |
| 1453 | + key: "close", | |
| 1454 | + value: function close() { | |
| 1455 | + if (!this.isOpen) return false; | |
| 1456 | + this.isOpen = false; | |
| 1457 | + this.inactivate(); | |
| 1458 | + $e.routes.clearCurrent(this.getNamespace()); | |
| 1459 | + $e.routes.clearHistory(this.getServiceName()); | |
| 1460 | + return true; | |
| 1461 | + } | |
| 1462 | + }, | |
| 1463 | + { | |
| 1464 | + key: "activate", | |
| 1465 | + value: function activate() { | |
| 1466 | + $e.components.activate(this.getNamespace()); | |
| 1467 | + } | |
| 1468 | + }, | |
| 1469 | + { | |
| 1470 | + key: "inactivate", | |
| 1471 | + value: function inactivate() { | |
| 1472 | + $e.components.inactivate(this.getNamespace()); | |
| 1473 | + } | |
| 1474 | + }, | |
| 1475 | + { | |
| 1476 | + key: "isActive", | |
| 1477 | + value: function isActive() { | |
| 1478 | + return $e.components.isActive(this.getNamespace()); | |
| 1479 | + } | |
| 1480 | + }, | |
| 1481 | + { | |
| 1482 | + key: "onRoute", | |
| 1483 | + value: function onRoute(route) { | |
| 1484 | + this.toggleRouteClass(route, true); | |
| 1485 | + this.toggleHistoryClass(); | |
| 1486 | + this.activate(); | |
| 1487 | + this.trigger("route/open", route); | |
| 1488 | + } | |
| 1489 | + }, | |
| 1490 | + { | |
| 1491 | + key: "onCloseRoute", | |
| 1492 | + value: function onCloseRoute(route) { | |
| 1493 | + this.toggleRouteClass(route, false); | |
| 1494 | + this.inactivate(); | |
| 1495 | + this.trigger("route/close", route); | |
| 1496 | + } | |
| 1497 | + }, | |
| 1498 | + { | |
| 1499 | + key: "setDefaultRoute", | |
| 1500 | + value: function setDefaultRoute(route) { | |
| 1501 | + this.defaultRoute = this.getNamespace() + "/" + route; | |
| 1502 | + } | |
| 1503 | + }, | |
| 1504 | + { | |
| 1505 | + key: "getDefaultRoute", | |
| 1506 | + value: function getDefaultRoute() { | |
| 1507 | + return this.defaultRoute; | |
| 1508 | + } | |
| 1509 | + }, | |
| 1510 | + { | |
| 1511 | + key: "removeTab", | |
| 1512 | + value: function removeTab(tab) { | |
| 1513 | + delete this.tabs[tab]; | |
| 1514 | + this.unregisterRoute(tab); | |
| 1515 | + } | |
| 1516 | + }, | |
| 1517 | + { | |
| 1518 | + key: "hasTab", | |
| 1519 | + value: function hasTab(tab) { | |
| 1520 | + return !!this.tabs[tab]; | |
| 1521 | + } | |
| 1522 | + }, | |
| 1523 | + { | |
| 1524 | + key: "addTab", | |
| 1525 | + value: function addTab(tab, args, position) { | |
| 1526 | + var _this3 = this; | |
| 1527 | + this.tabs[tab] = args; | |
| 1528 | + if ("undefined" !== typeof position) { | |
| 1529 | + var newTabs = {}; | |
| 1530 | + var ids = Object.keys(this.tabs); | |
| 1531 | + ids.pop(); | |
| 1532 | + ids.splice(position, 0, tab); | |
| 1533 | + ids.forEach(function(id) { | |
| 1534 | + newTabs[id] = _this3.tabs[id]; | |
| 1535 | + }); | |
| 1536 | + this.tabs = newTabs; | |
| 1537 | + } | |
| 1538 | + this.registerTabRoute(tab); | |
| 1539 | + } | |
| 1540 | + }, | |
| 1541 | + { | |
| 1542 | + key: "getTabsWrapperSelector", | |
| 1543 | + value: function getTabsWrapperSelector() { | |
| 1544 | + return ""; | |
| 1545 | + } | |
| 1546 | + }, | |
| 1547 | + { | |
| 1548 | + key: "getTabRoute", | |
| 1549 | + value: function getTabRoute(tab) { | |
| 1550 | + return this.getNamespace() + "/" + tab; | |
| 1551 | + } | |
| 1552 | + }, | |
| 1553 | + { | |
| 1554 | + key: "renderTab", | |
| 1555 | + value: function renderTab(tab) {} | |
| 1556 | + }, | |
| 1557 | + { | |
| 1558 | + key: "activateTab", | |
| 1559 | + value: function activateTab(tab, args) { | |
| 1560 | + var _this4 = this; | |
| 1561 | + this.renderTab(tab, args); | |
| 1562 | + jQuery(this.getTabsWrapperSelector() + " .elementor-component-tab").off("click").on("click", function(event) { | |
| 1563 | + $e.route(_this4.getTabRoute(event.currentTarget.dataset.tab), args); | |
| 1564 | + }).removeClass("elementor-active").filter("[data-tab=\"" + tab + "\"]").addClass("elementor-active"); | |
| 1565 | + } | |
| 1566 | + }, | |
| 1567 | + { | |
| 1568 | + key: "getActiveTabConfig", | |
| 1569 | + value: function getActiveTabConfig() { | |
| 1570 | + return this.tabs[this.currentTab] || {}; | |
| 1571 | + } | |
| 1572 | + }, | |
| 1573 | + { | |
| 1574 | + key: "getBodyClass", | |
| 1575 | + value: function getBodyClass(route) { | |
| 1576 | + return "e-route-" + route.replace(/\//g, "-"); | |
| 1577 | + } | |
| 1578 | + }, | |
| 1579 | + { | |
| 1580 | + key: "normalizeCommandName", | |
| 1581 | + value: function normalizeCommandName(commandName) { | |
| 1582 | + return commandName.replace(/[A-Z]/g, function(match, offset) { | |
| 1583 | + return (offset > 0 ? "-" : "") + match.toLowerCase(); | |
| 1584 | + }); | |
| 1585 | + } | |
| 1586 | + }, | |
| 1587 | + { | |
| 1588 | + key: "importCommands", | |
| 1589 | + value: function importCommands(commandsFromImport) { | |
| 1590 | + var _this5 = this; | |
| 1591 | + var commands = {}; | |
| 1592 | + Object.entries(commandsFromImport).forEach(function(_ref1) { | |
| 1593 | + var _ref10 = _slicedToArray(_ref1, 2); | |
| 1594 | + var className = _ref10[0]; | |
| 1595 | + var Class = _ref10[1]; | |
| 1596 | + var command = _this5.normalizeCommandName(className); | |
| 1597 | + commands[command] = Class; | |
| 1598 | + }); | |
| 1599 | + return commands; | |
| 1600 | + } | |
| 1601 | + }, | |
| 1602 | + { | |
| 1603 | + key: "importHooks", | |
| 1604 | + value: function importHooks(hooksFromImport) { | |
| 1605 | + var hooks = {}; | |
| 1606 | + for (var key in hooksFromImport) { | |
| 1607 | + var hook = new hooksFromImport[key](); | |
| 1608 | + hooks[hook.getId()] = hook; | |
| 1609 | + } | |
| 1610 | + return hooks; | |
| 1611 | + } | |
| 1612 | + }, | |
| 1613 | + { | |
| 1614 | + key: "importUiStates", | |
| 1615 | + value: function importUiStates(statesFromImport) { | |
| 1616 | + var _this6 = this; | |
| 1617 | + var uiStates = {}; | |
| 1618 | + Object.values(statesFromImport).forEach(function(className) { | |
| 1619 | + var uiState = new className(_this6); | |
| 1620 | + uiStates[uiState.getId()] = uiState; | |
| 1621 | + }); | |
| 1622 | + return uiStates; | |
| 1623 | + } | |
| 1624 | + }, | |
| 1625 | + { | |
| 1626 | + key: "setUiState", | |
| 1627 | + value: function setUiState(state, value) { | |
| 1628 | + $e.uiStates.set("".concat(this.getNamespace(), "/").concat(state), value); | |
| 1629 | + } | |
| 1630 | + }, | |
| 1631 | + { | |
| 1632 | + key: "toggleRouteClass", | |
| 1633 | + value: function toggleRouteClass(route, state) { | |
| 1634 | + document.body.classList.toggle(this.getBodyClass(route), state); | |
| 1635 | + } | |
| 1636 | + }, | |
| 1637 | + { | |
| 1638 | + key: "toggleHistoryClass", | |
| 1639 | + value: function toggleHistoryClass() { | |
| 1640 | + document.body.classList.toggle("e-routes-has-history", !!$e.routes.getHistory(this.getServiceName()).length); | |
| 1641 | + } | |
| 1642 | + } | |
| 1643 | + ]); | |
| 1644 | + }(import_module.default); | |
| 1007 | 1645 | |
| 1008 | - /** | |
| 1009 | - * Function getCurrentFirstTrace(). | |
| 1010 | - * | |
| 1011 | - * Receive first command in trace that currently running | |
| 1012 | - * | |
| 1013 | - * @return {string} first command in trace | |
| 1014 | - */ | |
| 1015 | - }, { | |
| 1016 | - key: "getCurrentFirstTrace", | |
| 1017 | - value: function getCurrentFirstTrace() { | |
| 1018 | - return this.currentTrace[0]; | |
| 1019 | - } | |
| 1646 | +//#endregion | |
| 1647 | +//#region modules/web-cli/assets/js/core/backwards-compatibility.js | |
| 1648 | + function _callSuper$29(t, o, e) { | |
| 1649 | + return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$29() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); | |
| 1650 | + } | |
| 1651 | + __name(_callSuper$29, "_callSuper"); | |
| 1652 | + function _isNativeReflectConstruct$29() { | |
| 1653 | + try { | |
| 1654 | + var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); | |
| 1655 | + } catch (t) {} | |
| 1656 | + return (_isNativeReflectConstruct$29 = function _isNativeReflectConstruct() { | |
| 1657 | + return !!t; | |
| 1658 | + })(); | |
| 1659 | + } | |
| 1660 | + __name(_isNativeReflectConstruct$29, "_isNativeReflectConstruct"); | |
| 1661 | + var BackwardsCompatibility = /*#__PURE__*/ function() { | |
| 1662 | + function BackwardsCompatibility() { | |
| 1663 | + _classCallCheck(this, BackwardsCompatibility); | |
| 1664 | + } | |
| 1665 | + return _createClass(BackwardsCompatibility, [{ | |
| 1666 | + key: "ensureTab", | |
| 1667 | + value: function ensureTab(namespace, tabSlug) { | |
| 1668 | + var page = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : ""; | |
| 1669 | + var component = $e.components.get(namespace); | |
| 1670 | + if (!component) { | |
| 1671 | + var Component = /*#__PURE__*/ function(_ComponentBase) { | |
| 1672 | + function Component() { | |
| 1673 | + _classCallCheck(this, Component); | |
| 1674 | + return _callSuper$29(this, Component, arguments); | |
| 1675 | + } | |
| 1676 | + _inherits(Component, _ComponentBase); | |
| 1677 | + return _createClass(Component, [{ | |
| 1678 | + key: "getNamespace", | |
| 1679 | + value: function getNamespace() { | |
| 1680 | + return namespace; | |
| 1681 | + } | |
| 1682 | + }, { | |
| 1683 | + key: "renderTab", | |
| 1684 | + value: function renderTab(tab) { | |
| 1685 | + elementor.getPanelView().setPage(page).activateTab(tab); | |
| 1686 | + } | |
| 1687 | + }]); | |
| 1688 | + }(ComponentBase); | |
| 1689 | + component = $e.components.register(new Component()); | |
| 1690 | + } | |
| 1691 | + if (!component.hasTab(tabSlug) && elementor.config.tabs[tabSlug]) component.addTab(tabSlug, { title: elementor.config.tabs[tabSlug] }); | |
| 1692 | + } | |
| 1693 | + }]); | |
| 1694 | + }(); | |
| 1020 | 1695 | |
| 1021 | - /** | |
| 1022 | - * Function beforeRun(). | |
| 1023 | - * | |
| 1024 | - * Responsible to add current command to trace and trigger 'run:before' event. | |
| 1025 | - * Run before command. | |
| 1026 | - * | |
| 1027 | - * @param {string} command | |
| 1028 | - * @param {{}} args | |
| 1029 | - * @param {boolean} [addTrace=true] | |
| 1030 | - */ | |
| 1031 | - }, { | |
| 1032 | - key: "beforeRun", | |
| 1033 | - value: function beforeRun(command) { | |
| 1034 | - var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | |
| 1035 | - var addTrace = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true; | |
| 1036 | - var component = this.getComponent(command), | |
| 1037 | - container = component.getServiceName(); | |
| 1038 | - if (addTrace) { | |
| 1039 | - this.addCurrentTrace(container, command, args); | |
| 1040 | - } | |
| 1041 | - if (args.onBefore) { | |
| 1042 | - args.onBefore.apply(component, [args]); | |
| 1043 | - } | |
| 1044 | - this.trigger('run:before', component, command, args); | |
| 1045 | - window.dispatchEvent(new CustomEvent('elementor/commands/run/before', { | |
| 1046 | - detail: { | |
| 1047 | - command: command, | |
| 1048 | - args: args | |
| 1049 | - } | |
| 1050 | - })); | |
| 1051 | - } | |
| 1696 | +//#endregion | |
| 1697 | +//#region modules/web-cli/assets/js/modules/command-internal-base.js | |
| 1698 | + function _callSuper$28(t, o, e) { | |
| 1699 | + return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$28() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); | |
| 1700 | + } | |
| 1701 | + __name(_callSuper$28, "_callSuper"); | |
| 1702 | + function _isNativeReflectConstruct$28() { | |
| 1703 | + try { | |
| 1704 | + var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); | |
| 1705 | + } catch (t) {} | |
| 1706 | + return (_isNativeReflectConstruct$28 = function _isNativeReflectConstruct() { | |
| 1707 | + return !!t; | |
| 1708 | + })(); | |
| 1709 | + } | |
| 1710 | + __name(_isNativeReflectConstruct$28, "_isNativeReflectConstruct"); | |
| 1711 | + /** | |
| 1712 | + * @name $e.modules.CommandInternalBase | |
| 1713 | + */ | |
| 1714 | + var CommandInternalBase = /*#__PURE__*/ function(_CommandBase) { | |
| 1715 | + function CommandInternalBase(args) { | |
| 1716 | + var commandsAPI = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : $e.commandsInternal; | |
| 1717 | + _classCallCheck(this, CommandInternalBase); | |
| 1718 | + return _callSuper$28(this, CommandInternalBase, [args, commandsAPI]); | |
| 1719 | + } | |
| 1720 | + _inherits(CommandInternalBase, _CommandBase); | |
| 1721 | + return _createClass(CommandInternalBase, null, [{ | |
| 1722 | + key: "getInstanceType", | |
| 1723 | + value: function getInstanceType() { | |
| 1724 | + return "CommandInternalBase"; | |
| 1725 | + } | |
| 1726 | + }]); | |
| 1727 | + }(CommandBase); | |
| 1052 | 1728 | |
| 1053 | - /** | |
| 1054 | - * Function validateRun(). | |
| 1055 | - * | |
| 1056 | - * Responsible to validate if the run is even possible. | |
| 1057 | - * Runs immediately after entering `run()`. | |
| 1058 | - * | |
| 1059 | - * @param {string} command | |
| 1060 | - * @param {*} args | |
| 1061 | - * | |
| 1062 | - * @return {boolean} dependency result | |
| 1063 | - */ | |
| 1064 | - }, { | |
| 1065 | - key: "validateRun", | |
| 1066 | - value: function validateRun(command) { | |
| 1067 | - var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | |
| 1068 | - if (!this.commands[command]) { | |
| 1069 | - this.error("`".concat(command, "` not found.")); | |
| 1070 | - } | |
| 1071 | - return this.getComponent(command).dependency(command, args); | |
| 1072 | - } | |
| 1729 | +//#endregion | |
| 1730 | +//#region modules/web-cli/assets/js/core/data/errors/base-error.js | |
| 1731 | + function ownKeys$2(e, r) { | |
| 1732 | + var t = Object.keys(e); | |
| 1733 | + if (Object.getOwnPropertySymbols) { | |
| 1734 | + var o = Object.getOwnPropertySymbols(e); | |
| 1735 | + r && (o = o.filter(function(r) { | |
| 1736 | + return Object.getOwnPropertyDescriptor(e, r).enumerable; | |
| 1737 | + })), t.push.apply(t, o); | |
| 1738 | + } | |
| 1739 | + return t; | |
| 1740 | + } | |
| 1741 | + __name(ownKeys$2, "ownKeys"); | |
| 1742 | + function _objectSpread$2(e) { | |
| 1743 | + for (var r = 1; r < arguments.length; r++) { | |
| 1744 | + var t = null != arguments[r] ? arguments[r] : {}; | |
| 1745 | + r % 2 ? ownKeys$2(Object(t), !0).forEach(function(r) { | |
| 1746 | + _defineProperty(e, r, t[r]); | |
| 1747 | + }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function(r) { | |
| 1748 | + Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); | |
| 1749 | + }); | |
| 1750 | + } | |
| 1751 | + return e; | |
| 1752 | + } | |
| 1753 | + __name(_objectSpread$2, "_objectSpread"); | |
| 1754 | + function _callSuper$27(t, o, e) { | |
| 1755 | + return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$27() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); | |
| 1756 | + } | |
| 1757 | + __name(_callSuper$27, "_callSuper"); | |
| 1758 | + function _isNativeReflectConstruct$27() { | |
| 1759 | + try { | |
| 1760 | + var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); | |
| 1761 | + } catch (t) {} | |
| 1762 | + return (_isNativeReflectConstruct$27 = function _isNativeReflectConstruct() { | |
| 1763 | + return !!t; | |
| 1764 | + })(); | |
| 1765 | + } | |
| 1766 | + __name(_isNativeReflectConstruct$27, "_isNativeReflectConstruct"); | |
| 1767 | + var BaseError = /*#__PURE__*/ function(_Error) { | |
| 1768 | + /** | |
| 1769 | + * Error constructor. | |
| 1770 | + * | |
| 1771 | + * @param {string} message | |
| 1772 | + * @param {string} code | |
| 1773 | + * @param {*} data | |
| 1774 | + */ | |
| 1775 | + function BaseError() { | |
| 1776 | + var _this; | |
| 1777 | + var message = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : ""; | |
| 1778 | + var code = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : ""; | |
| 1779 | + var data = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : []; | |
| 1780 | + _classCallCheck(this, BaseError); | |
| 1781 | + _this = _callSuper$27(this, BaseError, [message]); | |
| 1782 | + /** | |
| 1783 | + * The server error code. | |
| 1784 | + * | |
| 1785 | + * @type {string} | |
| 1786 | + */ | |
| 1787 | + _defineProperty(_this, "code", ""); | |
| 1788 | + /** | |
| 1789 | + * Additional data about the current error. | |
| 1790 | + * | |
| 1791 | + * @type {*[]} | |
| 1792 | + */ | |
| 1793 | + _defineProperty(_this, "data", []); | |
| 1794 | + _this.code = code; | |
| 1795 | + _this.data = data; | |
| 1796 | + return _this; | |
| 1797 | + } | |
| 1798 | + /** | |
| 1799 | + * Notify a message when the error occurs. | |
| 1800 | + */ | |
| 1801 | + _inherits(BaseError, _Error); | |
| 1802 | + return _createClass(BaseError, [{ | |
| 1803 | + key: "notify", | |
| 1804 | + value: function notify() { | |
| 1805 | + Console.error(_objectSpread$2({ message: this.message }, this)); | |
| 1806 | + } | |
| 1807 | + }], [{ | |
| 1808 | + key: "create", | |
| 1809 | + value: function create(message) { | |
| 1810 | + var code = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : ""; | |
| 1811 | + var data = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : []; | |
| 1812 | + return new this(message, code, data); | |
| 1813 | + } | |
| 1814 | + }, { | |
| 1815 | + key: "getHTTPErrorCode", | |
| 1816 | + value: function getHTTPErrorCode() { | |
| 1817 | + force_method_implementation_default(); | |
| 1818 | + } | |
| 1819 | + }]); | |
| 1820 | + }(/*#__PURE__*/ _wrapNativeSuper(Error)); | |
| 1073 | 1821 | |
| 1074 | - /** | |
| 1075 | - * Function run(). | |
| 1076 | - * | |
| 1077 | - * Runs a command. | |
| 1078 | - * | |
| 1079 | - * @param {string} command | |
| 1080 | - * @param {{}} args | |
| 1081 | - * | |
| 1082 | - * @return {boolean|*} results | |
| 1083 | - */ | |
| 1084 | - }, { | |
| 1085 | - key: "run", | |
| 1086 | - value: function run(command) { | |
| 1087 | - var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | |
| 1088 | - if (!this.validateRun(command, args)) { | |
| 1089 | - return false; | |
| 1090 | - } | |
| 1091 | - this.beforeRun(command, args); | |
| 1822 | +//#endregion | |
| 1823 | +//#region modules/web-cli/assets/js/core/data/errors/default-error.js | |
| 1824 | + function _callSuper$26(t, o, e) { | |
| 1825 | + return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$26() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); | |
| 1826 | + } | |
| 1827 | + __name(_callSuper$26, "_callSuper"); | |
| 1828 | + function _isNativeReflectConstruct$26() { | |
| 1829 | + try { | |
| 1830 | + var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); | |
| 1831 | + } catch (t) {} | |
| 1832 | + return (_isNativeReflectConstruct$26 = function _isNativeReflectConstruct() { | |
| 1833 | + return !!t; | |
| 1834 | + })(); | |
| 1835 | + } | |
| 1836 | + __name(_isNativeReflectConstruct$26, "_isNativeReflectConstruct"); | |
| 1837 | + var DefaultError = /*#__PURE__*/ function(_BaseError) { | |
| 1838 | + function DefaultError() { | |
| 1839 | + _classCallCheck(this, DefaultError); | |
| 1840 | + return _callSuper$26(this, DefaultError, arguments); | |
| 1841 | + } | |
| 1842 | + _inherits(DefaultError, _BaseError); | |
| 1843 | + return _createClass(DefaultError, null, [{ | |
| 1844 | + key: "getHTTPErrorCode", | |
| 1845 | + value: function getHTTPErrorCode() { | |
| 1846 | + return 501; | |
| 1847 | + } | |
| 1848 | + }]); | |
| 1849 | + }(BaseError); | |
| 1092 | 1850 | |
| 1093 | - // Get command class or callback. | |
| 1094 | - var context = this.commands[command]; | |
| 1851 | +//#endregion | |
| 1852 | +//#region modules/web-cli/assets/js/core/data/errors/error-404.js | |
| 1853 | + function _callSuper$25(t, o, e) { | |
| 1854 | + return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$25() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); | |
| 1855 | + } | |
| 1856 | + __name(_callSuper$25, "_callSuper"); | |
| 1857 | + function _isNativeReflectConstruct$25() { | |
| 1858 | + try { | |
| 1859 | + var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); | |
| 1860 | + } catch (t) {} | |
| 1861 | + return (_isNativeReflectConstruct$25 = function _isNativeReflectConstruct() { | |
| 1862 | + return !!t; | |
| 1863 | + })(); | |
| 1864 | + } | |
| 1865 | + __name(_isNativeReflectConstruct$25, "_isNativeReflectConstruct"); | |
| 1866 | + var Error404 = /*#__PURE__*/ function(_BaseError) { | |
| 1867 | + function Error404() { | |
| 1868 | + _classCallCheck(this, Error404); | |
| 1869 | + return _callSuper$25(this, Error404, arguments); | |
| 1870 | + } | |
| 1871 | + _inherits(Error404, _BaseError); | |
| 1872 | + return _createClass(Error404, [{ | |
| 1873 | + key: "notify", | |
| 1874 | + value: function notify() { | |
| 1875 | + Console.warn(this.message); | |
| 1876 | + } | |
| 1877 | + }], [{ | |
| 1878 | + key: "getHTTPErrorCode", | |
| 1879 | + value: function getHTTPErrorCode() { | |
| 1880 | + return 404; | |
| 1881 | + } | |
| 1882 | + }]); | |
| 1883 | + }(BaseError); | |
| 1095 | 1884 | |
| 1096 | - // Is it command-base based class? | |
| 1097 | - if (context.getInstanceType) { | |
| 1098 | - context = new context(args); | |
| 1099 | - } | |
| 1100 | - var currentComponent = this.getComponent(command); | |
| 1885 | +//#endregion | |
| 1886 | +//#region modules/web-cli/assets/js/core/data/errors/index.js | |
| 1887 | + var errors_exports = /* @__PURE__ */ __exportAll({ | |
| 1888 | + DefaultError: () => DefaultError, | |
| 1889 | + Error404: () => Error404 | |
| 1890 | + }); | |
| 1101 | 1891 | |
| 1102 | - // Is simple callback? (e.g. a route) | |
| 1103 | - if (!(context instanceof _commandBase.default)) { | |
| 1104 | - var results = context.apply(currentComponent, [args]); | |
| 1105 | - this.afterRun(command, args, results); | |
| 1106 | - return results; | |
| 1107 | - } | |
| 1108 | - if (!this.validateInstanceScope(context, currentComponent, command)) { | |
| 1109 | - return this.removeCurrentTrace(currentComponent); | |
| 1110 | - } | |
| 1111 | - return this.runInstance(context); | |
| 1112 | - } | |
| 1892 | +//#endregion | |
| 1893 | +//#region modules/web-cli/assets/js/modules/command-data.js | |
| 1894 | + function _callSuper$24(t, o, e) { | |
| 1895 | + return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$24() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); | |
| 1896 | + } | |
| 1897 | + __name(_callSuper$24, "_callSuper"); | |
| 1898 | + function _isNativeReflectConstruct$24() { | |
| 1899 | + try { | |
| 1900 | + var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); | |
| 1901 | + } catch (t) {} | |
| 1902 | + return (_isNativeReflectConstruct$24 = function _isNativeReflectConstruct() { | |
| 1903 | + return !!t; | |
| 1904 | + })(); | |
| 1905 | + } | |
| 1906 | + __name(_isNativeReflectConstruct$24, "_isNativeReflectConstruct"); | |
| 1907 | + /** | |
| 1908 | + * @name $e.modules.CommandData | |
| 1909 | + */ | |
| 1910 | + /** | |
| 1911 | + * @typedef {('create'|'delete'|'get'|'update'|'options')} DataTypes | |
| 1912 | + */ | |
| 1913 | + /** | |
| 1914 | + * @typedef {{}} RequestData | |
| 1915 | + */ | |
| 1916 | + /** | |
| 1917 | + * @typedef {import('../core/data/errors/base-error')} BaseError | |
| 1918 | + */ | |
| 1919 | + var CommandData = /*#__PURE__*/ function(_CommandBase) { | |
| 1920 | + function CommandData(args) { | |
| 1921 | + var _this$args$options; | |
| 1922 | + var _this; | |
| 1923 | + var commandsAPI = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : $e.data; | |
| 1924 | + _classCallCheck(this, CommandData); | |
| 1925 | + _this = _callSuper$24(this, CommandData, [args, commandsAPI]); | |
| 1926 | + /** | |
| 1927 | + * Data returned from remote. | |
| 1928 | + * | |
| 1929 | + * @type {*} | |
| 1930 | + */ | |
| 1931 | + _defineProperty(_this, "data", void 0); | |
| 1932 | + /** | |
| 1933 | + * Fetch type. | |
| 1934 | + * | |
| 1935 | + * @type {DataTypes} | |
| 1936 | + */ | |
| 1937 | + _defineProperty(_this, "type", void 0); | |
| 1938 | + if ((_this$args$options = _this.args.options) !== null && _this$args$options !== void 0 && _this$args$options.type) _this.type = _this.args.options.type; | |
| 1939 | + return _this; | |
| 1940 | + } | |
| 1941 | + /** | |
| 1942 | + * Function getEndpointFormat(). | |
| 1943 | + * | |
| 1944 | + * @return {null|string} endpoint format | |
| 1945 | + */ | |
| 1946 | + _inherits(CommandData, _CommandBase); | |
| 1947 | + return _createClass(CommandData, [ | |
| 1948 | + { | |
| 1949 | + key: "getApplyMethods", | |
| 1950 | + value: function getApplyMethods() { | |
| 1951 | + var type = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : this.type; | |
| 1952 | + var before; | |
| 1953 | + var after; | |
| 1954 | + switch (type) { | |
| 1955 | + case "create": | |
| 1956 | + before = this.applyBeforeCreate; | |
| 1957 | + after = this.applyAfterCreate; | |
| 1958 | + break; | |
| 1959 | + case "delete": | |
| 1960 | + before = this.applyBeforeDelete; | |
| 1961 | + after = this.applyAfterDelete; | |
| 1962 | + break; | |
| 1963 | + case "get": | |
| 1964 | + before = this.applyBeforeGet; | |
| 1965 | + after = this.applyAfterGet; | |
| 1966 | + break; | |
| 1967 | + case "update": | |
| 1968 | + before = this.applyBeforeUpdate; | |
| 1969 | + after = this.applyAfterUpdate; | |
| 1970 | + break; | |
| 1971 | + case "options": | |
| 1972 | + before = this.applyBeforeOptions; | |
| 1973 | + after = this.applyAfterOptions; | |
| 1974 | + break; | |
| 1975 | + default: return false; | |
| 1976 | + } | |
| 1977 | + return { | |
| 1978 | + before: before.bind(this), | |
| 1979 | + after: after.bind(this) | |
| 1980 | + }; | |
| 1981 | + } | |
| 1982 | + }, | |
| 1983 | + { | |
| 1984 | + key: "getRequestData", | |
| 1985 | + value: function getRequestData() { | |
| 1986 | + return { | |
| 1987 | + type: this.type, | |
| 1988 | + args: this.args, | |
| 1989 | + timestamp: (/* @__PURE__ */ new Date()).getTime(), | |
| 1990 | + component: this.component, | |
| 1991 | + command: this.command, | |
| 1992 | + endpoint: $e.data.commandToEndpoint(this.command, JSON.parse(JSON.stringify(this.args)), this.constructor.getEndpointFormat()) | |
| 1993 | + }; | |
| 1994 | + } | |
| 1995 | + }, | |
| 1996 | + { | |
| 1997 | + key: "apply", | |
| 1998 | + value: function apply() { | |
| 1999 | + var _this2 = this; | |
| 2000 | + var applyMethods = this.getApplyMethods(); | |
| 2001 | + this.args = applyMethods.before(this.args); | |
| 2002 | + var requestData = this.getRequestData(); | |
| 2003 | + return $e.data.fetch(requestData).then(function(data) { | |
| 2004 | + _this2.data = data; | |
| 2005 | + _this2.data = applyMethods.after(data, _this2.args); | |
| 2006 | + _this2.data = { data: _this2.data }; | |
| 2007 | + _this2.data = Object.assign({ __requestData__: requestData }, _this2.data); | |
| 2008 | + return _this2.data; | |
| 2009 | + }); | |
| 2010 | + } | |
| 2011 | + }, | |
| 2012 | + { | |
| 2013 | + key: "applyBeforeCreate", | |
| 2014 | + value: function applyBeforeCreate() { | |
| 2015 | + return arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; | |
| 2016 | + } | |
| 2017 | + }, | |
| 2018 | + { | |
| 2019 | + key: "applyAfterCreate", | |
| 2020 | + value: function applyAfterCreate(data) { | |
| 2021 | + arguments.length > 1 && arguments[1] !== void 0 && arguments[1]; | |
| 2022 | + return data; | |
| 2023 | + } | |
| 2024 | + }, | |
| 2025 | + { | |
| 2026 | + key: "applyBeforeDelete", | |
| 2027 | + value: function applyBeforeDelete() { | |
| 2028 | + return arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; | |
| 2029 | + } | |
| 2030 | + }, | |
| 2031 | + { | |
| 2032 | + key: "applyAfterDelete", | |
| 2033 | + value: function applyAfterDelete(data) { | |
| 2034 | + arguments.length > 1 && arguments[1] !== void 0 && arguments[1]; | |
| 2035 | + return data; | |
| 2036 | + } | |
| 2037 | + }, | |
| 2038 | + { | |
| 2039 | + key: "applyBeforeGet", | |
| 2040 | + value: function applyBeforeGet() { | |
| 2041 | + return arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; | |
| 2042 | + } | |
| 2043 | + }, | |
| 2044 | + { | |
| 2045 | + key: "applyAfterGet", | |
| 2046 | + value: function applyAfterGet(data) { | |
| 2047 | + arguments.length > 1 && arguments[1] !== void 0 && arguments[1]; | |
| 2048 | + return data; | |
| 2049 | + } | |
| 2050 | + }, | |
| 2051 | + { | |
| 2052 | + key: "applyBeforeUpdate", | |
| 2053 | + value: function applyBeforeUpdate() { | |
| 2054 | + return arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; | |
| 2055 | + } | |
| 2056 | + }, | |
| 2057 | + { | |
| 2058 | + key: "applyAfterUpdate", | |
| 2059 | + value: function applyAfterUpdate(data) { | |
| 2060 | + arguments.length > 1 && arguments[1] !== void 0 && arguments[1]; | |
| 2061 | + return data; | |
| 2062 | + } | |
| 2063 | + }, | |
| 2064 | + { | |
| 2065 | + key: "applyBeforeOptions", | |
| 2066 | + value: function applyBeforeOptions() { | |
| 2067 | + return arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; | |
| 2068 | + } | |
| 2069 | + }, | |
| 2070 | + { | |
| 2071 | + key: "applyAfterOptions", | |
| 2072 | + value: function applyAfterOptions(data) { | |
| 2073 | + arguments.length > 1 && arguments[1] !== void 0 && arguments[1]; | |
| 2074 | + return data; | |
| 2075 | + } | |
| 2076 | + }, | |
| 2077 | + { | |
| 2078 | + key: "applyAfterCatch", | |
| 2079 | + value: function applyAfterCatch(e) { | |
| 2080 | + e.notify(); | |
| 2081 | + } | |
| 2082 | + }, | |
| 2083 | + { | |
| 2084 | + key: "onCatchApply", | |
| 2085 | + value: function onCatchApply(e) { | |
| 2086 | + var _e; | |
| 2087 | + var httpErrorCode = ((_e = e) === null || _e === void 0 || (_e = _e.data) === null || _e === void 0 ? void 0 : _e.status) || 501; | |
| 2088 | + var dataError = Object.values(errors_exports).find(function(error) { | |
| 2089 | + return error.getHTTPErrorCode() === httpErrorCode; | |
| 2090 | + }); | |
| 2091 | + if (!dataError) dataError = DefaultError; | |
| 2092 | + e = dataError.create(e.message, e.code, e.data || []); | |
| 2093 | + this.runCatchHooks(e); | |
| 2094 | + this.applyAfterCatch(e); | |
| 2095 | + } | |
| 2096 | + } | |
| 2097 | + ], [{ | |
| 2098 | + key: "getInstanceType", | |
| 2099 | + value: function getInstanceType() { | |
| 2100 | + return "CommandData"; | |
| 2101 | + } | |
| 2102 | + }, { | |
| 2103 | + key: "getEndpointFormat", | |
| 2104 | + value: function getEndpointFormat() { | |
| 2105 | + return null; | |
| 2106 | + } | |
| 2107 | + }]); | |
| 2108 | + }(CommandBase); | |
| 1113 | 2109 | |
| 1114 | - /** | |
| 1115 | - * Function runInstance(). | |
| 1116 | - * | |
| 1117 | - * @param {CommandBase} instance | |
| 1118 | - * | |
| 1119 | - * @return {boolean|Promise<*>} | |
| 1120 | - */ | |
| 1121 | - }, { | |
| 1122 | - key: "runInstance", | |
| 1123 | - value: function runInstance(instance) { | |
| 1124 | - var results = null; | |
| 2110 | +//#endregion | |
| 2111 | +//#region node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js | |
| 2112 | + function asyncGeneratorStep(n, t, e, r, o, a, c) { | |
| 2113 | + try { | |
| 2114 | + var i = n[a](c); | |
| 2115 | + var u = i.value; | |
| 2116 | + } catch (n) { | |
| 2117 | + e(n); | |
| 2118 | + return; | |
| 2119 | + } | |
| 2120 | + i.done ? t(u) : Promise.resolve(u).then(r, o); | |
| 2121 | + } | |
| 2122 | + function _asyncToGenerator(n) { | |
| 2123 | + return function() { | |
| 2124 | + var t = this; | |
| 2125 | + var e = arguments; | |
| 2126 | + return new Promise(function(r, o) { | |
| 2127 | + var a = n.apply(t, e); | |
| 2128 | + function _next(n) { | |
| 2129 | + asyncGeneratorStep(a, r, o, _next, _throw, "next", n); | |
| 2130 | + } | |
| 2131 | + function _throw(n) { | |
| 2132 | + asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); | |
| 2133 | + } | |
| 2134 | + _next(void 0); | |
| 2135 | + }); | |
| 2136 | + }; | |
| 2137 | + } | |
| 1125 | 2138 | |
| 1126 | - // For UI Hooks. | |
| 1127 | - instance.onBeforeRun(instance.args); | |
| 1128 | - try { | |
| 1129 | - // For data hooks. | |
| 1130 | - instance.onBeforeApply(instance.args); | |
| 1131 | - results = instance.run(); | |
| 1132 | - } catch (e) { | |
| 1133 | - this.catchApply(e, instance); | |
| 1134 | - if (e instanceof $e.modules.HookBreak) { | |
| 1135 | - this.removeCurrentTrace(instance.component); | |
| 1136 | - return false; | |
| 1137 | - } | |
| 1138 | - } | |
| 1139 | - return this.applyRunAfter(instance, results); | |
| 1140 | - } | |
| 2139 | +//#endregion | |
| 2140 | +//#region node_modules/@babel/runtime/helpers/OverloadYield.js | |
| 2141 | + var require_OverloadYield = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 2142 | + function _OverloadYield(e, d) { | |
| 2143 | + this.v = e, this.k = d; | |
| 2144 | + } | |
| 2145 | + module.exports = _OverloadYield, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 2146 | + })); | |
| 1141 | 2147 | |
| 1142 | - /** | |
| 1143 | - * Function applyRunAfter(). | |
| 1144 | - * | |
| 1145 | - * Responsible for applying everything that need to be run after each command runs. | |
| 1146 | - * Called on run() after runInstance(), to manipulate results & apply 'after' hooks. | |
| 1147 | - * | |
| 1148 | - * @param {CommandBase} instance | |
| 1149 | - * @param {*} result | |
| 1150 | - * | |
| 1151 | - * @return {Promise<*>|*} | |
| 1152 | - */ | |
| 1153 | - }, { | |
| 1154 | - key: "applyRunAfter", | |
| 1155 | - value: function applyRunAfter(instance, result) { | |
| 1156 | - var _this3 = this; | |
| 1157 | - // TODO: Temp code determine if it's a jQuery deferred object. | |
| 1158 | - if (result && 'object' === (0, _typeof2.default)(result) && result.promise && result.then && result.fail) { | |
| 1159 | - var handleJQueryDeferred = function handleJQueryDeferred(_result) { | |
| 1160 | - _result.fail(function (e) { | |
| 1161 | - _this3.catchApply(e, instance); | |
| 1162 | - _this3.afterRun(instance.command, instance.args, e); | |
| 1163 | - }); | |
| 1164 | - return _result.done(function (__result) { | |
| 1165 | - return _this3.applyRunAfterAsyncResult(instance, __result); | |
| 1166 | - }); | |
| 1167 | - }; | |
| 1168 | - return handleJQueryDeferred(result); | |
| 1169 | - } else if (result instanceof Promise) { | |
| 1170 | - return this.applyRunAfterAsync(instance, result); | |
| 1171 | - } | |
| 1172 | - this.applyRunAfterSync(instance, result); | |
| 1173 | - return result; | |
| 1174 | - } | |
| 2148 | +//#endregion | |
| 2149 | +//#region node_modules/@babel/runtime/helpers/regeneratorDefine.js | |
| 2150 | + var require_regeneratorDefine = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 2151 | + function _regeneratorDefine(e, r, n, t) { | |
| 2152 | + var i = Object.defineProperty; | |
| 2153 | + try { | |
| 2154 | + i({}, "", {}); | |
| 2155 | + } catch (e) { | |
| 2156 | + i = 0; | |
| 2157 | + } | |
| 2158 | + module.exports = _regeneratorDefine = function regeneratorDefine(e, r, n, t) { | |
| 2159 | + function o(r, n) { | |
| 2160 | + _regeneratorDefine(e, r, function(e) { | |
| 2161 | + return this._invoke(r, n, e); | |
| 2162 | + }); | |
| 2163 | + } | |
| 2164 | + r ? i ? i(e, r, { | |
| 2165 | + value: n, | |
| 2166 | + enumerable: !t, | |
| 2167 | + configurable: !t, | |
| 2168 | + writable: !t | |
| 2169 | + }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); | |
| 2170 | + }, module.exports.__esModule = true, module.exports["default"] = module.exports, _regeneratorDefine(e, r, n, t); | |
| 2171 | + } | |
| 2172 | + module.exports = _regeneratorDefine, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 2173 | + })); | |
| 1175 | 2174 | |
| 1176 | - /** | |
| 1177 | - * Function applyRunAfterSync(). | |
| 1178 | - * | |
| 1179 | - * Responsible to handle simple(synchronous) 'run after' behavior. | |
| 1180 | - * Called on applyRunAfterSync() after runInstance(), to handle results. | |
| 1181 | - * | |
| 1182 | - * @param {CommandBase} instance | |
| 1183 | - * @param {*} result | |
| 1184 | - */ | |
| 1185 | - }, { | |
| 1186 | - key: "applyRunAfterSync", | |
| 1187 | - value: function applyRunAfterSync(instance, result) { | |
| 1188 | - // Run Data hooks. | |
| 1189 | - instance.onAfterApply(instance.args, result); | |
| 2175 | +//#endregion | |
| 2176 | +//#region node_modules/@babel/runtime/helpers/regenerator.js | |
| 2177 | + var require_regenerator$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 2178 | + var regeneratorDefine = require_regeneratorDefine(); | |
| 2179 | + function _regenerator() { | |
| 2180 | + /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ | |
| 2181 | + var e; | |
| 2182 | + var t; | |
| 2183 | + var r = "function" == typeof Symbol ? Symbol : {}; | |
| 2184 | + var n = r.iterator || "@@iterator"; | |
| 2185 | + var o = r.toStringTag || "@@toStringTag"; | |
| 2186 | + function i(r, n, o, i) { | |
| 2187 | + var c = n && n.prototype instanceof Generator ? n : Generator; | |
| 2188 | + var u = Object.create(c.prototype); | |
| 2189 | + return regeneratorDefine(u, "_invoke", function(r, n, o) { | |
| 2190 | + var i; | |
| 2191 | + var c; | |
| 2192 | + var u; | |
| 2193 | + var f = 0; | |
| 2194 | + var p = o || []; | |
| 2195 | + var y = !1; | |
| 2196 | + var G = { | |
| 2197 | + p: 0, | |
| 2198 | + n: 0, | |
| 2199 | + v: e, | |
| 2200 | + a: d, | |
| 2201 | + f: d.bind(e, 4), | |
| 2202 | + d: function d(t, r) { | |
| 2203 | + return i = t, c = 0, u = e, G.n = r, a; | |
| 2204 | + } | |
| 2205 | + }; | |
| 2206 | + function d(r, n) { | |
| 2207 | + for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { | |
| 2208 | + var o; | |
| 2209 | + var i = p[t]; | |
| 2210 | + var d = G.p; | |
| 2211 | + var l = i[2]; | |
| 2212 | + r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0)); | |
| 2213 | + } | |
| 2214 | + if (o || r > 1) return a; | |
| 2215 | + throw y = !0, n; | |
| 2216 | + } | |
| 2217 | + return function(o, p, l) { | |
| 2218 | + if (f > 1) throw TypeError("Generator is already running"); | |
| 2219 | + for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { | |
| 2220 | + i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); | |
| 2221 | + try { | |
| 2222 | + if (f = 2, i) { | |
| 2223 | + if (c || (o = "next"), t = i[o]) { | |
| 2224 | + if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); | |
| 2225 | + if (!t.done) return t; | |
| 2226 | + u = t.value, c < 2 && (c = 0); | |
| 2227 | + } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); | |
| 2228 | + i = e; | |
| 2229 | + } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; | |
| 2230 | + } catch (t) { | |
| 2231 | + i = e, c = 1, u = t; | |
| 2232 | + } finally { | |
| 2233 | + f = 1; | |
| 2234 | + } | |
| 2235 | + } | |
| 2236 | + return { | |
| 2237 | + value: t, | |
| 2238 | + done: y | |
| 2239 | + }; | |
| 2240 | + }; | |
| 2241 | + }(r, o, i), !0), u; | |
| 2242 | + } | |
| 2243 | + var a = {}; | |
| 2244 | + function Generator() {} | |
| 2245 | + function GeneratorFunction() {} | |
| 2246 | + function GeneratorFunctionPrototype() {} | |
| 2247 | + t = Object.getPrototypeOf; | |
| 2248 | + var c = [][n] ? t(t([][n]())) : (regeneratorDefine(t = {}, n, function() { | |
| 2249 | + return this; | |
| 2250 | + }), t); | |
| 2251 | + var u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); | |
| 2252 | + function f(e) { | |
| 2253 | + return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, regeneratorDefine(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; | |
| 2254 | + } | |
| 2255 | + return GeneratorFunction.prototype = GeneratorFunctionPrototype, regeneratorDefine(u, "constructor", GeneratorFunctionPrototype), regeneratorDefine(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", regeneratorDefine(GeneratorFunctionPrototype, o, "GeneratorFunction"), regeneratorDefine(u), regeneratorDefine(u, o, "Generator"), regeneratorDefine(u, n, function() { | |
| 2256 | + return this; | |
| 2257 | + }), regeneratorDefine(u, "toString", function() { | |
| 2258 | + return "[object Generator]"; | |
| 2259 | + }), (module.exports = _regenerator = function _regenerator() { | |
| 2260 | + return { | |
| 2261 | + w: i, | |
| 2262 | + m: f | |
| 2263 | + }; | |
| 2264 | + }, module.exports.__esModule = true, module.exports["default"] = module.exports)(); | |
| 2265 | + } | |
| 2266 | + module.exports = _regenerator, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 2267 | + })); | |
| 1190 | 2268 | |
| 1191 | - // For UI hooks. | |
| 1192 | - instance.onAfterRun(instance.args, result); | |
| 1193 | - this.afterRun(instance.command, instance.args, result); | |
| 1194 | - } | |
| 2269 | +//#endregion | |
| 2270 | +//#region node_modules/@babel/runtime/helpers/regeneratorAsyncIterator.js | |
| 2271 | + var require_regeneratorAsyncIterator = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 2272 | + var OverloadYield = require_OverloadYield(); | |
| 2273 | + var regeneratorDefine = require_regeneratorDefine(); | |
| 2274 | + function AsyncIterator(t, e) { | |
| 2275 | + function n(r, o, i, f) { | |
| 2276 | + try { | |
| 2277 | + var c = t[r](o); | |
| 2278 | + var u = c.value; | |
| 2279 | + return u instanceof OverloadYield ? e.resolve(u.v).then(function(t) { | |
| 2280 | + n("next", t, i, f); | |
| 2281 | + }, function(t) { | |
| 2282 | + n("throw", t, i, f); | |
| 2283 | + }) : e.resolve(u).then(function(t) { | |
| 2284 | + c.value = t, i(c); | |
| 2285 | + }, function(t) { | |
| 2286 | + return n("throw", t, i, f); | |
| 2287 | + }); | |
| 2288 | + } catch (t) { | |
| 2289 | + f(t); | |
| 2290 | + } | |
| 2291 | + } | |
| 2292 | + var r; | |
| 2293 | + this.next || (regeneratorDefine(AsyncIterator.prototype), regeneratorDefine(AsyncIterator.prototype, "function" == typeof Symbol && Symbol.asyncIterator || "@asyncIterator", function() { | |
| 2294 | + return this; | |
| 2295 | + })), regeneratorDefine(this, "_invoke", function(t, o, i) { | |
| 2296 | + function f() { | |
| 2297 | + return new e(function(e, r) { | |
| 2298 | + n(t, i, e, r); | |
| 2299 | + }); | |
| 2300 | + } | |
| 2301 | + return r = r ? r.then(f, f) : f(); | |
| 2302 | + }, !0); | |
| 2303 | + } | |
| 2304 | + module.exports = AsyncIterator, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 2305 | + })); | |
| 1195 | 2306 | |
| 1196 | - /** | |
| 1197 | - * Function applyRunAfterAsync(). | |
| 1198 | - * | |
| 1199 | - * Await for promise result. | |
| 1200 | - * Called on applyRunAfter() after runInstance(). | |
| 1201 | - * | |
| 1202 | - * @param {CommandBase} instance | |
| 1203 | - * @param {*} result | |
| 1204 | - */ | |
| 1205 | - }, { | |
| 1206 | - key: "applyRunAfterAsync", | |
| 1207 | - value: function applyRunAfterAsync(instance, result) { | |
| 1208 | - var _this4 = this; | |
| 1209 | - // Override initial result ( promise ) to await onAfter promises, first!. | |
| 1210 | - return (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee() { | |
| 1211 | - return _regenerator.default.wrap(function (_context) { | |
| 1212 | - while (1) switch (_context.prev = _context.next) { | |
| 1213 | - case 0: | |
| 1214 | - _context.next = 1; | |
| 1215 | - return result.catch(function (e) { | |
| 1216 | - _this4.catchApply(e, instance); | |
| 1217 | - _this4.afterRun(instance.command, instance.args, e); | |
| 1218 | - }); | |
| 1219 | - case 1: | |
| 1220 | - _context.next = 2; | |
| 1221 | - return result.then(function (_result) { | |
| 1222 | - return _this4.applyRunAfterAsyncResult(instance, _result); | |
| 1223 | - }); | |
| 1224 | - case 2: | |
| 1225 | - return _context.abrupt("return", result); | |
| 1226 | - case 3: | |
| 1227 | - case "end": | |
| 1228 | - return _context.stop(); | |
| 1229 | - } | |
| 1230 | - }, _callee); | |
| 1231 | - }))(); | |
| 1232 | - } | |
| 2307 | +//#endregion | |
| 2308 | +//#region node_modules/@babel/runtime/helpers/regeneratorAsyncGen.js | |
| 2309 | + var require_regeneratorAsyncGen = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 2310 | + var regenerator = require_regenerator$1(); | |
| 2311 | + var regeneratorAsyncIterator = require_regeneratorAsyncIterator(); | |
| 2312 | + function _regeneratorAsyncGen(r, e, t, o, n) { | |
| 2313 | + return new regeneratorAsyncIterator(regenerator().w(r, e, t, o), n || Promise); | |
| 2314 | + } | |
| 2315 | + module.exports = _regeneratorAsyncGen, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 2316 | + })); | |
| 1233 | 2317 | |
| 1234 | - /** | |
| 1235 | - * Function applyRunAfterAsyncResult(). | |
| 1236 | - * | |
| 1237 | - * Responsible to await all promises results. | |
| 1238 | - * Called on applyRunAfterAsync() after runInstance(), to handle async results. | |
| 1239 | - * Awaits all the promises, before releasing the command. | |
| 1240 | - * | |
| 1241 | - * @param {CommandBase} instance | |
| 1242 | - * @param {*} result | |
| 1243 | - */ | |
| 1244 | - }, { | |
| 1245 | - key: "applyRunAfterAsyncResult", | |
| 1246 | - value: (function () { | |
| 1247 | - var _applyRunAfterAsyncResult = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee2(instance, result) { | |
| 1248 | - var results, promises; | |
| 1249 | - return _regenerator.default.wrap(function (_context2) { | |
| 1250 | - while (1) switch (_context2.prev = _context2.next) { | |
| 1251 | - case 0: | |
| 1252 | - // Run Data hooks. | |
| 1253 | - results = instance.onAfterApply(instance.args, result), promises = Array.isArray(results) ? results.flat().filter(function (filtered) { | |
| 1254 | - return filtered instanceof Promise; | |
| 1255 | - }) : []; | |
| 1256 | - if (!promises.length) { | |
| 1257 | - _context2.next = 1; | |
| 1258 | - break; | |
| 1259 | - } | |
| 1260 | - _context2.next = 1; | |
| 1261 | - return Promise.all(promises); | |
| 1262 | - case 1: | |
| 1263 | - // For UI hooks. | |
| 1264 | - instance.onAfterRun(instance.args, result); | |
| 1265 | - this.afterRun(instance.command, instance.args, result); | |
| 1266 | - case 2: | |
| 1267 | - case "end": | |
| 1268 | - return _context2.stop(); | |
| 1269 | - } | |
| 1270 | - }, _callee2, this); | |
| 1271 | - })); | |
| 1272 | - function applyRunAfterAsyncResult(_x, _x2) { | |
| 1273 | - return _applyRunAfterAsyncResult.apply(this, arguments); | |
| 1274 | - } | |
| 1275 | - return applyRunAfterAsyncResult; | |
| 1276 | - }() | |
| 1277 | - /** | |
| 1278 | - * Function afterRun(). | |
| 1279 | - * | |
| 1280 | - * Responsible to to clear command from trace, and run 'run:after' event. | |
| 1281 | - * Method fired after the command runs. | |
| 1282 | - * | |
| 1283 | - * @param {string} command | |
| 1284 | - * @param {{}} args | |
| 1285 | - * @param {*} results | |
| 1286 | - * @param {boolean} [removeTrace=true] | |
| 1287 | - */ | |
| 1288 | - ) | |
| 1289 | - }, { | |
| 1290 | - key: "afterRun", | |
| 1291 | - value: function afterRun(command, args) { | |
| 1292 | - var results = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined; | |
| 1293 | - var removeTrace = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : true; | |
| 1294 | - var component = this.getComponent(command); | |
| 1295 | - if (args.onAfter) { | |
| 1296 | - args.onAfter.apply(component, [args, results]); | |
| 1297 | - } | |
| 1298 | - this.trigger('run:after', component, command, args, results); | |
| 1299 | - window.dispatchEvent(new CustomEvent('elementor/commands/run/after', { | |
| 1300 | - detail: { | |
| 1301 | - command: command, | |
| 1302 | - args: args | |
| 1303 | - } | |
| 1304 | - })); | |
| 1305 | - if (removeTrace) { | |
| 1306 | - this.removeCurrentTrace(component); | |
| 1307 | - } | |
| 1308 | - } | |
| 2318 | +//#endregion | |
| 2319 | +//#region node_modules/@babel/runtime/helpers/regeneratorAsync.js | |
| 2320 | + var require_regeneratorAsync = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 2321 | + var regeneratorAsyncGen = require_regeneratorAsyncGen(); | |
| 2322 | + function _regeneratorAsync(n, e, r, t, o) { | |
| 2323 | + var a = regeneratorAsyncGen(n, e, r, t, o); | |
| 2324 | + return a.next().then(function(n) { | |
| 2325 | + return n.done ? n.value : a.next(); | |
| 2326 | + }); | |
| 2327 | + } | |
| 2328 | + module.exports = _regeneratorAsync, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 2329 | + })); | |
| 1309 | 2330 | |
| 1310 | - /** | |
| 1311 | - * @param {Error} e | |
| 1312 | - * @param {CommandBase} instance | |
| 1313 | - */ | |
| 1314 | - }, { | |
| 1315 | - key: "catchApply", | |
| 1316 | - value: function catchApply(e, instance) { | |
| 1317 | - instance.onCatchApply(e); | |
| 1318 | - _console.default.error(e); | |
| 1319 | - } | |
| 2331 | +//#endregion | |
| 2332 | +//#region node_modules/@babel/runtime/helpers/regeneratorKeys.js | |
| 2333 | + var require_regeneratorKeys = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 2334 | + function _regeneratorKeys(e) { | |
| 2335 | + var n = Object(e); | |
| 2336 | + var r = []; | |
| 2337 | + for (var t in n) r.unshift(t); | |
| 2338 | + return function e() { | |
| 2339 | + for (; r.length;) if ((t = r.pop()) in n) return e.value = t, e.done = !1, e; | |
| 2340 | + return e.done = !0, e; | |
| 2341 | + }; | |
| 2342 | + } | |
| 2343 | + module.exports = _regeneratorKeys, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 2344 | + })); | |
| 1320 | 2345 | |
| 1321 | - /** | |
| 1322 | - * Function runShortcut(). | |
| 1323 | - * | |
| 1324 | - * Run shortcut. | |
| 1325 | - * | |
| 1326 | - * It's separated in order to allow override. | |
| 1327 | - * | |
| 1328 | - * @param {string} command | |
| 1329 | - * @param {*} event | |
| 1330 | - * | |
| 1331 | - * @return {boolean|*} result | |
| 1332 | - */ | |
| 1333 | - }, { | |
| 1334 | - key: "runShortcut", | |
| 1335 | - value: function runShortcut(command, event) { | |
| 1336 | - return this.run(command, event); | |
| 1337 | - } | |
| 1338 | - }, { | |
| 1339 | - key: "validateInstanceScope", | |
| 1340 | - value: function validateInstanceScope(instance, currentComponent, command) { | |
| 1341 | - if (!(instance instanceof _commandBase.default)) { | |
| 1342 | - this.error("invalid instance, command: '".concat(command, "' ")); | |
| 1343 | - } | |
| 2346 | +//#endregion | |
| 2347 | +//#region node_modules/@babel/runtime/helpers/typeof.js | |
| 2348 | + var require_typeof = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 2349 | + function _typeof(o) { | |
| 2350 | + "@babel/helpers - typeof"; | |
| 2351 | + return module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) { | |
| 2352 | + return typeof o; | |
| 2353 | + } : function(o) { | |
| 2354 | + return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; | |
| 2355 | + }, module.exports.__esModule = true, module.exports["default"] = module.exports, _typeof(o); | |
| 2356 | + } | |
| 2357 | + module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 2358 | + })); | |
| 1344 | 2359 | |
| 1345 | - // In case of different scope. | |
| 1346 | - if (currentComponent !== instance.component) { | |
| 1347 | - if ($e.devTools) { | |
| 1348 | - $e.devTools.log.warn("Command: '".concat(command, "' registerArgs.component: '").concat(instance.component.getNamespace(), "' while current component is: '").concat(currentComponent.getNamespace(), "'")); | |
| 1349 | - } | |
| 1350 | - return false; | |
| 1351 | - } | |
| 1352 | - return true; | |
| 1353 | - } | |
| 1354 | - }, { | |
| 1355 | - key: "addCurrentTrace", | |
| 1356 | - value: function addCurrentTrace(container, command, args) { | |
| 1357 | - this.currentTrace.push(command); | |
| 1358 | - Commands.trace.push(command); | |
| 1359 | - this.attachCurrent(container, command, args); | |
| 1360 | - } | |
| 1361 | - }, { | |
| 1362 | - key: "removeCurrentTrace", | |
| 1363 | - value: function removeCurrentTrace(currentComponent) { | |
| 1364 | - var container = currentComponent.getServiceName(); | |
| 1365 | - this.currentTrace.pop(); | |
| 1366 | - Commands.trace.pop(); | |
| 1367 | - this.detachCurrent(container); | |
| 1368 | - } | |
| 1369 | - }, { | |
| 1370 | - key: "attachCurrent", | |
| 1371 | - value: function attachCurrent(container, command, args) { | |
| 1372 | - this.current[container] = command; | |
| 1373 | - this.currentArgs[container] = args; | |
| 1374 | - } | |
| 1375 | - }, { | |
| 1376 | - key: "detachCurrent", | |
| 1377 | - value: function detachCurrent(container) { | |
| 1378 | - delete this.current[container]; | |
| 1379 | - delete this.currentArgs[container]; | |
| 1380 | - } | |
| 2360 | +//#endregion | |
| 2361 | +//#region node_modules/@babel/runtime/helpers/regeneratorValues.js | |
| 2362 | + var require_regeneratorValues = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 2363 | + var _typeof = require_typeof()["default"]; | |
| 2364 | + function _regeneratorValues(e) { | |
| 2365 | + if (null != e) { | |
| 2366 | + var t = e["function" == typeof Symbol && Symbol.iterator || "@@iterator"]; | |
| 2367 | + var r = 0; | |
| 2368 | + if (t) return t.call(e); | |
| 2369 | + if ("function" == typeof e.next) return e; | |
| 2370 | + if (!isNaN(e.length)) return { next: function next() { | |
| 2371 | + return e && r >= e.length && (e = void 0), { | |
| 2372 | + value: e && e[r++], | |
| 2373 | + done: !e | |
| 2374 | + }; | |
| 2375 | + } }; | |
| 2376 | + } | |
| 2377 | + throw new TypeError(_typeof(e) + " is not iterable"); | |
| 2378 | + } | |
| 2379 | + module.exports = _regeneratorValues, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 2380 | + })); | |
| 1381 | 2381 | |
| 1382 | - /** | |
| 1383 | - * Function error(). | |
| 1384 | - * | |
| 1385 | - * Throws error. | |
| 1386 | - * | |
| 1387 | - * @throws {Error} | |
| 1388 | - * | |
| 1389 | - * @param {string} message | |
| 1390 | - */ | |
| 1391 | - }, { | |
| 1392 | - key: "error", | |
| 1393 | - value: function error(message) { | |
| 1394 | - throw Error("Commands: ".concat(message)); | |
| 1395 | - } | |
| 1396 | - }]); | |
| 1397 | -}(_commands.default); | |
| 1398 | -(0, _defineProperty2.default)(Commands, "trace", []); | |
| 2382 | +//#endregion | |
| 2383 | +//#region node_modules/@babel/runtime/helpers/regeneratorRuntime.js | |
| 2384 | + var require_regeneratorRuntime = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 2385 | + var OverloadYield = require_OverloadYield(); | |
| 2386 | + var regenerator = require_regenerator$1(); | |
| 2387 | + var regeneratorAsync = require_regeneratorAsync(); | |
| 2388 | + var regeneratorAsyncGen = require_regeneratorAsyncGen(); | |
| 2389 | + var regeneratorAsyncIterator = require_regeneratorAsyncIterator(); | |
| 2390 | + var regeneratorKeys = require_regeneratorKeys(); | |
| 2391 | + var regeneratorValues = require_regeneratorValues(); | |
| 2392 | + function _regeneratorRuntime() { | |
| 2393 | + "use strict"; | |
| 2394 | + var r = regenerator(); | |
| 2395 | + var e = r.m(_regeneratorRuntime); | |
| 2396 | + var t = (Object.getPrototypeOf ? Object.getPrototypeOf(e) : e.__proto__).constructor; | |
| 2397 | + function n(r) { | |
| 2398 | + var e = "function" == typeof r && r.constructor; | |
| 2399 | + return !!e && (e === t || "GeneratorFunction" === (e.displayName || e.name)); | |
| 2400 | + } | |
| 2401 | + var o = { | |
| 2402 | + "throw": 1, | |
| 2403 | + "return": 2, | |
| 2404 | + "break": 3, | |
| 2405 | + "continue": 3 | |
| 2406 | + }; | |
| 2407 | + function a(r) { | |
| 2408 | + var e; | |
| 2409 | + var t; | |
| 2410 | + return function(n) { | |
| 2411 | + e || (e = { | |
| 2412 | + stop: function stop() { | |
| 2413 | + return t(n.a, 2); | |
| 2414 | + }, | |
| 2415 | + "catch": function _catch() { | |
| 2416 | + return n.v; | |
| 2417 | + }, | |
| 2418 | + abrupt: function abrupt(r, e) { | |
| 2419 | + return t(n.a, o[r], e); | |
| 2420 | + }, | |
| 2421 | + delegateYield: function delegateYield(r, o, a) { | |
| 2422 | + return e.resultName = o, t(n.d, regeneratorValues(r), a); | |
| 2423 | + }, | |
| 2424 | + finish: function finish(r) { | |
| 2425 | + return t(n.f, r); | |
| 2426 | + } | |
| 2427 | + }, t = function t(r, _t, o) { | |
| 2428 | + n.p = e.prev, n.n = e.next; | |
| 2429 | + try { | |
| 2430 | + return r(_t, o); | |
| 2431 | + } finally { | |
| 2432 | + e.next = n.n; | |
| 2433 | + } | |
| 2434 | + }), e.resultName && (e[e.resultName] = n.v, e.resultName = void 0), e.sent = n.v, e.next = n.n; | |
| 2435 | + try { | |
| 2436 | + return r.call(this, e); | |
| 2437 | + } finally { | |
| 2438 | + n.p = e.prev, n.n = e.next; | |
| 2439 | + } | |
| 2440 | + }; | |
| 2441 | + } | |
| 2442 | + return (module.exports = _regeneratorRuntime = function _regeneratorRuntime() { | |
| 2443 | + return { | |
| 2444 | + wrap: function wrap(e, t, n, o) { | |
| 2445 | + return r.w(a(e), t, n, o && o.reverse()); | |
| 2446 | + }, | |
| 2447 | + isGeneratorFunction: n, | |
| 2448 | + mark: r.m, | |
| 2449 | + awrap: function awrap(r, e) { | |
| 2450 | + return new OverloadYield(r, e); | |
| 2451 | + }, | |
| 2452 | + AsyncIterator: regeneratorAsyncIterator, | |
| 2453 | + async: function async(r, e, t, o, u) { | |
| 2454 | + return (n(e) ? regeneratorAsyncGen : regeneratorAsync)(a(r), e, t, o, u); | |
| 2455 | + }, | |
| 2456 | + keys: regeneratorKeys, | |
| 2457 | + values: regeneratorValues | |
| 2458 | + }; | |
| 2459 | + }, module.exports.__esModule = true, module.exports["default"] = module.exports)(); | |
| 2460 | + } | |
| 2461 | + module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 2462 | + })); | |
| 1399 | 2463 | |
| 1400 | -/***/ }), | |
| 2464 | +//#endregion | |
| 2465 | +//#region node_modules/@babel/runtime/regenerator/index.js | |
| 2466 | + var require_regenerator = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 2467 | + var runtime = require_regeneratorRuntime()(); | |
| 2468 | + module.exports = runtime; | |
| 2469 | + try { | |
| 2470 | + regeneratorRuntime = runtime; | |
| 2471 | + } catch (accidentalStrictMode) { | |
| 2472 | + if (typeof globalThis === "object") globalThis.regeneratorRuntime = runtime; | |
| 2473 | + else Function("r", "regeneratorRuntime = r")(runtime); | |
| 2474 | + } | |
| 2475 | + })); | |
| 1401 | 2476 | |
| 1402 | -/***/ "../modules/web-cli/assets/js/core/components.js": | |
| 1403 | -/*!*******************************************************!*\ | |
| 1404 | - !*** ../modules/web-cli/assets/js/core/components.js ***! | |
| 1405 | - \*******************************************************/ | |
| 1406 | -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 2477 | +//#endregion | |
| 2478 | +//#region modules/web-cli/assets/js/core/backwards-compatibility/commands.js | |
| 2479 | +var import_regenerator = /* @__PURE__ */ __toESM(require_regenerator()); | |
| 2480 | + function _callSuper$23(t, o, e) { | |
| 2481 | + return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$23() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); | |
| 2482 | + } | |
| 2483 | + __name(_callSuper$23, "_callSuper"); | |
| 2484 | + function _isNativeReflectConstruct$23() { | |
| 2485 | + try { | |
| 2486 | + var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); | |
| 2487 | + } catch (t) {} | |
| 2488 | + return (_isNativeReflectConstruct$23 = function _isNativeReflectConstruct() { | |
| 2489 | + return !!t; | |
| 2490 | + })(); | |
| 2491 | + } | |
| 2492 | + __name(_isNativeReflectConstruct$23, "_isNativeReflectConstruct"); | |
| 2493 | + var CommandsBackwardsCompatibility = /*#__PURE__*/ function(_Module) { | |
| 2494 | + function CommandsBackwardsCompatibility() { | |
| 2495 | + var _this; | |
| 2496 | + _classCallCheck(this, CommandsBackwardsCompatibility); | |
| 2497 | + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key]; | |
| 2498 | + _this = _callSuper$23(this, CommandsBackwardsCompatibility, [].concat(args)); | |
| 2499 | + _defineProperty(_this, "on", function(eventName, callback) { | |
| 2500 | + if ("run" === eventName) { | |
| 2501 | + var componentName = _this.getConstructorID(); | |
| 2502 | + componentName = componentName.replace(/^./, function(val) { | |
| 2503 | + return val.toLowerCase(); | |
| 2504 | + }); | |
| 2505 | + Deprecation.deprecated("$e.".concat(componentName, ".on( 'run', ... )"), "3.0.0", "$e.".concat(componentName, ".on( 'run:before', ... )")); | |
| 2506 | + _this.onOrig("run:before", callback); | |
| 2507 | + return; | |
| 2508 | + } | |
| 2509 | + _this.onOrig(eventName, callback); | |
| 2510 | + }); | |
| 2511 | + return _this; | |
| 2512 | + } | |
| 2513 | + _inherits(CommandsBackwardsCompatibility, _Module); | |
| 2514 | + return _createClass(CommandsBackwardsCompatibility, [{ | |
| 2515 | + key: "__construct", | |
| 2516 | + value: function __construct() { | |
| 2517 | + this.onOrig = this.on; | |
| 2518 | + } | |
| 2519 | + }]); | |
| 2520 | + }(import_module.default); | |
| 1407 | 2521 | |
| 1408 | -"use strict"; | |
| 2522 | +//#endregion | |
| 2523 | +//#region modules/web-cli/assets/js/core/commands.js | |
| 2524 | + init_typeof(); | |
| 2525 | + function ownKeys$1(e, r) { | |
| 2526 | + var t = Object.keys(e); | |
| 2527 | + if (Object.getOwnPropertySymbols) { | |
| 2528 | + var o = Object.getOwnPropertySymbols(e); | |
| 2529 | + r && (o = o.filter(function(r) { | |
| 2530 | + return Object.getOwnPropertyDescriptor(e, r).enumerable; | |
| 2531 | + })), t.push.apply(t, o); | |
| 2532 | + } | |
| 2533 | + return t; | |
| 2534 | + } | |
| 2535 | + __name(ownKeys$1, "ownKeys"); | |
| 2536 | + function _objectSpread$1(e) { | |
| 2537 | + for (var r = 1; r < arguments.length; r++) { | |
| 2538 | + var t = null != arguments[r] ? arguments[r] : {}; | |
| 2539 | + r % 2 ? ownKeys$1(Object(t), !0).forEach(function(r) { | |
| 2540 | + _defineProperty(e, r, t[r]); | |
| 2541 | + }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function(r) { | |
| 2542 | + Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); | |
| 2543 | + }); | |
| 2544 | + } | |
| 2545 | + return e; | |
| 2546 | + } | |
| 2547 | + __name(_objectSpread$1, "_objectSpread"); | |
| 2548 | + function _callSuper$22(t, o, e) { | |
| 2549 | + return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$22() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); | |
| 2550 | + } | |
| 2551 | + __name(_callSuper$22, "_callSuper"); | |
| 2552 | + function _isNativeReflectConstruct$22() { | |
| 2553 | + try { | |
| 2554 | + var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); | |
| 2555 | + } catch (t) {} | |
| 2556 | + return (_isNativeReflectConstruct$22 = function _isNativeReflectConstruct() { | |
| 2557 | + return !!t; | |
| 2558 | + })(); | |
| 2559 | + } | |
| 2560 | + __name(_isNativeReflectConstruct$22, "_isNativeReflectConstruct"); | |
| 2561 | + /** | |
| 2562 | + * @typedef {import('../modules/component-base')} ComponentBase | |
| 2563 | + */ | |
| 2564 | + /** | |
| 2565 | + * @typedef {import('../modules/command-base')} CommandBase | |
| 2566 | + */ | |
| 2567 | + /** | |
| 2568 | + * @typedef {{}} Component | |
| 2569 | + */ | |
| 2570 | + var Commands = /*#__PURE__*/ function(_CommandsBackwardsCom) { | |
| 2571 | + /** | |
| 2572 | + * Function constructor(). | |
| 2573 | + * | |
| 2574 | + * Create `$e.commands` API. | |
| 2575 | + * | |
| 2576 | + * @param {{}} args | |
| 2577 | + */ | |
| 2578 | + function Commands() { | |
| 2579 | + var _this; | |
| 2580 | + _classCallCheck(this, Commands); | |
| 2581 | + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key]; | |
| 2582 | + _this = _callSuper$22(this, Commands, [].concat(args)); | |
| 2583 | + _this.current = {}; | |
| 2584 | + _this.currentArgs = {}; | |
| 2585 | + _this.currentTrace = []; | |
| 2586 | + _this.commands = {}; | |
| 2587 | + _this.components = {}; | |
| 2588 | + Object.defineProperty(_this, "classes", { get: function get() { | |
| 2589 | + Deprecation.deprecated("$e.commands.classes", "3.7.0", "$e.commands.getCommandClass(), $e.commandsInternal.getCommandClass(), $e.data.getCommandClass(), $e.routes.getCommandClass() according to the requested command infra-structure,"); | |
| 2590 | + return _objectSpread$1(_objectSpread$1(_objectSpread$1(_objectSpread$1({}, $e.commands.commands), $e.commandsInternal.commands), $e.data.commands), $e.routes.commands); | |
| 2591 | + } }); | |
| 2592 | + return _this; | |
| 2593 | + } | |
| 2594 | + /** | |
| 2595 | + * @param {string} id | |
| 2596 | + * @return {CommandBase} command class | |
| 2597 | + */ | |
| 2598 | + _inherits(Commands, _CommandsBackwardsCom); | |
| 2599 | + return _createClass(Commands, [ | |
| 2600 | + { | |
| 2601 | + key: "getCommandClass", | |
| 2602 | + value: function getCommandClass(id) { | |
| 2603 | + return this.commands[id]; | |
| 2604 | + } | |
| 2605 | + }, | |
| 2606 | + { | |
| 2607 | + key: "getAll", | |
| 2608 | + value: function getAll() { | |
| 2609 | + return Object.keys(this.commands).sort(); | |
| 2610 | + } | |
| 2611 | + }, | |
| 2612 | + { | |
| 2613 | + key: "register", | |
| 2614 | + value: function register(component, command, callback) { | |
| 2615 | + var _this2 = this; | |
| 2616 | + var namespace; | |
| 2617 | + if ("string" === typeof component) { | |
| 2618 | + namespace = component; | |
| 2619 | + component = $e.components.get(namespace); | |
| 2620 | + if (!component) this.error("'".concat(namespace, "' component is not exist.")); | |
| 2621 | + } else namespace = component.getNamespace(); | |
| 2622 | + var fullCommand = namespace + (command ? "/" + command : ""); | |
| 2623 | + if (this.commands[fullCommand]) this.error("`".concat(fullCommand, "` is already registered.")); | |
| 2624 | + this.commands[fullCommand] = callback; | |
| 2625 | + this.components[fullCommand] = namespace; | |
| 2626 | + var shortcut = component.getShortcuts()[command]; | |
| 2627 | + if (shortcut) { | |
| 2628 | + shortcut.command = fullCommand; | |
| 2629 | + shortcut.callback = function(event) { | |
| 2630 | + return _this2.runShortcut(fullCommand, event); | |
| 2631 | + }; | |
| 2632 | + $e.shortcuts.register(shortcut.keys, shortcut); | |
| 2633 | + } | |
| 2634 | + return this; | |
| 2635 | + } | |
| 2636 | + }, | |
| 2637 | + { | |
| 2638 | + key: "unregister", | |
| 2639 | + value: function unregister(component, command) { | |
| 2640 | + var namespace; | |
| 2641 | + if ("string" === typeof component) { | |
| 2642 | + namespace = component; | |
| 2643 | + component = $e.components.get(namespace); | |
| 2644 | + if (!component) this.error("'".concat(namespace, "' component is not exist.")); | |
| 2645 | + } else namespace = component.getNamespace(); | |
| 2646 | + var fullCommand = namespace + (command ? "/" + command : ""); | |
| 2647 | + if (!this.commands[fullCommand]) this.error("`".concat(fullCommand, "` not exist.")); | |
| 2648 | + delete this.commands[fullCommand]; | |
| 2649 | + delete this.components[fullCommand]; | |
| 2650 | + var shortcut = component.getShortcuts()[command]; | |
| 2651 | + if (shortcut) $e.shortcuts.unregister(shortcut.keys, shortcut); | |
| 2652 | + return this; | |
| 2653 | + } | |
| 2654 | + }, | |
| 2655 | + { | |
| 2656 | + key: "getComponent", | |
| 2657 | + value: function getComponent(command) { | |
| 2658 | + var namespace = this.components[command]; | |
| 2659 | + return $e.components.get(namespace); | |
| 2660 | + } | |
| 2661 | + }, | |
| 2662 | + { | |
| 2663 | + key: "is", | |
| 2664 | + value: function is(command) { | |
| 2665 | + var component = this.getComponent(command); | |
| 2666 | + if (!component) return false; | |
| 2667 | + return command === this.current[component.getServiceName()]; | |
| 2668 | + } | |
| 2669 | + }, | |
| 2670 | + { | |
| 2671 | + key: "isCurrentFirstTrace", | |
| 2672 | + value: function isCurrentFirstTrace(command) { | |
| 2673 | + return command === this.getCurrentFirstTrace(); | |
| 2674 | + } | |
| 2675 | + }, | |
| 2676 | + { | |
| 2677 | + key: "getCurrent", | |
| 2678 | + value: function getCurrent() { | |
| 2679 | + var container = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : ""; | |
| 2680 | + if (container) { | |
| 2681 | + if (!this.current[container]) return false; | |
| 2682 | + return this.current[container]; | |
| 2683 | + } | |
| 2684 | + return this.current; | |
| 2685 | + } | |
| 2686 | + }, | |
| 2687 | + { | |
| 2688 | + key: "getCurrentArgs", | |
| 2689 | + value: function getCurrentArgs() { | |
| 2690 | + var container = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : ""; | |
| 2691 | + if (container) { | |
| 2692 | + if (!this.currentArgs[container]) return false; | |
| 2693 | + return this.currentArgs[container]; | |
| 2694 | + } | |
| 2695 | + return this.currentArgs; | |
| 2696 | + } | |
| 2697 | + }, | |
| 2698 | + { | |
| 2699 | + key: "getCurrentFirst", | |
| 2700 | + value: function getCurrentFirst() { | |
| 2701 | + return Object.values(this.current)[0]; | |
| 2702 | + } | |
| 2703 | + }, | |
| 2704 | + { | |
| 2705 | + key: "getCurrentLast", | |
| 2706 | + value: function getCurrentLast() { | |
| 2707 | + var current = Object.values(this.current); | |
| 2708 | + return current[current.length - 1]; | |
| 2709 | + } | |
| 2710 | + }, | |
| 2711 | + { | |
| 2712 | + key: "getCurrentFirstTrace", | |
| 2713 | + value: function getCurrentFirstTrace() { | |
| 2714 | + return this.currentTrace[0]; | |
| 2715 | + } | |
| 2716 | + }, | |
| 2717 | + { | |
| 2718 | + key: "beforeRun", | |
| 2719 | + value: function beforeRun(command) { | |
| 2720 | + var args = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; | |
| 2721 | + var addTrace = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : true; | |
| 2722 | + var component = this.getComponent(command); | |
| 2723 | + var container = component.getServiceName(); | |
| 2724 | + if (addTrace) this.addCurrentTrace(container, command, args); | |
| 2725 | + if (args.onBefore) args.onBefore.apply(component, [args]); | |
| 2726 | + this.trigger("run:before", component, command, args); | |
| 2727 | + window.dispatchEvent(new CustomEvent("elementor/commands/run/before", { detail: { | |
| 2728 | + command, | |
| 2729 | + args | |
| 2730 | + } })); | |
| 2731 | + } | |
| 2732 | + }, | |
| 2733 | + { | |
| 2734 | + key: "validateRun", | |
| 2735 | + value: function validateRun(command) { | |
| 2736 | + var args = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; | |
| 2737 | + if (!this.commands[command]) this.error("`".concat(command, "` not found.")); | |
| 2738 | + return this.getComponent(command).dependency(command, args); | |
| 2739 | + } | |
| 2740 | + }, | |
| 2741 | + { | |
| 2742 | + key: "run", | |
| 2743 | + value: function run(command) { | |
| 2744 | + var args = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; | |
| 2745 | + if (!this.validateRun(command, args)) return false; | |
| 2746 | + this.beforeRun(command, args); | |
| 2747 | + var context = this.commands[command]; | |
| 2748 | + if (context.getInstanceType) context = new context(args); | |
| 2749 | + var currentComponent = this.getComponent(command); | |
| 2750 | + if (!(context instanceof CommandBase)) { | |
| 2751 | + var results = context.apply(currentComponent, [args]); | |
| 2752 | + this.afterRun(command, args, results); | |
| 2753 | + return results; | |
| 2754 | + } | |
| 2755 | + if (!this.validateInstanceScope(context, currentComponent, command)) return this.removeCurrentTrace(currentComponent); | |
| 2756 | + return this.runInstance(context); | |
| 2757 | + } | |
| 2758 | + }, | |
| 2759 | + { | |
| 2760 | + key: "runInstance", | |
| 2761 | + value: function runInstance(instance) { | |
| 2762 | + var results = null; | |
| 2763 | + instance.onBeforeRun(instance.args); | |
| 2764 | + try { | |
| 2765 | + instance.onBeforeApply(instance.args); | |
| 2766 | + results = instance.run(); | |
| 2767 | + } catch (e) { | |
| 2768 | + this.catchApply(e, instance); | |
| 2769 | + if (e instanceof $e.modules.HookBreak) { | |
| 2770 | + this.removeCurrentTrace(instance.component); | |
| 2771 | + return false; | |
| 2772 | + } | |
| 2773 | + } | |
| 2774 | + return this.applyRunAfter(instance, results); | |
| 2775 | + } | |
| 2776 | + }, | |
| 2777 | + { | |
| 2778 | + key: "applyRunAfter", | |
| 2779 | + value: function applyRunAfter(instance, result) { | |
| 2780 | + var _this3 = this; | |
| 2781 | + if (result && "object" === _typeof(result) && result.promise && result.then && result.fail) return function handleJQueryDeferred(_result) { | |
| 2782 | + _result.fail(function(e) { | |
| 2783 | + _this3.catchApply(e, instance); | |
| 2784 | + _this3.afterRun(instance.command, instance.args, e); | |
| 2785 | + }); | |
| 2786 | + return _result.done(function(__result) { | |
| 2787 | + return _this3.applyRunAfterAsyncResult(instance, __result); | |
| 2788 | + }); | |
| 2789 | + }(result); | |
| 2790 | + else if (result instanceof Promise) return this.applyRunAfterAsync(instance, result); | |
| 2791 | + this.applyRunAfterSync(instance, result); | |
| 2792 | + return result; | |
| 2793 | + } | |
| 2794 | + }, | |
| 2795 | + { | |
| 2796 | + key: "applyRunAfterSync", | |
| 2797 | + value: function applyRunAfterSync(instance, result) { | |
| 2798 | + instance.onAfterApply(instance.args, result); | |
| 2799 | + instance.onAfterRun(instance.args, result); | |
| 2800 | + this.afterRun(instance.command, instance.args, result); | |
| 2801 | + } | |
| 2802 | + }, | |
| 2803 | + { | |
| 2804 | + key: "applyRunAfterAsync", | |
| 2805 | + value: function applyRunAfterAsync(instance, result) { | |
| 2806 | + var _this4 = this; | |
| 2807 | + return _asyncToGenerator(/*#__PURE__*/ import_regenerator.default.mark(function _callee() { | |
| 2808 | + return import_regenerator.default.wrap(function(_context) { | |
| 2809 | + while (1) switch (_context.prev = _context.next) { | |
| 2810 | + case 0: | |
| 2811 | + _context.next = 1; | |
| 2812 | + return result.catch(function(e) { | |
| 2813 | + _this4.catchApply(e, instance); | |
| 2814 | + _this4.afterRun(instance.command, instance.args, e); | |
| 2815 | + }); | |
| 2816 | + case 1: | |
| 2817 | + _context.next = 2; | |
| 2818 | + return result.then(function(_result) { | |
| 2819 | + return _this4.applyRunAfterAsyncResult(instance, _result); | |
| 2820 | + }); | |
| 2821 | + case 2: return _context.abrupt("return", result); | |
| 2822 | + case 3: | |
| 2823 | + case "end": return _context.stop(); | |
| 2824 | + } | |
| 2825 | + }, _callee); | |
| 2826 | + }))(); | |
| 2827 | + } | |
| 2828 | + }, | |
| 2829 | + { | |
| 2830 | + key: "applyRunAfterAsyncResult", | |
| 2831 | + value: function() { | |
| 2832 | + var _applyRunAfterAsyncResult = _asyncToGenerator(/*#__PURE__*/ import_regenerator.default.mark(function _callee2(instance, result) { | |
| 2833 | + var results; | |
| 2834 | + var promises; | |
| 2835 | + return import_regenerator.default.wrap(function(_context2) { | |
| 2836 | + while (1) switch (_context2.prev = _context2.next) { | |
| 2837 | + case 0: | |
| 2838 | + results = instance.onAfterApply(instance.args, result), promises = Array.isArray(results) ? results.flat().filter(function(filtered) { | |
| 2839 | + return filtered instanceof Promise; | |
| 2840 | + }) : []; | |
| 2841 | + if (!promises.length) { | |
| 2842 | + _context2.next = 1; | |
| 2843 | + break; | |
| 2844 | + } | |
| 2845 | + _context2.next = 1; | |
| 2846 | + return Promise.all(promises); | |
| 2847 | + case 1: | |
| 2848 | + instance.onAfterRun(instance.args, result); | |
| 2849 | + this.afterRun(instance.command, instance.args, result); | |
| 2850 | + case 2: | |
| 2851 | + case "end": return _context2.stop(); | |
| 2852 | + } | |
| 2853 | + }, _callee2, this); | |
| 2854 | + })); | |
| 2855 | + function applyRunAfterAsyncResult(_x, _x2) { | |
| 2856 | + return _applyRunAfterAsyncResult.apply(this, arguments); | |
| 2857 | + } | |
| 2858 | + return applyRunAfterAsyncResult; | |
| 2859 | + }() | |
| 2860 | + }, | |
| 2861 | + { | |
| 2862 | + key: "afterRun", | |
| 2863 | + value: function afterRun(command, args) { | |
| 2864 | + var results = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : void 0; | |
| 2865 | + var removeTrace = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : true; | |
| 2866 | + var component = this.getComponent(command); | |
| 2867 | + if (args.onAfter) args.onAfter.apply(component, [args, results]); | |
| 2868 | + this.trigger("run:after", component, command, args, results); | |
| 2869 | + window.dispatchEvent(new CustomEvent("elementor/commands/run/after", { detail: { | |
| 2870 | + command, | |
| 2871 | + args | |
| 2872 | + } })); | |
| 2873 | + if (removeTrace) this.removeCurrentTrace(component); | |
| 2874 | + } | |
| 2875 | + }, | |
| 2876 | + { | |
| 2877 | + key: "catchApply", | |
| 2878 | + value: function catchApply(e, instance) { | |
| 2879 | + instance.onCatchApply(e); | |
| 2880 | + Console.error(e); | |
| 2881 | + } | |
| 2882 | + }, | |
| 2883 | + { | |
| 2884 | + key: "runShortcut", | |
| 2885 | + value: function runShortcut(command, event) { | |
| 2886 | + return this.run(command, event); | |
| 2887 | + } | |
| 2888 | + }, | |
| 2889 | + { | |
| 2890 | + key: "validateInstanceScope", | |
| 2891 | + value: function validateInstanceScope(instance, currentComponent, command) { | |
| 2892 | + if (!(instance instanceof CommandBase)) this.error("invalid instance, command: '".concat(command, "' ")); | |
| 2893 | + if (currentComponent !== instance.component) { | |
| 2894 | + if ($e.devTools) $e.devTools.log.warn("Command: '".concat(command, "' registerArgs.component: '").concat(instance.component.getNamespace(), "' while current component is: '").concat(currentComponent.getNamespace(), "'")); | |
| 2895 | + return false; | |
| 2896 | + } | |
| 2897 | + return true; | |
| 2898 | + } | |
| 2899 | + }, | |
| 2900 | + { | |
| 2901 | + key: "addCurrentTrace", | |
| 2902 | + value: function addCurrentTrace(container, command, args) { | |
| 2903 | + this.currentTrace.push(command); | |
| 2904 | + Commands.trace.push(command); | |
| 2905 | + this.attachCurrent(container, command, args); | |
| 2906 | + } | |
| 2907 | + }, | |
| 2908 | + { | |
| 2909 | + key: "removeCurrentTrace", | |
| 2910 | + value: function removeCurrentTrace(currentComponent) { | |
| 2911 | + var container = currentComponent.getServiceName(); | |
| 2912 | + this.currentTrace.pop(); | |
| 2913 | + Commands.trace.pop(); | |
| 2914 | + this.detachCurrent(container); | |
| 2915 | + } | |
| 2916 | + }, | |
| 2917 | + { | |
| 2918 | + key: "attachCurrent", | |
| 2919 | + value: function attachCurrent(container, command, args) { | |
| 2920 | + this.current[container] = command; | |
| 2921 | + this.currentArgs[container] = args; | |
| 2922 | + } | |
| 2923 | + }, | |
| 2924 | + { | |
| 2925 | + key: "detachCurrent", | |
| 2926 | + value: function detachCurrent(container) { | |
| 2927 | + delete this.current[container]; | |
| 2928 | + delete this.currentArgs[container]; | |
| 2929 | + } | |
| 2930 | + }, | |
| 2931 | + { | |
| 2932 | + key: "error", | |
| 2933 | + value: function error(message) { | |
| 2934 | + throw Error("Commands: ".concat(message)); | |
| 2935 | + } | |
| 2936 | + } | |
| 2937 | + ]); | |
| 2938 | + }(CommandsBackwardsCompatibility); | |
| 2939 | + _defineProperty(Commands, "trace", []); | |
| 1409 | 2940 | |
| 2941 | +//#endregion | |
| 2942 | +//#region modules/web-cli/assets/js/core/commands-internal.js | |
| 2943 | + function _callSuper$21(t, o, e) { | |
| 2944 | + return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$21() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); | |
| 2945 | + } | |
| 2946 | + __name(_callSuper$21, "_callSuper"); | |
| 2947 | + function _isNativeReflectConstruct$21() { | |
| 2948 | + try { | |
| 2949 | + var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); | |
| 2950 | + } catch (t) {} | |
| 2951 | + return (_isNativeReflectConstruct$21 = function _isNativeReflectConstruct() { | |
| 2952 | + return !!t; | |
| 2953 | + })(); | |
| 2954 | + } | |
| 2955 | + __name(_isNativeReflectConstruct$21, "_isNativeReflectConstruct"); | |
| 2956 | + var CommandsInternal = /*#__PURE__*/ function(_Commands) { | |
| 2957 | + function CommandsInternal() { | |
| 2958 | + _classCallCheck(this, CommandsInternal); | |
| 2959 | + return _callSuper$21(this, CommandsInternal, arguments); | |
| 2960 | + } | |
| 2961 | + _inherits(CommandsInternal, _Commands); | |
| 2962 | + return _createClass(CommandsInternal, [{ | |
| 2963 | + key: "error", | |
| 2964 | + value: function error(message) { | |
| 2965 | + throw Error("Commands internal: " + message); | |
| 2966 | + } | |
| 2967 | + }]); | |
| 2968 | + }(Commands); | |
| 1410 | 2969 | |
| 1411 | -var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 1412 | -Object.defineProperty(exports, "__esModule", ({ | |
| 1413 | - value: true | |
| 1414 | -})); | |
| 1415 | -exports["default"] = void 0; | |
| 1416 | -var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 1417 | -var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 1418 | -var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 1419 | -var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 1420 | -var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 1421 | -var _module = _interopRequireDefault(__webpack_require__(/*! elementor-assets-js/modules/imports/module.js */ "../assets/dev/js/modules/imports/module.js")); | |
| 1422 | -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)); } | |
| 1423 | -function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } | |
| 1424 | -/** | |
| 1425 | - * @typedef {{}} Component | |
| 1426 | - */ | |
| 1427 | -var _default = exports["default"] = /*#__PURE__*/function (_Module) { | |
| 1428 | - function _default() { | |
| 1429 | - var _this; | |
| 1430 | - (0, _classCallCheck2.default)(this, _default); | |
| 1431 | - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { | |
| 1432 | - args[_key] = arguments[_key]; | |
| 1433 | - } | |
| 1434 | - _this = _callSuper(this, _default, [].concat(args)); | |
| 1435 | - _this.components = {}; | |
| 1436 | - _this.activeComponents = {}; | |
| 1437 | - return _this; | |
| 1438 | - } | |
| 1439 | - (0, _inherits2.default)(_default, _Module); | |
| 1440 | - return (0, _createClass2.default)(_default, [{ | |
| 1441 | - key: "getAll", | |
| 1442 | - value: function getAll() { | |
| 1443 | - return Object.keys(this.components).sort(); | |
| 1444 | - } | |
| 1445 | - }, { | |
| 1446 | - key: "register", | |
| 1447 | - value: function register(component) { | |
| 1448 | - if (this.components[component.getNamespace()]) { | |
| 1449 | - return; | |
| 1450 | - } | |
| 1451 | - component.registerAPI(); | |
| 1452 | - this.components[component.getNamespace()] = component; | |
| 1453 | - return component; | |
| 1454 | - } | |
| 2970 | +//#endregion | |
| 2971 | +//#region modules/web-cli/assets/js/modules/commands/close.js | |
| 2972 | + function _callSuper$20(t, o, e) { | |
| 2973 | + return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$20() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); | |
| 2974 | + } | |
| 2975 | + __name(_callSuper$20, "_callSuper"); | |
| 2976 | + function _isNativeReflectConstruct$20() { | |
| 2977 | + try { | |
| 2978 | + var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); | |
| 2979 | + } catch (t) {} | |
| 2980 | + return (_isNativeReflectConstruct$20 = function _isNativeReflectConstruct() { | |
| 2981 | + return !!t; | |
| 2982 | + })(); | |
| 2983 | + } | |
| 2984 | + __name(_isNativeReflectConstruct$20, "_isNativeReflectConstruct"); | |
| 2985 | + var Close = /*#__PURE__*/ function(_CommandBase) { | |
| 2986 | + function Close() { | |
| 2987 | + _classCallCheck(this, Close); | |
| 2988 | + return _callSuper$20(this, Close, arguments); | |
| 2989 | + } | |
| 2990 | + _inherits(Close, _CommandBase); | |
| 2991 | + return _createClass(Close, [{ | |
| 2992 | + key: "apply", | |
| 2993 | + value: function apply() { | |
| 2994 | + this.component.close(); | |
| 2995 | + } | |
| 2996 | + }]); | |
| 2997 | + }(CommandBase); | |
| 1455 | 2998 | |
| 1456 | - /** | |
| 1457 | - * @param {string} id | |
| 1458 | - * @return {Component} component | |
| 1459 | - */ | |
| 1460 | - }, { | |
| 1461 | - key: "get", | |
| 1462 | - value: function get(id) { | |
| 1463 | - return this.components[id]; | |
| 1464 | - } | |
| 1465 | - }, { | |
| 1466 | - key: "getActive", | |
| 1467 | - value: function getActive() { | |
| 1468 | - return this.activeComponents; | |
| 1469 | - } | |
| 1470 | - }, { | |
| 1471 | - key: "activate", | |
| 1472 | - value: function activate(namespace) { | |
| 1473 | - // Add as last. | |
| 1474 | - this.inactivate(namespace); | |
| 1475 | - this.activeComponents[namespace] = true; | |
| 1476 | - } | |
| 1477 | - }, { | |
| 1478 | - key: "inactivate", | |
| 1479 | - value: function inactivate(namespace) { | |
| 1480 | - delete this.activeComponents[namespace]; | |
| 1481 | - } | |
| 1482 | - }, { | |
| 1483 | - key: "isActive", | |
| 1484 | - value: function isActive(namespace) { | |
| 1485 | - return !!this.activeComponents[namespace]; | |
| 1486 | - } | |
| 1487 | - }]); | |
| 1488 | -}(_module.default); | |
| 2999 | +//#endregion | |
| 3000 | +//#region modules/web-cli/assets/js/modules/commands/open.js | |
| 3001 | + function _callSuper$19(t, o, e) { | |
| 3002 | + return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$19() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); | |
| 3003 | + } | |
| 3004 | + __name(_callSuper$19, "_callSuper"); | |
| 3005 | + function _isNativeReflectConstruct$19() { | |
| 3006 | + try { | |
| 3007 | + var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); | |
| 3008 | + } catch (t) {} | |
| 3009 | + return (_isNativeReflectConstruct$19 = function _isNativeReflectConstruct() { | |
| 3010 | + return !!t; | |
| 3011 | + })(); | |
| 3012 | + } | |
| 3013 | + __name(_isNativeReflectConstruct$19, "_isNativeReflectConstruct"); | |
| 3014 | + var Open = /*#__PURE__*/ function(_CommandBase) { | |
| 3015 | + function Open() { | |
| 3016 | + _classCallCheck(this, Open); | |
| 3017 | + return _callSuper$19(this, Open, arguments); | |
| 3018 | + } | |
| 3019 | + _inherits(Open, _CommandBase); | |
| 3020 | + return _createClass(Open, [{ | |
| 3021 | + key: "apply", | |
| 3022 | + value: function apply() { | |
| 3023 | + $e.route(this.component.getNamespace()); | |
| 3024 | + } | |
| 3025 | + }]); | |
| 3026 | + }(CommandBase); | |
| 1489 | 3027 | |
| 1490 | -/***/ }), | |
| 3028 | +//#endregion | |
| 3029 | +//#region modules/web-cli/assets/js/modules/commands/toggle.js | |
| 3030 | + function _callSuper$18(t, o, e) { | |
| 3031 | + return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$18() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); | |
| 3032 | + } | |
| 3033 | + __name(_callSuper$18, "_callSuper"); | |
| 3034 | + function _isNativeReflectConstruct$18() { | |
| 3035 | + try { | |
| 3036 | + var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); | |
| 3037 | + } catch (t) {} | |
| 3038 | + return (_isNativeReflectConstruct$18 = function _isNativeReflectConstruct() { | |
| 3039 | + return !!t; | |
| 3040 | + })(); | |
| 3041 | + } | |
| 3042 | + __name(_isNativeReflectConstruct$18, "_isNativeReflectConstruct"); | |
| 3043 | + var Toggle = /*#__PURE__*/ function(_CommandBase) { | |
| 3044 | + function Toggle() { | |
| 3045 | + _classCallCheck(this, Toggle); | |
| 3046 | + return _callSuper$18(this, Toggle, arguments); | |
| 3047 | + } | |
| 3048 | + _inherits(Toggle, _CommandBase); | |
| 3049 | + return _createClass(Toggle, [{ | |
| 3050 | + key: "apply", | |
| 3051 | + value: function apply() { | |
| 3052 | + if (this.component.isOpen) this.component.close(); | |
| 3053 | + else $e.route(this.component.getNamespace()); | |
| 3054 | + } | |
| 3055 | + }]); | |
| 3056 | + }(CommandBase); | |
| 1491 | 3057 | |
| 1492 | -/***/ "../modules/web-cli/assets/js/core/data.js": | |
| 1493 | -/*!*************************************************!*\ | |
| 1494 | - !*** ../modules/web-cli/assets/js/core/data.js ***! | |
| 1495 | - \*************************************************/ | |
| 1496 | -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 3058 | +//#endregion | |
| 3059 | +//#region modules/web-cli/assets/js/modules/commands/index.js | |
| 3060 | + var commands_exports = /* @__PURE__ */ __exportAll({ | |
| 3061 | + Close: () => Close, | |
| 3062 | + Open: () => Open, | |
| 3063 | + Toggle: () => Toggle | |
| 3064 | + }); | |
| 1497 | 3065 | |
| 1498 | -"use strict"; | |
| 3066 | +//#endregion | |
| 3067 | +//#region modules/web-cli/assets/js/modules/component-modal-base.js | |
| 3068 | + function _callSuper$17(t, o, e) { | |
| 3069 | + return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$17() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); | |
| 3070 | + } | |
| 3071 | + __name(_callSuper$17, "_callSuper"); | |
| 3072 | + function _isNativeReflectConstruct$17() { | |
| 3073 | + try { | |
| 3074 | + var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); | |
| 3075 | + } catch (t) {} | |
| 3076 | + return (_isNativeReflectConstruct$17 = function _isNativeReflectConstruct() { | |
| 3077 | + return !!t; | |
| 3078 | + })(); | |
| 3079 | + } | |
| 3080 | + __name(_isNativeReflectConstruct$17, "_isNativeReflectConstruct"); | |
| 3081 | + function _superPropGet$4(t, o, e, r) { | |
| 3082 | + var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e); | |
| 3083 | + return 2 & r && "function" == typeof p ? function(t) { | |
| 3084 | + return p.apply(e, t); | |
| 3085 | + } : p; | |
| 3086 | + } | |
| 3087 | + __name(_superPropGet$4, "_superPropGet"); | |
| 3088 | + var ComponentModalBase = /*#__PURE__*/ function(_ComponentBase) { | |
| 3089 | + function ComponentModalBase() { | |
| 3090 | + _classCallCheck(this, ComponentModalBase); | |
| 3091 | + return _callSuper$17(this, ComponentModalBase, arguments); | |
| 3092 | + } | |
| 3093 | + _inherits(ComponentModalBase, _ComponentBase); | |
| 3094 | + return _createClass(ComponentModalBase, [ | |
| 3095 | + { | |
| 3096 | + key: "registerAPI", | |
| 3097 | + value: function registerAPI() { | |
| 3098 | + var _this = this; | |
| 3099 | + _superPropGet$4(ComponentModalBase, "registerAPI", this, 3)([]); | |
| 3100 | + $e.shortcuts.register("esc", { | |
| 3101 | + scopes: [this.getNamespace()], | |
| 3102 | + callback: function callback() { | |
| 3103 | + return _this.close(); | |
| 3104 | + } | |
| 3105 | + }); | |
| 3106 | + } | |
| 3107 | + }, | |
| 3108 | + { | |
| 3109 | + key: "defaultCommands", | |
| 3110 | + value: function defaultCommands() { | |
| 3111 | + return this.importCommands(commands_exports); | |
| 3112 | + } | |
| 3113 | + }, | |
| 3114 | + { | |
| 3115 | + key: "defaultRoutes", | |
| 3116 | + value: function defaultRoutes() { | |
| 3117 | + return { "": function _() {} }; | |
| 3118 | + } | |
| 3119 | + }, | |
| 3120 | + { | |
| 3121 | + key: "open", | |
| 3122 | + value: function open() { | |
| 3123 | + var _this2 = this; | |
| 3124 | + if (!this.layout) { | |
| 3125 | + var layout = this.getModalLayout(); | |
| 3126 | + this.layout = new layout({ component: this }); | |
| 3127 | + this.layout.getModal().on("hide", function() { | |
| 3128 | + return _this2.close(); | |
| 3129 | + }); | |
| 3130 | + } | |
| 3131 | + this.layout.showModal(); | |
| 3132 | + return true; | |
| 3133 | + } | |
| 3134 | + }, | |
| 3135 | + { | |
| 3136 | + key: "close", | |
| 3137 | + value: function close() { | |
| 3138 | + if (!_superPropGet$4(ComponentModalBase, "close", this, 3)([])) return false; | |
| 3139 | + elementor.hooks.applyFilters("component/modal/close", this.layout.getModal().hide.bind(this.layout.getModal()), this)(); | |
| 3140 | + return true; | |
| 3141 | + } | |
| 3142 | + }, | |
| 3143 | + { | |
| 3144 | + key: "getModalLayout", | |
| 3145 | + value: function getModalLayout() { | |
| 3146 | + force_method_implementation_default(); | |
| 3147 | + } | |
| 3148 | + } | |
| 3149 | + ]); | |
| 3150 | + }(ComponentBase); | |
| 1499 | 3151 | |
| 3152 | +//#endregion | |
| 3153 | +//#region modules/web-cli/assets/js/core/components.js | |
| 3154 | + function _callSuper$16(t, o, e) { | |
| 3155 | + return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$16() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); | |
| 3156 | + } | |
| 3157 | + __name(_callSuper$16, "_callSuper"); | |
| 3158 | + function _isNativeReflectConstruct$16() { | |
| 3159 | + try { | |
| 3160 | + var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); | |
| 3161 | + } catch (t) {} | |
| 3162 | + return (_isNativeReflectConstruct$16 = function _isNativeReflectConstruct() { | |
| 3163 | + return !!t; | |
| 3164 | + })(); | |
| 3165 | + } | |
| 3166 | + __name(_isNativeReflectConstruct$16, "_isNativeReflectConstruct"); | |
| 3167 | + /** | |
| 3168 | + * @typedef {{}} Component | |
| 3169 | + */ | |
| 3170 | + var _default = /*#__PURE__*/ function(_Module) { | |
| 3171 | + function _default() { | |
| 3172 | + var _this; | |
| 3173 | + _classCallCheck(this, _default); | |
| 3174 | + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key]; | |
| 3175 | + _this = _callSuper$16(this, _default, [].concat(args)); | |
| 3176 | + _this.components = {}; | |
| 3177 | + _this.activeComponents = {}; | |
| 3178 | + return _this; | |
| 3179 | + } | |
| 3180 | + _inherits(_default, _Module); | |
| 3181 | + return _createClass(_default, [ | |
| 3182 | + { | |
| 3183 | + key: "getAll", | |
| 3184 | + value: function getAll() { | |
| 3185 | + return Object.keys(this.components).sort(); | |
| 3186 | + } | |
| 3187 | + }, | |
| 3188 | + { | |
| 3189 | + key: "register", | |
| 3190 | + value: function register(component) { | |
| 3191 | + if (this.components[component.getNamespace()]) return; | |
| 3192 | + component.registerAPI(); | |
| 3193 | + this.components[component.getNamespace()] = component; | |
| 3194 | + return component; | |
| 3195 | + } | |
| 3196 | + }, | |
| 3197 | + { | |
| 3198 | + key: "get", | |
| 3199 | + value: function get(id) { | |
| 3200 | + return this.components[id]; | |
| 3201 | + } | |
| 3202 | + }, | |
| 3203 | + { | |
| 3204 | + key: "getActive", | |
| 3205 | + value: function getActive() { | |
| 3206 | + return this.activeComponents; | |
| 3207 | + } | |
| 3208 | + }, | |
| 3209 | + { | |
| 3210 | + key: "activate", | |
| 3211 | + value: function activate(namespace) { | |
| 3212 | + this.inactivate(namespace); | |
| 3213 | + this.activeComponents[namespace] = true; | |
| 3214 | + } | |
| 3215 | + }, | |
| 3216 | + { | |
| 3217 | + key: "inactivate", | |
| 3218 | + value: function inactivate(namespace) { | |
| 3219 | + delete this.activeComponents[namespace]; | |
| 3220 | + } | |
| 3221 | + }, | |
| 3222 | + { | |
| 3223 | + key: "isActive", | |
| 3224 | + value: function isActive(namespace) { | |
| 3225 | + return !!this.activeComponents[namespace]; | |
| 3226 | + } | |
| 3227 | + } | |
| 3228 | + ]); | |
| 3229 | + }(import_module.default); | |
| 1500 | 3230 | |
| 1501 | -var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 1502 | -Object.defineProperty(exports, "__esModule", ({ | |
| 1503 | - value: true | |
| 1504 | -})); | |
| 1505 | -exports["default"] = exports.READABLE = exports.EDITABLE = exports.DELETABLE = exports.CREATABLE = exports.ALLMETHODS = void 0; | |
| 1506 | -var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ "../node_modules/@babel/runtime/regenerator/index.js")); | |
| 1507 | -var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "../node_modules/@babel/runtime/helpers/asyncToGenerator.js")); | |
| 1508 | -var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js")); | |
| 1509 | -var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 1510 | -var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 1511 | -var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 1512 | -var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 1513 | -var _get2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/get */ "../node_modules/@babel/runtime/helpers/get.js")); | |
| 1514 | -var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 1515 | -var _argsObject = _interopRequireDefault(__webpack_require__(/*! elementor-assets-js/modules/imports/args-object */ "../assets/dev/js/modules/imports/args-object.js")); | |
| 1516 | -var _commands = _interopRequireDefault(__webpack_require__(/*! ./commands.js */ "../modules/web-cli/assets/js/core/commands.js")); | |
| 1517 | -var _cache = _interopRequireDefault(__webpack_require__(/*! ./data/cache */ "../modules/web-cli/assets/js/core/data/cache.js")); | |
| 1518 | -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)); } | |
| 1519 | -function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } | |
| 1520 | -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; } | |
| 3231 | +//#endregion | |
| 3232 | +//#region modules/web-cli/assets/js/core/data/storages/base-storage.js | |
| 1521 | 3233 | /** |
| 1522 | - * @typedef {('create'|'delete'|'get'|'update'|'options')} DataTypes | |
| 1523 | - */ | |
| 1524 | -/** | |
| 1525 | - * @typedef {import('../modules/component-base')} ComponentBase | |
| 1526 | - */ | |
| 1527 | -/** | |
| 1528 | - * @typedef {{}} RequestInfo | |
| 1529 | - */ | |
| 3234 | + * TODO: Merge all storage's to one. | |
| 3235 | + * Using this technique give's the ability to use JSDOC from 'window.storage'. | |
| 3236 | + * | |
| 3237 | + * @implements {Storage} | |
| 3238 | + */ | |
| 3239 | + var BaseStorage = /*#__PURE__*/ function() { | |
| 3240 | + /** | |
| 3241 | + * Create storage wrapper. | |
| 3242 | + * | |
| 3243 | + * @param {Storage} provider | |
| 3244 | + */ | |
| 3245 | + function BaseStorage(provider) { | |
| 3246 | + _classCallCheck(this, BaseStorage); | |
| 3247 | + if (BaseStorage === (this instanceof BaseStorage ? this.constructor : void 0)) throw new TypeError("Cannot construct BaseStorage instances directly"); | |
| 3248 | + this.provider = provider; | |
| 3249 | + } | |
| 3250 | + return _createClass(BaseStorage, [ | |
| 3251 | + { | |
| 3252 | + key: "clear", | |
| 3253 | + value: function clear() { | |
| 3254 | + return this.provider.clear(); | |
| 3255 | + } | |
| 3256 | + }, | |
| 3257 | + { | |
| 3258 | + key: "getItem", | |
| 3259 | + value: function getItem(key) { | |
| 3260 | + var result = this.provider.getItem(key); | |
| 3261 | + if (null !== result) return JSON.parse(result); | |
| 3262 | + return result; | |
| 3263 | + } | |
| 3264 | + }, | |
| 3265 | + { | |
| 3266 | + key: "key", | |
| 3267 | + value: function key(index) { | |
| 3268 | + return this.provider.key(index); | |
| 3269 | + } | |
| 3270 | + }, | |
| 3271 | + { | |
| 3272 | + key: "removeItem", | |
| 3273 | + value: function removeItem(key) { | |
| 3274 | + return this.provider.removeItem(key); | |
| 3275 | + } | |
| 3276 | + }, | |
| 3277 | + { | |
| 3278 | + key: "setItem", | |
| 3279 | + value: function setItem(key, value) { | |
| 3280 | + return this.provider.setItem(key, JSON.stringify(value)); | |
| 3281 | + } | |
| 3282 | + }, | |
| 3283 | + { | |
| 3284 | + key: "getAll", | |
| 3285 | + value: function getAll() { | |
| 3286 | + var _this = this; | |
| 3287 | + var keys = Object.keys(this.provider); | |
| 3288 | + var result = {}; | |
| 3289 | + keys.forEach(function(key) { | |
| 3290 | + result[key] = _this.getItem(key); | |
| 3291 | + }); | |
| 3292 | + return result; | |
| 3293 | + } | |
| 3294 | + } | |
| 3295 | + ]); | |
| 3296 | + }(); | |
| 1530 | 3297 | |
| 1531 | -/** | |
| 1532 | - * @typedef {{}} RequestData | |
| 1533 | - * @property {ComponentBase} component component | |
| 1534 | - * @property {string} command command | |
| 1535 | - * @property {{}} args arguments | |
| 1536 | - * @property {DataTypes} type type | |
| 1537 | - * @property {number} timestamp timestamp | |
| 1538 | - * @property {string} endpoint endpoint | |
| 1539 | - * | |
| 1540 | - * @property {string} [baseEndpointURL] baseEndpointURL | |
| 1541 | - * @property {string} [namespace] namespace | |
| 1542 | - * @property {string} [version] version | |
| 1543 | - * @property {('hit'|'miss')} [cache] cache | |
| 1544 | - */ | |
| 3298 | +//#endregion | |
| 3299 | +//#region modules/web-cli/assets/js/core/data/storages/base-prefix-storage.js | |
| 3300 | + function _callSuper$15(t, o, e) { | |
| 3301 | + return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$15() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); | |
| 3302 | + } | |
| 3303 | + __name(_callSuper$15, "_callSuper"); | |
| 3304 | + function _isNativeReflectConstruct$15() { | |
| 3305 | + try { | |
| 3306 | + var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); | |
| 3307 | + } catch (t) {} | |
| 3308 | + return (_isNativeReflectConstruct$15 = function _isNativeReflectConstruct() { | |
| 3309 | + return !!t; | |
| 3310 | + })(); | |
| 3311 | + } | |
| 3312 | + __name(_isNativeReflectConstruct$15, "_isNativeReflectConstruct"); | |
| 3313 | + function _superPropGet$3(t, o, e, r) { | |
| 3314 | + var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e); | |
| 3315 | + return 2 & r && "function" == typeof p ? function(t) { | |
| 3316 | + return p.apply(e, t); | |
| 3317 | + } : p; | |
| 3318 | + } | |
| 3319 | + __name(_superPropGet$3, "_superPropGet"); | |
| 3320 | + var BasePrefixStorage = /*#__PURE__*/ function(_BaseStorage) { | |
| 3321 | + function BasePrefixStorage() { | |
| 3322 | + _classCallCheck(this, BasePrefixStorage); | |
| 3323 | + return _callSuper$15(this, BasePrefixStorage, arguments); | |
| 3324 | + } | |
| 3325 | + _inherits(BasePrefixStorage, _BaseStorage); | |
| 3326 | + return _createClass(BasePrefixStorage, [ | |
| 3327 | + { | |
| 3328 | + key: "clear", | |
| 3329 | + value: function clear() { | |
| 3330 | + var _this = this; | |
| 3331 | + Object.keys(this.getAll()).forEach(function(key) { | |
| 3332 | + return _this.removeItem(key); | |
| 3333 | + }); | |
| 3334 | + } | |
| 3335 | + }, | |
| 3336 | + { | |
| 3337 | + key: "getItem", | |
| 3338 | + value: function getItem(key) { | |
| 3339 | + return _superPropGet$3(BasePrefixStorage, "getItem", this, 3)([BasePrefixStorage.DEFAULT_KEY_PREFIX + key]); | |
| 3340 | + } | |
| 3341 | + }, | |
| 3342 | + { | |
| 3343 | + key: "removeItem", | |
| 3344 | + value: function removeItem(key) { | |
| 3345 | + return _superPropGet$3(BasePrefixStorage, "removeItem", this, 3)([BasePrefixStorage.DEFAULT_KEY_PREFIX + key]); | |
| 3346 | + } | |
| 3347 | + }, | |
| 3348 | + { | |
| 3349 | + key: "setItem", | |
| 3350 | + value: function setItem(key, value) { | |
| 3351 | + return _superPropGet$3(BasePrefixStorage, "setItem", this, 3)([BasePrefixStorage.DEFAULT_KEY_PREFIX + key, value]); | |
| 3352 | + } | |
| 3353 | + }, | |
| 3354 | + { | |
| 3355 | + key: "getAll", | |
| 3356 | + value: function getAll() { | |
| 3357 | + var _this2 = this; | |
| 3358 | + var DEFAULT_KEY_PREFIX = BasePrefixStorage.DEFAULT_KEY_PREFIX; | |
| 3359 | + var keys = Object.keys(this.provider); | |
| 3360 | + var result = {}; | |
| 3361 | + keys.forEach(function(key) { | |
| 3362 | + if (key.startsWith(DEFAULT_KEY_PREFIX)) { | |
| 3363 | + key = key.replace(DEFAULT_KEY_PREFIX, ""); | |
| 3364 | + result[key] = _this2.getItem(key); | |
| 3365 | + } | |
| 3366 | + }); | |
| 3367 | + return result; | |
| 3368 | + } | |
| 3369 | + } | |
| 3370 | + ]); | |
| 3371 | + }(BaseStorage); | |
| 3372 | + _defineProperty(BasePrefixStorage, "DEFAULT_KEY_PREFIX", "e_"); | |
| 1545 | 3373 | |
| 1546 | -/** | |
| 1547 | - * @typedef {Object} ExtractedCommand | |
| 1548 | - * @property {string} command command | |
| 1549 | - * @property {Object} args arguments | |
| 1550 | - */ | |
| 3374 | +//#endregion | |
| 3375 | +//#region modules/web-cli/assets/js/core/data/storages/local-storage.js | |
| 3376 | + function _callSuper$14(t, o, e) { | |
| 3377 | + return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$14() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); | |
| 3378 | + } | |
| 3379 | + __name(_callSuper$14, "_callSuper"); | |
| 3380 | + function _isNativeReflectConstruct$14() { | |
| 3381 | + try { | |
| 3382 | + var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); | |
| 3383 | + } catch (t) {} | |
| 3384 | + return (_isNativeReflectConstruct$14 = function _isNativeReflectConstruct() { | |
| 3385 | + return !!t; | |
| 3386 | + })(); | |
| 3387 | + } | |
| 3388 | + __name(_isNativeReflectConstruct$14, "_isNativeReflectConstruct"); | |
| 3389 | + var LocalStorage = /*#__PURE__*/ function(_BasePrefixStorage) { | |
| 3390 | + function LocalStorage() { | |
| 3391 | + _classCallCheck(this, LocalStorage); | |
| 3392 | + return _callSuper$14(this, LocalStorage, [localStorage]); | |
| 3393 | + } | |
| 3394 | + _inherits(LocalStorage, _BasePrefixStorage); | |
| 3395 | + return _createClass(LocalStorage, [{ | |
| 3396 | + key: "debug", | |
| 3397 | + value: function debug() { | |
| 3398 | + var entries = this.getAll(); | |
| 3399 | + var ordered = {}; | |
| 3400 | + Object.keys(entries).sort().forEach(function(key) { | |
| 3401 | + ordered[key] = entries[key]; | |
| 3402 | + }); | |
| 3403 | + return ordered; | |
| 3404 | + } | |
| 3405 | + }]); | |
| 3406 | + }(BasePrefixStorage); | |
| 1551 | 3407 | |
| 1552 | -// TODO: Return it from the server. Original at WP_REST_Server. | |
| 1553 | -var READABLE = exports.READABLE = ['GET'], | |
| 1554 | - CREATABLE = exports.CREATABLE = ['POST'], | |
| 1555 | - EDITABLE = exports.EDITABLE = ['POST', 'PUT', 'PATCH'], | |
| 1556 | - DELETABLE = exports.DELETABLE = ['DELETE'], | |
| 1557 | - ALLMETHODS = exports.ALLMETHODS = ['GET', 'POST', 'PUT', 'PATCH', 'DELETE']; | |
| 1558 | -var Data = exports["default"] = /*#__PURE__*/function (_Commands) { | |
| 1559 | - function Data() { | |
| 1560 | - var _this; | |
| 1561 | - var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | |
| 1562 | - (0, _classCallCheck2.default)(this, Data); | |
| 1563 | - _this = _callSuper(this, Data, [args]); | |
| 1564 | - _this.args = Object.assign(args, { | |
| 1565 | - namespace: 'elementor', | |
| 1566 | - version: '1', | |
| 1567 | - baseEndpointURL: elementorWebCliConfig.urls.rest | |
| 1568 | - }); | |
| 1569 | - _this.cache = new _cache.default(_this); | |
| 1570 | - _this.validatedRequests = {}; | |
| 1571 | - _this.commandFormats = {}; | |
| 1572 | - return _this; | |
| 1573 | - } | |
| 3408 | +//#endregion | |
| 3409 | +//#region modules/web-cli/assets/js/core/data/cache.js | |
| 3410 | + init_typeof(); | |
| 3411 | + /** | |
| 3412 | + * @typedef {{}} RequestData | |
| 3413 | + */ | |
| 3414 | + /** | |
| 3415 | + * @typedef {import('../data')} Data | |
| 3416 | + */ | |
| 3417 | + /** | |
| 3418 | + * TODO: Search common logic, create functions to reduce code size. | |
| 3419 | + */ | |
| 3420 | + var Cache = /*#__PURE__*/ function() { | |
| 3421 | + /** | |
| 3422 | + * Function constructor(). | |
| 3423 | + * | |
| 3424 | + * Create cache. | |
| 3425 | + * | |
| 3426 | + * @param {Data} manager | |
| 3427 | + */ | |
| 3428 | + function Cache(manager) { | |
| 3429 | + _classCallCheck(this, Cache); | |
| 3430 | + this.manager = manager; | |
| 3431 | + this.storage = new LocalStorage(); | |
| 3432 | + } | |
| 3433 | + /** | |
| 3434 | + * Function getAsync(). | |
| 3435 | + * | |
| 3436 | + * Receive from cache. the difference between getAsync() and get() is that receive return it as promise... | |
| 3437 | + * to fake fetch mechanism. | |
| 3438 | + * | |
| 3439 | + * @param {RequestData} requestData | |
| 3440 | + * | |
| 3441 | + * @return {(Promise|boolean)} request data | |
| 3442 | + */ | |
| 3443 | + return _createClass(Cache, [ | |
| 3444 | + { | |
| 3445 | + key: "getAsync", | |
| 3446 | + value: function getAsync(requestData) { | |
| 3447 | + var data = this.get(requestData); | |
| 3448 | + if (null !== data) { | |
| 3449 | + requestData.cache = "hit"; | |
| 3450 | + return new Promise(function(resolve) { | |
| 3451 | + resolve(data); | |
| 3452 | + }); | |
| 3453 | + } | |
| 3454 | + return false; | |
| 3455 | + } | |
| 3456 | + }, | |
| 3457 | + { | |
| 3458 | + key: "set", | |
| 3459 | + value: function set(requestData, data) { | |
| 3460 | + $e.data.validateRequestData(requestData); | |
| 3461 | + var componentName = requestData.component.getNamespace(); | |
| 3462 | + var pureEndpoint = requestData.endpoint.replace(componentName + "/", ""); | |
| 3463 | + var pureEndpointParts = pureEndpoint.split("/"); | |
| 3464 | + var newData = {}; | |
| 3465 | + if (pureEndpointParts.length && pureEndpoint !== componentName) { | |
| 3466 | + var result = pureEndpointParts.reduce(function(accumulator, pureEndpointPart) { | |
| 3467 | + accumulator[pureEndpointPart] = {}; | |
| 3468 | + return accumulator[pureEndpointPart]; | |
| 3469 | + }, newData); | |
| 3470 | + Object.assign(result, data); | |
| 3471 | + } else newData = data; | |
| 3472 | + var oldData = this.storage.getItem(componentName); | |
| 3473 | + if (oldData !== null) newData = jQuery.extend(true, oldData, newData); | |
| 3474 | + this.storage.setItem(componentName, newData); | |
| 3475 | + } | |
| 3476 | + }, | |
| 3477 | + { | |
| 3478 | + key: "get", | |
| 3479 | + value: function get(requestData) { | |
| 3480 | + $e.data.validateRequestData(requestData); | |
| 3481 | + var componentName = requestData.component.getNamespace(); | |
| 3482 | + var componentData = this.storage.getItem(componentName); | |
| 3483 | + if (componentData !== null) { | |
| 3484 | + if (componentName === requestData.endpoint) return componentData; | |
| 3485 | + return requestData.endpoint.replace(requestData.component.getNamespace() + "/", "").split("/").reduce(function(accumulator, endpointPart) { | |
| 3486 | + if (accumulator && accumulator[endpointPart]) return accumulator[endpointPart]; | |
| 3487 | + }, componentData) || null; | |
| 3488 | + } | |
| 3489 | + return null; | |
| 3490 | + } | |
| 3491 | + }, | |
| 3492 | + { | |
| 3493 | + key: "update", | |
| 3494 | + value: function update(requestData) { | |
| 3495 | + $e.data.validateRequestData(requestData, true); | |
| 3496 | + var endpoint = requestData.endpoint; | |
| 3497 | + var response = {}; | |
| 3498 | + Object.entries(this.storage.getAll()).forEach(function(_ref) { | |
| 3499 | + var _ref2 = _slicedToArray(_ref, 2); | |
| 3500 | + var endpointKey = _ref2[0]; | |
| 3501 | + var endpointValue = _ref2[1]; | |
| 3502 | + if (endpointValue && endpoint.includes(endpointKey)) { | |
| 3503 | + var oldData = endpointValue; | |
| 3504 | + var pureEndpointParts = requestData.endpoint.replace(requestData.component.getNamespace() + "/", "").split("/"); | |
| 3505 | + if (1 === pureEndpointParts.length && endpointKey === requestData.endpoint && endpointKey === requestData.component.getNamespace()) response = jQuery.extend(true, oldData, requestData.args.data); | |
| 3506 | + else { | |
| 3507 | + var oldSpecificData = pureEndpointParts.reduce(function(accumulator, pureEndpointPart) { | |
| 3508 | + return accumulator[pureEndpointPart]; | |
| 3509 | + }, oldData); | |
| 3510 | + response = jQuery.extend(true, oldSpecificData, requestData.args.data); | |
| 3511 | + } | |
| 3512 | + } | |
| 3513 | + }); | |
| 3514 | + if (0 === Object.values(response).length) return false; | |
| 3515 | + this.set(requestData, response); | |
| 3516 | + return true; | |
| 3517 | + } | |
| 3518 | + }, | |
| 3519 | + { | |
| 3520 | + key: "delete", | |
| 3521 | + value: function _delete(requestData) { | |
| 3522 | + $e.data.validateRequestData(requestData); | |
| 3523 | + var result = false; | |
| 3524 | + var componentName = requestData.component.getNamespace(); | |
| 3525 | + if (componentName !== requestData.endpoint) { | |
| 3526 | + var oldData = this.storage.getItem(componentName); | |
| 3527 | + var newData = {}; | |
| 3528 | + if (null === oldData) return false; | |
| 3529 | + var pureEndpointParts = requestData.endpoint.replace(componentName + "/", "").split("/"); | |
| 3530 | + var lastEndpointPart = pureEndpointParts[pureEndpointParts.length - 1]; | |
| 3531 | + pureEndpointParts.reduce(function(accumulator, pureEndpointPart) { | |
| 3532 | + if (pureEndpointPart === lastEndpointPart) accumulator[pureEndpointPart] = null; | |
| 3533 | + else accumulator[pureEndpointPart] = {}; | |
| 3534 | + return accumulator[pureEndpointPart]; | |
| 3535 | + }, newData); | |
| 3536 | + if (Object.keys(oldData).length) { | |
| 3537 | + var _deleteKeys = function deleteKeys(target, nullsObject) { | |
| 3538 | + if (nullsObject) Object.keys(nullsObject).forEach(function(key) { | |
| 3539 | + if (nullsObject[key] && "object" === _typeof(nullsObject[key])) _deleteKeys(target[key], nullsObject[key]); | |
| 3540 | + else if (null === nullsObject[key]) { | |
| 3541 | + delete target[key]; | |
| 3542 | + result = true; | |
| 3543 | + } | |
| 3544 | + }); | |
| 3545 | + else Object.keys(target).forEach(function(key) { | |
| 3546 | + return delete target[key]; | |
| 3547 | + }); | |
| 3548 | + return target; | |
| 3549 | + }; | |
| 3550 | + this.storage.setItem(componentName, _deleteKeys(oldData, newData)); | |
| 3551 | + } | |
| 3552 | + } else for (var key in this.storage.getAll()) if (key === requestData.endpoint) { | |
| 3553 | + this.storage.removeItem(requestData.endpoint); | |
| 3554 | + result = true; | |
| 3555 | + break; | |
| 3556 | + } | |
| 3557 | + return result; | |
| 3558 | + } | |
| 3559 | + } | |
| 3560 | + ]); | |
| 3561 | + }(); | |
| 1574 | 3562 | |
| 1575 | - /** | |
| 1576 | - * Function getHTTPMethod(). | |
| 1577 | - * | |
| 1578 | - * Returns HTTP Method by type. | |
| 1579 | - * | |
| 1580 | - * @param {DataTypes} type | |
| 1581 | - * | |
| 1582 | - * @return {string|boolean} HTTP Method | |
| 1583 | - */ | |
| 1584 | - (0, _inherits2.default)(Data, _Commands); | |
| 1585 | - return (0, _createClass2.default)(Data, [{ | |
| 1586 | - key: "getHTTPMethod", | |
| 1587 | - value: function getHTTPMethod(type) { | |
| 1588 | - switch (type) { | |
| 1589 | - case 'create': | |
| 1590 | - return 'POST'; | |
| 1591 | - case 'delete': | |
| 1592 | - return 'DELETE'; | |
| 1593 | - case 'get': | |
| 1594 | - return 'GET'; | |
| 1595 | - case 'update': | |
| 1596 | - return 'PUT'; | |
| 1597 | - case 'options': | |
| 1598 | - return 'OPTIONS'; | |
| 1599 | - } | |
| 1600 | - return false; | |
| 1601 | - } | |
| 3563 | +//#endregion | |
| 3564 | +//#region modules/web-cli/assets/js/core/data.js | |
| 3565 | + function _callSuper$13(t, o, e) { | |
| 3566 | + return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$13() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); | |
| 3567 | + } | |
| 3568 | + __name(_callSuper$13, "_callSuper"); | |
| 3569 | + function _isNativeReflectConstruct$13() { | |
| 3570 | + try { | |
| 3571 | + var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); | |
| 3572 | + } catch (t) {} | |
| 3573 | + return (_isNativeReflectConstruct$13 = function _isNativeReflectConstruct() { | |
| 3574 | + return !!t; | |
| 3575 | + })(); | |
| 3576 | + } | |
| 3577 | + __name(_isNativeReflectConstruct$13, "_isNativeReflectConstruct"); | |
| 3578 | + function _superPropGet$2(t, o, e, r) { | |
| 3579 | + var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e); | |
| 3580 | + return 2 & r && "function" == typeof p ? function(t) { | |
| 3581 | + return p.apply(e, t); | |
| 3582 | + } : p; | |
| 3583 | + } | |
| 3584 | + __name(_superPropGet$2, "_superPropGet"); | |
| 3585 | + /** | |
| 3586 | + * @typedef {('create'|'delete'|'get'|'update'|'options')} DataTypes | |
| 3587 | + */ | |
| 3588 | + /** | |
| 3589 | + * @typedef {import('../modules/component-base')} ComponentBase | |
| 3590 | + */ | |
| 3591 | + /** | |
| 3592 | + * @typedef {{}} RequestInfo | |
| 3593 | + */ | |
| 3594 | + /** | |
| 3595 | + * @typedef {{}} RequestData | |
| 3596 | + * @property {ComponentBase} component component | |
| 3597 | + * @property {string} command command | |
| 3598 | + * @property {{}} args arguments | |
| 3599 | + * @property {DataTypes} type type | |
| 3600 | + * @property {number} timestamp timestamp | |
| 3601 | + * @property {string} endpoint endpoint | |
| 3602 | + * | |
| 3603 | + * @property {string} [baseEndpointURL] baseEndpointURL | |
| 3604 | + * @property {string} [namespace] namespace | |
| 3605 | + * @property {string} [version] version | |
| 3606 | + * @property {('hit'|'miss')} [cache] cache | |
| 3607 | + */ | |
| 3608 | + /** | |
| 3609 | + * @typedef {Object} ExtractedCommand | |
| 3610 | + * @property {string} command command | |
| 3611 | + * @property {Object} args arguments | |
| 3612 | + */ | |
| 3613 | + var READABLE = ["GET"]; | |
| 3614 | + var CREATABLE = ["POST"]; | |
| 3615 | + var EDITABLE = [ | |
| 3616 | + "POST", | |
| 3617 | + "PUT", | |
| 3618 | + "PATCH" | |
| 3619 | + ]; | |
| 3620 | + var DELETABLE = ["DELETE"]; | |
| 3621 | + var Data$1 = /*#__PURE__*/ function(_Commands) { | |
| 3622 | + function Data() { | |
| 3623 | + var _this; | |
| 3624 | + var args = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; | |
| 3625 | + _classCallCheck(this, Data); | |
| 3626 | + _this = _callSuper$13(this, Data, [args]); | |
| 3627 | + _this.args = Object.assign(args, { | |
| 3628 | + namespace: "elementor", | |
| 3629 | + version: "1", | |
| 3630 | + baseEndpointURL: elementorWebCliConfig.urls.rest | |
| 3631 | + }); | |
| 3632 | + _this.cache = new Cache(_this); | |
| 3633 | + _this.validatedRequests = {}; | |
| 3634 | + _this.commandFormats = {}; | |
| 3635 | + return _this; | |
| 3636 | + } | |
| 3637 | + /** | |
| 3638 | + * Function getHTTPMethod(). | |
| 3639 | + * | |
| 3640 | + * Returns HTTP Method by type. | |
| 3641 | + * | |
| 3642 | + * @param {DataTypes} type | |
| 3643 | + * | |
| 3644 | + * @return {string|boolean} HTTP Method | |
| 3645 | + */ | |
| 3646 | + _inherits(Data, _Commands); | |
| 3647 | + return _createClass(Data, [ | |
| 3648 | + { | |
| 3649 | + key: "getHTTPMethod", | |
| 3650 | + value: function getHTTPMethod(type) { | |
| 3651 | + switch (type) { | |
| 3652 | + case "create": return "POST"; | |
| 3653 | + case "delete": return "DELETE"; | |
| 3654 | + case "get": return "GET"; | |
| 3655 | + case "update": return "PUT"; | |
| 3656 | + case "options": return "OPTIONS"; | |
| 3657 | + } | |
| 3658 | + return false; | |
| 3659 | + } | |
| 3660 | + }, | |
| 3661 | + { | |
| 3662 | + key: "getAllowedMethods", | |
| 3663 | + value: function getAllowedMethods(type) { | |
| 3664 | + switch (type) { | |
| 3665 | + case "create": return CREATABLE; | |
| 3666 | + case "delete": return DELETABLE; | |
| 3667 | + case "get": return READABLE; | |
| 3668 | + case "update": return EDITABLE; | |
| 3669 | + case "options": return ["OPTIONS"]; | |
| 3670 | + } | |
| 3671 | + return false; | |
| 3672 | + } | |
| 3673 | + }, | |
| 3674 | + { | |
| 3675 | + key: "getEndpointURL", | |
| 3676 | + value: function getEndpointURL(requestData) { | |
| 3677 | + var endpoint = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : requestData.endpoint; | |
| 3678 | + var _requestData$baseEndp = requestData.baseEndpointURL; | |
| 3679 | + var baseEndpointURL = _requestData$baseEndp === void 0 ? this.args.baseEndpointURL : _requestData$baseEndp; | |
| 3680 | + var _requestData$namespac = requestData.namespace; | |
| 3681 | + var namespace = _requestData$namespac === void 0 ? this.args.namespace : _requestData$namespac; | |
| 3682 | + var _requestData$version = requestData.version; | |
| 3683 | + var version = _requestData$version === void 0 ? this.args.version : _requestData$version; | |
| 3684 | + return "".concat(baseEndpointURL).concat(namespace, "/v").concat(version, "/") + endpoint; | |
| 3685 | + } | |
| 3686 | + }, | |
| 3687 | + { | |
| 3688 | + key: "commandToEndpoint", | |
| 3689 | + value: function commandToEndpoint(command, args) { | |
| 3690 | + var format = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : null; | |
| 3691 | + var endpoint = command; | |
| 3692 | + if ((args !== null && args !== void 0 && args.query ? Object.values(args.query).length : 0) && format && format.includes("/{")) format.split("/").filter(function(str) { | |
| 3693 | + return "{" === str.charAt(0); | |
| 3694 | + }).forEach(function(param) { | |
| 3695 | + param = param.replace("{", ""); | |
| 3696 | + param = param.replace("}", ""); | |
| 3697 | + var formatted = Object.entries(args.query).find(function(_ref) { | |
| 3698 | + return _slicedToArray(_ref, 1)[0] === param; | |
| 3699 | + }); | |
| 3700 | + if (!formatted) return; | |
| 3701 | + var key = formatted[0]; | |
| 3702 | + var value = formatted[1].toString(); | |
| 3703 | + format = format.replace(new RegExp("{" + param + "}", "g"), value); | |
| 3704 | + delete args.query[key]; | |
| 3705 | + }); | |
| 3706 | + if (format) endpoint = format; | |
| 3707 | + if (format && endpoint.includes("/{")) endpoint = endpoint.substring(0, endpoint.indexOf("/{")); | |
| 3708 | + if (args.query && Object.values(args.query).length) { | |
| 3709 | + var queryEntries = Object.entries(args.query).sort(function(_ref3, _ref4) { | |
| 3710 | + return _slicedToArray(_ref3, 1)[0] - _slicedToArray(_ref4, 1)[0]; | |
| 3711 | + }); | |
| 3712 | + if (queryEntries.length) { | |
| 3713 | + endpoint += "?"; | |
| 3714 | + queryEntries.forEach(function(_ref7) { | |
| 3715 | + var _ref8 = _slicedToArray(_ref7, 2); | |
| 3716 | + var name = _ref8[0]; | |
| 3717 | + var value = _ref8[1]; | |
| 3718 | + value = "".concat(value).replace(/\//g, "%2F"); | |
| 3719 | + endpoint += name + "=" + value + "&"; | |
| 3720 | + }); | |
| 3721 | + } | |
| 3722 | + endpoint = endpoint.replace(/&$/, ""); | |
| 3723 | + } | |
| 3724 | + return endpoint; | |
| 3725 | + } | |
| 3726 | + }, | |
| 3727 | + { | |
| 3728 | + key: "commandExtractArgs", | |
| 3729 | + value: function commandExtractArgs(command) { | |
| 3730 | + var _command; | |
| 3731 | + var args = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; | |
| 3732 | + if ((_command = command) !== null && _command !== void 0 && _command.includes("?")) { | |
| 3733 | + if (!args.query) args.query = {}; | |
| 3734 | + var commandParts = command.split("?"); | |
| 3735 | + var pureCommand = commandParts[0]; | |
| 3736 | + var queryString = commandParts[1]; | |
| 3737 | + var query = new URLSearchParams(queryString); | |
| 3738 | + Object.assign(args.query, Object.fromEntries(query)); | |
| 3739 | + command = pureCommand; | |
| 3740 | + } | |
| 3741 | + return { | |
| 3742 | + command, | |
| 3743 | + args | |
| 3744 | + }; | |
| 3745 | + } | |
| 3746 | + }, | |
| 3747 | + { | |
| 3748 | + key: "validateRequestData", | |
| 3749 | + value: function validateRequestData(requestData) { | |
| 3750 | + var requireArgsData = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false; | |
| 3751 | + if (requestData.timestamp && this.validatedRequests[requestData.timestamp]) return; | |
| 3752 | + var argsObject = new ArgsObject(requestData); | |
| 3753 | + argsObject.requireArgument("component"); | |
| 3754 | + argsObject.requireArgumentType("command", "string"); | |
| 3755 | + argsObject.requireArgumentType("endpoint", "string"); | |
| 3756 | + if (requireArgsData) argsObject.requireArgumentType("data", "object", requestData.args); | |
| 3757 | + if (!requestData.timestamp) requestData.timestamp = (/* @__PURE__ */ new Date()).getTime(); | |
| 3758 | + this.validatedRequests[requestData.timestamp] = true; | |
| 3759 | + } | |
| 3760 | + }, | |
| 3761 | + { | |
| 3762 | + key: "prepareHeaders", | |
| 3763 | + value: function prepareHeaders(requestData) { | |
| 3764 | + var _requestData$args; | |
| 3765 | + var type = requestData.type; | |
| 3766 | + var nonce = elementorWebCliConfig.nonce; | |
| 3767 | + var params = { | |
| 3768 | + signal: (_requestData$args = requestData.args) === null || _requestData$args === void 0 || (_requestData$args = _requestData$args.options) === null || _requestData$args === void 0 ? void 0 : _requestData$args.signal, | |
| 3769 | + credentials: "include" | |
| 3770 | + }; | |
| 3771 | + var headers = { "X-WP-Nonce": nonce }; | |
| 3772 | + /** | |
| 3773 | + * Translate: | |
| 3774 | + * 'create, delete, get, update' to HTTP Methods: | |
| 3775 | + * 'GET, POST, PUT, PATCH, DELETE' | |
| 3776 | + */ | |
| 3777 | + var allowedMethods = this.getAllowedMethods(type); | |
| 3778 | + var method = this.getHTTPMethod(type); | |
| 3779 | + if ("GET" === method) Object.assign(params, { headers }); | |
| 3780 | + else if (allowedMethods) { | |
| 3781 | + var _requestData$args2; | |
| 3782 | + var _requestData$args3; | |
| 3783 | + if (["POST", "PUT"].includes(method) && !((_requestData$args2 = requestData.args) !== null && _requestData$args2 !== void 0 && _requestData$args2.data)) throw Error("Invalid requestData.args.data"); | |
| 3784 | + Object.assign(headers, { "Content-Type": "application/json" }); | |
| 3785 | + if ((_requestData$args3 = requestData.args) !== null && _requestData$args3 !== void 0 && _requestData$args3.headers) Object.assign(headers, requestData.args.headers); | |
| 3786 | + Object.assign(params, { | |
| 3787 | + method, | |
| 3788 | + headers, | |
| 3789 | + body: "application/json" === headers["Content-Type"] ? JSON.stringify(requestData.args.data) : requestData.args.data | |
| 3790 | + }); | |
| 3791 | + } else throw Error("Invalid type: '".concat(type, "'")); | |
| 3792 | + return params; | |
| 3793 | + } | |
| 3794 | + }, | |
| 3795 | + { | |
| 3796 | + key: "prepareEndpoint", | |
| 3797 | + value: function prepareEndpoint(requestData) { | |
| 3798 | + var splitEndpoint = requestData.endpoint.split("?"); | |
| 3799 | + var endpoint = splitEndpoint.shift(); | |
| 3800 | + var endpointAddress = this.getEndpointURL(requestData, endpoint); | |
| 3801 | + if (splitEndpoint.length) { | |
| 3802 | + var separator = endpointAddress.includes("?") ? "&" : "?"; | |
| 3803 | + endpointAddress += separator + splitEndpoint.pop(); | |
| 3804 | + } | |
| 3805 | + return endpointAddress; | |
| 3806 | + } | |
| 3807 | + }, | |
| 3808 | + { | |
| 3809 | + key: "fetch", | |
| 3810 | + value: function fetch(requestData) { | |
| 3811 | + var _requestData$args$opt; | |
| 3812 | + var _this2 = this; | |
| 3813 | + var fetchAPI = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : window.fetch; | |
| 3814 | + requestData.cache = "miss"; | |
| 3815 | + var refresh = (_requestData$args$opt = requestData.args.options) === null || _requestData$args$opt === void 0 ? void 0 : _requestData$args$opt.refresh; | |
| 3816 | + var getCache = "get" === requestData.type && !refresh; | |
| 3817 | + var saveCache = ["create", "get"].includes(requestData.type) && !refresh; | |
| 3818 | + if (getCache) { | |
| 3819 | + var cachePromise = this.cache.getAsync(requestData); | |
| 3820 | + if (cachePromise) return cachePromise; | |
| 3821 | + } | |
| 3822 | + var params = this.prepareHeaders(requestData); | |
| 3823 | + return new Promise(/*#__PURE__*/ function() { | |
| 3824 | + var _ref9 = _asyncToGenerator(/*#__PURE__*/ import_regenerator.default.mark(function _callee2(resolve, reject) { | |
| 3825 | + var endpoint; | |
| 3826 | + var request; | |
| 3827 | + var response; | |
| 3828 | + var _t; | |
| 3829 | + return import_regenerator.default.wrap(function(_context2) { | |
| 3830 | + while (1) switch (_context2.prev = _context2.next) { | |
| 3831 | + case 0: | |
| 3832 | + _context2.prev = 0; | |
| 3833 | + endpoint = _this2.prepareEndpoint(requestData); | |
| 3834 | + request = fetchAPI(endpoint, params); | |
| 3835 | + _context2.next = 1; | |
| 3836 | + return request.then(/*#__PURE__*/ function() { | |
| 3837 | + var _ref0 = _asyncToGenerator(/*#__PURE__*/ import_regenerator.default.mark(function _callee(_response) { | |
| 3838 | + return import_regenerator.default.wrap(function(_context) { | |
| 3839 | + while (1) switch (_context.prev = _context.next) { | |
| 3840 | + case 0: | |
| 3841 | + if (_response.ok) { | |
| 3842 | + _context.next = 3; | |
| 3843 | + break; | |
| 3844 | + } | |
| 3845 | + if (!_response.headers.get("content-type").includes("application/json")) { | |
| 3846 | + _context.next = 2; | |
| 3847 | + break; | |
| 3848 | + } | |
| 3849 | + _context.next = 1; | |
| 3850 | + return _response.json(); | |
| 3851 | + case 1: _response = _context.sent; | |
| 3852 | + case 2: throw _response; | |
| 3853 | + case 3: return _context.abrupt("return", _response.json()); | |
| 3854 | + case 4: | |
| 3855 | + case "end": return _context.stop(); | |
| 3856 | + } | |
| 3857 | + }, _callee); | |
| 3858 | + })); | |
| 3859 | + return function(_x3) { | |
| 3860 | + return _ref0.apply(this, arguments); | |
| 3861 | + }; | |
| 3862 | + }()); | |
| 3863 | + case 1: | |
| 3864 | + response = _context2.sent; | |
| 3865 | + if (saveCache) _this2.cache.set(requestData, response); | |
| 3866 | + resolve(response); | |
| 3867 | + _context2.next = 3; | |
| 3868 | + break; | |
| 3869 | + case 2: | |
| 3870 | + _context2.prev = 2; | |
| 3871 | + _t = _context2["catch"](0); | |
| 3872 | + reject(_t); | |
| 3873 | + case 3: | |
| 3874 | + case "end": return _context2.stop(); | |
| 3875 | + } | |
| 3876 | + }, _callee2, null, [[0, 2]]); | |
| 3877 | + })); | |
| 3878 | + return function(_x, _x2) { | |
| 3879 | + return _ref9.apply(this, arguments); | |
| 3880 | + }; | |
| 3881 | + }()); | |
| 3882 | + } | |
| 3883 | + }, | |
| 3884 | + { | |
| 3885 | + key: "getCache", | |
| 3886 | + value: function getCache(component, command) { | |
| 3887 | + var args = { query: arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {} }; | |
| 3888 | + return this.cache.get({ | |
| 3889 | + endpoint: this.commandToEndpoint(command, args, this.commandFormats[command]), | |
| 3890 | + component, | |
| 3891 | + command, | |
| 3892 | + args | |
| 3893 | + }); | |
| 3894 | + } | |
| 3895 | + }, | |
| 3896 | + { | |
| 3897 | + key: "setCache", | |
| 3898 | + value: function setCache(component, command, query, data) { | |
| 3899 | + var args = { query }; | |
| 3900 | + this.cache.set({ | |
| 3901 | + endpoint: this.commandToEndpoint(command, args, this.commandFormats[command]), | |
| 3902 | + component, | |
| 3903 | + command, | |
| 3904 | + args | |
| 3905 | + }, data); | |
| 3906 | + } | |
| 3907 | + }, | |
| 3908 | + { | |
| 3909 | + key: "updateCache", | |
| 3910 | + value: function updateCache(component, command, query, data) { | |
| 3911 | + var args = { | |
| 3912 | + query, | |
| 3913 | + data | |
| 3914 | + }; | |
| 3915 | + this.cache.update({ | |
| 3916 | + endpoint: this.commandToEndpoint(command, args, this.commandFormats[command]), | |
| 3917 | + component, | |
| 3918 | + command, | |
| 3919 | + args | |
| 3920 | + }); | |
| 3921 | + } | |
| 3922 | + }, | |
| 3923 | + { | |
| 3924 | + key: "deleteCache", | |
| 3925 | + value: function deleteCache(component, command) { | |
| 3926 | + var args = { query: arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {} }; | |
| 3927 | + this.cache.delete({ | |
| 3928 | + endpoint: this.commandToEndpoint(command, args, this.commandFormats[command]), | |
| 3929 | + component, | |
| 3930 | + command, | |
| 3931 | + args | |
| 3932 | + }); | |
| 3933 | + } | |
| 3934 | + }, | |
| 3935 | + { | |
| 3936 | + key: "registerFormat", | |
| 3937 | + value: function registerFormat(command, format) { | |
| 3938 | + this.commandFormats[command] = format; | |
| 3939 | + } | |
| 3940 | + }, | |
| 3941 | + { | |
| 3942 | + key: "create", | |
| 3943 | + value: function create(command, data) { | |
| 3944 | + var query = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}; | |
| 3945 | + var options = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {}; | |
| 3946 | + return this.run("create", command, { | |
| 3947 | + query, | |
| 3948 | + options, | |
| 3949 | + data | |
| 3950 | + }); | |
| 3951 | + } | |
| 3952 | + }, | |
| 3953 | + { | |
| 3954 | + key: "delete", | |
| 3955 | + value: function _delete(command) { | |
| 3956 | + var query = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; | |
| 3957 | + var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}; | |
| 3958 | + return this.run("delete", command, { | |
| 3959 | + query, | |
| 3960 | + options | |
| 3961 | + }); | |
| 3962 | + } | |
| 3963 | + }, | |
| 3964 | + { | |
| 3965 | + key: "get", | |
| 3966 | + value: function get(command) { | |
| 3967 | + var query = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; | |
| 3968 | + var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}; | |
| 3969 | + return this.run("get", command, { | |
| 3970 | + query, | |
| 3971 | + options | |
| 3972 | + }); | |
| 3973 | + } | |
| 3974 | + }, | |
| 3975 | + { | |
| 3976 | + key: "update", | |
| 3977 | + value: function update(command, data) { | |
| 3978 | + var query = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}; | |
| 3979 | + var options = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : {}; | |
| 3980 | + return this.run("update", command, { | |
| 3981 | + query, | |
| 3982 | + options, | |
| 3983 | + data | |
| 3984 | + }); | |
| 3985 | + } | |
| 3986 | + }, | |
| 3987 | + { | |
| 3988 | + key: "options", | |
| 3989 | + value: function options(command, query) { | |
| 3990 | + var _options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}; | |
| 3991 | + return this.run("options", command, { | |
| 3992 | + query, | |
| 3993 | + options: _options | |
| 3994 | + }); | |
| 3995 | + } | |
| 3996 | + }, | |
| 3997 | + { | |
| 3998 | + key: "register", | |
| 3999 | + value: function register(component, command, callback) { | |
| 4000 | + _superPropGet$2(Data, "register", this, 3)([ | |
| 4001 | + component, | |
| 4002 | + command, | |
| 4003 | + callback | |
| 4004 | + ]); | |
| 4005 | + var fullCommandName = component.getNamespace() + "/" + command; | |
| 4006 | + var commandInstance = $e.data.getCommandClass(fullCommandName); | |
| 4007 | + var format = commandInstance !== null && commandInstance !== void 0 && commandInstance.getEndpointFormat ? commandInstance.getEndpointFormat() : false; | |
| 4008 | + if (format) $e.data.registerFormat(fullCommandName, format); | |
| 4009 | + return this; | |
| 4010 | + } | |
| 4011 | + }, | |
| 4012 | + { | |
| 4013 | + key: "run", | |
| 4014 | + value: function run(type, command, args) { | |
| 4015 | + args.options.type = type; | |
| 4016 | + var _this$commandExtractA = this.commandExtractArgs(command, args); | |
| 4017 | + command = _this$commandExtractA.command; | |
| 4018 | + args = _this$commandExtractA.args; | |
| 4019 | + return _superPropGet$2(Data, "run", this, 3)([command, args]); | |
| 4020 | + } | |
| 4021 | + }, | |
| 4022 | + { | |
| 4023 | + key: "error", | |
| 4024 | + value: function error(message) { | |
| 4025 | + throw Error("Data commands: " + message); | |
| 4026 | + } | |
| 4027 | + } | |
| 4028 | + ]); | |
| 4029 | + }(Commands); | |
| 1602 | 4030 | |
| 1603 | - /** | |
| 1604 | - * Function getAllowedMethods(). | |
| 1605 | - * | |
| 1606 | - * Returns allowed HTTP methods by type. | |
| 1607 | - * | |
| 1608 | - * @param {DataTypes} type | |
| 1609 | - * | |
| 1610 | - * @return {[string]|boolean} allowed HTTP methods | |
| 1611 | - */ | |
| 1612 | - }, { | |
| 1613 | - key: "getAllowedMethods", | |
| 1614 | - value: function getAllowedMethods(type) { | |
| 1615 | - switch (type) { | |
| 1616 | - case 'create': | |
| 1617 | - return CREATABLE; | |
| 1618 | - case 'delete': | |
| 1619 | - return DELETABLE; | |
| 1620 | - case 'get': | |
| 1621 | - return READABLE; | |
| 1622 | - case 'update': | |
| 1623 | - return EDITABLE; | |
| 1624 | - case 'options': | |
| 1625 | - return ['OPTIONS']; | |
| 1626 | - } | |
| 1627 | - return false; | |
| 1628 | - } | |
| 4031 | +//#endregion | |
| 4032 | +//#region modules/web-cli/assets/js/extras/hash-commands.js | |
| 4033 | + function _createForOfIteratorHelper(r, e) { | |
| 4034 | + var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; | |
| 4035 | + if (!t) { | |
| 4036 | + if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { | |
| 4037 | + t && (r = t); | |
| 4038 | + var _n = 0; | |
| 4039 | + var F = function F() {}; | |
| 4040 | + return { | |
| 4041 | + s: F, | |
| 4042 | + n: function n() { | |
| 4043 | + return _n >= r.length ? { done: !0 } : { | |
| 4044 | + done: !1, | |
| 4045 | + value: r[_n++] | |
| 4046 | + }; | |
| 4047 | + }, | |
| 4048 | + e: function e(r) { | |
| 4049 | + throw r; | |
| 4050 | + }, | |
| 4051 | + f: F | |
| 4052 | + }; | |
| 4053 | + } | |
| 4054 | + throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); | |
| 4055 | + } | |
| 4056 | + var o; | |
| 4057 | + var a = !0; | |
| 4058 | + var u = !1; | |
| 4059 | + return { | |
| 4060 | + s: function s() { | |
| 4061 | + t = t.call(r); | |
| 4062 | + }, | |
| 4063 | + n: function n() { | |
| 4064 | + var r = t.next(); | |
| 4065 | + return a = r.done, r; | |
| 4066 | + }, | |
| 4067 | + e: function e(r) { | |
| 4068 | + u = !0, o = r; | |
| 4069 | + }, | |
| 4070 | + f: function f() { | |
| 4071 | + try { | |
| 4072 | + a || null == t.return || t.return(); | |
| 4073 | + } finally { | |
| 4074 | + if (u) throw o; | |
| 4075 | + } | |
| 4076 | + } | |
| 4077 | + }; | |
| 4078 | + } | |
| 4079 | + function _unsupportedIterableToArray(r, a) { | |
| 4080 | + if (r) { | |
| 4081 | + if ("string" == typeof r) return _arrayLikeToArray(r, a); | |
| 4082 | + var t = {}.toString.call(r).slice(8, -1); | |
| 4083 | + return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; | |
| 4084 | + } | |
| 4085 | + } | |
| 4086 | + function _arrayLikeToArray(r, a) { | |
| 4087 | + (null == a || a > r.length) && (a = r.length); | |
| 4088 | + for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; | |
| 4089 | + return n; | |
| 4090 | + } | |
| 4091 | + var HashCommands = /*#__PURE__*/ function() { | |
| 4092 | + function HashCommands() { | |
| 4093 | + _classCallCheck(this, HashCommands); | |
| 4094 | + /** | |
| 4095 | + * Cannot be static since it uses callback(s) that are available only after '$e' is initialized. | |
| 4096 | + */ | |
| 4097 | + _defineProperty(this, "dispatchersList", { | |
| 4098 | + "e:run": { | |
| 4099 | + runner: function runner() { | |
| 4100 | + return $e.run; | |
| 4101 | + }, | |
| 4102 | + isSafe: function isSafe(command) { | |
| 4103 | + var _$e$commands$getComma; | |
| 4104 | + return (_$e$commands$getComma = $e.commands.getCommandClass(command)) === null || _$e$commands$getComma === void 0 ? void 0 : _$e$commands$getComma.getInfo().isSafe; | |
| 4105 | + }, | |
| 4106 | + isSafeWithArgs: function isSafeWithArgs(command) { | |
| 4107 | + var _$e$commands$getComma2; | |
| 4108 | + return (_$e$commands$getComma2 = $e.commands.getCommandClass(command)) === null || _$e$commands$getComma2 === void 0 ? void 0 : _$e$commands$getComma2.getInfo().isSafeWithArgs; | |
| 4109 | + } | |
| 4110 | + }, | |
| 4111 | + "e:route": { | |
| 4112 | + runner: function runner() { | |
| 4113 | + return $e.route; | |
| 4114 | + }, | |
| 4115 | + isSafe: function isSafe() { | |
| 4116 | + return true; | |
| 4117 | + }, | |
| 4118 | + isSafeWithArgs: function isSafeWithArgs() { | |
| 4119 | + return false; | |
| 4120 | + } | |
| 4121 | + } | |
| 4122 | + }); | |
| 4123 | + /** | |
| 4124 | + * @typedef HashCommand | |
| 4125 | + * @property {string} method method | |
| 4126 | + * @property {string} command command | |
| 4127 | + * @property {Object} args arguments | |
| 4128 | + */ | |
| 4129 | + /** | |
| 4130 | + * List of current loaded hash commands. | |
| 4131 | + * | |
| 4132 | + * @type {Array.<HashCommand>} | |
| 4133 | + */ | |
| 4134 | + _defineProperty(this, "commands", []); | |
| 4135 | + this.commands = this.get(); | |
| 4136 | + } | |
| 4137 | + /** | |
| 4138 | + * Function get(). | |
| 4139 | + * | |
| 4140 | + * Get API requests that comes from hash ( eg #e:run ). | |
| 4141 | + * | |
| 4142 | + * @param {string} hash | |
| 4143 | + * | |
| 4144 | + * @return {Array.<HashCommand>} API requests | |
| 4145 | + */ | |
| 4146 | + return _createClass(HashCommands, [ | |
| 4147 | + { | |
| 4148 | + key: "get", | |
| 4149 | + value: function get() { | |
| 4150 | + var _this = this; | |
| 4151 | + var hash = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : location.hash; | |
| 4152 | + var result = []; | |
| 4153 | + if (hash) hash.substr(1).split("&").forEach(function(hashItem) { | |
| 4154 | + var _hashItem$split2 = _slicedToArray(hashItem.split("?"), 2); | |
| 4155 | + var rawCommand = _hashItem$split2[0]; | |
| 4156 | + var rawArgs = _hashItem$split2[1]; | |
| 4157 | + var hashParts = rawCommand.split(":"); | |
| 4158 | + if (3 !== hashParts.length) return; | |
| 4159 | + var method = hashParts[0] + ":" + hashParts[1]; | |
| 4160 | + if (_this.dispatchersList[method]) { | |
| 4161 | + var command = hashParts[2]; | |
| 4162 | + var args = _this.parseCommandArgs(rawArgs); | |
| 4163 | + result.push({ | |
| 4164 | + method, | |
| 4165 | + command, | |
| 4166 | + args | |
| 4167 | + }); | |
| 4168 | + } | |
| 4169 | + }); | |
| 4170 | + return result; | |
| 4171 | + } | |
| 4172 | + }, | |
| 4173 | + { | |
| 4174 | + key: "run", | |
| 4175 | + value: function() { | |
| 4176 | + var _run = _asyncToGenerator(/*#__PURE__*/ import_regenerator.default.mark(function _callee() { | |
| 4177 | + var commands; | |
| 4178 | + var _iterator; | |
| 4179 | + var _step; | |
| 4180 | + var hashCommand; | |
| 4181 | + var dispatcher; | |
| 4182 | + var _iterator2; | |
| 4183 | + var _step2; | |
| 4184 | + var _hashCommand; | |
| 4185 | + var _dispatcher; | |
| 4186 | + var _args = arguments; | |
| 4187 | + var _t; | |
| 4188 | + var _t2; | |
| 4189 | + return import_regenerator.default.wrap(function(_context) { | |
| 4190 | + while (1) switch (_context.prev = _context.next) { | |
| 4191 | + case 0: | |
| 4192 | + commands = _args.length > 0 && _args[0] !== void 0 ? _args[0] : this.commands; | |
| 4193 | + _iterator = _createForOfIteratorHelper(commands); | |
| 4194 | + _context.prev = 1; | |
| 4195 | + _iterator.s(); | |
| 4196 | + case 2: | |
| 4197 | + if ((_step = _iterator.n()).done) { | |
| 4198 | + _context.next = 5; | |
| 4199 | + break; | |
| 4200 | + } | |
| 4201 | + hashCommand = _step.value; | |
| 4202 | + dispatcher = this.dispatchersList[hashCommand.method]; | |
| 4203 | + if (dispatcher) { | |
| 4204 | + _context.next = 3; | |
| 4205 | + break; | |
| 4206 | + } | |
| 4207 | + return _context.abrupt("return", Promise.reject(new Error("No dispatcher found for the command: `".concat(hashCommand.command, "`.")))); | |
| 4208 | + case 3: | |
| 4209 | + if (dispatcher.isSafe(hashCommand.command)) { | |
| 4210 | + _context.next = 4; | |
| 4211 | + break; | |
| 4212 | + } | |
| 4213 | + return _context.abrupt("return", Promise.reject(new Error("Attempting to run unsafe or non exist command: `".concat(hashCommand.command, "`.")))); | |
| 4214 | + case 4: | |
| 4215 | + _context.next = 2; | |
| 4216 | + break; | |
| 4217 | + case 5: | |
| 4218 | + _context.next = 7; | |
| 4219 | + break; | |
| 4220 | + case 6: | |
| 4221 | + _context.prev = 6; | |
| 4222 | + _t = _context["catch"](1); | |
| 4223 | + _iterator.e(_t); | |
| 4224 | + case 7: | |
| 4225 | + _context.prev = 7; | |
| 4226 | + _iterator.f(); | |
| 4227 | + return _context.finish(7); | |
| 4228 | + case 8: | |
| 4229 | + _iterator2 = _createForOfIteratorHelper(commands); | |
| 4230 | + _context.prev = 9; | |
| 4231 | + _iterator2.s(); | |
| 4232 | + case 10: | |
| 4233 | + if ((_step2 = _iterator2.n()).done) { | |
| 4234 | + _context.next = 12; | |
| 4235 | + break; | |
| 4236 | + } | |
| 4237 | + _hashCommand = _step2.value; | |
| 4238 | + _dispatcher = this.dispatchersList[_hashCommand.method]; | |
| 4239 | + _context.next = 11; | |
| 4240 | + return _dispatcher.runner()(_hashCommand.command, _dispatcher.isSafeWithArgs(_hashCommand.command) ? _hashCommand.args : void 0); | |
| 4241 | + case 11: | |
| 4242 | + _context.next = 10; | |
| 4243 | + break; | |
| 4244 | + case 12: | |
| 4245 | + _context.next = 14; | |
| 4246 | + break; | |
| 4247 | + case 13: | |
| 4248 | + _context.prev = 13; | |
| 4249 | + _t2 = _context["catch"](9); | |
| 4250 | + _iterator2.e(_t2); | |
| 4251 | + case 14: | |
| 4252 | + _context.prev = 14; | |
| 4253 | + _iterator2.f(); | |
| 4254 | + return _context.finish(14); | |
| 4255 | + case 15: | |
| 4256 | + case "end": return _context.stop(); | |
| 4257 | + } | |
| 4258 | + }, _callee, this, [[ | |
| 4259 | + 1, | |
| 4260 | + 6, | |
| 4261 | + 7, | |
| 4262 | + 8 | |
| 4263 | + ], [ | |
| 4264 | + 9, | |
| 4265 | + 13, | |
| 4266 | + 14, | |
| 4267 | + 15 | |
| 4268 | + ]]); | |
| 4269 | + })); | |
| 4270 | + function run() { | |
| 4271 | + return _run.apply(this, arguments); | |
| 4272 | + } | |
| 4273 | + return run; | |
| 4274 | + }() | |
| 4275 | + }, | |
| 4276 | + { | |
| 4277 | + key: "runOnce", | |
| 4278 | + value: function runOnce() { | |
| 4279 | + var _this2 = this; | |
| 4280 | + this.run(this.commands).then(function() { | |
| 4281 | + _this2.commands = []; | |
| 4282 | + }); | |
| 4283 | + } | |
| 4284 | + }, | |
| 4285 | + { | |
| 4286 | + key: "parseCommandArgs", | |
| 4287 | + value: function parseCommandArgs(rawArgs) { | |
| 4288 | + try { | |
| 4289 | + return JSON.parse(decodeURI(rawArgs || "{}")); | |
| 4290 | + } catch (e) { | |
| 4291 | + Console.warn("Hash commands JSON args cannot be parsed. \n\n", e); | |
| 4292 | + return {}; | |
| 4293 | + } | |
| 4294 | + } | |
| 4295 | + } | |
| 4296 | + ]); | |
| 4297 | + }(); | |
| 1629 | 4298 | |
| 1630 | - /** | |
| 1631 | - * Function getEndpointURL(). | |
| 1632 | - * | |
| 1633 | - * Get remote endpoint address. | |
| 1634 | - * | |
| 1635 | - * @param {RequestData} requestData | |
| 1636 | - * @param {string} [endpoint=requestData.endpoint] | |
| 1637 | - * | |
| 1638 | - * @return {string} endpoint address | |
| 1639 | - */ | |
| 1640 | - }, { | |
| 1641 | - key: "getEndpointURL", | |
| 1642 | - value: function getEndpointURL(requestData) { | |
| 1643 | - var endpoint = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : requestData.endpoint; | |
| 1644 | - // Allow to request data override default namespace and args. | |
| 1645 | - var _requestData$baseEndp = requestData.baseEndpointURL, | |
| 1646 | - baseEndpointURL = _requestData$baseEndp === void 0 ? this.args.baseEndpointURL : _requestData$baseEndp, | |
| 1647 | - _requestData$namespac = requestData.namespace, | |
| 1648 | - namespace = _requestData$namespac === void 0 ? this.args.namespace : _requestData$namespac, | |
| 1649 | - _requestData$version = requestData.version, | |
| 1650 | - version = _requestData$version === void 0 ? this.args.version : _requestData$version; | |
| 1651 | - return "".concat(baseEndpointURL).concat(namespace, "/v").concat(version, "/") + endpoint; | |
| 1652 | - } | |
| 4299 | +//#endregion | |
| 4300 | +//#region modules/web-cli/assets/js/modules/hook-break.js | |
| 4301 | + function _callSuper$12(t, o, e) { | |
| 4302 | + return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$12() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); | |
| 4303 | + } | |
| 4304 | + __name(_callSuper$12, "_callSuper"); | |
| 4305 | + function _isNativeReflectConstruct$12() { | |
| 4306 | + try { | |
| 4307 | + var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); | |
| 4308 | + } catch (t) {} | |
| 4309 | + return (_isNativeReflectConstruct$12 = function _isNativeReflectConstruct() { | |
| 4310 | + return !!t; | |
| 4311 | + })(); | |
| 4312 | + } | |
| 4313 | + __name(_isNativeReflectConstruct$12, "_isNativeReflectConstruct"); | |
| 4314 | + var HookBreak = /*#__PURE__*/ function(_Error) { | |
| 4315 | + function HookBreak() { | |
| 4316 | + _classCallCheck(this, HookBreak); | |
| 4317 | + return _callSuper$12(this, HookBreak, ["HookBreak"]); | |
| 4318 | + } | |
| 4319 | + _inherits(HookBreak, _Error); | |
| 4320 | + return _createClass(HookBreak); | |
| 4321 | + }(/*#__PURE__*/ _wrapNativeSuper(Error)); | |
| 1653 | 4322 | |
| 1654 | - /** | |
| 1655 | - * Function commandToEndpoint(). | |
| 1656 | - * | |
| 1657 | - * Convert command to endpoint. | |
| 1658 | - * | |
| 1659 | - * For example `component/command/{arg}` => `controller/endpoint/8`. | |
| 1660 | - * | |
| 1661 | - * TODO: Find a better solution. | |
| 1662 | - * | |
| 1663 | - * @param {string} command | |
| 1664 | - * @param {{}} args | |
| 1665 | - * @param {string|null} [format] | |
| 1666 | - * | |
| 1667 | - * @return {string} endpoint | |
| 1668 | - */ | |
| 1669 | - }, { | |
| 1670 | - key: "commandToEndpoint", | |
| 1671 | - value: function commandToEndpoint(command, args) { | |
| 1672 | - var format = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null; | |
| 1673 | - var endpoint = command; | |
| 1674 | - var argsQueryLength = args !== null && args !== void 0 && args.query ? Object.values(args.query).length : 0; | |
| 1675 | - if (argsQueryLength && format && format.includes('/{')) { | |
| 1676 | - // Means command includes magic query arguments ( controller/endpoint/{whatever} ). | |
| 1677 | - var magicParams = format.split('/').filter(function (str) { | |
| 1678 | - return '{' === str.charAt(0); | |
| 1679 | - }); | |
| 1680 | - magicParams.forEach(function (param) { | |
| 1681 | - // Remove the '{', '}'. | |
| 1682 | - param = param.replace('{', ''); | |
| 1683 | - param = param.replace('}', ''); | |
| 1684 | - var formatted = Object.entries(args.query).find(function (_ref) { | |
| 1685 | - var _ref2 = (0, _slicedToArray2.default)(_ref, 1), | |
| 1686 | - key = _ref2[0]; | |
| 1687 | - return key === param; | |
| 1688 | - }); | |
| 1689 | - if (!formatted) { | |
| 1690 | - return; | |
| 1691 | - } | |
| 1692 | - var key = formatted[0], | |
| 1693 | - value = formatted[1].toString(); | |
| 4323 | +//#endregion | |
| 4324 | +//#region modules/web-cli/assets/js/core/hooks/base.js | |
| 4325 | + function _callSuper$11(t, o, e) { | |
| 4326 | + return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$11() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); | |
| 4327 | + } | |
| 4328 | + __name(_callSuper$11, "_callSuper"); | |
| 4329 | + function _isNativeReflectConstruct$11() { | |
| 4330 | + try { | |
| 4331 | + var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); | |
| 4332 | + } catch (t) {} | |
| 4333 | + return (_isNativeReflectConstruct$11 = function _isNativeReflectConstruct() { | |
| 4334 | + return !!t; | |
| 4335 | + })(); | |
| 4336 | + } | |
| 4337 | + __name(_isNativeReflectConstruct$11, "_isNativeReflectConstruct"); | |
| 4338 | + /** | |
| 4339 | + * @typedef {import('../../modules/hook-base')} HookBase | |
| 4340 | + */ | |
| 4341 | + var HooksBase = /*#__PURE__*/ function(_Module) { | |
| 4342 | + /** | |
| 4343 | + * Function constructor(). | |
| 4344 | + * | |
| 4345 | + * Create hooks base. | |
| 4346 | + * | |
| 4347 | + * @param {{}} args | |
| 4348 | + */ | |
| 4349 | + function HooksBase() { | |
| 4350 | + var _this; | |
| 4351 | + _classCallCheck(this, HooksBase); | |
| 4352 | + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key]; | |
| 4353 | + _this = _callSuper$11(this, HooksBase, [].concat(args)); | |
| 4354 | + /** | |
| 4355 | + * Current command. | |
| 4356 | + * | |
| 4357 | + * @type {string} | |
| 4358 | + */ | |
| 4359 | + _this.current = ""; | |
| 4360 | + /** | |
| 4361 | + * Array of ids which in use. | |
| 4362 | + * | |
| 4363 | + * @type {Array} | |
| 4364 | + */ | |
| 4365 | + _this.usedIds = []; | |
| 4366 | + /** | |
| 4367 | + * Object of callbacks that was bound by container type. | |
| 4368 | + * | |
| 4369 | + * @type {{}} | |
| 4370 | + */ | |
| 4371 | + _this.callbacks = { | |
| 4372 | + after: {}, | |
| 4373 | + catch: {} | |
| 4374 | + }; | |
| 4375 | + /** | |
| 4376 | + * Object of depth. | |
| 4377 | + * | |
| 4378 | + * @type {{}} | |
| 4379 | + */ | |
| 4380 | + _this.depth = { | |
| 4381 | + after: {}, | |
| 4382 | + catch: {} | |
| 4383 | + }; | |
| 4384 | + _this.callbacksFlatList = {}; | |
| 4385 | + return _this; | |
| 4386 | + } | |
| 4387 | + _inherits(HooksBase, _Module); | |
| 4388 | + return _createClass(HooksBase, [ | |
| 4389 | + { | |
| 4390 | + key: "activate", | |
| 4391 | + value: function activate() { | |
| 4392 | + Object.values(this.getAll(true)).forEach(function(callback) { | |
| 4393 | + callback.activate(); | |
| 4394 | + }); | |
| 4395 | + } | |
| 4396 | + }, | |
| 4397 | + { | |
| 4398 | + key: "deactivate", | |
| 4399 | + value: function deactivate() { | |
| 4400 | + Object.values(this.getAll(true)).forEach(function(callback) { | |
| 4401 | + callback.deactivate(); | |
| 4402 | + }); | |
| 4403 | + } | |
| 4404 | + }, | |
| 4405 | + { | |
| 4406 | + key: "getType", | |
| 4407 | + value: function getType() { | |
| 4408 | + force_method_implementation_default(); | |
| 4409 | + } | |
| 4410 | + }, | |
| 4411 | + { | |
| 4412 | + key: "get", | |
| 4413 | + value: function get(id) { | |
| 4414 | + return this.callbacksFlatList[id]; | |
| 4415 | + } | |
| 4416 | + }, | |
| 4417 | + { | |
| 4418 | + key: "getAll", | |
| 4419 | + value: function getAll() { | |
| 4420 | + var _this2 = this; | |
| 4421 | + if (arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false) return this.callbacksFlatList; | |
| 4422 | + var result = {}; | |
| 4423 | + Object.keys(this.callbacks).forEach(function(event) { | |
| 4424 | + if (!result[event]) result[event] = []; | |
| 4425 | + Object.keys(_this2.callbacks[event]).forEach(function(command) { | |
| 4426 | + result[event].push({ | |
| 4427 | + command, | |
| 4428 | + callbacks: _this2.callbacks[event][command] | |
| 4429 | + }); | |
| 4430 | + }); | |
| 4431 | + }); | |
| 4432 | + return result; | |
| 4433 | + } | |
| 4434 | + }, | |
| 4435 | + { | |
| 4436 | + key: "getCurrent", | |
| 4437 | + value: function getCurrent() { | |
| 4438 | + return this.current; | |
| 4439 | + } | |
| 4440 | + }, | |
| 4441 | + { | |
| 4442 | + key: "getUsedIds", | |
| 4443 | + value: function getUsedIds() { | |
| 4444 | + return this.usedIds; | |
| 4445 | + } | |
| 4446 | + }, | |
| 4447 | + { | |
| 4448 | + key: "getCallbacks", | |
| 4449 | + value: function getCallbacks(event, command, args) { | |
| 4450 | + var _args$containers = args.containers; | |
| 4451 | + var containers = _args$containers === void 0 ? [args.container] : _args$containers; | |
| 4452 | + var containerType = containers[0] ? containers[0].type : false; | |
| 4453 | + var callbacks = []; | |
| 4454 | + if (this.callbacks[event] && this.callbacks[event][command]) { | |
| 4455 | + if (containerType && this.callbacks[event][command][containerType]) callbacks = callbacks.concat(this.callbacks[event][command][containerType]); | |
| 4456 | + if (this.callbacks[event][command].all) callbacks = callbacks.concat(this.callbacks[event][command].all); | |
| 4457 | + } | |
| 4458 | + if (callbacks.length) return callbacks; | |
| 4459 | + return false; | |
| 4460 | + } | |
| 4461 | + }, | |
| 4462 | + { | |
| 4463 | + key: "checkEvent", | |
| 4464 | + value: function checkEvent(event) { | |
| 4465 | + if (-1 === Object.keys(this.callbacks).indexOf(event)) throw Error("".concat(this.getType(), ": '").concat(event, "' is not available.")); | |
| 4466 | + } | |
| 4467 | + }, | |
| 4468 | + { | |
| 4469 | + key: "checkInstance", | |
| 4470 | + value: function checkInstance(instance) { | |
| 4471 | + if (instance.getType() !== this.getType()) throw new Error("invalid instance, please use: 'elementor-api/modules/hook-base.js'. "); | |
| 4472 | + } | |
| 4473 | + }, | |
| 4474 | + { | |
| 4475 | + key: "checkId", | |
| 4476 | + value: function checkId(id) { | |
| 4477 | + if (-1 !== this.usedIds.indexOf(id)) throw Error("id: '".concat(id, "' is already in use.")); | |
| 4478 | + } | |
| 4479 | + }, | |
| 4480 | + { | |
| 4481 | + key: "shouldRun", | |
| 4482 | + value: function shouldRun(callbacks) { | |
| 4483 | + return !!callbacks && callbacks.length; | |
| 4484 | + } | |
| 4485 | + }, | |
| 4486 | + { | |
| 4487 | + key: "register", | |
| 4488 | + value: function register(event, instance) { | |
| 4489 | + var command = instance.getCommand(); | |
| 4490 | + var id = instance.getId(); | |
| 4491 | + var containerType = instance.getContainerType(); | |
| 4492 | + this.checkEvent(event); | |
| 4493 | + this.checkInstance(instance); | |
| 4494 | + this.checkId(id); | |
| 4495 | + return this.registerCallback(id, event, command, instance, containerType); | |
| 4496 | + } | |
| 4497 | + }, | |
| 4498 | + { | |
| 4499 | + key: "registerCallback", | |
| 4500 | + value: function registerCallback(id, event, command, instance, containerType) { | |
| 4501 | + if (!this.callbacks[event][command]) this.callbacks[event][command] = []; | |
| 4502 | + this.usedIds.push(id); | |
| 4503 | + if (!this.callbacks[event][command]) this.callbacks[event][command] = {}; | |
| 4504 | + var callback = { | |
| 4505 | + id, | |
| 4506 | + callback: instance.run.bind(instance), | |
| 4507 | + isActive: true, | |
| 4508 | + activate: function activate() { | |
| 4509 | + this.isActive = true; | |
| 4510 | + }, | |
| 4511 | + deactivate: function deactivate() { | |
| 4512 | + this.isActive = false; | |
| 4513 | + } | |
| 4514 | + }; | |
| 4515 | + if (containerType) { | |
| 4516 | + if (!this.callbacks[event][command][containerType]) this.callbacks[event][command][containerType] = []; | |
| 4517 | + this.callbacks[event][command][containerType].push(callback); | |
| 4518 | + } else { | |
| 4519 | + if (!this.callbacks[event][command].all) this.callbacks[event][command].all = []; | |
| 4520 | + this.callbacks[event][command].all.push(callback); | |
| 4521 | + } | |
| 4522 | + this.callbacksFlatList[callback.id] = callback; | |
| 4523 | + return callback; | |
| 4524 | + } | |
| 4525 | + }, | |
| 4526 | + { | |
| 4527 | + key: "run", | |
| 4528 | + value: function run(event, command, args) { | |
| 4529 | + var result = arguments.length > 3 && arguments[3] !== void 0 ? arguments[3] : void 0; | |
| 4530 | + var callbacks = this.getCallbacks(event, command, args); | |
| 4531 | + if (this.shouldRun(callbacks)) { | |
| 4532 | + this.current = command; | |
| 4533 | + this.onRun(command, args, event); | |
| 4534 | + return this.runCallbacks(event, command, callbacks, args, result); | |
| 4535 | + } | |
| 4536 | + return false; | |
| 4537 | + } | |
| 4538 | + }, | |
| 4539 | + { | |
| 4540 | + key: "runCallbacks", | |
| 4541 | + value: function runCallbacks(event, command, callbacks, args, result) { | |
| 4542 | + var callbacksResult = []; | |
| 4543 | + for (var i in callbacks) { | |
| 4544 | + var callback = callbacks[i]; | |
| 4545 | + if (!callback.isActive) continue; | |
| 4546 | + if (void 0 === this.depth[event][callback.id]) this.depth[event][callback.id] = 0; | |
| 4547 | + this.depth[event][callback.id]++; | |
| 4548 | + if (1 === this.depth[event][callback.id]) { | |
| 4549 | + this.onCallback(command, args, event, callback.id); | |
| 4550 | + try { | |
| 4551 | + var callbackResult = this.runCallback(event, callback, args, result); | |
| 4552 | + if (!callbackResult) throw Error("Callback failed, event: '".concat(event, "'")); | |
| 4553 | + callbacksResult.push(callbackResult); | |
| 4554 | + } catch (e) { | |
| 4555 | + if (e instanceof $e.modules.HookBreak) throw e; | |
| 4556 | + Console.error(e); | |
| 4557 | + } | |
| 4558 | + } | |
| 4559 | + this.depth[event][callback.id]--; | |
| 4560 | + } | |
| 4561 | + return callbacksResult; | |
| 4562 | + } | |
| 4563 | + }, | |
| 4564 | + { | |
| 4565 | + key: "runCallback", | |
| 4566 | + value: function runCallback(event, callback, args, result) { | |
| 4567 | + force_method_implementation_default(); | |
| 4568 | + } | |
| 4569 | + }, | |
| 4570 | + { | |
| 4571 | + key: "onRun", | |
| 4572 | + value: function onRun(command, args, event) { | |
| 4573 | + force_method_implementation_default(); | |
| 4574 | + } | |
| 4575 | + }, | |
| 4576 | + { | |
| 4577 | + key: "onCallback", | |
| 4578 | + value: function onCallback(command, args, event, id) { | |
| 4579 | + force_method_implementation_default(); | |
| 4580 | + } | |
| 4581 | + } | |
| 4582 | + ]); | |
| 4583 | + }(import_module.default); | |
| 1694 | 4584 | |
| 1695 | - // Replace magic params with values. | |
| 1696 | - format = format.replace(new RegExp('{' + param + '}', 'g'), value); | |
| 1697 | - delete args.query[key]; | |
| 1698 | - }); | |
| 1699 | - } | |
| 1700 | - if (format) { | |
| 1701 | - endpoint = format; | |
| 1702 | - } | |
| 4585 | +//#endregion | |
| 4586 | +//#region modules/web-cli/assets/js/core/hooks/data.js | |
| 4587 | + function _callSuper$10(t, o, e) { | |
| 4588 | + return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$10() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); | |
| 4589 | + } | |
| 4590 | + __name(_callSuper$10, "_callSuper"); | |
| 4591 | + function _isNativeReflectConstruct$10() { | |
| 4592 | + try { | |
| 4593 | + var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); | |
| 4594 | + } catch (t) {} | |
| 4595 | + return (_isNativeReflectConstruct$10 = function _isNativeReflectConstruct() { | |
| 4596 | + return !!t; | |
| 4597 | + })(); | |
| 4598 | + } | |
| 4599 | + __name(_isNativeReflectConstruct$10, "_isNativeReflectConstruct"); | |
| 4600 | + function _superPropGet$1(t, o, e, r) { | |
| 4601 | + var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e); | |
| 4602 | + return 2 & r && "function" == typeof p ? function(t) { | |
| 4603 | + return p.apply(e, t); | |
| 4604 | + } : p; | |
| 4605 | + } | |
| 4606 | + __name(_superPropGet$1, "_superPropGet"); | |
| 4607 | + var Data = /*#__PURE__*/ function(_HooksBase) { | |
| 4608 | + function Data() { | |
| 4609 | + var _this; | |
| 4610 | + _classCallCheck(this, Data); | |
| 4611 | + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key]; | |
| 4612 | + _this = _callSuper$10(this, Data, [].concat(args)); | |
| 4613 | + _this.callbacks.dependency = {}; | |
| 4614 | + _this.depth.dependency = {}; | |
| 4615 | + return _this; | |
| 4616 | + } | |
| 4617 | + _inherits(Data, _HooksBase); | |
| 4618 | + return _createClass(Data, [ | |
| 4619 | + { | |
| 4620 | + key: "getType", | |
| 4621 | + value: function getType() { | |
| 4622 | + return "data"; | |
| 4623 | + } | |
| 4624 | + }, | |
| 4625 | + { | |
| 4626 | + key: "runCallback", | |
| 4627 | + value: function runCallback(event, callback, args, result) { | |
| 4628 | + switch (event) { | |
| 4629 | + case "dependency": | |
| 4630 | + if (!callback.callback(args)) { | |
| 4631 | + this.depth[event][callback.id]--; | |
| 4632 | + throw new $e.modules.HookBreak(); | |
| 4633 | + } | |
| 4634 | + return true; | |
| 4635 | + case "catch": | |
| 4636 | + case "after": | |
| 4637 | + /** | |
| 4638 | + * When handling HOOK which is data after (not breakable), | |
| 4639 | + * even the result of the callback is negative, it is required to return positive, | |
| 4640 | + * since result of runCallback determine if the callback succeeded. | |
| 4641 | + */ | |
| 4642 | + return callback.callback(args, result) || "after" === event; | |
| 4643 | + } | |
| 4644 | + return false; | |
| 4645 | + } | |
| 4646 | + }, | |
| 4647 | + { | |
| 4648 | + key: "shouldRun", | |
| 4649 | + value: function shouldRun(callbacks) { | |
| 4650 | + return _superPropGet$1(Data, "shouldRun", this, 3)([callbacks]) && elementor.documents.getCurrent().history.getActive(); | |
| 4651 | + } | |
| 4652 | + }, | |
| 4653 | + { | |
| 4654 | + key: "onRun", | |
| 4655 | + value: function onRun(command, args, event) { | |
| 4656 | + if (!$e.devTools) return; | |
| 4657 | + $e.devTools.log.callbacks().run(this.getType(), command, args, event); | |
| 4658 | + } | |
| 4659 | + }, | |
| 4660 | + { | |
| 4661 | + key: "onCallback", | |
| 4662 | + value: function onCallback(command, args, event, id) { | |
| 4663 | + if (!$e.devTools) return; | |
| 4664 | + $e.devTools.log.callbacks().callback(this.getType(), command, args, event, id); | |
| 4665 | + } | |
| 4666 | + } | |
| 4667 | + ]); | |
| 4668 | + }(HooksBase); | |
| 1703 | 4669 | |
| 1704 | - // If requested magic param does not exist in args, need to remove it to have fixed endpoint. | |
| 1705 | - // eg: 'documents/{documentId}/elements/{elementId}' and args { documentId: 4123 }. | |
| 1706 | - // result: 'documents/4123/elements' | |
| 1707 | - if (format && endpoint.includes('/{')) { | |
| 1708 | - endpoint = endpoint.substring(0, endpoint.indexOf('/{')); | |
| 1709 | - } | |
| 1710 | - if (args.query && Object.values(args.query).length) { | |
| 1711 | - // Sorting since the endpoint later will be used as key to store the cache. | |
| 1712 | - var queryEntries = Object.entries(args.query).sort(function (_ref3, _ref4) { | |
| 1713 | - var _ref5 = (0, _slicedToArray2.default)(_ref3, 1), | |
| 1714 | - aKey = _ref5[0]; | |
| 1715 | - var _ref6 = (0, _slicedToArray2.default)(_ref4, 1), | |
| 1716 | - bKey = _ref6[0]; | |
| 1717 | - return aKey - bKey; | |
| 1718 | - } // Sort by param name. | |
| 1719 | - ); | |
| 4670 | +//#endregion | |
| 4671 | +//#region modules/web-cli/assets/js/core/hooks/ui.js | |
| 4672 | + function _callSuper$9(t, o, e) { | |
| 4673 | + return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$9() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); | |
| 4674 | + } | |
| 4675 | + __name(_callSuper$9, "_callSuper"); | |
| 4676 | + function _isNativeReflectConstruct$9() { | |
| 4677 | + try { | |
| 4678 | + var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); | |
| 4679 | + } catch (t) {} | |
| 4680 | + return (_isNativeReflectConstruct$9 = function _isNativeReflectConstruct() { | |
| 4681 | + return !!t; | |
| 4682 | + })(); | |
| 4683 | + } | |
| 4684 | + __name(_isNativeReflectConstruct$9, "_isNativeReflectConstruct"); | |
| 4685 | + var Ui = /*#__PURE__*/ function(_HooksBase) { | |
| 4686 | + function Ui() { | |
| 4687 | + var _this; | |
| 4688 | + _classCallCheck(this, Ui); | |
| 4689 | + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key]; | |
| 4690 | + _this = _callSuper$9(this, Ui, [].concat(args)); | |
| 4691 | + _this.callbacks.before = {}; | |
| 4692 | + _this.depth.before = {}; | |
| 4693 | + return _this; | |
| 4694 | + } | |
| 4695 | + _inherits(Ui, _HooksBase); | |
| 4696 | + return _createClass(Ui, [ | |
| 4697 | + { | |
| 4698 | + key: "getType", | |
| 4699 | + value: function getType() { | |
| 4700 | + return "ui"; | |
| 4701 | + } | |
| 4702 | + }, | |
| 4703 | + { | |
| 4704 | + key: "runCallback", | |
| 4705 | + value: function runCallback(event, callback, args, result) { | |
| 4706 | + switch (event) { | |
| 4707 | + case "before": | |
| 4708 | + callback.callback(args); | |
| 4709 | + break; | |
| 4710 | + case "catch": | |
| 4711 | + case "after": | |
| 4712 | + callback.callback(args, result); | |
| 4713 | + break; | |
| 4714 | + default: return false; | |
| 4715 | + } | |
| 4716 | + return true; | |
| 4717 | + } | |
| 4718 | + }, | |
| 4719 | + { | |
| 4720 | + key: "onRun", | |
| 4721 | + value: function onRun(command, args, event) { | |
| 4722 | + if (!$e.devTools) return; | |
| 4723 | + $e.devTools.log.callbacks().run(this.getType(), command, args, event); | |
| 4724 | + } | |
| 4725 | + }, | |
| 4726 | + { | |
| 4727 | + key: "onCallback", | |
| 4728 | + value: function onCallback(command, args, event, id) { | |
| 4729 | + if (!$e.devTools) return; | |
| 4730 | + $e.devTools.log.callbacks().callback(this.getType(), command, args, event, id); | |
| 4731 | + } | |
| 4732 | + } | |
| 4733 | + ]); | |
| 4734 | + }(HooksBase); | |
| 1720 | 4735 | |
| 1721 | - // `args.query` will become a part of GET params. | |
| 1722 | - if (queryEntries.length) { | |
| 1723 | - endpoint += '?'; | |
| 1724 | - queryEntries.forEach(function (_ref7) { | |
| 1725 | - var _ref8 = (0, _slicedToArray2.default)(_ref7, 2), | |
| 1726 | - name = _ref8[0], | |
| 1727 | - value = _ref8[1]; | |
| 1728 | - // Replace the character '/' with the encoded version, | |
| 1729 | - // mostly because when saving this endpoint value to the cache it splits the url base on the '/' character. | |
| 1730 | - value = "".concat(value).replace(/\//g, '%2F'); | |
| 1731 | - endpoint += name + '=' + value + '&'; | |
| 1732 | - }); | |
| 1733 | - } | |
| 1734 | - | |
| 1735 | - // If last character is '&' remove it. | |
| 1736 | - endpoint = endpoint.replace(/&$/, ''); | |
| 1737 | - } | |
| 1738 | - return endpoint; | |
| 1739 | - } | |
| 1740 | - | |
| 1741 | - /** | |
| 1742 | - * Function commandExtractArgs(). | |
| 1743 | - * | |
| 1744 | - * If the command have query convert it to args. | |
| 1745 | - * | |
| 1746 | - * @param {string} command | |
| 1747 | - * @param {Object} args | |
| 1748 | - * | |
| 1749 | - * @return {ExtractedCommand} command | |
| 1750 | - */ | |
| 1751 | - }, { | |
| 1752 | - key: "commandExtractArgs", | |
| 1753 | - value: function commandExtractArgs(command) { | |
| 1754 | - var _command; | |
| 1755 | - var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | |
| 1756 | - if ((_command = command) !== null && _command !== void 0 && _command.includes('?')) { | |
| 1757 | - if (!args.query) { | |
| 1758 | - args.query = {}; | |
| 1759 | - } | |
| 1760 | - var commandParts = command.split('?'), | |
| 1761 | - pureCommand = commandParts[0], | |
| 1762 | - queryString = commandParts[1], | |
| 1763 | - query = new URLSearchParams(queryString); | |
| 1764 | - Object.assign(args.query, Object.fromEntries(query)); | |
| 1765 | - command = pureCommand; | |
| 1766 | - } | |
| 1767 | - return { | |
| 1768 | - command: command, | |
| 1769 | - args: args | |
| 1770 | - }; | |
| 1771 | - } | |
| 1772 | - | |
| 1773 | - /** | |
| 1774 | - * Function validateRequestData(). | |
| 1775 | - * | |
| 1776 | - * Validate request data requirements. | |
| 1777 | - * | |
| 1778 | - * @param {RequestData} requestData | |
| 1779 | - * @param {boolean} [requireArgsData] | |
| 1780 | - */ | |
| 1781 | - }, { | |
| 1782 | - key: "validateRequestData", | |
| 1783 | - value: function validateRequestData(requestData) { | |
| 1784 | - var requireArgsData = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; | |
| 1785 | - // Do not validate if its already valid. | |
| 1786 | - if (requestData.timestamp && this.validatedRequests[requestData.timestamp]) { | |
| 1787 | - return; | |
| 1788 | - } | |
| 1789 | - var argsObject = new _argsObject.default(requestData); | |
| 1790 | - argsObject.requireArgument('component'); | |
| 1791 | - argsObject.requireArgumentType('command', 'string'); | |
| 1792 | - argsObject.requireArgumentType('endpoint', 'string'); | |
| 1793 | - if (requireArgsData) { | |
| 1794 | - argsObject.requireArgumentType('data', 'object', requestData.args); | |
| 1795 | - } | |
| 1796 | - | |
| 1797 | - // Ensure timestamp. | |
| 1798 | - if (!requestData.timestamp) { | |
| 1799 | - requestData.timestamp = new Date().getTime(); | |
| 1800 | - } | |
| 1801 | - this.validatedRequests[requestData.timestamp] = true; | |
| 1802 | - } | |
| 1803 | - | |
| 1804 | - /** | |
| 1805 | - * Function prepareHeaders(). | |
| 1806 | - * | |
| 1807 | - * Prepare the headers for each request. | |
| 1808 | - * | |
| 1809 | - * @param {RequestData} requestData | |
| 1810 | - * | |
| 1811 | - * @return {{}} params | |
| 1812 | - */ | |
| 1813 | - }, { | |
| 1814 | - key: "prepareHeaders", | |
| 1815 | - value: function prepareHeaders(requestData) { | |
| 1816 | - var _requestData$args; | |
| 1817 | - var type = requestData.type, | |
| 1818 | - nonce = elementorWebCliConfig.nonce, | |
| 1819 | - params = { | |
| 1820 | - signal: (_requestData$args = requestData.args) === null || _requestData$args === void 0 || (_requestData$args = _requestData$args.options) === null || _requestData$args === void 0 ? void 0 : _requestData$args.signal, | |
| 1821 | - credentials: 'include' // Cookies is required for wp reset. | |
| 1822 | - }, | |
| 1823 | - headers = { | |
| 1824 | - 'X-WP-Nonce': nonce | |
| 1825 | - }; | |
| 1826 | - | |
| 1827 | - /** | |
| 1828 | - * Translate: | |
| 1829 | - * 'create, delete, get, update' to HTTP Methods: | |
| 1830 | - * 'GET, POST, PUT, PATCH, DELETE' | |
| 1831 | - */ | |
| 1832 | - var allowedMethods = this.getAllowedMethods(type), | |
| 1833 | - method = this.getHTTPMethod(type); | |
| 1834 | - if ('GET' === method) { | |
| 1835 | - Object.assign(params, { | |
| 1836 | - headers: headers | |
| 1837 | - }); | |
| 1838 | - } else if (allowedMethods) { | |
| 1839 | - var _requestData$args2, _requestData$args3; | |
| 1840 | - if (['POST', 'PUT'].includes(method) && !((_requestData$args2 = requestData.args) !== null && _requestData$args2 !== void 0 && _requestData$args2.data)) { | |
| 1841 | - throw Error('Invalid requestData.args.data'); | |
| 1842 | - } | |
| 1843 | - Object.assign(headers, { | |
| 1844 | - 'Content-Type': 'application/json' | |
| 1845 | - }); | |
| 1846 | - if ((_requestData$args3 = requestData.args) !== null && _requestData$args3 !== void 0 && _requestData$args3.headers) { | |
| 1847 | - Object.assign(headers, requestData.args.headers); | |
| 1848 | - } | |
| 1849 | - Object.assign(params, { | |
| 1850 | - method: method, | |
| 1851 | - headers: headers, | |
| 1852 | - body: 'application/json' === headers['Content-Type'] ? JSON.stringify(requestData.args.data) : requestData.args.data | |
| 1853 | - }); | |
| 1854 | - } else { | |
| 1855 | - throw Error("Invalid type: '".concat(type, "'")); | |
| 1856 | - } | |
| 1857 | - return params; | |
| 1858 | - } | |
| 1859 | - | |
| 1860 | - /** | |
| 1861 | - * Function prepareEndpoint(). | |
| 1862 | - * | |
| 1863 | - * This method response for building a final endpoint, | |
| 1864 | - * the main problem is with plain permalink mode + command with query params that creates a weird url, | |
| 1865 | - * the current method should fix it. | |
| 1866 | - * | |
| 1867 | - * @param {RequestData} requestData | |
| 1868 | - * | |
| 1869 | - * @return {string} Endpoint URL | |
| 1870 | - */ | |
| 1871 | - }, { | |
| 1872 | - key: "prepareEndpoint", | |
| 1873 | - value: function prepareEndpoint(requestData) { | |
| 1874 | - var splitEndpoint = requestData.endpoint.split('?'), | |
| 1875 | - endpoint = splitEndpoint.shift(); | |
| 1876 | - var endpointAddress = this.getEndpointURL(requestData, endpoint); | |
| 1877 | - if (splitEndpoint.length) { | |
| 1878 | - var separator = endpointAddress.includes('?') ? '&' : '?'; | |
| 1879 | - endpointAddress += separator + splitEndpoint.pop(); | |
| 1880 | - } | |
| 1881 | - return endpointAddress; | |
| 1882 | - } | |
| 1883 | - | |
| 1884 | - /** | |
| 1885 | - * Function fetch(). | |
| 1886 | - * | |
| 1887 | - * @param {RequestData} requestData | |
| 1888 | - * @param {function(RequestInfo,*) : Promise<Response> } [fetchAPI] | |
| 1889 | - * | |
| 1890 | - * @return {Promise<Response>} response | |
| 1891 | - */ | |
| 1892 | - }, { | |
| 1893 | - key: "fetch", | |
| 1894 | - value: function fetch(requestData) { | |
| 1895 | - var _requestData$args$opt, | |
| 1896 | - _this2 = this; | |
| 1897 | - var fetchAPI = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : window.fetch; | |
| 1898 | - requestData.cache = 'miss'; | |
| 1899 | - var refresh = (_requestData$args$opt = requestData.args.options) === null || _requestData$args$opt === void 0 ? void 0 : _requestData$args$opt.refresh, | |
| 1900 | - getCache = 'get' === requestData.type && !refresh, | |
| 1901 | - saveCache = ['create', 'get'].includes(requestData.type) && !refresh; | |
| 1902 | - if (getCache) { | |
| 1903 | - var cachePromise = this.cache.getAsync(requestData); | |
| 1904 | - if (cachePromise) { | |
| 1905 | - return cachePromise; | |
| 1906 | - } | |
| 1907 | - } | |
| 1908 | - var params = this.prepareHeaders(requestData); | |
| 1909 | - // eslint-disable-next-line no-async-promise-executor | |
| 1910 | - return new Promise(/*#__PURE__*/function () { | |
| 1911 | - var _ref9 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee2(resolve, reject) { | |
| 1912 | - var endpoint, request, response, _t; | |
| 1913 | - return _regenerator.default.wrap(function (_context2) { | |
| 1914 | - while (1) switch (_context2.prev = _context2.next) { | |
| 1915 | - case 0: | |
| 1916 | - _context2.prev = 0; | |
| 1917 | - endpoint = _this2.prepareEndpoint(requestData); | |
| 1918 | - request = fetchAPI(endpoint, params); | |
| 1919 | - _context2.next = 1; | |
| 1920 | - return request.then(/*#__PURE__*/function () { | |
| 1921 | - var _ref0 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee(_response) { | |
| 1922 | - return _regenerator.default.wrap(function (_context) { | |
| 1923 | - while (1) switch (_context.prev = _context.next) { | |
| 1924 | - case 0: | |
| 1925 | - if (_response.ok) { | |
| 1926 | - _context.next = 3; | |
| 1927 | - break; | |
| 1928 | - } | |
| 1929 | - if (!_response.headers.get('content-type').includes('application/json')) { | |
| 1930 | - _context.next = 2; | |
| 1931 | - break; | |
| 1932 | - } | |
| 1933 | - _context.next = 1; | |
| 1934 | - return _response.json(); | |
| 1935 | - case 1: | |
| 1936 | - _response = _context.sent; | |
| 1937 | - case 2: | |
| 1938 | - throw _response; | |
| 1939 | - case 3: | |
| 1940 | - return _context.abrupt("return", _response.json()); | |
| 1941 | - case 4: | |
| 1942 | - case "end": | |
| 1943 | - return _context.stop(); | |
| 1944 | - } | |
| 1945 | - }, _callee); | |
| 1946 | - })); | |
| 1947 | - return function (_x3) { | |
| 1948 | - return _ref0.apply(this, arguments); | |
| 1949 | - }; | |
| 1950 | - }()); | |
| 1951 | - case 1: | |
| 1952 | - response = _context2.sent; | |
| 1953 | - // At this point, it got the resolved response from remote. | |
| 1954 | - // So load cache, and resolve it. | |
| 1955 | - if (saveCache) { | |
| 1956 | - _this2.cache.set(requestData, response); | |
| 1957 | - } | |
| 1958 | - resolve(response); | |
| 1959 | - _context2.next = 3; | |
| 1960 | - break; | |
| 1961 | - case 2: | |
| 1962 | - _context2.prev = 2; | |
| 1963 | - _t = _context2["catch"](0); | |
| 1964 | - reject(_t); | |
| 1965 | - case 3: | |
| 1966 | - case "end": | |
| 1967 | - return _context2.stop(); | |
| 1968 | - } | |
| 1969 | - }, _callee2, null, [[0, 2]]); | |
| 1970 | - })); | |
| 1971 | - return function (_x, _x2) { | |
| 1972 | - return _ref9.apply(this, arguments); | |
| 1973 | - }; | |
| 1974 | - }()); | |
| 1975 | - } | |
| 1976 | - | |
| 1977 | - /** | |
| 1978 | - * Function getCache(). | |
| 1979 | - * | |
| 1980 | - * @param {ComponentBase} component | |
| 1981 | - * @param {string} command | |
| 1982 | - * @param {{}} query | |
| 1983 | - * | |
| 1984 | - * @return {{}} cache object | |
| 1985 | - */ | |
| 1986 | - }, { | |
| 1987 | - key: "getCache", | |
| 1988 | - value: function getCache(component, command) { | |
| 1989 | - var query = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; | |
| 1990 | - var args = { | |
| 1991 | - query: query | |
| 1992 | - }; | |
| 1993 | - return this.cache.get({ | |
| 1994 | - endpoint: this.commandToEndpoint(command, args, this.commandFormats[command]), | |
| 1995 | - component: component, | |
| 1996 | - command: command, | |
| 1997 | - args: args | |
| 1998 | - }); | |
| 1999 | - } | |
| 2000 | - | |
| 2001 | - /** | |
| 2002 | - * Function setCache(). | |
| 2003 | - * | |
| 2004 | - * @param {ComponentBase} component | |
| 2005 | - * @param {string} command | |
| 2006 | - * @param {{}} query | |
| 2007 | - * @param {*} data | |
| 2008 | - */ | |
| 2009 | - }, { | |
| 2010 | - key: "setCache", | |
| 2011 | - value: function setCache(component, command, query, data) { | |
| 2012 | - var args = { | |
| 2013 | - query: query | |
| 2014 | - }; | |
| 2015 | - this.cache.set({ | |
| 2016 | - endpoint: this.commandToEndpoint(command, args, this.commandFormats[command]), | |
| 2017 | - component: component, | |
| 2018 | - command: command, | |
| 2019 | - args: args | |
| 2020 | - }, data); | |
| 2021 | - } | |
| 2022 | - | |
| 2023 | - /** | |
| 2024 | - * Function updateCache(). | |
| 2025 | - * | |
| 2026 | - * The difference between 'setCache' and 'updateCache' is update will only modify exist values. | |
| 2027 | - * and 'setCache' will create or update. | |
| 2028 | - * | |
| 2029 | - * @param {ComponentBase} component | |
| 2030 | - * @param {string} command | |
| 2031 | - * @param {{}} query | |
| 2032 | - * @param {*} data | |
| 2033 | - */ | |
| 2034 | - }, { | |
| 2035 | - key: "updateCache", | |
| 2036 | - value: function updateCache(component, command, query, data) { | |
| 2037 | - var args = { | |
| 2038 | - query: query, | |
| 2039 | - data: data | |
| 2040 | - }; | |
| 2041 | - this.cache.update({ | |
| 2042 | - endpoint: this.commandToEndpoint(command, args, this.commandFormats[command]), | |
| 2043 | - component: component, | |
| 2044 | - command: command, | |
| 2045 | - args: args | |
| 2046 | - }); | |
| 2047 | - } | |
| 2048 | - | |
| 2049 | - /** | |
| 2050 | - * Function deleteCache(). | |
| 2051 | - * | |
| 2052 | - * @param {ComponentBase} component | |
| 2053 | - * @param {string} command | |
| 2054 | - * @param {{}} query | |
| 2055 | - */ | |
| 2056 | - }, { | |
| 2057 | - key: "deleteCache", | |
| 2058 | - value: function deleteCache(component, command) { | |
| 2059 | - var query = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; | |
| 2060 | - var args = { | |
| 2061 | - query: query | |
| 2062 | - }; | |
| 2063 | - this.cache.delete({ | |
| 2064 | - endpoint: this.commandToEndpoint(command, args, this.commandFormats[command]), | |
| 2065 | - component: component, | |
| 2066 | - command: command, | |
| 2067 | - args: args | |
| 2068 | - }); | |
| 2069 | - } | |
| 2070 | - | |
| 2071 | - /** | |
| 2072 | - * Function registerFormat(). | |
| 2073 | - * | |
| 2074 | - * Register's format for each command. | |
| 2075 | - * | |
| 2076 | - * @param {string} command | |
| 2077 | - * @param {string} format | |
| 2078 | - */ | |
| 2079 | - }, { | |
| 2080 | - key: "registerFormat", | |
| 2081 | - value: function registerFormat(command, format) { | |
| 2082 | - this.commandFormats[command] = format; | |
| 2083 | - } | |
| 2084 | - | |
| 2085 | - /** | |
| 2086 | - * Function create(). | |
| 2087 | - * | |
| 2088 | - * Run a command, that will be translated as endpoint for creating new data. | |
| 2089 | - * | |
| 2090 | - * @param {string} command | |
| 2091 | - * @param {*} data | |
| 2092 | - * @param {{}} query | |
| 2093 | - * @param {{}} options | |
| 2094 | - * | |
| 2095 | - * @return {*} result | |
| 2096 | - */ | |
| 2097 | - }, { | |
| 2098 | - key: "create", | |
| 2099 | - value: function create(command, data) { | |
| 2100 | - var query = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; | |
| 2101 | - var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; | |
| 2102 | - return this.run('create', command, { | |
| 2103 | - query: query, | |
| 2104 | - options: options, | |
| 2105 | - data: data | |
| 2106 | - }); | |
| 2107 | - } | |
| 2108 | - | |
| 2109 | - /** | |
| 2110 | - * Function delete(). | |
| 2111 | - * | |
| 2112 | - * Run a command, that will be translated as endpoint for deleting data. | |
| 2113 | - * | |
| 2114 | - * @param {string} command | |
| 2115 | - * @param {{}} query | |
| 2116 | - * @param {{}} options | |
| 2117 | - * | |
| 2118 | - * @return {*} result | |
| 2119 | - */ | |
| 2120 | - }, { | |
| 2121 | - key: "delete", | |
| 2122 | - value: function _delete(command) { | |
| 2123 | - var query = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | |
| 2124 | - var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; | |
| 2125 | - return this.run('delete', command, { | |
| 2126 | - query: query, | |
| 2127 | - options: options | |
| 2128 | - }); | |
| 2129 | - } | |
| 2130 | - | |
| 2131 | - /** | |
| 2132 | - * Function get(). | |
| 2133 | - * | |
| 2134 | - * Run a command, that will be translated as endpoint for getting data. | |
| 2135 | - * | |
| 2136 | - * @param {string} command | |
| 2137 | - * @param {{}} query | |
| 2138 | - * @param {{}} options | |
| 2139 | - * | |
| 2140 | - * @return {*} result | |
| 2141 | - */ | |
| 2142 | - }, { | |
| 2143 | - key: "get", | |
| 2144 | - value: function get(command) { | |
| 2145 | - var query = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | |
| 2146 | - var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; | |
| 2147 | - return this.run('get', command, { | |
| 2148 | - query: query, | |
| 2149 | - options: options | |
| 2150 | - }); | |
| 2151 | - } | |
| 2152 | - | |
| 2153 | - /** | |
| 2154 | - * Function update(). | |
| 2155 | - * | |
| 2156 | - * Run a command, that will be translated as endpoint for updating data. | |
| 2157 | - * | |
| 2158 | - * @param {string} command | |
| 2159 | - * @param {*} data | |
| 2160 | - * @param {{}} query | |
| 2161 | - * @param {{}} options | |
| 2162 | - * | |
| 2163 | - * @return {*} result | |
| 2164 | - */ | |
| 2165 | - }, { | |
| 2166 | - key: "update", | |
| 2167 | - value: function update(command, data) { | |
| 2168 | - var query = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; | |
| 2169 | - var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {}; | |
| 2170 | - return this.run('update', command, { | |
| 2171 | - query: query, | |
| 2172 | - options: options, | |
| 2173 | - data: data | |
| 2174 | - }); | |
| 2175 | - } | |
| 2176 | - | |
| 2177 | - /** | |
| 2178 | - * Function options(). | |
| 2179 | - * | |
| 2180 | - * Run a command, that will be translated as endpoint for requesting options/information about specific endpoint. | |
| 2181 | - * | |
| 2182 | - * @param {string} command | |
| 2183 | - * @param {{}} query | |
| 2184 | - * @param {{}} options | |
| 2185 | - * | |
| 2186 | - * @return {*} result | |
| 2187 | - */ | |
| 2188 | - }, { | |
| 2189 | - key: "options", | |
| 2190 | - value: function options(command, query) { | |
| 2191 | - var _options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; | |
| 2192 | - return this.run('options', command, { | |
| 2193 | - query: query, | |
| 2194 | - options: _options | |
| 2195 | - }); | |
| 2196 | - } | |
| 2197 | - }, { | |
| 2198 | - key: "register", | |
| 2199 | - value: function register(component, command, callback) { | |
| 2200 | - _superPropGet(Data, "register", this, 3)([component, command, callback]); | |
| 2201 | - var fullCommandName = component.getNamespace() + '/' + command, | |
| 2202 | - commandInstance = $e.data.getCommandClass(fullCommandName), | |
| 2203 | - format = commandInstance !== null && commandInstance !== void 0 && commandInstance.getEndpointFormat ? commandInstance.getEndpointFormat() : false; | |
| 2204 | - if (format) { | |
| 2205 | - $e.data.registerFormat(fullCommandName, format); | |
| 2206 | - } | |
| 2207 | - return this; | |
| 2208 | - } | |
| 2209 | - | |
| 2210 | - /** | |
| 2211 | - * TODO: Add JSDOC typedef for args ( query and options ). | |
| 2212 | - * | |
| 2213 | - * @param {DataTypes} type | |
| 2214 | - * @param {string} command | |
| 2215 | - * @param {{}} args | |
| 2216 | - * | |
| 2217 | - * @override | |
| 2218 | - */ | |
| 2219 | - }, { | |
| 2220 | - key: "run", | |
| 2221 | - value: function run(type, command, args) { | |
| 2222 | - args.options.type = type; | |
| 2223 | - var _this$commandExtractA = this.commandExtractArgs(command, args); | |
| 2224 | - command = _this$commandExtractA.command; | |
| 2225 | - args = _this$commandExtractA.args; | |
| 2226 | - return _superPropGet(Data, "run", this, 3)([command, args]); | |
| 2227 | - } | |
| 2228 | - }, { | |
| 2229 | - key: "error", | |
| 2230 | - value: function error(message) { | |
| 2231 | - throw Error('Data commands: ' + message); | |
| 2232 | - } | |
| 2233 | - }]); | |
| 2234 | -}(_commands.default); | |
| 2235 | - | |
| 2236 | -/***/ }), | |
| 2237 | - | |
| 2238 | -/***/ "../modules/web-cli/assets/js/core/data/cache.js": | |
| 2239 | -/*!*******************************************************!*\ | |
| 2240 | - !*** ../modules/web-cli/assets/js/core/data/cache.js ***! | |
| 2241 | - \*******************************************************/ | |
| 2242 | -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 2243 | - | |
| 2244 | -"use strict"; | |
| 2245 | - | |
| 2246 | - | |
| 2247 | -var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 2248 | -Object.defineProperty(exports, "__esModule", ({ | |
| 2249 | - value: true | |
| 2250 | -})); | |
| 2251 | -exports["default"] = void 0; | |
| 2252 | -var _typeof2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js")); | |
| 2253 | -var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js")); | |
| 2254 | -var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 2255 | -var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 2256 | -var _localStorage = _interopRequireDefault(__webpack_require__(/*! ./storages/local-storage */ "../modules/web-cli/assets/js/core/data/storages/local-storage.js")); | |
| 4736 | +//#endregion | |
| 4737 | +//#region modules/web-cli/assets/js/core/hooks.js | |
| 2257 | 4738 | /** |
| 2258 | - * @typedef {{}} RequestData | |
| 2259 | - */ | |
| 2260 | -/** | |
| 2261 | - * @typedef {import('../data')} Data | |
| 2262 | - */ | |
| 2263 | -/** | |
| 2264 | - * TODO: Search common logic, create functions to reduce code size. | |
| 2265 | - */ | |
| 2266 | -var Cache = exports["default"] = /*#__PURE__*/function () { | |
| 2267 | - /** | |
| 2268 | - * Function constructor(). | |
| 2269 | - * | |
| 2270 | - * Create cache. | |
| 2271 | - * | |
| 2272 | - * @param {Data} manager | |
| 2273 | - */ | |
| 2274 | - function Cache(manager) { | |
| 2275 | - (0, _classCallCheck2.default)(this, Cache); | |
| 2276 | - this.manager = manager; | |
| 2277 | - this.storage = new _localStorage.default(); | |
| 2278 | - } | |
| 4739 | + * @typedef {import('../modules/hook-base')} HookBase | |
| 4740 | + */ | |
| 4741 | + var Hooks = /*#__PURE__*/ function() { | |
| 4742 | + function Hooks() { | |
| 4743 | + _classCallCheck(this, Hooks); | |
| 4744 | + _defineProperty(this, "data", new Data()); | |
| 4745 | + _defineProperty(this, "ui", new Ui()); | |
| 4746 | + } | |
| 4747 | + return _createClass(Hooks, [ | |
| 4748 | + { | |
| 4749 | + key: "activate", | |
| 4750 | + value: function activate() { | |
| 4751 | + this.getTypes().forEach(function(hooksType) { | |
| 4752 | + hooksType.activate(); | |
| 4753 | + }); | |
| 4754 | + } | |
| 4755 | + }, | |
| 4756 | + { | |
| 4757 | + key: "deactivate", | |
| 4758 | + value: function deactivate() { | |
| 4759 | + this.getTypes().forEach(function(hooksType) { | |
| 4760 | + hooksType.deactivate(); | |
| 4761 | + }); | |
| 4762 | + } | |
| 4763 | + }, | |
| 4764 | + { | |
| 4765 | + key: "getAll", | |
| 4766 | + value: function getAll() { | |
| 4767 | + var flat = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false; | |
| 4768 | + var result = {}; | |
| 4769 | + this.getTypes().forEach(function(hooksType) { | |
| 4770 | + result[hooksType.getType()] = hooksType.getAll(flat); | |
| 4771 | + }); | |
| 4772 | + return result; | |
| 4773 | + } | |
| 4774 | + }, | |
| 4775 | + { | |
| 4776 | + key: "getTypes", | |
| 4777 | + value: function getTypes() { | |
| 4778 | + return [this.data, this.ui]; | |
| 4779 | + } | |
| 4780 | + }, | |
| 4781 | + { | |
| 4782 | + key: "getType", | |
| 4783 | + value: function getType(type) { | |
| 4784 | + return this.getTypes().find(function(hooks) { | |
| 4785 | + return type === hooks.getType(); | |
| 4786 | + }); | |
| 4787 | + } | |
| 4788 | + }, | |
| 4789 | + { | |
| 4790 | + key: "register", | |
| 4791 | + value: function register(type, event, instance) { | |
| 4792 | + return this.getType(type).register(event, instance); | |
| 4793 | + } | |
| 4794 | + }, | |
| 4795 | + { | |
| 4796 | + key: "run", | |
| 4797 | + value: function run(type, event, command, args) { | |
| 4798 | + var result = arguments.length > 4 && arguments[4] !== void 0 ? arguments[4] : void 0; | |
| 4799 | + return this.getType(type).run(event, command, args, result); | |
| 4800 | + } | |
| 4801 | + }, | |
| 4802 | + { | |
| 4803 | + key: "registerDataAfter", | |
| 4804 | + value: function registerDataAfter(instance) { | |
| 4805 | + return this.register("data", "after", instance); | |
| 4806 | + } | |
| 4807 | + }, | |
| 4808 | + { | |
| 4809 | + key: "registerDataCatch", | |
| 4810 | + value: function registerDataCatch(instance) { | |
| 4811 | + return this.register("data", "catch", instance); | |
| 4812 | + } | |
| 4813 | + }, | |
| 4814 | + { | |
| 4815 | + key: "registerDataDependency", | |
| 4816 | + value: function registerDataDependency(instance) { | |
| 4817 | + return this.register("data", "dependency", instance); | |
| 4818 | + } | |
| 4819 | + }, | |
| 4820 | + { | |
| 4821 | + key: "registerUIAfter", | |
| 4822 | + value: function registerUIAfter(instance) { | |
| 4823 | + return this.register("ui", "after", instance); | |
| 4824 | + } | |
| 4825 | + }, | |
| 4826 | + { | |
| 4827 | + key: "registerUICatch", | |
| 4828 | + value: function registerUICatch(instance) { | |
| 4829 | + return this.register("ui", "catch", instance); | |
| 4830 | + } | |
| 4831 | + }, | |
| 4832 | + { | |
| 4833 | + key: "registerUIBefore", | |
| 4834 | + value: function registerUIBefore(instance) { | |
| 4835 | + return this.register("ui", "before", instance); | |
| 4836 | + } | |
| 4837 | + }, | |
| 4838 | + { | |
| 4839 | + key: "runDataAfter", | |
| 4840 | + value: function runDataAfter(command, args, result) { | |
| 4841 | + return this.run("data", "after", command, args, result); | |
| 4842 | + } | |
| 4843 | + }, | |
| 4844 | + { | |
| 4845 | + key: "runDataCatch", | |
| 4846 | + value: function runDataCatch(command, args, error) { | |
| 4847 | + return this.run("data", "catch", command, args, error); | |
| 4848 | + } | |
| 4849 | + }, | |
| 4850 | + { | |
| 4851 | + key: "runDataDependency", | |
| 4852 | + value: function runDataDependency(command, args) { | |
| 4853 | + return this.run("data", "dependency", command, args); | |
| 4854 | + } | |
| 4855 | + }, | |
| 4856 | + { | |
| 4857 | + key: "runUIAfter", | |
| 4858 | + value: function runUIAfter(command, args, result) { | |
| 4859 | + return this.run("ui", "after", command, args, result); | |
| 4860 | + } | |
| 4861 | + }, | |
| 4862 | + { | |
| 4863 | + key: "runUICatch", | |
| 4864 | + value: function runUICatch(command, args, e) { | |
| 4865 | + return this.run("ui", "catch", command, args, e); | |
| 4866 | + } | |
| 4867 | + }, | |
| 4868 | + { | |
| 4869 | + key: "runUIBefore", | |
| 4870 | + value: function runUIBefore(command, args) { | |
| 4871 | + return this.run("ui", "before", command, args); | |
| 4872 | + } | |
| 4873 | + } | |
| 4874 | + ]); | |
| 4875 | + }(); | |
| 2279 | 4876 | |
| 2280 | - /** | |
| 2281 | - * Function getAsync(). | |
| 2282 | - * | |
| 2283 | - * Receive from cache. the difference between getAsync() and get() is that receive return it as promise... | |
| 2284 | - * to fake fetch mechanism. | |
| 2285 | - * | |
| 2286 | - * @param {RequestData} requestData | |
| 2287 | - * | |
| 2288 | - * @return {(Promise|boolean)} request data | |
| 2289 | - */ | |
| 2290 | - return (0, _createClass2.default)(Cache, [{ | |
| 2291 | - key: "getAsync", | |
| 2292 | - value: function getAsync(requestData) { | |
| 2293 | - var data = this.get(requestData); | |
| 2294 | - if (null !== data) { | |
| 2295 | - // If data comes from cache, add 'cache = hit' to requestData. | |
| 2296 | - requestData.cache = 'hit'; | |
| 2297 | - return new Promise(function (resolve) { | |
| 2298 | - resolve(data); | |
| 2299 | - }); | |
| 2300 | - } | |
| 4877 | +//#endregion | |
| 4878 | +//#region modules/web-cli/assets/js/core/routes.js | |
| 4879 | + function _callSuper$8(t, o, e) { | |
| 4880 | + return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$8() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); | |
| 4881 | + } | |
| 4882 | + __name(_callSuper$8, "_callSuper"); | |
| 4883 | + function _isNativeReflectConstruct$8() { | |
| 4884 | + try { | |
| 4885 | + var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); | |
| 4886 | + } catch (t) {} | |
| 4887 | + return (_isNativeReflectConstruct$8 = function _isNativeReflectConstruct() { | |
| 4888 | + return !!t; | |
| 4889 | + })(); | |
| 4890 | + } | |
| 4891 | + __name(_isNativeReflectConstruct$8, "_isNativeReflectConstruct"); | |
| 4892 | + function _superPropGet(t, o, e, r) { | |
| 4893 | + var p = _get(_getPrototypeOf(1 & r ? t.prototype : t), o, e); | |
| 4894 | + return 2 & r && "function" == typeof p ? function(t) { | |
| 4895 | + return p.apply(e, t); | |
| 4896 | + } : p; | |
| 4897 | + } | |
| 4898 | + var Routes = /*#__PURE__*/ function(_Commands) { | |
| 4899 | + function Routes() { | |
| 4900 | + var _this; | |
| 4901 | + _classCallCheck(this, Routes); | |
| 4902 | + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key]; | |
| 4903 | + _this = _callSuper$8(this, Routes, [].concat(args)); | |
| 4904 | + _this.savedStates = {}; | |
| 4905 | + _this.historyPerComponent = {}; | |
| 4906 | + return _this; | |
| 4907 | + } | |
| 4908 | + _inherits(Routes, _Commands); | |
| 4909 | + return _createClass(Routes, [ | |
| 4910 | + { | |
| 4911 | + key: "refreshContainer", | |
| 4912 | + value: function refreshContainer(container) { | |
| 4913 | + var currentRoute = this.getCurrent(container); | |
| 4914 | + var currentArgs = this.getCurrentArgs(container); | |
| 4915 | + this.clearCurrent(container); | |
| 4916 | + this.to(currentRoute, currentArgs); | |
| 4917 | + } | |
| 4918 | + }, | |
| 4919 | + { | |
| 4920 | + key: "getHistory", | |
| 4921 | + value: function getHistory() { | |
| 4922 | + var namespaceRoot = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : ""; | |
| 4923 | + if (namespaceRoot) return this.historyPerComponent[namespaceRoot] || []; | |
| 4924 | + return this.historyPerComponent; | |
| 4925 | + } | |
| 4926 | + }, | |
| 4927 | + { | |
| 4928 | + key: "clearHistory", | |
| 4929 | + value: function clearHistory(namespaceRoot) { | |
| 4930 | + delete this.historyPerComponent[namespaceRoot]; | |
| 4931 | + } | |
| 4932 | + }, | |
| 4933 | + { | |
| 4934 | + key: "clearCurrent", | |
| 4935 | + value: function clearCurrent(container) { | |
| 4936 | + var route = this.current[container]; | |
| 4937 | + if (!route) return; | |
| 4938 | + this.detachCurrent(container); | |
| 4939 | + this.getComponent(route).onCloseRoute(route); | |
| 4940 | + this.dispatchOnClose(route); | |
| 4941 | + } | |
| 4942 | + }, | |
| 4943 | + { | |
| 4944 | + key: "clear", | |
| 4945 | + value: function clear() { | |
| 4946 | + var _this2 = this; | |
| 4947 | + Object.keys(this.current).forEach(function(container) { | |
| 4948 | + return _this2.clearCurrent(container); | |
| 4949 | + }); | |
| 4950 | + } | |
| 4951 | + }, | |
| 4952 | + { | |
| 4953 | + key: "saveState", | |
| 4954 | + value: function saveState(container) { | |
| 4955 | + this.savedStates[container] = { | |
| 4956 | + route: this.current[container], | |
| 4957 | + args: this.currentArgs[container] | |
| 4958 | + }; | |
| 4959 | + return this; | |
| 4960 | + } | |
| 4961 | + }, | |
| 4962 | + { | |
| 4963 | + key: "restoreState", | |
| 4964 | + value: function restoreState(container) { | |
| 4965 | + if (!this.savedStates[container]) return false; | |
| 4966 | + this.to(this.savedStates[container].route, this.savedStates[container].args); | |
| 4967 | + return true; | |
| 4968 | + } | |
| 4969 | + }, | |
| 4970 | + { | |
| 4971 | + key: "validateRun", | |
| 4972 | + value: function validateRun(route) { | |
| 4973 | + var args = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; | |
| 4974 | + if (!_superPropGet(Routes, "validateRun", this, 3)([route, args])) return false; | |
| 4975 | + if (this.is(route, args) && !args.refresh) return false; | |
| 4976 | + var component = this.getComponent(route); | |
| 4977 | + if (!component.isOpen || args.reOpen) component.isOpen = component.open(args); | |
| 4978 | + return component.isOpen; | |
| 4979 | + } | |
| 4980 | + }, | |
| 4981 | + { | |
| 4982 | + key: "beforeRun", | |
| 4983 | + value: function beforeRun(route, args) { | |
| 4984 | + var container = this.getComponent(route).getServiceName(); | |
| 4985 | + var oldRoute = this.current[container]; | |
| 4986 | + if (oldRoute) this.getComponent(oldRoute).onCloseRoute(oldRoute); | |
| 4987 | + Commands.trace.push(route); | |
| 4988 | + _superPropGet(Routes, "beforeRun", this, 3)([ | |
| 4989 | + route, | |
| 4990 | + args, | |
| 4991 | + false | |
| 4992 | + ]); | |
| 4993 | + this.attachCurrent(container, route, args); | |
| 4994 | + if (oldRoute) this.dispatchOnClose(oldRoute); | |
| 4995 | + } | |
| 4996 | + }, | |
| 4997 | + { | |
| 4998 | + key: "to", | |
| 4999 | + value: function to(route, args) { | |
| 5000 | + var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : { history: true }; | |
| 5001 | + this.run(route, args); | |
| 5002 | + var namespaceRoot = this.getComponent(route).getServiceName(); | |
| 5003 | + if (options.history) { | |
| 5004 | + if (!this.historyPerComponent[namespaceRoot]) this.historyPerComponent[namespaceRoot] = []; | |
| 5005 | + this.historyPerComponent[namespaceRoot].push({ | |
| 5006 | + route, | |
| 5007 | + args | |
| 5008 | + }); | |
| 5009 | + } | |
| 5010 | + } | |
| 5011 | + }, | |
| 5012 | + { | |
| 5013 | + key: "back", | |
| 5014 | + value: function back(namespaceRoot) { | |
| 5015 | + var history = this.getHistory(namespaceRoot); | |
| 5016 | + history.pop(); | |
| 5017 | + var last = history.pop(); | |
| 5018 | + if (!last) return; | |
| 5019 | + this.to(last.route, last.args); | |
| 5020 | + } | |
| 5021 | + }, | |
| 5022 | + { | |
| 5023 | + key: "runShortcut", | |
| 5024 | + value: function runShortcut(command) { | |
| 5025 | + this.to(command); | |
| 5026 | + } | |
| 5027 | + }, | |
| 5028 | + { | |
| 5029 | + key: "afterRun", | |
| 5030 | + value: function afterRun(route, args) { | |
| 5031 | + var results = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : void 0; | |
| 5032 | + this.getComponent(route).onRoute(route, args); | |
| 5033 | + this.dispatchOnOpen(route); | |
| 5034 | + _superPropGet(Routes, "afterRun", this, 3)([ | |
| 5035 | + route, | |
| 5036 | + args, | |
| 5037 | + results, | |
| 5038 | + false | |
| 5039 | + ]); | |
| 5040 | + Commands.trace.pop(); | |
| 5041 | + } | |
| 5042 | + }, | |
| 5043 | + { | |
| 5044 | + key: "is", | |
| 5045 | + value: function is(route) { | |
| 5046 | + var args = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; | |
| 5047 | + if (!_superPropGet(Routes, "is", this, 3)([route])) return false; | |
| 5048 | + var container = this.getComponent(route).getServiceName(); | |
| 5049 | + return _.isEqual(args, this.currentArgs[container]); | |
| 5050 | + } | |
| 5051 | + }, | |
| 5052 | + { | |
| 5053 | + key: "isPartOf", | |
| 5054 | + value: function isPartOf(route) { | |
| 5055 | + /** | |
| 5056 | + * Check against current command hierarchically. | |
| 5057 | + * For example `is( 'panel' )` will be true for `panel/elements` | |
| 5058 | + * `is( 'panel/editor' )` will be true for `panel/editor/style` | |
| 5059 | + */ | |
| 5060 | + var container = route.split("/")[0]; | |
| 5061 | + var toCheck = []; | |
| 5062 | + var currentParts = this.current[container] ? this.current[container].split("/") : []; | |
| 5063 | + var match = false; | |
| 5064 | + currentParts.forEach(function(part) { | |
| 5065 | + toCheck.push(part); | |
| 5066 | + if (toCheck.join("/") === route) match = true; | |
| 5067 | + }); | |
| 5068 | + return match; | |
| 5069 | + } | |
| 5070 | + }, | |
| 5071 | + { | |
| 5072 | + key: "error", | |
| 5073 | + value: function error(message) { | |
| 5074 | + throw Error("Routes: " + message); | |
| 5075 | + } | |
| 5076 | + }, | |
| 5077 | + { | |
| 5078 | + key: "dispatchOnOpen", | |
| 5079 | + value: function dispatchOnOpen(route) { | |
| 5080 | + window.dispatchEvent(new CustomEvent("elementor/routes/open", { detail: { route } })); | |
| 5081 | + } | |
| 5082 | + }, | |
| 5083 | + { | |
| 5084 | + key: "dispatchOnClose", | |
| 5085 | + value: function dispatchOnClose(route) { | |
| 5086 | + window.dispatchEvent(new CustomEvent("elementor/routes/close", { detail: { route } })); | |
| 5087 | + } | |
| 5088 | + } | |
| 5089 | + ]); | |
| 5090 | + }(Commands); | |
| 2301 | 5091 | |
| 2302 | - // TODO: Check if possible, always return promise and reject it. | |
| 2303 | - return false; | |
| 2304 | - } | |
| 5092 | +//#endregion | |
| 5093 | +//#region modules/web-cli/assets/js/utils/environment.js | |
| 5094 | + var matchUserAgent = function matchUserAgent(UserAgentStr) { | |
| 5095 | + return userAgent.indexOf(UserAgentStr) >= 0; | |
| 5096 | + }; | |
| 5097 | + var userAgent = navigator.userAgent; | |
| 5098 | + var isOpera = !!window.opr && !!opr.addons || !!window.opera || matchUserAgent(" OPR/"); | |
| 5099 | + var isFirefox = matchUserAgent("Firefox"); | |
| 5100 | + var isSafari = /^((?!chrome|android).)*safari/i.test(userAgent) || /constructor/i.test(window.HTMLElement) || function(p) { | |
| 5101 | + return "[object SafariRemoteNotification]" === p.toString(); | |
| 5102 | + }(!window.safari || typeof safari !== "undefined" && safari.pushNotification); | |
| 5103 | + var isIE = /Trident|MSIE/.test(userAgent) && !!document.documentMode; | |
| 5104 | + var isEdge = !isIE && !!window.StyleMedia || matchUserAgent("Edg"); | |
| 5105 | + var isChrome = !!window.chrome && matchUserAgent("Chrome") && !(isEdge || isOpera); | |
| 5106 | + var isBlink = matchUserAgent("Chrome") && !!window.CSS; | |
| 5107 | + var environment = { | |
| 5108 | + appleWebkit: matchUserAgent("AppleWebKit") && !isBlink, | |
| 5109 | + blink: isBlink, | |
| 5110 | + chrome: isChrome, | |
| 5111 | + edge: isEdge, | |
| 5112 | + firefox: isFirefox, | |
| 5113 | + ie: isIE, | |
| 5114 | + mac: matchUserAgent("Macintosh"), | |
| 5115 | + opera: isOpera, | |
| 5116 | + safari: isSafari, | |
| 5117 | + webkit: matchUserAgent("AppleWebKit") | |
| 5118 | + }; | |
| 2305 | 5119 | |
| 2306 | - /** | |
| 2307 | - * Function set(). | |
| 2308 | - * | |
| 2309 | - * set data to cache. | |
| 2310 | - * | |
| 2311 | - * The difference between set() and update() is that set, will modify the data anyway... | |
| 2312 | - * when update() will only modify exist objects/values. | |
| 2313 | - * | |
| 2314 | - * @param {RequestData} requestData | |
| 2315 | - * @param {*} data | |
| 2316 | - */ | |
| 2317 | - }, { | |
| 2318 | - key: "set", | |
| 2319 | - value: function set(requestData, data) { | |
| 2320 | - $e.data.validateRequestData(requestData); | |
| 2321 | - var componentName = requestData.component.getNamespace(), | |
| 2322 | - pureEndpoint = requestData.endpoint.replace(componentName + '/', ''), | |
| 2323 | - pureEndpointParts = pureEndpoint.split('/'); | |
| 2324 | - var newData = {}; | |
| 5120 | +//#endregion | |
| 5121 | +//#region modules/web-cli/assets/js/core/shortcuts.js | |
| 5122 | + var Shortcuts = /*#__PURE__*/ function() { | |
| 5123 | + function Shortcuts($window) { | |
| 5124 | + _classCallCheck(this, Shortcuts); | |
| 5125 | + this.specialKeys = { | |
| 5126 | + 13: "enter", | |
| 5127 | + 27: "esc", | |
| 5128 | + 38: "up", | |
| 5129 | + 40: "down", | |
| 5130 | + 46: "del", | |
| 5131 | + 191: "?" | |
| 5132 | + }; | |
| 5133 | + this.component = ""; | |
| 5134 | + this.handlers = {}; | |
| 5135 | + this.bindListener($window); | |
| 5136 | + } | |
| 5137 | + return _createClass(Shortcuts, [ | |
| 5138 | + { | |
| 5139 | + key: "bindListener", | |
| 5140 | + value: function bindListener($window) { | |
| 5141 | + var _this = this; | |
| 5142 | + $window.on("keydown", function(event) { | |
| 5143 | + return _this.handle(event); | |
| 5144 | + }); | |
| 5145 | + } | |
| 5146 | + }, | |
| 5147 | + { | |
| 5148 | + key: "getAll", | |
| 5149 | + value: function getAll() { | |
| 5150 | + var shortcuts = {}; | |
| 5151 | + jQuery.each(this.handlers, function(key, handler) { | |
| 5152 | + jQuery.each(handler, function(index, config) { | |
| 5153 | + shortcuts[config.command] = key; | |
| 5154 | + }); | |
| 5155 | + }); | |
| 5156 | + return shortcuts; | |
| 5157 | + } | |
| 5158 | + }, | |
| 5159 | + { | |
| 5160 | + key: "register", | |
| 5161 | + value: function register(shortcuts, args) { | |
| 5162 | + var _this2 = this; | |
| 5163 | + shortcuts.replace(" ", "").split(",").forEach(function(shortcut) { | |
| 5164 | + if (!_this2.handlers[shortcut]) _this2.handlers[shortcut] = []; | |
| 5165 | + _this2.handlers[shortcut].push(args); | |
| 5166 | + }); | |
| 5167 | + } | |
| 5168 | + }, | |
| 5169 | + { | |
| 5170 | + key: "unregister", | |
| 5171 | + value: function unregister(shortcuts, args) { | |
| 5172 | + var _this3 = this; | |
| 5173 | + shortcuts.replace(" ", "").split(",").forEach(function(shortcut) { | |
| 5174 | + _this3.handlers[shortcut].forEach(function(index, handler) { | |
| 5175 | + if (args === handler) delete _this3.handlers[shortcut][index]; | |
| 5176 | + }); | |
| 5177 | + }); | |
| 5178 | + } | |
| 5179 | + }, | |
| 5180 | + { | |
| 5181 | + key: "handle", | |
| 5182 | + value: function handle(event) { | |
| 5183 | + var handlers = this.getHandlersByPriority(event); | |
| 5184 | + if (!handlers) return; | |
| 5185 | + var filteredHandlers = handlers.filter(function(handler) { | |
| 5186 | + if (handler.exclude && -1 !== handler.exclude.indexOf("input")) { | |
| 5187 | + var $target = jQuery(event.target); | |
| 5188 | + if ($target.is(":input, .elementor-input") || $target.closest("[contenteditable=\"true\"]").length) return false; | |
| 5189 | + } | |
| 5190 | + if (handler.dependency && !handler.dependency(event)) return false; | |
| 5191 | + if (!handler.allowAltKey && event.altKey) return false; | |
| 5192 | + return true; | |
| 5193 | + }); | |
| 5194 | + if (!filteredHandlers.length) return; | |
| 5195 | + if (1 < filteredHandlers.length && elementorWebCliConfig.isDebug) Console.warn("Multiple handlers for shortcut.", filteredHandlers, event); | |
| 5196 | + event.preventDefault(); | |
| 5197 | + filteredHandlers[0].callback(event); | |
| 5198 | + } | |
| 5199 | + }, | |
| 5200 | + { | |
| 5201 | + key: "isControlEvent", | |
| 5202 | + value: function isControlEvent(event) { | |
| 5203 | + return event[environment.mac ? "metaKey" : "ctrlKey"]; | |
| 5204 | + } | |
| 5205 | + }, | |
| 5206 | + { | |
| 5207 | + key: "getEventShortcut", | |
| 5208 | + value: function getEventShortcut(event) { | |
| 5209 | + var shortcut = []; | |
| 5210 | + if (event.altKey) shortcut.push("alt"); | |
| 5211 | + if (this.isControlEvent(event)) shortcut.push("ctrl"); | |
| 5212 | + if (event.shiftKey) shortcut.push("shift"); | |
| 5213 | + if (this.specialKeys[event.which]) shortcut.push(this.specialKeys[event.which]); | |
| 5214 | + else shortcut.push(String.fromCharCode(event.which).toLowerCase()); | |
| 5215 | + return shortcut.join("+"); | |
| 5216 | + } | |
| 5217 | + }, | |
| 5218 | + { | |
| 5219 | + key: "isActiveScope", | |
| 5220 | + value: function isActiveScope(scopes) { | |
| 5221 | + var activeComponents = Object.keys($e.components.activeComponents); | |
| 5222 | + var activeComponent = activeComponents[activeComponents.length - 1]; | |
| 5223 | + var component = $e.components.get(activeComponent); | |
| 5224 | + if (!component) return false; | |
| 5225 | + var namespace = component.getNamespace(); | |
| 5226 | + if (scopes.some(function(scope) { | |
| 5227 | + return namespace === scope; | |
| 5228 | + })) return true; | |
| 5229 | + var namespaceRoot = component.getServiceName(); | |
| 5230 | + return scopes.some(function(scope) { | |
| 5231 | + return namespaceRoot === scope; | |
| 5232 | + }); | |
| 5233 | + } | |
| 5234 | + }, | |
| 5235 | + { | |
| 5236 | + key: "getHandlersByPriority", | |
| 5237 | + value: function getHandlersByPriority(event) { | |
| 5238 | + var _this4 = this; | |
| 5239 | + var handlers = this.handlers[this.getEventShortcut(event)]; | |
| 5240 | + if (!handlers) return false; | |
| 5241 | + var inCurrentScope = handlers.filter(function(handler) { | |
| 5242 | + return handler.scopes && _this4.isActiveScope(handler.scopes); | |
| 5243 | + }); | |
| 5244 | + if (inCurrentScope.length) return inCurrentScope; | |
| 5245 | + var noScope = handlers.filter(function(handler) { | |
| 5246 | + return !handler.scopes; | |
| 5247 | + }); | |
| 5248 | + if (noScope.length) return noScope; | |
| 5249 | + } | |
| 5250 | + } | |
| 5251 | + ]); | |
| 5252 | + }(); | |
| 2325 | 5253 | |
| 2326 | - // Example of working with reaming endpoint part(s) can be found at 'cache.spec.js' test: 'load(): deep'. | |
| 2327 | - // Analyze reaming endpoint. | |
| 2328 | - if (pureEndpointParts.length && pureEndpoint !== componentName) { | |
| 2329 | - // Using reaming endpoint parts, to build new data object. | |
| 2330 | - var result = pureEndpointParts.reduce(function (accumulator, pureEndpointPart) { | |
| 2331 | - accumulator[pureEndpointPart] = {}; | |
| 2332 | - return accumulator[pureEndpointPart]; | |
| 2333 | - }, newData); | |
| 5254 | +//#endregion | |
| 5255 | +//#region modules/web-cli/assets/js/core/store.js | |
| 5256 | + function ownKeys(e, r) { | |
| 5257 | + var t = Object.keys(e); | |
| 5258 | + if (Object.getOwnPropertySymbols) { | |
| 5259 | + var o = Object.getOwnPropertySymbols(e); | |
| 5260 | + r && (o = o.filter(function(r) { | |
| 5261 | + return Object.getOwnPropertyDescriptor(e, r).enumerable; | |
| 5262 | + })), t.push.apply(t, o); | |
| 5263 | + } | |
| 5264 | + return t; | |
| 5265 | + } | |
| 5266 | + function _objectSpread(e) { | |
| 5267 | + for (var r = 1; r < arguments.length; r++) { | |
| 5268 | + var t = null != arguments[r] ? arguments[r] : {}; | |
| 5269 | + r % 2 ? ownKeys(Object(t), !0).forEach(function(r) { | |
| 5270 | + _defineProperty(e, r, t[r]); | |
| 5271 | + }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r) { | |
| 5272 | + Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); | |
| 5273 | + }); | |
| 5274 | + } | |
| 5275 | + return e; | |
| 5276 | + } | |
| 5277 | + /** | |
| 5278 | + * @typedef {Promise.resolve(elementorVendors.reduxToolkit).Slice} Slice | |
| 5279 | + */ | |
| 5280 | + /** | |
| 5281 | + * @typedef {Promise.resolve(elementorVendors.reduxToolkit).EnhancedStore} EnhancedStore | |
| 5282 | + */ | |
| 5283 | + /** | |
| 5284 | + * @typedef {Promise.resolve(elementorVendors.reduxToolkit).AnyAction} AnyAction | |
| 5285 | + */ | |
| 5286 | + /** | |
| 5287 | + * @typedef {Promise.resolve(elementorVendors.reduxToolkit).ThunkMiddlewareFor} ThunkMiddlewareFor | |
| 5288 | + */ | |
| 5289 | + var Store = /*#__PURE__*/ function() { | |
| 5290 | + /** | |
| 5291 | + * Initialize the Store. | |
| 5292 | + * | |
| 5293 | + * @return {void} | |
| 5294 | + */ | |
| 5295 | + function Store() { | |
| 5296 | + _classCallCheck(this, Store); | |
| 5297 | + /** | |
| 5298 | + * @type {Object} | |
| 5299 | + */ | |
| 5300 | + _defineProperty(this, "slices", {}); | |
| 5301 | + /** | |
| 5302 | + * @type {EnhancedStore<{}, AnyAction, [ThunkMiddlewareFor<{}>]>} | |
| 5303 | + */ | |
| 5304 | + _defineProperty(this, "reduxStore", void 0); | |
| 5305 | + this.slices = {}; | |
| 5306 | + this.reduxStore = this.createStore(); | |
| 5307 | + } | |
| 5308 | + /** | |
| 5309 | + * Create a Redux Store object. | |
| 5310 | + * | |
| 5311 | + * @return {EnhancedStore<{}, AnyAction, [ThunkMiddlewareFor<{}>]>} store | |
| 5312 | + */ | |
| 5313 | + return _createClass(Store, [ | |
| 5314 | + { | |
| 5315 | + key: "createStore", | |
| 5316 | + value: function createStore() { | |
| 5317 | + return (0, _reduxjs_toolkit.configureStore)({ reducer: function reducer() {} }); | |
| 5318 | + } | |
| 5319 | + }, | |
| 5320 | + { | |
| 5321 | + key: "injectReducer", | |
| 5322 | + value: function injectReducer(id, newReducer) { | |
| 5323 | + var prevReducers = this.getReducers(); | |
| 5324 | + this.reduxStore.replaceReducer((0, _reduxjs_toolkit.combineReducers)(_objectSpread(_objectSpread({}, prevReducers), {}, _defineProperty({}, id, newReducer)))); | |
| 5325 | + } | |
| 5326 | + }, | |
| 5327 | + { | |
| 5328 | + key: "register", | |
| 5329 | + value: function register(sliceId, instance) { | |
| 5330 | + if (this.slices[sliceId]) throw "Slice with ID '".concat(sliceId, "' already exists."); | |
| 5331 | + this.slices[sliceId] = instance; | |
| 5332 | + this.injectReducer(sliceId, instance.reducer); | |
| 5333 | + } | |
| 5334 | + }, | |
| 5335 | + { | |
| 5336 | + key: "get", | |
| 5337 | + value: function get(sliceId) { | |
| 5338 | + return this.slices[sliceId]; | |
| 5339 | + } | |
| 5340 | + }, | |
| 5341 | + { | |
| 5342 | + key: "getAllSlices", | |
| 5343 | + value: function getAllSlices() { | |
| 5344 | + return this.slices; | |
| 5345 | + } | |
| 5346 | + }, | |
| 5347 | + { | |
| 5348 | + key: "getAll", | |
| 5349 | + value: function getAll() { | |
| 5350 | + return Object.keys(this.slices).sort(); | |
| 5351 | + } | |
| 5352 | + }, | |
| 5353 | + { | |
| 5354 | + key: "getReducers", | |
| 5355 | + value: function getReducers() { | |
| 5356 | + return Object.entries(this.slices).reduce(function(reducers, _ref) { | |
| 5357 | + var _ref2 = _slicedToArray(_ref, 2); | |
| 5358 | + var key = _ref2[0]; | |
| 5359 | + var slice = _ref2[1]; | |
| 5360 | + return _objectSpread(_objectSpread({}, reducers), {}, _defineProperty({}, key, slice.reducer)); | |
| 5361 | + }, {}); | |
| 5362 | + } | |
| 5363 | + }, | |
| 5364 | + { | |
| 5365 | + key: "getReduxStore", | |
| 5366 | + value: function getReduxStore() { | |
| 5367 | + return this.reduxStore; | |
| 5368 | + } | |
| 5369 | + }, | |
| 5370 | + { | |
| 5371 | + key: "dispatch", | |
| 5372 | + value: function dispatch() { | |
| 5373 | + var _this$reduxStore; | |
| 5374 | + return (_this$reduxStore = this.reduxStore).dispatch.apply(_this$reduxStore, arguments); | |
| 5375 | + } | |
| 5376 | + }, | |
| 5377 | + { | |
| 5378 | + key: "getState", | |
| 5379 | + value: function getState() { | |
| 5380 | + var sliceId = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : null; | |
| 5381 | + var state = this.reduxStore.getState(); | |
| 5382 | + return sliceId ? state[sliceId] : state; | |
| 5383 | + } | |
| 5384 | + }, | |
| 5385 | + { | |
| 5386 | + key: "replaceReducer", | |
| 5387 | + value: function replaceReducer() { | |
| 5388 | + var _this$reduxStore2; | |
| 5389 | + return (_this$reduxStore2 = this.reduxStore).replaceReducer.apply(_this$reduxStore2, arguments); | |
| 5390 | + } | |
| 5391 | + }, | |
| 5392 | + { | |
| 5393 | + key: "subscribe", | |
| 5394 | + value: function subscribe() { | |
| 5395 | + var _this$reduxStore3; | |
| 5396 | + return (_this$reduxStore3 = this.reduxStore).subscribe.apply(_this$reduxStore3, arguments); | |
| 5397 | + } | |
| 5398 | + } | |
| 5399 | + ]); | |
| 5400 | + }(); | |
| 2334 | 5401 | |
| 2335 | - // 'result' is equal to 'newData' with a deeper pointer, build based on 'pureEndpointParts' ( will effect newData ). | |
| 2336 | - Object.assign(result, data); | |
| 2337 | - } else { | |
| 2338 | - newData = data; | |
| 2339 | - } | |
| 2340 | - var oldData = this.storage.getItem(componentName); | |
| 2341 | - | |
| 2342 | - // When have old data, merge it recursively with newData using jQuery.extend(). | |
| 2343 | - if (oldData !== null) { | |
| 2344 | - newData = jQuery.extend(true, oldData, newData); | |
| 2345 | - } | |
| 2346 | - this.storage.setItem(componentName, newData); | |
| 2347 | - } | |
| 2348 | - | |
| 2349 | - /** | |
| 2350 | - * Function get(). | |
| 2351 | - * | |
| 2352 | - * Get from exist storage. | |
| 2353 | - * | |
| 2354 | - * @param {RequestData} requestData | |
| 2355 | - * | |
| 2356 | - * @return {{}} data | |
| 2357 | - */ | |
| 2358 | - }, { | |
| 2359 | - key: "get", | |
| 2360 | - value: function get(requestData) { | |
| 2361 | - $e.data.validateRequestData(requestData); | |
| 2362 | - var componentName = requestData.component.getNamespace(), | |
| 2363 | - componentData = this.storage.getItem(componentName); | |
| 2364 | - if (componentData !== null) { | |
| 2365 | - if (componentName === requestData.endpoint) { | |
| 2366 | - return componentData; | |
| 2367 | - } | |
| 2368 | - | |
| 2369 | - // Example of working with reaming endpoint part(s) can be found at 'cache.spec.js' test: 'get(): complex'. | |
| 2370 | - // Analyze reaming endpoint (Using reduce over endpoint parts, build the right index). | |
| 2371 | - var pureEndpoint = requestData.endpoint.replace(requestData.component.getNamespace() + '/', ''), | |
| 2372 | - pureEndpointParts = pureEndpoint.split('/'), | |
| 2373 | - // eslint-disable-next-line array-callback-return | |
| 2374 | - result = pureEndpointParts.reduce(function (accumulator, endpointPart) { | |
| 2375 | - if (accumulator && accumulator[endpointPart]) { | |
| 2376 | - return accumulator[endpointPart]; | |
| 2377 | - } | |
| 2378 | - }, componentData); | |
| 2379 | - | |
| 2380 | - // Since $e.data.cache.receive will reject only if null is the result. | |
| 2381 | - return result || null; | |
| 2382 | - } | |
| 2383 | - return null; | |
| 2384 | - } | |
| 2385 | - | |
| 2386 | - /** | |
| 2387 | - * Function update(). | |
| 2388 | - * | |
| 2389 | - * Update only already exist storage, runs over all storage | |
| 2390 | - * | |
| 2391 | - * @param {RequestData} requestData | |
| 2392 | - * | |
| 2393 | - * @return {boolean} is updated | |
| 2394 | - */ | |
| 2395 | - }, { | |
| 2396 | - key: "update", | |
| 2397 | - value: function update(requestData) { | |
| 2398 | - $e.data.validateRequestData(requestData, true); | |
| 2399 | - var endpoint = requestData.endpoint; | |
| 2400 | - var response = {}; | |
| 2401 | - | |
| 2402 | - // Simulate response from cache. | |
| 2403 | - Object.entries(this.storage.getAll()).forEach(function (_ref) { | |
| 2404 | - var _ref2 = (0, _slicedToArray2.default)(_ref, 2), | |
| 2405 | - endpointKey = _ref2[0], | |
| 2406 | - /* String*/endpointValue = _ref2[1]; | |
| 2407 | - if (endpointValue && endpoint.includes(endpointKey)) { | |
| 2408 | - // Assuming it is a specific endpoint. | |
| 2409 | - var oldData = endpointValue, | |
| 2410 | - pureEndpoint = requestData.endpoint.replace(requestData.component.getNamespace() + '/', ''), | |
| 2411 | - pureEndpointParts = pureEndpoint.split('/'), | |
| 2412 | - isComponentUpdate = 1 === pureEndpointParts.length && endpointKey === requestData.endpoint && endpointKey === requestData.component.getNamespace(); | |
| 2413 | - | |
| 2414 | - // Component update or specific update? | |
| 2415 | - if (isComponentUpdate) { | |
| 2416 | - response = jQuery.extend(true, oldData, requestData.args.data); | |
| 2417 | - } else { | |
| 2418 | - var oldSpecificData = pureEndpointParts.reduce(function (accumulator, pureEndpointPart) { | |
| 2419 | - return accumulator[pureEndpointPart]; | |
| 2420 | - }, oldData); | |
| 2421 | - response = jQuery.extend(true, oldSpecificData, requestData.args.data); | |
| 2422 | - } | |
| 2423 | - } | |
| 2424 | - }); | |
| 2425 | - | |
| 2426 | - // If response not found. | |
| 2427 | - if (0 === Object.values(response).length) { | |
| 2428 | - return false; | |
| 2429 | - } | |
| 2430 | - | |
| 2431 | - // Update cache. | |
| 2432 | - this.set(requestData, response); | |
| 2433 | - return true; | |
| 2434 | - } | |
| 2435 | - | |
| 2436 | - /** | |
| 2437 | - * Function delete(). | |
| 2438 | - * | |
| 2439 | - * Delete endpoint from storage. | |
| 2440 | - * | |
| 2441 | - * @param {RequestData} requestData | |
| 2442 | - * | |
| 2443 | - * @return {boolean} is deleted | |
| 2444 | - */ | |
| 2445 | - }, { | |
| 2446 | - key: "delete", | |
| 2447 | - value: function _delete(requestData) { | |
| 2448 | - $e.data.validateRequestData(requestData); | |
| 2449 | - var result = false; | |
| 2450 | - var componentName = requestData.component.getNamespace(); | |
| 2451 | - if (componentName !== requestData.endpoint) { | |
| 2452 | - var oldData = this.storage.getItem(componentName), | |
| 2453 | - newData = {}; | |
| 2454 | - if (null === oldData) { | |
| 2455 | - return false; | |
| 2456 | - } | |
| 2457 | - var pureEndpoint = requestData.endpoint.replace(componentName + '/', ''), | |
| 2458 | - pureEndpointParts = pureEndpoint.split('/'), | |
| 2459 | - lastEndpointPart = pureEndpointParts[pureEndpointParts.length - 1]; | |
| 2460 | - pureEndpointParts.reduce(function (accumulator, pureEndpointPart) { | |
| 2461 | - if (pureEndpointPart === lastEndpointPart) { | |
| 2462 | - // Null, means delete. | |
| 2463 | - accumulator[pureEndpointPart] = null; | |
| 2464 | - } else { | |
| 2465 | - accumulator[pureEndpointPart] = {}; | |
| 2466 | - } | |
| 2467 | - return accumulator[pureEndpointPart]; | |
| 2468 | - }, newData); | |
| 2469 | - if (Object.keys(oldData).length) { | |
| 2470 | - var _deleteKeys = function deleteKeys(target, nullsObject) { | |
| 2471 | - if (nullsObject) { | |
| 2472 | - Object.keys(nullsObject).forEach(function (key) { | |
| 2473 | - if (nullsObject[key] && 'object' === (0, _typeof2.default)(nullsObject[key])) { | |
| 2474 | - _deleteKeys(target[key], nullsObject[key]); | |
| 2475 | - } else if (null === nullsObject[key]) { | |
| 2476 | - delete target[key]; | |
| 2477 | - result = true; | |
| 2478 | - } | |
| 2479 | - }); | |
| 2480 | - } else { | |
| 2481 | - // Means need to clear all the object. | |
| 2482 | - Object.keys(target).forEach(function (key) { | |
| 2483 | - return delete target[key]; | |
| 2484 | - }); | |
| 2485 | - } | |
| 2486 | - return target; | |
| 2487 | - }; | |
| 2488 | - this.storage.setItem(componentName, _deleteKeys(oldData, newData)); | |
| 2489 | - } | |
| 2490 | - } else { | |
| 2491 | - for (var key in this.storage.getAll()) { | |
| 2492 | - if (key === requestData.endpoint) { | |
| 2493 | - this.storage.removeItem(requestData.endpoint); | |
| 2494 | - result = true; | |
| 2495 | - break; | |
| 2496 | - } | |
| 2497 | - } | |
| 2498 | - } | |
| 2499 | - return result; | |
| 2500 | - } | |
| 2501 | - }]); | |
| 2502 | -}(); | |
| 2503 | - | |
| 2504 | -/***/ }), | |
| 2505 | - | |
| 2506 | -/***/ "../modules/web-cli/assets/js/core/data/errors/base-error.js": | |
| 2507 | -/*!*******************************************************************!*\ | |
| 2508 | - !*** ../modules/web-cli/assets/js/core/data/errors/base-error.js ***! | |
| 2509 | - \*******************************************************************/ | |
| 2510 | -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 2511 | - | |
| 2512 | -"use strict"; | |
| 2513 | - | |
| 2514 | - | |
| 2515 | -var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 2516 | -Object.defineProperty(exports, "__esModule", ({ | |
| 2517 | - value: true | |
| 2518 | -})); | |
| 2519 | -exports["default"] = void 0; | |
| 2520 | -var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 2521 | -var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 2522 | -var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 2523 | -var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 2524 | -var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 2525 | -var _wrapNativeSuper2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/wrapNativeSuper */ "../node_modules/@babel/runtime/helpers/wrapNativeSuper.js")); | |
| 2526 | -var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js")); | |
| 2527 | -var _console = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/console */ "../modules/web-cli/assets/js/utils/console.js")); | |
| 2528 | -var _forceMethodImplementation = _interopRequireDefault(__webpack_require__(/*! ../../../utils/force-method-implementation */ "../modules/web-cli/assets/js/utils/force-method-implementation.js")); | |
| 2529 | -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; } | |
| 2530 | -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; } | |
| 2531 | -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)); } | |
| 2532 | -function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } | |
| 2533 | -var BaseError = exports["default"] = /*#__PURE__*/function (_Error) { | |
| 2534 | - /** | |
| 2535 | - * Error constructor. | |
| 2536 | - * | |
| 2537 | - * @param {string} message | |
| 2538 | - * @param {string} code | |
| 2539 | - * @param {*} data | |
| 2540 | - */ | |
| 2541 | - function BaseError() { | |
| 2542 | - var _this; | |
| 2543 | - var message = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; | |
| 2544 | - var code = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; | |
| 2545 | - var data = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : []; | |
| 2546 | - (0, _classCallCheck2.default)(this, BaseError); | |
| 2547 | - _this = _callSuper(this, BaseError, [message]); | |
| 2548 | - /** | |
| 2549 | - * The server error code. | |
| 2550 | - * | |
| 2551 | - * @type {string} | |
| 2552 | - */ | |
| 2553 | - (0, _defineProperty2.default)(_this, "code", ''); | |
| 2554 | - /** | |
| 2555 | - * Additional data about the current error. | |
| 2556 | - * | |
| 2557 | - * @type {*[]} | |
| 2558 | - */ | |
| 2559 | - (0, _defineProperty2.default)(_this, "data", []); | |
| 2560 | - _this.code = code; | |
| 2561 | - _this.data = data; | |
| 2562 | - return _this; | |
| 2563 | - } | |
| 2564 | - | |
| 2565 | - /** | |
| 2566 | - * Notify a message when the error occurs. | |
| 2567 | - */ | |
| 2568 | - (0, _inherits2.default)(BaseError, _Error); | |
| 2569 | - return (0, _createClass2.default)(BaseError, [{ | |
| 2570 | - key: "notify", | |
| 2571 | - value: function notify() { | |
| 2572 | - _console.default.error(_objectSpread({ | |
| 2573 | - message: this.message | |
| 2574 | - }, this)); | |
| 2575 | - } | |
| 2576 | - }], [{ | |
| 2577 | - key: "create", | |
| 2578 | - value: | |
| 2579 | - /** | |
| 2580 | - * Static helper function to create the error. | |
| 2581 | - * | |
| 2582 | - * @param {string} message | |
| 2583 | - * @param {string} code | |
| 2584 | - * @param {*} data | |
| 2585 | - * @return {BaseError} error | |
| 2586 | - */ | |
| 2587 | - function create(message) { | |
| 2588 | - var code = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ''; | |
| 2589 | - var data = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : []; | |
| 2590 | - return new this(message, code, data); | |
| 2591 | - } | |
| 2592 | - | |
| 2593 | - /** | |
| 2594 | - * Returns the status code of the error. | |
| 2595 | - */ | |
| 2596 | - }, { | |
| 2597 | - key: "getHTTPErrorCode", | |
| 2598 | - value: function getHTTPErrorCode() { | |
| 2599 | - (0, _forceMethodImplementation.default)(); | |
| 2600 | - } | |
| 2601 | - }]); | |
| 2602 | -}(/*#__PURE__*/(0, _wrapNativeSuper2.default)(Error)); | |
| 2603 | - | |
| 2604 | -/***/ }), | |
| 2605 | - | |
| 2606 | -/***/ "../modules/web-cli/assets/js/core/data/errors/default-error.js": | |
| 2607 | -/*!**********************************************************************!*\ | |
| 2608 | - !*** ../modules/web-cli/assets/js/core/data/errors/default-error.js ***! | |
| 2609 | - \**********************************************************************/ | |
| 2610 | -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 2611 | - | |
| 2612 | -"use strict"; | |
| 2613 | - | |
| 2614 | - | |
| 2615 | -var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 2616 | -Object.defineProperty(exports, "__esModule", ({ | |
| 2617 | - value: true | |
| 2618 | -})); | |
| 2619 | -exports["default"] = exports.DefaultError = void 0; | |
| 2620 | -var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 2621 | -var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 2622 | -var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 2623 | -var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 2624 | -var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 2625 | -var _baseError = _interopRequireDefault(__webpack_require__(/*! ./base-error */ "../modules/web-cli/assets/js/core/data/errors/base-error.js")); | |
| 2626 | -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)); } | |
| 2627 | -function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } | |
| 2628 | -var DefaultError = exports.DefaultError = /*#__PURE__*/function (_BaseError) { | |
| 2629 | - function DefaultError() { | |
| 2630 | - (0, _classCallCheck2.default)(this, DefaultError); | |
| 2631 | - return _callSuper(this, DefaultError, arguments); | |
| 2632 | - } | |
| 2633 | - (0, _inherits2.default)(DefaultError, _BaseError); | |
| 2634 | - return (0, _createClass2.default)(DefaultError, null, [{ | |
| 2635 | - key: "getHTTPErrorCode", | |
| 2636 | - value: function getHTTPErrorCode() { | |
| 2637 | - return 501; | |
| 2638 | - } | |
| 2639 | - }]); | |
| 2640 | -}(_baseError.default); | |
| 2641 | -var _default = exports["default"] = DefaultError; | |
| 2642 | - | |
| 2643 | -/***/ }), | |
| 2644 | - | |
| 2645 | -/***/ "../modules/web-cli/assets/js/core/data/errors/error-404.js": | |
| 2646 | -/*!******************************************************************!*\ | |
| 2647 | - !*** ../modules/web-cli/assets/js/core/data/errors/error-404.js ***! | |
| 2648 | - \******************************************************************/ | |
| 2649 | -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 2650 | - | |
| 2651 | -"use strict"; | |
| 2652 | - | |
| 2653 | - | |
| 2654 | -var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 2655 | -Object.defineProperty(exports, "__esModule", ({ | |
| 2656 | - value: true | |
| 2657 | -})); | |
| 2658 | -exports["default"] = exports.Error404 = void 0; | |
| 2659 | -var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 2660 | -var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 2661 | -var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 2662 | -var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 2663 | -var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 2664 | -var _baseError = _interopRequireDefault(__webpack_require__(/*! ./base-error */ "../modules/web-cli/assets/js/core/data/errors/base-error.js")); | |
| 2665 | -var _console = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/console */ "../modules/web-cli/assets/js/utils/console.js")); | |
| 2666 | -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)); } | |
| 2667 | -function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } | |
| 2668 | -var Error404 = exports.Error404 = /*#__PURE__*/function (_BaseError) { | |
| 2669 | - function Error404() { | |
| 2670 | - (0, _classCallCheck2.default)(this, Error404); | |
| 2671 | - return _callSuper(this, Error404, arguments); | |
| 2672 | - } | |
| 2673 | - (0, _inherits2.default)(Error404, _BaseError); | |
| 2674 | - return (0, _createClass2.default)(Error404, [{ | |
| 2675 | - key: "notify", | |
| 2676 | - value: function notify() { | |
| 2677 | - _console.default.warn(this.message); | |
| 2678 | - } | |
| 2679 | - }], [{ | |
| 2680 | - key: "getHTTPErrorCode", | |
| 2681 | - value: function getHTTPErrorCode() { | |
| 2682 | - return 404; | |
| 2683 | - } | |
| 2684 | - }]); | |
| 2685 | -}(_baseError.default); | |
| 2686 | -var _default = exports["default"] = Error404; | |
| 2687 | - | |
| 2688 | -/***/ }), | |
| 2689 | - | |
| 2690 | -/***/ "../modules/web-cli/assets/js/core/data/errors/index.js": | |
| 2691 | -/*!**************************************************************!*\ | |
| 2692 | - !*** ../modules/web-cli/assets/js/core/data/errors/index.js ***! | |
| 2693 | - \**************************************************************/ | |
| 2694 | -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 2695 | - | |
| 2696 | -"use strict"; | |
| 2697 | - | |
| 2698 | - | |
| 2699 | -Object.defineProperty(exports, "__esModule", ({ | |
| 2700 | - value: true | |
| 2701 | -})); | |
| 2702 | -Object.defineProperty(exports, "DefaultError", ({ | |
| 2703 | - enumerable: true, | |
| 2704 | - get: function get() { | |
| 2705 | - return _defaultError.DefaultError; | |
| 2706 | - } | |
| 2707 | -})); | |
| 2708 | -Object.defineProperty(exports, "Error404", ({ | |
| 2709 | - enumerable: true, | |
| 2710 | - get: function get() { | |
| 2711 | - return _error.Error404; | |
| 2712 | - } | |
| 2713 | -})); | |
| 2714 | -var _defaultError = __webpack_require__(/*! ./default-error */ "../modules/web-cli/assets/js/core/data/errors/default-error.js"); | |
| 2715 | -var _error = __webpack_require__(/*! ./error-404 */ "../modules/web-cli/assets/js/core/data/errors/error-404.js"); | |
| 2716 | - | |
| 2717 | -/***/ }), | |
| 2718 | - | |
| 2719 | -/***/ "../modules/web-cli/assets/js/core/data/storages/base-prefix-storage.js": | |
| 2720 | -/*!******************************************************************************!*\ | |
| 2721 | - !*** ../modules/web-cli/assets/js/core/data/storages/base-prefix-storage.js ***! | |
| 2722 | - \******************************************************************************/ | |
| 2723 | -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 2724 | - | |
| 2725 | -"use strict"; | |
| 2726 | - | |
| 2727 | - | |
| 2728 | -var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 2729 | -Object.defineProperty(exports, "__esModule", ({ | |
| 2730 | - value: true | |
| 2731 | -})); | |
| 2732 | -exports["default"] = void 0; | |
| 2733 | -var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 2734 | -var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 2735 | -var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 2736 | -var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 2737 | -var _get2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/get */ "../node_modules/@babel/runtime/helpers/get.js")); | |
| 2738 | -var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 2739 | -var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js")); | |
| 2740 | -var _baseStorage = _interopRequireDefault(__webpack_require__(/*! elementor-api/core/data/storages/base-storage */ "../modules/web-cli/assets/js/core/data/storages/base-storage.js")); | |
| 2741 | -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)); } | |
| 2742 | -function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } | |
| 2743 | -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; } | |
| 2744 | -var BasePrefixStorage = exports["default"] = /*#__PURE__*/function (_BaseStorage) { | |
| 2745 | - function BasePrefixStorage() { | |
| 2746 | - (0, _classCallCheck2.default)(this, BasePrefixStorage); | |
| 2747 | - return _callSuper(this, BasePrefixStorage, arguments); | |
| 2748 | - } | |
| 2749 | - (0, _inherits2.default)(BasePrefixStorage, _BaseStorage); | |
| 2750 | - return (0, _createClass2.default)(BasePrefixStorage, [{ | |
| 2751 | - key: "clear", | |
| 2752 | - value: function clear() { | |
| 2753 | - var _this = this; | |
| 2754 | - Object.keys(this.getAll()).forEach(function (key) { | |
| 2755 | - return _this.removeItem(key); | |
| 2756 | - }); | |
| 2757 | - } | |
| 2758 | - }, { | |
| 2759 | - key: "getItem", | |
| 2760 | - value: function getItem(key) { | |
| 2761 | - return _superPropGet(BasePrefixStorage, "getItem", this, 3)([BasePrefixStorage.DEFAULT_KEY_PREFIX + key]); | |
| 2762 | - } | |
| 2763 | - }, { | |
| 2764 | - key: "removeItem", | |
| 2765 | - value: function removeItem(key) { | |
| 2766 | - return _superPropGet(BasePrefixStorage, "removeItem", this, 3)([BasePrefixStorage.DEFAULT_KEY_PREFIX + key]); | |
| 2767 | - } | |
| 2768 | - }, { | |
| 2769 | - key: "setItem", | |
| 2770 | - value: function setItem(key, value) { | |
| 2771 | - return _superPropGet(BasePrefixStorage, "setItem", this, 3)([BasePrefixStorage.DEFAULT_KEY_PREFIX + key, value]); | |
| 2772 | - } | |
| 2773 | - }, { | |
| 2774 | - key: "getAll", | |
| 2775 | - value: function getAll() { | |
| 2776 | - var _this2 = this; | |
| 2777 | - var DEFAULT_KEY_PREFIX = BasePrefixStorage.DEFAULT_KEY_PREFIX, | |
| 2778 | - keys = Object.keys(this.provider), | |
| 2779 | - result = {}; | |
| 2780 | - keys.forEach(function (key) { | |
| 2781 | - if (key.startsWith(DEFAULT_KEY_PREFIX)) { | |
| 2782 | - key = key.replace(DEFAULT_KEY_PREFIX, ''); | |
| 2783 | - result[key] = _this2.getItem(key); | |
| 2784 | - } | |
| 2785 | - }); | |
| 2786 | - return result; | |
| 2787 | - } | |
| 2788 | - }]); | |
| 2789 | -}(_baseStorage.default); | |
| 2790 | -(0, _defineProperty2.default)(BasePrefixStorage, "DEFAULT_KEY_PREFIX", 'e_'); | |
| 2791 | - | |
| 2792 | -/***/ }), | |
| 2793 | - | |
| 2794 | -/***/ "../modules/web-cli/assets/js/core/data/storages/base-storage.js": | |
| 2795 | -/*!***********************************************************************!*\ | |
| 2796 | - !*** ../modules/web-cli/assets/js/core/data/storages/base-storage.js ***! | |
| 2797 | - \***********************************************************************/ | |
| 2798 | -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 2799 | - | |
| 2800 | -"use strict"; | |
| 2801 | - | |
| 2802 | - | |
| 2803 | -var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 2804 | -Object.defineProperty(exports, "__esModule", ({ | |
| 2805 | - value: true | |
| 2806 | -})); | |
| 2807 | -exports["default"] = void 0; | |
| 2808 | -var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 2809 | -var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 5402 | +//#endregion | |
| 5403 | +//#region modules/web-cli/assets/js/core/ui-states.js | |
| 2810 | 5404 | /** |
| 2811 | - * TODO: Merge all storage's to one. | |
| 2812 | - * Using this technique give's the ability to use JSDOC from 'window.storage'. | |
| 2813 | - * | |
| 2814 | - * @implements {Storage} | |
| 2815 | - */ | |
| 2816 | -var BaseStorage = exports["default"] = /*#__PURE__*/function () { | |
| 2817 | - /** | |
| 2818 | - * Create storage wrapper. | |
| 2819 | - * | |
| 2820 | - * @param {Storage} provider | |
| 2821 | - */ | |
| 2822 | - function BaseStorage(provider) { | |
| 2823 | - (0, _classCallCheck2.default)(this, BaseStorage); | |
| 2824 | - if (BaseStorage === (this instanceof BaseStorage ? this.constructor : void 0)) { | |
| 2825 | - throw new TypeError('Cannot construct BaseStorage instances directly'); | |
| 2826 | - } | |
| 2827 | - this.provider = provider; | |
| 2828 | - } | |
| 2829 | - return (0, _createClass2.default)(BaseStorage, [{ | |
| 2830 | - key: "clear", | |
| 2831 | - value: function clear() { | |
| 2832 | - return this.provider.clear(); | |
| 2833 | - } | |
| 2834 | - }, { | |
| 2835 | - key: "getItem", | |
| 2836 | - value: function getItem(key) { | |
| 2837 | - var result = this.provider.getItem(key); | |
| 2838 | - if (null !== result) { | |
| 2839 | - return JSON.parse(result); | |
| 2840 | - } | |
| 2841 | - return result; | |
| 2842 | - } | |
| 2843 | - }, { | |
| 2844 | - key: "key", | |
| 2845 | - value: function key(index) { | |
| 2846 | - return this.provider.key(index); | |
| 2847 | - } | |
| 2848 | - }, { | |
| 2849 | - key: "removeItem", | |
| 2850 | - value: function removeItem(key) { | |
| 2851 | - return this.provider.removeItem(key); | |
| 2852 | - } | |
| 2853 | - }, { | |
| 2854 | - key: "setItem", | |
| 2855 | - value: function setItem(key, value) { | |
| 2856 | - return this.provider.setItem(key, JSON.stringify(value)); | |
| 2857 | - } | |
| 2858 | - }, { | |
| 2859 | - key: "getAll", | |
| 2860 | - value: function getAll() { | |
| 2861 | - var _this = this; | |
| 2862 | - var keys = Object.keys(this.provider), | |
| 2863 | - result = {}; | |
| 2864 | - keys.forEach(function (key) { | |
| 2865 | - result[key] = _this.getItem(key); | |
| 2866 | - }); | |
| 2867 | - return result; | |
| 2868 | - } | |
| 2869 | - }]); | |
| 2870 | -}(); | |
| 5405 | + * @typedef {import('./states/ui-state-base')} UiStateBase | |
| 5406 | + */ | |
| 5407 | + var UiStates = /*#__PURE__*/ function() { | |
| 5408 | + /** | |
| 5409 | + * Initialize the State Manager. | |
| 5410 | + * | |
| 5411 | + * @return {void} | |
| 5412 | + */ | |
| 5413 | + function UiStates() { | |
| 5414 | + _classCallCheck(this, UiStates); | |
| 5415 | + this.states = {}; | |
| 5416 | + } | |
| 5417 | + /** | |
| 5418 | + * Register a new state. | |
| 5419 | + * | |
| 5420 | + * @param {UiStateBase} instance - State instance. | |
| 5421 | + */ | |
| 5422 | + return _createClass(UiStates, [ | |
| 5423 | + { | |
| 5424 | + key: "register", | |
| 5425 | + value: function register(instance) { | |
| 5426 | + var stateId = instance.getPrefixedId(); | |
| 5427 | + if (this.states[stateId]) throw "State '".concat(stateId, "' already exists."); | |
| 5428 | + this.states[stateId] = instance; | |
| 5429 | + } | |
| 5430 | + }, | |
| 5431 | + { | |
| 5432 | + key: "getAll", | |
| 5433 | + value: function getAll() { | |
| 5434 | + var states = {}; | |
| 5435 | + Object.entries(this.states).forEach(function(_ref) { | |
| 5436 | + var _ref2 = _slicedToArray(_ref, 2); | |
| 5437 | + var id = _ref2[0]; | |
| 5438 | + var options = _ref2[1].getOptions(); | |
| 5439 | + states[id] = Object.keys(options); | |
| 5440 | + }); | |
| 5441 | + return states; | |
| 5442 | + } | |
| 5443 | + }, | |
| 5444 | + { | |
| 5445 | + key: "get", | |
| 5446 | + value: function get(state) { | |
| 5447 | + if (state) return this.states[state]; | |
| 5448 | + return this.states; | |
| 5449 | + } | |
| 5450 | + }, | |
| 5451 | + { | |
| 5452 | + key: "set", | |
| 5453 | + value: function set(state, value) { | |
| 5454 | + if (!this.get(state)) throw "State '".concat(state, "' doesn't exist."); | |
| 5455 | + var oldValue = this.getCurrent(state); | |
| 5456 | + var classPrefix = "e-ui-state--".concat(state.replaceAll("/", "-")); | |
| 5457 | + var oldStateClass = "".concat(classPrefix, "__").concat(oldValue); | |
| 5458 | + var newStateClass = "".concat(classPrefix, "__").concat(value); | |
| 5459 | + var scopes = this.get(state).getScopes(); | |
| 5460 | + this.get(state).set(value); | |
| 5461 | + scopes.forEach(function(scope) { | |
| 5462 | + scope.classList.remove(oldStateClass); | |
| 5463 | + if (value) scope.classList.add(newStateClass); | |
| 5464 | + var event = new CustomEvent("e-ui-state:".concat(state), { detail: { | |
| 5465 | + oldValue, | |
| 5466 | + newValue: value | |
| 5467 | + } }); | |
| 5468 | + scope.dispatchEvent(event); | |
| 5469 | + }); | |
| 5470 | + } | |
| 5471 | + }, | |
| 5472 | + { | |
| 5473 | + key: "remove", | |
| 5474 | + value: function remove(state) { | |
| 5475 | + this.set(state, ""); | |
| 5476 | + } | |
| 5477 | + }, | |
| 5478 | + { | |
| 5479 | + key: "getCurrent", | |
| 5480 | + value: function getCurrent(state) { | |
| 5481 | + var _this$get; | |
| 5482 | + return (_this$get = this.get(state)) === null || _this$get === void 0 ? void 0 : _this$get.getCurrent(); | |
| 5483 | + } | |
| 5484 | + } | |
| 5485 | + ]); | |
| 5486 | + }(); | |
| 2871 | 5487 | |
| 2872 | -/***/ }), | |
| 5488 | +//#endregion | |
| 5489 | +//#region modules/web-cli/assets/js/modules/hook-base.js | |
| 5490 | + var HookBase = /*#__PURE__*/ function() { | |
| 5491 | + /** | |
| 5492 | + * Function constructor(). | |
| 5493 | + * | |
| 5494 | + * Create callback base. | |
| 5495 | + */ | |
| 5496 | + function HookBase() { | |
| 5497 | + _classCallCheck(this, HookBase); | |
| 5498 | + /** | |
| 5499 | + * Callback type, eg ( hook, event ). | |
| 5500 | + * | |
| 5501 | + * @type {string} | |
| 5502 | + */ | |
| 5503 | + _defineProperty(this, "type", void 0); | |
| 5504 | + /** | |
| 5505 | + * Full command address, that will hook the callback. | |
| 5506 | + * | |
| 5507 | + * @type {string} | |
| 5508 | + */ | |
| 5509 | + _defineProperty(this, "command", void 0); | |
| 5510 | + /** | |
| 5511 | + * Unique id of the callback. | |
| 5512 | + * | |
| 5513 | + * @type {string} | |
| 5514 | + */ | |
| 5515 | + _defineProperty(this, "id", void 0); | |
| 5516 | + this.initialize(); | |
| 5517 | + this.type = this.getType(); | |
| 5518 | + this.command = this.getCommand(); | |
| 5519 | + this.id = this.getId(); | |
| 5520 | + } | |
| 5521 | + /** | |
| 5522 | + * Function initialize(). | |
| 5523 | + * | |
| 5524 | + * Called after creation of the base, used for initialize extras. | |
| 5525 | + * Without expending constructor. | |
| 5526 | + */ | |
| 5527 | + return _createClass(HookBase, [ | |
| 5528 | + { | |
| 5529 | + key: "initialize", | |
| 5530 | + value: function initialize() {} | |
| 5531 | + }, | |
| 5532 | + { | |
| 5533 | + key: "register", | |
| 5534 | + value: function register() { | |
| 5535 | + force_method_implementation_default(); | |
| 5536 | + } | |
| 5537 | + }, | |
| 5538 | + { | |
| 5539 | + key: "getType", | |
| 5540 | + value: function getType() { | |
| 5541 | + force_method_implementation_default(); | |
| 5542 | + } | |
| 5543 | + }, | |
| 5544 | + { | |
| 5545 | + key: "getCommand", | |
| 5546 | + value: function getCommand() { | |
| 5547 | + force_method_implementation_default(); | |
| 5548 | + } | |
| 5549 | + }, | |
| 5550 | + { | |
| 5551 | + key: "getId", | |
| 5552 | + value: function getId() { | |
| 5553 | + force_method_implementation_default(); | |
| 5554 | + } | |
| 5555 | + }, | |
| 5556 | + { | |
| 5557 | + key: "getContainerType", | |
| 5558 | + value: function getContainerType() {} | |
| 5559 | + }, | |
| 5560 | + { | |
| 5561 | + key: "getConditions", | |
| 5562 | + value: function getConditions() { | |
| 5563 | + arguments.length > 0 && arguments[0] !== void 0 && arguments[0]; | |
| 5564 | + arguments.length > 1 && arguments[1]; | |
| 5565 | + return true; | |
| 5566 | + } | |
| 5567 | + }, | |
| 5568 | + { | |
| 5569 | + key: "apply", | |
| 5570 | + value: function apply(args) { | |
| 5571 | + force_method_implementation_default(); | |
| 5572 | + } | |
| 5573 | + }, | |
| 5574 | + { | |
| 5575 | + key: "run", | |
| 5576 | + value: function run() { | |
| 5577 | + var _ref$options = (arguments.length <= 0 ? void 0 : arguments[0]).options; | |
| 5578 | + var options = _ref$options === void 0 ? {} : _ref$options; | |
| 5579 | + if (options.callbacks && false === options.callbacks[this.id]) return true; | |
| 5580 | + if (this.getConditions.apply(this, arguments)) { | |
| 5581 | + if ($e.devTools) $e.devTools.log.callbacks().active(this.type, this.command, this.id); | |
| 5582 | + return this.apply.apply(this, arguments); | |
| 5583 | + } | |
| 5584 | + return true; | |
| 5585 | + } | |
| 5586 | + } | |
| 5587 | + ]); | |
| 5588 | + }(); | |
| 2873 | 5589 | |
| 2874 | -/***/ "../modules/web-cli/assets/js/core/data/storages/local-storage.js": | |
| 2875 | -/*!************************************************************************!*\ | |
| 2876 | - !*** ../modules/web-cli/assets/js/core/data/storages/local-storage.js ***! | |
| 2877 | - \************************************************************************/ | |
| 2878 | -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 5590 | +//#endregion | |
| 5591 | +//#region modules/web-cli/assets/js/modules/hooks/data/base.js | |
| 5592 | + function _callSuper$7(t, o, e) { | |
| 5593 | + return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$7() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); | |
| 5594 | + } | |
| 5595 | + __name(_callSuper$7, "_callSuper"); | |
| 5596 | + function _isNativeReflectConstruct$7() { | |
| 5597 | + try { | |
| 5598 | + var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); | |
| 5599 | + } catch (t) {} | |
| 5600 | + return (_isNativeReflectConstruct$7 = function _isNativeReflectConstruct() { | |
| 5601 | + return !!t; | |
| 5602 | + })(); | |
| 5603 | + } | |
| 5604 | + __name(_isNativeReflectConstruct$7, "_isNativeReflectConstruct"); | |
| 5605 | + var Base$1 = /*#__PURE__*/ function(_HookBase) { | |
| 5606 | + function Base() { | |
| 5607 | + _classCallCheck(this, Base); | |
| 5608 | + return _callSuper$7(this, Base, arguments); | |
| 5609 | + } | |
| 5610 | + _inherits(Base, _HookBase); | |
| 5611 | + return _createClass(Base, [{ | |
| 5612 | + key: "getType", | |
| 5613 | + value: function getType() { | |
| 5614 | + return "data"; | |
| 5615 | + } | |
| 5616 | + }]); | |
| 5617 | + }(HookBase); | |
| 2879 | 5618 | |
| 2880 | -"use strict"; | |
| 5619 | +//#endregion | |
| 5620 | +//#region modules/web-cli/assets/js/modules/hooks/data/after.js | |
| 5621 | + function _callSuper$6(t, o, e) { | |
| 5622 | + return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$6() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); | |
| 5623 | + } | |
| 5624 | + __name(_callSuper$6, "_callSuper"); | |
| 5625 | + function _isNativeReflectConstruct$6() { | |
| 5626 | + try { | |
| 5627 | + var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); | |
| 5628 | + } catch (t) {} | |
| 5629 | + return (_isNativeReflectConstruct$6 = function _isNativeReflectConstruct() { | |
| 5630 | + return !!t; | |
| 5631 | + })(); | |
| 5632 | + } | |
| 5633 | + __name(_isNativeReflectConstruct$6, "_isNativeReflectConstruct"); | |
| 5634 | + var After$1 = /*#__PURE__*/ function(_Base) { | |
| 5635 | + function After() { | |
| 5636 | + _classCallCheck(this, After); | |
| 5637 | + return _callSuper$6(this, After, arguments); | |
| 5638 | + } | |
| 5639 | + _inherits(After, _Base); | |
| 5640 | + return _createClass(After, [{ | |
| 5641 | + key: "register", | |
| 5642 | + value: function register() { | |
| 5643 | + $e.hooks.registerDataAfter(this); | |
| 5644 | + } | |
| 5645 | + }]); | |
| 5646 | + }(Base$1); | |
| 2881 | 5647 | |
| 5648 | +//#endregion | |
| 5649 | +//#region modules/web-cli/assets/js/modules/hooks/data/catch.js | |
| 5650 | + function _callSuper$5(t, o, e) { | |
| 5651 | + return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$5() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); | |
| 5652 | + } | |
| 5653 | + __name(_callSuper$5, "_callSuper"); | |
| 5654 | + function _isNativeReflectConstruct$5() { | |
| 5655 | + try { | |
| 5656 | + var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); | |
| 5657 | + } catch (t) {} | |
| 5658 | + return (_isNativeReflectConstruct$5 = function _isNativeReflectConstruct() { | |
| 5659 | + return !!t; | |
| 5660 | + })(); | |
| 5661 | + } | |
| 5662 | + __name(_isNativeReflectConstruct$5, "_isNativeReflectConstruct"); | |
| 5663 | + var Catch$1 = /*#__PURE__*/ function(_Base) { | |
| 5664 | + function Catch() { | |
| 5665 | + _classCallCheck(this, Catch); | |
| 5666 | + return _callSuper$5(this, Catch, arguments); | |
| 5667 | + } | |
| 5668 | + _inherits(Catch, _Base); | |
| 5669 | + return _createClass(Catch, [{ | |
| 5670 | + key: "register", | |
| 5671 | + value: function register() { | |
| 5672 | + $e.hooks.registerDataCatch(this); | |
| 5673 | + } | |
| 5674 | + }]); | |
| 5675 | + }(Base$1); | |
| 2882 | 5676 | |
| 2883 | -var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 2884 | -Object.defineProperty(exports, "__esModule", ({ | |
| 2885 | - value: true | |
| 2886 | -})); | |
| 2887 | -exports["default"] = void 0; | |
| 2888 | -var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 2889 | -var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 2890 | -var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 2891 | -var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 2892 | -var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 2893 | -var _basePrefixStorage = _interopRequireDefault(__webpack_require__(/*! ./base-prefix-storage */ "../modules/web-cli/assets/js/core/data/storages/base-prefix-storage.js")); | |
| 2894 | -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)); } | |
| 2895 | -function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } | |
| 2896 | -var LocalStorage = exports["default"] = /*#__PURE__*/function (_BasePrefixStorage) { | |
| 2897 | - function LocalStorage() { | |
| 2898 | - (0, _classCallCheck2.default)(this, LocalStorage); | |
| 2899 | - return _callSuper(this, LocalStorage, [localStorage]); | |
| 2900 | - } | |
| 2901 | - (0, _inherits2.default)(LocalStorage, _BasePrefixStorage); | |
| 2902 | - return (0, _createClass2.default)(LocalStorage, [{ | |
| 2903 | - key: "debug", | |
| 2904 | - value: function debug() { | |
| 2905 | - var entries = this.getAll(), | |
| 2906 | - ordered = {}; | |
| 2907 | - Object.keys(entries).sort().forEach(function (key) { | |
| 2908 | - var value = entries[key]; | |
| 2909 | - ordered[key] = value; | |
| 2910 | - }); | |
| 2911 | - return ordered; | |
| 2912 | - } | |
| 2913 | - }]); | |
| 2914 | -}(_basePrefixStorage.default); | |
| 5677 | +//#endregion | |
| 5678 | +//#region modules/web-cli/assets/js/modules/hooks/data/dependency.js | |
| 5679 | + function _callSuper$4(t, o, e) { | |
| 5680 | + return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$4() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); | |
| 5681 | + } | |
| 5682 | + __name(_callSuper$4, "_callSuper"); | |
| 5683 | + function _isNativeReflectConstruct$4() { | |
| 5684 | + try { | |
| 5685 | + var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); | |
| 5686 | + } catch (t) {} | |
| 5687 | + return (_isNativeReflectConstruct$4 = function _isNativeReflectConstruct() { | |
| 5688 | + return !!t; | |
| 5689 | + })(); | |
| 5690 | + } | |
| 5691 | + __name(_isNativeReflectConstruct$4, "_isNativeReflectConstruct"); | |
| 5692 | + var Dependency = /*#__PURE__*/ function(_Base) { | |
| 5693 | + function Dependency() { | |
| 5694 | + _classCallCheck(this, Dependency); | |
| 5695 | + return _callSuper$4(this, Dependency, arguments); | |
| 5696 | + } | |
| 5697 | + _inherits(Dependency, _Base); | |
| 5698 | + return _createClass(Dependency, [{ | |
| 5699 | + key: "register", | |
| 5700 | + value: function register() { | |
| 5701 | + $e.hooks.registerDataDependency(this); | |
| 5702 | + } | |
| 5703 | + }]); | |
| 5704 | + }(Base$1); | |
| 2915 | 5705 | |
| 2916 | -/***/ }), | |
| 5706 | +//#endregion | |
| 5707 | +//#region modules/web-cli/assets/js/modules/hooks/data/index.js | |
| 5708 | + var data_exports = /* @__PURE__ */ __exportAll({ | |
| 5709 | + After: () => After$1, | |
| 5710 | + Base: () => Base$1, | |
| 5711 | + Catch: () => Catch$1, | |
| 5712 | + Dependency: () => Dependency | |
| 5713 | + }); | |
| 2917 | 5714 | |
| 2918 | -/***/ "../modules/web-cli/assets/js/core/hooks.js": | |
| 2919 | -/*!**************************************************!*\ | |
| 2920 | - !*** ../modules/web-cli/assets/js/core/hooks.js ***! | |
| 2921 | - \**************************************************/ | |
| 2922 | -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 5715 | +//#endregion | |
| 5716 | +//#region modules/web-cli/assets/js/modules/hooks/ui/base.js | |
| 5717 | + function _callSuper$3(t, o, e) { | |
| 5718 | + return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$3() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); | |
| 5719 | + } | |
| 5720 | + __name(_callSuper$3, "_callSuper"); | |
| 5721 | + function _isNativeReflectConstruct$3() { | |
| 5722 | + try { | |
| 5723 | + var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); | |
| 5724 | + } catch (t) {} | |
| 5725 | + return (_isNativeReflectConstruct$3 = function _isNativeReflectConstruct() { | |
| 5726 | + return !!t; | |
| 5727 | + })(); | |
| 5728 | + } | |
| 5729 | + __name(_isNativeReflectConstruct$3, "_isNativeReflectConstruct"); | |
| 5730 | + var Base = /*#__PURE__*/ function(_HookBase) { | |
| 5731 | + function Base() { | |
| 5732 | + _classCallCheck(this, Base); | |
| 5733 | + return _callSuper$3(this, Base, arguments); | |
| 5734 | + } | |
| 5735 | + _inherits(Base, _HookBase); | |
| 5736 | + return _createClass(Base, [{ | |
| 5737 | + key: "getType", | |
| 5738 | + value: function getType() { | |
| 5739 | + return "ui"; | |
| 5740 | + } | |
| 5741 | + }]); | |
| 5742 | + }(HookBase); | |
| 2923 | 5743 | |
| 2924 | -"use strict"; | |
| 5744 | +//#endregion | |
| 5745 | +//#region modules/web-cli/assets/js/modules/hooks/ui/after.js | |
| 5746 | + function _callSuper$2(t, o, e) { | |
| 5747 | + return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$2() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); | |
| 5748 | + } | |
| 5749 | + __name(_callSuper$2, "_callSuper"); | |
| 5750 | + function _isNativeReflectConstruct$2() { | |
| 5751 | + try { | |
| 5752 | + var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); | |
| 5753 | + } catch (t) {} | |
| 5754 | + return (_isNativeReflectConstruct$2 = function _isNativeReflectConstruct() { | |
| 5755 | + return !!t; | |
| 5756 | + })(); | |
| 5757 | + } | |
| 5758 | + __name(_isNativeReflectConstruct$2, "_isNativeReflectConstruct"); | |
| 5759 | + var After = /*#__PURE__*/ function(_Base) { | |
| 5760 | + function After() { | |
| 5761 | + _classCallCheck(this, After); | |
| 5762 | + return _callSuper$2(this, After, arguments); | |
| 5763 | + } | |
| 5764 | + _inherits(After, _Base); | |
| 5765 | + return _createClass(After, [{ | |
| 5766 | + key: "register", | |
| 5767 | + value: function register() { | |
| 5768 | + $e.hooks.registerUIAfter(this); | |
| 5769 | + } | |
| 5770 | + }]); | |
| 5771 | + }(Base); | |
| 2925 | 5772 | |
| 5773 | +//#endregion | |
| 5774 | +//#region modules/web-cli/assets/js/modules/hooks/ui/before.js | |
| 5775 | + function _callSuper$1(t, o, e) { | |
| 5776 | + return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$1() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); | |
| 5777 | + } | |
| 5778 | + __name(_callSuper$1, "_callSuper"); | |
| 5779 | + function _isNativeReflectConstruct$1() { | |
| 5780 | + try { | |
| 5781 | + var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); | |
| 5782 | + } catch (t) {} | |
| 5783 | + return (_isNativeReflectConstruct$1 = function _isNativeReflectConstruct() { | |
| 5784 | + return !!t; | |
| 5785 | + })(); | |
| 5786 | + } | |
| 5787 | + __name(_isNativeReflectConstruct$1, "_isNativeReflectConstruct"); | |
| 5788 | + var Before = /*#__PURE__*/ function(_Base) { | |
| 5789 | + function Before() { | |
| 5790 | + _classCallCheck(this, Before); | |
| 5791 | + return _callSuper$1(this, Before, arguments); | |
| 5792 | + } | |
| 5793 | + _inherits(Before, _Base); | |
| 5794 | + return _createClass(Before, [{ | |
| 5795 | + key: "register", | |
| 5796 | + value: function register() { | |
| 5797 | + $e.hooks.registerUIBefore(this); | |
| 5798 | + } | |
| 5799 | + }]); | |
| 5800 | + }(Base); | |
| 2926 | 5801 | |
| 2927 | -var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 2928 | -Object.defineProperty(exports, "__esModule", ({ | |
| 2929 | - value: true | |
| 2930 | -})); | |
| 2931 | -exports["default"] = void 0; | |
| 2932 | -var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 2933 | -var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 2934 | -var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js")); | |
| 2935 | -var _data = _interopRequireDefault(__webpack_require__(/*! ./hooks/data.js */ "../modules/web-cli/assets/js/core/hooks/data.js")); | |
| 2936 | -var _ui = _interopRequireDefault(__webpack_require__(/*! ./hooks/ui.js */ "../modules/web-cli/assets/js/core/hooks/ui.js")); | |
| 2937 | -/** | |
| 2938 | - * @typedef {import('../modules/hook-base')} HookBase | |
| 2939 | - */ | |
| 2940 | -var Hooks = exports["default"] = /*#__PURE__*/function () { | |
| 2941 | - function Hooks() { | |
| 2942 | - (0, _classCallCheck2.default)(this, Hooks); | |
| 2943 | - (0, _defineProperty2.default)(this, "data", new _data.default()); | |
| 2944 | - (0, _defineProperty2.default)(this, "ui", new _ui.default()); | |
| 2945 | - } | |
| 2946 | - return (0, _createClass2.default)(Hooks, [{ | |
| 2947 | - key: "activate", | |
| 2948 | - value: | |
| 2949 | - /** | |
| 2950 | - * Function activate(). | |
| 2951 | - * | |
| 2952 | - * Activate all hooks. | |
| 2953 | - */ | |
| 2954 | - function activate() { | |
| 2955 | - this.getTypes().forEach(function (hooksType) { | |
| 2956 | - hooksType.activate(); | |
| 2957 | - }); | |
| 2958 | - } | |
| 5802 | +//#endregion | |
| 5803 | +//#region modules/web-cli/assets/js/modules/hooks/ui/catch.js | |
| 5804 | + function _callSuper(t, o, e) { | |
| 5805 | + return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); | |
| 5806 | + } | |
| 5807 | + function _isNativeReflectConstruct() { | |
| 5808 | + try { | |
| 5809 | + var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); | |
| 5810 | + } catch (t) {} | |
| 5811 | + return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { | |
| 5812 | + return !!t; | |
| 5813 | + })(); | |
| 5814 | + } | |
| 5815 | + var Catch = /*#__PURE__*/ function(_Base) { | |
| 5816 | + function Catch() { | |
| 5817 | + _classCallCheck(this, Catch); | |
| 5818 | + return _callSuper(this, Catch, arguments); | |
| 5819 | + } | |
| 5820 | + _inherits(Catch, _Base); | |
| 5821 | + return _createClass(Catch, [{ | |
| 5822 | + key: "register", | |
| 5823 | + value: function register() { | |
| 5824 | + $e.hooks.registerUICatch(this); | |
| 5825 | + } | |
| 5826 | + }]); | |
| 5827 | + }(Base); | |
| 2959 | 5828 | |
| 2960 | - /** | |
| 2961 | - * Function deactivate(). | |
| 2962 | - * | |
| 2963 | - * Deactivate all hooks. | |
| 2964 | - */ | |
| 2965 | - }, { | |
| 2966 | - key: "deactivate", | |
| 2967 | - value: function deactivate() { | |
| 2968 | - this.getTypes().forEach(function (hooksType) { | |
| 2969 | - hooksType.deactivate(); | |
| 2970 | - }); | |
| 2971 | - } | |
| 2972 | - }, { | |
| 2973 | - key: "getAll", | |
| 2974 | - value: function getAll() { | |
| 2975 | - var flat = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; | |
| 2976 | - var result = {}; | |
| 2977 | - this.getTypes().forEach(function (hooksType) { | |
| 2978 | - result[hooksType.getType()] = hooksType.getAll(flat); | |
| 2979 | - }); | |
| 2980 | - return result; | |
| 2981 | - } | |
| 2982 | - }, { | |
| 2983 | - key: "getTypes", | |
| 2984 | - value: function getTypes() { | |
| 2985 | - return [this.data, this.ui]; | |
| 2986 | - } | |
| 2987 | - }, { | |
| 2988 | - key: "getType", | |
| 2989 | - value: function getType(type) { | |
| 2990 | - return this.getTypes().find(function (hooks) { | |
| 2991 | - return type === hooks.getType(); | |
| 2992 | - }); | |
| 2993 | - } | |
| 5829 | +//#endregion | |
| 5830 | +//#region modules/web-cli/assets/js/modules/hooks/ui/index.js | |
| 5831 | + var ui_exports = /* @__PURE__ */ __exportAll({ | |
| 5832 | + After: () => After, | |
| 5833 | + Base: () => Base, | |
| 5834 | + Before: () => Before, | |
| 5835 | + Catch: () => Catch | |
| 5836 | + }); | |
| 2994 | 5837 | |
| 2995 | - /** | |
| 2996 | - * Function register(). | |
| 2997 | - * | |
| 2998 | - * Register hook. | |
| 2999 | - * | |
| 3000 | - * @param {string} type | |
| 3001 | - * @param {string} event | |
| 3002 | - * @param {HookBase} instance | |
| 3003 | - * | |
| 3004 | - * @return {{}} Created callback | |
| 3005 | - */ | |
| 3006 | - }, { | |
| 3007 | - key: "register", | |
| 3008 | - value: function register(type, event, instance) { | |
| 3009 | - return this.getType(type).register(event, instance); | |
| 3010 | - } | |
| 5838 | +//#endregion | |
| 5839 | +//#region modules/web-cli/assets/js/api.js | |
| 5840 | + var API = /*#__PURE__*/ function() { | |
| 5841 | + /** | |
| 5842 | + * Function constructor(). | |
| 5843 | + * | |
| 5844 | + * Create's 'elementor' api. | |
| 5845 | + */ | |
| 5846 | + function API() { | |
| 5847 | + _classCallCheck(this, API); | |
| 5848 | + this.components = new _default(); | |
| 5849 | + this.commands = new Commands(); | |
| 5850 | + this.commandsInternal = new CommandsInternal(); | |
| 5851 | + this.hooks = new Hooks(); | |
| 5852 | + this.routes = new Routes(); | |
| 5853 | + this.shortcuts = new Shortcuts(jQuery(window)); | |
| 5854 | + this.data = new Data$1(); | |
| 5855 | + this.store = new Store(); | |
| 5856 | + this.uiStates = new UiStates(); | |
| 5857 | + this.modules = { | |
| 5858 | + CommandBase, | |
| 5859 | + CommandInternalBase, | |
| 5860 | + CommandData, | |
| 5861 | + ComponentBase, | |
| 5862 | + ComponentModalBase, | |
| 5863 | + HookBreak, | |
| 5864 | + hookData: data_exports, | |
| 5865 | + hookUI: ui_exports | |
| 5866 | + }; | |
| 5867 | + this.extras = { hashCommands: new HashCommands() }; | |
| 5868 | + this.bc = new BackwardsCompatibility(); | |
| 5869 | + } | |
| 5870 | + /** | |
| 5871 | + * Function run(). | |
| 5872 | + * | |
| 5873 | + * Alias of `$e.commands.run()`. | |
| 5874 | + * | |
| 5875 | + * @param {string} command | |
| 5876 | + * @param {*} [args={}] | |
| 5877 | + * | |
| 5878 | + * @return {*} result | |
| 5879 | + */ | |
| 5880 | + return _createClass(API, [ | |
| 5881 | + { | |
| 5882 | + key: "run", | |
| 5883 | + value: function run(command) { | |
| 5884 | + var args = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; | |
| 5885 | + return $e.commands.run(command, args); | |
| 5886 | + } | |
| 5887 | + }, | |
| 5888 | + { | |
| 5889 | + key: "internal", | |
| 5890 | + value: function internal(command) { | |
| 5891 | + var args = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; | |
| 5892 | + return $e.commandsInternal.run(command, args); | |
| 5893 | + } | |
| 5894 | + }, | |
| 5895 | + { | |
| 5896 | + key: "route", | |
| 5897 | + value: function route(_route) { | |
| 5898 | + var args = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; | |
| 5899 | + var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : { history: true }; | |
| 5900 | + return $e.routes.to(_route, args, options); | |
| 5901 | + } | |
| 5902 | + } | |
| 5903 | + ]); | |
| 5904 | + }(); | |
| 3011 | 5905 | |
| 3012 | - /** | |
| 3013 | - * Function run(). | |
| 3014 | - * | |
| 3015 | - * Run's a hook. | |
| 3016 | - * | |
| 3017 | - * @param {string} type | |
| 3018 | - * @param {string} event | |
| 3019 | - * @param {string} command | |
| 3020 | - * @param {{}} args | |
| 3021 | - * @param {*} result | |
| 3022 | - * | |
| 3023 | - * @return {boolean} result | |
| 3024 | - */ | |
| 3025 | - }, { | |
| 3026 | - key: "run", | |
| 3027 | - value: function run(type, event, command, args) { | |
| 3028 | - var result = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : undefined; | |
| 3029 | - return this.getType(type).run(event, command, args, result); | |
| 3030 | - } | |
| 5906 | +//#endregion | |
| 5907 | +//#region modules/web-cli/assets/js/index.js | |
| 5908 | + window.$e = new API(); | |
| 3031 | 5909 | |
| 3032 | - /** | |
| 3033 | - * Function registerDataAfter(). | |
| 3034 | - * | |
| 3035 | - * Register data hook that's run after the command. | |
| 3036 | - * | |
| 3037 | - * @param {HookBase} instance | |
| 3038 | - * | |
| 3039 | - * @return {{}} callback | |
| 3040 | - */ | |
| 3041 | - }, { | |
| 3042 | - key: "registerDataAfter", | |
| 3043 | - value: function registerDataAfter(instance) { | |
| 3044 | - return this.register('data', 'after', instance); | |
| 3045 | - } | |
| 3046 | - | |
| 3047 | - /** | |
| 3048 | - * Function registerDataCatch(). | |
| 3049 | - * | |
| 3050 | - * Register data hook that's run when the command fails. | |
| 3051 | - * | |
| 3052 | - * @param {HookBase} instance | |
| 3053 | - * | |
| 3054 | - * @return {{}} callback | |
| 3055 | - */ | |
| 3056 | - }, { | |
| 3057 | - key: "registerDataCatch", | |
| 3058 | - value: function registerDataCatch(instance) { | |
| 3059 | - return this.register('data', 'catch', instance); | |
| 3060 | - } | |
| 3061 | - | |
| 3062 | - /** | |
| 3063 | - * Function registerDataDependency(). | |
| 3064 | - * | |
| 3065 | - * Register data hook that's run before the command as dependency. | |
| 3066 | - * | |
| 3067 | - * @param {HookBase} instance | |
| 3068 | - * | |
| 3069 | - * @return {{}} callback | |
| 3070 | - */ | |
| 3071 | - }, { | |
| 3072 | - key: "registerDataDependency", | |
| 3073 | - value: function registerDataDependency(instance) { | |
| 3074 | - return this.register('data', 'dependency', instance); | |
| 3075 | - } | |
| 3076 | - | |
| 3077 | - /** | |
| 3078 | - * Function registerUIAfter(). | |
| 3079 | - * | |
| 3080 | - * Register UI hook that's run after the commands run. | |
| 3081 | - * | |
| 3082 | - * @param {HookBase} instance | |
| 3083 | - * | |
| 3084 | - * @return {{}} callback | |
| 3085 | - */ | |
| 3086 | - }, { | |
| 3087 | - key: "registerUIAfter", | |
| 3088 | - value: function registerUIAfter(instance) { | |
| 3089 | - return this.register('ui', 'after', instance); | |
| 3090 | - } | |
| 3091 | - | |
| 3092 | - /** | |
| 3093 | - * Function registerUICatch(). | |
| 3094 | - * | |
| 3095 | - * Register UI hook that's run when the command fails. | |
| 3096 | - * | |
| 3097 | - * @param {HookBase} instance | |
| 3098 | - * | |
| 3099 | - * @return {{}} callback | |
| 3100 | - */ | |
| 3101 | - }, { | |
| 3102 | - key: "registerUICatch", | |
| 3103 | - value: function registerUICatch(instance) { | |
| 3104 | - return this.register('ui', 'catch', instance); | |
| 3105 | - } | |
| 3106 | - | |
| 3107 | - /** | |
| 3108 | - * Function registerUIBefore(). | |
| 3109 | - * | |
| 3110 | - * Register UI hook that's run before the command. | |
| 3111 | - * | |
| 3112 | - * @param {HookBase} instance | |
| 3113 | - * | |
| 3114 | - * @return {{}} callback | |
| 3115 | - */ | |
| 3116 | - }, { | |
| 3117 | - key: "registerUIBefore", | |
| 3118 | - value: function registerUIBefore(instance) { | |
| 3119 | - return this.register('ui', 'before', instance); | |
| 3120 | - } | |
| 3121 | - | |
| 3122 | - /** | |
| 3123 | - * Function runDataAfter(). | |
| 3124 | - * | |
| 3125 | - * Run data hook that's run after the command. | |
| 3126 | - * | |
| 3127 | - * @param {string} command | |
| 3128 | - * @param {{}} args | |
| 3129 | - * @param {*} result | |
| 3130 | - * | |
| 3131 | - * @return {boolean} result | |
| 3132 | - */ | |
| 3133 | - }, { | |
| 3134 | - key: "runDataAfter", | |
| 3135 | - value: function runDataAfter(command, args, result) { | |
| 3136 | - return this.run('data', 'after', command, args, result); | |
| 3137 | - } | |
| 3138 | - | |
| 3139 | - /** | |
| 3140 | - * Function runDataCatch(). | |
| 3141 | - * | |
| 3142 | - * Run data hook that's run when the command fails. | |
| 3143 | - * | |
| 3144 | - * @param {string} command | |
| 3145 | - * @param {{}} args | |
| 3146 | - * @param {*} error | |
| 3147 | - * | |
| 3148 | - * @return {boolean} result | |
| 3149 | - */ | |
| 3150 | - }, { | |
| 3151 | - key: "runDataCatch", | |
| 3152 | - value: function runDataCatch(command, args, error) { | |
| 3153 | - return this.run('data', 'catch', command, args, error); | |
| 3154 | - } | |
| 3155 | - | |
| 3156 | - /** | |
| 3157 | - * Function runDataDependency(). | |
| 3158 | - * | |
| 3159 | - * Run data hook that's run before the command as dependency. | |
| 3160 | - * | |
| 3161 | - * @param {string} command | |
| 3162 | - * @param {{}} args | |
| 3163 | - * | |
| 3164 | - * @return {boolean} result | |
| 3165 | - */ | |
| 3166 | - }, { | |
| 3167 | - key: "runDataDependency", | |
| 3168 | - value: function runDataDependency(command, args) { | |
| 3169 | - return this.run('data', 'dependency', command, args); | |
| 3170 | - } | |
| 3171 | - | |
| 3172 | - /** | |
| 3173 | - * Function runUIAfter(). | |
| 3174 | - * | |
| 3175 | - * Run UI hook that's run after the commands run. | |
| 3176 | - * | |
| 3177 | - * @param {string} command | |
| 3178 | - * @param {{}} args | |
| 3179 | - * @param {*} result | |
| 3180 | - * | |
| 3181 | - * @return {boolean} result | |
| 3182 | - */ | |
| 3183 | - }, { | |
| 3184 | - key: "runUIAfter", | |
| 3185 | - value: function runUIAfter(command, args, result) { | |
| 3186 | - return this.run('ui', 'after', command, args, result); | |
| 3187 | - } | |
| 3188 | - | |
| 3189 | - /** | |
| 3190 | - * Function runUICatch(). | |
| 3191 | - * | |
| 3192 | - * Run UI hook that's run when the command fails. | |
| 3193 | - * | |
| 3194 | - * @param {string} command | |
| 3195 | - * @param {{}} args | |
| 3196 | - * @param {*} e | |
| 3197 | - * | |
| 3198 | - * @return {boolean} result | |
| 3199 | - */ | |
| 3200 | - }, { | |
| 3201 | - key: "runUICatch", | |
| 3202 | - value: function runUICatch(command, args, e) { | |
| 3203 | - return this.run('ui', 'catch', command, args, e); | |
| 3204 | - } | |
| 3205 | - | |
| 3206 | - /** | |
| 3207 | - * Function runUIBefore(). | |
| 3208 | - * | |
| 3209 | - * Run UI hook that's run before the command. | |
| 3210 | - * | |
| 3211 | - * @param {string} command | |
| 3212 | - * @param {{}} args | |
| 3213 | - * | |
| 3214 | - * @return {boolean} result | |
| 3215 | - */ | |
| 3216 | - }, { | |
| 3217 | - key: "runUIBefore", | |
| 3218 | - value: function runUIBefore(command, args) { | |
| 3219 | - return this.run('ui', 'before', command, args); | |
| 3220 | - } | |
| 3221 | - }]); | |
| 3222 | -}(); | |
| 3223 | - | |
| 3224 | -/***/ }), | |
| 3225 | - | |
| 3226 | -/***/ "../modules/web-cli/assets/js/core/hooks/base.js": | |
| 3227 | -/*!*******************************************************!*\ | |
| 3228 | - !*** ../modules/web-cli/assets/js/core/hooks/base.js ***! | |
| 3229 | - \*******************************************************/ | |
| 3230 | -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 3231 | - | |
| 3232 | -"use strict"; | |
| 3233 | - | |
| 3234 | - | |
| 3235 | -var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 3236 | -Object.defineProperty(exports, "__esModule", ({ | |
| 3237 | - value: true | |
| 3238 | -})); | |
| 3239 | -exports["default"] = void 0; | |
| 3240 | -var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 3241 | -var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 3242 | -var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 3243 | -var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 3244 | -var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 3245 | -var _console = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/console */ "../modules/web-cli/assets/js/utils/console.js")); | |
| 3246 | -var _module = _interopRequireDefault(__webpack_require__(/*! elementor-assets-js/modules/imports/module.js */ "../assets/dev/js/modules/imports/module.js")); | |
| 3247 | -var _forceMethodImplementation = _interopRequireDefault(__webpack_require__(/*! ../../utils/force-method-implementation */ "../modules/web-cli/assets/js/utils/force-method-implementation.js")); | |
| 3248 | -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)); } | |
| 3249 | -function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } | |
| 3250 | -/** | |
| 3251 | - * @typedef {import('../../modules/hook-base')} HookBase | |
| 3252 | - */ | |
| 3253 | -var HooksBase = exports["default"] = /*#__PURE__*/function (_Module) { | |
| 3254 | - /** | |
| 3255 | - * Function constructor(). | |
| 3256 | - * | |
| 3257 | - * Create hooks base. | |
| 3258 | - * | |
| 3259 | - * @param {{}} args | |
| 3260 | - */ | |
| 3261 | - function HooksBase() { | |
| 3262 | - var _this; | |
| 3263 | - (0, _classCallCheck2.default)(this, HooksBase); | |
| 3264 | - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { | |
| 3265 | - args[_key] = arguments[_key]; | |
| 3266 | - } | |
| 3267 | - _this = _callSuper(this, HooksBase, [].concat(args)); | |
| 3268 | - | |
| 3269 | - /** | |
| 3270 | - * Current command. | |
| 3271 | - * | |
| 3272 | - * @type {string} | |
| 3273 | - */ | |
| 3274 | - _this.current = ''; | |
| 3275 | - | |
| 3276 | - /** | |
| 3277 | - * Array of ids which in use. | |
| 3278 | - * | |
| 3279 | - * @type {Array} | |
| 3280 | - */ | |
| 3281 | - _this.usedIds = []; | |
| 3282 | - | |
| 3283 | - /** | |
| 3284 | - * Object of callbacks that was bound by container type. | |
| 3285 | - * | |
| 3286 | - * @type {{}} | |
| 3287 | - */ | |
| 3288 | - _this.callbacks = { | |
| 3289 | - after: {}, | |
| 3290 | - catch: {} | |
| 3291 | - }; | |
| 3292 | - | |
| 3293 | - /** | |
| 3294 | - * Object of depth. | |
| 3295 | - * | |
| 3296 | - * @type {{}} | |
| 3297 | - */ | |
| 3298 | - _this.depth = { | |
| 3299 | - after: {}, | |
| 3300 | - catch: {} | |
| 3301 | - }; | |
| 3302 | - _this.callbacksFlatList = {}; | |
| 3303 | - return _this; | |
| 3304 | - } | |
| 3305 | - (0, _inherits2.default)(HooksBase, _Module); | |
| 3306 | - return (0, _createClass2.default)(HooksBase, [{ | |
| 3307 | - key: "activate", | |
| 3308 | - value: function activate() { | |
| 3309 | - Object.values(this.getAll(true)).forEach(function (callback) { | |
| 3310 | - callback.activate(); | |
| 3311 | - }); | |
| 3312 | - } | |
| 3313 | - }, { | |
| 3314 | - key: "deactivate", | |
| 3315 | - value: function deactivate() { | |
| 3316 | - Object.values(this.getAll(true)).forEach(function (callback) { | |
| 3317 | - callback.deactivate(); | |
| 3318 | - }); | |
| 3319 | - } | |
| 3320 | - | |
| 3321 | - // eslint-disable-next-line jsdoc/require-returns-check | |
| 3322 | - /** | |
| 3323 | - * Function getType(). | |
| 3324 | - * | |
| 3325 | - * Returns type eg: ( event, hook, etc ... ). | |
| 3326 | - * | |
| 3327 | - * @return {string} type | |
| 3328 | - */ | |
| 3329 | - }, { | |
| 3330 | - key: "getType", | |
| 3331 | - value: function getType() { | |
| 3332 | - (0, _forceMethodImplementation.default)(); | |
| 3333 | - } | |
| 3334 | - }, { | |
| 3335 | - key: "get", | |
| 3336 | - value: function get(id) { | |
| 3337 | - return this.callbacksFlatList[id]; | |
| 3338 | - } | |
| 3339 | - | |
| 3340 | - /** | |
| 3341 | - * Function getAll(). | |
| 3342 | - * | |
| 3343 | - * Return all possible callbacks. | |
| 3344 | - * | |
| 3345 | - * @param {boolean} flat | |
| 3346 | - * | |
| 3347 | - * @return {{}} all callbacks | |
| 3348 | - */ | |
| 3349 | - }, { | |
| 3350 | - key: "getAll", | |
| 3351 | - value: function getAll() { | |
| 3352 | - var _this2 = this; | |
| 3353 | - var flat = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false; | |
| 3354 | - if (flat) { | |
| 3355 | - return this.callbacksFlatList; | |
| 3356 | - } | |
| 3357 | - var result = {}; | |
| 3358 | - Object.keys(this.callbacks).forEach(function (event) { | |
| 3359 | - if (!result[event]) { | |
| 3360 | - result[event] = []; | |
| 3361 | - } | |
| 3362 | - Object.keys(_this2.callbacks[event]).forEach(function (command) { | |
| 3363 | - result[event].push({ | |
| 3364 | - command: command, | |
| 3365 | - callbacks: _this2.callbacks[event][command] | |
| 3366 | - }); | |
| 3367 | - }); | |
| 3368 | - }); | |
| 3369 | - return result; | |
| 3370 | - } | |
| 3371 | - | |
| 3372 | - /** | |
| 3373 | - * Function getCurrent(); | |
| 3374 | - * | |
| 3375 | - * Return current command. | |
| 3376 | - * | |
| 3377 | - * @return {string} current command | |
| 3378 | - */ | |
| 3379 | - }, { | |
| 3380 | - key: "getCurrent", | |
| 3381 | - value: function getCurrent() { | |
| 3382 | - return this.current; | |
| 3383 | - } | |
| 3384 | - | |
| 3385 | - /** | |
| 3386 | - * Function getUsedIds(). | |
| 3387 | - * | |
| 3388 | - * Returns the current used ids. | |
| 3389 | - * | |
| 3390 | - * @return {Array} used IDs | |
| 3391 | - */ | |
| 3392 | - }, { | |
| 3393 | - key: "getUsedIds", | |
| 3394 | - value: function getUsedIds() { | |
| 3395 | - return this.usedIds; | |
| 3396 | - } | |
| 3397 | - | |
| 3398 | - /** | |
| 3399 | - * Function getCallbacks(). | |
| 3400 | - * | |
| 3401 | - * Get available callbacks for specific event and command. | |
| 3402 | - * | |
| 3403 | - * @param {string} event | |
| 3404 | - * @param {string} command | |
| 3405 | - * @param {*} args | |
| 3406 | - * @return {(Array | boolean)} callbacks | |
| 3407 | - */ | |
| 3408 | - }, { | |
| 3409 | - key: "getCallbacks", | |
| 3410 | - value: function getCallbacks(event, command, args) { | |
| 3411 | - var _args$containers = args.containers, | |
| 3412 | - containers = _args$containers === void 0 ? [args.container] : _args$containers, | |
| 3413 | - containerType = containers[0] ? containers[0].type : false; | |
| 3414 | - var callbacks = []; | |
| 3415 | - if (this.callbacks[event] && this.callbacks[event][command]) { | |
| 3416 | - if (containerType && this.callbacks[event][command][containerType]) { | |
| 3417 | - callbacks = callbacks.concat(this.callbacks[event][command][containerType]); | |
| 3418 | - } | |
| 3419 | - if (this.callbacks[event][command].all) { | |
| 3420 | - callbacks = callbacks.concat(this.callbacks[event][command].all); | |
| 3421 | - } | |
| 3422 | - } | |
| 3423 | - if (callbacks.length) { | |
| 3424 | - return callbacks; | |
| 3425 | - } | |
| 3426 | - return false; | |
| 3427 | - } | |
| 3428 | - | |
| 3429 | - /** | |
| 3430 | - * Function checkEvent(). | |
| 3431 | - * | |
| 3432 | - * Validate if the event is available. | |
| 3433 | - * | |
| 3434 | - * @param {string} event | |
| 3435 | - */ | |
| 3436 | - }, { | |
| 3437 | - key: "checkEvent", | |
| 3438 | - value: function checkEvent(event) { | |
| 3439 | - if (-1 === Object.keys(this.callbacks).indexOf(event)) { | |
| 3440 | - throw Error("".concat(this.getType(), ": '").concat(event, "' is not available.")); | |
| 3441 | - } | |
| 3442 | - } | |
| 3443 | - | |
| 3444 | - /** | |
| 3445 | - * Function checkInstance(). | |
| 3446 | - * | |
| 3447 | - * Validate given instance. | |
| 3448 | - * | |
| 3449 | - * @param {HookBase} instance | |
| 3450 | - */ | |
| 3451 | - }, { | |
| 3452 | - key: "checkInstance", | |
| 3453 | - value: function checkInstance(instance) { | |
| 3454 | - if (instance.getType() !== this.getType()) { | |
| 3455 | - throw new Error("invalid instance, please use: 'elementor-api/modules/hook-base.js'. "); | |
| 3456 | - } | |
| 3457 | - } | |
| 3458 | - | |
| 3459 | - /** | |
| 3460 | - * Function checkId(). | |
| 3461 | - * | |
| 3462 | - * Validate if the id is not used before. | |
| 3463 | - * | |
| 3464 | - * @param {string} id | |
| 3465 | - */ | |
| 3466 | - }, { | |
| 3467 | - key: "checkId", | |
| 3468 | - value: function checkId(id) { | |
| 3469 | - if (-1 !== this.usedIds.indexOf(id)) { | |
| 3470 | - throw Error("id: '".concat(id, "' is already in use.")); | |
| 3471 | - } | |
| 3472 | - } | |
| 3473 | - | |
| 3474 | - /** | |
| 3475 | - * Function shouldRun(). | |
| 3476 | - * | |
| 3477 | - * Determine if the event should run. | |
| 3478 | - * | |
| 3479 | - * @param {Array} callbacks | |
| 3480 | - * | |
| 3481 | - * @return {boolean} true if there are callbacks, otherwise false | |
| 3482 | - * | |
| 3483 | - * @throws {Error} | |
| 3484 | - */ | |
| 3485 | - }, { | |
| 3486 | - key: "shouldRun", | |
| 3487 | - value: function shouldRun(callbacks) { | |
| 3488 | - return !!callbacks && callbacks.length; | |
| 3489 | - } | |
| 3490 | - | |
| 3491 | - /** | |
| 3492 | - * Function register(). | |
| 3493 | - * | |
| 3494 | - * Register the callback instance. | |
| 3495 | - * | |
| 3496 | - * @param {string} event | |
| 3497 | - * @param {HookBase} instance | |
| 3498 | - * | |
| 3499 | - * @return {{}} Created callback | |
| 3500 | - */ | |
| 3501 | - }, { | |
| 3502 | - key: "register", | |
| 3503 | - value: function register(event, instance) { | |
| 3504 | - var command = instance.getCommand(), | |
| 3505 | - id = instance.getId(), | |
| 3506 | - containerType = instance.getContainerType(); | |
| 3507 | - this.checkEvent(event); | |
| 3508 | - this.checkInstance(instance); | |
| 3509 | - this.checkId(id); | |
| 3510 | - return this.registerCallback(id, event, command, instance, containerType); | |
| 3511 | - } | |
| 3512 | - | |
| 3513 | - /** | |
| 3514 | - * Function registerCallback(). | |
| 3515 | - * | |
| 3516 | - * Register callback. | |
| 3517 | - * | |
| 3518 | - * @param {string} id | |
| 3519 | - * @param {string} event | |
| 3520 | - * @param {string} command | |
| 3521 | - * @param {HookBase} instance | |
| 3522 | - * @param {string} containerType | |
| 3523 | - * | |
| 3524 | - * TODO: Consider replace with typedef. | |
| 3525 | - * @return {{callback: *, id: *, isActive: boolean}} callback | |
| 3526 | - */ | |
| 3527 | - }, { | |
| 3528 | - key: "registerCallback", | |
| 3529 | - value: function registerCallback(id, event, command, instance, containerType) { | |
| 3530 | - if (!this.callbacks[event][command]) { | |
| 3531 | - this.callbacks[event][command] = []; | |
| 3532 | - } | |
| 3533 | - | |
| 3534 | - // Save used id(s). | |
| 3535 | - this.usedIds.push(id); | |
| 3536 | - if (!this.callbacks[event][command]) { | |
| 3537 | - this.callbacks[event][command] = {}; | |
| 3538 | - } | |
| 3539 | - | |
| 3540 | - // TODO: Create HookCallback class/type. | |
| 3541 | - var callback = { | |
| 3542 | - id: id, | |
| 3543 | - callback: instance.run.bind(instance), | |
| 3544 | - isActive: true, | |
| 3545 | - activate: function activate() { | |
| 3546 | - this.isActive = true; | |
| 3547 | - }, | |
| 3548 | - deactivate: function deactivate() { | |
| 3549 | - this.isActive = false; | |
| 3550 | - } | |
| 3551 | - }; | |
| 3552 | - if (containerType) { | |
| 3553 | - if (!this.callbacks[event][command][containerType]) { | |
| 3554 | - this.callbacks[event][command][containerType] = []; | |
| 3555 | - } | |
| 3556 | - this.callbacks[event][command][containerType].push(callback); | |
| 3557 | - } else { | |
| 3558 | - if (!this.callbacks[event][command].all) { | |
| 3559 | - this.callbacks[event][command].all = []; | |
| 3560 | - } | |
| 3561 | - this.callbacks[event][command].all.push(callback); | |
| 3562 | - } | |
| 3563 | - this.callbacksFlatList[callback.id] = callback; | |
| 3564 | - return callback; | |
| 3565 | - } | |
| 3566 | - | |
| 3567 | - /** | |
| 3568 | - * Function run(). | |
| 3569 | - * | |
| 3570 | - * Run the callbacks. | |
| 3571 | - * | |
| 3572 | - * @param {string} event | |
| 3573 | - * @param {string} command | |
| 3574 | - * @param {{}} args | |
| 3575 | - * @param {*} result | |
| 3576 | - * | |
| 3577 | - * @return {*} results | |
| 3578 | - */ | |
| 3579 | - }, { | |
| 3580 | - key: "run", | |
| 3581 | - value: function run(event, command, args) { | |
| 3582 | - var result = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : undefined; | |
| 3583 | - var callbacks = this.getCallbacks(event, command, args); | |
| 3584 | - if (this.shouldRun(callbacks)) { | |
| 3585 | - this.current = command; | |
| 3586 | - this.onRun(command, args, event); | |
| 3587 | - return this.runCallbacks(event, command, callbacks, args, result); | |
| 3588 | - } | |
| 3589 | - return false; | |
| 3590 | - } | |
| 3591 | - | |
| 3592 | - /** | |
| 3593 | - * Function runCallbacks(). | |
| 3594 | - * | |
| 3595 | - * Run's the given callbacks. | |
| 3596 | - * | |
| 3597 | - * @param {string} event | |
| 3598 | - * @param {string} command | |
| 3599 | - * @param {Array} callbacks | |
| 3600 | - * @param {{}} args | |
| 3601 | - * @param {[]} result | |
| 3602 | - */ | |
| 3603 | - }, { | |
| 3604 | - key: "runCallbacks", | |
| 3605 | - value: function runCallbacks(event, command, callbacks, args, result) { | |
| 3606 | - var callbacksResult = []; | |
| 3607 | - for (var i in callbacks) { | |
| 3608 | - var callback = callbacks[i]; | |
| 3609 | - if (!callback.isActive) { | |
| 3610 | - continue; | |
| 3611 | - } | |
| 3612 | - | |
| 3613 | - // If not exist, set zero. | |
| 3614 | - if (undefined === this.depth[event][callback.id]) { | |
| 3615 | - this.depth[event][callback.id] = 0; | |
| 3616 | - } | |
| 3617 | - this.depth[event][callback.id]++; | |
| 3618 | - | |
| 3619 | - // Prevent recursive hooks. | |
| 3620 | - if (1 === this.depth[event][callback.id]) { | |
| 3621 | - this.onCallback(command, args, event, callback.id); | |
| 3622 | - try { | |
| 3623 | - var callbackResult = this.runCallback(event, callback, args, result); | |
| 3624 | - if (!callbackResult) { | |
| 3625 | - throw Error("Callback failed, event: '".concat(event, "'")); | |
| 3626 | - } | |
| 3627 | - callbacksResult.push(callbackResult); | |
| 3628 | - } catch (e) { | |
| 3629 | - // If its 'Hook-Break' then parent `try {}` will handle it. | |
| 3630 | - if (e instanceof $e.modules.HookBreak) { | |
| 3631 | - throw e; | |
| 3632 | - } | |
| 3633 | - _console.default.error(e); | |
| 3634 | - } | |
| 3635 | - } | |
| 3636 | - this.depth[event][callback.id]--; | |
| 3637 | - } | |
| 3638 | - return callbacksResult; | |
| 3639 | - } | |
| 3640 | - | |
| 3641 | - // eslint-disable-next-line jsdoc/require-returns-check | |
| 3642 | - /** | |
| 3643 | - * Function runCallback(). | |
| 3644 | - * | |
| 3645 | - * Run's the given callback. | |
| 3646 | - * | |
| 3647 | - * @param {string} event | |
| 3648 | - * @param {{}} callback | |
| 3649 | - * @param {{}} args | |
| 3650 | - * @param {*} result | |
| 3651 | - * | |
| 3652 | - * @return {*} results | |
| 3653 | - * | |
| 3654 | - * @throws {Error} | |
| 3655 | - */ | |
| 3656 | - }, { | |
| 3657 | - key: "runCallback", | |
| 3658 | - value: function runCallback(event, callback, args, result) { | |
| 3659 | - // eslint-disable-line no-unused-vars | |
| 3660 | - (0, _forceMethodImplementation.default)(); | |
| 3661 | - } | |
| 3662 | - | |
| 3663 | - /** | |
| 3664 | - * Function onRun(). | |
| 3665 | - * | |
| 3666 | - * Called before run a set of callbacks. | |
| 3667 | - * | |
| 3668 | - * @param {string} command | |
| 3669 | - * @param {{}} args | |
| 3670 | - * @param {string} event | |
| 3671 | - * | |
| 3672 | - * @throws {Error} | |
| 3673 | - */ | |
| 3674 | - }, { | |
| 3675 | - key: "onRun", | |
| 3676 | - value: function onRun(command, args, event) { | |
| 3677 | - // eslint-disable-line no-unused-vars | |
| 3678 | - (0, _forceMethodImplementation.default)(); | |
| 3679 | - } | |
| 3680 | - | |
| 3681 | - /** | |
| 3682 | - * Function onCallback(). | |
| 3683 | - * | |
| 3684 | - * Called before a single callback. | |
| 3685 | - * | |
| 3686 | - * @param {string} command | |
| 3687 | - * @param {{}} args | |
| 3688 | - * @param {string} event | |
| 3689 | - * @param {string} id | |
| 3690 | - * | |
| 3691 | - * @throws {Error} | |
| 3692 | - */ | |
| 3693 | - }, { | |
| 3694 | - key: "onCallback", | |
| 3695 | - value: function onCallback(command, args, event, id) { | |
| 3696 | - // eslint-disable-line no-unused-vars | |
| 3697 | - (0, _forceMethodImplementation.default)(); | |
| 3698 | - } | |
| 3699 | - }]); | |
| 3700 | -}(_module.default); | |
| 3701 | - | |
| 3702 | -/***/ }), | |
| 3703 | - | |
| 3704 | -/***/ "../modules/web-cli/assets/js/core/hooks/data.js": | |
| 3705 | -/*!*******************************************************!*\ | |
| 3706 | - !*** ../modules/web-cli/assets/js/core/hooks/data.js ***! | |
| 3707 | - \*******************************************************/ | |
| 3708 | -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 3709 | - | |
| 3710 | -"use strict"; | |
| 3711 | - | |
| 3712 | - | |
| 3713 | -var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 3714 | -Object.defineProperty(exports, "__esModule", ({ | |
| 3715 | - value: true | |
| 3716 | -})); | |
| 3717 | -exports["default"] = void 0; | |
| 3718 | -var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 3719 | -var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 3720 | -var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 3721 | -var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 3722 | -var _get2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/get */ "../node_modules/@babel/runtime/helpers/get.js")); | |
| 3723 | -var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 3724 | -var _base = _interopRequireDefault(__webpack_require__(/*! ./base.js */ "../modules/web-cli/assets/js/core/hooks/base.js")); | |
| 3725 | -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)); } | |
| 3726 | -function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } | |
| 3727 | -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; } | |
| 3728 | -var Data = exports["default"] = /*#__PURE__*/function (_HooksBase) { | |
| 3729 | - function Data() { | |
| 3730 | - var _this; | |
| 3731 | - (0, _classCallCheck2.default)(this, Data); | |
| 3732 | - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { | |
| 3733 | - args[_key] = arguments[_key]; | |
| 3734 | - } | |
| 3735 | - _this = _callSuper(this, Data, [].concat(args)); | |
| 3736 | - _this.callbacks.dependency = {}; | |
| 3737 | - _this.depth.dependency = {}; | |
| 3738 | - return _this; | |
| 3739 | - } | |
| 3740 | - (0, _inherits2.default)(Data, _HooksBase); | |
| 3741 | - return (0, _createClass2.default)(Data, [{ | |
| 3742 | - key: "getType", | |
| 3743 | - value: function getType() { | |
| 3744 | - return 'data'; | |
| 3745 | - } | |
| 3746 | - }, { | |
| 3747 | - key: "runCallback", | |
| 3748 | - value: function runCallback(event, callback, args, result) { | |
| 3749 | - switch (event) { | |
| 3750 | - case 'dependency': | |
| 3751 | - { | |
| 3752 | - // If callback returns false and its dependency, then 'Hook-Break'. | |
| 3753 | - if (!callback.callback(args)) { | |
| 3754 | - this.depth[event][callback.id]--; | |
| 3755 | - | |
| 3756 | - // Throw custom break to be catch by the base for 'Safe' exit. | |
| 3757 | - throw new $e.modules.HookBreak(); | |
| 3758 | - } | |
| 3759 | - return true; | |
| 3760 | - } | |
| 3761 | - case 'catch': | |
| 3762 | - case 'after': | |
| 3763 | - { | |
| 3764 | - /** | |
| 3765 | - * When handling HOOK which is data after (not breakable), | |
| 3766 | - * even the result of the callback is negative, it is required to return positive, | |
| 3767 | - * since result of runCallback determine if the callback succeeded. | |
| 3768 | - */ | |
| 3769 | - return callback.callback(args, result) || 'after' === event; | |
| 3770 | - } | |
| 3771 | - } | |
| 3772 | - return false; | |
| 3773 | - } | |
| 3774 | - }, { | |
| 3775 | - key: "shouldRun", | |
| 3776 | - value: function shouldRun(callbacks) { | |
| 3777 | - return _superPropGet(Data, "shouldRun", this, 3)([callbacks]) && elementor.documents.getCurrent().history.getActive(); | |
| 3778 | - } | |
| 3779 | - }, { | |
| 3780 | - key: "onRun", | |
| 3781 | - value: function onRun(command, args, event) { | |
| 3782 | - if (!$e.devTools) { | |
| 3783 | - return; | |
| 3784 | - } | |
| 3785 | - $e.devTools.log.callbacks().run(this.getType(), command, args, event); | |
| 3786 | - } | |
| 3787 | - }, { | |
| 3788 | - key: "onCallback", | |
| 3789 | - value: function onCallback(command, args, event, id) { | |
| 3790 | - if (!$e.devTools) { | |
| 3791 | - return; | |
| 3792 | - } | |
| 3793 | - $e.devTools.log.callbacks().callback(this.getType(), command, args, event, id); | |
| 3794 | - } | |
| 3795 | - }]); | |
| 3796 | -}(_base.default); | |
| 3797 | - | |
| 3798 | -/***/ }), | |
| 3799 | - | |
| 3800 | -/***/ "../modules/web-cli/assets/js/core/hooks/ui.js": | |
| 3801 | -/*!*****************************************************!*\ | |
| 3802 | - !*** ../modules/web-cli/assets/js/core/hooks/ui.js ***! | |
| 3803 | - \*****************************************************/ | |
| 3804 | -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 3805 | - | |
| 3806 | -"use strict"; | |
| 3807 | - | |
| 3808 | - | |
| 3809 | -var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 3810 | -Object.defineProperty(exports, "__esModule", ({ | |
| 3811 | - value: true | |
| 3812 | -})); | |
| 3813 | -exports["default"] = void 0; | |
| 3814 | -var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 3815 | -var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 3816 | -var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 3817 | -var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 3818 | -var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 3819 | -var _base = _interopRequireDefault(__webpack_require__(/*! ./base */ "../modules/web-cli/assets/js/core/hooks/base.js")); | |
| 3820 | -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)); } | |
| 3821 | -function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } | |
| 3822 | -var Ui = exports["default"] = /*#__PURE__*/function (_HooksBase) { | |
| 3823 | - function Ui() { | |
| 3824 | - var _this; | |
| 3825 | - (0, _classCallCheck2.default)(this, Ui); | |
| 3826 | - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { | |
| 3827 | - args[_key] = arguments[_key]; | |
| 3828 | - } | |
| 3829 | - _this = _callSuper(this, Ui, [].concat(args)); | |
| 3830 | - _this.callbacks.before = {}; | |
| 3831 | - _this.depth.before = {}; | |
| 3832 | - return _this; | |
| 3833 | - } | |
| 3834 | - (0, _inherits2.default)(Ui, _HooksBase); | |
| 3835 | - return (0, _createClass2.default)(Ui, [{ | |
| 3836 | - key: "getType", | |
| 3837 | - value: function getType() { | |
| 3838 | - return 'ui'; | |
| 3839 | - } | |
| 3840 | - }, { | |
| 3841 | - key: "runCallback", | |
| 3842 | - value: function runCallback(event, callback, args, result) { | |
| 3843 | - switch (event) { | |
| 3844 | - case 'before': | |
| 3845 | - callback.callback(args); | |
| 3846 | - break; | |
| 3847 | - case 'catch': | |
| 3848 | - case 'after': | |
| 3849 | - callback.callback(args, result); | |
| 3850 | - break; | |
| 3851 | - default: | |
| 3852 | - return false; | |
| 3853 | - } | |
| 3854 | - return true; | |
| 3855 | - } | |
| 3856 | - }, { | |
| 3857 | - key: "onRun", | |
| 3858 | - value: function onRun(command, args, event) { | |
| 3859 | - if (!$e.devTools) { | |
| 3860 | - return; | |
| 3861 | - } | |
| 3862 | - $e.devTools.log.callbacks().run(this.getType(), command, args, event); | |
| 3863 | - } | |
| 3864 | - }, { | |
| 3865 | - key: "onCallback", | |
| 3866 | - value: function onCallback(command, args, event, id) { | |
| 3867 | - if (!$e.devTools) { | |
| 3868 | - return; | |
| 3869 | - } | |
| 3870 | - $e.devTools.log.callbacks().callback(this.getType(), command, args, event, id); | |
| 3871 | - } | |
| 3872 | - }]); | |
| 3873 | -}(_base.default); | |
| 3874 | - | |
| 3875 | -/***/ }), | |
| 3876 | - | |
| 3877 | -/***/ "../modules/web-cli/assets/js/core/routes.js": | |
| 3878 | -/*!***************************************************!*\ | |
| 3879 | - !*** ../modules/web-cli/assets/js/core/routes.js ***! | |
| 3880 | - \***************************************************/ | |
| 3881 | -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 3882 | - | |
| 3883 | -"use strict"; | |
| 3884 | - | |
| 3885 | - | |
| 3886 | -var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 3887 | -Object.defineProperty(exports, "__esModule", ({ | |
| 3888 | - value: true | |
| 3889 | -})); | |
| 3890 | -exports["default"] = void 0; | |
| 3891 | -var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 3892 | -var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 3893 | -var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 3894 | -var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 3895 | -var _get2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/get */ "../node_modules/@babel/runtime/helpers/get.js")); | |
| 3896 | -var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 3897 | -var _commands = _interopRequireDefault(__webpack_require__(/*! ./commands */ "../modules/web-cli/assets/js/core/commands.js")); | |
| 3898 | -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)); } | |
| 3899 | -function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } | |
| 3900 | -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; } | |
| 3901 | -var Routes = exports["default"] = /*#__PURE__*/function (_Commands) { | |
| 3902 | - function Routes() { | |
| 3903 | - var _this; | |
| 3904 | - (0, _classCallCheck2.default)(this, Routes); | |
| 3905 | - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { | |
| 3906 | - args[_key] = arguments[_key]; | |
| 3907 | - } | |
| 3908 | - _this = _callSuper(this, Routes, [].concat(args)); | |
| 3909 | - _this.savedStates = {}; | |
| 3910 | - _this.historyPerComponent = {}; | |
| 3911 | - return _this; | |
| 3912 | - } | |
| 3913 | - (0, _inherits2.default)(Routes, _Commands); | |
| 3914 | - return (0, _createClass2.default)(Routes, [{ | |
| 3915 | - key: "refreshContainer", | |
| 3916 | - value: function refreshContainer(container) { | |
| 3917 | - var currentRoute = this.getCurrent(container), | |
| 3918 | - currentArgs = this.getCurrentArgs(container); | |
| 3919 | - this.clearCurrent(container); | |
| 3920 | - this.to(currentRoute, currentArgs); | |
| 3921 | - } | |
| 3922 | - }, { | |
| 3923 | - key: "getHistory", | |
| 3924 | - value: function getHistory() { | |
| 3925 | - var namespaceRoot = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ''; | |
| 3926 | - if (namespaceRoot) { | |
| 3927 | - return this.historyPerComponent[namespaceRoot] || []; | |
| 3928 | - } | |
| 3929 | - return this.historyPerComponent; | |
| 3930 | - } | |
| 3931 | - }, { | |
| 3932 | - key: "clearHistory", | |
| 3933 | - value: function clearHistory(namespaceRoot) { | |
| 3934 | - delete this.historyPerComponent[namespaceRoot]; | |
| 3935 | - } | |
| 3936 | - }, { | |
| 3937 | - key: "clearCurrent", | |
| 3938 | - value: function clearCurrent(container) { | |
| 3939 | - var route = this.current[container]; | |
| 3940 | - if (!route) { | |
| 3941 | - return; | |
| 3942 | - } | |
| 3943 | - this.detachCurrent(container); | |
| 3944 | - this.getComponent(route).onCloseRoute(route); | |
| 3945 | - this.dispatchOnClose(route); | |
| 3946 | - } | |
| 3947 | - }, { | |
| 3948 | - key: "clear", | |
| 3949 | - value: function clear() { | |
| 3950 | - var _this2 = this; | |
| 3951 | - Object.keys(this.current).forEach(function (container) { | |
| 3952 | - return _this2.clearCurrent(container); | |
| 3953 | - }); | |
| 3954 | - } | |
| 3955 | - }, { | |
| 3956 | - key: "saveState", | |
| 3957 | - value: function saveState(container) { | |
| 3958 | - this.savedStates[container] = { | |
| 3959 | - route: this.current[container], | |
| 3960 | - args: this.currentArgs[container] | |
| 3961 | - }; | |
| 3962 | - return this; | |
| 3963 | - } | |
| 3964 | - }, { | |
| 3965 | - key: "restoreState", | |
| 3966 | - value: function restoreState(container) { | |
| 3967 | - if (!this.savedStates[container]) { | |
| 3968 | - return false; | |
| 3969 | - } | |
| 3970 | - this.to(this.savedStates[container].route, this.savedStates[container].args); | |
| 3971 | - return true; | |
| 3972 | - } | |
| 3973 | - }, { | |
| 3974 | - key: "validateRun", | |
| 3975 | - value: function validateRun(route) { | |
| 3976 | - var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | |
| 3977 | - if (!_superPropGet(Routes, "validateRun", this, 3)([route, args])) { | |
| 3978 | - return false; | |
| 3979 | - } | |
| 3980 | - if (this.is(route, args) && !args.refresh) { | |
| 3981 | - return false; | |
| 3982 | - } | |
| 3983 | - var component = this.getComponent(route); | |
| 3984 | - if (!component.isOpen || args.reOpen) { | |
| 3985 | - component.isOpen = component.open(args); | |
| 3986 | - } | |
| 3987 | - return component.isOpen; | |
| 3988 | - } | |
| 3989 | - | |
| 3990 | - /** | |
| 3991 | - * @override | |
| 3992 | - */ | |
| 3993 | - }, { | |
| 3994 | - key: "beforeRun", | |
| 3995 | - value: function beforeRun(route, args) { | |
| 3996 | - var component = this.getComponent(route), | |
| 3997 | - container = component.getServiceName(), | |
| 3998 | - oldRoute = this.current[container]; | |
| 3999 | - if (oldRoute) { | |
| 4000 | - this.getComponent(oldRoute).onCloseRoute(oldRoute); | |
| 4001 | - } | |
| 4002 | - _commands.default.trace.push(route); | |
| 4003 | - _superPropGet(Routes, "beforeRun", this, 3)([route, args, false]); | |
| 4004 | - this.attachCurrent(container, route, args); | |
| 4005 | - | |
| 4006 | - // In the previous condition, `$e.routes.is()` resolves the old route as active (because the actual route | |
| 4007 | - // switching happens inside `this.attachCurrent()`), so we can't use it there. | |
| 4008 | - if (oldRoute) { | |
| 4009 | - this.dispatchOnClose(oldRoute); | |
| 4010 | - } | |
| 4011 | - } | |
| 4012 | - }, { | |
| 4013 | - key: "to", | |
| 4014 | - value: function to(route, args) { | |
| 4015 | - var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : { | |
| 4016 | - history: true | |
| 4017 | - }; | |
| 4018 | - this.run(route, args); | |
| 4019 | - var namespaceRoot = this.getComponent(route).getServiceName(); | |
| 4020 | - if (options.history) { | |
| 4021 | - if (!this.historyPerComponent[namespaceRoot]) { | |
| 4022 | - this.historyPerComponent[namespaceRoot] = []; | |
| 4023 | - } | |
| 4024 | - this.historyPerComponent[namespaceRoot].push({ | |
| 4025 | - route: route, | |
| 4026 | - args: args | |
| 4027 | - }); | |
| 4028 | - } | |
| 4029 | - } | |
| 4030 | - }, { | |
| 4031 | - key: "back", | |
| 4032 | - value: function back(namespaceRoot) { | |
| 4033 | - var history = this.getHistory(namespaceRoot); | |
| 4034 | - | |
| 4035 | - // Remove current; | |
| 4036 | - history.pop(); | |
| 4037 | - var last = history.pop(); | |
| 4038 | - if (!last) { | |
| 4039 | - return; | |
| 4040 | - } | |
| 4041 | - this.to(last.route, last.args); | |
| 4042 | - } | |
| 4043 | - | |
| 4044 | - // Don't use the event object. | |
| 4045 | - }, { | |
| 4046 | - key: "runShortcut", | |
| 4047 | - value: function runShortcut(command) { | |
| 4048 | - this.to(command); | |
| 4049 | - } | |
| 4050 | - | |
| 4051 | - // Don't clear current route. | |
| 4052 | - }, { | |
| 4053 | - key: "afterRun", | |
| 4054 | - value: function afterRun(route, args) { | |
| 4055 | - var results = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined; | |
| 4056 | - var component = this.getComponent(route); | |
| 4057 | - component.onRoute(route, args); | |
| 4058 | - this.dispatchOnOpen(route); | |
| 4059 | - _superPropGet(Routes, "afterRun", this, 3)([route, args, results, false]); | |
| 4060 | - _commands.default.trace.pop(); | |
| 4061 | - } | |
| 4062 | - }, { | |
| 4063 | - key: "is", | |
| 4064 | - value: function is(route) { | |
| 4065 | - var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | |
| 4066 | - if (!_superPropGet(Routes, "is", this, 3)([route])) { | |
| 4067 | - return false; | |
| 4068 | - } | |
| 4069 | - var container = this.getComponent(route).getServiceName(); | |
| 4070 | - return _.isEqual(args, this.currentArgs[container]); | |
| 4071 | - } | |
| 4072 | - }, { | |
| 4073 | - key: "isPartOf", | |
| 4074 | - value: function isPartOf(route) { | |
| 4075 | - /** | |
| 4076 | - * Check against current command hierarchically. | |
| 4077 | - * For example `is( 'panel' )` will be true for `panel/elements` | |
| 4078 | - * `is( 'panel/editor' )` will be true for `panel/editor/style` | |
| 4079 | - */ | |
| 4080 | - var parts = route.split('/'), | |
| 4081 | - container = parts[0], | |
| 4082 | - toCheck = [], | |
| 4083 | - currentParts = this.current[container] ? this.current[container].split('/') : []; | |
| 4084 | - var match = false; | |
| 4085 | - currentParts.forEach(function (part) { | |
| 4086 | - toCheck.push(part); | |
| 4087 | - if (toCheck.join('/') === route) { | |
| 4088 | - match = true; | |
| 4089 | - } | |
| 4090 | - }); | |
| 4091 | - return match; | |
| 4092 | - } | |
| 4093 | - }, { | |
| 4094 | - key: "error", | |
| 4095 | - value: function error(message) { | |
| 4096 | - throw Error('Routes: ' + message); | |
| 4097 | - } | |
| 4098 | - }, { | |
| 4099 | - key: "dispatchOnOpen", | |
| 4100 | - value: function dispatchOnOpen(route) { | |
| 4101 | - window.dispatchEvent(new CustomEvent('elementor/routes/open', { | |
| 4102 | - detail: { | |
| 4103 | - route: route | |
| 4104 | - } | |
| 4105 | - })); | |
| 4106 | - } | |
| 4107 | - }, { | |
| 4108 | - key: "dispatchOnClose", | |
| 4109 | - value: function dispatchOnClose(route) { | |
| 4110 | - window.dispatchEvent(new CustomEvent('elementor/routes/close', { | |
| 4111 | - detail: { | |
| 4112 | - route: route | |
| 4113 | - } | |
| 4114 | - })); | |
| 4115 | - } | |
| 4116 | - }]); | |
| 4117 | -}(_commands.default); | |
| 4118 | - | |
| 4119 | -/***/ }), | |
| 4120 | - | |
| 4121 | -/***/ "../modules/web-cli/assets/js/core/shortcuts.js": | |
| 4122 | -/*!******************************************************!*\ | |
| 4123 | - !*** ../modules/web-cli/assets/js/core/shortcuts.js ***! | |
| 4124 | - \******************************************************/ | |
| 4125 | -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 4126 | - | |
| 4127 | -"use strict"; | |
| 4128 | - | |
| 4129 | - | |
| 4130 | -var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 4131 | -Object.defineProperty(exports, "__esModule", ({ | |
| 4132 | - value: true | |
| 4133 | -})); | |
| 4134 | -exports["default"] = void 0; | |
| 4135 | -var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 4136 | -var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 4137 | -var _environment = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/environment */ "../modules/web-cli/assets/js/utils/environment.js")); | |
| 4138 | -var _console = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/console */ "../modules/web-cli/assets/js/utils/console.js")); | |
| 4139 | -var Shortcuts = exports["default"] = /*#__PURE__*/function () { | |
| 4140 | - function Shortcuts($window) { | |
| 4141 | - (0, _classCallCheck2.default)(this, Shortcuts); | |
| 4142 | - this.specialKeys = { | |
| 4143 | - 13: 'enter', | |
| 4144 | - 27: 'esc', | |
| 4145 | - 38: 'up', | |
| 4146 | - 40: 'down', | |
| 4147 | - 46: 'del', | |
| 4148 | - 191: '?' | |
| 4149 | - }; | |
| 4150 | - this.component = ''; | |
| 4151 | - this.handlers = {}; | |
| 4152 | - this.bindListener($window); | |
| 4153 | - } | |
| 4154 | - return (0, _createClass2.default)(Shortcuts, [{ | |
| 4155 | - key: "bindListener", | |
| 4156 | - value: function bindListener($window) { | |
| 4157 | - var _this = this; | |
| 4158 | - $window.on('keydown', function (event) { | |
| 4159 | - return _this.handle(event); | |
| 4160 | - }); | |
| 4161 | - } | |
| 4162 | - }, { | |
| 4163 | - key: "getAll", | |
| 4164 | - value: function getAll() { | |
| 4165 | - var shortcuts = {}; | |
| 4166 | - jQuery.each(this.handlers, function (key, handler) { | |
| 4167 | - jQuery.each(handler, function (index, config) { | |
| 4168 | - shortcuts[config.command] = key; | |
| 4169 | - }); | |
| 4170 | - }); | |
| 4171 | - return shortcuts; | |
| 4172 | - } | |
| 4173 | - | |
| 4174 | - /** | |
| 4175 | - * @param {string} shortcuts | |
| 4176 | - * @param {Object} args | |
| 4177 | - * @param {Function} args.callback Required | |
| 4178 | - * @param {string} args.component Optional | |
| 4179 | - * @param {Function} args.dependency Optional | |
| 4180 | - * @param {Array} args.exclude Optional | |
| 4181 | - * @param {boolean} args.allowAltKey Optional | |
| 4182 | - */ | |
| 4183 | - }, { | |
| 4184 | - key: "register", | |
| 4185 | - value: function register(shortcuts, args) { | |
| 4186 | - var _this2 = this; | |
| 4187 | - shortcuts.replace(' ', '').split(',').forEach(function (shortcut) { | |
| 4188 | - if (!_this2.handlers[shortcut]) { | |
| 4189 | - _this2.handlers[shortcut] = []; | |
| 4190 | - } | |
| 4191 | - _this2.handlers[shortcut].push(args); | |
| 4192 | - }); | |
| 4193 | - } | |
| 4194 | - }, { | |
| 4195 | - key: "unregister", | |
| 4196 | - value: function unregister(shortcuts, args) { | |
| 4197 | - var _this3 = this; | |
| 4198 | - shortcuts.replace(' ', '').split(',').forEach(function (shortcut) { | |
| 4199 | - _this3.handlers[shortcut].forEach(function (index, handler) { | |
| 4200 | - if (args === handler) { | |
| 4201 | - delete _this3.handlers[shortcut][index]; | |
| 4202 | - } | |
| 4203 | - }); | |
| 4204 | - }); | |
| 4205 | - } | |
| 4206 | - }, { | |
| 4207 | - key: "handle", | |
| 4208 | - value: function handle(event) { | |
| 4209 | - var handlers = this.getHandlersByPriority(event); | |
| 4210 | - if (!handlers) { | |
| 4211 | - return; | |
| 4212 | - } | |
| 4213 | - var filteredHandlers = handlers.filter(function (handler) { | |
| 4214 | - if (handler.exclude && -1 !== handler.exclude.indexOf('input')) { | |
| 4215 | - var $target = jQuery(event.target); | |
| 4216 | - if ($target.is(':input, .elementor-input') || $target.closest('[contenteditable="true"]').length) { | |
| 4217 | - return false; | |
| 4218 | - } | |
| 4219 | - } | |
| 4220 | - if (handler.dependency && !handler.dependency(event)) { | |
| 4221 | - return false; | |
| 4222 | - } | |
| 4223 | - | |
| 4224 | - // Fix for some keyboard sources that consider alt key as ctrl key | |
| 4225 | - if (!handler.allowAltKey && event.altKey) { | |
| 4226 | - return false; | |
| 4227 | - } | |
| 4228 | - return true; | |
| 4229 | - }); | |
| 4230 | - if (!filteredHandlers.length) { | |
| 4231 | - return; | |
| 4232 | - } | |
| 4233 | - if (1 < filteredHandlers.length && elementorWebCliConfig.isDebug) { | |
| 4234 | - _console.default.warn('Multiple handlers for shortcut.', filteredHandlers, event); | |
| 4235 | - } | |
| 4236 | - event.preventDefault(); | |
| 4237 | - filteredHandlers[0].callback(event); | |
| 4238 | - } | |
| 4239 | - }, { | |
| 4240 | - key: "isControlEvent", | |
| 4241 | - value: function isControlEvent(event) { | |
| 4242 | - return event[_environment.default.mac ? 'metaKey' : 'ctrlKey']; | |
| 4243 | - } | |
| 4244 | - }, { | |
| 4245 | - key: "getEventShortcut", | |
| 4246 | - value: function getEventShortcut(event) { | |
| 4247 | - var shortcut = []; | |
| 4248 | - if (event.altKey) { | |
| 4249 | - shortcut.push('alt'); | |
| 4250 | - } | |
| 4251 | - if (this.isControlEvent(event)) { | |
| 4252 | - shortcut.push('ctrl'); | |
| 4253 | - } | |
| 4254 | - if (event.shiftKey) { | |
| 4255 | - shortcut.push('shift'); | |
| 4256 | - } | |
| 4257 | - if (this.specialKeys[event.which]) { | |
| 4258 | - shortcut.push(this.specialKeys[event.which]); | |
| 4259 | - } else { | |
| 4260 | - shortcut.push(String.fromCharCode(event.which).toLowerCase()); | |
| 4261 | - } | |
| 4262 | - return shortcut.join('+'); | |
| 4263 | - } | |
| 4264 | - }, { | |
| 4265 | - key: "isActiveScope", | |
| 4266 | - value: function isActiveScope(scopes) { | |
| 4267 | - var activeComponents = Object.keys($e.components.activeComponents), | |
| 4268 | - activeComponent = activeComponents[activeComponents.length - 1], | |
| 4269 | - component = $e.components.get(activeComponent); | |
| 4270 | - if (!component) { | |
| 4271 | - return false; | |
| 4272 | - } | |
| 4273 | - var namespace = component.getNamespace(); | |
| 4274 | - var filteredByNamespace = scopes.some(function (scope) { | |
| 4275 | - return namespace === scope; | |
| 4276 | - }); | |
| 4277 | - if (filteredByNamespace) { | |
| 4278 | - return true; | |
| 4279 | - } | |
| 4280 | - | |
| 4281 | - // Else filter by namespaceRoot. | |
| 4282 | - var namespaceRoot = component.getServiceName(); | |
| 4283 | - return scopes.some(function (scope) { | |
| 4284 | - return namespaceRoot === scope; | |
| 4285 | - }); | |
| 4286 | - } | |
| 4287 | - }, { | |
| 4288 | - key: "getHandlersByPriority", | |
| 4289 | - value: function getHandlersByPriority(event) { | |
| 4290 | - var _this4 = this; | |
| 4291 | - var handlers = this.handlers[this.getEventShortcut(event)]; | |
| 4292 | - if (!handlers) { | |
| 4293 | - return false; | |
| 4294 | - } | |
| 4295 | - | |
| 4296 | - // TODO: Prioritize current scope before roo scope. | |
| 4297 | - var inCurrentScope = handlers.filter(function (handler) { | |
| 4298 | - return handler.scopes && _this4.isActiveScope(handler.scopes); | |
| 4299 | - }); | |
| 4300 | - if (inCurrentScope.length) { | |
| 4301 | - return inCurrentScope; | |
| 4302 | - } | |
| 4303 | - var noScope = handlers.filter(function (handler) { | |
| 4304 | - return !handler.scopes; | |
| 4305 | - }); | |
| 4306 | - if (noScope.length) { | |
| 4307 | - return noScope; | |
| 4308 | - } | |
| 4309 | - } | |
| 4310 | - }]); | |
| 4311 | -}(); | |
| 4312 | - | |
| 4313 | -/***/ }), | |
| 4314 | - | |
| 4315 | -/***/ "../modules/web-cli/assets/js/core/store.js": | |
| 4316 | -/*!**************************************************!*\ | |
| 4317 | - !*** ../modules/web-cli/assets/js/core/store.js ***! | |
| 4318 | - \**************************************************/ | |
| 4319 | -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 4320 | - | |
| 4321 | -"use strict"; | |
| 4322 | - | |
| 4323 | - | |
| 4324 | -var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 4325 | -Object.defineProperty(exports, "__esModule", ({ | |
| 4326 | - value: true | |
| 4327 | -})); | |
| 4328 | -exports["default"] = void 0; | |
| 4329 | -var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js")); | |
| 4330 | -var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 4331 | -var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 4332 | -var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js")); | |
| 4333 | -var _toolkit = __webpack_require__(/*! @reduxjs/toolkit */ "@reduxjs/toolkit"); | |
| 4334 | -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; } | |
| 4335 | -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; } | |
| 4336 | -/** | |
| 4337 | - * @typedef {import('@reduxjs/toolkit').Slice} Slice | |
| 4338 | - */ | |
| 4339 | -/** | |
| 4340 | - * @typedef {import('@reduxjs/toolkit').EnhancedStore} EnhancedStore | |
| 4341 | - */ | |
| 4342 | -/** | |
| 4343 | - * @typedef {import('@reduxjs/toolkit').AnyAction} AnyAction | |
| 4344 | - */ | |
| 4345 | -/** | |
| 4346 | - * @typedef {import('@reduxjs/toolkit').ThunkMiddlewareFor} ThunkMiddlewareFor | |
| 4347 | - */ | |
| 4348 | -var Store = exports["default"] = /*#__PURE__*/function () { | |
| 4349 | - /** | |
| 4350 | - * Initialize the Store. | |
| 4351 | - * | |
| 4352 | - * @return {void} | |
| 4353 | - */ | |
| 4354 | - function Store() { | |
| 4355 | - (0, _classCallCheck2.default)(this, Store); | |
| 4356 | - /** | |
| 4357 | - * @type {Object} | |
| 4358 | - */ | |
| 4359 | - (0, _defineProperty2.default)(this, "slices", {}); | |
| 4360 | - /** | |
| 4361 | - * @type {EnhancedStore<{}, AnyAction, [ThunkMiddlewareFor<{}>]>} | |
| 4362 | - */ | |
| 4363 | - (0, _defineProperty2.default)(this, "reduxStore", void 0); | |
| 4364 | - this.slices = {}; | |
| 4365 | - this.reduxStore = this.createStore(); | |
| 4366 | - } | |
| 4367 | - | |
| 4368 | - /** | |
| 4369 | - * Create a Redux Store object. | |
| 4370 | - * | |
| 4371 | - * @return {EnhancedStore<{}, AnyAction, [ThunkMiddlewareFor<{}>]>} store | |
| 4372 | - */ | |
| 4373 | - return (0, _createClass2.default)(Store, [{ | |
| 4374 | - key: "createStore", | |
| 4375 | - value: function createStore() { | |
| 4376 | - return (0, _toolkit.configureStore)({ | |
| 4377 | - // Use an empty function instead of empty object since an empty object | |
| 4378 | - // isn't a valid reducer value. | |
| 4379 | - reducer: function reducer() {} | |
| 4380 | - }); | |
| 4381 | - } | |
| 4382 | - | |
| 4383 | - /** | |
| 4384 | - * Inject a new reducer. | |
| 4385 | - * | |
| 4386 | - * See: https://redux.js.org/usage/code-splitting#defining-an-injectreducer-function | |
| 4387 | - * | |
| 4388 | - * @param {string} id - Reducer unique ID. | |
| 4389 | - * @param {Function} newReducer - New reducer to inject. | |
| 4390 | - * | |
| 4391 | - * @return {void} | |
| 4392 | - */ | |
| 4393 | - }, { | |
| 4394 | - key: "injectReducer", | |
| 4395 | - value: function injectReducer(id, newReducer) { | |
| 4396 | - var prevReducers = this.getReducers(); | |
| 4397 | - this.reduxStore.replaceReducer((0, _toolkit.combineReducers)(_objectSpread(_objectSpread({}, prevReducers), {}, (0, _defineProperty2.default)({}, id, newReducer)))); | |
| 4398 | - } | |
| 4399 | - | |
| 4400 | - /** | |
| 4401 | - * Register a Redux Store slice. | |
| 4402 | - * | |
| 4403 | - * @param {string} sliceId - Slice unique ID. | |
| 4404 | - * @param {Slice} instance - Slice object to add. | |
| 4405 | - * | |
| 4406 | - * @return {void} | |
| 4407 | - */ | |
| 4408 | - }, { | |
| 4409 | - key: "register", | |
| 4410 | - value: function register(sliceId, instance) { | |
| 4411 | - if (this.slices[sliceId]) { | |
| 4412 | - throw "Slice with ID '".concat(sliceId, "' already exists."); | |
| 4413 | - } | |
| 4414 | - this.slices[sliceId] = instance; | |
| 4415 | - this.injectReducer(sliceId, instance.reducer); | |
| 4416 | - } | |
| 4417 | - | |
| 4418 | - /** | |
| 4419 | - * Get a specific slice. | |
| 4420 | - * | |
| 4421 | - * @param {string|null} sliceId - Slice ID to get. | |
| 4422 | - * | |
| 4423 | - * @return {Slice} slice | |
| 4424 | - */ | |
| 4425 | - }, { | |
| 4426 | - key: "get", | |
| 4427 | - value: function get(sliceId) { | |
| 4428 | - return this.slices[sliceId]; | |
| 4429 | - } | |
| 4430 | - | |
| 4431 | - /** | |
| 4432 | - * Get all slices. | |
| 4433 | - * | |
| 4434 | - * @return {Object} slices | |
| 4435 | - */ | |
| 4436 | - }, { | |
| 4437 | - key: "getAllSlices", | |
| 4438 | - value: function getAllSlices() { | |
| 4439 | - return this.slices; | |
| 4440 | - } | |
| 4441 | - | |
| 4442 | - /** | |
| 4443 | - * Get All slices. | |
| 4444 | - * | |
| 4445 | - * @return {Object} slices | |
| 4446 | - */ | |
| 4447 | - }, { | |
| 4448 | - key: "getAll", | |
| 4449 | - value: function getAll() { | |
| 4450 | - return Object.keys(this.slices).sort(); | |
| 4451 | - } | |
| 4452 | - | |
| 4453 | - /** | |
| 4454 | - * Return the current reducers. | |
| 4455 | - * | |
| 4456 | - * @return {Object} reducers | |
| 4457 | - */ | |
| 4458 | - }, { | |
| 4459 | - key: "getReducers", | |
| 4460 | - value: function getReducers() { | |
| 4461 | - return Object.entries(this.slices).reduce(function (reducers, _ref) { | |
| 4462 | - var _ref2 = (0, _slicedToArray2.default)(_ref, 2), | |
| 4463 | - key = _ref2[0], | |
| 4464 | - slice = _ref2[1]; | |
| 4465 | - return _objectSpread(_objectSpread({}, reducers), {}, (0, _defineProperty2.default)({}, key, slice.reducer)); | |
| 4466 | - }, {}); | |
| 4467 | - } | |
| 4468 | - | |
| 4469 | - /** | |
| 4470 | - * Get the actual Redux store object. | |
| 4471 | - * | |
| 4472 | - * @return {Object} redux store object | |
| 4473 | - */ | |
| 4474 | - }, { | |
| 4475 | - key: "getReduxStore", | |
| 4476 | - value: function getReduxStore() { | |
| 4477 | - return this.reduxStore; | |
| 4478 | - } | |
| 4479 | - | |
| 4480 | - /** | |
| 4481 | - * Proxy to Redux's `dispatch()` function. | |
| 4482 | - * | |
| 4483 | - * @return {*} the dispatched action | |
| 4484 | - */ | |
| 4485 | - }, { | |
| 4486 | - key: "dispatch", | |
| 4487 | - value: function dispatch() { | |
| 4488 | - var _this$reduxStore; | |
| 4489 | - return (_this$reduxStore = this.reduxStore).dispatch.apply(_this$reduxStore, arguments); | |
| 4490 | - } | |
| 4491 | - | |
| 4492 | - /** | |
| 4493 | - * Proxy to Redux's `getState()` function, with the ability to get a specific slice. | |
| 4494 | - * | |
| 4495 | - * @param {string|null} sliceId | |
| 4496 | - * | |
| 4497 | - * @return {*} The current state tree of the application | |
| 4498 | - */ | |
| 4499 | - }, { | |
| 4500 | - key: "getState", | |
| 4501 | - value: function getState() { | |
| 4502 | - var sliceId = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null; | |
| 4503 | - var state = this.reduxStore.getState(); | |
| 4504 | - return sliceId ? state[sliceId] : state; | |
| 4505 | - } | |
| 4506 | - | |
| 4507 | - /** | |
| 4508 | - * Proxy to Redux's `replaceReducer()` function. | |
| 4509 | - * TODO: Do we want that? | |
| 4510 | - * | |
| 4511 | - * @return {*} undefined | |
| 4512 | - */ | |
| 4513 | - }, { | |
| 4514 | - key: "replaceReducer", | |
| 4515 | - value: function replaceReducer() { | |
| 4516 | - var _this$reduxStore2; | |
| 4517 | - return (_this$reduxStore2 = this.reduxStore).replaceReducer.apply(_this$reduxStore2, arguments); | |
| 4518 | - } | |
| 4519 | - | |
| 4520 | - /** | |
| 4521 | - * Proxy to Redux's `subscribe()` function. | |
| 4522 | - * | |
| 4523 | - * @return {*} A function that unsubscribes the change listener | |
| 4524 | - */ | |
| 4525 | - }, { | |
| 4526 | - key: "subscribe", | |
| 4527 | - value: function subscribe() { | |
| 4528 | - var _this$reduxStore3; | |
| 4529 | - return (_this$reduxStore3 = this.reduxStore).subscribe.apply(_this$reduxStore3, arguments); | |
| 4530 | - } | |
| 4531 | - }]); | |
| 4532 | -}(); | |
| 4533 | - | |
| 4534 | -/***/ }), | |
| 4535 | - | |
| 4536 | -/***/ "../modules/web-cli/assets/js/core/ui-states.js": | |
| 4537 | -/*!******************************************************!*\ | |
| 4538 | - !*** ../modules/web-cli/assets/js/core/ui-states.js ***! | |
| 4539 | - \******************************************************/ | |
| 4540 | -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 4541 | - | |
| 4542 | -"use strict"; | |
| 4543 | - | |
| 4544 | - | |
| 4545 | -var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 4546 | -Object.defineProperty(exports, "__esModule", ({ | |
| 4547 | - value: true | |
| 4548 | -})); | |
| 4549 | -exports["default"] = void 0; | |
| 4550 | -var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js")); | |
| 4551 | -var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 4552 | -var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 4553 | -/** | |
| 4554 | - * @typedef {import('./states/ui-state-base')} UiStateBase | |
| 4555 | - */ | |
| 4556 | -var UiStates = exports["default"] = /*#__PURE__*/function () { | |
| 4557 | - /** | |
| 4558 | - * Initialize the State Manager. | |
| 4559 | - * | |
| 4560 | - * @return {void} | |
| 4561 | - */ | |
| 4562 | - function UiStates() { | |
| 4563 | - (0, _classCallCheck2.default)(this, UiStates); | |
| 4564 | - this.states = {}; | |
| 4565 | - } | |
| 4566 | - | |
| 4567 | - /** | |
| 4568 | - * Register a new state. | |
| 4569 | - * | |
| 4570 | - * @param {UiStateBase} instance - State instance. | |
| 4571 | - */ | |
| 4572 | - return (0, _createClass2.default)(UiStates, [{ | |
| 4573 | - key: "register", | |
| 4574 | - value: function register(instance) { | |
| 4575 | - var stateId = instance.getPrefixedId(); | |
| 4576 | - if (this.states[stateId]) { | |
| 4577 | - throw "State '".concat(stateId, "' already exists."); | |
| 4578 | - } | |
| 4579 | - this.states[stateId] = instance; | |
| 4580 | - } | |
| 4581 | - | |
| 4582 | - /** | |
| 4583 | - * Get all existing states with their options: | |
| 4584 | - * | |
| 4585 | - * { | |
| 4586 | - * 'state-id': [ | |
| 4587 | - * 'option-1', | |
| 4588 | - * 'option-2', | |
| 4589 | - * 'option-3', | |
| 4590 | - * ], | |
| 4591 | - * } | |
| 4592 | - * | |
| 4593 | - * @return {Object} all existing states | |
| 4594 | - */ | |
| 4595 | - }, { | |
| 4596 | - key: "getAll", | |
| 4597 | - value: function getAll() { | |
| 4598 | - var states = {}; | |
| 4599 | - Object.entries(this.states).forEach(function (_ref) { | |
| 4600 | - var _ref2 = (0, _slicedToArray2.default)(_ref, 2), | |
| 4601 | - id = _ref2[0], | |
| 4602 | - instance = _ref2[1]; | |
| 4603 | - var options = instance.getOptions(); | |
| 4604 | - states[id] = Object.keys(options); | |
| 4605 | - }); | |
| 4606 | - return states; | |
| 4607 | - } | |
| 4608 | - | |
| 4609 | - /** | |
| 4610 | - * Get the state value, or return all of them if no `state` is set. | |
| 4611 | - * | |
| 4612 | - * @param {string} state - State ID. | |
| 4613 | - * | |
| 4614 | - * @return {UiStateBase} state value | |
| 4615 | - */ | |
| 4616 | - }, { | |
| 4617 | - key: "get", | |
| 4618 | - value: function get(state) { | |
| 4619 | - if (state) { | |
| 4620 | - return this.states[state]; | |
| 4621 | - } | |
| 4622 | - return this.states; | |
| 4623 | - } | |
| 4624 | - | |
| 4625 | - /** | |
| 4626 | - * Set the current state value and trigger its callbacks & events. | |
| 4627 | - * This function triggers a `e-ui-state:${ stateID }` event to the scope, with `oldValue` & `newValue` | |
| 4628 | - * under `e.detail`. | |
| 4629 | - * Additionally, it adds a `e-ui-state--${ stateID }__${ value }` class to the scope element. | |
| 4630 | - * | |
| 4631 | - * @param {string} state - State ID. | |
| 4632 | - * @param {string} value - New state value. | |
| 4633 | - * | |
| 4634 | - * @return {void} | |
| 4635 | - */ | |
| 4636 | - }, { | |
| 4637 | - key: "set", | |
| 4638 | - value: function set(state, value) { | |
| 4639 | - // Invalid state or option. | |
| 4640 | - if (!this.get(state)) { | |
| 4641 | - throw "State '".concat(state, "' doesn't exist."); | |
| 4642 | - } | |
| 4643 | - var oldValue = this.getCurrent(state), | |
| 4644 | - classPrefix = "e-ui-state--".concat(state.replaceAll('/', '-')), | |
| 4645 | - oldStateClass = "".concat(classPrefix, "__").concat(oldValue), | |
| 4646 | - newStateClass = "".concat(classPrefix, "__").concat(value), | |
| 4647 | - scopes = this.get(state).getScopes(); | |
| 4648 | - | |
| 4649 | - // Set the current state to the new value. | |
| 4650 | - this.get(state).set(value); | |
| 4651 | - scopes.forEach(function (scope) { | |
| 4652 | - scope.classList.remove(oldStateClass); | |
| 4653 | - | |
| 4654 | - // Set the new class only if there is a value (i.e. it's not a state removal action). | |
| 4655 | - if (value) { | |
| 4656 | - scope.classList.add(newStateClass); | |
| 4657 | - } | |
| 4658 | - | |
| 4659 | - // Dispatch a custom state-change event to the scope. | |
| 4660 | - var event = new CustomEvent("e-ui-state:".concat(state), { | |
| 4661 | - detail: { | |
| 4662 | - oldValue: oldValue, | |
| 4663 | - newValue: value | |
| 4664 | - } | |
| 4665 | - }); | |
| 4666 | - scope.dispatchEvent(event); | |
| 4667 | - }); | |
| 4668 | - } | |
| 4669 | - | |
| 4670 | - /** | |
| 4671 | - * Remove a state. | |
| 4672 | - * | |
| 4673 | - * @param {string} state - State ID. | |
| 4674 | - * | |
| 4675 | - * @return {void} | |
| 4676 | - */ | |
| 4677 | - }, { | |
| 4678 | - key: "remove", | |
| 4679 | - value: function remove(state) { | |
| 4680 | - this.set(state, ''); | |
| 4681 | - } | |
| 4682 | - | |
| 4683 | - /** | |
| 4684 | - * Get the current state value. | |
| 4685 | - * | |
| 4686 | - * @param {string} state - State ID. | |
| 4687 | - * | |
| 4688 | - * @return {string} current state value | |
| 4689 | - */ | |
| 4690 | - }, { | |
| 4691 | - key: "getCurrent", | |
| 4692 | - value: function getCurrent(state) { | |
| 4693 | - var _this$get; | |
| 4694 | - return (_this$get = this.get(state)) === null || _this$get === void 0 ? void 0 : _this$get.getCurrent(); | |
| 4695 | - } | |
| 4696 | - }]); | |
| 4697 | -}(); | |
| 4698 | - | |
| 4699 | -/***/ }), | |
| 4700 | - | |
| 4701 | -/***/ "../modules/web-cli/assets/js/extras/hash-commands.js": | |
| 4702 | -/*!************************************************************!*\ | |
| 4703 | - !*** ../modules/web-cli/assets/js/extras/hash-commands.js ***! | |
| 4704 | - \************************************************************/ | |
| 4705 | -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 4706 | - | |
| 4707 | -"use strict"; | |
| 4708 | - | |
| 4709 | - | |
| 4710 | -var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 4711 | -Object.defineProperty(exports, "__esModule", ({ | |
| 4712 | - value: true | |
| 4713 | -})); | |
| 4714 | -exports["default"] = void 0; | |
| 4715 | -var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ "../node_modules/@babel/runtime/regenerator/index.js")); | |
| 4716 | -var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "../node_modules/@babel/runtime/helpers/asyncToGenerator.js")); | |
| 4717 | -var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js")); | |
| 4718 | -var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 4719 | -var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 4720 | -var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js")); | |
| 4721 | -var _console = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/console */ "../modules/web-cli/assets/js/utils/console.js")); | |
| 4722 | -function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, 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 o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; } | |
| 4723 | -function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); 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; } } | |
| 4724 | -function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } | |
| 4725 | -var HashCommands = exports["default"] = /*#__PURE__*/function () { | |
| 4726 | - function HashCommands() { | |
| 4727 | - (0, _classCallCheck2.default)(this, HashCommands); | |
| 4728 | - /** | |
| 4729 | - * Cannot be static since it uses callback(s) that are available only after '$e' is initialized. | |
| 4730 | - */ | |
| 4731 | - (0, _defineProperty2.default)(this, "dispatchersList", { | |
| 4732 | - 'e:run': { | |
| 4733 | - runner: function runner() { | |
| 4734 | - return $e.run; | |
| 4735 | - }, | |
| 4736 | - isSafe: function isSafe(command) { | |
| 4737 | - var _$e$commands$getComma; | |
| 4738 | - return (_$e$commands$getComma = $e.commands.getCommandClass(command)) === null || _$e$commands$getComma === void 0 ? void 0 : _$e$commands$getComma.getInfo().isSafe; | |
| 4739 | - }, | |
| 4740 | - isSafeWithArgs: function isSafeWithArgs(command) { | |
| 4741 | - var _$e$commands$getComma2; | |
| 4742 | - return (_$e$commands$getComma2 = $e.commands.getCommandClass(command)) === null || _$e$commands$getComma2 === void 0 ? void 0 : _$e$commands$getComma2.getInfo().isSafeWithArgs; | |
| 4743 | - } | |
| 4744 | - }, | |
| 4745 | - 'e:route': { | |
| 4746 | - runner: function runner() { | |
| 4747 | - return $e.route; | |
| 4748 | - }, | |
| 4749 | - isSafe: function isSafe() { | |
| 4750 | - return true; | |
| 4751 | - }, | |
| 4752 | - isSafeWithArgs: function isSafeWithArgs() { | |
| 4753 | - return false; | |
| 4754 | - } | |
| 4755 | - } | |
| 4756 | - }); | |
| 4757 | - /** | |
| 4758 | - * @typedef HashCommand | |
| 4759 | - * @property {string} method method | |
| 4760 | - * @property {string} command command | |
| 4761 | - * @property {Object} args arguments | |
| 4762 | - */ | |
| 4763 | - /** | |
| 4764 | - * List of current loaded hash commands. | |
| 4765 | - * | |
| 4766 | - * @type {Array.<HashCommand>} | |
| 4767 | - */ | |
| 4768 | - (0, _defineProperty2.default)(this, "commands", []); | |
| 4769 | - this.commands = this.get(); | |
| 4770 | - } | |
| 4771 | - | |
| 4772 | - /** | |
| 4773 | - * Function get(). | |
| 4774 | - * | |
| 4775 | - * Get API requests that comes from hash ( eg #e:run ). | |
| 4776 | - * | |
| 4777 | - * @param {string} hash | |
| 4778 | - * | |
| 4779 | - * @return {Array.<HashCommand>} API requests | |
| 4780 | - */ | |
| 4781 | - return (0, _createClass2.default)(HashCommands, [{ | |
| 4782 | - key: "get", | |
| 4783 | - value: function get() { | |
| 4784 | - var _this = this; | |
| 4785 | - var hash = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : location.hash; | |
| 4786 | - var result = []; | |
| 4787 | - if (hash) { | |
| 4788 | - // Remove first '#' and split each '&'. | |
| 4789 | - var hashList = hash.substr(1).split('&'); | |
| 4790 | - hashList.forEach(function (hashItem) { | |
| 4791 | - // eslint-disable-next-line @wordpress/no-unused-vars-before-return | |
| 4792 | - var _hashItem$split = hashItem.split('?'), | |
| 4793 | - _hashItem$split2 = (0, _slicedToArray2.default)(_hashItem$split, 2), | |
| 4794 | - rawCommand = _hashItem$split2[0], | |
| 4795 | - rawArgs = _hashItem$split2[1]; | |
| 4796 | - var hashParts = rawCommand.split(':'); | |
| 4797 | - if (3 !== hashParts.length) { | |
| 4798 | - return; | |
| 4799 | - } | |
| 4800 | - var method = hashParts[0] + ':' + hashParts[1], | |
| 4801 | - dispatcher = _this.dispatchersList[method]; | |
| 4802 | - if (dispatcher) { | |
| 4803 | - var command = hashParts[2], | |
| 4804 | - args = _this.parseCommandArgs(rawArgs); | |
| 4805 | - result.push({ | |
| 4806 | - method: method, | |
| 4807 | - command: command, | |
| 4808 | - args: args | |
| 4809 | - }); | |
| 4810 | - } | |
| 4811 | - }); | |
| 4812 | - } | |
| 4813 | - return result; | |
| 4814 | - } | |
| 4815 | - | |
| 4816 | - /** | |
| 4817 | - * Function run(). | |
| 4818 | - * | |
| 4819 | - * Run API requests that comes from hash ( eg #e:run ). | |
| 4820 | - * | |
| 4821 | - * @param {Array.<HashCommand>} [commands=this.commands] | |
| 4822 | - */ | |
| 4823 | - }, { | |
| 4824 | - key: "run", | |
| 4825 | - value: (function () { | |
| 4826 | - var _run = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee() { | |
| 4827 | - var commands, | |
| 4828 | - _iterator, | |
| 4829 | - _step, | |
| 4830 | - hashCommand, | |
| 4831 | - dispatcher, | |
| 4832 | - _iterator2, | |
| 4833 | - _step2, | |
| 4834 | - _hashCommand, | |
| 4835 | - _dispatcher, | |
| 4836 | - _args = arguments, | |
| 4837 | - _t, | |
| 4838 | - _t2; | |
| 4839 | - return _regenerator.default.wrap(function (_context) { | |
| 4840 | - while (1) switch (_context.prev = _context.next) { | |
| 4841 | - case 0: | |
| 4842 | - commands = _args.length > 0 && _args[0] !== undefined ? _args[0] : this.commands; | |
| 4843 | - // To allow validate the run first. | |
| 4844 | - _iterator = _createForOfIteratorHelper(commands); | |
| 4845 | - _context.prev = 1; | |
| 4846 | - _iterator.s(); | |
| 4847 | - case 2: | |
| 4848 | - if ((_step = _iterator.n()).done) { | |
| 4849 | - _context.next = 5; | |
| 4850 | - break; | |
| 4851 | - } | |
| 4852 | - hashCommand = _step.value; | |
| 4853 | - dispatcher = this.dispatchersList[hashCommand.method]; | |
| 4854 | - if (dispatcher) { | |
| 4855 | - _context.next = 3; | |
| 4856 | - break; | |
| 4857 | - } | |
| 4858 | - return _context.abrupt("return", Promise.reject(new Error("No dispatcher found for the command: `".concat(hashCommand.command, "`.")))); | |
| 4859 | - case 3: | |
| 4860 | - if (dispatcher.isSafe(hashCommand.command)) { | |
| 4861 | - _context.next = 4; | |
| 4862 | - break; | |
| 4863 | - } | |
| 4864 | - return _context.abrupt("return", Promise.reject(new Error("Attempting to run unsafe or non exist command: `".concat(hashCommand.command, "`.")))); | |
| 4865 | - case 4: | |
| 4866 | - _context.next = 2; | |
| 4867 | - break; | |
| 4868 | - case 5: | |
| 4869 | - _context.next = 7; | |
| 4870 | - break; | |
| 4871 | - case 6: | |
| 4872 | - _context.prev = 6; | |
| 4873 | - _t = _context["catch"](1); | |
| 4874 | - _iterator.e(_t); | |
| 4875 | - case 7: | |
| 4876 | - _context.prev = 7; | |
| 4877 | - _iterator.f(); | |
| 4878 | - return _context.finish(7); | |
| 4879 | - case 8: | |
| 4880 | - // This logic will run the promises by sequence (will wait for dispatcher to finish, before run again). | |
| 4881 | - _iterator2 = _createForOfIteratorHelper(commands); | |
| 4882 | - _context.prev = 9; | |
| 4883 | - _iterator2.s(); | |
| 4884 | - case 10: | |
| 4885 | - if ((_step2 = _iterator2.n()).done) { | |
| 4886 | - _context.next = 12; | |
| 4887 | - break; | |
| 4888 | - } | |
| 4889 | - _hashCommand = _step2.value; | |
| 4890 | - _dispatcher = this.dispatchersList[_hashCommand.method]; | |
| 4891 | - _context.next = 11; | |
| 4892 | - return _dispatcher.runner()(_hashCommand.command, _dispatcher.isSafeWithArgs(_hashCommand.command) ? _hashCommand.args : undefined); | |
| 4893 | - case 11: | |
| 4894 | - _context.next = 10; | |
| 4895 | - break; | |
| 4896 | - case 12: | |
| 4897 | - _context.next = 14; | |
| 4898 | - break; | |
| 4899 | - case 13: | |
| 4900 | - _context.prev = 13; | |
| 4901 | - _t2 = _context["catch"](9); | |
| 4902 | - _iterator2.e(_t2); | |
| 4903 | - case 14: | |
| 4904 | - _context.prev = 14; | |
| 4905 | - _iterator2.f(); | |
| 4906 | - return _context.finish(14); | |
| 4907 | - case 15: | |
| 4908 | - case "end": | |
| 4909 | - return _context.stop(); | |
| 4910 | - } | |
| 4911 | - }, _callee, this, [[1, 6, 7, 8], [9, 13, 14, 15]]); | |
| 4912 | - })); | |
| 4913 | - function run() { | |
| 4914 | - return _run.apply(this, arguments); | |
| 4915 | - } | |
| 4916 | - return run; | |
| 4917 | - }() | |
| 4918 | - /** | |
| 4919 | - * Function runOnce(). | |
| 4920 | - * | |
| 4921 | - * Do same as `run` but clear `this.commands` before leaving. | |
| 4922 | - */ | |
| 4923 | - ) | |
| 4924 | - }, { | |
| 4925 | - key: "runOnce", | |
| 4926 | - value: function runOnce() { | |
| 4927 | - var _this2 = this; | |
| 4928 | - this.run(this.commands).then(function () { | |
| 4929 | - _this2.commands = []; | |
| 4930 | - }); | |
| 4931 | - } | |
| 4932 | - | |
| 4933 | - /** | |
| 4934 | - * Takes a args in form of JSON and parse it. | |
| 4935 | - * | |
| 4936 | - * @param {string} rawArgs | |
| 4937 | - * @return {Object} args in as an object | |
| 4938 | - */ | |
| 4939 | - }, { | |
| 4940 | - key: "parseCommandArgs", | |
| 4941 | - value: function parseCommandArgs(rawArgs) { | |
| 4942 | - try { | |
| 4943 | - return JSON.parse(decodeURI(rawArgs || '{}')); | |
| 4944 | - } catch (e) { | |
| 4945 | - _console.default.warn('Hash commands JSON args cannot be parsed. \n\n', e); | |
| 4946 | - return {}; | |
| 4947 | - } | |
| 4948 | - } | |
| 4949 | - }]); | |
| 4950 | -}(); | |
| 4951 | - | |
| 4952 | -/***/ }), | |
| 4953 | - | |
| 4954 | -/***/ "../modules/web-cli/assets/js/modules/command-base.js": | |
| 4955 | -/*!************************************************************!*\ | |
| 4956 | - !*** ../modules/web-cli/assets/js/modules/command-base.js ***! | |
| 4957 | - \************************************************************/ | |
| 4958 | -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 4959 | - | |
| 4960 | -"use strict"; | |
| 4961 | - | |
| 4962 | - | |
| 4963 | -var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 4964 | -Object.defineProperty(exports, "__esModule", ({ | |
| 4965 | - value: true | |
| 4966 | -})); | |
| 4967 | -exports["default"] = void 0; | |
| 4968 | -var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 4969 | -var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 4970 | -var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 4971 | -var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 4972 | -var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 4973 | -var _commandInfra = _interopRequireDefault(__webpack_require__(/*! ./command-infra */ "../modules/web-cli/assets/js/modules/command-infra.js")); | |
| 4974 | -var _deprecation = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/deprecation */ "../modules/web-cli/assets/js/utils/deprecation.js")); | |
| 4975 | -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)); } | |
| 4976 | -function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } | |
| 4977 | -/** | |
| 4978 | - * @name $e.modules.CommandBase | |
| 4979 | - */ | |
| 4980 | -var CommandBase = exports["default"] = /*#__PURE__*/function (_CommandInfra) { | |
| 4981 | - function CommandBase() { | |
| 4982 | - (0, _classCallCheck2.default)(this, CommandBase); | |
| 4983 | - return _callSuper(this, CommandBase, arguments); | |
| 4984 | - } | |
| 4985 | - (0, _inherits2.default)(CommandBase, _CommandInfra); | |
| 4986 | - return (0, _createClass2.default)(CommandBase, [{ | |
| 4987 | - key: "onBeforeRun", | |
| 4988 | - value: function onBeforeRun() { | |
| 4989 | - var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | |
| 4990 | - $e.hooks.runUIBefore(this.command, args); | |
| 4991 | - } | |
| 4992 | - }, { | |
| 4993 | - key: "onAfterRun", | |
| 4994 | - value: function onAfterRun() { | |
| 4995 | - var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | |
| 4996 | - var result = arguments.length > 1 ? arguments[1] : undefined; | |
| 4997 | - $e.hooks.runUIAfter(this.command, args, result); | |
| 4998 | - } | |
| 4999 | - }, { | |
| 5000 | - key: "onBeforeApply", | |
| 5001 | - value: function onBeforeApply() { | |
| 5002 | - var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | |
| 5003 | - $e.hooks.runDataDependency(this.command, args); | |
| 5004 | - } | |
| 5005 | - }, { | |
| 5006 | - key: "onAfterApply", | |
| 5007 | - value: function onAfterApply() { | |
| 5008 | - var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | |
| 5009 | - var result = arguments.length > 1 ? arguments[1] : undefined; | |
| 5010 | - return $e.hooks.runDataAfter(this.command, args, result); | |
| 5011 | - } | |
| 5012 | - }, { | |
| 5013 | - key: "onCatchApply", | |
| 5014 | - value: function onCatchApply(e) { | |
| 5015 | - this.runCatchHooks(e); | |
| 5016 | - } | |
| 5017 | - | |
| 5018 | - /** | |
| 5019 | - * Run all the catch hooks. | |
| 5020 | - * | |
| 5021 | - * @param {Error} e | |
| 5022 | - */ | |
| 5023 | - }, { | |
| 5024 | - key: "runCatchHooks", | |
| 5025 | - value: function runCatchHooks(e) { | |
| 5026 | - $e.hooks.runDataCatch(this.command, this.args, e); | |
| 5027 | - $e.hooks.runUICatch(this.command, this.args, e); | |
| 5028 | - } | |
| 5029 | - | |
| 5030 | - /** | |
| 5031 | - * TODO - Remove - Backwards compatibility. | |
| 5032 | - * | |
| 5033 | - * Function requireContainer(). | |
| 5034 | - * | |
| 5035 | - * Validate `arg.container` & `arg.containers`. | |
| 5036 | - * | |
| 5037 | - * @param {{}} args | |
| 5038 | - * @deprecated since 3.7.0, extend `$e.modules.editor.CommandContainerBase` or `$e.modules.editor.CommandContainerInternalBase` instead. | |
| 5039 | - * | |
| 5040 | - * @throws {Error} | |
| 5041 | - */ | |
| 5042 | - }, { | |
| 5043 | - key: "requireContainer", | |
| 5044 | - value: function requireContainer() { | |
| 5045 | - var _this = this; | |
| 5046 | - var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.args; | |
| 5047 | - _deprecation.default.deprecated('requireContainer()', '3.7.0', 'Extend `$e.modules.editor.CommandContainerBase` or `$e.modules.editor.CommandContainerInternalBase`'); | |
| 5048 | - if (!args.container && !args.containers) { | |
| 5049 | - throw Error('container or containers are required.'); | |
| 5050 | - } | |
| 5051 | - if (args.container && args.containers) { | |
| 5052 | - throw Error('container and containers cannot go together please select one of them.'); | |
| 5053 | - } | |
| 5054 | - var containers = args.containers || [args.container]; | |
| 5055 | - containers.forEach(function (container) { | |
| 5056 | - _this.requireArgumentInstance('container', elementorModules.editor.Container, { | |
| 5057 | - container: container | |
| 5058 | - }); | |
| 5059 | - }); | |
| 5060 | - } | |
| 5061 | - }], [{ | |
| 5062 | - key: "getInstanceType", | |
| 5063 | - value: function getInstanceType() { | |
| 5064 | - return 'CommandBase'; | |
| 5065 | - } | |
| 5066 | - }]); | |
| 5067 | -}(_commandInfra.default); | |
| 5068 | - | |
| 5069 | -/***/ }), | |
| 5070 | - | |
| 5071 | -/***/ "../modules/web-cli/assets/js/modules/command-callback-base.js": | |
| 5072 | -/*!*********************************************************************!*\ | |
| 5073 | - !*** ../modules/web-cli/assets/js/modules/command-callback-base.js ***! | |
| 5074 | - \*********************************************************************/ | |
| 5075 | -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 5076 | - | |
| 5077 | -"use strict"; | |
| 5078 | - | |
| 5079 | - | |
| 5080 | -var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 5081 | -Object.defineProperty(exports, "__esModule", ({ | |
| 5082 | - value: true | |
| 5083 | -})); | |
| 5084 | -exports["default"] = void 0; | |
| 5085 | -var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 5086 | -var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 5087 | -var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 5088 | -var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 5089 | -var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 5090 | -var _commandBase = _interopRequireDefault(__webpack_require__(/*! ./command-base */ "../modules/web-cli/assets/js/modules/command-base.js")); | |
| 5091 | -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)); } | |
| 5092 | -function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } | |
| 5093 | -/** | |
| 5094 | - * To support pure callbacks in the API(commands.js), to ensure they have registered with the proper context. | |
| 5095 | - */ | |
| 5096 | -var CommandCallbackBase = exports["default"] = /*#__PURE__*/function (_CommandBase) { | |
| 5097 | - function CommandCallbackBase() { | |
| 5098 | - (0, _classCallCheck2.default)(this, CommandCallbackBase); | |
| 5099 | - return _callSuper(this, CommandCallbackBase, arguments); | |
| 5100 | - } | |
| 5101 | - (0, _inherits2.default)(CommandCallbackBase, _CommandBase); | |
| 5102 | - return (0, _createClass2.default)(CommandCallbackBase, [{ | |
| 5103 | - key: "apply", | |
| 5104 | - value: function apply() { | |
| 5105 | - var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | |
| 5106 | - return this.constructor.getCallback()(args); | |
| 5107 | - } | |
| 5108 | - }], [{ | |
| 5109 | - key: "getInstanceType", | |
| 5110 | - value: function getInstanceType() { | |
| 5111 | - return 'CommandCallbackBase'; | |
| 5112 | - } | |
| 5113 | - | |
| 5114 | - /** | |
| 5115 | - * Get original callback of the command. | |
| 5116 | - * | |
| 5117 | - * Support pure callbacks ( Non command-base ). | |
| 5118 | - * | |
| 5119 | - * @return {()=>{}} Command Results. | |
| 5120 | - */ | |
| 5121 | - }, { | |
| 5122 | - key: "getCallback", | |
| 5123 | - value: function getCallback() { | |
| 5124 | - return this.registerConfig.callback; | |
| 5125 | - } | |
| 5126 | - }]); | |
| 5127 | -}(_commandBase.default); | |
| 5128 | - | |
| 5129 | -/***/ }), | |
| 5130 | - | |
| 5131 | -/***/ "../modules/web-cli/assets/js/modules/command-data.js": | |
| 5132 | -/*!************************************************************!*\ | |
| 5133 | - !*** ../modules/web-cli/assets/js/modules/command-data.js ***! | |
| 5134 | - \************************************************************/ | |
| 5135 | -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 5136 | - | |
| 5137 | -"use strict"; | |
| 5138 | - | |
| 5139 | - | |
| 5140 | -var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 5141 | -var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js"); | |
| 5142 | -Object.defineProperty(exports, "__esModule", ({ | |
| 5143 | - value: true | |
| 5144 | -})); | |
| 5145 | -exports["default"] = void 0; | |
| 5146 | -var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 5147 | -var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 5148 | -var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 5149 | -var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 5150 | -var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 5151 | -var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js")); | |
| 5152 | -var _commandBase = _interopRequireDefault(__webpack_require__(/*! ./command-base */ "../modules/web-cli/assets/js/modules/command-base.js")); | |
| 5153 | -var errors = _interopRequireWildcard(__webpack_require__(/*! ../core/data/errors/ */ "../modules/web-cli/assets/js/core/data/errors/index.js")); | |
| 5154 | -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); } | |
| 5155 | -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)); } | |
| 5156 | -function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } | |
| 5157 | -/** | |
| 5158 | - * @name $e.modules.CommandData | |
| 5159 | - */ | |
| 5160 | -/** | |
| 5161 | - * @typedef {('create'|'delete'|'get'|'update'|'options')} DataTypes | |
| 5162 | - */ | |
| 5163 | -/** | |
| 5164 | - * @typedef {{}} RequestData | |
| 5165 | - */ | |
| 5166 | -/** | |
| 5167 | - * @typedef {import('../core/data/errors/base-error')} BaseError | |
| 5168 | - */ | |
| 5169 | -var CommandData = exports["default"] = /*#__PURE__*/function (_CommandBase) { | |
| 5170 | - function CommandData(args) { | |
| 5171 | - var _this$args$options; | |
| 5172 | - var _this; | |
| 5173 | - var commandsAPI = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : $e.data; | |
| 5174 | - (0, _classCallCheck2.default)(this, CommandData); | |
| 5175 | - _this = _callSuper(this, CommandData, [args, commandsAPI]); | |
| 5176 | - /** | |
| 5177 | - * Data returned from remote. | |
| 5178 | - * | |
| 5179 | - * @type {*} | |
| 5180 | - */ | |
| 5181 | - (0, _defineProperty2.default)(_this, "data", void 0); | |
| 5182 | - /** | |
| 5183 | - * Fetch type. | |
| 5184 | - * | |
| 5185 | - * @type {DataTypes} | |
| 5186 | - */ | |
| 5187 | - (0, _defineProperty2.default)(_this, "type", void 0); | |
| 5188 | - if ((_this$args$options = _this.args.options) !== null && _this$args$options !== void 0 && _this$args$options.type) { | |
| 5189 | - _this.type = _this.args.options.type; | |
| 5190 | - } | |
| 5191 | - return _this; | |
| 5192 | - } | |
| 5193 | - | |
| 5194 | - /** | |
| 5195 | - * Function getEndpointFormat(). | |
| 5196 | - * | |
| 5197 | - * @return {null|string} endpoint format | |
| 5198 | - */ | |
| 5199 | - (0, _inherits2.default)(CommandData, _CommandBase); | |
| 5200 | - return (0, _createClass2.default)(CommandData, [{ | |
| 5201 | - key: "getApplyMethods", | |
| 5202 | - value: | |
| 5203 | - /** | |
| 5204 | - * @param {DataTypes} type | |
| 5205 | - * | |
| 5206 | - * @return {boolean|{before: (function(*=): {}), after: (function({}, *=): {})}} apply methods | |
| 5207 | - */ | |
| 5208 | - function getApplyMethods() { | |
| 5209 | - var type = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.type; | |
| 5210 | - var before, after; | |
| 5211 | - switch (type) { | |
| 5212 | - case 'create': | |
| 5213 | - before = this.applyBeforeCreate; | |
| 5214 | - after = this.applyAfterCreate; | |
| 5215 | - break; | |
| 5216 | - case 'delete': | |
| 5217 | - before = this.applyBeforeDelete; | |
| 5218 | - after = this.applyAfterDelete; | |
| 5219 | - break; | |
| 5220 | - case 'get': | |
| 5221 | - before = this.applyBeforeGet; | |
| 5222 | - after = this.applyAfterGet; | |
| 5223 | - break; | |
| 5224 | - case 'update': | |
| 5225 | - before = this.applyBeforeUpdate; | |
| 5226 | - after = this.applyAfterUpdate; | |
| 5227 | - break; | |
| 5228 | - case 'options': | |
| 5229 | - before = this.applyBeforeOptions; | |
| 5230 | - after = this.applyAfterOptions; | |
| 5231 | - break; | |
| 5232 | - default: | |
| 5233 | - return false; | |
| 5234 | - } | |
| 5235 | - return { | |
| 5236 | - before: before.bind(this), | |
| 5237 | - after: after.bind(this) | |
| 5238 | - }; | |
| 5239 | - } | |
| 5240 | - | |
| 5241 | - /** | |
| 5242 | - * Function getRequestData(). | |
| 5243 | - * | |
| 5244 | - * @return {RequestData} request data | |
| 5245 | - */ | |
| 5246 | - }, { | |
| 5247 | - key: "getRequestData", | |
| 5248 | - value: function getRequestData() { | |
| 5249 | - return { | |
| 5250 | - type: this.type, | |
| 5251 | - args: this.args, | |
| 5252 | - timestamp: new Date().getTime(), | |
| 5253 | - component: this.component, | |
| 5254 | - command: this.command, | |
| 5255 | - endpoint: $e.data.commandToEndpoint(this.command, JSON.parse(JSON.stringify(this.args)), this.constructor.getEndpointFormat()) | |
| 5256 | - }; | |
| 5257 | - } | |
| 5258 | - }, { | |
| 5259 | - key: "apply", | |
| 5260 | - value: function apply() { | |
| 5261 | - var _this2 = this; | |
| 5262 | - var applyMethods = this.getApplyMethods(); | |
| 5263 | - | |
| 5264 | - // Run 'before' method. | |
| 5265 | - this.args = applyMethods.before(this.args); | |
| 5266 | - var requestData = this.getRequestData(); | |
| 5267 | - return $e.data.fetch(requestData).then(function (data) { | |
| 5268 | - _this2.data = data; | |
| 5269 | - | |
| 5270 | - // Run 'after' method. | |
| 5271 | - _this2.data = applyMethods.after(data, _this2.args); | |
| 5272 | - _this2.data = { | |
| 5273 | - data: _this2.data | |
| 5274 | - }; | |
| 5275 | - | |
| 5276 | - // Append requestData. | |
| 5277 | - _this2.data = Object.assign({ | |
| 5278 | - __requestData__: requestData | |
| 5279 | - }, _this2.data); | |
| 5280 | - return _this2.data; | |
| 5281 | - }); | |
| 5282 | - } | |
| 5283 | - | |
| 5284 | - /** | |
| 5285 | - * @param {*} [args={}] | |
| 5286 | - * @return {{}} filtered args | |
| 5287 | - */ | |
| 5288 | - }, { | |
| 5289 | - key: "applyBeforeCreate", | |
| 5290 | - value: function applyBeforeCreate() { | |
| 5291 | - var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | |
| 5292 | - return args; | |
| 5293 | - } | |
| 5294 | - | |
| 5295 | - /** | |
| 5296 | - * @param {{}} data | |
| 5297 | - * @param {*} [args={}] | |
| 5298 | - * @return {{}} filtered result | |
| 5299 | - */ | |
| 5300 | - }, { | |
| 5301 | - key: "applyAfterCreate", | |
| 5302 | - value: function applyAfterCreate(data) { | |
| 5303 | - var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | |
| 5304 | - // eslint-disable-line no-unused-vars | |
| 5305 | - return data; | |
| 5306 | - } | |
| 5307 | - | |
| 5308 | - /** | |
| 5309 | - * @param {*} [args={}] | |
| 5310 | - * @return {{}} filtered args | |
| 5311 | - */ | |
| 5312 | - }, { | |
| 5313 | - key: "applyBeforeDelete", | |
| 5314 | - value: function applyBeforeDelete() { | |
| 5315 | - var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | |
| 5316 | - return args; | |
| 5317 | - } | |
| 5318 | - | |
| 5319 | - /** | |
| 5320 | - * @param {{}} data | |
| 5321 | - * @param {*} [args={}] | |
| 5322 | - * @return {{}} filtered result | |
| 5323 | - */ | |
| 5324 | - }, { | |
| 5325 | - key: "applyAfterDelete", | |
| 5326 | - value: function applyAfterDelete(data) { | |
| 5327 | - var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | |
| 5328 | - // eslint-disable-line no-unused-vars | |
| 5329 | - return data; | |
| 5330 | - } | |
| 5331 | - | |
| 5332 | - /** | |
| 5333 | - * @param {*} [args={}] | |
| 5334 | - * @return {{}} filtered args | |
| 5335 | - */ | |
| 5336 | - }, { | |
| 5337 | - key: "applyBeforeGet", | |
| 5338 | - value: function applyBeforeGet() { | |
| 5339 | - var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | |
| 5340 | - return args; | |
| 5341 | - } | |
| 5342 | - | |
| 5343 | - /** | |
| 5344 | - * @param {{}} data | |
| 5345 | - * @param {*} [args={}] | |
| 5346 | - * @return {{}} filtered result | |
| 5347 | - */ | |
| 5348 | - }, { | |
| 5349 | - key: "applyAfterGet", | |
| 5350 | - value: function applyAfterGet(data) { | |
| 5351 | - var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | |
| 5352 | - // eslint-disable-line no-unused-vars | |
| 5353 | - return data; | |
| 5354 | - } | |
| 5355 | - | |
| 5356 | - /** | |
| 5357 | - * @param {*} [args={}] | |
| 5358 | - * @return {{}} filtered args | |
| 5359 | - */ | |
| 5360 | - }, { | |
| 5361 | - key: "applyBeforeUpdate", | |
| 5362 | - value: function applyBeforeUpdate() { | |
| 5363 | - var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | |
| 5364 | - return args; | |
| 5365 | - } | |
| 5366 | - | |
| 5367 | - /** | |
| 5368 | - * @param {{}} data | |
| 5369 | - * @param {*} [args={}] | |
| 5370 | - * @return {{}} filtered result | |
| 5371 | - */ | |
| 5372 | - }, { | |
| 5373 | - key: "applyAfterUpdate", | |
| 5374 | - value: function applyAfterUpdate(data) { | |
| 5375 | - var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | |
| 5376 | - // eslint-disable-line no-unused-vars | |
| 5377 | - return data; | |
| 5378 | - } | |
| 5379 | - | |
| 5380 | - /** | |
| 5381 | - * @param {*} [args={}] | |
| 5382 | - * @return {{}} filtered args | |
| 5383 | - */ | |
| 5384 | - }, { | |
| 5385 | - key: "applyBeforeOptions", | |
| 5386 | - value: function applyBeforeOptions() { | |
| 5387 | - var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | |
| 5388 | - return args; | |
| 5389 | - } | |
| 5390 | - | |
| 5391 | - /** | |
| 5392 | - * @param {{}} data | |
| 5393 | - * @param {*} [args={}] | |
| 5394 | - * @return {{}} filtered result | |
| 5395 | - */ | |
| 5396 | - }, { | |
| 5397 | - key: "applyAfterOptions", | |
| 5398 | - value: function applyAfterOptions(data) { | |
| 5399 | - var args = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | |
| 5400 | - // eslint-disable-line no-unused-vars | |
| 5401 | - return data; | |
| 5402 | - } | |
| 5403 | - | |
| 5404 | - /** | |
| 5405 | - * @param {BaseError} e | |
| 5406 | - */ | |
| 5407 | - }, { | |
| 5408 | - key: "applyAfterCatch", | |
| 5409 | - value: function applyAfterCatch(e) { | |
| 5410 | - e.notify(); | |
| 5411 | - } | |
| 5412 | - }, { | |
| 5413 | - key: "onCatchApply", | |
| 5414 | - value: function onCatchApply(e) { | |
| 5415 | - var _e; | |
| 5416 | - // TODO: If the errors that returns from the server is consistent remove the '?' from 'e' | |
| 5417 | - var httpErrorCode = ((_e = e) === null || _e === void 0 || (_e = _e.data) === null || _e === void 0 ? void 0 : _e.status) || 501; | |
| 5418 | - var dataError = Object.values(errors).find(function (error) { | |
| 5419 | - return error.getHTTPErrorCode() === httpErrorCode; | |
| 5420 | - }); | |
| 5421 | - if (!dataError) { | |
| 5422 | - dataError = errors.DefaultError; | |
| 5423 | - } | |
| 5424 | - e = dataError.create(e.message, e.code, e.data || []); | |
| 5425 | - this.runCatchHooks(e); | |
| 5426 | - this.applyAfterCatch(e); | |
| 5427 | - } | |
| 5428 | - }], [{ | |
| 5429 | - key: "getInstanceType", | |
| 5430 | - value: function getInstanceType() { | |
| 5431 | - return 'CommandData'; | |
| 5432 | - } | |
| 5433 | - }, { | |
| 5434 | - key: "getEndpointFormat", | |
| 5435 | - value: function getEndpointFormat() { | |
| 5436 | - return null; | |
| 5437 | - } | |
| 5438 | - }]); | |
| 5439 | -}(_commandBase.default); | |
| 5440 | - | |
| 5441 | -/***/ }), | |
| 5442 | - | |
| 5443 | -/***/ "../modules/web-cli/assets/js/modules/command-infra.js": | |
| 5444 | -/*!*************************************************************!*\ | |
| 5445 | - !*** ../modules/web-cli/assets/js/modules/command-infra.js ***! | |
| 5446 | - \*************************************************************/ | |
| 5447 | -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 5448 | - | |
| 5449 | -"use strict"; | |
| 5450 | - | |
| 5451 | - | |
| 5452 | -var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 5453 | -Object.defineProperty(exports, "__esModule", ({ | |
| 5454 | - value: true | |
| 5455 | -})); | |
| 5456 | -exports["default"] = void 0; | |
| 5457 | -var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 5458 | -var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 5459 | -var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 5460 | -var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 5461 | -var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 5462 | -var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js")); | |
| 5463 | -var _argsObject = _interopRequireDefault(__webpack_require__(/*! elementor-assets-js/modules/imports/args-object */ "../assets/dev/js/modules/imports/args-object.js")); | |
| 5464 | -var _deprecation = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/deprecation */ "../modules/web-cli/assets/js/utils/deprecation.js")); | |
| 5465 | -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)); } | |
| 5466 | -function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } | |
| 5467 | -/** | |
| 5468 | - * @typedef {import('../modules/component-base')} ComponentBase | |
| 5469 | - */ | |
| 5470 | -var CommandInfra = exports["default"] = /*#__PURE__*/function (_ArgsObject) { | |
| 5471 | - /** | |
| 5472 | - * Function constructor(). | |
| 5473 | - * | |
| 5474 | - * Create Commands Base. | |
| 5475 | - * | |
| 5476 | - * @param {{}} args | |
| 5477 | - */ | |
| 5478 | - function CommandInfra() { | |
| 5479 | - var _this; | |
| 5480 | - var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | |
| 5481 | - (0, _classCallCheck2.default)(this, CommandInfra); | |
| 5482 | - _this = _callSuper(this, CommandInfra, [args]); | |
| 5483 | - if (!_this.constructor.registerConfig) { | |
| 5484 | - throw RangeError('Doing it wrong: Each command type should have `registerConfig`.'); | |
| 5485 | - } | |
| 5486 | - | |
| 5487 | - // Acknowledge self about which command it run. | |
| 5488 | - _this.command = _this.constructor.getCommand(); | |
| 5489 | - | |
| 5490 | - // Assign instance of current component. | |
| 5491 | - _this.component = _this.constructor.getComponent(); | |
| 5492 | - | |
| 5493 | - // Who ever need do something before without `super` the constructor can use `initialize` method. | |
| 5494 | - _this.initialize(args); | |
| 5495 | - | |
| 5496 | - // Refresh args, maybe the changed via `initialize`. | |
| 5497 | - args = _this.args; | |
| 5498 | - | |
| 5499 | - // Validate args before run. | |
| 5500 | - _this.validateArgs(args); | |
| 5501 | - return _this; | |
| 5502 | - } | |
| 5503 | - | |
| 5504 | - /** | |
| 5505 | - * Function initialize(). | |
| 5506 | - * | |
| 5507 | - * Initialize command, called after construction. | |
| 5508 | - * | |
| 5509 | - * @param {{}} args | |
| 5510 | - */ | |
| 5511 | - (0, _inherits2.default)(CommandInfra, _ArgsObject); | |
| 5512 | - return (0, _createClass2.default)(CommandInfra, [{ | |
| 5513 | - key: "currentCommand", | |
| 5514 | - get: | |
| 5515 | - /** | |
| 5516 | - * @deprecated since 3.7.0, use `this.command` instead. | |
| 5517 | - */ | |
| 5518 | - function get() { | |
| 5519 | - _deprecation.default.deprecated('this.currentCommand', '3.7.0', 'this.command'); | |
| 5520 | - return this.command; | |
| 5521 | - } | |
| 5522 | - }, { | |
| 5523 | - key: "initialize", | |
| 5524 | - value: function initialize() { | |
| 5525 | - var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | |
| 5526 | - } // eslint-disable-line no-unused-vars | |
| 5527 | - | |
| 5528 | - /** | |
| 5529 | - * Function validateArgs(). | |
| 5530 | - * | |
| 5531 | - * Validate command arguments. | |
| 5532 | - * | |
| 5533 | - * @param {{}} args | |
| 5534 | - */ | |
| 5535 | - }, { | |
| 5536 | - key: "validateArgs", | |
| 5537 | - value: function validateArgs() { | |
| 5538 | - var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | |
| 5539 | - } // eslint-disable-line no-unused-vars | |
| 5540 | - | |
| 5541 | - // eslint-disable-next-line jsdoc/require-returns-check | |
| 5542 | - /** | |
| 5543 | - * Function apply(). | |
| 5544 | - * | |
| 5545 | - * Do the actual command. | |
| 5546 | - * | |
| 5547 | - * @param {{}} args | |
| 5548 | - * | |
| 5549 | - * @return {*} Command results. | |
| 5550 | - */ | |
| 5551 | - }, { | |
| 5552 | - key: "apply", | |
| 5553 | - value: function apply() { | |
| 5554 | - var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | |
| 5555 | - // eslint-disable-line no-unused-vars | |
| 5556 | - elementorModules.ForceMethodImplementation(); | |
| 5557 | - } | |
| 5558 | - | |
| 5559 | - /** | |
| 5560 | - * Function run(). | |
| 5561 | - * | |
| 5562 | - * Run command with history & hooks. | |
| 5563 | - * | |
| 5564 | - * @return {*} Command results. | |
| 5565 | - */ | |
| 5566 | - }, { | |
| 5567 | - key: "run", | |
| 5568 | - value: function run() { | |
| 5569 | - return this.apply(this.args); | |
| 5570 | - } | |
| 5571 | - | |
| 5572 | - /** | |
| 5573 | - * Function onBeforeRun. | |
| 5574 | - * | |
| 5575 | - * Called before run(). | |
| 5576 | - * | |
| 5577 | - * @param {{}} args | |
| 5578 | - */ | |
| 5579 | - }, { | |
| 5580 | - key: "onBeforeRun", | |
| 5581 | - value: function onBeforeRun() { | |
| 5582 | - var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | |
| 5583 | - } // eslint-disable-line no-unused-vars | |
| 5584 | - | |
| 5585 | - /** | |
| 5586 | - * Function onAfterRun. | |
| 5587 | - * | |
| 5588 | - * Called after run(). | |
| 5589 | - * | |
| 5590 | - * @param {{}} args | |
| 5591 | - * @param {*} result | |
| 5592 | - */ | |
| 5593 | - }, { | |
| 5594 | - key: "onAfterRun", | |
| 5595 | - value: function onAfterRun() { | |
| 5596 | - var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | |
| 5597 | - var result = arguments.length > 1 ? arguments[1] : undefined; | |
| 5598 | - } // eslint-disable-line no-unused-vars | |
| 5599 | - | |
| 5600 | - /** | |
| 5601 | - * Function onBeforeApply. | |
| 5602 | - * | |
| 5603 | - * Called before apply(). | |
| 5604 | - * | |
| 5605 | - * @param {{}} args | |
| 5606 | - */ | |
| 5607 | - }, { | |
| 5608 | - key: "onBeforeApply", | |
| 5609 | - value: function onBeforeApply() { | |
| 5610 | - var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | |
| 5611 | - } // eslint-disable-line no-unused-vars | |
| 5612 | - | |
| 5613 | - /** | |
| 5614 | - * Function onAfterApply. | |
| 5615 | - * | |
| 5616 | - * Called after apply(). | |
| 5617 | - * | |
| 5618 | - * @param {{}} args | |
| 5619 | - * @param {*} result | |
| 5620 | - */ | |
| 5621 | - }, { | |
| 5622 | - key: "onAfterApply", | |
| 5623 | - value: function onAfterApply() { | |
| 5624 | - var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | |
| 5625 | - var result = arguments.length > 1 ? arguments[1] : undefined; | |
| 5626 | - } // eslint-disable-line no-unused-vars | |
| 5627 | - | |
| 5628 | - /** | |
| 5629 | - * Function onCatchApply. | |
| 5630 | - * | |
| 5631 | - * Called after apply() failed. | |
| 5632 | - * | |
| 5633 | - * @param {Error} e | |
| 5634 | - */ | |
| 5635 | - }, { | |
| 5636 | - key: "onCatchApply", | |
| 5637 | - value: function onCatchApply(e) {} // eslint-disable-line no-unused-vars | |
| 5638 | - }], [{ | |
| 5639 | - key: "getInstanceType", | |
| 5640 | - value: function getInstanceType() { | |
| 5641 | - return 'CommandInfra'; | |
| 5642 | - } | |
| 5643 | - | |
| 5644 | - /** | |
| 5645 | - * Get info of command. | |
| 5646 | - * | |
| 5647 | - * @return {Object} Extra information about the command. | |
| 5648 | - */ | |
| 5649 | - }, { | |
| 5650 | - key: "getInfo", | |
| 5651 | - value: function getInfo() { | |
| 5652 | - return {}; | |
| 5653 | - } | |
| 5654 | - | |
| 5655 | - /** | |
| 5656 | - * @return {string} Self command name. | |
| 5657 | - */ | |
| 5658 | - }, { | |
| 5659 | - key: "getCommand", | |
| 5660 | - value: function getCommand() { | |
| 5661 | - return this.registerConfig.command; | |
| 5662 | - } | |
| 5663 | - | |
| 5664 | - /** | |
| 5665 | - * @return {ComponentBase} Self component | |
| 5666 | - */ | |
| 5667 | - }, { | |
| 5668 | - key: "getComponent", | |
| 5669 | - value: function getComponent() { | |
| 5670 | - return this.registerConfig.component; | |
| 5671 | - } | |
| 5672 | - }, { | |
| 5673 | - key: "setRegisterConfig", | |
| 5674 | - value: function setRegisterConfig(config) { | |
| 5675 | - this.registerConfig = Object.freeze(config); | |
| 5676 | - } | |
| 5677 | - }]); | |
| 5678 | -}(_argsObject.default); | |
| 5679 | -/** | |
| 5680 | - * @type {Object} | |
| 5681 | - */ | |
| 5682 | -(0, _defineProperty2.default)(CommandInfra, "registerConfig", null); | |
| 5683 | - | |
| 5684 | -/***/ }), | |
| 5685 | - | |
| 5686 | -/***/ "../modules/web-cli/assets/js/modules/command-internal-base.js": | |
| 5687 | -/*!*********************************************************************!*\ | |
| 5688 | - !*** ../modules/web-cli/assets/js/modules/command-internal-base.js ***! | |
| 5689 | - \*********************************************************************/ | |
| 5690 | -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 5691 | - | |
| 5692 | -"use strict"; | |
| 5693 | - | |
| 5694 | - | |
| 5695 | -var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 5696 | -Object.defineProperty(exports, "__esModule", ({ | |
| 5697 | - value: true | |
| 5698 | -})); | |
| 5699 | -exports["default"] = void 0; | |
| 5700 | -var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 5701 | -var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 5702 | -var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 5703 | -var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 5704 | -var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 5705 | -var _commandBase = _interopRequireDefault(__webpack_require__(/*! ./command-base */ "../modules/web-cli/assets/js/modules/command-base.js")); | |
| 5706 | -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)); } | |
| 5707 | -function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } | |
| 5708 | -/** | |
| 5709 | - * @name $e.modules.CommandInternalBase | |
| 5710 | - */ | |
| 5711 | -var CommandInternalBase = exports["default"] = /*#__PURE__*/function (_CommandBase) { | |
| 5712 | - function CommandInternalBase(args) { | |
| 5713 | - var commandsAPI = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : $e.commandsInternal; | |
| 5714 | - (0, _classCallCheck2.default)(this, CommandInternalBase); | |
| 5715 | - return _callSuper(this, CommandInternalBase, [args, commandsAPI]); | |
| 5716 | - } | |
| 5717 | - (0, _inherits2.default)(CommandInternalBase, _CommandBase); | |
| 5718 | - return (0, _createClass2.default)(CommandInternalBase, null, [{ | |
| 5719 | - key: "getInstanceType", | |
| 5720 | - value: function getInstanceType() { | |
| 5721 | - return 'CommandInternalBase'; | |
| 5722 | - } | |
| 5723 | - }]); | |
| 5724 | -}(_commandBase.default); | |
| 5725 | - | |
| 5726 | -/***/ }), | |
| 5727 | - | |
| 5728 | -/***/ "../modules/web-cli/assets/js/modules/commands/close.js": | |
| 5729 | -/*!**************************************************************!*\ | |
| 5730 | - !*** ../modules/web-cli/assets/js/modules/commands/close.js ***! | |
| 5731 | - \**************************************************************/ | |
| 5732 | -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 5733 | - | |
| 5734 | -"use strict"; | |
| 5735 | - | |
| 5736 | - | |
| 5737 | -var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 5738 | -Object.defineProperty(exports, "__esModule", ({ | |
| 5739 | - value: true | |
| 5740 | -})); | |
| 5741 | -exports["default"] = exports.Close = void 0; | |
| 5742 | -var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 5743 | -var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 5744 | -var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 5745 | -var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 5746 | -var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 5747 | -var _commandBase = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/command-base */ "../modules/web-cli/assets/js/modules/command-base.js")); | |
| 5748 | -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)); } | |
| 5749 | -function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } | |
| 5750 | -var Close = exports.Close = /*#__PURE__*/function (_CommandBase) { | |
| 5751 | - function Close() { | |
| 5752 | - (0, _classCallCheck2.default)(this, Close); | |
| 5753 | - return _callSuper(this, Close, arguments); | |
| 5754 | - } | |
| 5755 | - (0, _inherits2.default)(Close, _CommandBase); | |
| 5756 | - return (0, _createClass2.default)(Close, [{ | |
| 5757 | - key: "apply", | |
| 5758 | - value: function apply() { | |
| 5759 | - this.component.close(); | |
| 5760 | - } | |
| 5761 | - }]); | |
| 5762 | -}(_commandBase.default); | |
| 5763 | -var _default = exports["default"] = Close; | |
| 5764 | - | |
| 5765 | -/***/ }), | |
| 5766 | - | |
| 5767 | -/***/ "../modules/web-cli/assets/js/modules/commands/index.js": | |
| 5768 | -/*!**************************************************************!*\ | |
| 5769 | - !*** ../modules/web-cli/assets/js/modules/commands/index.js ***! | |
| 5770 | - \**************************************************************/ | |
| 5771 | -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 5772 | - | |
| 5773 | -"use strict"; | |
| 5774 | - | |
| 5775 | - | |
| 5776 | -Object.defineProperty(exports, "__esModule", ({ | |
| 5777 | - value: true | |
| 5778 | -})); | |
| 5779 | -Object.defineProperty(exports, "Close", ({ | |
| 5780 | - enumerable: true, | |
| 5781 | - get: function get() { | |
| 5782 | - return _close.Close; | |
| 5783 | - } | |
| 5784 | -})); | |
| 5785 | -Object.defineProperty(exports, "Open", ({ | |
| 5786 | - enumerable: true, | |
| 5787 | - get: function get() { | |
| 5788 | - return _open.Open; | |
| 5789 | - } | |
| 5790 | -})); | |
| 5791 | -Object.defineProperty(exports, "Toggle", ({ | |
| 5792 | - enumerable: true, | |
| 5793 | - get: function get() { | |
| 5794 | - return _toggle.Toggle; | |
| 5795 | - } | |
| 5796 | -})); | |
| 5797 | -var _close = __webpack_require__(/*! ./close */ "../modules/web-cli/assets/js/modules/commands/close.js"); | |
| 5798 | -var _open = __webpack_require__(/*! ./open */ "../modules/web-cli/assets/js/modules/commands/open.js"); | |
| 5799 | -var _toggle = __webpack_require__(/*! ./toggle */ "../modules/web-cli/assets/js/modules/commands/toggle.js"); | |
| 5800 | - | |
| 5801 | -/***/ }), | |
| 5802 | - | |
| 5803 | -/***/ "../modules/web-cli/assets/js/modules/commands/open.js": | |
| 5804 | -/*!*************************************************************!*\ | |
| 5805 | - !*** ../modules/web-cli/assets/js/modules/commands/open.js ***! | |
| 5806 | - \*************************************************************/ | |
| 5807 | -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 5808 | - | |
| 5809 | -"use strict"; | |
| 5810 | - | |
| 5811 | - | |
| 5812 | -var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 5813 | -Object.defineProperty(exports, "__esModule", ({ | |
| 5814 | - value: true | |
| 5815 | -})); | |
| 5816 | -exports["default"] = exports.Open = void 0; | |
| 5817 | -var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 5818 | -var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 5819 | -var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 5820 | -var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 5821 | -var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 5822 | -var _commandBase = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/command-base */ "../modules/web-cli/assets/js/modules/command-base.js")); | |
| 5823 | -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)); } | |
| 5824 | -function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } | |
| 5825 | -var Open = exports.Open = /*#__PURE__*/function (_CommandBase) { | |
| 5826 | - function Open() { | |
| 5827 | - (0, _classCallCheck2.default)(this, Open); | |
| 5828 | - return _callSuper(this, Open, arguments); | |
| 5829 | - } | |
| 5830 | - (0, _inherits2.default)(Open, _CommandBase); | |
| 5831 | - return (0, _createClass2.default)(Open, [{ | |
| 5832 | - key: "apply", | |
| 5833 | - value: function apply() { | |
| 5834 | - $e.route(this.component.getNamespace()); | |
| 5835 | - } | |
| 5836 | - }]); | |
| 5837 | -}(_commandBase.default); | |
| 5838 | -var _default = exports["default"] = Open; | |
| 5839 | - | |
| 5840 | -/***/ }), | |
| 5841 | - | |
| 5842 | -/***/ "../modules/web-cli/assets/js/modules/commands/toggle.js": | |
| 5843 | -/*!***************************************************************!*\ | |
| 5844 | - !*** ../modules/web-cli/assets/js/modules/commands/toggle.js ***! | |
| 5845 | - \***************************************************************/ | |
| 5846 | -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 5847 | - | |
| 5848 | -"use strict"; | |
| 5849 | - | |
| 5850 | - | |
| 5851 | -var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 5852 | -Object.defineProperty(exports, "__esModule", ({ | |
| 5853 | - value: true | |
| 5854 | -})); | |
| 5855 | -exports["default"] = exports.Toggle = void 0; | |
| 5856 | -var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 5857 | -var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 5858 | -var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 5859 | -var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 5860 | -var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 5861 | -var _commandBase = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/command-base */ "../modules/web-cli/assets/js/modules/command-base.js")); | |
| 5862 | -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)); } | |
| 5863 | -function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } | |
| 5864 | -var Toggle = exports.Toggle = /*#__PURE__*/function (_CommandBase) { | |
| 5865 | - function Toggle() { | |
| 5866 | - (0, _classCallCheck2.default)(this, Toggle); | |
| 5867 | - return _callSuper(this, Toggle, arguments); | |
| 5868 | - } | |
| 5869 | - (0, _inherits2.default)(Toggle, _CommandBase); | |
| 5870 | - return (0, _createClass2.default)(Toggle, [{ | |
| 5871 | - key: "apply", | |
| 5872 | - value: function apply() { | |
| 5873 | - if (this.component.isOpen) { | |
| 5874 | - this.component.close(); | |
| 5875 | - } else { | |
| 5876 | - $e.route(this.component.getNamespace()); | |
| 5877 | - } | |
| 5878 | - } | |
| 5879 | - }]); | |
| 5880 | -}(_commandBase.default); | |
| 5881 | -var _default = exports["default"] = Toggle; | |
| 5882 | - | |
| 5883 | -/***/ }), | |
| 5884 | - | |
| 5885 | -/***/ "../modules/web-cli/assets/js/modules/component-base.js": | |
| 5886 | -/*!**************************************************************!*\ | |
| 5887 | - !*** ../modules/web-cli/assets/js/modules/component-base.js ***! | |
| 5888 | - \**************************************************************/ | |
| 5889 | -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 5890 | - | |
| 5891 | -"use strict"; | |
| 5892 | - | |
| 5893 | - | |
| 5894 | -var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 5895 | -Object.defineProperty(exports, "__esModule", ({ | |
| 5896 | - value: true | |
| 5897 | -})); | |
| 5898 | -exports["default"] = void 0; | |
| 5899 | -var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js")); | |
| 5900 | -var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js")); | |
| 5901 | -var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 5902 | -var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 5903 | -var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 5904 | -var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 5905 | -var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 5906 | -var _commandCallbackBase = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/command-callback-base */ "../modules/web-cli/assets/js/modules/command-callback-base.js")); | |
| 5907 | -var _toolkit = __webpack_require__(/*! @reduxjs/toolkit */ "@reduxjs/toolkit"); | |
| 5908 | -var _module = _interopRequireDefault(__webpack_require__(/*! elementor/assets/dev/js/modules/imports/module.js */ "../assets/dev/js/modules/imports/module.js")); | |
| 5909 | -var _forceMethodImplementation = _interopRequireDefault(__webpack_require__(/*! ../utils/force-method-implementation */ "../modules/web-cli/assets/js/utils/force-method-implementation.js")); | |
| 5910 | -var _deprecation = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/deprecation */ "../modules/web-cli/assets/js/utils/deprecation.js")); | |
| 5911 | -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; } | |
| 5912 | -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; } | |
| 5913 | -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)); } | |
| 5914 | -function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } | |
| 5915 | -/** | |
| 5916 | - * @typedef {import('./command-infra')} CommandInfra | |
| 5917 | - * @typedef {import('./hook-base')} HookBase | |
| 5918 | - * @typedef {import('../core/states/ui-state-base')} UiStateBase | |
| 5919 | - */ | |
| 5920 | -var ComponentBase = exports["default"] = /*#__PURE__*/function (_Module) { | |
| 5921 | - function ComponentBase() { | |
| 5922 | - (0, _classCallCheck2.default)(this, ComponentBase); | |
| 5923 | - return _callSuper(this, ComponentBase, arguments); | |
| 5924 | - } | |
| 5925 | - (0, _inherits2.default)(ComponentBase, _Module); | |
| 5926 | - return (0, _createClass2.default)(ComponentBase, [{ | |
| 5927 | - key: "__construct", | |
| 5928 | - value: function __construct() { | |
| 5929 | - var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | |
| 5930 | - if (args.manager) { | |
| 5931 | - this.manager = args.manager; | |
| 5932 | - } | |
| 5933 | - this.commands = this.defaultCommands(); | |
| 5934 | - this.commandsInternal = this.defaultCommandsInternal(); | |
| 5935 | - this.hooks = this.defaultHooks(); | |
| 5936 | - this.routes = this.defaultRoutes(); | |
| 5937 | - this.tabs = this.defaultTabs(); | |
| 5938 | - this.shortcuts = this.defaultShortcuts(); | |
| 5939 | - this.utils = this.defaultUtils(); | |
| 5940 | - this.data = this.defaultData(); | |
| 5941 | - this.uiStates = this.defaultUiStates(); | |
| 5942 | - this.states = this.defaultStates(); | |
| 5943 | - this.defaultRoute = ''; | |
| 5944 | - this.currentTab = ''; | |
| 5945 | - } | |
| 5946 | - }, { | |
| 5947 | - key: "registerAPI", | |
| 5948 | - value: function registerAPI() { | |
| 5949 | - var _this = this; | |
| 5950 | - Object.entries(this.getTabs()).forEach(function (tab) { | |
| 5951 | - return _this.registerTabRoute(tab[0]); | |
| 5952 | - }); | |
| 5953 | - Object.entries(this.getRoutes()).forEach(function (_ref) { | |
| 5954 | - var _ref2 = (0, _slicedToArray2.default)(_ref, 2), | |
| 5955 | - route = _ref2[0], | |
| 5956 | - callback = _ref2[1]; | |
| 5957 | - return _this.registerRoute(route, callback); | |
| 5958 | - }); | |
| 5959 | - Object.entries(this.getCommands()).forEach(function (_ref3) { | |
| 5960 | - var _ref4 = (0, _slicedToArray2.default)(_ref3, 2), | |
| 5961 | - command = _ref4[0], | |
| 5962 | - callback = _ref4[1]; | |
| 5963 | - return _this.registerCommand(command, callback); | |
| 5964 | - }); | |
| 5965 | - Object.entries(this.getCommandsInternal()).forEach(function (_ref5) { | |
| 5966 | - var _ref6 = (0, _slicedToArray2.default)(_ref5, 2), | |
| 5967 | - command = _ref6[0], | |
| 5968 | - callback = _ref6[1]; | |
| 5969 | - return _this.registerCommandInternal(command, callback); | |
| 5970 | - }); | |
| 5971 | - Object.values(this.getHooks()).forEach(function (instance) { | |
| 5972 | - return _this.registerHook(instance); | |
| 5973 | - }); | |
| 5974 | - Object.entries(this.getData()).forEach(function (_ref7) { | |
| 5975 | - var _ref8 = (0, _slicedToArray2.default)(_ref7, 2), | |
| 5976 | - command = _ref8[0], | |
| 5977 | - callback = _ref8[1]; | |
| 5978 | - return _this.registerData(command, callback); | |
| 5979 | - }); | |
| 5980 | - Object.values(this.getUiStates()).forEach(function (instance) { | |
| 5981 | - return _this.registerUiState(instance); | |
| 5982 | - }); | |
| 5983 | - Object.entries(this.getStates()).forEach(function (_ref9) { | |
| 5984 | - var _ref0 = (0, _slicedToArray2.default)(_ref9, 2), | |
| 5985 | - id = _ref0[0], | |
| 5986 | - state = _ref0[1]; | |
| 5987 | - return _this.registerState(id, state); | |
| 5988 | - }); | |
| 5989 | - } | |
| 5990 | - | |
| 5991 | - // eslint-disable-next-line jsdoc/require-returns-check | |
| 5992 | - /** | |
| 5993 | - * @return {string} namespace | |
| 5994 | - */ | |
| 5995 | - }, { | |
| 5996 | - key: "getNamespace", | |
| 5997 | - value: function getNamespace() { | |
| 5998 | - (0, _forceMethodImplementation.default)(); | |
| 5999 | - } | |
| 6000 | - | |
| 6001 | - /** | |
| 6002 | - * @deprecated since 3.7.0, use `getServiceName()` instead. | |
| 6003 | - */ | |
| 6004 | - }, { | |
| 6005 | - key: "getRootContainer", | |
| 6006 | - value: function getRootContainer() { | |
| 6007 | - _deprecation.default.deprecated('getRootContainer()', '3.7.0', 'getServiceName()'); | |
| 6008 | - return this.getServiceName(); | |
| 6009 | - } | |
| 6010 | - }, { | |
| 6011 | - key: "getServiceName", | |
| 6012 | - value: function getServiceName() { | |
| 6013 | - return this.getNamespace().split('/')[0]; | |
| 6014 | - } | |
| 6015 | - }, { | |
| 6016 | - key: "store", | |
| 6017 | - get: function get() { | |
| 6018 | - return $e.store.get(this.getNamespace()); | |
| 6019 | - } | |
| 6020 | - }, { | |
| 6021 | - key: "defaultTabs", | |
| 6022 | - value: function defaultTabs() { | |
| 6023 | - return {}; | |
| 6024 | - } | |
| 6025 | - }, { | |
| 6026 | - key: "defaultRoutes", | |
| 6027 | - value: function defaultRoutes() { | |
| 6028 | - return {}; | |
| 6029 | - } | |
| 6030 | - }, { | |
| 6031 | - key: "defaultCommands", | |
| 6032 | - value: function defaultCommands() { | |
| 6033 | - return {}; | |
| 6034 | - } | |
| 6035 | - }, { | |
| 6036 | - key: "defaultCommandsInternal", | |
| 6037 | - value: function defaultCommandsInternal() { | |
| 6038 | - return {}; | |
| 6039 | - } | |
| 6040 | - }, { | |
| 6041 | - key: "defaultHooks", | |
| 6042 | - value: function defaultHooks() { | |
| 6043 | - return {}; | |
| 6044 | - } | |
| 6045 | - | |
| 6046 | - /** | |
| 6047 | - * Get the component's default UI states. | |
| 6048 | - * | |
| 6049 | - * @return {Object} default UI states | |
| 6050 | - */ | |
| 6051 | - }, { | |
| 6052 | - key: "defaultUiStates", | |
| 6053 | - value: function defaultUiStates() { | |
| 6054 | - return {}; | |
| 6055 | - } | |
| 6056 | - | |
| 6057 | - /** | |
| 6058 | - * Get the component's Redux slice settings. | |
| 6059 | - * | |
| 6060 | - * @return {Object} Redux slice settings | |
| 6061 | - */ | |
| 6062 | - }, { | |
| 6063 | - key: "defaultStates", | |
| 6064 | - value: function defaultStates() { | |
| 6065 | - return {}; | |
| 6066 | - } | |
| 6067 | - }, { | |
| 6068 | - key: "defaultShortcuts", | |
| 6069 | - value: function defaultShortcuts() { | |
| 6070 | - return {}; | |
| 6071 | - } | |
| 6072 | - }, { | |
| 6073 | - key: "defaultUtils", | |
| 6074 | - value: function defaultUtils() { | |
| 6075 | - return {}; | |
| 6076 | - } | |
| 6077 | - }, { | |
| 6078 | - key: "defaultData", | |
| 6079 | - value: function defaultData() { | |
| 6080 | - return {}; | |
| 6081 | - } | |
| 6082 | - }, { | |
| 6083 | - key: "getCommands", | |
| 6084 | - value: function getCommands() { | |
| 6085 | - return this.commands; | |
| 6086 | - } | |
| 6087 | - }, { | |
| 6088 | - key: "getCommandsInternal", | |
| 6089 | - value: function getCommandsInternal() { | |
| 6090 | - return this.commandsInternal; | |
| 6091 | - } | |
| 6092 | - }, { | |
| 6093 | - key: "getHooks", | |
| 6094 | - value: function getHooks() { | |
| 6095 | - return this.hooks; | |
| 6096 | - } | |
| 6097 | - | |
| 6098 | - /** | |
| 6099 | - * Retrieve the component's UI states. | |
| 6100 | - * | |
| 6101 | - * @return {Object} UI states | |
| 6102 | - */ | |
| 6103 | - }, { | |
| 6104 | - key: "getUiStates", | |
| 6105 | - value: function getUiStates() { | |
| 6106 | - return this.uiStates; | |
| 6107 | - } | |
| 6108 | - | |
| 6109 | - /** | |
| 6110 | - * Retrieve the component's Redux Slice. | |
| 6111 | - * | |
| 6112 | - * @return {Object} Redux Slice | |
| 6113 | - */ | |
| 6114 | - }, { | |
| 6115 | - key: "getStates", | |
| 6116 | - value: function getStates() { | |
| 6117 | - return this.states; | |
| 6118 | - } | |
| 6119 | - }, { | |
| 6120 | - key: "getRoutes", | |
| 6121 | - value: function getRoutes() { | |
| 6122 | - return this.routes; | |
| 6123 | - } | |
| 6124 | - }, { | |
| 6125 | - key: "getTabs", | |
| 6126 | - value: function getTabs() { | |
| 6127 | - return this.tabs; | |
| 6128 | - } | |
| 6129 | - }, { | |
| 6130 | - key: "getShortcuts", | |
| 6131 | - value: function getShortcuts() { | |
| 6132 | - return this.shortcuts; | |
| 6133 | - } | |
| 6134 | - }, { | |
| 6135 | - key: "getData", | |
| 6136 | - value: function getData() { | |
| 6137 | - return this.data; | |
| 6138 | - } | |
| 6139 | - | |
| 6140 | - /** | |
| 6141 | - * @param {string} command | |
| 6142 | - * @param {(()=>{}|CommandInfra)} context | |
| 6143 | - * @param {'default'|'internal'|'data'} commandsType | |
| 6144 | - */ | |
| 6145 | - }, { | |
| 6146 | - key: "registerCommand", | |
| 6147 | - value: function registerCommand(command, context) { | |
| 6148 | - var commandsType = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'default'; | |
| 6149 | - var commandsManager; | |
| 6150 | - switch (commandsType) { | |
| 6151 | - case 'default': | |
| 6152 | - commandsManager = $e.commands; | |
| 6153 | - break; | |
| 6154 | - case 'internal': | |
| 6155 | - commandsManager = $e.commandsInternal; | |
| 6156 | - break; | |
| 6157 | - case 'data': | |
| 6158 | - commandsManager = $e.data; | |
| 6159 | - break; | |
| 6160 | - default: | |
| 6161 | - throw new Error("Invalid commands type: '".concat(command, "'")); | |
| 6162 | - } | |
| 6163 | - var fullCommand = this.getNamespace() + '/' + command, | |
| 6164 | - instanceType = context.getInstanceType ? context.getInstanceType() : false, | |
| 6165 | - registerConfig = { | |
| 6166 | - command: fullCommand, | |
| 6167 | - component: this | |
| 6168 | - }; | |
| 6169 | - | |
| 6170 | - // Support pure callback. | |
| 6171 | - if (!instanceType) { | |
| 6172 | - if ($e.devTools) { | |
| 6173 | - $e.devTools.log.warn("Attach command-callback-base, on command: '".concat(fullCommand, "', context is unknown type.")); | |
| 6174 | - } | |
| 6175 | - registerConfig.callback = context; | |
| 6176 | - | |
| 6177 | - // Unique class. | |
| 6178 | - context = /*#__PURE__*/function (_CommandCallbackBase) { | |
| 6179 | - function context() { | |
| 6180 | - (0, _classCallCheck2.default)(this, context); | |
| 6181 | - return _callSuper(this, context, arguments); | |
| 6182 | - } | |
| 6183 | - (0, _inherits2.default)(context, _CommandCallbackBase); | |
| 6184 | - return (0, _createClass2.default)(context); | |
| 6185 | - }(_commandCallbackBase.default); | |
| 6186 | - } | |
| 6187 | - context.setRegisterConfig(registerConfig); | |
| 6188 | - commandsManager.register(this, command, context); | |
| 6189 | - } | |
| 6190 | - | |
| 6191 | - /** | |
| 6192 | - * @param {HookBase} instance | |
| 6193 | - */ | |
| 6194 | - }, { | |
| 6195 | - key: "registerHook", | |
| 6196 | - value: function registerHook(instance) { | |
| 6197 | - return instance.register(); | |
| 6198 | - } | |
| 6199 | - }, { | |
| 6200 | - key: "registerCommandInternal", | |
| 6201 | - value: function registerCommandInternal(command, context) { | |
| 6202 | - this.registerCommand(command, context, 'internal'); | |
| 6203 | - } | |
| 6204 | - | |
| 6205 | - /** | |
| 6206 | - * Register a UI state. | |
| 6207 | - * | |
| 6208 | - * @param {UiStateBase} instance - UI state instance. | |
| 6209 | - * | |
| 6210 | - * @return {void} | |
| 6211 | - */ | |
| 6212 | - }, { | |
| 6213 | - key: "registerUiState", | |
| 6214 | - value: function registerUiState(instance) { | |
| 6215 | - $e.uiStates.register(instance); | |
| 6216 | - } | |
| 6217 | - | |
| 6218 | - /** | |
| 6219 | - * Register a Redux Slice. | |
| 6220 | - * | |
| 6221 | - * @param {string} id - State id. | |
| 6222 | - * @param {Object} stateConfig - The state config. | |
| 6223 | - * | |
| 6224 | - * @return {void} | |
| 6225 | - */ | |
| 6226 | - }, { | |
| 6227 | - key: "registerState", | |
| 6228 | - value: function registerState(id, stateConfig) { | |
| 6229 | - id = this.getNamespace() + (id ? "/".concat(id) : ''); | |
| 6230 | - var slice = (0, _toolkit.createSlice)(_objectSpread(_objectSpread({}, stateConfig), {}, { | |
| 6231 | - name: id | |
| 6232 | - })); | |
| 6233 | - $e.store.register(id, slice); | |
| 6234 | - } | |
| 6235 | - }, { | |
| 6236 | - key: "registerRoute", | |
| 6237 | - value: function registerRoute(route, callback) { | |
| 6238 | - $e.routes.register(this, route, callback); | |
| 6239 | - } | |
| 6240 | - }, { | |
| 6241 | - key: "registerData", | |
| 6242 | - value: function registerData(command, context) { | |
| 6243 | - this.registerCommand(command, context, 'data'); | |
| 6244 | - } | |
| 6245 | - }, { | |
| 6246 | - key: "unregisterRoute", | |
| 6247 | - value: function unregisterRoute(route) { | |
| 6248 | - $e.routes.unregister(this, route); | |
| 6249 | - } | |
| 6250 | - }, { | |
| 6251 | - key: "registerTabRoute", | |
| 6252 | - value: function registerTabRoute(tab) { | |
| 6253 | - var _this2 = this; | |
| 6254 | - this.registerRoute(tab, function (args) { | |
| 6255 | - return _this2.activateTab(tab, args); | |
| 6256 | - }); | |
| 6257 | - } | |
| 6258 | - }, { | |
| 6259 | - key: "dependency", | |
| 6260 | - value: function dependency() { | |
| 6261 | - return true; | |
| 6262 | - } | |
| 6263 | - }, { | |
| 6264 | - key: "open", | |
| 6265 | - value: function open() { | |
| 6266 | - return true; | |
| 6267 | - } | |
| 6268 | - }, { | |
| 6269 | - key: "close", | |
| 6270 | - value: function close() { | |
| 6271 | - if (!this.isOpen) { | |
| 6272 | - return false; | |
| 6273 | - } | |
| 6274 | - this.isOpen = false; | |
| 6275 | - this.inactivate(); | |
| 6276 | - $e.routes.clearCurrent(this.getNamespace()); | |
| 6277 | - $e.routes.clearHistory(this.getServiceName()); | |
| 6278 | - return true; | |
| 6279 | - } | |
| 6280 | - }, { | |
| 6281 | - key: "activate", | |
| 6282 | - value: function activate() { | |
| 6283 | - $e.components.activate(this.getNamespace()); | |
| 6284 | - } | |
| 6285 | - }, { | |
| 6286 | - key: "inactivate", | |
| 6287 | - value: function inactivate() { | |
| 6288 | - $e.components.inactivate(this.getNamespace()); | |
| 6289 | - } | |
| 6290 | - }, { | |
| 6291 | - key: "isActive", | |
| 6292 | - value: function isActive() { | |
| 6293 | - return $e.components.isActive(this.getNamespace()); | |
| 6294 | - } | |
| 6295 | - }, { | |
| 6296 | - key: "onRoute", | |
| 6297 | - value: function onRoute(route) { | |
| 6298 | - this.toggleRouteClass(route, true); | |
| 6299 | - this.toggleHistoryClass(); | |
| 6300 | - this.activate(); | |
| 6301 | - this.trigger('route/open', route); | |
| 6302 | - } | |
| 6303 | - }, { | |
| 6304 | - key: "onCloseRoute", | |
| 6305 | - value: function onCloseRoute(route) { | |
| 6306 | - this.toggleRouteClass(route, false); | |
| 6307 | - this.inactivate(); | |
| 6308 | - this.trigger('route/close', route); | |
| 6309 | - } | |
| 6310 | - }, { | |
| 6311 | - key: "setDefaultRoute", | |
| 6312 | - value: function setDefaultRoute(route) { | |
| 6313 | - this.defaultRoute = this.getNamespace() + '/' + route; | |
| 6314 | - } | |
| 6315 | - }, { | |
| 6316 | - key: "getDefaultRoute", | |
| 6317 | - value: function getDefaultRoute() { | |
| 6318 | - return this.defaultRoute; | |
| 6319 | - } | |
| 6320 | - }, { | |
| 6321 | - key: "removeTab", | |
| 6322 | - value: function removeTab(tab) { | |
| 6323 | - delete this.tabs[tab]; | |
| 6324 | - this.unregisterRoute(tab); | |
| 6325 | - } | |
| 6326 | - }, { | |
| 6327 | - key: "hasTab", | |
| 6328 | - value: function hasTab(tab) { | |
| 6329 | - return !!this.tabs[tab]; | |
| 6330 | - } | |
| 6331 | - }, { | |
| 6332 | - key: "addTab", | |
| 6333 | - value: function addTab(tab, args, position) { | |
| 6334 | - var _this3 = this; | |
| 6335 | - this.tabs[tab] = args; | |
| 6336 | - // It can be 0. | |
| 6337 | - if ('undefined' !== typeof position) { | |
| 6338 | - var newTabs = {}; | |
| 6339 | - var ids = Object.keys(this.tabs); | |
| 6340 | - // Remove new tab | |
| 6341 | - ids.pop(); | |
| 6342 | - | |
| 6343 | - // Add it to position. | |
| 6344 | - ids.splice(position, 0, tab); | |
| 6345 | - ids.forEach(function (id) { | |
| 6346 | - newTabs[id] = _this3.tabs[id]; | |
| 6347 | - }); | |
| 6348 | - this.tabs = newTabs; | |
| 6349 | - } | |
| 6350 | - this.registerTabRoute(tab); | |
| 6351 | - } | |
| 6352 | - }, { | |
| 6353 | - key: "getTabsWrapperSelector", | |
| 6354 | - value: function getTabsWrapperSelector() { | |
| 6355 | - return ''; | |
| 6356 | - } | |
| 6357 | - }, { | |
| 6358 | - key: "getTabRoute", | |
| 6359 | - value: function getTabRoute(tab) { | |
| 6360 | - return this.getNamespace() + '/' + tab; | |
| 6361 | - } | |
| 6362 | - }, { | |
| 6363 | - key: "renderTab", | |
| 6364 | - value: function renderTab(tab) {} // eslint-disable-line | |
| 6365 | - }, { | |
| 6366 | - key: "activateTab", | |
| 6367 | - value: function activateTab(tab, args) { | |
| 6368 | - var _this4 = this; | |
| 6369 | - this.renderTab(tab, args); | |
| 6370 | - jQuery(this.getTabsWrapperSelector() + ' .elementor-component-tab').off('click').on('click', function (event) { | |
| 6371 | - $e.route(_this4.getTabRoute(event.currentTarget.dataset.tab), args); | |
| 6372 | - }).removeClass('elementor-active').filter('[data-tab="' + tab + '"]').addClass('elementor-active'); | |
| 6373 | - } | |
| 6374 | - }, { | |
| 6375 | - key: "getActiveTabConfig", | |
| 6376 | - value: function getActiveTabConfig() { | |
| 6377 | - return this.tabs[this.currentTab] || {}; | |
| 6378 | - } | |
| 6379 | - }, { | |
| 6380 | - key: "getBodyClass", | |
| 6381 | - value: function getBodyClass(route) { | |
| 6382 | - return 'e-route-' + route.replace(/\//g, '-'); | |
| 6383 | - } | |
| 6384 | - | |
| 6385 | - /** | |
| 6386 | - * If command includes uppercase character convert it to lowercase and add `-`. | |
| 6387 | - * e.g: `CopyAll` is converted to `copy-all`. | |
| 6388 | - * | |
| 6389 | - * @param {string} commandName | |
| 6390 | - */ | |
| 6391 | - }, { | |
| 6392 | - key: "normalizeCommandName", | |
| 6393 | - value: function normalizeCommandName(commandName) { | |
| 6394 | - return commandName.replace(/[A-Z]/g, function (match, offset) { | |
| 6395 | - return (offset > 0 ? '-' : '') + match.toLowerCase(); | |
| 6396 | - }); | |
| 6397 | - } | |
| 6398 | - | |
| 6399 | - /** | |
| 6400 | - * @param {{}} commandsFromImport | |
| 6401 | - * @return {{}} imported commands | |
| 6402 | - */ | |
| 6403 | - }, { | |
| 6404 | - key: "importCommands", | |
| 6405 | - value: function importCommands(commandsFromImport) { | |
| 6406 | - var _this5 = this; | |
| 6407 | - var commands = {}; | |
| 6408 | - | |
| 6409 | - // Convert `Commands` to `ComponentBase` workable format. | |
| 6410 | - Object.entries(commandsFromImport).forEach(function (_ref1) { | |
| 6411 | - var _ref10 = (0, _slicedToArray2.default)(_ref1, 2), | |
| 6412 | - className = _ref10[0], | |
| 6413 | - Class = _ref10[1]; | |
| 6414 | - var command = _this5.normalizeCommandName(className); | |
| 6415 | - commands[command] = Class; | |
| 6416 | - }); | |
| 6417 | - return commands; | |
| 6418 | - } | |
| 6419 | - }, { | |
| 6420 | - key: "importHooks", | |
| 6421 | - value: function importHooks(hooksFromImport) { | |
| 6422 | - var hooks = {}; | |
| 6423 | - for (var key in hooksFromImport) { | |
| 6424 | - var hook = new hooksFromImport[key](); | |
| 6425 | - hooks[hook.getId()] = hook; | |
| 6426 | - } | |
| 6427 | - return hooks; | |
| 6428 | - } | |
| 6429 | - | |
| 6430 | - /** | |
| 6431 | - * Import & initialize the component's UI states. | |
| 6432 | - * Should be used inside `defaultUiState()`. | |
| 6433 | - * | |
| 6434 | - * @param {Object} statesFromImport - UI states from import. | |
| 6435 | - * | |
| 6436 | - * @return {Object} UI States | |
| 6437 | - */ | |
| 6438 | - }, { | |
| 6439 | - key: "importUiStates", | |
| 6440 | - value: function importUiStates(statesFromImport) { | |
| 6441 | - var _this6 = this; | |
| 6442 | - var uiStates = {}; | |
| 6443 | - Object.values(statesFromImport).forEach(function (className) { | |
| 6444 | - var uiState = new className(_this6); | |
| 6445 | - uiStates[uiState.getId()] = uiState; | |
| 6446 | - }); | |
| 6447 | - return uiStates; | |
| 6448 | - } | |
| 6449 | - | |
| 6450 | - /** | |
| 6451 | - * Set a UI state value. | |
| 6452 | - * TODO: Should we provide such function? Maybe the developer should implicitly pass the full state ID? | |
| 6453 | - * | |
| 6454 | - * @param {string} state - Non-prefixed state ID. | |
| 6455 | - * @param {*} value - New state value. | |
| 6456 | - * | |
| 6457 | - * @return {void} | |
| 6458 | - */ | |
| 6459 | - }, { | |
| 6460 | - key: "setUiState", | |
| 6461 | - value: function setUiState(state, value) { | |
| 6462 | - $e.uiStates.set("".concat(this.getNamespace(), "/").concat(state), value); | |
| 6463 | - } | |
| 6464 | - }, { | |
| 6465 | - key: "toggleRouteClass", | |
| 6466 | - value: function toggleRouteClass(route, state) { | |
| 6467 | - document.body.classList.toggle(this.getBodyClass(route), state); | |
| 6468 | - } | |
| 6469 | - }, { | |
| 6470 | - key: "toggleHistoryClass", | |
| 6471 | - value: function toggleHistoryClass() { | |
| 6472 | - document.body.classList.toggle('e-routes-has-history', !!$e.routes.getHistory(this.getServiceName()).length); | |
| 6473 | - } | |
| 6474 | - }]); | |
| 6475 | -}(_module.default); | |
| 6476 | - | |
| 6477 | -/***/ }), | |
| 6478 | - | |
| 6479 | -/***/ "../modules/web-cli/assets/js/modules/component-modal-base.js": | |
| 6480 | -/*!********************************************************************!*\ | |
| 6481 | - !*** ../modules/web-cli/assets/js/modules/component-modal-base.js ***! | |
| 6482 | - \********************************************************************/ | |
| 6483 | -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 6484 | - | |
| 6485 | -"use strict"; | |
| 6486 | - | |
| 6487 | - | |
| 6488 | -var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 6489 | -var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js"); | |
| 6490 | -Object.defineProperty(exports, "__esModule", ({ | |
| 6491 | - value: true | |
| 6492 | -})); | |
| 6493 | -exports["default"] = void 0; | |
| 6494 | -var _readOnlyError2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/readOnlyError */ "../node_modules/@babel/runtime/helpers/readOnlyError.js")); | |
| 6495 | -var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 6496 | -var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 6497 | -var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 6498 | -var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 6499 | -var _get2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/get */ "../node_modules/@babel/runtime/helpers/get.js")); | |
| 6500 | -var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 6501 | -var _componentBase = _interopRequireDefault(__webpack_require__(/*! ./component-base */ "../modules/web-cli/assets/js/modules/component-base.js")); | |
| 6502 | -var commands = _interopRequireWildcard(__webpack_require__(/*! ./commands/ */ "../modules/web-cli/assets/js/modules/commands/index.js")); | |
| 6503 | -var _forceMethodImplementation = _interopRequireDefault(__webpack_require__(/*! ../utils/force-method-implementation */ "../modules/web-cli/assets/js/utils/force-method-implementation.js")); | |
| 6504 | -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); } | |
| 6505 | -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)); } | |
| 6506 | -function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } | |
| 6507 | -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; } | |
| 6508 | -var ComponentModalBase = exports["default"] = /*#__PURE__*/function (_ComponentBase) { | |
| 6509 | - function ComponentModalBase() { | |
| 6510 | - (0, _classCallCheck2.default)(this, ComponentModalBase); | |
| 6511 | - return _callSuper(this, ComponentModalBase, arguments); | |
| 6512 | - } | |
| 6513 | - (0, _inherits2.default)(ComponentModalBase, _ComponentBase); | |
| 6514 | - return (0, _createClass2.default)(ComponentModalBase, [{ | |
| 6515 | - key: "registerAPI", | |
| 6516 | - value: function registerAPI() { | |
| 6517 | - var _this = this; | |
| 6518 | - _superPropGet(ComponentModalBase, "registerAPI", this, 3)([]); | |
| 6519 | - $e.shortcuts.register('esc', { | |
| 6520 | - scopes: [this.getNamespace()], | |
| 6521 | - callback: function callback() { | |
| 6522 | - return _this.close(); | |
| 6523 | - } | |
| 6524 | - }); | |
| 6525 | - } | |
| 6526 | - }, { | |
| 6527 | - key: "defaultCommands", | |
| 6528 | - value: function defaultCommands() { | |
| 6529 | - return this.importCommands(commands); | |
| 6530 | - } | |
| 6531 | - }, { | |
| 6532 | - key: "defaultRoutes", | |
| 6533 | - value: function defaultRoutes() { | |
| 6534 | - return { | |
| 6535 | - '': function _() {/* Nothing to do, it's already rendered. */} | |
| 6536 | - }; | |
| 6537 | - } | |
| 6538 | - }, { | |
| 6539 | - key: "open", | |
| 6540 | - value: function open() { | |
| 6541 | - var _this2 = this; | |
| 6542 | - if (!this.layout) { | |
| 6543 | - var layout = this.getModalLayout(); | |
| 6544 | - this.layout = new layout({ | |
| 6545 | - component: this | |
| 6546 | - }); | |
| 6547 | - this.layout.getModal().on('hide', function () { | |
| 6548 | - return _this2.close(); | |
| 6549 | - }); | |
| 6550 | - } | |
| 6551 | - this.layout.showModal(); | |
| 6552 | - return true; | |
| 6553 | - } | |
| 6554 | - }, { | |
| 6555 | - key: "close", | |
| 6556 | - value: function close() { | |
| 6557 | - if (!_superPropGet(ComponentModalBase, "close", this, 3)([])) { | |
| 6558 | - return false; | |
| 6559 | - } | |
| 6560 | - var close = elementor.hooks.applyFilters('component/modal/close', this.layout.getModal().hide.bind(this.layout.getModal()), this); | |
| 6561 | - close(); | |
| 6562 | - return true; | |
| 6563 | - } | |
| 6564 | - }, { | |
| 6565 | - key: "getModalLayout", | |
| 6566 | - value: function getModalLayout() { | |
| 6567 | - (0, _forceMethodImplementation.default)(); | |
| 6568 | - } | |
| 6569 | - }]); | |
| 6570 | -}(_componentBase.default); | |
| 6571 | - | |
| 6572 | -/***/ }), | |
| 6573 | - | |
| 6574 | -/***/ "../modules/web-cli/assets/js/modules/hook-base.js": | |
| 6575 | -/*!*********************************************************!*\ | |
| 6576 | - !*** ../modules/web-cli/assets/js/modules/hook-base.js ***! | |
| 6577 | - \*********************************************************/ | |
| 6578 | -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 6579 | - | |
| 6580 | -"use strict"; | |
| 6581 | - | |
| 6582 | - | |
| 6583 | -var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 6584 | -Object.defineProperty(exports, "__esModule", ({ | |
| 6585 | - value: true | |
| 6586 | -})); | |
| 6587 | -exports["default"] = void 0; | |
| 6588 | -var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 6589 | -var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 6590 | -var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js")); | |
| 6591 | -var _forceMethodImplementation = _interopRequireDefault(__webpack_require__(/*! ../utils/force-method-implementation */ "../modules/web-cli/assets/js/utils/force-method-implementation.js")); | |
| 6592 | -var HookBase = exports["default"] = /*#__PURE__*/function () { | |
| 6593 | - /** | |
| 6594 | - * Function constructor(). | |
| 6595 | - * | |
| 6596 | - * Create callback base. | |
| 6597 | - */ | |
| 6598 | - function HookBase() { | |
| 6599 | - (0, _classCallCheck2.default)(this, HookBase); | |
| 6600 | - /** | |
| 6601 | - * Callback type, eg ( hook, event ). | |
| 6602 | - * | |
| 6603 | - * @type {string} | |
| 6604 | - */ | |
| 6605 | - (0, _defineProperty2.default)(this, "type", void 0); | |
| 6606 | - /** | |
| 6607 | - * Full command address, that will hook the callback. | |
| 6608 | - * | |
| 6609 | - * @type {string} | |
| 6610 | - */ | |
| 6611 | - (0, _defineProperty2.default)(this, "command", void 0); | |
| 6612 | - /** | |
| 6613 | - * Unique id of the callback. | |
| 6614 | - * | |
| 6615 | - * @type {string} | |
| 6616 | - */ | |
| 6617 | - (0, _defineProperty2.default)(this, "id", void 0); | |
| 6618 | - this.initialize(); | |
| 6619 | - this.type = this.getType(); | |
| 6620 | - this.command = this.getCommand(); | |
| 6621 | - this.id = this.getId(); | |
| 6622 | - } | |
| 6623 | - | |
| 6624 | - /** | |
| 6625 | - * Function initialize(). | |
| 6626 | - * | |
| 6627 | - * Called after creation of the base, used for initialize extras. | |
| 6628 | - * Without expending constructor. | |
| 6629 | - */ | |
| 6630 | - return (0, _createClass2.default)(HookBase, [{ | |
| 6631 | - key: "initialize", | |
| 6632 | - value: function initialize() {} | |
| 6633 | - | |
| 6634 | - /** | |
| 6635 | - * Function register(). | |
| 6636 | - * | |
| 6637 | - * Used to register the callback. | |
| 6638 | - * | |
| 6639 | - * @throws {Error} | |
| 6640 | - */ | |
| 6641 | - }, { | |
| 6642 | - key: "register", | |
| 6643 | - value: function register() { | |
| 6644 | - (0, _forceMethodImplementation.default)(); | |
| 6645 | - } | |
| 6646 | - | |
| 6647 | - // eslint-disable-next-line jsdoc/require-returns-check | |
| 6648 | - /** | |
| 6649 | - * Function getType(). | |
| 6650 | - * | |
| 6651 | - * Get type eg: ( hook, event, etc ... ). | |
| 6652 | - * | |
| 6653 | - * @return {string} type | |
| 6654 | - * | |
| 6655 | - * @throws {Error} | |
| 6656 | - */ | |
| 6657 | - }, { | |
| 6658 | - key: "getType", | |
| 6659 | - value: function getType() { | |
| 6660 | - (0, _forceMethodImplementation.default)(); | |
| 6661 | - } | |
| 6662 | - | |
| 6663 | - // eslint-disable-next-line jsdoc/require-returns-check | |
| 6664 | - /** | |
| 6665 | - * Function getCommand(). | |
| 6666 | - * | |
| 6667 | - * Returns the full command path for callback binding. | |
| 6668 | - * | |
| 6669 | - * Supports array of strings ( commands ). | |
| 6670 | - * | |
| 6671 | - * @return {string} command | |
| 6672 | - * | |
| 6673 | - * @throws {Error} | |
| 6674 | - */ | |
| 6675 | - }, { | |
| 6676 | - key: "getCommand", | |
| 6677 | - value: function getCommand() { | |
| 6678 | - (0, _forceMethodImplementation.default)(); | |
| 6679 | - } | |
| 6680 | - | |
| 6681 | - // eslint-disable-next-line jsdoc/require-returns-check | |
| 6682 | - /** | |
| 6683 | - * Function getId(). | |
| 6684 | - * | |
| 6685 | - * Returns command id for the hook (should be unique). | |
| 6686 | - * | |
| 6687 | - * @return {string} id | |
| 6688 | - * | |
| 6689 | - * @throws {Error} | |
| 6690 | - */ | |
| 6691 | - }, { | |
| 6692 | - key: "getId", | |
| 6693 | - value: function getId() { | |
| 6694 | - (0, _forceMethodImplementation.default)(); | |
| 6695 | - } | |
| 6696 | - | |
| 6697 | - // eslint-disable-next-line jsdoc/require-returns-check | |
| 6698 | - /** | |
| 6699 | - * Function getContainerType(). | |
| 6700 | - * | |
| 6701 | - * Bind eContainer type to callback. | |
| 6702 | - * | |
| 6703 | - * Used to gain performance. | |
| 6704 | - * | |
| 6705 | - * @return {string} type | |
| 6706 | - */ | |
| 6707 | - }, { | |
| 6708 | - key: "getContainerType", | |
| 6709 | - value: function getContainerType() {} | |
| 6710 | - | |
| 6711 | - /** | |
| 6712 | - * Function getConditions(). | |
| 6713 | - * | |
| 6714 | - * Condition for running the callback, if true, call to apply(). | |
| 6715 | - * | |
| 6716 | - * @param {*} [args={}] | |
| 6717 | - * @param {*} [result=*] | |
| 6718 | - * | |
| 6719 | - * @return {boolean} conditions | |
| 6720 | - */ | |
| 6721 | - }, { | |
| 6722 | - key: "getConditions", | |
| 6723 | - value: function getConditions() { | |
| 6724 | - var args = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | |
| 6725 | - var result = arguments.length > 1 ? arguments[1] : undefined; | |
| 6726 | - // eslint-disable-line no-unused-vars | |
| 6727 | - return true; | |
| 6728 | - } | |
| 6729 | - | |
| 6730 | - // eslint-disable-next-line jsdoc/require-returns-check | |
| 6731 | - /** | |
| 6732 | - * Function apply(). | |
| 6733 | - * | |
| 6734 | - * Apply the callback, ( The actual affect of the callback ). | |
| 6735 | - * | |
| 6736 | - * @param {*} [args={}] | |
| 6737 | - * | |
| 6738 | - * @return {*} results | |
| 6739 | - */ | |
| 6740 | - }, { | |
| 6741 | - key: "apply", | |
| 6742 | - value: function apply(args) { | |
| 6743 | - // eslint-disable-line no-unused-vars | |
| 6744 | - (0, _forceMethodImplementation.default)(); | |
| 6745 | - } | |
| 6746 | - | |
| 6747 | - /** | |
| 6748 | - * Function run(). | |
| 6749 | - * | |
| 6750 | - * Run the callback. | |
| 6751 | - * | |
| 6752 | - * @param {*} args | |
| 6753 | - * | |
| 6754 | - * @return {*} results | |
| 6755 | - */ | |
| 6756 | - }, { | |
| 6757 | - key: "run", | |
| 6758 | - value: function run() { | |
| 6759 | - var _ref = arguments.length <= 0 ? undefined : arguments[0], | |
| 6760 | - _ref$options = _ref.options, | |
| 6761 | - options = _ref$options === void 0 ? {} : _ref$options; | |
| 6762 | - | |
| 6763 | - // Disable callback if requested by args.options. | |
| 6764 | - if (options.callbacks && false === options.callbacks[this.id]) { | |
| 6765 | - return true; | |
| 6766 | - } | |
| 6767 | - if (this.getConditions.apply(this, arguments)) { | |
| 6768 | - if ($e.devTools) { | |
| 6769 | - $e.devTools.log.callbacks().active(this.type, this.command, this.id); | |
| 6770 | - } | |
| 6771 | - return this.apply.apply(this, arguments); | |
| 6772 | - } | |
| 6773 | - return true; | |
| 6774 | - } | |
| 6775 | - }]); | |
| 6776 | -}(); | |
| 6777 | - | |
| 6778 | -/***/ }), | |
| 6779 | - | |
| 6780 | -/***/ "../modules/web-cli/assets/js/modules/hook-break.js": | |
| 6781 | -/*!**********************************************************!*\ | |
| 6782 | - !*** ../modules/web-cli/assets/js/modules/hook-break.js ***! | |
| 6783 | - \**********************************************************/ | |
| 6784 | -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 6785 | - | |
| 6786 | -"use strict"; | |
| 6787 | - | |
| 6788 | - | |
| 6789 | -var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 6790 | -Object.defineProperty(exports, "__esModule", ({ | |
| 6791 | - value: true | |
| 6792 | -})); | |
| 6793 | -exports["default"] = void 0; | |
| 6794 | -var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 6795 | -var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 6796 | -var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 6797 | -var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 6798 | -var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 6799 | -var _wrapNativeSuper2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/wrapNativeSuper */ "../node_modules/@babel/runtime/helpers/wrapNativeSuper.js")); | |
| 6800 | -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)); } | |
| 6801 | -function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } | |
| 6802 | -var HookBreak = exports["default"] = /*#__PURE__*/function (_Error) { | |
| 6803 | - function HookBreak() { | |
| 6804 | - (0, _classCallCheck2.default)(this, HookBreak); | |
| 6805 | - return _callSuper(this, HookBreak, ['HookBreak']); | |
| 6806 | - } | |
| 6807 | - (0, _inherits2.default)(HookBreak, _Error); | |
| 6808 | - return (0, _createClass2.default)(HookBreak); | |
| 6809 | -}(/*#__PURE__*/(0, _wrapNativeSuper2.default)(Error)); | |
| 6810 | - | |
| 6811 | -/***/ }), | |
| 6812 | - | |
| 6813 | -/***/ "../modules/web-cli/assets/js/modules/hooks/data/after.js": | |
| 6814 | -/*!****************************************************************!*\ | |
| 6815 | - !*** ../modules/web-cli/assets/js/modules/hooks/data/after.js ***! | |
| 6816 | - \****************************************************************/ | |
| 6817 | -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 6818 | - | |
| 6819 | -"use strict"; | |
| 6820 | - | |
| 6821 | - | |
| 6822 | -var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 6823 | -Object.defineProperty(exports, "__esModule", ({ | |
| 6824 | - value: true | |
| 6825 | -})); | |
| 6826 | -exports["default"] = exports.After = void 0; | |
| 6827 | -var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 6828 | -var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 6829 | -var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 6830 | -var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 6831 | -var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 6832 | -var _base = _interopRequireDefault(__webpack_require__(/*! ./base */ "../modules/web-cli/assets/js/modules/hooks/data/base.js")); | |
| 6833 | -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)); } | |
| 6834 | -function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } | |
| 6835 | -var After = exports.After = /*#__PURE__*/function (_Base) { | |
| 6836 | - function After() { | |
| 6837 | - (0, _classCallCheck2.default)(this, After); | |
| 6838 | - return _callSuper(this, After, arguments); | |
| 6839 | - } | |
| 6840 | - (0, _inherits2.default)(After, _Base); | |
| 6841 | - return (0, _createClass2.default)(After, [{ | |
| 6842 | - key: "register", | |
| 6843 | - value: function register() { | |
| 6844 | - $e.hooks.registerDataAfter(this); | |
| 6845 | - } | |
| 6846 | - }]); | |
| 6847 | -}(_base.default); | |
| 6848 | -var _default = exports["default"] = After; | |
| 6849 | - | |
| 6850 | -/***/ }), | |
| 6851 | - | |
| 6852 | -/***/ "../modules/web-cli/assets/js/modules/hooks/data/base.js": | |
| 6853 | -/*!***************************************************************!*\ | |
| 6854 | - !*** ../modules/web-cli/assets/js/modules/hooks/data/base.js ***! | |
| 6855 | - \***************************************************************/ | |
| 6856 | -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 6857 | - | |
| 6858 | -"use strict"; | |
| 6859 | - | |
| 6860 | - | |
| 6861 | -var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 6862 | -Object.defineProperty(exports, "__esModule", ({ | |
| 6863 | - value: true | |
| 6864 | -})); | |
| 6865 | -exports["default"] = exports.Base = void 0; | |
| 6866 | -var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 6867 | -var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 6868 | -var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 6869 | -var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 6870 | -var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 6871 | -var _hookBase = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/hook-base */ "../modules/web-cli/assets/js/modules/hook-base.js")); | |
| 6872 | -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)); } | |
| 6873 | -function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } | |
| 6874 | -var Base = exports.Base = /*#__PURE__*/function (_HookBase) { | |
| 6875 | - function Base() { | |
| 6876 | - (0, _classCallCheck2.default)(this, Base); | |
| 6877 | - return _callSuper(this, Base, arguments); | |
| 6878 | - } | |
| 6879 | - (0, _inherits2.default)(Base, _HookBase); | |
| 6880 | - return (0, _createClass2.default)(Base, [{ | |
| 6881 | - key: "getType", | |
| 6882 | - value: function getType() { | |
| 6883 | - return 'data'; | |
| 6884 | - } | |
| 6885 | - }]); | |
| 6886 | -}(_hookBase.default); | |
| 6887 | -var _default = exports["default"] = Base; | |
| 6888 | - | |
| 6889 | -/***/ }), | |
| 6890 | - | |
| 6891 | -/***/ "../modules/web-cli/assets/js/modules/hooks/data/catch.js": | |
| 6892 | -/*!****************************************************************!*\ | |
| 6893 | - !*** ../modules/web-cli/assets/js/modules/hooks/data/catch.js ***! | |
| 6894 | - \****************************************************************/ | |
| 6895 | -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 6896 | - | |
| 6897 | -"use strict"; | |
| 6898 | - | |
| 6899 | - | |
| 6900 | -var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 6901 | -Object.defineProperty(exports, "__esModule", ({ | |
| 6902 | - value: true | |
| 6903 | -})); | |
| 6904 | -exports["default"] = exports.Catch = void 0; | |
| 6905 | -var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 6906 | -var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 6907 | -var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 6908 | -var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 6909 | -var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 6910 | -var _base = _interopRequireDefault(__webpack_require__(/*! ./base */ "../modules/web-cli/assets/js/modules/hooks/data/base.js")); | |
| 6911 | -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)); } | |
| 6912 | -function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } | |
| 6913 | -var Catch = exports.Catch = /*#__PURE__*/function (_Base) { | |
| 6914 | - function Catch() { | |
| 6915 | - (0, _classCallCheck2.default)(this, Catch); | |
| 6916 | - return _callSuper(this, Catch, arguments); | |
| 6917 | - } | |
| 6918 | - (0, _inherits2.default)(Catch, _Base); | |
| 6919 | - return (0, _createClass2.default)(Catch, [{ | |
| 6920 | - key: "register", | |
| 6921 | - value: function register() { | |
| 6922 | - $e.hooks.registerDataCatch(this); | |
| 6923 | - } | |
| 6924 | - }]); | |
| 6925 | -}(_base.default); | |
| 6926 | -var _default = exports["default"] = Catch; | |
| 6927 | - | |
| 6928 | -/***/ }), | |
| 6929 | - | |
| 6930 | -/***/ "../modules/web-cli/assets/js/modules/hooks/data/dependency.js": | |
| 6931 | -/*!*********************************************************************!*\ | |
| 6932 | - !*** ../modules/web-cli/assets/js/modules/hooks/data/dependency.js ***! | |
| 6933 | - \*********************************************************************/ | |
| 6934 | -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 6935 | - | |
| 6936 | -"use strict"; | |
| 6937 | - | |
| 6938 | - | |
| 6939 | -var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 6940 | -Object.defineProperty(exports, "__esModule", ({ | |
| 6941 | - value: true | |
| 6942 | -})); | |
| 6943 | -exports["default"] = exports.Dependency = void 0; | |
| 6944 | -var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 6945 | -var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 6946 | -var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 6947 | -var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 6948 | -var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 6949 | -var _base = _interopRequireDefault(__webpack_require__(/*! ./base */ "../modules/web-cli/assets/js/modules/hooks/data/base.js")); | |
| 6950 | -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)); } | |
| 6951 | -function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } | |
| 6952 | -var Dependency = exports.Dependency = /*#__PURE__*/function (_Base) { | |
| 6953 | - function Dependency() { | |
| 6954 | - (0, _classCallCheck2.default)(this, Dependency); | |
| 6955 | - return _callSuper(this, Dependency, arguments); | |
| 6956 | - } | |
| 6957 | - (0, _inherits2.default)(Dependency, _Base); | |
| 6958 | - return (0, _createClass2.default)(Dependency, [{ | |
| 6959 | - key: "register", | |
| 6960 | - value: function register() { | |
| 6961 | - $e.hooks.registerDataDependency(this); | |
| 6962 | - } | |
| 6963 | - }]); | |
| 6964 | -}(_base.default); | |
| 6965 | -var _default = exports["default"] = Dependency; | |
| 6966 | - | |
| 6967 | -/***/ }), | |
| 6968 | - | |
| 6969 | -/***/ "../modules/web-cli/assets/js/modules/hooks/data/index.js": | |
| 6970 | -/*!****************************************************************!*\ | |
| 6971 | - !*** ../modules/web-cli/assets/js/modules/hooks/data/index.js ***! | |
| 6972 | - \****************************************************************/ | |
| 6973 | -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 6974 | - | |
| 6975 | -"use strict"; | |
| 6976 | - | |
| 6977 | - | |
| 6978 | -Object.defineProperty(exports, "__esModule", ({ | |
| 6979 | - value: true | |
| 6980 | -})); | |
| 6981 | -Object.defineProperty(exports, "After", ({ | |
| 6982 | - enumerable: true, | |
| 6983 | - get: function get() { | |
| 6984 | - return _after.After; | |
| 6985 | - } | |
| 6986 | -})); | |
| 6987 | -Object.defineProperty(exports, "Base", ({ | |
| 6988 | - enumerable: true, | |
| 6989 | - get: function get() { | |
| 6990 | - return _base.Base; | |
| 6991 | - } | |
| 6992 | -})); | |
| 6993 | -Object.defineProperty(exports, "Catch", ({ | |
| 6994 | - enumerable: true, | |
| 6995 | - get: function get() { | |
| 6996 | - return _catch.Catch; | |
| 6997 | - } | |
| 6998 | -})); | |
| 6999 | -Object.defineProperty(exports, "Dependency", ({ | |
| 7000 | - enumerable: true, | |
| 7001 | - get: function get() { | |
| 7002 | - return _dependency.Dependency; | |
| 7003 | - } | |
| 7004 | -})); | |
| 7005 | -var _after = __webpack_require__(/*! ./after */ "../modules/web-cli/assets/js/modules/hooks/data/after.js"); | |
| 7006 | -var _base = __webpack_require__(/*! ./base */ "../modules/web-cli/assets/js/modules/hooks/data/base.js"); | |
| 7007 | -var _catch = __webpack_require__(/*! ./catch */ "../modules/web-cli/assets/js/modules/hooks/data/catch.js"); | |
| 7008 | -var _dependency = __webpack_require__(/*! ./dependency */ "../modules/web-cli/assets/js/modules/hooks/data/dependency.js"); | |
| 7009 | - | |
| 7010 | -/***/ }), | |
| 7011 | - | |
| 7012 | -/***/ "../modules/web-cli/assets/js/modules/hooks/ui/after.js": | |
| 7013 | -/*!**************************************************************!*\ | |
| 7014 | - !*** ../modules/web-cli/assets/js/modules/hooks/ui/after.js ***! | |
| 7015 | - \**************************************************************/ | |
| 7016 | -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 7017 | - | |
| 7018 | -"use strict"; | |
| 7019 | - | |
| 7020 | - | |
| 7021 | -var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 7022 | -Object.defineProperty(exports, "__esModule", ({ | |
| 7023 | - value: true | |
| 7024 | -})); | |
| 7025 | -exports["default"] = exports.After = void 0; | |
| 7026 | -var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 7027 | -var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 7028 | -var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 7029 | -var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 7030 | -var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 7031 | -var _base = _interopRequireDefault(__webpack_require__(/*! ./base */ "../modules/web-cli/assets/js/modules/hooks/ui/base.js")); | |
| 7032 | -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)); } | |
| 7033 | -function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } | |
| 7034 | -var After = exports.After = /*#__PURE__*/function (_Base) { | |
| 7035 | - function After() { | |
| 7036 | - (0, _classCallCheck2.default)(this, After); | |
| 7037 | - return _callSuper(this, After, arguments); | |
| 7038 | - } | |
| 7039 | - (0, _inherits2.default)(After, _Base); | |
| 7040 | - return (0, _createClass2.default)(After, [{ | |
| 7041 | - key: "register", | |
| 7042 | - value: function register() { | |
| 7043 | - $e.hooks.registerUIAfter(this); | |
| 7044 | - } | |
| 7045 | - }]); | |
| 7046 | -}(_base.default); | |
| 7047 | -var _default = exports["default"] = After; | |
| 7048 | - | |
| 7049 | -/***/ }), | |
| 7050 | - | |
| 7051 | -/***/ "../modules/web-cli/assets/js/modules/hooks/ui/base.js": | |
| 7052 | -/*!*************************************************************!*\ | |
| 7053 | - !*** ../modules/web-cli/assets/js/modules/hooks/ui/base.js ***! | |
| 7054 | - \*************************************************************/ | |
| 7055 | -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 7056 | - | |
| 7057 | -"use strict"; | |
| 7058 | - | |
| 7059 | - | |
| 7060 | -var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 7061 | -Object.defineProperty(exports, "__esModule", ({ | |
| 7062 | - value: true | |
| 7063 | -})); | |
| 7064 | -exports["default"] = exports.Base = void 0; | |
| 7065 | -var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 7066 | -var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 7067 | -var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 7068 | -var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 7069 | -var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 7070 | -var _hookBase = _interopRequireDefault(__webpack_require__(/*! elementor-api/modules/hook-base */ "../modules/web-cli/assets/js/modules/hook-base.js")); | |
| 7071 | -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)); } | |
| 7072 | -function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } | |
| 7073 | -var Base = exports.Base = /*#__PURE__*/function (_HookBase) { | |
| 7074 | - function Base() { | |
| 7075 | - (0, _classCallCheck2.default)(this, Base); | |
| 7076 | - return _callSuper(this, Base, arguments); | |
| 7077 | - } | |
| 7078 | - (0, _inherits2.default)(Base, _HookBase); | |
| 7079 | - return (0, _createClass2.default)(Base, [{ | |
| 7080 | - key: "getType", | |
| 7081 | - value: function getType() { | |
| 7082 | - return 'ui'; | |
| 7083 | - } | |
| 7084 | - }]); | |
| 7085 | -}(_hookBase.default); | |
| 7086 | -var _default = exports["default"] = Base; | |
| 7087 | - | |
| 7088 | -/***/ }), | |
| 7089 | - | |
| 7090 | -/***/ "../modules/web-cli/assets/js/modules/hooks/ui/before.js": | |
| 7091 | -/*!***************************************************************!*\ | |
| 7092 | - !*** ../modules/web-cli/assets/js/modules/hooks/ui/before.js ***! | |
| 7093 | - \***************************************************************/ | |
| 7094 | -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 7095 | - | |
| 7096 | -"use strict"; | |
| 7097 | - | |
| 7098 | - | |
| 7099 | -var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 7100 | -Object.defineProperty(exports, "__esModule", ({ | |
| 7101 | - value: true | |
| 7102 | -})); | |
| 7103 | -exports["default"] = exports.Before = void 0; | |
| 7104 | -var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 7105 | -var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 7106 | -var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 7107 | -var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 7108 | -var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 7109 | -var _base = _interopRequireDefault(__webpack_require__(/*! ./base */ "../modules/web-cli/assets/js/modules/hooks/ui/base.js")); | |
| 7110 | -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)); } | |
| 7111 | -function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } | |
| 7112 | -var Before = exports.Before = /*#__PURE__*/function (_Base) { | |
| 7113 | - function Before() { | |
| 7114 | - (0, _classCallCheck2.default)(this, Before); | |
| 7115 | - return _callSuper(this, Before, arguments); | |
| 7116 | - } | |
| 7117 | - (0, _inherits2.default)(Before, _Base); | |
| 7118 | - return (0, _createClass2.default)(Before, [{ | |
| 7119 | - key: "register", | |
| 7120 | - value: function register() { | |
| 7121 | - $e.hooks.registerUIBefore(this); | |
| 7122 | - } | |
| 7123 | - }]); | |
| 7124 | -}(_base.default); | |
| 7125 | -var _default = exports["default"] = Before; | |
| 7126 | - | |
| 7127 | -/***/ }), | |
| 7128 | - | |
| 7129 | -/***/ "../modules/web-cli/assets/js/modules/hooks/ui/catch.js": | |
| 7130 | -/*!**************************************************************!*\ | |
| 7131 | - !*** ../modules/web-cli/assets/js/modules/hooks/ui/catch.js ***! | |
| 7132 | - \**************************************************************/ | |
| 7133 | -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 7134 | - | |
| 7135 | -"use strict"; | |
| 7136 | - | |
| 7137 | - | |
| 7138 | -var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 7139 | -Object.defineProperty(exports, "__esModule", ({ | |
| 7140 | - value: true | |
| 7141 | -})); | |
| 7142 | -exports["default"] = exports.Catch = void 0; | |
| 7143 | -var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 7144 | -var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 7145 | -var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 7146 | -var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 7147 | -var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 7148 | -var _base = _interopRequireDefault(__webpack_require__(/*! ./base */ "../modules/web-cli/assets/js/modules/hooks/ui/base.js")); | |
| 7149 | -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)); } | |
| 7150 | -function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } | |
| 7151 | -var Catch = exports.Catch = /*#__PURE__*/function (_Base) { | |
| 7152 | - function Catch() { | |
| 7153 | - (0, _classCallCheck2.default)(this, Catch); | |
| 7154 | - return _callSuper(this, Catch, arguments); | |
| 7155 | - } | |
| 7156 | - (0, _inherits2.default)(Catch, _Base); | |
| 7157 | - return (0, _createClass2.default)(Catch, [{ | |
| 7158 | - key: "register", | |
| 7159 | - value: function register() { | |
| 7160 | - $e.hooks.registerUICatch(this); | |
| 7161 | - } | |
| 7162 | - }]); | |
| 7163 | -}(_base.default); | |
| 7164 | -var _default = exports["default"] = Catch; | |
| 7165 | - | |
| 7166 | -/***/ }), | |
| 7167 | - | |
| 7168 | -/***/ "../modules/web-cli/assets/js/modules/hooks/ui/index.js": | |
| 7169 | -/*!**************************************************************!*\ | |
| 7170 | - !*** ../modules/web-cli/assets/js/modules/hooks/ui/index.js ***! | |
| 7171 | - \**************************************************************/ | |
| 7172 | -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 7173 | - | |
| 7174 | -"use strict"; | |
| 7175 | - | |
| 7176 | - | |
| 7177 | -Object.defineProperty(exports, "__esModule", ({ | |
| 7178 | - value: true | |
| 7179 | -})); | |
| 7180 | -Object.defineProperty(exports, "After", ({ | |
| 7181 | - enumerable: true, | |
| 7182 | - get: function get() { | |
| 7183 | - return _after.After; | |
| 7184 | - } | |
| 7185 | -})); | |
| 7186 | -Object.defineProperty(exports, "Base", ({ | |
| 7187 | - enumerable: true, | |
| 7188 | - get: function get() { | |
| 7189 | - return _base.Base; | |
| 7190 | - } | |
| 7191 | -})); | |
| 7192 | -Object.defineProperty(exports, "Before", ({ | |
| 7193 | - enumerable: true, | |
| 7194 | - get: function get() { | |
| 7195 | - return _before.Before; | |
| 7196 | - } | |
| 7197 | -})); | |
| 7198 | -Object.defineProperty(exports, "Catch", ({ | |
| 7199 | - enumerable: true, | |
| 7200 | - get: function get() { | |
| 7201 | - return _catch.Catch; | |
| 7202 | - } | |
| 7203 | -})); | |
| 7204 | -var _after = __webpack_require__(/*! ./after */ "../modules/web-cli/assets/js/modules/hooks/ui/after.js"); | |
| 7205 | -var _base = __webpack_require__(/*! ./base */ "../modules/web-cli/assets/js/modules/hooks/ui/base.js"); | |
| 7206 | -var _before = __webpack_require__(/*! ./before */ "../modules/web-cli/assets/js/modules/hooks/ui/before.js"); | |
| 7207 | -var _catch = __webpack_require__(/*! ./catch */ "../modules/web-cli/assets/js/modules/hooks/ui/catch.js"); | |
| 7208 | - | |
| 7209 | -/***/ }), | |
| 7210 | - | |
| 7211 | -/***/ "../modules/web-cli/assets/js/utils/console.js": | |
| 7212 | -/*!*****************************************************!*\ | |
| 7213 | - !*** ../modules/web-cli/assets/js/utils/console.js ***! | |
| 7214 | - \*****************************************************/ | |
| 7215 | -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 7216 | - | |
| 7217 | -"use strict"; | |
| 7218 | - | |
| 7219 | - | |
| 7220 | -var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 7221 | -Object.defineProperty(exports, "__esModule", ({ | |
| 7222 | - value: true | |
| 7223 | -})); | |
| 7224 | -exports["default"] = void 0; | |
| 7225 | -var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 7226 | -var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 7227 | -var Console = exports["default"] = /*#__PURE__*/function () { | |
| 7228 | - function Console() { | |
| 7229 | - (0, _classCallCheck2.default)(this, Console); | |
| 7230 | - } | |
| 7231 | - return (0, _createClass2.default)(Console, null, [{ | |
| 7232 | - key: "error", | |
| 7233 | - value: function error(message) { | |
| 7234 | - // Show an error if devTools is available. | |
| 7235 | - if ($e.devTools) { | |
| 7236 | - $e.devTools.log.error(message); | |
| 7237 | - } | |
| 7238 | - | |
| 7239 | - // If not a 'Hook-Break' then show error. | |
| 7240 | - if (!(message instanceof $e.modules.HookBreak)) { | |
| 7241 | - // eslint-disable-next-line no-console | |
| 7242 | - console.error(message); | |
| 7243 | - } | |
| 7244 | - } | |
| 7245 | - }, { | |
| 7246 | - key: "warn", | |
| 7247 | - value: function warn() { | |
| 7248 | - var _console; | |
| 7249 | - var style = "font-size: 12px; background-image: url(\"".concat(elementorWebCliConfig.urls.assets, "images/logo-icon.png\"); background-repeat: no-repeat; background-size: contain;"); | |
| 7250 | - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { | |
| 7251 | - args[_key] = arguments[_key]; | |
| 7252 | - } | |
| 7253 | - args.unshift('%c %c', style, ''); | |
| 7254 | - (_console = console).warn.apply(_console, args); // eslint-disable-line no-console | |
| 7255 | - } | |
| 7256 | - }]); | |
| 7257 | -}(); | |
| 7258 | - | |
| 7259 | -/***/ }), | |
| 7260 | - | |
| 7261 | -/***/ "../modules/web-cli/assets/js/utils/deprecation.js": | |
| 7262 | -/*!*********************************************************!*\ | |
| 7263 | - !*** ../modules/web-cli/assets/js/utils/deprecation.js ***! | |
| 7264 | - \*********************************************************/ | |
| 7265 | -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 7266 | - | |
| 7267 | -"use strict"; | |
| 7268 | - | |
| 7269 | - | |
| 7270 | -var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 7271 | -Object.defineProperty(exports, "__esModule", ({ | |
| 7272 | - value: true | |
| 7273 | -})); | |
| 7274 | -exports["default"] = void 0; | |
| 7275 | -var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js")); | |
| 7276 | -var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 7277 | -var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 7278 | -var _console = _interopRequireDefault(__webpack_require__(/*! elementor-api/utils/console */ "../modules/web-cli/assets/js/utils/console.js")); | |
| 7279 | -// Copied from `modules/dev-tools/assets/js/deprecation.js` | |
| 7280 | -/** | |
| 7281 | - * @typedef {Object} Version | |
| 7282 | - * @property {number} major1 The first number | |
| 7283 | - * @property {number} major2 The second number | |
| 7284 | - * @property {number} minor The third number | |
| 7285 | - * @property {string} build The fourth number | |
| 7286 | - */ | |
| 7287 | - | |
| 7288 | -var softDeprecated = function softDeprecated(name, version, replacement) { | |
| 7289 | - if (elementorWebCliConfig.isDebug) { | |
| 7290 | - deprecatedMessage('soft', name, version, replacement); | |
| 7291 | - } | |
| 7292 | -}; | |
| 7293 | -var hardDeprecated = function hardDeprecated(name, version, replacement) { | |
| 7294 | - deprecatedMessage('hard', name, version, replacement); | |
| 7295 | -}; | |
| 7296 | -var deprecatedMessage = function deprecatedMessage(type, name, version, replacement) { | |
| 7297 | - var message = "`".concat(name, "` is ").concat(type, " deprecated since ").concat(version); | |
| 7298 | - if (replacement) { | |
| 7299 | - message += " - Use `".concat(replacement, "` instead"); | |
| 7300 | - } | |
| 7301 | - _console.default.warn(message); | |
| 7302 | -}; | |
| 7303 | -var Deprecation = exports["default"] = /*#__PURE__*/function () { | |
| 7304 | - function Deprecation() { | |
| 7305 | - (0, _classCallCheck2.default)(this, Deprecation); | |
| 7306 | - } | |
| 7307 | - return (0, _createClass2.default)(Deprecation, null, [{ | |
| 7308 | - key: "deprecated", | |
| 7309 | - value: function deprecated(name, version, replacement) { | |
| 7310 | - if (this.isHardDeprecated(version)) { | |
| 7311 | - hardDeprecated(name, version, replacement); | |
| 7312 | - } else { | |
| 7313 | - softDeprecated(name, version, replacement); | |
| 7314 | - } | |
| 7315 | - } | |
| 7316 | - | |
| 7317 | - /** | |
| 7318 | - * @param {string} version | |
| 7319 | - * | |
| 7320 | - * @return {Version} | |
| 7321 | - */ | |
| 7322 | - }, { | |
| 7323 | - key: "parseVersion", | |
| 7324 | - value: function parseVersion(version) { | |
| 7325 | - var versionParts = version.split('.'); | |
| 7326 | - if (versionParts.length < 3 || versionParts.length > 4) { | |
| 7327 | - throw new RangeError('Invalid Semantic Version string provided'); | |
| 7328 | - } | |
| 7329 | - var _versionParts = (0, _slicedToArray2.default)(versionParts, 4), | |
| 7330 | - major1 = _versionParts[0], | |
| 7331 | - major2 = _versionParts[1], | |
| 7332 | - minor = _versionParts[2], | |
| 7333 | - _versionParts$ = _versionParts[3], | |
| 7334 | - build = _versionParts$ === void 0 ? '' : _versionParts$; | |
| 7335 | - return { | |
| 7336 | - major1: parseInt(major1), | |
| 7337 | - major2: parseInt(major2), | |
| 7338 | - minor: parseInt(minor), | |
| 7339 | - build: build | |
| 7340 | - }; | |
| 7341 | - } | |
| 7342 | - | |
| 7343 | - /** | |
| 7344 | - * Get total of major. | |
| 7345 | - * | |
| 7346 | - * 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, | |
| 7347 | - * versions with major2 more then 9 will be added to total. | |
| 7348 | - * | |
| 7349 | - * @param {Version} versionObj | |
| 7350 | - * | |
| 7351 | - * @return {number} | |
| 7352 | - */ | |
| 7353 | - }, { | |
| 7354 | - key: "getTotalMajor", | |
| 7355 | - value: function getTotalMajor(versionObj) { | |
| 7356 | - var total = parseInt("".concat(versionObj.major1).concat(versionObj.major2, "0")); | |
| 7357 | - total = Number((total / 10).toFixed(0)); | |
| 7358 | - if (versionObj.major2 > 9) { | |
| 7359 | - total = versionObj.major2 - 9; | |
| 7360 | - } | |
| 7361 | - return total; | |
| 7362 | - } | |
| 7363 | - | |
| 7364 | - /** | |
| 7365 | - * @param {string} version1 | |
| 7366 | - * @param {string} version2 | |
| 7367 | - * | |
| 7368 | - * @return {number} | |
| 7369 | - */ | |
| 7370 | - }, { | |
| 7371 | - key: "compareVersion", | |
| 7372 | - value: function compareVersion(version1, version2) { | |
| 7373 | - var _this = this; | |
| 7374 | - return [this.parseVersion(version1), this.parseVersion(version2)].map(function (versionObj) { | |
| 7375 | - return _this.getTotalMajor(versionObj); | |
| 7376 | - }).reduce(function (acc, major) { | |
| 7377 | - return acc - major; | |
| 7378 | - }); | |
| 7379 | - } | |
| 7380 | - | |
| 7381 | - /** | |
| 7382 | - * @param {string} version | |
| 7383 | - * | |
| 7384 | - * @return {boolean} | |
| 7385 | - */ | |
| 7386 | - }, { | |
| 7387 | - key: "isSoftDeprecated", | |
| 7388 | - value: function isSoftDeprecated(version) { | |
| 7389 | - var total = this.compareVersion(version, elementorWebCliConfig.version); | |
| 7390 | - return total <= 4; | |
| 7391 | - } | |
| 7392 | - | |
| 7393 | - /** | |
| 7394 | - * @param {string} version | |
| 7395 | - * @return {boolean} | |
| 7396 | - */ | |
| 7397 | - }, { | |
| 7398 | - key: "isHardDeprecated", | |
| 7399 | - value: function isHardDeprecated(version) { | |
| 7400 | - var total = this.compareVersion(version, elementorWebCliConfig.version); | |
| 7401 | - return total < 0 || total >= 8; | |
| 7402 | - } | |
| 7403 | - }]); | |
| 7404 | -}(); | |
| 7405 | - | |
| 7406 | -/***/ }), | |
| 7407 | - | |
| 7408 | -/***/ "../modules/web-cli/assets/js/utils/environment.js": | |
| 7409 | -/*!*********************************************************!*\ | |
| 7410 | - !*** ../modules/web-cli/assets/js/utils/environment.js ***! | |
| 7411 | - \*********************************************************/ | |
| 7412 | -/***/ ((__unused_webpack_module, exports) => { | |
| 7413 | - | |
| 7414 | -"use strict"; | |
| 7415 | - | |
| 7416 | - | |
| 7417 | -Object.defineProperty(exports, "__esModule", ({ | |
| 7418 | - value: true | |
| 7419 | -})); | |
| 7420 | -exports["default"] = void 0; | |
| 7421 | -// TODO: Copied from `core/common/assets/js/utils/environment.js`. | |
| 7422 | -var matchUserAgent = function matchUserAgent(UserAgentStr) { | |
| 7423 | - return userAgent.indexOf(UserAgentStr) >= 0; | |
| 7424 | - }, | |
| 7425 | - userAgent = navigator.userAgent, | |
| 7426 | - // Solution influenced by https://stackoverflow.com/questions/9847580/how-to-detect-safari-chrome-ie-firefox-and-opera-browser | |
| 7427 | - | |
| 7428 | - // Opera 8.0+ | |
| 7429 | - isOpera = !!window.opr && !!opr.addons || !!window.opera || matchUserAgent(' OPR/'), | |
| 7430 | - // Firefox 1.0+ | |
| 7431 | - isFirefox = matchUserAgent('Firefox'), | |
| 7432 | - // Safari 3.0+ "[object HTMLElementConstructor]" | |
| 7433 | - isSafari = /^((?!chrome|android).)*safari/i.test(userAgent) || /constructor/i.test(window.HTMLElement) || function (p) { | |
| 7434 | - return '[object SafariRemoteNotification]' === p.toString(); | |
| 7435 | - }(!window.safari || typeof safari !== 'undefined' && safari.pushNotification), | |
| 7436 | - // Internet Explorer 6-11 | |
| 7437 | - isIE = /Trident|MSIE/.test(userAgent) && (/* @cc_on!@*/ false || !!document.documentMode), | |
| 7438 | - // Edge 20+ | |
| 7439 | - isEdge = !isIE && !!window.StyleMedia || matchUserAgent('Edg'), | |
| 7440 | - // Google Chrome (Not accurate) | |
| 7441 | - isChrome = !!window.chrome && matchUserAgent('Chrome') && !(isEdge || isOpera), | |
| 7442 | - // Blink engine | |
| 7443 | - isBlink = matchUserAgent('Chrome') && !!window.CSS, | |
| 7444 | - // Apple Webkit engine | |
| 7445 | - isAppleWebkit = matchUserAgent('AppleWebKit') && !isBlink, | |
| 7446 | - environment = { | |
| 7447 | - appleWebkit: isAppleWebkit, | |
| 7448 | - blink: isBlink, | |
| 7449 | - chrome: isChrome, | |
| 7450 | - edge: isEdge, | |
| 7451 | - firefox: isFirefox, | |
| 7452 | - ie: isIE, | |
| 7453 | - mac: matchUserAgent('Macintosh'), | |
| 7454 | - opera: isOpera, | |
| 7455 | - safari: isSafari, | |
| 7456 | - webkit: matchUserAgent('AppleWebKit') | |
| 7457 | - }; | |
| 7458 | -var _default = exports["default"] = environment; | |
| 7459 | - | |
| 7460 | -/***/ }), | |
| 7461 | - | |
| 7462 | -/***/ "../modules/web-cli/assets/js/utils/force-method-implementation.js": | |
| 7463 | -/*!*************************************************************************!*\ | |
| 7464 | - !*** ../modules/web-cli/assets/js/utils/force-method-implementation.js ***! | |
| 7465 | - \*************************************************************************/ | |
| 7466 | -/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 7467 | - | |
| 7468 | -"use strict"; | |
| 7469 | - | |
| 7470 | - | |
| 7471 | -var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 7472 | -Object.defineProperty(exports, "__esModule", ({ | |
| 7473 | - value: true | |
| 7474 | -})); | |
| 7475 | -exports["default"] = exports.ForceMethodImplementation = void 0; | |
| 7476 | -var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 7477 | -var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 7478 | -var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 7479 | -var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 7480 | -var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 7481 | -var _wrapNativeSuper2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/wrapNativeSuper */ "../node_modules/@babel/runtime/helpers/wrapNativeSuper.js")); | |
| 7482 | -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)); } | |
| 7483 | -function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } | |
| 7484 | -// TODO: Copied from `assets/dev/js/modules/imports/force-method-implementation.js`; | |
| 7485 | -var ForceMethodImplementation = exports.ForceMethodImplementation = /*#__PURE__*/function (_Error) { | |
| 7486 | - function ForceMethodImplementation() { | |
| 7487 | - var _this; | |
| 7488 | - var info = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | |
| 7489 | - (0, _classCallCheck2.default)(this, ForceMethodImplementation); | |
| 7490 | - _this = _callSuper(this, ForceMethodImplementation, ["".concat(info.isStatic ? 'static ' : '').concat(info.fullName, "() should be implemented, please provide '").concat(info.functionName || info.fullName, "' functionality.")]); | |
| 7491 | - Error.captureStackTrace(_this, ForceMethodImplementation); | |
| 7492 | - return _this; | |
| 7493 | - } | |
| 7494 | - (0, _inherits2.default)(ForceMethodImplementation, _Error); | |
| 7495 | - return (0, _createClass2.default)(ForceMethodImplementation); | |
| 7496 | -}(/*#__PURE__*/(0, _wrapNativeSuper2.default)(Error)); | |
| 7497 | -var _default = exports["default"] = function _default() { | |
| 7498 | - var stack = Error().stack, | |
| 7499 | - caller = stack.split('\n')[2].trim(), | |
| 7500 | - callerName = caller.startsWith('at new') ? 'constructor' : caller.split(' ')[1], | |
| 7501 | - info = {}; | |
| 7502 | - info.functionName = callerName; | |
| 7503 | - info.fullName = callerName; | |
| 7504 | - if (info.functionName.includes('.')) { | |
| 7505 | - var parts = info.functionName.split('.'); | |
| 7506 | - info.className = parts[0]; | |
| 7507 | - info.functionName = parts[1]; | |
| 7508 | - } else { | |
| 7509 | - info.isStatic = true; | |
| 7510 | - } | |
| 7511 | - throw new ForceMethodImplementation(info); | |
| 7512 | -}; | |
| 7513 | - | |
| 7514 | -/***/ }), | |
| 7515 | - | |
| 7516 | -/***/ "../node_modules/@babel/runtime/helpers/OverloadYield.js": | |
| 7517 | -/*!***************************************************************!*\ | |
| 7518 | - !*** ../node_modules/@babel/runtime/helpers/OverloadYield.js ***! | |
| 7519 | - \***************************************************************/ | |
| 7520 | -/***/ ((module) => { | |
| 7521 | - | |
| 7522 | -function _OverloadYield(e, d) { | |
| 7523 | - this.v = e, this.k = d; | |
| 7524 | -} | |
| 7525 | -module.exports = _OverloadYield, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 7526 | - | |
| 7527 | -/***/ }), | |
| 7528 | - | |
| 7529 | -/***/ "../node_modules/@babel/runtime/helpers/arrayLikeToArray.js": | |
| 7530 | -/*!******************************************************************!*\ | |
| 7531 | - !*** ../node_modules/@babel/runtime/helpers/arrayLikeToArray.js ***! | |
| 7532 | - \******************************************************************/ | |
| 7533 | -/***/ ((module) => { | |
| 7534 | - | |
| 7535 | -function _arrayLikeToArray(r, a) { | |
| 7536 | - (null == a || a > r.length) && (a = r.length); | |
| 7537 | - for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; | |
| 7538 | - return n; | |
| 7539 | -} | |
| 7540 | -module.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 7541 | - | |
| 7542 | -/***/ }), | |
| 7543 | - | |
| 7544 | -/***/ "../node_modules/@babel/runtime/helpers/arrayWithHoles.js": | |
| 7545 | -/*!****************************************************************!*\ | |
| 7546 | - !*** ../node_modules/@babel/runtime/helpers/arrayWithHoles.js ***! | |
| 7547 | - \****************************************************************/ | |
| 7548 | -/***/ ((module) => { | |
| 7549 | - | |
| 7550 | -function _arrayWithHoles(r) { | |
| 7551 | - if (Array.isArray(r)) return r; | |
| 7552 | -} | |
| 7553 | -module.exports = _arrayWithHoles, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 7554 | - | |
| 7555 | -/***/ }), | |
| 7556 | - | |
| 7557 | -/***/ "../node_modules/@babel/runtime/helpers/assertThisInitialized.js": | |
| 7558 | -/*!***********************************************************************!*\ | |
| 7559 | - !*** ../node_modules/@babel/runtime/helpers/assertThisInitialized.js ***! | |
| 7560 | - \***********************************************************************/ | |
| 7561 | -/***/ ((module) => { | |
| 7562 | - | |
| 7563 | -function _assertThisInitialized(e) { | |
| 7564 | - if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); | |
| 7565 | - return e; | |
| 7566 | -} | |
| 7567 | -module.exports = _assertThisInitialized, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 7568 | - | |
| 7569 | -/***/ }), | |
| 7570 | - | |
| 7571 | -/***/ "../node_modules/@babel/runtime/helpers/asyncToGenerator.js": | |
| 7572 | -/*!******************************************************************!*\ | |
| 7573 | - !*** ../node_modules/@babel/runtime/helpers/asyncToGenerator.js ***! | |
| 7574 | - \******************************************************************/ | |
| 7575 | -/***/ ((module) => { | |
| 7576 | - | |
| 7577 | -function asyncGeneratorStep(n, t, e, r, o, a, c) { | |
| 7578 | - try { | |
| 7579 | - var i = n[a](c), | |
| 7580 | - u = i.value; | |
| 7581 | - } catch (n) { | |
| 7582 | - return void e(n); | |
| 7583 | - } | |
| 7584 | - i.done ? t(u) : Promise.resolve(u).then(r, o); | |
| 7585 | -} | |
| 7586 | -function _asyncToGenerator(n) { | |
| 7587 | - return function () { | |
| 7588 | - var t = this, | |
| 7589 | - e = arguments; | |
| 7590 | - return new Promise(function (r, o) { | |
| 7591 | - var a = n.apply(t, e); | |
| 7592 | - function _next(n) { | |
| 7593 | - asyncGeneratorStep(a, r, o, _next, _throw, "next", n); | |
| 7594 | - } | |
| 7595 | - function _throw(n) { | |
| 7596 | - asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); | |
| 7597 | - } | |
| 7598 | - _next(void 0); | |
| 7599 | - }); | |
| 7600 | - }; | |
| 7601 | -} | |
| 7602 | -module.exports = _asyncToGenerator, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 7603 | - | |
| 7604 | -/***/ }), | |
| 7605 | - | |
| 7606 | -/***/ "../node_modules/@babel/runtime/helpers/classCallCheck.js": | |
| 7607 | -/*!****************************************************************!*\ | |
| 7608 | - !*** ../node_modules/@babel/runtime/helpers/classCallCheck.js ***! | |
| 7609 | - \****************************************************************/ | |
| 7610 | -/***/ ((module) => { | |
| 7611 | - | |
| 7612 | -function _classCallCheck(a, n) { | |
| 7613 | - if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); | |
| 7614 | -} | |
| 7615 | -module.exports = _classCallCheck, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 7616 | - | |
| 7617 | -/***/ }), | |
| 7618 | - | |
| 7619 | -/***/ "../node_modules/@babel/runtime/helpers/construct.js": | |
| 7620 | -/*!***********************************************************!*\ | |
| 7621 | - !*** ../node_modules/@babel/runtime/helpers/construct.js ***! | |
| 7622 | - \***********************************************************/ | |
| 7623 | -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 7624 | - | |
| 7625 | -var isNativeReflectConstruct = __webpack_require__(/*! ./isNativeReflectConstruct.js */ "../node_modules/@babel/runtime/helpers/isNativeReflectConstruct.js"); | |
| 7626 | -var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ "../node_modules/@babel/runtime/helpers/setPrototypeOf.js"); | |
| 7627 | -function _construct(t, e, r) { | |
| 7628 | - if (isNativeReflectConstruct()) return Reflect.construct.apply(null, arguments); | |
| 7629 | - var o = [null]; | |
| 7630 | - o.push.apply(o, e); | |
| 7631 | - var p = new (t.bind.apply(t, o))(); | |
| 7632 | - return r && setPrototypeOf(p, r.prototype), p; | |
| 7633 | -} | |
| 7634 | -module.exports = _construct, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 7635 | - | |
| 7636 | -/***/ }), | |
| 7637 | - | |
| 7638 | -/***/ "../node_modules/@babel/runtime/helpers/createClass.js": | |
| 7639 | -/*!*************************************************************!*\ | |
| 7640 | - !*** ../node_modules/@babel/runtime/helpers/createClass.js ***! | |
| 7641 | - \*************************************************************/ | |
| 7642 | -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 7643 | - | |
| 7644 | -var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ "../node_modules/@babel/runtime/helpers/toPropertyKey.js"); | |
| 7645 | -function _defineProperties(e, r) { | |
| 7646 | - for (var t = 0; t < r.length; t++) { | |
| 7647 | - var o = r[t]; | |
| 7648 | - o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, toPropertyKey(o.key), o); | |
| 7649 | - } | |
| 7650 | -} | |
| 7651 | -function _createClass(e, r, t) { | |
| 7652 | - return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { | |
| 7653 | - writable: !1 | |
| 7654 | - }), e; | |
| 7655 | -} | |
| 7656 | -module.exports = _createClass, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 7657 | - | |
| 7658 | -/***/ }), | |
| 7659 | - | |
| 7660 | -/***/ "../node_modules/@babel/runtime/helpers/defineProperty.js": | |
| 7661 | -/*!****************************************************************!*\ | |
| 7662 | - !*** ../node_modules/@babel/runtime/helpers/defineProperty.js ***! | |
| 7663 | - \****************************************************************/ | |
| 7664 | -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 7665 | - | |
| 7666 | -var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ "../node_modules/@babel/runtime/helpers/toPropertyKey.js"); | |
| 7667 | -function _defineProperty(e, r, t) { | |
| 7668 | - return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, { | |
| 7669 | - value: t, | |
| 7670 | - enumerable: !0, | |
| 7671 | - configurable: !0, | |
| 7672 | - writable: !0 | |
| 7673 | - }) : e[r] = t, e; | |
| 7674 | -} | |
| 7675 | -module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 7676 | - | |
| 7677 | -/***/ }), | |
| 7678 | - | |
| 7679 | -/***/ "../node_modules/@babel/runtime/helpers/get.js": | |
| 7680 | -/*!*****************************************************!*\ | |
| 7681 | - !*** ../node_modules/@babel/runtime/helpers/get.js ***! | |
| 7682 | - \*****************************************************/ | |
| 7683 | -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 7684 | - | |
| 7685 | -var superPropBase = __webpack_require__(/*! ./superPropBase.js */ "../node_modules/@babel/runtime/helpers/superPropBase.js"); | |
| 7686 | -function _get() { | |
| 7687 | - return module.exports = _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) { | |
| 7688 | - var p = superPropBase(e, t); | |
| 7689 | - if (p) { | |
| 7690 | - var n = Object.getOwnPropertyDescriptor(p, t); | |
| 7691 | - return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value; | |
| 7692 | - } | |
| 7693 | - }, module.exports.__esModule = true, module.exports["default"] = module.exports, _get.apply(null, arguments); | |
| 7694 | -} | |
| 7695 | -module.exports = _get, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 7696 | - | |
| 7697 | -/***/ }), | |
| 7698 | - | |
| 7699 | -/***/ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js": | |
| 7700 | -/*!****************************************************************!*\ | |
| 7701 | - !*** ../node_modules/@babel/runtime/helpers/getPrototypeOf.js ***! | |
| 7702 | - \****************************************************************/ | |
| 7703 | -/***/ ((module) => { | |
| 7704 | - | |
| 7705 | -function _getPrototypeOf(t) { | |
| 7706 | - return module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { | |
| 7707 | - return t.__proto__ || Object.getPrototypeOf(t); | |
| 7708 | - }, module.exports.__esModule = true, module.exports["default"] = module.exports, _getPrototypeOf(t); | |
| 7709 | -} | |
| 7710 | -module.exports = _getPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 7711 | - | |
| 7712 | -/***/ }), | |
| 7713 | - | |
| 7714 | -/***/ "../node_modules/@babel/runtime/helpers/inherits.js": | |
| 7715 | -/*!**********************************************************!*\ | |
| 7716 | - !*** ../node_modules/@babel/runtime/helpers/inherits.js ***! | |
| 7717 | - \**********************************************************/ | |
| 7718 | -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 7719 | - | |
| 7720 | -var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ "../node_modules/@babel/runtime/helpers/setPrototypeOf.js"); | |
| 7721 | -function _inherits(t, e) { | |
| 7722 | - if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); | |
| 7723 | - t.prototype = Object.create(e && e.prototype, { | |
| 7724 | - constructor: { | |
| 7725 | - value: t, | |
| 7726 | - writable: !0, | |
| 7727 | - configurable: !0 | |
| 7728 | - } | |
| 7729 | - }), Object.defineProperty(t, "prototype", { | |
| 7730 | - writable: !1 | |
| 7731 | - }), e && setPrototypeOf(t, e); | |
| 7732 | -} | |
| 7733 | -module.exports = _inherits, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 7734 | - | |
| 7735 | -/***/ }), | |
| 7736 | - | |
| 7737 | -/***/ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js": | |
| 7738 | -/*!***********************************************************************!*\ | |
| 7739 | - !*** ../node_modules/@babel/runtime/helpers/interopRequireDefault.js ***! | |
| 7740 | - \***********************************************************************/ | |
| 7741 | -/***/ ((module) => { | |
| 7742 | - | |
| 7743 | -function _interopRequireDefault(e) { | |
| 7744 | - return e && e.__esModule ? e : { | |
| 7745 | - "default": e | |
| 7746 | - }; | |
| 7747 | -} | |
| 7748 | -module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 7749 | - | |
| 7750 | -/***/ }), | |
| 7751 | - | |
| 7752 | -/***/ "../node_modules/@babel/runtime/helpers/isNativeFunction.js": | |
| 7753 | -/*!******************************************************************!*\ | |
| 7754 | - !*** ../node_modules/@babel/runtime/helpers/isNativeFunction.js ***! | |
| 7755 | - \******************************************************************/ | |
| 7756 | -/***/ ((module) => { | |
| 7757 | - | |
| 7758 | -function _isNativeFunction(t) { | |
| 7759 | - try { | |
| 7760 | - return -1 !== Function.toString.call(t).indexOf("[native code]"); | |
| 7761 | - } catch (n) { | |
| 7762 | - return "function" == typeof t; | |
| 7763 | - } | |
| 7764 | -} | |
| 7765 | -module.exports = _isNativeFunction, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 7766 | - | |
| 7767 | -/***/ }), | |
| 7768 | - | |
| 7769 | -/***/ "../node_modules/@babel/runtime/helpers/isNativeReflectConstruct.js": | |
| 7770 | -/*!**************************************************************************!*\ | |
| 7771 | - !*** ../node_modules/@babel/runtime/helpers/isNativeReflectConstruct.js ***! | |
| 7772 | - \**************************************************************************/ | |
| 7773 | -/***/ ((module) => { | |
| 7774 | - | |
| 7775 | -function _isNativeReflectConstruct() { | |
| 7776 | - try { | |
| 7777 | - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); | |
| 7778 | - } catch (t) {} | |
| 7779 | - return (module.exports = _isNativeReflectConstruct = function _isNativeReflectConstruct() { | |
| 7780 | - return !!t; | |
| 7781 | - }, module.exports.__esModule = true, module.exports["default"] = module.exports)(); | |
| 7782 | -} | |
| 7783 | -module.exports = _isNativeReflectConstruct, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 7784 | - | |
| 7785 | -/***/ }), | |
| 7786 | - | |
| 7787 | -/***/ "../node_modules/@babel/runtime/helpers/iterableToArrayLimit.js": | |
| 7788 | -/*!**********************************************************************!*\ | |
| 7789 | - !*** ../node_modules/@babel/runtime/helpers/iterableToArrayLimit.js ***! | |
| 7790 | - \**********************************************************************/ | |
| 7791 | -/***/ ((module) => { | |
| 7792 | - | |
| 7793 | -function _iterableToArrayLimit(r, l) { | |
| 7794 | - var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; | |
| 7795 | - if (null != t) { | |
| 7796 | - var e, | |
| 7797 | - n, | |
| 7798 | - i, | |
| 7799 | - u, | |
| 7800 | - a = [], | |
| 7801 | - f = !0, | |
| 7802 | - o = !1; | |
| 7803 | - try { | |
| 7804 | - if (i = (t = t.call(r)).next, 0 === l) { | |
| 7805 | - if (Object(t) !== t) return; | |
| 7806 | - f = !1; | |
| 7807 | - } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); | |
| 7808 | - } catch (r) { | |
| 7809 | - o = !0, n = r; | |
| 7810 | - } finally { | |
| 7811 | - try { | |
| 7812 | - if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; | |
| 7813 | - } finally { | |
| 7814 | - if (o) throw n; | |
| 7815 | - } | |
| 7816 | - } | |
| 7817 | - return a; | |
| 7818 | - } | |
| 7819 | -} | |
| 7820 | -module.exports = _iterableToArrayLimit, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 7821 | - | |
| 7822 | -/***/ }), | |
| 7823 | - | |
| 7824 | -/***/ "../node_modules/@babel/runtime/helpers/nonIterableRest.js": | |
| 7825 | -/*!*****************************************************************!*\ | |
| 7826 | - !*** ../node_modules/@babel/runtime/helpers/nonIterableRest.js ***! | |
| 7827 | - \*****************************************************************/ | |
| 7828 | -/***/ ((module) => { | |
| 7829 | - | |
| 7830 | -function _nonIterableRest() { | |
| 7831 | - throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); | |
| 7832 | -} | |
| 7833 | -module.exports = _nonIterableRest, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 7834 | - | |
| 7835 | -/***/ }), | |
| 7836 | - | |
| 7837 | -/***/ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js": | |
| 7838 | -/*!***************************************************************************!*\ | |
| 7839 | - !*** ../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js ***! | |
| 7840 | - \***************************************************************************/ | |
| 7841 | -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 7842 | - | |
| 7843 | -var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]); | |
| 7844 | -var assertThisInitialized = __webpack_require__(/*! ./assertThisInitialized.js */ "../node_modules/@babel/runtime/helpers/assertThisInitialized.js"); | |
| 7845 | -function _possibleConstructorReturn(t, e) { | |
| 7846 | - if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; | |
| 7847 | - if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); | |
| 7848 | - return assertThisInitialized(t); | |
| 7849 | -} | |
| 7850 | -module.exports = _possibleConstructorReturn, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 7851 | - | |
| 7852 | -/***/ }), | |
| 7853 | - | |
| 7854 | -/***/ "../node_modules/@babel/runtime/helpers/readOnlyError.js": | |
| 7855 | -/*!***************************************************************!*\ | |
| 7856 | - !*** ../node_modules/@babel/runtime/helpers/readOnlyError.js ***! | |
| 7857 | - \***************************************************************/ | |
| 7858 | -/***/ ((module) => { | |
| 7859 | - | |
| 7860 | -function _readOnlyError(r) { | |
| 7861 | - throw new TypeError('"' + r + '" is read-only'); | |
| 7862 | -} | |
| 7863 | -module.exports = _readOnlyError, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 7864 | - | |
| 7865 | -/***/ }), | |
| 7866 | - | |
| 7867 | -/***/ "../node_modules/@babel/runtime/helpers/regenerator.js": | |
| 7868 | -/*!*************************************************************!*\ | |
| 7869 | - !*** ../node_modules/@babel/runtime/helpers/regenerator.js ***! | |
| 7870 | - \*************************************************************/ | |
| 7871 | -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 7872 | - | |
| 7873 | -var regeneratorDefine = __webpack_require__(/*! ./regeneratorDefine.js */ "../node_modules/@babel/runtime/helpers/regeneratorDefine.js"); | |
| 7874 | -function _regenerator() { | |
| 7875 | - /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ | |
| 7876 | - var e, | |
| 7877 | - t, | |
| 7878 | - r = "function" == typeof Symbol ? Symbol : {}, | |
| 7879 | - n = r.iterator || "@@iterator", | |
| 7880 | - o = r.toStringTag || "@@toStringTag"; | |
| 7881 | - function i(r, n, o, i) { | |
| 7882 | - var c = n && n.prototype instanceof Generator ? n : Generator, | |
| 7883 | - u = Object.create(c.prototype); | |
| 7884 | - return regeneratorDefine(u, "_invoke", function (r, n, o) { | |
| 7885 | - var i, | |
| 7886 | - c, | |
| 7887 | - u, | |
| 7888 | - f = 0, | |
| 7889 | - p = o || [], | |
| 7890 | - y = !1, | |
| 7891 | - G = { | |
| 7892 | - p: 0, | |
| 7893 | - n: 0, | |
| 7894 | - v: e, | |
| 7895 | - a: d, | |
| 7896 | - f: d.bind(e, 4), | |
| 7897 | - d: function d(t, r) { | |
| 7898 | - return i = t, c = 0, u = e, G.n = r, a; | |
| 7899 | - } | |
| 7900 | - }; | |
| 7901 | - function d(r, n) { | |
| 7902 | - for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { | |
| 7903 | - var o, | |
| 7904 | - i = p[t], | |
| 7905 | - d = G.p, | |
| 7906 | - l = i[2]; | |
| 7907 | - 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)); | |
| 7908 | - } | |
| 7909 | - if (o || r > 1) return a; | |
| 7910 | - throw y = !0, n; | |
| 7911 | - } | |
| 7912 | - return function (o, p, l) { | |
| 7913 | - if (f > 1) throw TypeError("Generator is already running"); | |
| 7914 | - for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { | |
| 7915 | - i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); | |
| 7916 | - try { | |
| 7917 | - if (f = 2, i) { | |
| 7918 | - if (c || (o = "next"), t = i[o]) { | |
| 7919 | - if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); | |
| 7920 | - if (!t.done) return t; | |
| 7921 | - u = t.value, c < 2 && (c = 0); | |
| 7922 | - } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); | |
| 7923 | - i = e; | |
| 7924 | - } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; | |
| 7925 | - } catch (t) { | |
| 7926 | - i = e, c = 1, u = t; | |
| 7927 | - } finally { | |
| 7928 | - f = 1; | |
| 7929 | - } | |
| 7930 | - } | |
| 7931 | - return { | |
| 7932 | - value: t, | |
| 7933 | - done: y | |
| 7934 | - }; | |
| 7935 | - }; | |
| 7936 | - }(r, o, i), !0), u; | |
| 7937 | - } | |
| 7938 | - var a = {}; | |
| 7939 | - function Generator() {} | |
| 7940 | - function GeneratorFunction() {} | |
| 7941 | - function GeneratorFunctionPrototype() {} | |
| 7942 | - t = Object.getPrototypeOf; | |
| 7943 | - var c = [][n] ? t(t([][n]())) : (regeneratorDefine(t = {}, n, function () { | |
| 7944 | - return this; | |
| 7945 | - }), t), | |
| 7946 | - u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); | |
| 7947 | - function f(e) { | |
| 7948 | - return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, regeneratorDefine(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; | |
| 7949 | - } | |
| 7950 | - 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 () { | |
| 7951 | - return this; | |
| 7952 | - }), regeneratorDefine(u, "toString", function () { | |
| 7953 | - return "[object Generator]"; | |
| 7954 | - }), (module.exports = _regenerator = function _regenerator() { | |
| 7955 | - return { | |
| 7956 | - w: i, | |
| 7957 | - m: f | |
| 7958 | - }; | |
| 7959 | - }, module.exports.__esModule = true, module.exports["default"] = module.exports)(); | |
| 7960 | -} | |
| 7961 | -module.exports = _regenerator, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 7962 | - | |
| 7963 | -/***/ }), | |
| 7964 | - | |
| 7965 | -/***/ "../node_modules/@babel/runtime/helpers/regeneratorAsync.js": | |
| 7966 | -/*!******************************************************************!*\ | |
| 7967 | - !*** ../node_modules/@babel/runtime/helpers/regeneratorAsync.js ***! | |
| 7968 | - \******************************************************************/ | |
| 7969 | -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 7970 | - | |
| 7971 | -var regeneratorAsyncGen = __webpack_require__(/*! ./regeneratorAsyncGen.js */ "../node_modules/@babel/runtime/helpers/regeneratorAsyncGen.js"); | |
| 7972 | -function _regeneratorAsync(n, e, r, t, o) { | |
| 7973 | - var a = regeneratorAsyncGen(n, e, r, t, o); | |
| 7974 | - return a.next().then(function (n) { | |
| 7975 | - return n.done ? n.value : a.next(); | |
| 7976 | - }); | |
| 7977 | -} | |
| 7978 | -module.exports = _regeneratorAsync, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 7979 | - | |
| 7980 | -/***/ }), | |
| 7981 | - | |
| 7982 | -/***/ "../node_modules/@babel/runtime/helpers/regeneratorAsyncGen.js": | |
| 7983 | -/*!*********************************************************************!*\ | |
| 7984 | - !*** ../node_modules/@babel/runtime/helpers/regeneratorAsyncGen.js ***! | |
| 7985 | - \*********************************************************************/ | |
| 7986 | -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 7987 | - | |
| 7988 | -var regenerator = __webpack_require__(/*! ./regenerator.js */ "../node_modules/@babel/runtime/helpers/regenerator.js"); | |
| 7989 | -var regeneratorAsyncIterator = __webpack_require__(/*! ./regeneratorAsyncIterator.js */ "../node_modules/@babel/runtime/helpers/regeneratorAsyncIterator.js"); | |
| 7990 | -function _regeneratorAsyncGen(r, e, t, o, n) { | |
| 7991 | - return new regeneratorAsyncIterator(regenerator().w(r, e, t, o), n || Promise); | |
| 7992 | -} | |
| 7993 | -module.exports = _regeneratorAsyncGen, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 7994 | - | |
| 7995 | -/***/ }), | |
| 7996 | - | |
| 7997 | -/***/ "../node_modules/@babel/runtime/helpers/regeneratorAsyncIterator.js": | |
| 7998 | -/*!**************************************************************************!*\ | |
| 7999 | - !*** ../node_modules/@babel/runtime/helpers/regeneratorAsyncIterator.js ***! | |
| 8000 | - \**************************************************************************/ | |
| 8001 | -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 8002 | - | |
| 8003 | -var OverloadYield = __webpack_require__(/*! ./OverloadYield.js */ "../node_modules/@babel/runtime/helpers/OverloadYield.js"); | |
| 8004 | -var regeneratorDefine = __webpack_require__(/*! ./regeneratorDefine.js */ "../node_modules/@babel/runtime/helpers/regeneratorDefine.js"); | |
| 8005 | -function AsyncIterator(t, e) { | |
| 8006 | - function n(r, o, i, f) { | |
| 8007 | - try { | |
| 8008 | - var c = t[r](o), | |
| 8009 | - u = c.value; | |
| 8010 | - return u instanceof OverloadYield ? e.resolve(u.v).then(function (t) { | |
| 8011 | - n("next", t, i, f); | |
| 8012 | - }, function (t) { | |
| 8013 | - n("throw", t, i, f); | |
| 8014 | - }) : e.resolve(u).then(function (t) { | |
| 8015 | - c.value = t, i(c); | |
| 8016 | - }, function (t) { | |
| 8017 | - return n("throw", t, i, f); | |
| 8018 | - }); | |
| 8019 | - } catch (t) { | |
| 8020 | - f(t); | |
| 8021 | - } | |
| 8022 | - } | |
| 8023 | - var r; | |
| 8024 | - this.next || (regeneratorDefine(AsyncIterator.prototype), regeneratorDefine(AsyncIterator.prototype, "function" == typeof Symbol && Symbol.asyncIterator || "@asyncIterator", function () { | |
| 8025 | - return this; | |
| 8026 | - })), regeneratorDefine(this, "_invoke", function (t, o, i) { | |
| 8027 | - function f() { | |
| 8028 | - return new e(function (e, r) { | |
| 8029 | - n(t, i, e, r); | |
| 8030 | - }); | |
| 8031 | - } | |
| 8032 | - return r = r ? r.then(f, f) : f(); | |
| 8033 | - }, !0); | |
| 8034 | -} | |
| 8035 | -module.exports = AsyncIterator, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 8036 | - | |
| 8037 | -/***/ }), | |
| 8038 | - | |
| 8039 | -/***/ "../node_modules/@babel/runtime/helpers/regeneratorDefine.js": | |
| 8040 | -/*!*******************************************************************!*\ | |
| 8041 | - !*** ../node_modules/@babel/runtime/helpers/regeneratorDefine.js ***! | |
| 8042 | - \*******************************************************************/ | |
| 8043 | -/***/ ((module) => { | |
| 8044 | - | |
| 8045 | -function _regeneratorDefine(e, r, n, t) { | |
| 8046 | - var i = Object.defineProperty; | |
| 8047 | - try { | |
| 8048 | - i({}, "", {}); | |
| 8049 | - } catch (e) { | |
| 8050 | - i = 0; | |
| 8051 | - } | |
| 8052 | - module.exports = _regeneratorDefine = function regeneratorDefine(e, r, n, t) { | |
| 8053 | - function o(r, n) { | |
| 8054 | - _regeneratorDefine(e, r, function (e) { | |
| 8055 | - return this._invoke(r, n, e); | |
| 8056 | - }); | |
| 8057 | - } | |
| 8058 | - r ? i ? i(e, r, { | |
| 8059 | - value: n, | |
| 8060 | - enumerable: !t, | |
| 8061 | - configurable: !t, | |
| 8062 | - writable: !t | |
| 8063 | - }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); | |
| 8064 | - }, module.exports.__esModule = true, module.exports["default"] = module.exports, _regeneratorDefine(e, r, n, t); | |
| 8065 | -} | |
| 8066 | -module.exports = _regeneratorDefine, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 8067 | - | |
| 8068 | -/***/ }), | |
| 8069 | - | |
| 8070 | -/***/ "../node_modules/@babel/runtime/helpers/regeneratorKeys.js": | |
| 8071 | -/*!*****************************************************************!*\ | |
| 8072 | - !*** ../node_modules/@babel/runtime/helpers/regeneratorKeys.js ***! | |
| 8073 | - \*****************************************************************/ | |
| 8074 | -/***/ ((module) => { | |
| 8075 | - | |
| 8076 | -function _regeneratorKeys(e) { | |
| 8077 | - var n = Object(e), | |
| 8078 | - r = []; | |
| 8079 | - for (var t in n) r.unshift(t); | |
| 8080 | - return function e() { | |
| 8081 | - for (; r.length;) if ((t = r.pop()) in n) return e.value = t, e.done = !1, e; | |
| 8082 | - return e.done = !0, e; | |
| 8083 | - }; | |
| 8084 | -} | |
| 8085 | -module.exports = _regeneratorKeys, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 8086 | - | |
| 8087 | -/***/ }), | |
| 8088 | - | |
| 8089 | -/***/ "../node_modules/@babel/runtime/helpers/regeneratorRuntime.js": | |
| 8090 | -/*!********************************************************************!*\ | |
| 8091 | - !*** ../node_modules/@babel/runtime/helpers/regeneratorRuntime.js ***! | |
| 8092 | - \********************************************************************/ | |
| 8093 | -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 8094 | - | |
| 8095 | -var OverloadYield = __webpack_require__(/*! ./OverloadYield.js */ "../node_modules/@babel/runtime/helpers/OverloadYield.js"); | |
| 8096 | -var regenerator = __webpack_require__(/*! ./regenerator.js */ "../node_modules/@babel/runtime/helpers/regenerator.js"); | |
| 8097 | -var regeneratorAsync = __webpack_require__(/*! ./regeneratorAsync.js */ "../node_modules/@babel/runtime/helpers/regeneratorAsync.js"); | |
| 8098 | -var regeneratorAsyncGen = __webpack_require__(/*! ./regeneratorAsyncGen.js */ "../node_modules/@babel/runtime/helpers/regeneratorAsyncGen.js"); | |
| 8099 | -var regeneratorAsyncIterator = __webpack_require__(/*! ./regeneratorAsyncIterator.js */ "../node_modules/@babel/runtime/helpers/regeneratorAsyncIterator.js"); | |
| 8100 | -var regeneratorKeys = __webpack_require__(/*! ./regeneratorKeys.js */ "../node_modules/@babel/runtime/helpers/regeneratorKeys.js"); | |
| 8101 | -var regeneratorValues = __webpack_require__(/*! ./regeneratorValues.js */ "../node_modules/@babel/runtime/helpers/regeneratorValues.js"); | |
| 8102 | -function _regeneratorRuntime() { | |
| 8103 | - "use strict"; | |
| 8104 | - | |
| 8105 | - var r = regenerator(), | |
| 8106 | - e = r.m(_regeneratorRuntime), | |
| 8107 | - t = (Object.getPrototypeOf ? Object.getPrototypeOf(e) : e.__proto__).constructor; | |
| 8108 | - function n(r) { | |
| 8109 | - var e = "function" == typeof r && r.constructor; | |
| 8110 | - return !!e && (e === t || "GeneratorFunction" === (e.displayName || e.name)); | |
| 8111 | - } | |
| 8112 | - var o = { | |
| 8113 | - "throw": 1, | |
| 8114 | - "return": 2, | |
| 8115 | - "break": 3, | |
| 8116 | - "continue": 3 | |
| 8117 | - }; | |
| 8118 | - function a(r) { | |
| 8119 | - var e, t; | |
| 8120 | - return function (n) { | |
| 8121 | - e || (e = { | |
| 8122 | - stop: function stop() { | |
| 8123 | - return t(n.a, 2); | |
| 8124 | - }, | |
| 8125 | - "catch": function _catch() { | |
| 8126 | - return n.v; | |
| 8127 | - }, | |
| 8128 | - abrupt: function abrupt(r, e) { | |
| 8129 | - return t(n.a, o[r], e); | |
| 8130 | - }, | |
| 8131 | - delegateYield: function delegateYield(r, o, a) { | |
| 8132 | - return e.resultName = o, t(n.d, regeneratorValues(r), a); | |
| 8133 | - }, | |
| 8134 | - finish: function finish(r) { | |
| 8135 | - return t(n.f, r); | |
| 8136 | - } | |
| 8137 | - }, t = function t(r, _t, o) { | |
| 8138 | - n.p = e.prev, n.n = e.next; | |
| 8139 | - try { | |
| 8140 | - return r(_t, o); | |
| 8141 | - } finally { | |
| 8142 | - e.next = n.n; | |
| 8143 | - } | |
| 8144 | - }), e.resultName && (e[e.resultName] = n.v, e.resultName = void 0), e.sent = n.v, e.next = n.n; | |
| 8145 | - try { | |
| 8146 | - return r.call(this, e); | |
| 8147 | - } finally { | |
| 8148 | - n.p = e.prev, n.n = e.next; | |
| 8149 | - } | |
| 8150 | - }; | |
| 8151 | - } | |
| 8152 | - return (module.exports = _regeneratorRuntime = function _regeneratorRuntime() { | |
| 8153 | - return { | |
| 8154 | - wrap: function wrap(e, t, n, o) { | |
| 8155 | - return r.w(a(e), t, n, o && o.reverse()); | |
| 8156 | - }, | |
| 8157 | - isGeneratorFunction: n, | |
| 8158 | - mark: r.m, | |
| 8159 | - awrap: function awrap(r, e) { | |
| 8160 | - return new OverloadYield(r, e); | |
| 8161 | - }, | |
| 8162 | - AsyncIterator: regeneratorAsyncIterator, | |
| 8163 | - async: function async(r, e, t, o, u) { | |
| 8164 | - return (n(e) ? regeneratorAsyncGen : regeneratorAsync)(a(r), e, t, o, u); | |
| 8165 | - }, | |
| 8166 | - keys: regeneratorKeys, | |
| 8167 | - values: regeneratorValues | |
| 8168 | - }; | |
| 8169 | - }, module.exports.__esModule = true, module.exports["default"] = module.exports)(); | |
| 8170 | -} | |
| 8171 | -module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 8172 | - | |
| 8173 | -/***/ }), | |
| 8174 | - | |
| 8175 | -/***/ "../node_modules/@babel/runtime/helpers/regeneratorValues.js": | |
| 8176 | -/*!*******************************************************************!*\ | |
| 8177 | - !*** ../node_modules/@babel/runtime/helpers/regeneratorValues.js ***! | |
| 8178 | - \*******************************************************************/ | |
| 8179 | -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 8180 | - | |
| 8181 | -var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]); | |
| 8182 | -function _regeneratorValues(e) { | |
| 8183 | - if (null != e) { | |
| 8184 | - var t = e["function" == typeof Symbol && Symbol.iterator || "@@iterator"], | |
| 8185 | - r = 0; | |
| 8186 | - if (t) return t.call(e); | |
| 8187 | - if ("function" == typeof e.next) return e; | |
| 8188 | - if (!isNaN(e.length)) return { | |
| 8189 | - next: function next() { | |
| 8190 | - return e && r >= e.length && (e = void 0), { | |
| 8191 | - value: e && e[r++], | |
| 8192 | - done: !e | |
| 8193 | - }; | |
| 8194 | - } | |
| 8195 | - }; | |
| 8196 | - } | |
| 8197 | - throw new TypeError(_typeof(e) + " is not iterable"); | |
| 8198 | -} | |
| 8199 | -module.exports = _regeneratorValues, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 8200 | - | |
| 8201 | -/***/ }), | |
| 8202 | - | |
| 8203 | -/***/ "../node_modules/@babel/runtime/helpers/setPrototypeOf.js": | |
| 8204 | -/*!****************************************************************!*\ | |
| 8205 | - !*** ../node_modules/@babel/runtime/helpers/setPrototypeOf.js ***! | |
| 8206 | - \****************************************************************/ | |
| 8207 | -/***/ ((module) => { | |
| 8208 | - | |
| 8209 | -function _setPrototypeOf(t, e) { | |
| 8210 | - return module.exports = _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { | |
| 8211 | - return t.__proto__ = e, t; | |
| 8212 | - }, module.exports.__esModule = true, module.exports["default"] = module.exports, _setPrototypeOf(t, e); | |
| 8213 | -} | |
| 8214 | -module.exports = _setPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 8215 | - | |
| 8216 | -/***/ }), | |
| 8217 | - | |
| 8218 | -/***/ "../node_modules/@babel/runtime/helpers/slicedToArray.js": | |
| 8219 | -/*!***************************************************************!*\ | |
| 8220 | - !*** ../node_modules/@babel/runtime/helpers/slicedToArray.js ***! | |
| 8221 | - \***************************************************************/ | |
| 8222 | -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 8223 | - | |
| 8224 | -var arrayWithHoles = __webpack_require__(/*! ./arrayWithHoles.js */ "../node_modules/@babel/runtime/helpers/arrayWithHoles.js"); | |
| 8225 | -var iterableToArrayLimit = __webpack_require__(/*! ./iterableToArrayLimit.js */ "../node_modules/@babel/runtime/helpers/iterableToArrayLimit.js"); | |
| 8226 | -var unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray.js */ "../node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js"); | |
| 8227 | -var nonIterableRest = __webpack_require__(/*! ./nonIterableRest.js */ "../node_modules/@babel/runtime/helpers/nonIterableRest.js"); | |
| 8228 | -function _slicedToArray(r, e) { | |
| 8229 | - return arrayWithHoles(r) || iterableToArrayLimit(r, e) || unsupportedIterableToArray(r, e) || nonIterableRest(); | |
| 8230 | -} | |
| 8231 | -module.exports = _slicedToArray, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 8232 | - | |
| 8233 | -/***/ }), | |
| 8234 | - | |
| 8235 | -/***/ "../node_modules/@babel/runtime/helpers/superPropBase.js": | |
| 8236 | -/*!***************************************************************!*\ | |
| 8237 | - !*** ../node_modules/@babel/runtime/helpers/superPropBase.js ***! | |
| 8238 | - \***************************************************************/ | |
| 8239 | -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 8240 | - | |
| 8241 | -var getPrototypeOf = __webpack_require__(/*! ./getPrototypeOf.js */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"); | |
| 8242 | -function _superPropBase(t, o) { | |
| 8243 | - for (; !{}.hasOwnProperty.call(t, o) && null !== (t = getPrototypeOf(t));); | |
| 8244 | - return t; | |
| 8245 | -} | |
| 8246 | -module.exports = _superPropBase, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 8247 | - | |
| 8248 | -/***/ }), | |
| 8249 | - | |
| 8250 | -/***/ "../node_modules/@babel/runtime/helpers/toPrimitive.js": | |
| 8251 | -/*!*************************************************************!*\ | |
| 8252 | - !*** ../node_modules/@babel/runtime/helpers/toPrimitive.js ***! | |
| 8253 | - \*************************************************************/ | |
| 8254 | -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 8255 | - | |
| 8256 | -var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]); | |
| 8257 | -function toPrimitive(t, r) { | |
| 8258 | - if ("object" != _typeof(t) || !t) return t; | |
| 8259 | - var e = t[Symbol.toPrimitive]; | |
| 8260 | - if (void 0 !== e) { | |
| 8261 | - var i = e.call(t, r || "default"); | |
| 8262 | - if ("object" != _typeof(i)) return i; | |
| 8263 | - throw new TypeError("@@toPrimitive must return a primitive value."); | |
| 8264 | - } | |
| 8265 | - return ("string" === r ? String : Number)(t); | |
| 8266 | -} | |
| 8267 | -module.exports = toPrimitive, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 8268 | - | |
| 8269 | -/***/ }), | |
| 8270 | - | |
| 8271 | -/***/ "../node_modules/@babel/runtime/helpers/toPropertyKey.js": | |
| 8272 | -/*!***************************************************************!*\ | |
| 8273 | - !*** ../node_modules/@babel/runtime/helpers/toPropertyKey.js ***! | |
| 8274 | - \***************************************************************/ | |
| 8275 | -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 8276 | - | |
| 8277 | -var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]); | |
| 8278 | -var toPrimitive = __webpack_require__(/*! ./toPrimitive.js */ "../node_modules/@babel/runtime/helpers/toPrimitive.js"); | |
| 8279 | -function toPropertyKey(t) { | |
| 8280 | - var i = toPrimitive(t, "string"); | |
| 8281 | - return "symbol" == _typeof(i) ? i : i + ""; | |
| 8282 | -} | |
| 8283 | -module.exports = toPropertyKey, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 8284 | - | |
| 8285 | -/***/ }), | |
| 8286 | - | |
| 8287 | -/***/ "../node_modules/@babel/runtime/helpers/typeof.js": | |
| 8288 | -/*!********************************************************!*\ | |
| 8289 | - !*** ../node_modules/@babel/runtime/helpers/typeof.js ***! | |
| 8290 | - \********************************************************/ | |
| 8291 | -/***/ ((module) => { | |
| 8292 | - | |
| 8293 | -function _typeof(o) { | |
| 8294 | - "@babel/helpers - typeof"; | |
| 8295 | - | |
| 8296 | - return module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { | |
| 8297 | - return typeof o; | |
| 8298 | - } : function (o) { | |
| 8299 | - return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; | |
| 8300 | - }, module.exports.__esModule = true, module.exports["default"] = module.exports, _typeof(o); | |
| 8301 | -} | |
| 8302 | -module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 8303 | - | |
| 8304 | -/***/ }), | |
| 8305 | - | |
| 8306 | -/***/ "../node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js": | |
| 8307 | -/*!****************************************************************************!*\ | |
| 8308 | - !*** ../node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js ***! | |
| 8309 | - \****************************************************************************/ | |
| 8310 | -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 8311 | - | |
| 8312 | -var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray.js */ "../node_modules/@babel/runtime/helpers/arrayLikeToArray.js"); | |
| 8313 | -function _unsupportedIterableToArray(r, a) { | |
| 8314 | - if (r) { | |
| 8315 | - if ("string" == typeof r) return arrayLikeToArray(r, a); | |
| 8316 | - var t = {}.toString.call(r).slice(8, -1); | |
| 8317 | - 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; | |
| 8318 | - } | |
| 8319 | -} | |
| 8320 | -module.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 8321 | - | |
| 8322 | -/***/ }), | |
| 8323 | - | |
| 8324 | -/***/ "../node_modules/@babel/runtime/helpers/wrapNativeSuper.js": | |
| 8325 | -/*!*****************************************************************!*\ | |
| 8326 | - !*** ../node_modules/@babel/runtime/helpers/wrapNativeSuper.js ***! | |
| 8327 | - \*****************************************************************/ | |
| 8328 | -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 8329 | - | |
| 8330 | -var getPrototypeOf = __webpack_require__(/*! ./getPrototypeOf.js */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"); | |
| 8331 | -var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ "../node_modules/@babel/runtime/helpers/setPrototypeOf.js"); | |
| 8332 | -var isNativeFunction = __webpack_require__(/*! ./isNativeFunction.js */ "../node_modules/@babel/runtime/helpers/isNativeFunction.js"); | |
| 8333 | -var construct = __webpack_require__(/*! ./construct.js */ "../node_modules/@babel/runtime/helpers/construct.js"); | |
| 8334 | -function _wrapNativeSuper(t) { | |
| 8335 | - var r = "function" == typeof Map ? new Map() : void 0; | |
| 8336 | - return module.exports = _wrapNativeSuper = function _wrapNativeSuper(t) { | |
| 8337 | - if (null === t || !isNativeFunction(t)) return t; | |
| 8338 | - if ("function" != typeof t) throw new TypeError("Super expression must either be null or a function"); | |
| 8339 | - if (void 0 !== r) { | |
| 8340 | - if (r.has(t)) return r.get(t); | |
| 8341 | - r.set(t, Wrapper); | |
| 8342 | - } | |
| 8343 | - function Wrapper() { | |
| 8344 | - return construct(t, arguments, getPrototypeOf(this).constructor); | |
| 8345 | - } | |
| 8346 | - return Wrapper.prototype = Object.create(t.prototype, { | |
| 8347 | - constructor: { | |
| 8348 | - value: Wrapper, | |
| 8349 | - enumerable: !1, | |
| 8350 | - writable: !0, | |
| 8351 | - configurable: !0 | |
| 8352 | - } | |
| 8353 | - }), setPrototypeOf(Wrapper, t); | |
| 8354 | - }, module.exports.__esModule = true, module.exports["default"] = module.exports, _wrapNativeSuper(t); | |
| 8355 | -} | |
| 8356 | -module.exports = _wrapNativeSuper, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 8357 | - | |
| 8358 | -/***/ }), | |
| 8359 | - | |
| 8360 | -/***/ "../node_modules/@babel/runtime/regenerator/index.js": | |
| 8361 | -/*!***********************************************************!*\ | |
| 8362 | - !*** ../node_modules/@babel/runtime/regenerator/index.js ***! | |
| 8363 | - \***********************************************************/ | |
| 8364 | -/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 8365 | - | |
| 8366 | -// TODO(Babel 8): Remove this file. | |
| 8367 | - | |
| 8368 | -var runtime = __webpack_require__(/*! ../helpers/regeneratorRuntime */ "../node_modules/@babel/runtime/helpers/regeneratorRuntime.js")(); | |
| 8369 | -module.exports = runtime; | |
| 8370 | - | |
| 8371 | -// Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736= | |
| 8372 | -try { | |
| 8373 | - regeneratorRuntime = runtime; | |
| 8374 | -} catch (accidentalStrictMode) { | |
| 8375 | - if (typeof globalThis === "object") { | |
| 8376 | - globalThis.regeneratorRuntime = runtime; | |
| 8377 | - } else { | |
| 8378 | - Function("r", "regeneratorRuntime = r")(runtime); | |
| 8379 | - } | |
| 8380 | -} | |
| 8381 | - | |
| 8382 | - | |
| 8383 | -/***/ }), | |
| 8384 | - | |
| 8385 | -/***/ "@reduxjs/toolkit": | |
| 8386 | -/*!************************************************!*\ | |
| 8387 | - !*** external "elementorVendors.reduxToolkit" ***! | |
| 8388 | - \************************************************/ | |
| 8389 | -/***/ ((module) => { | |
| 8390 | - | |
| 8391 | -"use strict"; | |
| 8392 | -module.exports = elementorVendors.reduxToolkit; | |
| 8393 | - | |
| 8394 | -/***/ }) | |
| 8395 | - | |
| 8396 | -/******/ }); | |
| 8397 | -/************************************************************************/ | |
| 8398 | -/******/ // The module cache | |
| 8399 | -/******/ var __webpack_module_cache__ = {}; | |
| 8400 | -/******/ | |
| 8401 | -/******/ // The require function | |
| 8402 | -/******/ function __webpack_require__(moduleId) { | |
| 8403 | -/******/ // Check if module is in cache | |
| 8404 | -/******/ var cachedModule = __webpack_module_cache__[moduleId]; | |
| 8405 | -/******/ if (cachedModule !== undefined) { | |
| 8406 | -/******/ return cachedModule.exports; | |
| 8407 | -/******/ } | |
| 8408 | -/******/ // Create a new module (and put it into the cache) | |
| 8409 | -/******/ var module = __webpack_module_cache__[moduleId] = { | |
| 8410 | -/******/ // no module.id needed | |
| 8411 | -/******/ // no module.loaded needed | |
| 8412 | -/******/ exports: {} | |
| 8413 | -/******/ }; | |
| 8414 | -/******/ | |
| 8415 | -/******/ // Execute the module function | |
| 8416 | -/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); | |
| 8417 | -/******/ | |
| 8418 | -/******/ // Return the exports of the module | |
| 8419 | -/******/ return module.exports; | |
| 8420 | -/******/ } | |
| 8421 | -/******/ | |
| 8422 | -/************************************************************************/ | |
| 8423 | -var __webpack_exports__ = {}; | |
| 8424 | -// This entry needs to be wrapped in an IIFE because it needs to be in strict mode. | |
| 8425 | -(() => { | |
| 8426 | -"use strict"; | |
| 8427 | -/*!*********************************************!*\ | |
| 8428 | - !*** ../modules/web-cli/assets/js/index.js ***! | |
| 8429 | - \*********************************************/ | |
| 8430 | - | |
| 8431 | - | |
| 8432 | -var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 8433 | -var _api = _interopRequireDefault(__webpack_require__(/*! ./api */ "../modules/web-cli/assets/js/api.js")); | |
| 8434 | -window.$e = new _api.default(); | |
| 8435 | -})(); | |
| 8436 | - | |
| 8437 | -/******/ })() | |
| 8438 | -; | |
| 5910 | +//#endregion | |
| 5911 | +})(elementorVendors.reduxToolkit); | |
| 8439 | 5912 | //# sourceMappingURL=web-cli.js.map |