| @@ -1,8943 +1,8666 @@ | ||
| 1 | -(function(_wordpress_i18n, react, react_dom, _elementor_ui, _elementor_icons) { | |
| 1 | +/*! elementor - v3.17.0 - 01-11-2023 */ | |
| 2 | +/******/ (() => { // webpackBootstrap | |
| 3 | +/******/ var __webpack_modules__ = ({ | |
| 2 | 4 | |
| 3 | -//#region \0rolldown/runtime.js | |
| 4 | - var __create = Object.create; | |
| 5 | - var __defProp = Object.defineProperty; | |
| 6 | - var __name = (target, value) => __defProp(target, "name", { | |
| 7 | - value, | |
| 8 | - configurable: true | |
| 9 | - }); | |
| 10 | - var __getOwnPropDesc = Object.getOwnPropertyDescriptor; | |
| 11 | - var __getOwnPropNames = Object.getOwnPropertyNames; | |
| 12 | - var __getProtoOf = Object.getPrototypeOf; | |
| 13 | - var __hasOwnProp = Object.prototype.hasOwnProperty; | |
| 14 | - var __esmMin = (fn, res, err) => () => { | |
| 15 | - if (err) throw err[0]; | |
| 16 | - try { | |
| 17 | - return fn && (res = fn(fn = 0)), res; | |
| 18 | - } catch (e) { | |
| 19 | - throw err = [e], e; | |
| 20 | - } | |
| 21 | - }; | |
| 22 | - var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports); | |
| 23 | - var __exportAll = (all, no_symbols) => { | |
| 24 | - let target = {}; | |
| 25 | - for (var name in all) { | |
| 26 | - __defProp(target, name, { | |
| 27 | - get: all[name], | |
| 28 | - enumerable: true | |
| 29 | - }); | |
| 30 | - } | |
| 31 | - if (!no_symbols) { | |
| 32 | - __defProp(target, Symbol.toStringTag, { value: "Module" }); | |
| 33 | - } | |
| 34 | - return target; | |
| 35 | - }; | |
| 36 | - var __copyProps = (to, from, except, desc) => { | |
| 37 | - if (from && typeof from === "object" || typeof from === "function") { | |
| 38 | - for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) { | |
| 39 | - key = keys[i]; | |
| 40 | - if (!__hasOwnProp.call(to, key) && key !== except) { | |
| 41 | - __defProp(to, key, { | |
| 42 | - get: ((k) => from[k]).bind(null, key), | |
| 43 | - enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable | |
| 44 | - }); | |
| 45 | - } | |
| 46 | - } | |
| 47 | - } | |
| 48 | - return to; | |
| 49 | - }; | |
| 50 | - var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { | |
| 51 | - value: mod, | |
| 52 | - enumerable: true | |
| 53 | - }) : target, mod)); | |
| 54 | - var __toCommonJS = (mod) => __hasOwnProp.call(mod, "module.exports") ? mod["module.exports"] : __copyProps(__defProp({}, "__esModule", { value: true }), mod); | |
| 5 | +/***/ "../modules/ai/assets/js/editor/ai-layout-behavior.js": | |
| 6 | +/*!************************************************************!*\ | |
| 7 | + !*** ../modules/ai/assets/js/editor/ai-layout-behavior.js ***! | |
| 8 | + \************************************************************/ | |
| 9 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 55 | 10 | |
| 56 | -//#endregion | |
| 57 | -react = __toESM(react); | |
| 58 | -react_dom = __toESM(react_dom); | |
| 11 | +"use strict"; | |
| 12 | +/* provided dependency */ var ReactDOM = __webpack_require__(/*! react-dom */ "react-dom"); | |
| 13 | +/* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"]; | |
| 59 | 14 | |
| 60 | -//#region node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js | |
| 61 | - function asyncGeneratorStep$1(n, t, e, r, o, a, c) { | |
| 62 | - try { | |
| 63 | - var i = n[a](c); | |
| 64 | - var u = i.value; | |
| 65 | - } catch (n) { | |
| 66 | - e(n); | |
| 67 | - return; | |
| 68 | - } | |
| 69 | - i.done ? t(u) : Promise.resolve(u).then(r, o); | |
| 70 | - } | |
| 71 | - function _asyncToGenerator$1(n) { | |
| 72 | - return function() { | |
| 73 | - var t = this; | |
| 74 | - var e = arguments; | |
| 75 | - return new Promise(function(r, o) { | |
| 76 | - var a = n.apply(t, e); | |
| 77 | - function _next(n) { | |
| 78 | - asyncGeneratorStep$1(a, r, o, _next, _throw, "next", n); | |
| 79 | - } | |
| 80 | - function _throw(n) { | |
| 81 | - asyncGeneratorStep$1(a, r, o, _next, _throw, "throw", n); | |
| 82 | - } | |
| 83 | - _next(void 0); | |
| 84 | - }); | |
| 85 | - }; | |
| 86 | - } | |
| 87 | - var init_asyncToGenerator$1 = __esmMin((() => { | |
| 88 | - __name(asyncGeneratorStep$1, "asyncGeneratorStep"); | |
| 89 | - __name(_asyncToGenerator$1, "_asyncToGenerator"); | |
| 90 | - })); | |
| 91 | 15 | |
| 92 | -//#endregion | |
| 93 | -//#region node_modules/@babel/runtime/helpers/esm/classCallCheck.js | |
| 94 | - function _classCallCheck(a, n) { | |
| 95 | - if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); | |
| 96 | - } | |
| 97 | - var init_classCallCheck = __esmMin((() => {})); | |
| 16 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 17 | +Object.defineProperty(exports, "__esModule", ({ | |
| 18 | + value: true | |
| 19 | +})); | |
| 20 | +exports["default"] = void 0; | |
| 21 | +var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); | |
| 22 | +var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ "../node_modules/@babel/runtime/regenerator/index.js")); | |
| 23 | +var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "../node_modules/@babel/runtime/helpers/asyncToGenerator.js")); | |
| 24 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 25 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 26 | +var _assertThisInitialized2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ "../node_modules/@babel/runtime/helpers/assertThisInitialized.js")); | |
| 27 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 28 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 29 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 30 | +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js")); | |
| 31 | +var _layoutApp = _interopRequireDefault(__webpack_require__(/*! ./layout-app */ "../modules/ai/assets/js/editor/layout-app.js")); | |
| 32 | +var _helpers = __webpack_require__(/*! ./helpers */ "../modules/ai/assets/js/editor/helpers/index.js"); | |
| 33 | +var _screenshot = __webpack_require__(/*! ./utils/screenshot */ "../modules/ai/assets/js/editor/utils/screenshot.js"); | |
| 34 | +var _history = __webpack_require__(/*! ./utils/history */ "../modules/ai/assets/js/editor/utils/history.js"); | |
| 35 | +var _genereateIds = __webpack_require__(/*! ./utils/genereate-ids */ "../modules/ai/assets/js/editor/utils/genereate-ids.js"); | |
| 36 | +var _previewContainer = __webpack_require__(/*! ./utils/preview-container */ "../modules/ai/assets/js/editor/utils/preview-container.js"); | |
| 37 | +function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } | |
| 38 | +function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } | |
| 39 | +var AiLayoutBehavior = /*#__PURE__*/function (_Marionette$Behavior) { | |
| 40 | + (0, _inherits2.default)(AiLayoutBehavior, _Marionette$Behavior); | |
| 41 | + var _super = _createSuper(AiLayoutBehavior); | |
| 42 | + function AiLayoutBehavior() { | |
| 43 | + var _this; | |
| 44 | + (0, _classCallCheck2.default)(this, AiLayoutBehavior); | |
| 45 | + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { | |
| 46 | + args[_key] = arguments[_key]; | |
| 47 | + } | |
| 48 | + _this = _super.call.apply(_super, [this].concat(args)); | |
| 49 | + (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "previewContainer", null); | |
| 50 | + return _this; | |
| 51 | + } | |
| 52 | + (0, _createClass2.default)(AiLayoutBehavior, [{ | |
| 53 | + key: "ui", | |
| 54 | + value: function ui() { | |
| 55 | + return { | |
| 56 | + aiButton: '.e-ai-layout-button', | |
| 57 | + addTemplateButton: '.elementor-add-template-button' | |
| 58 | + }; | |
| 59 | + } | |
| 60 | + }, { | |
| 61 | + key: "events", | |
| 62 | + value: function events() { | |
| 63 | + return { | |
| 64 | + 'click @ui.aiButton': 'onAiButtonClick' | |
| 65 | + }; | |
| 66 | + } | |
| 67 | + }, { | |
| 68 | + key: "onAiButtonClick", | |
| 69 | + value: function onAiButtonClick(e) { | |
| 70 | + var _elementor, | |
| 71 | + _elementor$getPrefere, | |
| 72 | + _this2 = this; | |
| 73 | + e.stopPropagation(); | |
| 74 | + this.closePanel(); | |
| 75 | + this.previewContainer = (0, _previewContainer.createPreviewContainer)({ | |
| 76 | + // Create the container at the "drag widget here" area position. | |
| 77 | + at: this.view.getOption('at') | |
| 78 | + }); | |
| 79 | + this.previewContainer.init(); | |
| 80 | + var rootElement = document.createElement('div'); | |
| 81 | + var colorScheme = ((_elementor = elementor) === null || _elementor === void 0 ? void 0 : (_elementor$getPrefere = _elementor.getPreferences) === null || _elementor$getPrefere === void 0 ? void 0 : _elementor$getPrefere.call(_elementor, 'ui_theme')) || 'auto'; | |
| 82 | + var isRTL = elementorCommon.config.isRTL; | |
| 83 | + document.body.append(rootElement); | |
| 84 | + ReactDOM.render( /*#__PURE__*/_react.default.createElement(_layoutApp.default, { | |
| 85 | + isRTL: isRTL, | |
| 86 | + colorScheme: colorScheme, | |
| 87 | + onClose: function onClose() { | |
| 88 | + _this2.previewContainer.destroy(); | |
| 89 | + _this2.previewContainer = null; | |
| 90 | + ReactDOM.unmountComponentAtNode(rootElement); | |
| 91 | + rootElement.remove(); | |
| 92 | + _this2.openPanel(); | |
| 93 | + }, | |
| 94 | + onConnect: _helpers.onConnect, | |
| 95 | + onGenerate: this.onGenerate.bind(this), | |
| 96 | + onData: this.onData, | |
| 97 | + onSelect: this.onSelect.bind(this), | |
| 98 | + onInsert: this.onInsert.bind(this) | |
| 99 | + }), rootElement); | |
| 100 | + } | |
| 101 | + }, { | |
| 102 | + key: "closePanel", | |
| 103 | + value: function closePanel() { | |
| 104 | + $e.run('panel/close'); | |
| 105 | + $e.components.get('panel').blockUserInteractions(); | |
| 106 | + } | |
| 107 | + }, { | |
| 108 | + key: "openPanel", | |
| 109 | + value: function openPanel() { | |
| 110 | + $e.run('panel/open'); | |
| 111 | + $e.components.get('panel').unblockUserInteractions(); | |
| 112 | + } | |
| 113 | + }, { | |
| 114 | + key: "hideDropArea", | |
| 115 | + value: function hideDropArea() { | |
| 116 | + this.view.onCloseButtonClick(); | |
| 117 | + } | |
| 118 | + }, { | |
| 119 | + key: "onGenerate", | |
| 120 | + value: function onGenerate() { | |
| 121 | + var _this$previewContaine; | |
| 122 | + (_this$previewContaine = this.previewContainer) === null || _this$previewContaine === void 0 ? void 0 : _this$previewContaine.reset(); | |
| 123 | + } | |
| 124 | + }, { | |
| 125 | + key: "onData", | |
| 126 | + value: function () { | |
| 127 | + var _onData = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(template) { | |
| 128 | + var screenshot; | |
| 129 | + return _regenerator.default.wrap(function _callee$(_context) { | |
| 130 | + while (1) switch (_context.prev = _context.next) { | |
| 131 | + case 0: | |
| 132 | + _context.next = 2; | |
| 133 | + return (0, _screenshot.takeScreenshot)(template); | |
| 134 | + case 2: | |
| 135 | + screenshot = _context.sent; | |
| 136 | + return _context.abrupt("return", { | |
| 137 | + screenshot: screenshot, | |
| 138 | + template: template | |
| 139 | + }); | |
| 140 | + case 4: | |
| 141 | + case "end": | |
| 142 | + return _context.stop(); | |
| 143 | + } | |
| 144 | + }, _callee); | |
| 145 | + })); | |
| 146 | + function onData(_x) { | |
| 147 | + return _onData.apply(this, arguments); | |
| 148 | + } | |
| 149 | + return onData; | |
| 150 | + }() | |
| 151 | + }, { | |
| 152 | + key: "onSelect", | |
| 153 | + value: function onSelect(template) { | |
| 154 | + this.previewContainer.setContent(template); | |
| 155 | + } | |
| 156 | + }, { | |
| 157 | + key: "onInsert", | |
| 158 | + value: function onInsert(template) { | |
| 159 | + this.hideDropArea(); | |
| 160 | + var endHistoryLog = (0, _history.startHistoryLog)({ | |
| 161 | + type: 'import', | |
| 162 | + title: __('AI Layout', 'elementor') | |
| 163 | + }); | |
| 164 | + $e.run('document/elements/create', { | |
| 165 | + container: elementor.getPreviewContainer(), | |
| 166 | + model: (0, _genereateIds.generateIds)(template), | |
| 167 | + options: { | |
| 168 | + at: this.view.getOption('at'), | |
| 169 | + edit: true | |
| 170 | + } | |
| 171 | + }); | |
| 172 | + endHistoryLog(); | |
| 173 | + } | |
| 174 | + }, { | |
| 175 | + key: "onRender", | |
| 176 | + value: function onRender() { | |
| 177 | + var $button = jQuery('<div>', { | |
| 178 | + class: 'e-ai-layout-button elementor-add-section-area-button e-button-primary', | |
| 179 | + title: __('Build with AI', 'elementor'), | |
| 180 | + role: 'button' | |
| 181 | + }); | |
| 182 | + $button.html("\n\t\t\t<div class=\"e-ai-layout-button--sparkle\"></div>\n\t\t\t<div class=\"e-ai-layout-button--sparkle\"></div>\n\t\t\t<div class=\"e-ai-layout-button--sparkle\"></div>\n\t\t\t<div class=\"e-ai-layout-button--sparkle\"></div>\n\t\t\t<div class=\"e-ai-layout-button--sparkle\"></div>\n\t\t\t<div class=\"e-ai-layout-button--sparkle\"></div>\n\t\t\t<div class=\"e-ai-layout-button--sparkle\"></div>\n\t\t\t<i class=\"eicon-ai\"></i>\n\t\t"); | |
| 183 | + this.ui.addTemplateButton.after($button); | |
| 184 | + } | |
| 185 | + }]); | |
| 186 | + return AiLayoutBehavior; | |
| 187 | +}(Marionette.Behavior); | |
| 188 | +exports["default"] = AiLayoutBehavior; | |
| 98 | 189 | |
| 99 | -//#endregion | |
| 100 | -//#region node_modules/@babel/runtime/helpers/esm/typeof.js | |
| 101 | - function _typeof$1(o) { | |
| 102 | - "@babel/helpers - typeof"; | |
| 103 | - return _typeof$1 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) { | |
| 104 | - return typeof o; | |
| 105 | - } : function(o) { | |
| 106 | - return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; | |
| 107 | - }, _typeof$1(o); | |
| 108 | - } | |
| 109 | - var init_typeof$1 = __esmMin((() => { | |
| 110 | - __name(_typeof$1, "_typeof"); | |
| 111 | - })); | |
| 190 | +/***/ }), | |
| 112 | 191 | |
| 113 | -//#endregion | |
| 114 | -//#region node_modules/@babel/runtime/helpers/esm/toPrimitive.js | |
| 115 | - function toPrimitive$1(t, r) { | |
| 116 | - if ("object" != _typeof$1(t) || !t) return t; | |
| 117 | - var e = t[Symbol.toPrimitive]; | |
| 118 | - if (void 0 !== e) { | |
| 119 | - var i = e.call(t, r || "default"); | |
| 120 | - if ("object" != _typeof$1(i)) return i; | |
| 121 | - throw new TypeError("@@toPrimitive must return a primitive value."); | |
| 122 | - } | |
| 123 | - return ("string" === r ? String : Number)(t); | |
| 124 | - } | |
| 125 | - var init_toPrimitive$1 = __esmMin((() => { | |
| 126 | - init_typeof$1(); | |
| 127 | - __name(toPrimitive$1, "toPrimitive"); | |
| 128 | - })); | |
| 192 | +/***/ "../modules/ai/assets/js/editor/api/index.js": | |
| 193 | +/*!***************************************************!*\ | |
| 194 | + !*** ../modules/ai/assets/js/editor/api/index.js ***! | |
| 195 | + \***************************************************/ | |
| 196 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 129 | 197 | |
| 130 | -//#endregion | |
| 131 | -//#region node_modules/@babel/runtime/helpers/esm/toPropertyKey.js | |
| 132 | - function toPropertyKey$1(t) { | |
| 133 | - var i = toPrimitive$1(t, "string"); | |
| 134 | - return "symbol" == _typeof$1(i) ? i : i + ""; | |
| 135 | - } | |
| 136 | - var init_toPropertyKey$1 = __esmMin((() => { | |
| 137 | - init_typeof$1(); | |
| 138 | - init_toPrimitive$1(); | |
| 139 | - __name(toPropertyKey$1, "toPropertyKey"); | |
| 140 | - })); | |
| 198 | +"use strict"; | |
| 141 | 199 | |
| 142 | -//#endregion | |
| 143 | -//#region node_modules/@babel/runtime/helpers/esm/createClass.js | |
| 144 | - function _defineProperties(e, r) { | |
| 145 | - for (var t = 0; t < r.length; t++) { | |
| 146 | - var o = r[t]; | |
| 147 | - o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, toPropertyKey$1(o.key), o); | |
| 148 | - } | |
| 149 | - } | |
| 150 | - function _createClass(e, r, t) { | |
| 151 | - return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; | |
| 152 | - } | |
| 153 | - var init_createClass = __esmMin((() => { | |
| 154 | - init_toPropertyKey$1(); | |
| 155 | - })); | |
| 156 | 200 | |
| 157 | -//#endregion | |
| 158 | -//#region node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js | |
| 159 | -init_asyncToGenerator$1(); | |
| 160 | -init_classCallCheck(); | |
| 161 | -init_createClass(); | |
| 162 | - function _assertThisInitialized(e) { | |
| 163 | - if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); | |
| 164 | - return e; | |
| 165 | - } | |
| 201 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 202 | +Object.defineProperty(exports, "__esModule", ({ | |
| 203 | + value: true | |
| 204 | +})); | |
| 205 | +exports.uploadImage = exports.toggleFavoriteHistoryItem = exports.setStatusFeedback = exports.setGetStarted = exports.getUserInformation = exports.getTextToImageGeneration = exports.getLayoutPromptEnhanced = exports.getImageToImageUpscale = exports.getImageToImageReplaceBackground = exports.getImageToImageRemoveText = exports.getImageToImageRemoveBackground = exports.getImageToImageOutPainting = exports.getImageToImageMaskGeneration = exports.getImageToImageGeneration = exports.getImagePromptEnhanced = exports.getHistory = exports.getEditText = exports.getCustomCode = exports.getCustomCSS = exports.getCompletionText = exports.generateLayout = exports.deleteHistoryItem = void 0; | |
| 206 | +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js")); | |
| 207 | +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | |
| 208 | +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | |
| 209 | +var request = function request(endpoint) { | |
| 210 | + var data = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | |
| 211 | + var immediately = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false; | |
| 212 | + var signal = arguments.length > 3 ? arguments[3] : undefined; | |
| 213 | + if (Object.keys(data).length) { | |
| 214 | + data.context = window.elementorAiCurrentContext; | |
| 215 | + } | |
| 216 | + return new Promise(function (resolve, reject) { | |
| 217 | + var ajaxData = elementorCommon.ajax.addRequest(endpoint, { | |
| 218 | + success: resolve, | |
| 219 | + error: reject, | |
| 220 | + data: data | |
| 221 | + }, immediately); | |
| 222 | + if (signal && ajaxData.jqXhr) { | |
| 223 | + signal.addEventListener('abort', ajaxData.jqXhr.abort); | |
| 224 | + } | |
| 225 | + }); | |
| 226 | +}; | |
| 227 | +var getUserInformation = function getUserInformation() { | |
| 228 | + return request('ai_get_user_information'); | |
| 229 | +}; | |
| 230 | +exports.getUserInformation = getUserInformation; | |
| 231 | +var getCompletionText = function getCompletionText(prompt) { | |
| 232 | + return request('ai_get_completion_text', { | |
| 233 | + prompt: prompt | |
| 234 | + }); | |
| 235 | +}; | |
| 236 | +exports.getCompletionText = getCompletionText; | |
| 237 | +var getEditText = function getEditText(input, instruction) { | |
| 238 | + return request('ai_get_edit_text', { | |
| 239 | + input: input, | |
| 240 | + instruction: instruction | |
| 241 | + }); | |
| 242 | +}; | |
| 243 | +exports.getEditText = getEditText; | |
| 244 | +var getCustomCode = function getCustomCode(prompt, language) { | |
| 245 | + return request('ai_get_custom_code', { | |
| 246 | + prompt: prompt, | |
| 247 | + language: language | |
| 248 | + }); | |
| 249 | +}; | |
| 250 | +exports.getCustomCode = getCustomCode; | |
| 251 | +var getCustomCSS = function getCustomCSS(prompt, htmlMarkup, elementId) { | |
| 252 | + return request('ai_get_custom_css', { | |
| 253 | + prompt: prompt, | |
| 254 | + html_markup: htmlMarkup, | |
| 255 | + element_id: elementId | |
| 256 | + }); | |
| 257 | +}; | |
| 258 | +exports.getCustomCSS = getCustomCSS; | |
| 259 | +var setGetStarted = function setGetStarted() { | |
| 260 | + return request('ai_set_get_started'); | |
| 261 | +}; | |
| 262 | +exports.setGetStarted = setGetStarted; | |
| 263 | +var setStatusFeedback = function setStatusFeedback(responseId) { | |
| 264 | + return request('ai_set_status_feedback', { | |
| 265 | + response_id: responseId | |
| 266 | + }); | |
| 267 | +}; | |
| 268 | +exports.setStatusFeedback = setStatusFeedback; | |
| 269 | +var getTextToImageGeneration = function getTextToImageGeneration(prompt, promptSettings) { | |
| 270 | + return request('ai_get_text_to_image', { | |
| 271 | + prompt: prompt, | |
| 272 | + promptSettings: promptSettings | |
| 273 | + }); | |
| 274 | +}; | |
| 275 | +exports.getTextToImageGeneration = getTextToImageGeneration; | |
| 276 | +var getImageToImageGeneration = function getImageToImageGeneration(prompt, promptSettings, image) { | |
| 277 | + return request('ai_get_image_to_image', { | |
| 278 | + prompt: prompt, | |
| 279 | + promptSettings: promptSettings, | |
| 280 | + image: image | |
| 281 | + }); | |
| 282 | +}; | |
| 283 | +exports.getImageToImageGeneration = getImageToImageGeneration; | |
| 284 | +var getImageToImageMaskGeneration = function getImageToImageMaskGeneration(prompt, promptSettings, image, mask) { | |
| 285 | + return request('ai_get_image_to_image_mask', { | |
| 286 | + prompt: prompt, | |
| 287 | + promptSettings: promptSettings, | |
| 288 | + image: image, | |
| 289 | + mask: mask | |
| 290 | + }); | |
| 291 | +}; | |
| 292 | +exports.getImageToImageMaskGeneration = getImageToImageMaskGeneration; | |
| 293 | +var getImageToImageOutPainting = function getImageToImageOutPainting(prompt, promptSettings, image, mask) { | |
| 294 | + return request('ai_get_image_to_image_outpainting', { | |
| 295 | + prompt: prompt, | |
| 296 | + promptSettings: promptSettings, | |
| 297 | + mask: mask | |
| 298 | + }); | |
| 299 | +}; | |
| 300 | +exports.getImageToImageOutPainting = getImageToImageOutPainting; | |
| 301 | +var getImageToImageUpscale = function getImageToImageUpscale(prompt, promptSettings, image) { | |
| 302 | + return request('ai_get_image_to_image_upscale', { | |
| 303 | + prompt: prompt, | |
| 304 | + promptSettings: promptSettings, | |
| 305 | + image: image | |
| 306 | + }); | |
| 307 | +}; | |
| 308 | +exports.getImageToImageUpscale = getImageToImageUpscale; | |
| 309 | +var getImageToImageRemoveBackground = function getImageToImageRemoveBackground(image) { | |
| 310 | + return request('ai_get_image_to_image_remove_background', { | |
| 311 | + image: image | |
| 312 | + }); | |
| 313 | +}; | |
| 314 | +exports.getImageToImageRemoveBackground = getImageToImageRemoveBackground; | |
| 315 | +var getImageToImageReplaceBackground = function getImageToImageReplaceBackground(prompt, image) { | |
| 316 | + return request('ai_get_image_to_image_replace_background', { | |
| 317 | + prompt: prompt, | |
| 318 | + image: image | |
| 319 | + }); | |
| 320 | +}; | |
| 321 | +exports.getImageToImageReplaceBackground = getImageToImageReplaceBackground; | |
| 322 | +var getImageToImageRemoveText = function getImageToImageRemoveText(image) { | |
| 323 | + return request('ai_get_image_to_image_remove_text', { | |
| 324 | + image: image | |
| 325 | + }); | |
| 326 | +}; | |
| 327 | +exports.getImageToImageRemoveText = getImageToImageRemoveText; | |
| 328 | +var getImagePromptEnhanced = function getImagePromptEnhanced(prompt) { | |
| 329 | + return request('ai_get_image_prompt_enhancer', { | |
| 330 | + prompt: prompt | |
| 331 | + }); | |
| 332 | +}; | |
| 333 | +exports.getImagePromptEnhanced = getImagePromptEnhanced; | |
| 334 | +var uploadImage = function uploadImage(image) { | |
| 335 | + return request('ai_upload_image', _objectSpread({}, image)); | |
| 336 | +}; | |
| 337 | +exports.uploadImage = uploadImage; | |
| 338 | +var generateLayout = function generateLayout(prompt, variationType, signal) { | |
| 339 | + return request('ai_generate_layout', { | |
| 340 | + prompt: prompt, | |
| 341 | + variationType: variationType | |
| 342 | + }, true, signal); | |
| 343 | +}; | |
| 344 | +exports.generateLayout = generateLayout; | |
| 345 | +var getLayoutPromptEnhanced = function getLayoutPromptEnhanced(prompt) { | |
| 346 | + return request('ai_get_layout_prompt_enhancer', { | |
| 347 | + prompt: prompt | |
| 348 | + }); | |
| 349 | +}; | |
| 350 | +exports.getLayoutPromptEnhanced = getLayoutPromptEnhanced; | |
| 351 | +var getHistory = function getHistory(type, page, limit) { | |
| 352 | + return request('ai_get_history', { | |
| 353 | + type: type, | |
| 354 | + page: page, | |
| 355 | + limit: limit | |
| 356 | + }); | |
| 357 | +}; | |
| 358 | +exports.getHistory = getHistory; | |
| 359 | +var deleteHistoryItem = function deleteHistoryItem(id) { | |
| 360 | + return request('ai_delete_history_item', { | |
| 361 | + id: id | |
| 362 | + }); | |
| 363 | +}; | |
| 364 | +exports.deleteHistoryItem = deleteHistoryItem; | |
| 365 | +var toggleFavoriteHistoryItem = function toggleFavoriteHistoryItem(id) { | |
| 366 | + return request('ai_toggle_favorite_history_item', { | |
| 367 | + id: id | |
| 368 | + }); | |
| 369 | +}; | |
| 370 | +exports.toggleFavoriteHistoryItem = toggleFavoriteHistoryItem; | |
| 166 | 371 | |
| 167 | -//#endregion | |
| 168 | -//#region node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js | |
| 169 | - init_typeof$1(); | |
| 170 | - function _possibleConstructorReturn(t, e) { | |
| 171 | - if (e && ("object" == _typeof$1(e) || "function" == typeof e)) return e; | |
| 172 | - if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); | |
| 173 | - return _assertThisInitialized(t); | |
| 174 | - } | |
| 372 | +/***/ }), | |
| 175 | 373 | |
| 176 | -//#endregion | |
| 177 | -//#region node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js | |
| 178 | - function _getPrototypeOf(t) { | |
| 179 | - return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function(t) { | |
| 180 | - return t.__proto__ || Object.getPrototypeOf(t); | |
| 181 | - }, _getPrototypeOf(t); | |
| 182 | - } | |
| 374 | +/***/ "../modules/ai/assets/js/editor/components/dialog-header.js": | |
| 375 | +/*!******************************************************************!*\ | |
| 376 | + !*** ../modules/ai/assets/js/editor/components/dialog-header.js ***! | |
| 377 | + \******************************************************************/ | |
| 378 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 183 | 379 | |
| 184 | -//#endregion | |
| 185 | -//#region node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js | |
| 186 | - function _setPrototypeOf(t, e) { | |
| 187 | - return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function(t, e) { | |
| 188 | - return t.__proto__ = e, t; | |
| 189 | - }, _setPrototypeOf(t, e); | |
| 190 | - } | |
| 380 | +"use strict"; | |
| 381 | +/* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"]; | |
| 382 | +/* provided dependency */ var PropTypes = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js"); | |
| 191 | 383 | |
| 192 | -//#endregion | |
| 193 | -//#region node_modules/@babel/runtime/helpers/esm/inherits.js | |
| 194 | - function _inherits(t, e) { | |
| 195 | - if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); | |
| 196 | - t.prototype = Object.create(e && e.prototype, { constructor: { | |
| 197 | - value: t, | |
| 198 | - writable: !0, | |
| 199 | - configurable: !0 | |
| 200 | - } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && _setPrototypeOf(t, e); | |
| 201 | - } | |
| 202 | 384 | |
| 203 | -//#endregion | |
| 204 | -//#region node_modules/@babel/runtime/helpers/esm/defineProperty.js | |
| 205 | - function _defineProperty$1(e, r, t) { | |
| 206 | - return (r = toPropertyKey$1(r)) in e ? Object.defineProperty(e, r, { | |
| 207 | - value: t, | |
| 208 | - enumerable: !0, | |
| 209 | - configurable: !0, | |
| 210 | - writable: !0 | |
| 211 | - }) : e[r] = t, e; | |
| 212 | - } | |
| 213 | - var init_defineProperty$1 = __esmMin((() => { | |
| 214 | - init_toPropertyKey$1(); | |
| 215 | - __name(_defineProperty$1, "_defineProperty"); | |
| 216 | - })); | |
| 385 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 386 | +Object.defineProperty(exports, "__esModule", ({ | |
| 387 | + value: true | |
| 388 | +})); | |
| 389 | +exports["default"] = void 0; | |
| 390 | +var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); | |
| 391 | +var _extends2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/extends */ "../node_modules/@babel/runtime/helpers/extends.js")); | |
| 392 | +var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); | |
| 393 | +var _icons = __webpack_require__(/*! @elementor/icons */ "@elementor/icons"); | |
| 394 | +var ElementorLogo = function ElementorLogo(props) { | |
| 395 | + return /*#__PURE__*/_react.default.createElement(_ui.SvgIcon, (0, _extends2.default)({ | |
| 396 | + viewBox: "0 0 32 32" | |
| 397 | + }, props), /*#__PURE__*/_react.default.createElement("path", { | |
| 398 | + fillRule: "evenodd", | |
| 399 | + clipRule: "evenodd", | |
| 400 | + d: "M2.69648 24.8891C0.938383 22.2579 0 19.1645 0 16C0 11.7566 1.68571 7.68687 4.68629 4.68629C7.68687 1.68571 11.7566 0 16 0C19.1645 0 22.2579 0.938383 24.8891 2.69648C27.5203 4.45459 29.5711 6.95344 30.7821 9.87706C31.9931 12.8007 32.3099 16.0177 31.6926 19.1214C31.0752 22.2251 29.5514 25.0761 27.3137 27.3137C25.0761 29.5514 22.2251 31.0752 19.1214 31.6926C16.0177 32.3099 12.8007 31.9931 9.87706 30.7821C6.95344 29.5711 4.45459 27.5203 2.69648 24.8891ZM12.0006 9.33281H9.33437V22.6665H12.0006V9.33281ZM22.6657 9.33281H14.6669V11.9991H22.6657V9.33281ZM22.6657 14.6654H14.6669V17.3316H22.6657V14.6654ZM22.6657 20.0003H14.6669V22.6665H22.6657V20.0003Z" | |
| 401 | + })); | |
| 402 | +}; | |
| 403 | +var StyledElementorLogo = (0, _ui.styled)(ElementorLogo)(function (_ref) { | |
| 404 | + var theme = _ref.theme; | |
| 405 | + return { | |
| 406 | + width: theme.spacing(3), | |
| 407 | + height: theme.spacing(3), | |
| 408 | + '& path': { | |
| 409 | + fill: theme.palette.text.primary | |
| 410 | + } | |
| 411 | + }; | |
| 412 | +}); | |
| 413 | +var DialogHeader = function DialogHeader(props) { | |
| 414 | + return /*#__PURE__*/_react.default.createElement(_ui.AppBar, { | |
| 415 | + sx: { | |
| 416 | + fontWeight: 'normal' | |
| 417 | + }, | |
| 418 | + color: "transparent", | |
| 419 | + position: "relative" | |
| 420 | + }, /*#__PURE__*/_react.default.createElement(_ui.Toolbar, { | |
| 421 | + variant: "dense" | |
| 422 | + }, /*#__PURE__*/_react.default.createElement(StyledElementorLogo, { | |
| 423 | + sx: { | |
| 424 | + mr: 1 | |
| 425 | + } | |
| 426 | + }), /*#__PURE__*/_react.default.createElement(_ui.Typography, { | |
| 427 | + component: "span", | |
| 428 | + variant: "subtitle2", | |
| 429 | + sx: { | |
| 430 | + fontWeight: 'bold', | |
| 431 | + textTransform: 'uppercase' | |
| 432 | + } | |
| 433 | + }, __('AI', 'elementor')), /*#__PURE__*/_react.default.createElement(_ui.Chip, { | |
| 434 | + label: __('Beta', 'elementor'), | |
| 435 | + color: "default", | |
| 436 | + size: "small", | |
| 437 | + sx: { | |
| 438 | + ml: 1 | |
| 439 | + } | |
| 440 | + }), /*#__PURE__*/_react.default.createElement(_ui.Stack, { | |
| 441 | + direction: "row", | |
| 442 | + spacing: 1, | |
| 443 | + alignItems: "center", | |
| 444 | + sx: { | |
| 445 | + ml: 'auto' | |
| 446 | + } | |
| 447 | + }, props.children, /*#__PURE__*/_react.default.createElement(_ui.IconButton, { | |
| 448 | + size: "small", | |
| 449 | + "aria-label": "close", | |
| 450 | + onClick: props.onClose, | |
| 451 | + sx: { | |
| 452 | + '&.MuiButtonBase-root': { | |
| 453 | + mr: -1 | |
| 454 | + } | |
| 455 | + } | |
| 456 | + }, /*#__PURE__*/_react.default.createElement(_icons.XIcon, null))))); | |
| 457 | +}; | |
| 458 | +DialogHeader.propTypes = { | |
| 459 | + onClose: PropTypes.func.isRequired, | |
| 460 | + children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]) | |
| 461 | +}; | |
| 462 | +var _default = DialogHeader; | |
| 463 | +exports["default"] = _default; | |
| 217 | 464 | |
| 218 | -//#endregion | |
| 219 | -//#region node_modules/@babel/runtime/helpers/OverloadYield.js | |
| 220 | - var require_OverloadYield = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 221 | - function _OverloadYield(e, d) { | |
| 222 | - this.v = e, this.k = d; | |
| 223 | - } | |
| 224 | - module.exports = _OverloadYield, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 225 | - })); | |
| 465 | +/***/ }), | |
| 226 | 466 | |
| 227 | -//#endregion | |
| 228 | -//#region node_modules/@babel/runtime/helpers/regeneratorDefine.js | |
| 229 | - var require_regeneratorDefine = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 230 | - function _regeneratorDefine(e, r, n, t) { | |
| 231 | - var i = Object.defineProperty; | |
| 232 | - try { | |
| 233 | - i({}, "", {}); | |
| 234 | - } catch (e) { | |
| 235 | - i = 0; | |
| 236 | - } | |
| 237 | - module.exports = _regeneratorDefine = function regeneratorDefine(e, r, n, t) { | |
| 238 | - function o(r, n) { | |
| 239 | - _regeneratorDefine(e, r, function(e) { | |
| 240 | - return this._invoke(r, n, e); | |
| 241 | - }); | |
| 242 | - } | |
| 243 | - r ? i ? i(e, r, { | |
| 244 | - value: n, | |
| 245 | - enumerable: !t, | |
| 246 | - configurable: !t, | |
| 247 | - writable: !t | |
| 248 | - }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2)); | |
| 249 | - }, module.exports.__esModule = true, module.exports["default"] = module.exports, _regeneratorDefine(e, r, n, t); | |
| 250 | - } | |
| 251 | - module.exports = _regeneratorDefine, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 252 | - })); | |
| 467 | +/***/ "../modules/ai/assets/js/editor/components/loader.js": | |
| 468 | +/*!***********************************************************!*\ | |
| 469 | + !*** ../modules/ai/assets/js/editor/components/loader.js ***! | |
| 470 | + \***********************************************************/ | |
| 471 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 253 | 472 | |
| 254 | -//#endregion | |
| 255 | -//#region node_modules/@babel/runtime/helpers/regenerator.js | |
| 256 | - var require_regenerator$1 = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 257 | - var regeneratorDefine = require_regeneratorDefine(); | |
| 258 | - function _regenerator() { | |
| 259 | - /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */ | |
| 260 | - var e; | |
| 261 | - var t; | |
| 262 | - var r = "function" == typeof Symbol ? Symbol : {}; | |
| 263 | - var n = r.iterator || "@@iterator"; | |
| 264 | - var o = r.toStringTag || "@@toStringTag"; | |
| 265 | - function i(r, n, o, i) { | |
| 266 | - var c = n && n.prototype instanceof Generator ? n : Generator; | |
| 267 | - var u = Object.create(c.prototype); | |
| 268 | - return regeneratorDefine(u, "_invoke", function(r, n, o) { | |
| 269 | - var i; | |
| 270 | - var c; | |
| 271 | - var u; | |
| 272 | - var f = 0; | |
| 273 | - var p = o || []; | |
| 274 | - var y = !1; | |
| 275 | - var G = { | |
| 276 | - p: 0, | |
| 277 | - n: 0, | |
| 278 | - v: e, | |
| 279 | - a: d, | |
| 280 | - f: d.bind(e, 4), | |
| 281 | - d: function d(t, r) { | |
| 282 | - return i = t, c = 0, u = e, G.n = r, a; | |
| 283 | - } | |
| 284 | - }; | |
| 285 | - function d(r, n) { | |
| 286 | - for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) { | |
| 287 | - var o; | |
| 288 | - var i = p[t]; | |
| 289 | - var d = G.p; | |
| 290 | - var l = i[2]; | |
| 291 | - 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)); | |
| 292 | - } | |
| 293 | - if (o || r > 1) return a; | |
| 294 | - throw y = !0, n; | |
| 295 | - } | |
| 296 | - return function(o, p, l) { | |
| 297 | - if (f > 1) throw TypeError("Generator is already running"); | |
| 298 | - for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) { | |
| 299 | - i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u); | |
| 300 | - try { | |
| 301 | - if (f = 2, i) { | |
| 302 | - if (c || (o = "next"), t = i[o]) { | |
| 303 | - if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object"); | |
| 304 | - if (!t.done) return t; | |
| 305 | - u = t.value, c < 2 && (c = 0); | |
| 306 | - } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1); | |
| 307 | - i = e; | |
| 308 | - } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break; | |
| 309 | - } catch (t) { | |
| 310 | - i = e, c = 1, u = t; | |
| 311 | - } finally { | |
| 312 | - f = 1; | |
| 313 | - } | |
| 314 | - } | |
| 315 | - return { | |
| 316 | - value: t, | |
| 317 | - done: y | |
| 318 | - }; | |
| 319 | - }; | |
| 320 | - }(r, o, i), !0), u; | |
| 321 | - } | |
| 322 | - var a = {}; | |
| 323 | - function Generator() {} | |
| 324 | - function GeneratorFunction() {} | |
| 325 | - function GeneratorFunctionPrototype() {} | |
| 326 | - t = Object.getPrototypeOf; | |
| 327 | - var c = [][n] ? t(t([][n]())) : (regeneratorDefine(t = {}, n, function() { | |
| 328 | - return this; | |
| 329 | - }), t); | |
| 330 | - var u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c); | |
| 331 | - function f(e) { | |
| 332 | - return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, regeneratorDefine(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e; | |
| 333 | - } | |
| 334 | - 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() { | |
| 335 | - return this; | |
| 336 | - }), regeneratorDefine(u, "toString", function() { | |
| 337 | - return "[object Generator]"; | |
| 338 | - }), (module.exports = _regenerator = function _regenerator() { | |
| 339 | - return { | |
| 340 | - w: i, | |
| 341 | - m: f | |
| 342 | - }; | |
| 343 | - }, module.exports.__esModule = true, module.exports["default"] = module.exports)(); | |
| 344 | - } | |
| 345 | - module.exports = _regenerator, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 346 | - })); | |
| 473 | +"use strict"; | |
| 474 | +/* provided dependency */ var PropTypes = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js"); | |
| 347 | 475 | |
| 348 | -//#endregion | |
| 349 | -//#region node_modules/@babel/runtime/helpers/regeneratorAsyncIterator.js | |
| 350 | - var require_regeneratorAsyncIterator = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 351 | - var OverloadYield = require_OverloadYield(); | |
| 352 | - var regeneratorDefine = require_regeneratorDefine(); | |
| 353 | - function AsyncIterator(t, e) { | |
| 354 | - function n(r, o, i, f) { | |
| 355 | - try { | |
| 356 | - var c = t[r](o); | |
| 357 | - var u = c.value; | |
| 358 | - return u instanceof OverloadYield ? e.resolve(u.v).then(function(t) { | |
| 359 | - n("next", t, i, f); | |
| 360 | - }, function(t) { | |
| 361 | - n("throw", t, i, f); | |
| 362 | - }) : e.resolve(u).then(function(t) { | |
| 363 | - c.value = t, i(c); | |
| 364 | - }, function(t) { | |
| 365 | - return n("throw", t, i, f); | |
| 366 | - }); | |
| 367 | - } catch (t) { | |
| 368 | - f(t); | |
| 369 | - } | |
| 370 | - } | |
| 371 | - var r; | |
| 372 | - this.next || (regeneratorDefine(AsyncIterator.prototype), regeneratorDefine(AsyncIterator.prototype, "function" == typeof Symbol && Symbol.asyncIterator || "@asyncIterator", function() { | |
| 373 | - return this; | |
| 374 | - })), regeneratorDefine(this, "_invoke", function(t, o, i) { | |
| 375 | - function f() { | |
| 376 | - return new e(function(e, r) { | |
| 377 | - n(t, i, e, r); | |
| 378 | - }); | |
| 379 | - } | |
| 380 | - return r = r ? r.then(f, f) : f(); | |
| 381 | - }, !0); | |
| 382 | - } | |
| 383 | - module.exports = AsyncIterator, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 384 | - })); | |
| 385 | 476 | |
| 386 | -//#endregion | |
| 387 | -//#region node_modules/@babel/runtime/helpers/regeneratorAsyncGen.js | |
| 388 | - var require_regeneratorAsyncGen = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 389 | - var regenerator = require_regenerator$1(); | |
| 390 | - var regeneratorAsyncIterator = require_regeneratorAsyncIterator(); | |
| 391 | - function _regeneratorAsyncGen(r, e, t, o, n) { | |
| 392 | - return new regeneratorAsyncIterator(regenerator().w(r, e, t, o), n || Promise); | |
| 393 | - } | |
| 394 | - module.exports = _regeneratorAsyncGen, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 395 | - })); | |
| 477 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 478 | +Object.defineProperty(exports, "__esModule", ({ | |
| 479 | + value: true | |
| 480 | +})); | |
| 481 | +exports["default"] = void 0; | |
| 482 | +var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); | |
| 483 | +var _extends2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/extends */ "../node_modules/@babel/runtime/helpers/extends.js")); | |
| 484 | +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js")); | |
| 485 | +var _objectWithoutProperties2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/objectWithoutProperties */ "../node_modules/@babel/runtime/helpers/objectWithoutProperties.js")); | |
| 486 | +var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); | |
| 487 | +var _excluded = ["sx", "BoxProps"]; | |
| 488 | +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | |
| 489 | +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | |
| 490 | +var Loader = function Loader(_ref) { | |
| 491 | + var _ref$sx = _ref.sx, | |
| 492 | + sx = _ref$sx === void 0 ? {} : _ref$sx, | |
| 493 | + _ref$BoxProps = _ref.BoxProps, | |
| 494 | + BoxProps = _ref$BoxProps === void 0 ? {} : _ref$BoxProps, | |
| 495 | + props = (0, _objectWithoutProperties2.default)(_ref, _excluded); | |
| 496 | + return /*#__PURE__*/_react.default.createElement(_ui.Box, (0, _extends2.default)({ | |
| 497 | + width: "100%", | |
| 498 | + display: "flex", | |
| 499 | + alignItems: "center" | |
| 500 | + }, BoxProps, { | |
| 501 | + sx: _objectSpread({ | |
| 502 | + px: 1.5, | |
| 503 | + minHeight: function minHeight(theme) { | |
| 504 | + return theme.spacing(5); | |
| 505 | + } | |
| 506 | + }, BoxProps.sx || {}) | |
| 507 | + }), /*#__PURE__*/_react.default.createElement(_ui.LinearProgress, (0, _extends2.default)({ | |
| 508 | + color: "secondary" | |
| 509 | + }, props, { | |
| 510 | + sx: _objectSpread({ | |
| 511 | + width: '100%' | |
| 512 | + }, sx) | |
| 513 | + }))); | |
| 514 | +}; | |
| 515 | +Loader.propTypes = { | |
| 516 | + sx: PropTypes.object, | |
| 517 | + BoxProps: PropTypes.object | |
| 518 | +}; | |
| 519 | +var _default = Loader; | |
| 520 | +exports["default"] = _default; | |
| 396 | 521 | |
| 397 | -//#endregion | |
| 398 | -//#region node_modules/@babel/runtime/helpers/regeneratorAsync.js | |
| 399 | - var require_regeneratorAsync = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 400 | - var regeneratorAsyncGen = require_regeneratorAsyncGen(); | |
| 401 | - function _regeneratorAsync(n, e, r, t, o) { | |
| 402 | - var a = regeneratorAsyncGen(n, e, r, t, o); | |
| 403 | - return a.next().then(function(n) { | |
| 404 | - return n.done ? n.value : a.next(); | |
| 405 | - }); | |
| 406 | - } | |
| 407 | - module.exports = _regeneratorAsync, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 408 | - })); | |
| 522 | +/***/ }), | |
| 409 | 523 | |
| 410 | -//#endregion | |
| 411 | -//#region node_modules/@babel/runtime/helpers/regeneratorKeys.js | |
| 412 | - var require_regeneratorKeys = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 413 | - function _regeneratorKeys(e) { | |
| 414 | - var n = Object(e); | |
| 415 | - var r = []; | |
| 416 | - for (var t in n) r.unshift(t); | |
| 417 | - return function e() { | |
| 418 | - for (; r.length;) if ((t = r.pop()) in n) return e.value = t, e.done = !1, e; | |
| 419 | - return e.done = !0, e; | |
| 420 | - }; | |
| 421 | - } | |
| 422 | - module.exports = _regeneratorKeys, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 423 | - })); | |
| 524 | +/***/ "../modules/ai/assets/js/editor/components/prompt-dialog.js": | |
| 525 | +/*!******************************************************************!*\ | |
| 526 | + !*** ../modules/ai/assets/js/editor/components/prompt-dialog.js ***! | |
| 527 | + \******************************************************************/ | |
| 528 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 424 | 529 | |
| 425 | -//#endregion | |
| 426 | -//#region node_modules/@babel/runtime/helpers/typeof.js | |
| 427 | - var require_typeof = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 428 | - function _typeof(o) { | |
| 429 | - "@babel/helpers - typeof"; | |
| 430 | - return module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) { | |
| 431 | - return typeof o; | |
| 432 | - } : function(o) { | |
| 433 | - return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; | |
| 434 | - }, module.exports.__esModule = true, module.exports["default"] = module.exports, _typeof(o); | |
| 435 | - } | |
| 436 | - module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 437 | - })); | |
| 530 | +"use strict"; | |
| 531 | +/* provided dependency */ var PropTypes = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js"); | |
| 438 | 532 | |
| 439 | -//#endregion | |
| 440 | -//#region node_modules/@babel/runtime/helpers/regeneratorValues.js | |
| 441 | - var require_regeneratorValues = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 442 | - var _typeof = require_typeof()["default"]; | |
| 443 | - function _regeneratorValues(e) { | |
| 444 | - if (null != e) { | |
| 445 | - var t = e["function" == typeof Symbol && Symbol.iterator || "@@iterator"]; | |
| 446 | - var r = 0; | |
| 447 | - if (t) return t.call(e); | |
| 448 | - if ("function" == typeof e.next) return e; | |
| 449 | - if (!isNaN(e.length)) return { next: function next() { | |
| 450 | - return e && r >= e.length && (e = void 0), { | |
| 451 | - value: e && e[r++], | |
| 452 | - done: !e | |
| 453 | - }; | |
| 454 | - } }; | |
| 455 | - } | |
| 456 | - throw new TypeError(_typeof(e) + " is not iterable"); | |
| 457 | - } | |
| 458 | - module.exports = _regeneratorValues, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 459 | - })); | |
| 460 | 533 | |
| 461 | -//#endregion | |
| 462 | -//#region node_modules/@babel/runtime/helpers/regeneratorRuntime.js | |
| 463 | - var require_regeneratorRuntime = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 464 | - var OverloadYield = require_OverloadYield(); | |
| 465 | - var regenerator = require_regenerator$1(); | |
| 466 | - var regeneratorAsync = require_regeneratorAsync(); | |
| 467 | - var regeneratorAsyncGen = require_regeneratorAsyncGen(); | |
| 468 | - var regeneratorAsyncIterator = require_regeneratorAsyncIterator(); | |
| 469 | - var regeneratorKeys = require_regeneratorKeys(); | |
| 470 | - var regeneratorValues = require_regeneratorValues(); | |
| 471 | - function _regeneratorRuntime() { | |
| 472 | - "use strict"; | |
| 473 | - var r = regenerator(); | |
| 474 | - var e = r.m(_regeneratorRuntime); | |
| 475 | - var t = (Object.getPrototypeOf ? Object.getPrototypeOf(e) : e.__proto__).constructor; | |
| 476 | - function n(r) { | |
| 477 | - var e = "function" == typeof r && r.constructor; | |
| 478 | - return !!e && (e === t || "GeneratorFunction" === (e.displayName || e.name)); | |
| 479 | - } | |
| 480 | - var o = { | |
| 481 | - "throw": 1, | |
| 482 | - "return": 2, | |
| 483 | - "break": 3, | |
| 484 | - "continue": 3 | |
| 485 | - }; | |
| 486 | - function a(r) { | |
| 487 | - var e; | |
| 488 | - var t; | |
| 489 | - return function(n) { | |
| 490 | - e || (e = { | |
| 491 | - stop: function stop() { | |
| 492 | - return t(n.a, 2); | |
| 493 | - }, | |
| 494 | - "catch": function _catch() { | |
| 495 | - return n.v; | |
| 496 | - }, | |
| 497 | - abrupt: function abrupt(r, e) { | |
| 498 | - return t(n.a, o[r], e); | |
| 499 | - }, | |
| 500 | - delegateYield: function delegateYield(r, o, a) { | |
| 501 | - return e.resultName = o, t(n.d, regeneratorValues(r), a); | |
| 502 | - }, | |
| 503 | - finish: function finish(r) { | |
| 504 | - return t(n.f, r); | |
| 505 | - } | |
| 506 | - }, t = function t(r, _t, o) { | |
| 507 | - n.p = e.prev, n.n = e.next; | |
| 508 | - try { | |
| 509 | - return r(_t, o); | |
| 510 | - } finally { | |
| 511 | - e.next = n.n; | |
| 512 | - } | |
| 513 | - }), e.resultName && (e[e.resultName] = n.v, e.resultName = void 0), e.sent = n.v, e.next = n.n; | |
| 514 | - try { | |
| 515 | - return r.call(this, e); | |
| 516 | - } finally { | |
| 517 | - n.p = e.prev, n.n = e.next; | |
| 518 | - } | |
| 519 | - }; | |
| 520 | - } | |
| 521 | - return (module.exports = _regeneratorRuntime = function _regeneratorRuntime() { | |
| 522 | - return { | |
| 523 | - wrap: function wrap(e, t, n, o) { | |
| 524 | - return r.w(a(e), t, n, o && o.reverse()); | |
| 525 | - }, | |
| 526 | - isGeneratorFunction: n, | |
| 527 | - mark: r.m, | |
| 528 | - awrap: function awrap(r, e) { | |
| 529 | - return new OverloadYield(r, e); | |
| 530 | - }, | |
| 531 | - AsyncIterator: regeneratorAsyncIterator, | |
| 532 | - async: function async(r, e, t, o, u) { | |
| 533 | - return (n(e) ? regeneratorAsyncGen : regeneratorAsync)(a(r), e, t, o, u); | |
| 534 | - }, | |
| 535 | - keys: regeneratorKeys, | |
| 536 | - values: regeneratorValues | |
| 537 | - }; | |
| 538 | - }, module.exports.__esModule = true, module.exports["default"] = module.exports)(); | |
| 539 | - } | |
| 540 | - module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 541 | - })); | |
| 534 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 535 | +var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js"); | |
| 536 | +Object.defineProperty(exports, "__esModule", ({ | |
| 537 | + value: true | |
| 538 | +})); | |
| 539 | +exports["default"] = void 0; | |
| 540 | +var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); | |
| 541 | +var _extends2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/extends */ "../node_modules/@babel/runtime/helpers/extends.js")); | |
| 542 | +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js")); | |
| 543 | +var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js")); | |
| 544 | +var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); | |
| 545 | +var _reactDraggable = _interopRequireDefault(__webpack_require__(/*! react-draggable */ "../node_modules/react-draggable/build/cjs/cjs.js")); | |
| 546 | +var _dialogHeader = _interopRequireDefault(__webpack_require__(/*! ./dialog-header */ "../modules/ai/assets/js/editor/components/dialog-header.js")); | |
| 547 | +function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | |
| 548 | +function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | |
| 549 | +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | |
| 550 | +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | |
| 551 | +var DraggablePaper = function DraggablePaper(props) { | |
| 552 | + var _useState = (0, _react.useState)({ | |
| 553 | + x: 0, | |
| 554 | + y: 0 | |
| 555 | + }), | |
| 556 | + _useState2 = (0, _slicedToArray2.default)(_useState, 2), | |
| 557 | + position = _useState2[0], | |
| 558 | + setPosition = _useState2[1]; | |
| 559 | + var paperRef = (0, _react.useRef)(null); | |
| 560 | + var timeout = (0, _react.useRef)(null); | |
| 561 | + var onDrag = function onDrag(_e, _ref) { | |
| 562 | + var x = _ref.x, | |
| 563 | + y = _ref.y; | |
| 564 | + return setPosition({ | |
| 565 | + x: x, | |
| 566 | + y: y | |
| 567 | + }); | |
| 568 | + }; | |
| 569 | + var handlePositionBoundaries = function handlePositionBoundaries() { | |
| 570 | + clearTimeout(timeout.current); | |
| 542 | 571 | |
| 543 | -//#endregion | |
| 544 | -//#region node_modules/@babel/runtime/regenerator/index.js | |
| 545 | - var require_regenerator = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 546 | - var runtime = require_regeneratorRuntime()(); | |
| 547 | - module.exports = runtime; | |
| 548 | - try { | |
| 549 | - regeneratorRuntime = runtime; | |
| 550 | - } catch (accidentalStrictMode) { | |
| 551 | - if (typeof globalThis === "object") globalThis.regeneratorRuntime = runtime; | |
| 552 | - else Function("r", "regeneratorRuntime = r")(runtime); | |
| 553 | - } | |
| 554 | - })); | |
| 572 | + // Ensuring the dialog header, which is used as the dialog dragging handle, does not exceed the screen. | |
| 573 | + timeout.current = setTimeout(function () { | |
| 574 | + var _paperRef$current; | |
| 575 | + var dialogTop = (_paperRef$current = paperRef.current) === null || _paperRef$current === void 0 ? void 0 : _paperRef$current.getBoundingClientRect().top; | |
| 576 | + if (dialogTop < 0) { | |
| 577 | + setPosition(function (prev) { | |
| 578 | + return _objectSpread(_objectSpread({}, prev), {}, { | |
| 579 | + y: prev.y - dialogTop | |
| 580 | + }); | |
| 581 | + }); | |
| 582 | + } | |
| 583 | + }, 50); | |
| 584 | + }; | |
| 585 | + (0, _react.useEffect)(function () { | |
| 586 | + var resizeObserver = new ResizeObserver(handlePositionBoundaries); | |
| 587 | + resizeObserver.observe(paperRef.current); | |
| 588 | + return function () { | |
| 589 | + resizeObserver.disconnect(); | |
| 590 | + }; | |
| 591 | + }, []); | |
| 592 | + return /*#__PURE__*/_react.default.createElement(_reactDraggable.default, { | |
| 593 | + position: position, | |
| 594 | + onDrag: onDrag, | |
| 595 | + handle: ".MuiAppBar-root", | |
| 596 | + cancel: '[class*="MuiDialogContent-root"]', | |
| 597 | + bounds: "parent" | |
| 598 | + }, /*#__PURE__*/_react.default.createElement(_ui.Paper, (0, _extends2.default)({}, props, { | |
| 599 | + ref: paperRef | |
| 600 | + }))); | |
| 601 | +}; | |
| 602 | +var PromptDialog = function PromptDialog(props) { | |
| 603 | + return /*#__PURE__*/_react.default.createElement(_ui.Dialog, (0, _extends2.default)({ | |
| 604 | + scroll: "paper", | |
| 605 | + open: true, | |
| 606 | + fullWidth: true, | |
| 607 | + hideBackdrop: true, | |
| 608 | + PaperComponent: DraggablePaper, | |
| 609 | + disableScrollLock: true, | |
| 610 | + sx: { | |
| 611 | + '& .MuiDialog-container': { | |
| 612 | + alignItems: 'flex-start', | |
| 613 | + mt: '18vh' | |
| 614 | + } | |
| 615 | + }, | |
| 616 | + PaperProps: { | |
| 617 | + sx: { | |
| 618 | + m: 0, | |
| 619 | + maxHeight: '76vh' | |
| 620 | + } | |
| 621 | + } | |
| 622 | + }, props), props.children); | |
| 623 | +}; | |
| 624 | +PromptDialog.propTypes = { | |
| 625 | + onClose: PropTypes.func.isRequired, | |
| 626 | + children: PropTypes.node.isRequired, | |
| 627 | + maxWidth: PropTypes.oneOf(['xs', 'sm', 'md', 'lg', 'xl', false]) | |
| 628 | +}; | |
| 629 | +PromptDialog.Header = _dialogHeader.default; | |
| 630 | +PromptDialog.Content = _ui.DialogContent; | |
| 631 | +var _default = PromptDialog; | |
| 632 | +exports["default"] = _default; | |
| 555 | 633 | |
| 556 | -//#endregion | |
| 557 | -//#region node_modules/react-dom/client.js | |
| 558 | - var require_client = /* @__PURE__ */ __commonJSMin(((exports) => { | |
| 559 | - var m = (globalThis.ReactDOM); | |
| 560 | - var i = m.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED; | |
| 561 | - exports.createRoot = function(c, o) { | |
| 562 | - i.usingClientEntryPoint = true; | |
| 563 | - try { | |
| 564 | - return m.createRoot(c, o); | |
| 565 | - } finally { | |
| 566 | - i.usingClientEntryPoint = false; | |
| 567 | - } | |
| 568 | - }; | |
| 569 | - })); | |
| 634 | +/***/ }), | |
| 570 | 635 | |
| 571 | -//#endregion | |
| 572 | -//#region assets/dev/js/utils/react.js | |
| 636 | +/***/ "../modules/ai/assets/js/editor/components/prompt-error-message.js": | |
| 637 | +/*!*************************************************************************!*\ | |
| 638 | + !*** ../modules/ai/assets/js/editor/components/prompt-error-message.js ***! | |
| 639 | + \*************************************************************************/ | |
| 640 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 641 | + | |
| 642 | +"use strict"; | |
| 643 | +/* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"]; | |
| 644 | +/* provided dependency */ var PropTypes = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js"); | |
| 645 | + | |
| 646 | + | |
| 647 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 648 | +Object.defineProperty(exports, "__esModule", ({ | |
| 649 | + value: true | |
| 650 | +})); | |
| 651 | +exports["default"] = void 0; | |
| 652 | +var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); | |
| 653 | +var _extends2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/extends */ "../node_modules/@babel/runtime/helpers/extends.js")); | |
| 654 | +var _objectWithoutProperties2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/objectWithoutProperties */ "../node_modules/@babel/runtime/helpers/objectWithoutProperties.js")); | |
| 655 | +var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); | |
| 656 | +var _excluded = ["error", "onRetry", "actionPosition"]; | |
| 657 | +var PromptErrorMessage = function PromptErrorMessage(_ref) { | |
| 658 | + var error = _ref.error, | |
| 659 | + _ref$onRetry = _ref.onRetry, | |
| 660 | + onRetry = _ref$onRetry === void 0 ? function () {} : _ref$onRetry, | |
| 661 | + _ref$actionPosition = _ref.actionPosition, | |
| 662 | + actionPosition = _ref$actionPosition === void 0 ? 'default' : _ref$actionPosition, | |
| 663 | + props = (0, _objectWithoutProperties2.default)(_ref, _excluded); | |
| 664 | + var messages = { | |
| 665 | + default: { | |
| 666 | + text: /*#__PURE__*/_react.default.createElement(_ui.AlertTitle, null, __('Unknown error. Please try again later.', 'elementor')), | |
| 667 | + description: __('Error code:', 'elementor') + ' ' + error, | |
| 668 | + buttonText: __('Try Again', 'elementor'), | |
| 669 | + buttonAction: onRetry | |
| 670 | + }, | |
| 671 | + service_outage_internal: { | |
| 672 | + text: /*#__PURE__*/_react.default.createElement(_ui.AlertTitle, null, __('Elementor AI is temporarily unavailable', 'elementor')), | |
| 673 | + description: __('Seems like we are experiencing technical difficulty. We should be up and running shortly.', 'elementor'), | |
| 674 | + buttonText: __('Try Again', 'elementor'), | |
| 675 | + buttonAction: onRetry | |
| 676 | + }, | |
| 677 | + invalid_connect_data: { | |
| 678 | + text: /*#__PURE__*/_react.default.createElement(_ui.AlertTitle, null, __('Reconnect your account', 'elementor')), | |
| 679 | + description: /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, __('We couldn\'t connect to your account due to technical difficulties on our end. Reconnect your account to continue.', 'elementor'), ' ', /*#__PURE__*/_react.default.createElement("a", { | |
| 680 | + href: "https://elementor.com/help/disconnecting-reconnecting-your-elementor-account/", | |
| 681 | + target: "_blank", | |
| 682 | + rel: "noreferrer" | |
| 683 | + }, __('Show me how', 'elementor'))), | |
| 684 | + buttonText: __('Reconnect', 'elementor'), | |
| 685 | + buttonAction: function buttonAction() { | |
| 686 | + return window.open(window.ElementorAiConfig.connect_url); | |
| 687 | + } | |
| 688 | + }, | |
| 689 | + not_connected: { | |
| 690 | + text: /*#__PURE__*/_react.default.createElement(_ui.AlertTitle, null, __('You aren\'t connected to Elementor AI.', 'elementor')), | |
| 691 | + description: __('Elementor AI is just a few clicks away. Connect your account to instantly create texts and custom code.', 'elementor'), | |
| 692 | + buttonText: __('Connect', 'elementor'), | |
| 693 | + buttonAction: function buttonAction() { | |
| 694 | + return window.open(window.ElementorAiConfig.connect_url); | |
| 695 | + } | |
| 696 | + }, | |
| 697 | + quota_reached_trail: { | |
| 698 | + text: /*#__PURE__*/_react.default.createElement(_ui.AlertTitle, null, __('It\'s time to upgrade.', 'elementor')), | |
| 699 | + description: __('Enjoy the free trial? Upgrade now for unlimited access to built-in image, text and custom code generators.', 'elementor'), | |
| 700 | + buttonText: __('Upgrade', 'elementor'), | |
| 701 | + buttonAction: function buttonAction() { | |
| 702 | + return window.open('https://go.elementor.com/ai-popup-purchase-limit-reached/', '_blank'); | |
| 703 | + } | |
| 704 | + }, | |
| 705 | + quota_reached_subscription: { | |
| 706 | + text: /*#__PURE__*/_react.default.createElement(_ui.AlertTitle, null, __('It\'s time to upgrade.', 'elementor')), | |
| 707 | + description: __('Love Elementor AI? Upgrade to continue creating with built-in image, text and custom code generators.', 'elementor'), | |
| 708 | + buttonText: __('Upgrade', 'elementor'), | |
| 709 | + buttonAction: function buttonAction() { | |
| 710 | + return window.open('https://go.elementor.com/ai-popup-purchase-limit-reached/', '_blank'); | |
| 711 | + } | |
| 712 | + }, | |
| 713 | + rate_limit_network: { | |
| 714 | + text: /*#__PURE__*/_react.default.createElement(_ui.AlertTitle, null, __('Whoa! Slow down there.', 'elementor')), | |
| 715 | + description: __('We can’t process that many requests so fast. Try again in 15 minutes.', 'elementor') | |
| 716 | + }, | |
| 717 | + invalid_prompts: { | |
| 718 | + text: /*#__PURE__*/_react.default.createElement(_ui.AlertTitle, null, __('We were unable to generate that prompt.', 'elementor')), | |
| 719 | + description: __('Seems like the prompt contains words that could generate harmful content. Write a different prompt to continue.', 'elementor') | |
| 720 | + } | |
| 721 | + }; | |
| 722 | + var message = messages[error] || messages.default; | |
| 723 | + var action = (message === null || message === void 0 ? void 0 : message.buttonText) && /*#__PURE__*/_react.default.createElement(_ui.Button, { | |
| 724 | + color: "inherit", | |
| 725 | + size: "small", | |
| 726 | + variant: "outlined", | |
| 727 | + onClick: message.buttonAction | |
| 728 | + }, message.buttonText); | |
| 729 | + return /*#__PURE__*/_react.default.createElement(_ui.Alert, (0, _extends2.default)({ | |
| 730 | + severity: message.severity || 'error', | |
| 731 | + action: 'default' === actionPosition && action | |
| 732 | + }, props), message.text, message.description, 'bottom' === actionPosition && /*#__PURE__*/_react.default.createElement(_ui.Box, { | |
| 733 | + sx: { | |
| 734 | + mt: 1 | |
| 735 | + } | |
| 736 | + }, action)); | |
| 737 | +}; | |
| 738 | +PromptErrorMessage.propTypes = { | |
| 739 | + error: PropTypes.string, | |
| 740 | + onRetry: PropTypes.func, | |
| 741 | + actionPosition: PropTypes.oneOf(['default', 'bottom']) | |
| 742 | +}; | |
| 743 | +var _default = PromptErrorMessage; | |
| 744 | +exports["default"] = _default; | |
| 745 | + | |
| 746 | +/***/ }), | |
| 747 | + | |
| 748 | +/***/ "../modules/ai/assets/js/editor/components/upgrade-chip.js": | |
| 749 | +/*!*****************************************************************!*\ | |
| 750 | + !*** ../modules/ai/assets/js/editor/components/upgrade-chip.js ***! | |
| 751 | + \*****************************************************************/ | |
| 752 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 753 | + | |
| 754 | +"use strict"; | |
| 755 | +/* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"]; | |
| 756 | +/* provided dependency */ var PropTypes = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js"); | |
| 757 | + | |
| 758 | + | |
| 759 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 760 | +var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js"); | |
| 761 | +Object.defineProperty(exports, "__esModule", ({ | |
| 762 | + value: true | |
| 763 | +})); | |
| 764 | +exports["default"] = void 0; | |
| 765 | +var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); | |
| 766 | +var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js")); | |
| 767 | +var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); | |
| 768 | +var _icons = __webpack_require__(/*! @elementor/icons */ "@elementor/icons"); | |
| 769 | +function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | |
| 770 | +function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | |
| 771 | +var popoverId = 'e-ai-upgrade-popover'; | |
| 772 | +var StyledContent = (0, _ui.styled)(_ui.Paper)(function (_ref) { | |
| 773 | + var theme = _ref.theme; | |
| 774 | + return { | |
| 775 | + position: 'relative', | |
| 776 | + '[data-popper-placement="top"] &': { | |
| 777 | + marginBottom: theme.spacing(2.5) | |
| 778 | + }, | |
| 779 | + '[data-popper-placement="bottom"] &': { | |
| 780 | + marginTop: theme.spacing(2.5) | |
| 781 | + }, | |
| 782 | + padding: theme.spacing(3), | |
| 783 | + boxShadow: theme.shadows[4], | |
| 784 | + zIndex: '9999' | |
| 785 | + }; | |
| 786 | +}); | |
| 787 | +var StyledArrow = (0, _ui.styled)(_ui.Box)(function (_ref2) { | |
| 788 | + var theme = _ref2.theme; | |
| 789 | + return { | |
| 790 | + width: theme.spacing(5), | |
| 791 | + height: theme.spacing(2.5), | |
| 792 | + position: 'absolute', | |
| 793 | + overflow: 'hidden', | |
| 794 | + // Override Popper inline styles. | |
| 795 | + left: '50% !important', | |
| 796 | + transform: 'translateX(-50%) rotate(var(--rotate, 0deg)) !important', | |
| 797 | + '[data-popper-placement="top"] &': { | |
| 798 | + top: '100%' | |
| 799 | + }, | |
| 800 | + '[data-popper-placement="bottom"] &': { | |
| 801 | + '--rotate': '180deg', | |
| 802 | + top: "calc(".concat(theme.spacing(2.5), " * -1)") | |
| 803 | + }, | |
| 804 | + '&::after': { | |
| 805 | + backgroundColor: theme.palette.background.paper, | |
| 806 | + content: '""', | |
| 807 | + display: 'block', | |
| 808 | + position: 'absolute', | |
| 809 | + width: theme.spacing(2.5), | |
| 810 | + height: theme.spacing(2.5), | |
| 811 | + top: 0, | |
| 812 | + left: '50%', | |
| 813 | + transform: 'translateX(-50%) translateY(-50%) rotate(45deg)', | |
| 814 | + boxShadow: '1px 1px 5px 0px rgba(0, 0, 0, 0.2)', | |
| 815 | + backgroundImage: 'linear-gradient(rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.05))' | |
| 816 | + } | |
| 817 | + }; | |
| 818 | +}); | |
| 819 | +var upgradeBullets = [__('Generate your website\'s text or create custom code without having to write a single line yourself.', 'elementor'), __('Effortlessly create or enhance stunning images and bring your ideas to life.', 'elementor'), __('Access 30-days of AI History with the AI Starter plan and 90-days with the Power plan.', 'elementor')]; | |
| 820 | +var Chip = (0, _ui.styled)(_ui.Chip)(function () { | |
| 821 | + return { | |
| 822 | + '& .MuiChip-label': { | |
| 823 | + lineHeight: 1.5 | |
| 824 | + }, | |
| 825 | + '& .MuiSvgIcon-root.MuiChip-icon': { | |
| 826 | + fontSize: '1.25rem' | |
| 827 | + } | |
| 828 | + }; | |
| 829 | +}); | |
| 830 | +var UpgradeChip = function UpgradeChip(_ref3) { | |
| 831 | + var _ref3$hasSubscription = _ref3.hasSubscription, | |
| 832 | + hasSubscription = _ref3$hasSubscription === void 0 ? false : _ref3$hasSubscription, | |
| 833 | + _ref3$usagePercentage = _ref3.usagePercentage, | |
| 834 | + usagePercentage = _ref3$usagePercentage === void 0 ? 0 : _ref3$usagePercentage; | |
| 835 | + var _useState = (0, _react.useState)(false), | |
| 836 | + _useState2 = (0, _slicedToArray2.default)(_useState, 2), | |
| 837 | + isPopoverOpen = _useState2[0], | |
| 838 | + setIsPopoverOpen = _useState2[1]; | |
| 839 | + var anchorEl = (0, _react.useRef)(null); | |
| 840 | + var arrowEl = (0, _react.useRef)(null); | |
| 841 | + var showPopover = function showPopover() { | |
| 842 | + return setIsPopoverOpen(true); | |
| 843 | + }; | |
| 844 | + var hidePopover = function hidePopover() { | |
| 845 | + return setIsPopoverOpen(false); | |
| 846 | + }; | |
| 847 | + var actionUrl = 'https://go.elementor.com/ai-popup-purchase-dropdown/'; | |
| 848 | + if (hasSubscription) { | |
| 849 | + actionUrl = usagePercentage >= 100 ? 'https://go.elementor.com/ai-popup-upgrade-limit-reached/' : 'https://go.elementor.com/ai-popup-upgrade-limit-reached-80-percent/'; | |
| 850 | + } | |
| 851 | + var actionLabel = hasSubscription ? __('Upgrade Elementor AI', 'elementor') : __('Get Elementor AI', 'elementor'); | |
| 852 | + return /*#__PURE__*/_react.default.createElement(_ui.Box, { | |
| 853 | + component: "span", | |
| 854 | + "aria-owns": isPopoverOpen ? popoverId : undefined, | |
| 855 | + "aria-haspopup": "true", | |
| 856 | + onMouseEnter: showPopover, | |
| 857 | + onMouseLeave: hidePopover, | |
| 858 | + ref: anchorEl, | |
| 859 | + display: "flex", | |
| 860 | + alignItems: "center" | |
| 861 | + }, /*#__PURE__*/_react.default.createElement(Chip, { | |
| 862 | + color: "accent", | |
| 863 | + label: __('Upgrade', 'elementor'), | |
| 864 | + icon: /*#__PURE__*/_react.default.createElement(_icons.UpgradeIcon, null), | |
| 865 | + size: "small" | |
| 866 | + }), /*#__PURE__*/_react.default.createElement(_ui.Popper, { | |
| 867 | + open: isPopoverOpen, | |
| 868 | + anchorEl: anchorEl.current, | |
| 869 | + sx: { | |
| 870 | + zIndex: '9999', | |
| 871 | + maxWidth: 300 | |
| 872 | + }, | |
| 873 | + modifiers: [{ | |
| 874 | + name: 'arrow', | |
| 875 | + enabled: true, | |
| 876 | + options: { | |
| 877 | + element: arrowEl.current | |
| 878 | + } | |
| 879 | + }] | |
| 880 | + }, /*#__PURE__*/_react.default.createElement(StyledContent, null, /*#__PURE__*/_react.default.createElement(StyledArrow, { | |
| 881 | + ref: arrowEl | |
| 882 | + }), /*#__PURE__*/_react.default.createElement(_ui.Typography, { | |
| 883 | + variant: "h5", | |
| 884 | + color: "text.primary" | |
| 885 | + }, __('Maximum access to Elementor AI', 'elementor')), /*#__PURE__*/_react.default.createElement(_ui.List, { | |
| 886 | + sx: { | |
| 887 | + mb: 1 | |
| 888 | + } | |
| 889 | + }, upgradeBullets.map(function (bullet, index) { | |
| 890 | + return /*#__PURE__*/_react.default.createElement(_ui.ListItem, { | |
| 891 | + key: index, | |
| 892 | + disableGutters: true, | |
| 893 | + sx: { | |
| 894 | + alignItems: 'flex-start' | |
| 895 | + } | |
| 896 | + }, /*#__PURE__*/_react.default.createElement(_ui.ListItemIcon, null, /*#__PURE__*/_react.default.createElement(_icons.CheckedCircleIcon, null)), /*#__PURE__*/_react.default.createElement(_ui.ListItemText, { | |
| 897 | + sx: { | |
| 898 | + m: 0 | |
| 899 | + } | |
| 900 | + }, /*#__PURE__*/_react.default.createElement(_ui.Typography, { | |
| 901 | + variant: "body2" | |
| 902 | + }, bullet))); | |
| 903 | + })), /*#__PURE__*/_react.default.createElement(_ui.Button, { | |
| 904 | + variant: "contained", | |
| 905 | + color: "accent", | |
| 906 | + size: "small", | |
| 907 | + href: actionUrl, | |
| 908 | + target: "_blank", | |
| 909 | + startIcon: /*#__PURE__*/_react.default.createElement(_icons.UpgradeIcon, null), | |
| 910 | + sx: { | |
| 911 | + '&:hover': { | |
| 912 | + color: 'accent.contrastText' | |
| 913 | + } | |
| 914 | + } | |
| 915 | + }, actionLabel)))); | |
| 916 | +}; | |
| 917 | +var _default = UpgradeChip; | |
| 918 | +exports["default"] = _default; | |
| 919 | +UpgradeChip.propTypes = { | |
| 920 | + hasSubscription: PropTypes.bool, | |
| 921 | + usagePercentage: PropTypes.number | |
| 922 | +}; | |
| 923 | + | |
| 924 | +/***/ }), | |
| 925 | + | |
| 926 | +/***/ "../modules/ai/assets/js/editor/components/wizard-dialog.js": | |
| 927 | +/*!******************************************************************!*\ | |
| 928 | + !*** ../modules/ai/assets/js/editor/components/wizard-dialog.js ***! | |
| 929 | + \******************************************************************/ | |
| 930 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 931 | + | |
| 932 | +"use strict"; | |
| 933 | +/* provided dependency */ var PropTypes = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js"); | |
| 934 | + | |
| 935 | + | |
| 936 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 937 | +Object.defineProperty(exports, "__esModule", ({ | |
| 938 | + value: true | |
| 939 | +})); | |
| 940 | +exports["default"] = void 0; | |
| 941 | +var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); | |
| 942 | +var _extends2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/extends */ "../node_modules/@babel/runtime/helpers/extends.js")); | |
| 943 | +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js")); | |
| 944 | +var _objectWithoutProperties2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/objectWithoutProperties */ "../node_modules/@babel/runtime/helpers/objectWithoutProperties.js")); | |
| 945 | +var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); | |
| 946 | +var _dialogHeader = _interopRequireDefault(__webpack_require__(/*! ./dialog-header */ "../modules/ai/assets/js/editor/components/dialog-header.js")); | |
| 947 | +var _excluded = ["sx"]; | |
| 948 | +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | |
| 949 | +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | |
| 950 | +var WizardDialog = function WizardDialog(props) { | |
| 951 | + return /*#__PURE__*/_react.default.createElement(_ui.Dialog, { | |
| 952 | + open: true, | |
| 953 | + onClose: props.onClose, | |
| 954 | + fullWidth: true, | |
| 955 | + hideBackdrop: true, | |
| 956 | + maxWidth: "lg", | |
| 957 | + PaperProps: { | |
| 958 | + sx: { | |
| 959 | + height: '88vh' | |
| 960 | + } | |
| 961 | + }, | |
| 962 | + sx: { | |
| 963 | + zIndex: 9999 | |
| 964 | + } | |
| 965 | + }, props.children); | |
| 966 | +}; | |
| 967 | +WizardDialog.propTypes = { | |
| 968 | + onClose: PropTypes.func.isRequired, | |
| 969 | + children: PropTypes.node.isRequired | |
| 970 | +}; | |
| 971 | +var WizardDialogContent = function WizardDialogContent(_ref) { | |
| 972 | + var _ref$sx = _ref.sx, | |
| 973 | + sx = _ref$sx === void 0 ? {} : _ref$sx, | |
| 974 | + props = (0, _objectWithoutProperties2.default)(_ref, _excluded); | |
| 975 | + return /*#__PURE__*/_react.default.createElement(_ui.DialogContent, (0, _extends2.default)({}, props, { | |
| 976 | + sx: _objectSpread({ | |
| 977 | + display: 'flex', | |
| 978 | + flexDirection: 'column', | |
| 979 | + justifyContent: 'center' | |
| 980 | + }, sx) | |
| 981 | + })); | |
| 982 | +}; | |
| 983 | +WizardDialogContent.propTypes = { | |
| 984 | + sx: PropTypes.object | |
| 985 | +}; | |
| 986 | +WizardDialog.Header = _dialogHeader.default; | |
| 987 | +WizardDialog.Content = WizardDialogContent; | |
| 988 | +var _default = WizardDialog; | |
| 989 | +exports["default"] = _default; | |
| 990 | + | |
| 991 | +/***/ }), | |
| 992 | + | |
| 993 | +/***/ "../modules/ai/assets/js/editor/helpers/index.js": | |
| 994 | +/*!*******************************************************!*\ | |
| 995 | + !*** ../modules/ai/assets/js/editor/helpers/index.js ***! | |
| 996 | + \*******************************************************/ | |
| 997 | +/***/ ((__unused_webpack_module, exports) => { | |
| 998 | + | |
| 999 | +"use strict"; | |
| 1000 | + | |
| 1001 | + | |
| 1002 | +Object.defineProperty(exports, "__esModule", ({ | |
| 1003 | + value: true | |
| 1004 | +})); | |
| 1005 | +exports.vh = exports.onConnect = void 0; | |
| 1006 | +var onConnect = function onConnect(data) { | |
| 1007 | + elementorCommon.config.library_connect.is_connected = true; | |
| 1008 | + elementorCommon.config.library_connect.current_access_level = data.accessLevel; | |
| 1009 | +}; | |
| 1010 | +exports.onConnect = onConnect; | |
| 1011 | +var vh = function vh(value) { | |
| 1012 | + var h = Math.max(document.documentElement.clientHeight, window.innerHeight || 0); | |
| 1013 | + return value * h / 100; | |
| 1014 | +}; | |
| 1015 | +exports.vh = vh; | |
| 1016 | + | |
| 1017 | +/***/ }), | |
| 1018 | + | |
| 1019 | +/***/ "../modules/ai/assets/js/editor/hooks/use-introduction.js": | |
| 1020 | +/*!****************************************************************!*\ | |
| 1021 | + !*** ../modules/ai/assets/js/editor/hooks/use-introduction.js ***! | |
| 1022 | + \****************************************************************/ | |
| 1023 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 1024 | + | |
| 1025 | +"use strict"; | |
| 1026 | + | |
| 1027 | + | |
| 1028 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 1029 | +Object.defineProperty(exports, "__esModule", ({ | |
| 1030 | + value: true | |
| 1031 | +})); | |
| 1032 | +exports["default"] = useIntroduction; | |
| 1033 | +var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js")); | |
| 1034 | +var _react = __webpack_require__(/*! react */ "react"); | |
| 1035 | +function useIntroduction(key) { | |
| 1036 | + var _window$elementor, _window$elementor$con, _window$elementor$con2, _window$elementor$con3; | |
| 1037 | + var _useState = (0, _react.useState)(!!((_window$elementor = window.elementor) !== null && _window$elementor !== void 0 && (_window$elementor$con = _window$elementor.config) !== null && _window$elementor$con !== void 0 && (_window$elementor$con2 = _window$elementor$con.user) !== null && _window$elementor$con2 !== void 0 && (_window$elementor$con3 = _window$elementor$con2.introduction) !== null && _window$elementor$con3 !== void 0 && _window$elementor$con3[key])), | |
| 1038 | + _useState2 = (0, _slicedToArray2.default)(_useState, 2), | |
| 1039 | + isViewed = _useState2[0], | |
| 1040 | + setIsViewed = _useState2[1]; | |
| 1041 | + function markAsViewed() { | |
| 1042 | + if (!key) { | |
| 1043 | + return Promise.reject(); | |
| 1044 | + } | |
| 1045 | + return new Promise(function (resolve, reject) { | |
| 1046 | + if (isViewed) { | |
| 1047 | + reject(); | |
| 1048 | + } | |
| 1049 | + setIsViewed(true); | |
| 1050 | + elementorCommon.ajax.addRequest('introduction_viewed', { | |
| 1051 | + data: { | |
| 1052 | + introductionKey: key | |
| 1053 | + }, | |
| 1054 | + error: function error() { | |
| 1055 | + setIsViewed(false); | |
| 1056 | + reject(); | |
| 1057 | + }, | |
| 1058 | + success: function success() { | |
| 1059 | + var _window$elementor2, _window$elementor2$co, _window$elementor2$co2; | |
| 1060 | + setIsViewed(true); | |
| 1061 | + if ((_window$elementor2 = window.elementor) !== null && _window$elementor2 !== void 0 && (_window$elementor2$co = _window$elementor2.config) !== null && _window$elementor2$co !== void 0 && (_window$elementor2$co2 = _window$elementor2$co.user) !== null && _window$elementor2$co2 !== void 0 && _window$elementor2$co2.introduction) { | |
| 1062 | + window.elementor.config.user.introduction[key] = true; | |
| 1063 | + } | |
| 1064 | + resolve(); | |
| 1065 | + } | |
| 1066 | + }); | |
| 1067 | + }); | |
| 1068 | + } | |
| 1069 | + return { | |
| 1070 | + isViewed: isViewed, | |
| 1071 | + markAsViewed: markAsViewed | |
| 1072 | + }; | |
| 1073 | +} | |
| 1074 | + | |
| 1075 | +/***/ }), | |
| 1076 | + | |
| 1077 | +/***/ "../modules/ai/assets/js/editor/hooks/use-prompt-enhancer.js": | |
| 1078 | +/*!*******************************************************************!*\ | |
| 1079 | + !*** ../modules/ai/assets/js/editor/hooks/use-prompt-enhancer.js ***! | |
| 1080 | + \*******************************************************************/ | |
| 1081 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 1082 | + | |
| 1083 | +"use strict"; | |
| 1084 | + | |
| 1085 | + | |
| 1086 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 1087 | +Object.defineProperty(exports, "__esModule", ({ | |
| 1088 | + value: true | |
| 1089 | +})); | |
| 1090 | +exports["default"] = void 0; | |
| 1091 | +var _api = __webpack_require__(/*! ../api */ "../modules/ai/assets/js/editor/api/index.js"); | |
| 1092 | +var _usePrompt2 = _interopRequireDefault(__webpack_require__(/*! ./use-prompt */ "../modules/ai/assets/js/editor/hooks/use-prompt.js")); | |
| 1093 | +var enhancePromptMap = new Map([['media', _api.getImagePromptEnhanced], ['layout', _api.getLayoutPromptEnhanced]]); | |
| 1094 | +var getResult = function getResult(prompt, type) { | |
| 1095 | + if (!enhancePromptMap.has(type)) { | |
| 1096 | + throw new Error("Invalid prompt type: ".concat(type)); | |
| 1097 | + } | |
| 1098 | + return enhancePromptMap.get(type)(prompt); | |
| 1099 | +}; | |
| 1100 | + | |
| 573 | 1101 | /** |
| 574 | - * Support conditional rendering of a React App to the DOM, based on the React version. | |
| 575 | - * We use `createRoot` when available, but fallback to `ReactDOM.render` for older versions. | |
| 576 | - * | |
| 577 | - * @param {Promise.resolve(React).ReactElement} app The app to render. | |
| 578 | - * @param {HTMLElement} domElement The DOM element to render the app into. | |
| 579 | - * | |
| 580 | - * @return {{ unmount: () => void }} The unmount function. | |
| 581 | - */ | |
| 582 | - function render(app, domElement) { | |
| 583 | - var unmountFunction; | |
| 584 | - try { | |
| 585 | - var root = (0, import_client.createRoot)(domElement); | |
| 586 | - root.render(app); | |
| 587 | - unmountFunction = function unmountFunction() { | |
| 588 | - root.unmount(); | |
| 589 | - }; | |
| 590 | - } catch (e) { | |
| 591 | - react_dom.render(app, domElement); | |
| 592 | - unmountFunction = function unmountFunction() { | |
| 593 | - react_dom.unmountComponentAtNode(domElement); | |
| 594 | - }; | |
| 595 | - } | |
| 596 | - return { unmount: unmountFunction }; | |
| 597 | - } | |
| 598 | - var import_client, react_default; | |
| 599 | - var init_react = __esmMin((() => { | |
| 600 | - import_client = require_client(); | |
| 601 | - react_default = { render }; | |
| 602 | - })); | |
| 1102 | + * Hook to enhance a prompt. | |
| 1103 | + * | |
| 1104 | + * @param {string} prompt | |
| 1105 | + * @param {'media' | 'layout'} type | |
| 1106 | + * @return {{enhancedPrompt: string | undefined, isEnhancing: boolean, enhance: (function(...[*]): Promise)}} | |
| 1107 | + */ | |
| 1108 | +var usePromptEnhancer = function usePromptEnhancer(prompt, type) { | |
| 1109 | + var _usePrompt = (0, _usePrompt2.default)(function () { | |
| 1110 | + return getResult(prompt, type); | |
| 1111 | + }, prompt), | |
| 1112 | + enhancedData = _usePrompt.data, | |
| 1113 | + isEnhancing = _usePrompt.isLoading, | |
| 1114 | + enhance = _usePrompt.send; | |
| 1115 | + return { | |
| 1116 | + enhance: enhance, | |
| 1117 | + isEnhancing: isEnhancing, | |
| 1118 | + enhancedPrompt: enhancedData === null || enhancedData === void 0 ? void 0 : enhancedData.result | |
| 1119 | + }; | |
| 1120 | +}; | |
| 1121 | +var _default = usePromptEnhancer; | |
| 1122 | +exports["default"] = _default; | |
| 603 | 1123 | |
| 604 | -//#endregion | |
| 605 | -//#region node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js | |
| 606 | - function _arrayLikeToArray(r, a) { | |
| 607 | - (null == a || a > r.length) && (a = r.length); | |
| 608 | - for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; | |
| 609 | - return n; | |
| 610 | - } | |
| 611 | - var init_arrayLikeToArray = __esmMin((() => {})); | |
| 1124 | +/***/ }), | |
| 612 | 1125 | |
| 613 | -//#endregion | |
| 614 | -//#region node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js | |
| 615 | - function _arrayWithoutHoles(r) { | |
| 616 | - if (Array.isArray(r)) return _arrayLikeToArray(r); | |
| 617 | - } | |
| 618 | - var init_arrayWithoutHoles = __esmMin((() => { | |
| 619 | - init_arrayLikeToArray(); | |
| 620 | - })); | |
| 1126 | +/***/ "../modules/ai/assets/js/editor/hooks/use-prompt.js": | |
| 1127 | +/*!**********************************************************!*\ | |
| 1128 | + !*** ../modules/ai/assets/js/editor/hooks/use-prompt.js ***! | |
| 1129 | + \**********************************************************/ | |
| 1130 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 621 | 1131 | |
| 622 | -//#endregion | |
| 623 | -//#region node_modules/@babel/runtime/helpers/esm/iterableToArray.js | |
| 624 | - function _iterableToArray(r) { | |
| 625 | - if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); | |
| 626 | - } | |
| 627 | - var init_iterableToArray = __esmMin((() => {})); | |
| 1132 | +"use strict"; | |
| 628 | 1133 | |
| 629 | -//#endregion | |
| 630 | -//#region node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js | |
| 631 | - function _unsupportedIterableToArray(r, a) { | |
| 632 | - if (r) { | |
| 633 | - if ("string" == typeof r) return _arrayLikeToArray(r, a); | |
| 634 | - var t = {}.toString.call(r).slice(8, -1); | |
| 635 | - 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; | |
| 636 | - } | |
| 637 | - } | |
| 638 | - var init_unsupportedIterableToArray = __esmMin((() => { | |
| 639 | - init_arrayLikeToArray(); | |
| 640 | - })); | |
| 641 | 1134 | |
| 642 | -//#endregion | |
| 643 | -//#region node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js | |
| 644 | - function _nonIterableSpread() { | |
| 645 | - throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); | |
| 646 | - } | |
| 647 | - var init_nonIterableSpread = __esmMin((() => {})); | |
| 1135 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 1136 | +Object.defineProperty(exports, "__esModule", ({ | |
| 1137 | + value: true | |
| 1138 | +})); | |
| 1139 | +exports["default"] = void 0; | |
| 1140 | +var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ "../node_modules/@babel/runtime/regenerator/index.js")); | |
| 1141 | +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js")); | |
| 1142 | +var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "../node_modules/@babel/runtime/helpers/asyncToGenerator.js")); | |
| 1143 | +var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js")); | |
| 1144 | +var _react = __webpack_require__(/*! react */ "react"); | |
| 1145 | +var _api = __webpack_require__(/*! ../api */ "../modules/ai/assets/js/editor/api/index.js"); | |
| 1146 | +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | |
| 1147 | +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | |
| 1148 | +var normalizeResponse = function normalizeResponse(_ref) { | |
| 1149 | + var text = _ref.text, | |
| 1150 | + responseId = _ref.response_id, | |
| 1151 | + usage = _ref.usage, | |
| 1152 | + images = _ref.images; | |
| 1153 | + var creditsData = usage ? usage.quota - usage.usedQuota : 0; | |
| 1154 | + var credits = Math.max(creditsData, 0); | |
| 1155 | + var result = text || images; | |
| 1156 | + return { | |
| 1157 | + result: result, | |
| 1158 | + responseId: responseId, | |
| 1159 | + credits: credits | |
| 1160 | + }; | |
| 1161 | +}; | |
| 1162 | +var usePrompt = function usePrompt(fetchData, initialState) { | |
| 1163 | + var _useState = (0, _react.useState)(false), | |
| 1164 | + _useState2 = (0, _slicedToArray2.default)(_useState, 2), | |
| 1165 | + isLoading = _useState2[0], | |
| 1166 | + setIsLoading = _useState2[1]; | |
| 1167 | + var _useState3 = (0, _react.useState)(''), | |
| 1168 | + _useState4 = (0, _slicedToArray2.default)(_useState3, 2), | |
| 1169 | + error = _useState4[0], | |
| 1170 | + setError = _useState4[1]; | |
| 1171 | + var _useState5 = (0, _react.useState)(initialState), | |
| 1172 | + _useState6 = (0, _slicedToArray2.default)(_useState5, 2), | |
| 1173 | + data = _useState6[0], | |
| 1174 | + setData = _useState6[1]; | |
| 1175 | + var send = /*#__PURE__*/function () { | |
| 1176 | + var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() { | |
| 1177 | + var _len, | |
| 1178 | + args, | |
| 1179 | + _key, | |
| 1180 | + _args = arguments; | |
| 1181 | + return _regenerator.default.wrap(function _callee$(_context) { | |
| 1182 | + while (1) switch (_context.prev = _context.next) { | |
| 1183 | + case 0: | |
| 1184 | + for (_len = _args.length, args = new Array(_len), _key = 0; _key < _len; _key++) { | |
| 1185 | + args[_key] = _args[_key]; | |
| 1186 | + } | |
| 1187 | + return _context.abrupt("return", new Promise(function (resolve, reject) { | |
| 1188 | + setError(''); | |
| 1189 | + setIsLoading(true); | |
| 1190 | + fetchData.apply(void 0, args).then(function (result) { | |
| 1191 | + var normalizedData = normalizeResponse(result); | |
| 1192 | + setData(normalizedData); | |
| 1193 | + resolve(normalizedData); | |
| 1194 | + }).catch(function (err) { | |
| 1195 | + var finalError = (err === null || err === void 0 ? void 0 : err.responseText) || err; | |
| 1196 | + setError(finalError); | |
| 1197 | + reject(finalError); | |
| 1198 | + }).finally(function () { | |
| 1199 | + return setIsLoading(false); | |
| 1200 | + }); | |
| 1201 | + })); | |
| 1202 | + case 2: | |
| 1203 | + case "end": | |
| 1204 | + return _context.stop(); | |
| 1205 | + } | |
| 1206 | + }, _callee); | |
| 1207 | + })); | |
| 1208 | + return function send() { | |
| 1209 | + return _ref2.apply(this, arguments); | |
| 1210 | + }; | |
| 1211 | + }(); | |
| 1212 | + var sendUsageData = function sendUsageData() { | |
| 1213 | + var usageData = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : data; | |
| 1214 | + return usageData.responseId && (0, _api.setStatusFeedback)(usageData.responseId); | |
| 1215 | + }; | |
| 1216 | + var reset = function reset() { | |
| 1217 | + setData(function (_ref3) { | |
| 1218 | + var credits = _ref3.credits; | |
| 1219 | + return { | |
| 1220 | + credits: credits, | |
| 1221 | + result: '', | |
| 1222 | + responseId: '' | |
| 1223 | + }; | |
| 1224 | + }); | |
| 1225 | + setError(''); | |
| 1226 | + setIsLoading(false); | |
| 1227 | + }; | |
| 1228 | + var setResult = function setResult(result) { | |
| 1229 | + var responseId = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; | |
| 1230 | + var updatedResult = _objectSpread({}, data); | |
| 1231 | + updatedResult.result = result; | |
| 1232 | + if (responseId) { | |
| 1233 | + updatedResult.responseId = responseId; | |
| 1234 | + } | |
| 1235 | + setData(updatedResult); | |
| 1236 | + }; | |
| 1237 | + return { | |
| 1238 | + isLoading: isLoading, | |
| 1239 | + error: error, | |
| 1240 | + data: data, | |
| 1241 | + setResult: setResult, | |
| 1242 | + reset: reset, | |
| 1243 | + send: send, | |
| 1244 | + sendUsageData: sendUsageData | |
| 1245 | + }; | |
| 1246 | +}; | |
| 1247 | +var _default = usePrompt; | |
| 1248 | +exports["default"] = _default; | |
| 648 | 1249 | |
| 649 | -//#endregion | |
| 650 | -//#region node_modules/@babel/runtime/helpers/esm/toConsumableArray.js | |
| 651 | - function _toConsumableArray(r) { | |
| 652 | - return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); | |
| 1250 | +/***/ }), | |
| 1251 | + | |
| 1252 | +/***/ "../modules/ai/assets/js/editor/hooks/use-user-info.js": | |
| 1253 | +/*!*************************************************************!*\ | |
| 1254 | + !*** ../modules/ai/assets/js/editor/hooks/use-user-info.js ***! | |
| 1255 | + \*************************************************************/ | |
| 1256 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 1257 | + | |
| 1258 | +"use strict"; | |
| 1259 | + | |
| 1260 | + | |
| 1261 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 1262 | +Object.defineProperty(exports, "__esModule", ({ | |
| 1263 | + value: true | |
| 1264 | +})); | |
| 1265 | +exports["default"] = void 0; | |
| 1266 | +var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ "../node_modules/@babel/runtime/regenerator/index.js")); | |
| 1267 | +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js")); | |
| 1268 | +var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "../node_modules/@babel/runtime/helpers/asyncToGenerator.js")); | |
| 1269 | +var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js")); | |
| 1270 | +var _react = __webpack_require__(/*! react */ "react"); | |
| 1271 | +var _api = __webpack_require__(/*! ../api */ "../modules/ai/assets/js/editor/api/index.js"); | |
| 1272 | +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | |
| 1273 | +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | |
| 1274 | +var useUserInfo = function useUserInfo() { | |
| 1275 | + var _useState = (0, _react.useState)(false), | |
| 1276 | + _useState2 = (0, _slicedToArray2.default)(_useState, 2), | |
| 1277 | + isLoading = _useState2[0], | |
| 1278 | + setIsLoading = _useState2[1]; | |
| 1279 | + var _useState3 = (0, _react.useState)({ | |
| 1280 | + is_connected: false, | |
| 1281 | + is_get_started: false, | |
| 1282 | + connect_url: '', | |
| 1283 | + usage: { | |
| 1284 | + hasAiSubscription: false, | |
| 1285 | + quota: 0, | |
| 1286 | + usedQuota: 0 | |
| 1287 | + } | |
| 1288 | + }), | |
| 1289 | + _useState4 = (0, _slicedToArray2.default)(_useState3, 2), | |
| 1290 | + userInfo = _useState4[0], | |
| 1291 | + setUserInfo = _useState4[1]; | |
| 1292 | + var credits = userInfo.usage.quota - userInfo.usage.usedQuota; | |
| 1293 | + var usagePercentage = userInfo.usage.usedQuota / userInfo.usage.quota * 100; | |
| 1294 | + var fetchData = /*#__PURE__*/function () { | |
| 1295 | + var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() { | |
| 1296 | + var userInfoResult; | |
| 1297 | + return _regenerator.default.wrap(function _callee$(_context) { | |
| 1298 | + while (1) switch (_context.prev = _context.next) { | |
| 1299 | + case 0: | |
| 1300 | + setIsLoading(true); | |
| 1301 | + _context.next = 3; | |
| 1302 | + return (0, _api.getUserInformation)(); | |
| 1303 | + case 3: | |
| 1304 | + userInfoResult = _context.sent; | |
| 1305 | + setUserInfo(function (prevState) { | |
| 1306 | + return _objectSpread(_objectSpread({}, prevState), userInfoResult); | |
| 1307 | + }); | |
| 1308 | + setIsLoading(false); | |
| 1309 | + case 6: | |
| 1310 | + case "end": | |
| 1311 | + return _context.stop(); | |
| 1312 | + } | |
| 1313 | + }, _callee); | |
| 1314 | + })); | |
| 1315 | + return function fetchData() { | |
| 1316 | + return _ref.apply(this, arguments); | |
| 1317 | + }; | |
| 1318 | + }(); | |
| 1319 | + (0, _react.useEffect)(function () { | |
| 1320 | + fetchData(); | |
| 1321 | + }, []); | |
| 1322 | + return { | |
| 1323 | + isLoading: isLoading, | |
| 1324 | + isConnected: userInfo.is_connected, | |
| 1325 | + isGetStarted: userInfo.is_get_started, | |
| 1326 | + connectUrl: userInfo.connect_url, | |
| 1327 | + hasSubscription: userInfo.usage.hasAiSubscription, | |
| 1328 | + credits: credits < 0 ? 0 : credits, | |
| 1329 | + usagePercentage: Math.round(usagePercentage), | |
| 1330 | + fetchData: fetchData | |
| 1331 | + }; | |
| 1332 | +}; | |
| 1333 | +var _default = useUserInfo; | |
| 1334 | +exports["default"] = _default; | |
| 1335 | + | |
| 1336 | +/***/ }), | |
| 1337 | + | |
| 1338 | +/***/ "../modules/ai/assets/js/editor/icons/arrow-left-icon.js": | |
| 1339 | +/*!***************************************************************!*\ | |
| 1340 | + !*** ../modules/ai/assets/js/editor/icons/arrow-left-icon.js ***! | |
| 1341 | + \***************************************************************/ | |
| 1342 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 1343 | + | |
| 1344 | +"use strict"; | |
| 1345 | + | |
| 1346 | + | |
| 1347 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 1348 | +Object.defineProperty(exports, "__esModule", ({ | |
| 1349 | + value: true | |
| 1350 | +})); | |
| 1351 | +exports["default"] = void 0; | |
| 1352 | +var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); | |
| 1353 | +var _extends2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/extends */ "../node_modules/@babel/runtime/helpers/extends.js")); | |
| 1354 | +var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); | |
| 1355 | +var ArrowLeftIcon = _react.default.forwardRef(function (props, ref) { | |
| 1356 | + return /*#__PURE__*/_react.default.createElement(_ui.SvgIcon, (0, _extends2.default)({ | |
| 1357 | + viewBox: "0 0 24 24" | |
| 1358 | + }, props, { | |
| 1359 | + ref: ref | |
| 1360 | + }), /*#__PURE__*/_react.default.createElement("path", { | |
| 1361 | + fillRule: "evenodd", | |
| 1362 | + clipRule: "evenodd", | |
| 1363 | + d: "M9.53033 7.46967C9.82322 7.76256 9.82322 8.23744 9.53033 8.53033L6.81066 11.25H19C19.4142 11.25 19.75 11.5858 19.75 12C19.75 12.4142 19.4142 12.75 19 12.75H6.81066L9.53033 15.4697C9.82322 15.7626 9.82322 16.2374 9.53033 16.5303C9.23744 16.8232 8.76256 16.8232 8.46967 16.5303L4.46967 12.5303C4.17678 12.2374 4.17678 11.7626 4.46967 11.4697L8.46967 7.46967C8.76256 7.17678 9.23744 7.17678 9.53033 7.46967Z" | |
| 1364 | + })); | |
| 1365 | +}); | |
| 1366 | +var _default = ArrowLeftIcon; | |
| 1367 | +exports["default"] = _default; | |
| 1368 | + | |
| 1369 | +/***/ }), | |
| 1370 | + | |
| 1371 | +/***/ "../modules/ai/assets/js/editor/icons/edit-icon.js": | |
| 1372 | +/*!*********************************************************!*\ | |
| 1373 | + !*** ../modules/ai/assets/js/editor/icons/edit-icon.js ***! | |
| 1374 | + \*********************************************************/ | |
| 1375 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 1376 | + | |
| 1377 | +"use strict"; | |
| 1378 | + | |
| 1379 | + | |
| 1380 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 1381 | +Object.defineProperty(exports, "__esModule", ({ | |
| 1382 | + value: true | |
| 1383 | +})); | |
| 1384 | +exports["default"] = void 0; | |
| 1385 | +var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); | |
| 1386 | +var _extends2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/extends */ "../node_modules/@babel/runtime/helpers/extends.js")); | |
| 1387 | +var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); | |
| 1388 | +var EditIcon = _react.default.forwardRef(function (props, ref) { | |
| 1389 | + return /*#__PURE__*/_react.default.createElement(_ui.SvgIcon, (0, _extends2.default)({ | |
| 1390 | + viewBox: "0 0 24 24" | |
| 1391 | + }, props, { | |
| 1392 | + ref: ref | |
| 1393 | + }), /*#__PURE__*/_react.default.createElement("path", { | |
| 1394 | + fillRule: "evenodd", | |
| 1395 | + clipRule: "evenodd", | |
| 1396 | + d: "M13.9697 4.96967C14.6408 4.29858 15.5509 3.92157 16.5 3.92157C17.4491 3.92157 18.3592 4.29858 19.0303 4.96967C19.7014 5.64075 20.0784 6.55094 20.0784 7.5C20.0784 8.44905 19.7014 9.35924 19.0303 10.0303L8.53033 20.5303C8.38968 20.671 8.19891 20.75 8 20.75H4C3.58579 20.75 3.25 20.4142 3.25 20V16C3.25 15.8011 3.32902 15.6103 3.46967 15.4697L13.9697 4.96967ZM16.5 5.42157C15.9488 5.42157 15.4201 5.64055 15.0303 6.03033L4.75 16.3107V19.25H7.68934L17.9697 8.96967C18.3595 8.57989 18.5784 8.05123 18.5784 7.5C18.5784 6.94876 18.3595 6.42011 17.9697 6.03033C17.5799 5.64055 17.0512 5.42157 16.5 5.42157Z" | |
| 1397 | + }), /*#__PURE__*/_react.default.createElement("path", { | |
| 1398 | + fillRule: "evenodd", | |
| 1399 | + clipRule: "evenodd", | |
| 1400 | + d: "M12.9697 5.96967C13.2626 5.67677 13.7374 5.67677 14.0303 5.96967L18.0303 9.96967C18.3232 10.2626 18.3232 10.7374 18.0303 11.0303C17.7374 11.3232 17.2626 11.3232 16.9697 11.0303L12.9697 7.03033C12.6768 6.73743 12.6768 6.26256 12.9697 5.96967Z" | |
| 1401 | + })); | |
| 1402 | +}); | |
| 1403 | +var _default = EditIcon; | |
| 1404 | +exports["default"] = _default; | |
| 1405 | + | |
| 1406 | +/***/ }), | |
| 1407 | + | |
| 1408 | +/***/ "../modules/ai/assets/js/editor/icons/expand-diagonal-icon.js": | |
| 1409 | +/*!********************************************************************!*\ | |
| 1410 | + !*** ../modules/ai/assets/js/editor/icons/expand-diagonal-icon.js ***! | |
| 1411 | + \********************************************************************/ | |
| 1412 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 1413 | + | |
| 1414 | +"use strict"; | |
| 1415 | + | |
| 1416 | + | |
| 1417 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 1418 | +Object.defineProperty(exports, "__esModule", ({ | |
| 1419 | + value: true | |
| 1420 | +})); | |
| 1421 | +exports["default"] = void 0; | |
| 1422 | +var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); | |
| 1423 | +var _extends2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/extends */ "../node_modules/@babel/runtime/helpers/extends.js")); | |
| 1424 | +var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); | |
| 1425 | +var ExpandDiagonalIcon = _react.default.forwardRef(function (props, ref) { | |
| 1426 | + return /*#__PURE__*/_react.default.createElement(_ui.SvgIcon, (0, _extends2.default)({ | |
| 1427 | + viewBox: "0 0 24 24" | |
| 1428 | + }, props, { | |
| 1429 | + ref: ref | |
| 1430 | + }), /*#__PURE__*/_react.default.createElement("path", { | |
| 1431 | + fillRule: "evenodd", | |
| 1432 | + clipRule: "evenodd", | |
| 1433 | + d: "M4 3.25H8C8.41421 3.25 8.75 3.58579 8.75 4C8.75 4.41421 8.41421 4.75 8 4.75H5.81066L10.5303 9.46967C10.8232 9.76256 10.8232 10.2374 10.5303 10.5303C10.2374 10.8232 9.76256 10.8232 9.46967 10.5303L4.75 5.81066V8C4.75 8.41421 4.41421 8.75 4 8.75C3.58579 8.75 3.25 8.41421 3.25 8V4C3.25 3.58579 3.58579 3.25 4 3.25ZM13.4697 13.4697C13.7626 13.1768 14.2374 13.1768 14.5303 13.4697L19.25 18.1893V16C19.25 15.5858 19.5858 15.25 20 15.25C20.4142 15.25 20.75 15.5858 20.75 16V20C20.75 20.4142 20.4142 20.75 20 20.75H16C15.5858 20.75 15.25 20.4142 15.25 20C15.25 19.5858 15.5858 19.25 16 19.25H18.1893L13.4697 14.5303C13.1768 14.2374 13.1768 13.7626 13.4697 13.4697Z" | |
| 1434 | + })); | |
| 1435 | +}); | |
| 1436 | +var _default = ExpandDiagonalIcon; | |
| 1437 | +exports["default"] = _default; | |
| 1438 | + | |
| 1439 | +/***/ }), | |
| 1440 | + | |
| 1441 | +/***/ "../modules/ai/assets/js/editor/icons/minimize-diagonal-icon.js": | |
| 1442 | +/*!**********************************************************************!*\ | |
| 1443 | + !*** ../modules/ai/assets/js/editor/icons/minimize-diagonal-icon.js ***! | |
| 1444 | + \**********************************************************************/ | |
| 1445 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 1446 | + | |
| 1447 | +"use strict"; | |
| 1448 | + | |
| 1449 | + | |
| 1450 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 1451 | +Object.defineProperty(exports, "__esModule", ({ | |
| 1452 | + value: true | |
| 1453 | +})); | |
| 1454 | +exports["default"] = void 0; | |
| 1455 | +var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); | |
| 1456 | +var _extends2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/extends */ "../node_modules/@babel/runtime/helpers/extends.js")); | |
| 1457 | +var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); | |
| 1458 | +var MinimizeDiagonalIcon = _react.default.forwardRef(function (props, ref) { | |
| 1459 | + return /*#__PURE__*/_react.default.createElement(_ui.SvgIcon, (0, _extends2.default)({ | |
| 1460 | + viewBox: "0 0 24 24" | |
| 1461 | + }, props, { | |
| 1462 | + ref: ref | |
| 1463 | + }), /*#__PURE__*/_react.default.createElement("path", { | |
| 1464 | + fillRule: "evenodd", | |
| 1465 | + clipRule: "evenodd", | |
| 1466 | + d: "M3.46967 3.46967C3.76256 3.17678 4.23744 3.17678 4.53033 3.46967L9.25 8.18934V6C9.25 5.58579 9.58579 5.25 10 5.25C10.4142 5.25 10.75 5.58579 10.75 6V10C10.75 10.4142 10.4142 10.75 10 10.75H6C5.58579 10.75 5.25 10.4142 5.25 10C5.25 9.58579 5.58579 9.25 6 9.25H8.18934L3.46967 4.53033C3.17678 4.23744 3.17678 3.76256 3.46967 3.46967ZM14 13.25H18C18.4142 13.25 18.75 13.5858 18.75 14C18.75 14.4142 18.4142 14.75 18 14.75H15.8107L20.5303 19.4697C20.8232 19.7626 20.8232 20.2374 20.5303 20.5303C20.2374 20.8232 19.7626 20.8232 19.4697 20.5303L14.75 15.8107V18C14.75 18.4142 14.4142 18.75 14 18.75C13.5858 18.75 13.25 18.4142 13.25 18V14C13.25 13.5858 13.5858 13.25 14 13.25Z" | |
| 1467 | + })); | |
| 1468 | +}); | |
| 1469 | +var _default = MinimizeDiagonalIcon; | |
| 1470 | +exports["default"] = _default; | |
| 1471 | + | |
| 1472 | +/***/ }), | |
| 1473 | + | |
| 1474 | +/***/ "../modules/ai/assets/js/editor/icons/refresh-icon.js": | |
| 1475 | +/*!************************************************************!*\ | |
| 1476 | + !*** ../modules/ai/assets/js/editor/icons/refresh-icon.js ***! | |
| 1477 | + \************************************************************/ | |
| 1478 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 1479 | + | |
| 1480 | +"use strict"; | |
| 1481 | + | |
| 1482 | + | |
| 1483 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 1484 | +Object.defineProperty(exports, "__esModule", ({ | |
| 1485 | + value: true | |
| 1486 | +})); | |
| 1487 | +exports["default"] = void 0; | |
| 1488 | +var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); | |
| 1489 | +var _extends2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/extends */ "../node_modules/@babel/runtime/helpers/extends.js")); | |
| 1490 | +var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); | |
| 1491 | +var RefreshIcon = _react.default.forwardRef(function (props, ref) { | |
| 1492 | + return /*#__PURE__*/_react.default.createElement(_ui.SvgIcon, (0, _extends2.default)({ | |
| 1493 | + viewBox: "0 0 24 24" | |
| 1494 | + }, props, { | |
| 1495 | + ref: ref | |
| 1496 | + }), /*#__PURE__*/_react.default.createElement("path", { | |
| 1497 | + fillRule: "evenodd", | |
| 1498 | + clipRule: "evenodd", | |
| 1499 | + d: "M7.55012 4.45178C9.23098 3.48072 11.1845 3.08925 13.1097 3.33767C15.035 3.58609 16.8251 4.46061 18.2045 5.82653C19.5838 7.19245 20.4757 8.97399 20.743 10.8967C20.8 11.307 20.5136 11.6858 20.1033 11.7428C19.6931 11.7998 19.3142 11.5135 19.2572 11.1032C19.0353 9.50635 18.2945 8.02677 17.149 6.89236C16.0035 5.75795 14.5167 5.03165 12.9178 4.82534C11.3189 4.61902 9.69644 4.94414 8.30047 5.75061C7.24361 6.36117 6.36093 7.22198 5.72541 8.24995H8.00009C8.41431 8.24995 8.75009 8.58574 8.75009 8.99995C8.75009 9.41417 8.41431 9.74995 8.00009 9.74995H4.51686C4.5055 9.75021 4.49412 9.75021 4.48272 9.74995H4.00009C3.58588 9.74995 3.25009 9.41417 3.25009 8.99995V4.99995C3.25009 4.58574 3.58588 4.24995 4.00009 4.24995C4.41431 4.24995 4.75009 4.58574 4.75009 4.99995V7.00691C5.48358 5.96916 6.43655 5.0951 7.55012 4.45178Z" | |
| 1500 | + }), /*#__PURE__*/_react.default.createElement("path", { | |
| 1501 | + fillRule: "evenodd", | |
| 1502 | + clipRule: "evenodd", | |
| 1503 | + d: "M3.89686 12.2571C4.30713 12.2001 4.68594 12.4864 4.74295 12.8967C4.96487 14.4936 5.70565 15.9731 6.85119 17.1075C7.99673 18.242 9.48347 18.9683 11.0824 19.1746C12.6813 19.3809 14.3037 19.0558 15.6997 18.2493C16.7566 17.6387 17.6393 16.7779 18.2748 15.75H16.0001C15.5859 15.75 15.2501 15.4142 15.2501 15C15.2501 14.5857 15.5859 14.25 16.0001 14.25H19.4833C19.4947 14.2497 19.5061 14.2497 19.5175 14.25H20.0001C20.4143 14.25 20.7501 14.5857 20.7501 15V19C20.7501 19.4142 20.4143 19.75 20.0001 19.75C19.5859 19.75 19.2501 19.4142 19.2501 19V16.993C18.5166 18.0307 17.5636 18.9048 16.4501 19.5481C14.7692 20.5192 12.8157 20.9107 10.8904 20.6622C8.9652 20.4138 7.17504 19.5393 5.79572 18.1734C4.4164 16.8074 3.52443 15.0259 3.25723 13.1032C3.20022 12.6929 3.48658 12.3141 3.89686 12.2571Z" | |
| 1504 | + })); | |
| 1505 | +}); | |
| 1506 | +var _default = RefreshIcon; | |
| 1507 | +exports["default"] = _default; | |
| 1508 | + | |
| 1509 | +/***/ }), | |
| 1510 | + | |
| 1511 | +/***/ "../modules/ai/assets/js/editor/icons/wand-icon.js": | |
| 1512 | +/*!*********************************************************!*\ | |
| 1513 | + !*** ../modules/ai/assets/js/editor/icons/wand-icon.js ***! | |
| 1514 | + \*********************************************************/ | |
| 1515 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 1516 | + | |
| 1517 | +"use strict"; | |
| 1518 | + | |
| 1519 | + | |
| 1520 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 1521 | +Object.defineProperty(exports, "__esModule", ({ | |
| 1522 | + value: true | |
| 1523 | +})); | |
| 1524 | +exports["default"] = void 0; | |
| 1525 | +var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); | |
| 1526 | +var _extends2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/extends */ "../node_modules/@babel/runtime/helpers/extends.js")); | |
| 1527 | +var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); | |
| 1528 | +var WandIcon = _react.default.forwardRef(function (props, ref) { | |
| 1529 | + return /*#__PURE__*/_react.default.createElement(_ui.SvgIcon, (0, _extends2.default)({ | |
| 1530 | + viewBox: "0 0 24 24" | |
| 1531 | + }, props, { | |
| 1532 | + ref: ref | |
| 1533 | + }), /*#__PURE__*/_react.default.createElement("path", { | |
| 1534 | + fillRule: "evenodd", | |
| 1535 | + clipRule: "evenodd", | |
| 1536 | + d: "M9 2.25C9.41421 2.25 9.75 2.58579 9.75 3C9.75 3.33152 9.8817 3.64946 10.1161 3.88388C10.3505 4.1183 10.6685 4.25 11 4.25C11.4142 4.25 11.75 4.58579 11.75 5C11.75 5.41421 11.4142 5.75 11 5.75C10.6685 5.75 10.3505 5.8817 10.1161 6.11612C9.8817 6.35054 9.75 6.66848 9.75 7C9.75 7.41421 9.41421 7.75 9 7.75C8.58579 7.75 8.25 7.41421 8.25 7C8.25 6.66848 8.1183 6.35054 7.88388 6.11612C7.64946 5.8817 7.33152 5.75 7 5.75C6.58579 5.75 6.25 5.41421 6.25 5C6.25 4.58579 6.58579 4.25 7 4.25C7.33152 4.25 7.64946 4.1183 7.88388 3.88388C8.1183 3.64946 8.25 3.33152 8.25 3C8.25 2.58579 8.58579 2.25 9 2.25ZM9 4.88746C8.98182 4.90673 8.96333 4.92576 8.94454 4.94454C8.92576 4.96333 8.90673 4.98182 8.88746 5C8.90673 5.01818 8.92576 5.03667 8.94454 5.05546C8.96333 5.07424 8.98182 5.09327 9 5.11254C9.01818 5.09327 9.03667 5.07424 9.05546 5.05546C9.07424 5.03667 9.09327 5.01818 9.11254 5C9.09327 4.98182 9.07424 4.96333 9.05546 4.94454C9.03667 4.92576 9.01818 4.90673 9 4.88746Z" | |
| 1537 | + }), /*#__PURE__*/_react.default.createElement("path", { | |
| 1538 | + fillRule: "evenodd", | |
| 1539 | + clipRule: "evenodd", | |
| 1540 | + d: "M18.5303 2.46967C18.2374 2.17678 17.7626 2.17678 17.4697 2.46967L2.46967 17.4697C2.17678 17.7626 2.17678 18.2374 2.46967 18.5303L5.46967 21.5303C5.76256 21.8232 6.23744 21.8232 6.53033 21.5303L21.5303 6.53033C21.8232 6.23744 21.8232 5.76256 21.5303 5.46967L18.5303 2.46967ZM18 7.93934L19.9393 6L18 4.06066L16.0607 6L18 7.93934ZM15 7.06066L16.9393 9L6 19.9393L4.06066 18L15 7.06066Z" | |
| 1541 | + }), /*#__PURE__*/_react.default.createElement("path", { | |
| 1542 | + fillRule: "evenodd", | |
| 1543 | + clipRule: "evenodd", | |
| 1544 | + d: "M19.75 13C19.75 12.5858 19.4142 12.25 19 12.25C18.5858 12.25 18.25 12.5858 18.25 13C18.25 13.3315 18.1183 13.6495 17.8839 13.8839C17.6495 14.1183 17.3315 14.25 17 14.25C16.5858 14.25 16.25 14.5858 16.25 15C16.25 15.4142 16.5858 15.75 17 15.75C17.3315 15.75 17.6495 15.8817 17.8839 16.1161C18.1183 16.3505 18.25 16.6685 18.25 17C18.25 17.4142 18.5858 17.75 19 17.75C19.4142 17.75 19.75 17.4142 19.75 17C19.75 16.6685 19.8817 16.3505 20.1161 16.1161C20.3505 15.8817 20.6685 15.75 21 15.75C21.4142 15.75 21.75 15.4142 21.75 15C21.75 14.5858 21.4142 14.25 21 14.25C20.6685 14.25 20.3505 14.1183 20.1161 13.8839C19.8817 13.6495 19.75 13.3315 19.75 13ZM18.9445 14.9445C18.9633 14.9258 18.9818 14.9067 19 14.8875C19.0182 14.9067 19.0367 14.9258 19.0555 14.9445C19.0742 14.9633 19.0933 14.9818 19.1125 15C19.0933 15.0182 19.0742 15.0367 19.0555 15.0555C19.0367 15.0742 19.0182 15.0933 19 15.1125C18.9818 15.0933 18.9633 15.0742 18.9445 15.0555C18.9258 15.0367 18.9067 15.0182 18.8875 15C18.9067 14.9818 18.9258 14.9633 18.9445 14.9445Z" | |
| 1545 | + })); | |
| 1546 | +}); | |
| 1547 | +var _default = WandIcon; | |
| 1548 | +exports["default"] = _default; | |
| 1549 | + | |
| 1550 | +/***/ }), | |
| 1551 | + | |
| 1552 | +/***/ "../modules/ai/assets/js/editor/layout-app.js": | |
| 1553 | +/*!****************************************************!*\ | |
| 1554 | + !*** ../modules/ai/assets/js/editor/layout-app.js ***! | |
| 1555 | + \****************************************************/ | |
| 1556 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 1557 | + | |
| 1558 | +"use strict"; | |
| 1559 | +/* provided dependency */ var PropTypes = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js"); | |
| 1560 | + | |
| 1561 | + | |
| 1562 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 1563 | +Object.defineProperty(exports, "__esModule", ({ | |
| 1564 | + value: true | |
| 1565 | +})); | |
| 1566 | +exports["default"] = void 0; | |
| 1567 | +var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); | |
| 1568 | +var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); | |
| 1569 | +var _layoutContent = _interopRequireDefault(__webpack_require__(/*! ./layout-content */ "../modules/ai/assets/js/editor/layout-content.js")); | |
| 1570 | +var LayoutApp = function LayoutApp(_ref) { | |
| 1571 | + var isRTL = _ref.isRTL, | |
| 1572 | + colorScheme = _ref.colorScheme, | |
| 1573 | + onClose = _ref.onClose, | |
| 1574 | + onConnect = _ref.onConnect, | |
| 1575 | + onData = _ref.onData, | |
| 1576 | + onInsert = _ref.onInsert, | |
| 1577 | + onSelect = _ref.onSelect, | |
| 1578 | + onGenerate = _ref.onGenerate; | |
| 1579 | + return /*#__PURE__*/_react.default.createElement(_ui.DirectionProvider, { | |
| 1580 | + rtl: isRTL | |
| 1581 | + }, /*#__PURE__*/_react.default.createElement(_ui.ThemeProvider, { | |
| 1582 | + colorScheme: colorScheme | |
| 1583 | + }, /*#__PURE__*/_react.default.createElement(_layoutContent.default, { | |
| 1584 | + onClose: onClose, | |
| 1585 | + onConnect: onConnect, | |
| 1586 | + onData: onData, | |
| 1587 | + onInsert: onInsert, | |
| 1588 | + onSelect: onSelect, | |
| 1589 | + onGenerate: onGenerate | |
| 1590 | + }))); | |
| 1591 | +}; | |
| 1592 | +LayoutApp.propTypes = { | |
| 1593 | + colorScheme: PropTypes.oneOf(['auto', 'light', 'dark']), | |
| 1594 | + isRTL: PropTypes.bool, | |
| 1595 | + onClose: PropTypes.func.isRequired, | |
| 1596 | + onConnect: PropTypes.func.isRequired, | |
| 1597 | + onData: PropTypes.func.isRequired, | |
| 1598 | + onInsert: PropTypes.func.isRequired, | |
| 1599 | + onSelect: PropTypes.func.isRequired, | |
| 1600 | + onGenerate: PropTypes.func.isRequired | |
| 1601 | +}; | |
| 1602 | +var _default = LayoutApp; | |
| 1603 | +exports["default"] = _default; | |
| 1604 | + | |
| 1605 | +/***/ }), | |
| 1606 | + | |
| 1607 | +/***/ "../modules/ai/assets/js/editor/layout-content.js": | |
| 1608 | +/*!********************************************************!*\ | |
| 1609 | + !*** ../modules/ai/assets/js/editor/layout-content.js ***! | |
| 1610 | + \********************************************************/ | |
| 1611 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 1612 | + | |
| 1613 | +"use strict"; | |
| 1614 | +/* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"]; | |
| 1615 | +/* provided dependency */ var PropTypes = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js"); | |
| 1616 | + | |
| 1617 | + | |
| 1618 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 1619 | +Object.defineProperty(exports, "__esModule", ({ | |
| 1620 | + value: true | |
| 1621 | +})); | |
| 1622 | +exports["default"] = void 0; | |
| 1623 | +var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); | |
| 1624 | +var _connect = _interopRequireDefault(__webpack_require__(/*! ./pages/connect */ "../modules/ai/assets/js/editor/pages/connect/index.js")); | |
| 1625 | +var _formLayout = _interopRequireDefault(__webpack_require__(/*! ./pages/form-layout */ "../modules/ai/assets/js/editor/pages/form-layout/index.js")); | |
| 1626 | +var _getStarted = _interopRequireDefault(__webpack_require__(/*! ./pages/get-started */ "../modules/ai/assets/js/editor/pages/get-started/index.js")); | |
| 1627 | +var _loader = _interopRequireDefault(__webpack_require__(/*! ./components/loader */ "../modules/ai/assets/js/editor/components/loader.js")); | |
| 1628 | +var _upgradeChip = _interopRequireDefault(__webpack_require__(/*! ./components/upgrade-chip */ "../modules/ai/assets/js/editor/components/upgrade-chip.js")); | |
| 1629 | +var _useUserInfo2 = _interopRequireDefault(__webpack_require__(/*! ./hooks/use-user-info */ "../modules/ai/assets/js/editor/hooks/use-user-info.js")); | |
| 1630 | +var _wizardDialog = _interopRequireDefault(__webpack_require__(/*! ./components/wizard-dialog */ "../modules/ai/assets/js/editor/components/wizard-dialog.js")); | |
| 1631 | +var _layoutDialog = _interopRequireDefault(__webpack_require__(/*! ./pages/form-layout/components/layout-dialog */ "../modules/ai/assets/js/editor/pages/form-layout/components/layout-dialog.js")); | |
| 1632 | +var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); | |
| 1633 | +var _useIntroduction2 = _interopRequireDefault(__webpack_require__(/*! ./hooks/use-introduction */ "../modules/ai/assets/js/editor/hooks/use-introduction.js")); | |
| 1634 | +var LayoutContent = function LayoutContent(_ref) { | |
| 1635 | + var onClose = _ref.onClose, | |
| 1636 | + onConnect = _ref.onConnect, | |
| 1637 | + onData = _ref.onData, | |
| 1638 | + onInsert = _ref.onInsert, | |
| 1639 | + onSelect = _ref.onSelect, | |
| 1640 | + onGenerate = _ref.onGenerate; | |
| 1641 | + var _useUserInfo = (0, _useUserInfo2.default)(), | |
| 1642 | + isLoading = _useUserInfo.isLoading, | |
| 1643 | + isConnected = _useUserInfo.isConnected, | |
| 1644 | + isGetStarted = _useUserInfo.isGetStarted, | |
| 1645 | + connectUrl = _useUserInfo.connectUrl, | |
| 1646 | + fetchData = _useUserInfo.fetchData, | |
| 1647 | + hasSubscription = _useUserInfo.hasSubscription, | |
| 1648 | + credits = _useUserInfo.credits, | |
| 1649 | + usagePercentage = _useUserInfo.usagePercentage; | |
| 1650 | + var _useIntroduction = (0, _useIntroduction2.default)('e-ai-builder-coming-soon-info'), | |
| 1651 | + isViewed = _useIntroduction.isViewed, | |
| 1652 | + markAsViewed = _useIntroduction.markAsViewed; | |
| 1653 | + if (isLoading) { | |
| 1654 | + return /*#__PURE__*/_react.default.createElement(_layoutDialog.default, { | |
| 1655 | + onClose: onClose | |
| 1656 | + }, /*#__PURE__*/_react.default.createElement(_layoutDialog.default.Header, { | |
| 1657 | + onClose: onClose | |
| 1658 | + }), /*#__PURE__*/_react.default.createElement(_layoutDialog.default.Content, { | |
| 1659 | + dividers: true | |
| 1660 | + }, /*#__PURE__*/_react.default.createElement(_loader.default, { | |
| 1661 | + BoxProps: { | |
| 1662 | + sx: { | |
| 1663 | + px: 3 | |
| 1664 | + } | |
| 1665 | + } | |
| 1666 | + }))); | |
| 1667 | + } | |
| 1668 | + if (!isConnected) { | |
| 1669 | + return /*#__PURE__*/_react.default.createElement(_wizardDialog.default, { | |
| 1670 | + onClose: onClose | |
| 1671 | + }, /*#__PURE__*/_react.default.createElement(_layoutDialog.default, { | |
| 1672 | + onClose: onClose | |
| 1673 | + }), /*#__PURE__*/_react.default.createElement(_wizardDialog.default.Content, { | |
| 1674 | + dividers: true | |
| 1675 | + }, /*#__PURE__*/_react.default.createElement(_connect.default, { | |
| 1676 | + connectUrl: connectUrl, | |
| 1677 | + onSuccess: function onSuccess(data) { | |
| 1678 | + onConnect(data); | |
| 1679 | + fetchData(); | |
| 1680 | + } | |
| 1681 | + }))); | |
| 1682 | + } | |
| 1683 | + if (!isGetStarted) { | |
| 1684 | + return /*#__PURE__*/_react.default.createElement(_wizardDialog.default, { | |
| 1685 | + onClose: onClose | |
| 1686 | + }, /*#__PURE__*/_react.default.createElement(_layoutDialog.default, { | |
| 1687 | + onClose: onClose | |
| 1688 | + }), /*#__PURE__*/_react.default.createElement(_wizardDialog.default.Content, { | |
| 1689 | + dividers: true | |
| 1690 | + }, /*#__PURE__*/_react.default.createElement(_getStarted.default, { | |
| 1691 | + onSuccess: fetchData | |
| 1692 | + }))); | |
| 1693 | + } | |
| 1694 | + var showUpgradeChip = !hasSubscription || 80 <= usagePercentage; | |
| 1695 | + return /*#__PURE__*/_react.default.createElement(_formLayout.default, { | |
| 1696 | + credits: credits, | |
| 1697 | + onClose: onClose, | |
| 1698 | + onInsert: onInsert, | |
| 1699 | + onData: onData, | |
| 1700 | + onSelect: onSelect, | |
| 1701 | + onGenerate: onGenerate, | |
| 1702 | + DialogHeaderProps: { | |
| 1703 | + children: showUpgradeChip && /*#__PURE__*/_react.default.createElement(_upgradeChip.default, { | |
| 1704 | + hasSubscription: hasSubscription, | |
| 1705 | + usagePercentage: usagePercentage | |
| 1706 | + }) | |
| 1707 | + }, | |
| 1708 | + DialogContentProps: { | |
| 1709 | + children: !isViewed && /*#__PURE__*/_react.default.createElement(_ui.Alert, { | |
| 1710 | + severity: "info", | |
| 1711 | + onClose: markAsViewed | |
| 1712 | + }, __("Layouts generated with AI only include some Elementor widgets, but we're evolving! More capabilities coming soon...", 'elementor')) | |
| 1713 | + } | |
| 1714 | + }); | |
| 1715 | +}; | |
| 1716 | +LayoutContent.propTypes = { | |
| 1717 | + onClose: PropTypes.func.isRequired, | |
| 1718 | + onConnect: PropTypes.func.isRequired, | |
| 1719 | + onData: PropTypes.func.isRequired, | |
| 1720 | + onInsert: PropTypes.func.isRequired, | |
| 1721 | + onSelect: PropTypes.func.isRequired, | |
| 1722 | + onGenerate: PropTypes.func.isRequired | |
| 1723 | +}; | |
| 1724 | +var _default = LayoutContent; | |
| 1725 | +exports["default"] = _default; | |
| 1726 | + | |
| 1727 | +/***/ }), | |
| 1728 | + | |
| 1729 | +/***/ "../modules/ai/assets/js/editor/pages/connect/index.js": | |
| 1730 | +/*!*************************************************************!*\ | |
| 1731 | + !*** ../modules/ai/assets/js/editor/pages/connect/index.js ***! | |
| 1732 | + \*************************************************************/ | |
| 1733 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 1734 | + | |
| 1735 | +"use strict"; | |
| 1736 | +/* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"]; | |
| 1737 | +/* provided dependency */ var PropTypes = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js"); | |
| 1738 | + | |
| 1739 | + | |
| 1740 | +var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js"); | |
| 1741 | +Object.defineProperty(exports, "__esModule", ({ | |
| 1742 | + value: true | |
| 1743 | +})); | |
| 1744 | +exports["default"] = void 0; | |
| 1745 | +var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); | |
| 1746 | +var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); | |
| 1747 | +var _icons = __webpack_require__(/*! @elementor/icons */ "@elementor/icons"); | |
| 1748 | +function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | |
| 1749 | +function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | |
| 1750 | +var Connect = function Connect(_ref) { | |
| 1751 | + var connectUrl = _ref.connectUrl, | |
| 1752 | + onSuccess = _ref.onSuccess; | |
| 1753 | + var approveButtonRef = (0, _react.useRef)(); | |
| 1754 | + (0, _react.useEffect)(function () { | |
| 1755 | + jQuery(approveButtonRef.current).elementorConnect({ | |
| 1756 | + success: function success(_, data) { | |
| 1757 | + return onSuccess(data); | |
| 1758 | + }, | |
| 1759 | + error: function error() { | |
| 1760 | + throw new Error('Elementor AI: Failed to connect.'); | |
| 1761 | + } | |
| 1762 | + }); | |
| 1763 | + }, []); | |
| 1764 | + return /*#__PURE__*/_react.default.createElement(_ui.Stack, { | |
| 1765 | + alignItems: "center", | |
| 1766 | + gap: 2 | |
| 1767 | + }, /*#__PURE__*/_react.default.createElement(_icons.AIIcon, { | |
| 1768 | + sx: { | |
| 1769 | + color: 'text.primary', | |
| 1770 | + fontSize: '60px', | |
| 1771 | + mb: 1 | |
| 1772 | + } | |
| 1773 | + }), /*#__PURE__*/_react.default.createElement(_ui.Typography, { | |
| 1774 | + variant: "h4", | |
| 1775 | + sx: { | |
| 1776 | + color: 'text.primary' | |
| 1777 | + } | |
| 1778 | + }, __('Step into the future with Elementor AI', 'elementor')), /*#__PURE__*/_react.default.createElement(_ui.Typography, { | |
| 1779 | + variant: "body2" | |
| 1780 | + }, __('Create smarter with AI text and code generators built right into the editor.', 'elementor')), /*#__PURE__*/_react.default.createElement(_ui.Typography, { | |
| 1781 | + variant: "caption", | |
| 1782 | + sx: { | |
| 1783 | + maxWidth: 520, | |
| 1784 | + textAlign: 'center' | |
| 1785 | + } | |
| 1786 | + }, __('By clicking "Connect", I approve the ', 'elementor'), /*#__PURE__*/_react.default.createElement(_ui.Link, { | |
| 1787 | + href: "https://go.elementor.com/ai-terms/", | |
| 1788 | + target: "_blank", | |
| 1789 | + color: "info.main" | |
| 1790 | + }, __('Terms of Service', 'elementor')), ' & ', /*#__PURE__*/_react.default.createElement(_ui.Link, { | |
| 1791 | + href: "https://go.elementor.com/ai-privacy-policy/", | |
| 1792 | + target: "_blank", | |
| 1793 | + color: "info.main" | |
| 1794 | + }, __('Privacy Policy', 'elementor')), __(' of the Elementor AI service.', 'elementor')), /*#__PURE__*/_react.default.createElement(_ui.Button, { | |
| 1795 | + ref: approveButtonRef, | |
| 1796 | + href: connectUrl, | |
| 1797 | + variant: "contained", | |
| 1798 | + sx: { | |
| 1799 | + mt: 1, | |
| 1800 | + '&:hover': { | |
| 1801 | + color: 'primary.contrastText' | |
| 1802 | + } | |
| 1803 | + } | |
| 1804 | + }, __('Connect', 'elementor'))); | |
| 1805 | +}; | |
| 1806 | +Connect.propTypes = { | |
| 1807 | + connectUrl: PropTypes.string.isRequired, | |
| 1808 | + onSuccess: PropTypes.func.isRequired | |
| 1809 | +}; | |
| 1810 | +var _default = Connect; | |
| 1811 | +exports["default"] = _default; | |
| 1812 | + | |
| 1813 | +/***/ }), | |
| 1814 | + | |
| 1815 | +/***/ "../modules/ai/assets/js/editor/pages/form-layout/components/layout-dialog.js": | |
| 1816 | +/*!************************************************************************************!*\ | |
| 1817 | + !*** ../modules/ai/assets/js/editor/pages/form-layout/components/layout-dialog.js ***! | |
| 1818 | + \************************************************************************************/ | |
| 1819 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 1820 | + | |
| 1821 | +"use strict"; | |
| 1822 | +/* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"]; | |
| 1823 | +/* provided dependency */ var PropTypes = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js"); | |
| 1824 | + | |
| 1825 | + | |
| 1826 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 1827 | +var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js"); | |
| 1828 | +Object.defineProperty(exports, "__esModule", ({ | |
| 1829 | + value: true | |
| 1830 | +})); | |
| 1831 | +exports["default"] = void 0; | |
| 1832 | +var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); | |
| 1833 | +var _extends2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/extends */ "../node_modules/@babel/runtime/helpers/extends.js")); | |
| 1834 | +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js")); | |
| 1835 | +var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js")); | |
| 1836 | +var _objectWithoutProperties2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/objectWithoutProperties */ "../node_modules/@babel/runtime/helpers/objectWithoutProperties.js")); | |
| 1837 | +var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); | |
| 1838 | +var _promptDialog = _interopRequireDefault(__webpack_require__(/*! ../../../components/prompt-dialog */ "../modules/ai/assets/js/editor/components/prompt-dialog.js")); | |
| 1839 | +var _icons = __webpack_require__(/*! @elementor/icons */ "@elementor/icons"); | |
| 1840 | +var _excluded = ["sx", "PaperProps"]; | |
| 1841 | +function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | |
| 1842 | +function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | |
| 1843 | +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | |
| 1844 | +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | |
| 1845 | +var StyledDialog = (0, _ui.styled)(_promptDialog.default)(function () { | |
| 1846 | + return { | |
| 1847 | + '& .MuiDialog-container': { | |
| 1848 | + marginTop: 0, | |
| 1849 | + alignItems: 'flex-end', | |
| 1850 | + paddingBottom: '16vh' | |
| 1851 | + }, | |
| 1852 | + '& .MuiPaper-root': { | |
| 1853 | + margin: 0, | |
| 1854 | + maxHeight: '55vh' | |
| 1855 | + } | |
| 1856 | + }; | |
| 1857 | +}); | |
| 1858 | +var DialogHeader = function DialogHeader(_ref) { | |
| 1859 | + var onClose = _ref.onClose, | |
| 1860 | + children = _ref.children; | |
| 1861 | + return /*#__PURE__*/_react.default.createElement(_ui.AppBar, { | |
| 1862 | + sx: { | |
| 1863 | + fontWeight: 'normal' | |
| 1864 | + }, | |
| 1865 | + color: "transparent", | |
| 1866 | + position: "relative" | |
| 1867 | + }, /*#__PURE__*/_react.default.createElement(_ui.Toolbar, { | |
| 1868 | + variant: "dense" | |
| 1869 | + }, /*#__PURE__*/_react.default.createElement(_icons.AIIcon, { | |
| 1870 | + sx: { | |
| 1871 | + mr: 1 | |
| 1872 | + } | |
| 1873 | + }), /*#__PURE__*/_react.default.createElement(_ui.Typography, { | |
| 1874 | + component: "span", | |
| 1875 | + variant: "subtitle2", | |
| 1876 | + sx: { | |
| 1877 | + fontWeight: 'bold', | |
| 1878 | + textTransform: 'uppercase' | |
| 1879 | + } | |
| 1880 | + }, __('AI', 'elementor')), /*#__PURE__*/_react.default.createElement(_ui.Chip, { | |
| 1881 | + label: __('Beta', 'elementor'), | |
| 1882 | + color: "default", | |
| 1883 | + size: "small", | |
| 1884 | + sx: { | |
| 1885 | + ml: 1 | |
| 1886 | + } | |
| 1887 | + }), /*#__PURE__*/_react.default.createElement(_ui.Stack, { | |
| 1888 | + direction: "row", | |
| 1889 | + spacing: 1, | |
| 1890 | + alignItems: "center", | |
| 1891 | + sx: { | |
| 1892 | + ml: 'auto' | |
| 1893 | + } | |
| 1894 | + }, children, /*#__PURE__*/_react.default.createElement(_ui.IconButton, { | |
| 1895 | + size: "small", | |
| 1896 | + "aria-label": "close", | |
| 1897 | + onClick: onClose, | |
| 1898 | + sx: { | |
| 1899 | + '&.MuiButtonBase-root': { | |
| 1900 | + mr: -1 | |
| 1901 | + } | |
| 1902 | + } | |
| 1903 | + }, /*#__PURE__*/_react.default.createElement(_icons.XIcon, null))))); | |
| 1904 | +}; | |
| 1905 | +DialogHeader.propTypes = { | |
| 1906 | + children: PropTypes.node, | |
| 1907 | + onClose: PropTypes.func.isRequired | |
| 1908 | +}; | |
| 1909 | +var StyledDialogContent = (0, _ui.styled)(_promptDialog.default.Content)(function () { | |
| 1910 | + return { | |
| 1911 | + '&.MuiDialogContent-root': { | |
| 1912 | + padding: 0 | |
| 1913 | + } | |
| 1914 | + }; | |
| 1915 | +}); | |
| 1916 | +var LayoutDialog = function LayoutDialog(_ref2) { | |
| 1917 | + var _ref2$sx = _ref2.sx, | |
| 1918 | + sx = _ref2$sx === void 0 ? {} : _ref2$sx, | |
| 1919 | + _ref2$PaperProps = _ref2.PaperProps, | |
| 1920 | + PaperProps = _ref2$PaperProps === void 0 ? {} : _ref2$PaperProps, | |
| 1921 | + props = (0, _objectWithoutProperties2.default)(_ref2, _excluded); | |
| 1922 | + var _useState = (0, _react.useState)({ | |
| 1923 | + pointerEvents: 'none' | |
| 1924 | + }), | |
| 1925 | + _useState2 = (0, _slicedToArray2.default)(_useState, 2), | |
| 1926 | + sxStyle = _useState2[0], | |
| 1927 | + setSxStyle = _useState2[1]; | |
| 1928 | + var timeoutRef = (0, _react.useRef)(null); | |
| 1929 | + | |
| 1930 | + /** | |
| 1931 | + * The PromptDialog is using disableScrollLock in order to allow scrolling the page when the Dialog is opened. | |
| 1932 | + * When using the react-draggable library inside the editor, the background page scroll is not working smoothly. | |
| 1933 | + * Therefore, we need to delay the pointerEvents: none, which allowing to scroll the page content. | |
| 1934 | + */ | |
| 1935 | + return /*#__PURE__*/_react.default.createElement(StyledDialog, (0, _extends2.default)({ | |
| 1936 | + maxWidth: "md", | |
| 1937 | + PaperProps: _objectSpread({ | |
| 1938 | + sx: { | |
| 1939 | + pointerEvents: 'auto' | |
| 1940 | + }, | |
| 1941 | + onMouseEnter: function onMouseEnter() { | |
| 1942 | + clearTimeout(timeoutRef.current); | |
| 1943 | + setSxStyle({ | |
| 1944 | + pointerEvents: 'all' | |
| 1945 | + }); | |
| 1946 | + }, | |
| 1947 | + onMouseLeave: function onMouseLeave() { | |
| 1948 | + clearTimeout(timeoutRef.current); | |
| 1949 | + timeoutRef.current = setTimeout(function () { | |
| 1950 | + setSxStyle({ | |
| 1951 | + pointerEvents: 'none' | |
| 1952 | + }); | |
| 1953 | + }, 200); | |
| 1954 | + } | |
| 1955 | + }, PaperProps) | |
| 1956 | + }, props, { | |
| 1957 | + sx: _objectSpread(_objectSpread({}, sxStyle), sx) | |
| 1958 | + })); | |
| 1959 | +}; | |
| 1960 | +LayoutDialog.propTypes = { | |
| 1961 | + sx: PropTypes.object, | |
| 1962 | + PaperProps: PropTypes.object | |
| 1963 | +}; | |
| 1964 | +LayoutDialog.Header = DialogHeader; | |
| 1965 | +LayoutDialog.Content = StyledDialogContent; | |
| 1966 | +var _default = LayoutDialog; | |
| 1967 | +exports["default"] = _default; | |
| 1968 | + | |
| 1969 | +/***/ }), | |
| 1970 | + | |
| 1971 | +/***/ "../modules/ai/assets/js/editor/pages/form-layout/components/prompt-autocomplete.js": | |
| 1972 | +/*!******************************************************************************************!*\ | |
| 1973 | + !*** ../modules/ai/assets/js/editor/pages/form-layout/components/prompt-autocomplete.js ***! | |
| 1974 | + \******************************************************************************************/ | |
| 1975 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 1976 | + | |
| 1977 | +"use strict"; | |
| 1978 | +/* provided dependency */ var PropTypes = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js"); | |
| 1979 | + | |
| 1980 | + | |
| 1981 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 1982 | +var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js"); | |
| 1983 | +Object.defineProperty(exports, "__esModule", ({ | |
| 1984 | + value: true | |
| 1985 | +})); | |
| 1986 | +exports["default"] = void 0; | |
| 1987 | +var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); | |
| 1988 | +var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js")); | |
| 1989 | +var _objectWithoutProperties2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/objectWithoutProperties */ "../node_modules/@babel/runtime/helpers/objectWithoutProperties.js")); | |
| 1990 | +var _extends2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/extends */ "../node_modules/@babel/runtime/helpers/extends.js")); | |
| 1991 | +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js")); | |
| 1992 | +var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); | |
| 1993 | +var _excluded = ["onSubmit"]; | |
| 1994 | +function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | |
| 1995 | +function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | |
| 1996 | +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | |
| 1997 | +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | |
| 1998 | +var TextInput = (0, _react.forwardRef)(function (props, ref) { | |
| 1999 | + return /*#__PURE__*/_react.default.createElement(_ui.TextField | |
| 2000 | + // eslint-disable-next-line jsx-a11y/no-autofocus | |
| 2001 | + , (0, _extends2.default)({ | |
| 2002 | + autoFocus: true, | |
| 2003 | + multiline: true, | |
| 2004 | + size: "small", | |
| 2005 | + maxRows: 3, | |
| 2006 | + color: "secondary", | |
| 2007 | + variant: "standard" | |
| 2008 | + }, props, { | |
| 2009 | + inputRef: ref, | |
| 2010 | + InputProps: _objectSpread(_objectSpread({}, props.InputProps), {}, { | |
| 2011 | + type: 'search' | |
| 2012 | + }) | |
| 2013 | + })); | |
| 2014 | +}); | |
| 2015 | +TextInput.propTypes = { | |
| 2016 | + InputProps: PropTypes.object | |
| 2017 | +}; | |
| 2018 | +var PromptAutocomplete = function PromptAutocomplete(_ref) { | |
| 2019 | + var onSubmit = _ref.onSubmit, | |
| 2020 | + props = (0, _objectWithoutProperties2.default)(_ref, _excluded); | |
| 2021 | + var _useState = (0, _react.useState)(false), | |
| 2022 | + _useState2 = (0, _slicedToArray2.default)(_useState, 2), | |
| 2023 | + showSuggestions = _useState2[0], | |
| 2024 | + setShowSuggestions = _useState2[1]; | |
| 2025 | + return /*#__PURE__*/_react.default.createElement(_ui.Autocomplete, (0, _extends2.default)({ | |
| 2026 | + freeSolo: true, | |
| 2027 | + fullWidth: true, | |
| 2028 | + disableClearable: true, | |
| 2029 | + open: showSuggestions, | |
| 2030 | + onClose: function onClose() { | |
| 2031 | + return setShowSuggestions(false); | |
| 2032 | + }, | |
| 2033 | + onKeyDown: function onKeyDown(e) { | |
| 2034 | + if ('Enter' === e.key && !e.shiftKey && !showSuggestions) { | |
| 2035 | + onSubmit(e); | |
| 2036 | + } else if ('/' === e.key && '' === e.target.value) { | |
| 2037 | + e.preventDefault(); | |
| 2038 | + setShowSuggestions(true); | |
| 2039 | + } | |
| 2040 | + } | |
| 2041 | + }, props)); | |
| 2042 | +}; | |
| 2043 | +PromptAutocomplete.propTypes = { | |
| 2044 | + onSubmit: PropTypes.func.isRequired | |
| 2045 | +}; | |
| 2046 | +PromptAutocomplete.TextInput = TextInput; | |
| 2047 | +var _default = PromptAutocomplete; | |
| 2048 | +exports["default"] = _default; | |
| 2049 | + | |
| 2050 | +/***/ }), | |
| 2051 | + | |
| 2052 | +/***/ "../modules/ai/assets/js/editor/pages/form-layout/components/prompt-form.js": | |
| 2053 | +/*!**********************************************************************************!*\ | |
| 2054 | + !*** ../modules/ai/assets/js/editor/pages/form-layout/components/prompt-form.js ***! | |
| 2055 | + \**********************************************************************************/ | |
| 2056 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 2057 | + | |
| 2058 | +"use strict"; | |
| 2059 | +/* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"]; | |
| 2060 | +/* provided dependency */ var PropTypes = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js"); | |
| 2061 | + | |
| 2062 | + | |
| 2063 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 2064 | +var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js"); | |
| 2065 | +Object.defineProperty(exports, "__esModule", ({ | |
| 2066 | + value: true | |
| 2067 | +})); | |
| 2068 | +exports["default"] = void 0; | |
| 2069 | +var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); | |
| 2070 | +var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js")); | |
| 2071 | +var _extends2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/extends */ "../node_modules/@babel/runtime/helpers/extends.js")); | |
| 2072 | +var _objectWithoutProperties2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/objectWithoutProperties */ "../node_modules/@babel/runtime/helpers/objectWithoutProperties.js")); | |
| 2073 | +var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); | |
| 2074 | +var _promptAutocomplete = _interopRequireDefault(__webpack_require__(/*! ./prompt-autocomplete */ "../modules/ai/assets/js/editor/pages/form-layout/components/prompt-autocomplete.js")); | |
| 2075 | +var _enhanceButton = _interopRequireDefault(__webpack_require__(/*! ../../form-media/components/enhance-button */ "../modules/ai/assets/js/editor/pages/form-media/components/enhance-button.js")); | |
| 2076 | +var _generateSubmit = _interopRequireDefault(__webpack_require__(/*! ../../form-media/components/generate-submit */ "../modules/ai/assets/js/editor/pages/form-media/components/generate-submit.js")); | |
| 2077 | +var _arrowLeftIcon = _interopRequireDefault(__webpack_require__(/*! ../../../icons/arrow-left-icon */ "../modules/ai/assets/js/editor/icons/arrow-left-icon.js")); | |
| 2078 | +var _editIcon = _interopRequireDefault(__webpack_require__(/*! ../../../icons/edit-icon */ "../modules/ai/assets/js/editor/icons/edit-icon.js")); | |
| 2079 | +var _usePromptEnhancer2 = _interopRequireDefault(__webpack_require__(/*! ../../../hooks/use-prompt-enhancer */ "../modules/ai/assets/js/editor/hooks/use-prompt-enhancer.js")); | |
| 2080 | +var _excluded = ["tooltip"]; | |
| 2081 | +function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | |
| 2082 | +function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | |
| 2083 | +var PROMPT_SUGGESTIONS = Object.freeze([{ | |
| 2084 | + text: __('A services section with a list layout, icons, and corresponding service descriptions for', 'elementor') | |
| 2085 | +}, { | |
| 2086 | + text: __('An accordion-style FAQ block, with clickable questions revealing detailed answers about', 'elementor') | |
| 2087 | +}, { | |
| 2088 | + text: __('A hero section combining an image, heading, subheading, and call-to-action button about', 'elementor') | |
| 2089 | +}, { | |
| 2090 | + text: __('A full-width call-to-action with a background image, overlaid text, and a standout button about', 'elementor') | |
| 2091 | +}, { | |
| 2092 | + text: __('A carousel testimonial block displaying user images, names, and their feedback on', 'elementor') | |
| 2093 | +}, { | |
| 2094 | + text: __('A features block, showcasing the feature title, and brief description about', 'elementor') | |
| 2095 | +}, { | |
| 2096 | + text: __('Multi column minimalistic About us section with icons showcasing', 'elementor') | |
| 2097 | +}, { | |
| 2098 | + text: __('A section with contact form and social media icons representing alternative contact methods for', 'elementor') | |
| 2099 | +}, { | |
| 2100 | + text: __('Statistics display in a 3-column layout, with numbers and icons about', 'elementor') | |
| 2101 | +}, { | |
| 2102 | + text: __('Pricing table section with highlighted option for', 'elementor') | |
| 2103 | +}, { | |
| 2104 | + text: __('About us section, combining company history and values about', 'elementor') | |
| 2105 | +}]); | |
| 2106 | +var IconButtonWithTooltip = function IconButtonWithTooltip(_ref) { | |
| 2107 | + var tooltip = _ref.tooltip, | |
| 2108 | + props = (0, _objectWithoutProperties2.default)(_ref, _excluded); | |
| 2109 | + return /*#__PURE__*/_react.default.createElement(_ui.Tooltip, { | |
| 2110 | + title: tooltip | |
| 2111 | + }, /*#__PURE__*/_react.default.createElement(_ui.Box, { | |
| 2112 | + component: "span", | |
| 2113 | + sx: { | |
| 2114 | + cursor: props.disabled ? 'default' : 'pointer' | |
| 2115 | + } | |
| 2116 | + }, /*#__PURE__*/_react.default.createElement(_ui.IconButton, props))); | |
| 2117 | +}; | |
| 2118 | +IconButtonWithTooltip.propTypes = { | |
| 2119 | + tooltip: PropTypes.string, | |
| 2120 | + disabled: PropTypes.bool | |
| 2121 | +}; | |
| 2122 | +var BackButton = function BackButton(props) { | |
| 2123 | + return /*#__PURE__*/_react.default.createElement(IconButtonWithTooltip, (0, _extends2.default)({ | |
| 2124 | + size: "small", | |
| 2125 | + color: "secondary", | |
| 2126 | + tooltip: __('Back to results', 'elementor') | |
| 2127 | + }, props), /*#__PURE__*/_react.default.createElement(_arrowLeftIcon.default, null)); | |
| 2128 | +}; | |
| 2129 | +var EditButton = function EditButton(props) { | |
| 2130 | + return /*#__PURE__*/_react.default.createElement(IconButtonWithTooltip, (0, _extends2.default)({ | |
| 2131 | + size: "small", | |
| 2132 | + color: "primary", | |
| 2133 | + tooltip: __('Edit prompt', 'elementor') | |
| 2134 | + }, props), /*#__PURE__*/_react.default.createElement(_editIcon.default, null)); | |
| 2135 | +}; | |
| 2136 | +var GenerateButton = function GenerateButton(props) { | |
| 2137 | + return /*#__PURE__*/_react.default.createElement(_generateSubmit.default, (0, _extends2.default)({ | |
| 2138 | + size: "small", | |
| 2139 | + fullWidth: false | |
| 2140 | + }, props), __('Generate', 'elementor')); | |
| 2141 | +}; | |
| 2142 | +var PromptForm = (0, _react.forwardRef)(function (_ref2, ref) { | |
| 2143 | + var isActive = _ref2.isActive, | |
| 2144 | + isLoading = _ref2.isLoading, | |
| 2145 | + _ref2$showActions = _ref2.showActions, | |
| 2146 | + showActions = _ref2$showActions === void 0 ? false : _ref2$showActions, | |
| 2147 | + _onSubmit = _ref2.onSubmit, | |
| 2148 | + onBack = _ref2.onBack, | |
| 2149 | + onEdit = _ref2.onEdit; | |
| 2150 | + var _useState = (0, _react.useState)(''), | |
| 2151 | + _useState2 = (0, _slicedToArray2.default)(_useState, 2), | |
| 2152 | + prompt = _useState2[0], | |
| 2153 | + setPrompt = _useState2[1]; | |
| 2154 | + var _usePromptEnhancer = (0, _usePromptEnhancer2.default)(prompt, 'layout'), | |
| 2155 | + isEnhancing = _usePromptEnhancer.isEnhancing, | |
| 2156 | + enhance = _usePromptEnhancer.enhance; | |
| 2157 | + var previousPrompt = (0, _react.useRef)(''); | |
| 2158 | + var isInteractionsDisabled = isEnhancing || isLoading || !isActive || '' === prompt; | |
| 2159 | + var handleBack = function handleBack() { | |
| 2160 | + setPrompt(previousPrompt.current); | |
| 2161 | + onBack(); | |
| 2162 | + }; | |
| 2163 | + var handleEdit = function handleEdit() { | |
| 2164 | + previousPrompt.current = prompt; | |
| 2165 | + onEdit(); | |
| 2166 | + }; | |
| 2167 | + return /*#__PURE__*/_react.default.createElement(_ui.Box, { | |
| 2168 | + component: "form", | |
| 2169 | + onSubmit: function onSubmit(e) { | |
| 2170 | + return _onSubmit(e, prompt); | |
| 2171 | + }, | |
| 2172 | + sx: { | |
| 2173 | + p: 2 | |
| 2174 | + }, | |
| 2175 | + display: "flex", | |
| 2176 | + alignItems: "center", | |
| 2177 | + gap: 1 | |
| 2178 | + }, /*#__PURE__*/_react.default.createElement(_ui.Stack, { | |
| 2179 | + direction: "row", | |
| 2180 | + flexGrow: 1, | |
| 2181 | + spacing: 1 | |
| 2182 | + }, showActions && (isActive ? /*#__PURE__*/_react.default.createElement(BackButton, { | |
| 2183 | + disabled: isLoading || isEnhancing, | |
| 2184 | + onClick: handleBack | |
| 2185 | + }) : /*#__PURE__*/_react.default.createElement(EditButton, { | |
| 2186 | + disabled: isLoading, | |
| 2187 | + onClick: handleEdit | |
| 2188 | + })), /*#__PURE__*/_react.default.createElement(_promptAutocomplete.default, { | |
| 2189 | + value: prompt, | |
| 2190 | + disabled: isLoading || !isActive || isEnhancing, | |
| 2191 | + onSubmit: function onSubmit(e) { | |
| 2192 | + return _onSubmit(e, prompt); | |
| 2193 | + }, | |
| 2194 | + options: PROMPT_SUGGESTIONS, | |
| 2195 | + getOptionLabel: function getOptionLabel(option) { | |
| 2196 | + return option.text ? option.text + '...' : prompt; | |
| 2197 | + }, | |
| 2198 | + onChange: function onChange(_, selectedValue) { | |
| 2199 | + return setPrompt(selectedValue.text + ' '); | |
| 2200 | + }, | |
| 2201 | + renderInput: function renderInput(params) { | |
| 2202 | + return /*#__PURE__*/_react.default.createElement(_promptAutocomplete.default.TextInput, (0, _extends2.default)({}, params, { | |
| 2203 | + ref: ref, | |
| 2204 | + onChange: function onChange(e) { | |
| 2205 | + return setPrompt(e.target.value); | |
| 2206 | + }, | |
| 2207 | + placeholder: __("Press '/' for suggested prompts or describe the layout you want to create", 'elementor') | |
| 2208 | + })); | |
| 2209 | + } | |
| 2210 | + })), /*#__PURE__*/_react.default.createElement(_enhanceButton.default, { | |
| 2211 | + size: "small", | |
| 2212 | + disabled: isInteractionsDisabled, | |
| 2213 | + isLoading: isEnhancing, | |
| 2214 | + onClick: function onClick() { | |
| 2215 | + return enhance().then(function (_ref3) { | |
| 2216 | + var result = _ref3.result; | |
| 2217 | + return setPrompt(result); | |
| 2218 | + }); | |
| 2219 | + } | |
| 2220 | + }), /*#__PURE__*/_react.default.createElement(GenerateButton, { | |
| 2221 | + disabled: isInteractionsDisabled | |
| 2222 | + })); | |
| 2223 | +}); | |
| 2224 | +PromptForm.propTypes = { | |
| 2225 | + isActive: PropTypes.bool, | |
| 2226 | + isLoading: PropTypes.bool, | |
| 2227 | + showActions: PropTypes.bool, | |
| 2228 | + onSubmit: PropTypes.func.isRequired, | |
| 2229 | + onBack: PropTypes.func.isRequired, | |
| 2230 | + onEdit: PropTypes.func.isRequired | |
| 2231 | +}; | |
| 2232 | +var _default = PromptForm; | |
| 2233 | +exports["default"] = _default; | |
| 2234 | + | |
| 2235 | +/***/ }), | |
| 2236 | + | |
| 2237 | +/***/ "../modules/ai/assets/js/editor/pages/form-layout/components/screenshot-container.js": | |
| 2238 | +/*!*******************************************************************************************!*\ | |
| 2239 | + !*** ../modules/ai/assets/js/editor/pages/form-layout/components/screenshot-container.js ***! | |
| 2240 | + \*******************************************************************************************/ | |
| 2241 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 2242 | + | |
| 2243 | +"use strict"; | |
| 2244 | + | |
| 2245 | + | |
| 2246 | +Object.defineProperty(exports, "__esModule", ({ | |
| 2247 | + value: true | |
| 2248 | +})); | |
| 2249 | +exports["default"] = void 0; | |
| 2250 | +var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); | |
| 2251 | +var ScreenshotContainer = (0, _ui.styled)(_ui.Box, { | |
| 2252 | + shouldForwardProp: function shouldForwardProp(prop) { | |
| 2253 | + return prop !== 'outlineOffset'; | |
| 2254 | + } | |
| 2255 | +})(function (_ref) { | |
| 2256 | + var theme = _ref.theme, | |
| 2257 | + selected = _ref.selected, | |
| 2258 | + height = _ref.height, | |
| 2259 | + disabled = _ref.disabled, | |
| 2260 | + _ref$outlineOffset = _ref.outlineOffset, | |
| 2261 | + outlineOffset = _ref$outlineOffset === void 0 ? '0px' : _ref$outlineOffset; | |
| 2262 | + var outlineColor = selected ? theme.palette.text.primary : theme.palette.text.disabled; | |
| 2263 | + var outline = "2px solid ".concat(outlineColor); | |
| 2264 | + return { | |
| 2265 | + height: height, | |
| 2266 | + cursor: disabled ? 'default' : 'pointer', | |
| 2267 | + overflow: 'hidden', | |
| 2268 | + boxSizing: 'border-box', | |
| 2269 | + backgroundPosition: 'top center', | |
| 2270 | + backgroundSize: '100% auto', | |
| 2271 | + backgroundRepeat: 'no-repeat', | |
| 2272 | + backgroundColor: theme.palette.common.white, | |
| 2273 | + borderRadius: theme.shape.borderRadius * 0.5, | |
| 2274 | + outlineOffset: outlineOffset, | |
| 2275 | + outline: outline, | |
| 2276 | + opacity: disabled ? '0.4' : '1', | |
| 2277 | + transition: "all 50ms linear", | |
| 2278 | + '&:hover': disabled ? {} : { | |
| 2279 | + outlineColor: theme.palette.text.primary | |
| 2280 | + } | |
| 2281 | + }; | |
| 2282 | +}); | |
| 2283 | +var _default = ScreenshotContainer; | |
| 2284 | +exports["default"] = _default; | |
| 2285 | + | |
| 2286 | +/***/ }), | |
| 2287 | + | |
| 2288 | +/***/ "../modules/ai/assets/js/editor/pages/form-layout/components/screenshot-unavailable.js": | |
| 2289 | +/*!*********************************************************************************************!*\ | |
| 2290 | + !*** ../modules/ai/assets/js/editor/pages/form-layout/components/screenshot-unavailable.js ***! | |
| 2291 | + \*********************************************************************************************/ | |
| 2292 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 2293 | + | |
| 2294 | +"use strict"; | |
| 2295 | +/* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"]; | |
| 2296 | +/* provided dependency */ var PropTypes = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js"); | |
| 2297 | + | |
| 2298 | + | |
| 2299 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 2300 | +Object.defineProperty(exports, "__esModule", ({ | |
| 2301 | + value: true | |
| 2302 | +})); | |
| 2303 | +exports["default"] = ScreenshotUnavailable; | |
| 2304 | +var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); | |
| 2305 | +var _extends2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/extends */ "../node_modules/@babel/runtime/helpers/extends.js")); | |
| 2306 | +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js")); | |
| 2307 | +var _screenshotContainer = _interopRequireDefault(__webpack_require__(/*! ./screenshot-container */ "../modules/ai/assets/js/editor/pages/form-layout/components/screenshot-container.js")); | |
| 2308 | +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | |
| 2309 | +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | |
| 2310 | +function ScreenshotUnavailable(props) { | |
| 2311 | + return /*#__PURE__*/_react.default.createElement(_screenshotContainer.default, (0, _extends2.default)({}, props, { | |
| 2312 | + sx: _objectSpread(_objectSpread({}, props.sx || {}), {}, { | |
| 2313 | + display: 'flex', | |
| 2314 | + alignItems: 'center', | |
| 2315 | + justifyContent: 'center', | |
| 2316 | + backgroundColor: 'background.paper', | |
| 2317 | + color: 'text.tertiary', | |
| 2318 | + fontStyle: 'italic', | |
| 2319 | + fontSize: '12px', | |
| 2320 | + paddingInline: 12, | |
| 2321 | + textAlign: 'center', | |
| 2322 | + lineHeight: 1.5 | |
| 2323 | + }) | |
| 2324 | + }), __('Preview unavailable', 'elementor')); | |
| 2325 | +} | |
| 2326 | +ScreenshotUnavailable.propTypes = { | |
| 2327 | + sx: PropTypes.object | |
| 2328 | +}; | |
| 2329 | + | |
| 2330 | +/***/ }), | |
| 2331 | + | |
| 2332 | +/***/ "../modules/ai/assets/js/editor/pages/form-layout/components/screenshot.js": | |
| 2333 | +/*!*********************************************************************************!*\ | |
| 2334 | + !*** ../modules/ai/assets/js/editor/pages/form-layout/components/screenshot.js ***! | |
| 2335 | + \*********************************************************************************/ | |
| 2336 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 2337 | + | |
| 2338 | +"use strict"; | |
| 2339 | +/* provided dependency */ var PropTypes = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js"); | |
| 2340 | + | |
| 2341 | + | |
| 2342 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 2343 | +Object.defineProperty(exports, "__esModule", ({ | |
| 2344 | + value: true | |
| 2345 | +})); | |
| 2346 | +exports["default"] = void 0; | |
| 2347 | +var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); | |
| 2348 | +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js")); | |
| 2349 | +var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); | |
| 2350 | +var _screenshotContainer = _interopRequireDefault(__webpack_require__(/*! ./screenshot-container */ "../modules/ai/assets/js/editor/pages/form-layout/components/screenshot-container.js")); | |
| 2351 | +var _screenshotUnavailable = _interopRequireDefault(__webpack_require__(/*! ./screenshot-unavailable */ "../modules/ai/assets/js/editor/pages/form-layout/components/screenshot-unavailable.js")); | |
| 2352 | +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | |
| 2353 | +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | |
| 2354 | +var SCREENSHOT_HEIGHT = '138px'; | |
| 2355 | +var Screenshot = function Screenshot(_ref) { | |
| 2356 | + var url = _ref.url, | |
| 2357 | + _ref$isLoading = _ref.isLoading, | |
| 2358 | + isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading, | |
| 2359 | + _ref$isSelected = _ref.isSelected, | |
| 2360 | + isSelected = _ref$isSelected === void 0 ? false : _ref$isSelected, | |
| 2361 | + isPlaceholder = _ref.isPlaceholder, | |
| 2362 | + disabled = _ref.disabled, | |
| 2363 | + onClick = _ref.onClick, | |
| 2364 | + _ref$sx = _ref.sx, | |
| 2365 | + sx = _ref$sx === void 0 ? {} : _ref$sx, | |
| 2366 | + outlineOffset = _ref.outlineOffset; | |
| 2367 | + if (isPlaceholder) { | |
| 2368 | + return /*#__PURE__*/_react.default.createElement(_ui.Box, { | |
| 2369 | + sx: _objectSpread({ | |
| 2370 | + height: SCREENSHOT_HEIGHT | |
| 2371 | + }, sx) | |
| 2372 | + }); | |
| 2373 | + } | |
| 2374 | + if (isLoading) { | |
| 2375 | + return /*#__PURE__*/_react.default.createElement(_ui.Skeleton, { | |
| 2376 | + width: "100%", | |
| 2377 | + animation: "wave", | |
| 2378 | + variant: "rounded", | |
| 2379 | + height: SCREENSHOT_HEIGHT, | |
| 2380 | + sx: sx | |
| 2381 | + }); | |
| 2382 | + } | |
| 2383 | + if (!url) { | |
| 2384 | + return /*#__PURE__*/_react.default.createElement(_screenshotUnavailable.default, { | |
| 2385 | + selected: isSelected, | |
| 2386 | + disabled: disabled, | |
| 2387 | + sx: sx, | |
| 2388 | + onClick: onClick, | |
| 2389 | + height: SCREENSHOT_HEIGHT, | |
| 2390 | + outlineOffset: outlineOffset | |
| 2391 | + }); | |
| 2392 | + } | |
| 2393 | + return /*#__PURE__*/_react.default.createElement(_screenshotContainer.default, { | |
| 2394 | + selected: isSelected, | |
| 2395 | + disabled: disabled, | |
| 2396 | + sx: _objectSpread({ | |
| 2397 | + backgroundImage: "url('".concat(url, "')") | |
| 2398 | + }, sx), | |
| 2399 | + onClick: onClick, | |
| 2400 | + height: SCREENSHOT_HEIGHT, | |
| 2401 | + outlineOffset: outlineOffset | |
| 2402 | + }); | |
| 2403 | +}; | |
| 2404 | +Screenshot.propTypes = { | |
| 2405 | + isSelected: PropTypes.bool, | |
| 2406 | + isLoading: PropTypes.bool, | |
| 2407 | + isPlaceholder: PropTypes.bool, | |
| 2408 | + disabled: PropTypes.bool, | |
| 2409 | + onClick: PropTypes.func.isRequired, | |
| 2410 | + url: PropTypes.string, | |
| 2411 | + sx: PropTypes.object, | |
| 2412 | + outlineOffset: PropTypes.string | |
| 2413 | +}; | |
| 2414 | +var _default = Screenshot; | |
| 2415 | +exports["default"] = _default; | |
| 2416 | + | |
| 2417 | +/***/ }), | |
| 2418 | + | |
| 2419 | +/***/ "../modules/ai/assets/js/editor/pages/form-layout/components/unsaved-changes-alert.js": | |
| 2420 | +/*!********************************************************************************************!*\ | |
| 2421 | + !*** ../modules/ai/assets/js/editor/pages/form-layout/components/unsaved-changes-alert.js ***! | |
| 2422 | + \********************************************************************************************/ | |
| 2423 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 2424 | + | |
| 2425 | +"use strict"; | |
| 2426 | +/* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"]; | |
| 2427 | +/* provided dependency */ var PropTypes = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js"); | |
| 2428 | + | |
| 2429 | + | |
| 2430 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 2431 | +Object.defineProperty(exports, "__esModule", ({ | |
| 2432 | + value: true | |
| 2433 | +})); | |
| 2434 | +exports["default"] = void 0; | |
| 2435 | +var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); | |
| 2436 | +var _extends2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/extends */ "../node_modules/@babel/runtime/helpers/extends.js")); | |
| 2437 | +var _objectWithoutProperties2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/objectWithoutProperties */ "../node_modules/@babel/runtime/helpers/objectWithoutProperties.js")); | |
| 2438 | +var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); | |
| 2439 | +var _excluded = ["onClose", "onCancel", "title", "text"]; | |
| 2440 | +var UnsavedChangesAlert = function UnsavedChangesAlert(_ref) { | |
| 2441 | + var onClose = _ref.onClose, | |
| 2442 | + onCancel = _ref.onCancel, | |
| 2443 | + title = _ref.title, | |
| 2444 | + text = _ref.text, | |
| 2445 | + props = (0, _objectWithoutProperties2.default)(_ref, _excluded); | |
| 2446 | + return /*#__PURE__*/_react.default.createElement(_ui.Dialog, (0, _extends2.default)({ | |
| 2447 | + "aria-labelledby": "unsaved-changes-alert-title", | |
| 2448 | + "aria-describedby": "unsaved-changes-alert-description" | |
| 2449 | + }, props), /*#__PURE__*/_react.default.createElement(_ui.DialogTitle, { | |
| 2450 | + id: "unsaved-changes-alert-title" | |
| 2451 | + }, title), /*#__PURE__*/_react.default.createElement(_ui.DialogContent, null, /*#__PURE__*/_react.default.createElement(_ui.DialogContentText, { | |
| 2452 | + id: "unsaved-changes-alert-description" | |
| 2453 | + }, text)), /*#__PURE__*/_react.default.createElement(_ui.DialogActions, null, /*#__PURE__*/_react.default.createElement(_ui.Button, { | |
| 2454 | + onClick: onCancel, | |
| 2455 | + color: "secondary" | |
| 2456 | + }, __('Cancel', 'elementor')), /*#__PURE__*/_react.default.createElement(_ui.Button, { | |
| 2457 | + onClick: onClose, | |
| 2458 | + color: "error", | |
| 2459 | + variant: "contained" | |
| 2460 | + }, __('Yes, leave', 'elementor')))); | |
| 2461 | +}; | |
| 2462 | +UnsavedChangesAlert.propTypes = { | |
| 2463 | + title: PropTypes.string, | |
| 2464 | + text: PropTypes.string, | |
| 2465 | + onCancel: PropTypes.func, | |
| 2466 | + onClose: PropTypes.func | |
| 2467 | +}; | |
| 2468 | +var _default = UnsavedChangesAlert; | |
| 2469 | +exports["default"] = _default; | |
| 2470 | + | |
| 2471 | +/***/ }), | |
| 2472 | + | |
| 2473 | +/***/ "../modules/ai/assets/js/editor/pages/form-layout/hooks/use-layout-prompt.js": | |
| 2474 | +/*!***********************************************************************************!*\ | |
| 2475 | + !*** ../modules/ai/assets/js/editor/pages/form-layout/hooks/use-layout-prompt.js ***! | |
| 2476 | + \***********************************************************************************/ | |
| 2477 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 2478 | + | |
| 2479 | +"use strict"; | |
| 2480 | + | |
| 2481 | + | |
| 2482 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 2483 | +Object.defineProperty(exports, "__esModule", ({ | |
| 2484 | + value: true | |
| 2485 | +})); | |
| 2486 | +exports["default"] = void 0; | |
| 2487 | +var _api = __webpack_require__(/*! ../../../api */ "../modules/ai/assets/js/editor/api/index.js"); | |
| 2488 | +var _usePrompt = _interopRequireDefault(__webpack_require__(/*! ../../../hooks/use-prompt */ "../modules/ai/assets/js/editor/hooks/use-prompt.js")); | |
| 2489 | +var useLayoutPrompt = function useLayoutPrompt(type, initialValue) { | |
| 2490 | + return (0, _usePrompt.default)(function (prompt, signal) { | |
| 2491 | + return (0, _api.generateLayout)(prompt, type, signal); | |
| 2492 | + }, initialValue); | |
| 2493 | +}; | |
| 2494 | +var _default = useLayoutPrompt; | |
| 2495 | +exports["default"] = _default; | |
| 2496 | + | |
| 2497 | +/***/ }), | |
| 2498 | + | |
| 2499 | +/***/ "../modules/ai/assets/js/editor/pages/form-layout/hooks/use-screenshot.js": | |
| 2500 | +/*!********************************************************************************!*\ | |
| 2501 | + !*** ../modules/ai/assets/js/editor/pages/form-layout/hooks/use-screenshot.js ***! | |
| 2502 | + \********************************************************************************/ | |
| 2503 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 2504 | + | |
| 2505 | +"use strict"; | |
| 2506 | + | |
| 2507 | + | |
| 2508 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 2509 | +Object.defineProperty(exports, "__esModule", ({ | |
| 2510 | + value: true | |
| 2511 | +})); | |
| 2512 | +exports["default"] = void 0; | |
| 2513 | +var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ "../node_modules/@babel/runtime/regenerator/index.js")); | |
| 2514 | +var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "../node_modules/@babel/runtime/helpers/asyncToGenerator.js")); | |
| 2515 | +var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js")); | |
| 2516 | +var _react = __webpack_require__(/*! react */ "react"); | |
| 2517 | +var _useLayoutPrompt = _interopRequireDefault(__webpack_require__(/*! ./use-layout-prompt */ "../modules/ai/assets/js/editor/pages/form-layout/hooks/use-layout-prompt.js")); | |
| 2518 | +var ERROR_INITIAL_VALUE = ''; | |
| 2519 | +var useScreenshot = function useScreenshot(type, onData) { | |
| 2520 | + var _useState = (0, _react.useState)(ERROR_INITIAL_VALUE), | |
| 2521 | + _useState2 = (0, _slicedToArray2.default)(_useState, 2), | |
| 2522 | + error = _useState2[0], | |
| 2523 | + setError = _useState2[1]; | |
| 2524 | + var _useState3 = (0, _react.useState)(false), | |
| 2525 | + _useState4 = (0, _slicedToArray2.default)(_useState3, 2), | |
| 2526 | + isLoading = _useState4[0], | |
| 2527 | + setIsLoading = _useState4[1]; | |
| 2528 | + var layoutData = (0, _useLayoutPrompt.default)(type, null); | |
| 2529 | + var generate = function generate(prompt, signal) { | |
| 2530 | + setIsLoading(true); | |
| 2531 | + setError(ERROR_INITIAL_VALUE); | |
| 2532 | + return layoutData.send(prompt, signal).then( /*#__PURE__*/function () { | |
| 2533 | + var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(data) { | |
| 2534 | + var createdScreenshot; | |
| 2535 | + return _regenerator.default.wrap(function _callee$(_context) { | |
| 2536 | + while (1) switch (_context.prev = _context.next) { | |
| 2537 | + case 0: | |
| 2538 | + _context.next = 2; | |
| 2539 | + return onData(data.result); | |
| 2540 | + case 2: | |
| 2541 | + createdScreenshot = _context.sent; | |
| 2542 | + createdScreenshot.sendUsageData = function () { | |
| 2543 | + return layoutData.sendUsageData(data); | |
| 2544 | + }; | |
| 2545 | + return _context.abrupt("return", createdScreenshot); | |
| 2546 | + case 5: | |
| 2547 | + case "end": | |
| 2548 | + return _context.stop(); | |
| 2549 | + } | |
| 2550 | + }, _callee); | |
| 2551 | + })); | |
| 2552 | + return function (_x) { | |
| 2553 | + return _ref.apply(this, arguments); | |
| 2554 | + }; | |
| 2555 | + }()).catch(function (err) { | |
| 2556 | + setError(err.message || err); | |
| 2557 | + throw err; | |
| 2558 | + }).finally(function () { | |
| 2559 | + return setIsLoading(false); | |
| 2560 | + }); | |
| 2561 | + }; | |
| 2562 | + return { | |
| 2563 | + generate: generate, | |
| 2564 | + error: error, | |
| 2565 | + isLoading: isLoading | |
| 2566 | + }; | |
| 2567 | +}; | |
| 2568 | +var _default = useScreenshot; | |
| 2569 | +exports["default"] = _default; | |
| 2570 | + | |
| 2571 | +/***/ }), | |
| 2572 | + | |
| 2573 | +/***/ "../modules/ai/assets/js/editor/pages/form-layout/hooks/use-screenshots.js": | |
| 2574 | +/*!*********************************************************************************!*\ | |
| 2575 | + !*** ../modules/ai/assets/js/editor/pages/form-layout/hooks/use-screenshots.js ***! | |
| 2576 | + \*********************************************************************************/ | |
| 2577 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 2578 | + | |
| 2579 | +"use strict"; | |
| 2580 | + | |
| 2581 | + | |
| 2582 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 2583 | +Object.defineProperty(exports, "__esModule", ({ | |
| 2584 | + value: true | |
| 2585 | +})); | |
| 2586 | +exports["default"] = void 0; | |
| 2587 | +var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ "../node_modules/@babel/runtime/regenerator/index.js")); | |
| 2588 | +var _toConsumableArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ "../node_modules/@babel/runtime/helpers/toConsumableArray.js")); | |
| 2589 | +var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "../node_modules/@babel/runtime/helpers/asyncToGenerator.js")); | |
| 2590 | +var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js")); | |
| 2591 | +var _react = __webpack_require__(/*! react */ "react"); | |
| 2592 | +var _useScreenshot = _interopRequireDefault(__webpack_require__(/*! ./use-screenshot */ "../modules/ai/assets/js/editor/pages/form-layout/hooks/use-screenshot.js")); | |
| 2593 | +var PENDING_VALUE = { | |
| 2594 | + isPending: true | |
| 2595 | +}; | |
| 2596 | +var useScreenshots = function useScreenshots(_ref) { | |
| 2597 | + var onData = _ref.onData; | |
| 2598 | + var _useState = (0, _react.useState)([]), | |
| 2599 | + _useState2 = (0, _slicedToArray2.default)(_useState, 2), | |
| 2600 | + screenshots = _useState2[0], | |
| 2601 | + setScreenshots = _useState2[1]; | |
| 2602 | + var screenshotsData = [(0, _useScreenshot.default)(0, onData), (0, _useScreenshot.default)(1, onData), (0, _useScreenshot.default)(2, onData)]; | |
| 2603 | + var screenshotsGroupCount = screenshotsData.length; | |
| 2604 | + var error = screenshotsData.every(function (s) { | |
| 2605 | + return s === null || s === void 0 ? void 0 : s.error; | |
| 2606 | + }) ? screenshotsData[0].error : ''; | |
| 2607 | + var isLoading = screenshotsData.some(function (s) { | |
| 2608 | + return s === null || s === void 0 ? void 0 : s.isLoading; | |
| 2609 | + }); | |
| 2610 | + var abortController = (0, _react.useRef)(null); | |
| 2611 | + var abort = function abort() { | |
| 2612 | + var _abortController$curr; | |
| 2613 | + return (_abortController$curr = abortController.current) === null || _abortController$curr === void 0 ? void 0 : _abortController$curr.abort(); | |
| 2614 | + }; | |
| 2615 | + var createScreenshots = /*#__PURE__*/function () { | |
| 2616 | + var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(prompt) { | |
| 2617 | + var onGenerate, onError, promises, results, isAllFailed; | |
| 2618 | + return _regenerator.default.wrap(function _callee$(_context) { | |
| 2619 | + while (1) switch (_context.prev = _context.next) { | |
| 2620 | + case 0: | |
| 2621 | + abortController.current = new AbortController(); | |
| 2622 | + onGenerate = function onGenerate(screenshot) { | |
| 2623 | + setScreenshots(function (prev) { | |
| 2624 | + var updatedData = (0, _toConsumableArray2.default)(prev); | |
| 2625 | + var pendingIndex = updatedData.indexOf(PENDING_VALUE); | |
| 2626 | + updatedData[pendingIndex] = screenshot; | |
| 2627 | + return updatedData; | |
| 2628 | + }); | |
| 2629 | + return true; | |
| 2630 | + }; | |
| 2631 | + onError = function onError() { | |
| 2632 | + setScreenshots(function (prev) { | |
| 2633 | + var updatedData = (0, _toConsumableArray2.default)(prev); | |
| 2634 | + var pendingIndex = updatedData.lastIndexOf(PENDING_VALUE); | |
| 2635 | + updatedData[pendingIndex] = { | |
| 2636 | + isError: true | |
| 2637 | + }; | |
| 2638 | + return updatedData; | |
| 2639 | + }); | |
| 2640 | + return false; | |
| 2641 | + }; | |
| 2642 | + promises = screenshotsData.map(function (_ref3) { | |
| 2643 | + var generate = _ref3.generate; | |
| 2644 | + return generate(prompt, abortController.current.signal).then(onGenerate).catch(onError); | |
| 2645 | + }); | |
| 2646 | + _context.next = 6; | |
| 2647 | + return Promise.all(promises); | |
| 2648 | + case 6: | |
| 2649 | + results = _context.sent; | |
| 2650 | + isAllFailed = results.every(function (value) { | |
| 2651 | + return false === value; | |
| 2652 | + }); | |
| 2653 | + if (isAllFailed) { | |
| 2654 | + setScreenshots(function (prev) { | |
| 2655 | + var updatedData = (0, _toConsumableArray2.default)(prev); | |
| 2656 | + updatedData.splice(screenshotsGroupCount * -1); | |
| 2657 | + return updatedData; | |
| 2658 | + }); | |
| 2659 | + } | |
| 2660 | + case 9: | |
| 2661 | + case "end": | |
| 2662 | + return _context.stop(); | |
| 2663 | + } | |
| 2664 | + }, _callee); | |
| 2665 | + })); | |
| 2666 | + return function createScreenshots(_x) { | |
| 2667 | + return _ref2.apply(this, arguments); | |
| 2668 | + }; | |
| 2669 | + }(); | |
| 2670 | + var generate = function generate(prompt) { | |
| 2671 | + var placeholders = Array(screenshotsGroupCount).fill(PENDING_VALUE); | |
| 2672 | + setScreenshots(placeholders); | |
| 2673 | + createScreenshots(prompt); | |
| 2674 | + }; | |
| 2675 | + var regenerate = function regenerate(prompt) { | |
| 2676 | + var placeholders = Array(screenshotsGroupCount).fill(PENDING_VALUE); | |
| 2677 | + setScreenshots(function (prev) { | |
| 2678 | + return [].concat((0, _toConsumableArray2.default)(prev), (0, _toConsumableArray2.default)(placeholders)); | |
| 2679 | + }); | |
| 2680 | + createScreenshots(prompt); | |
| 2681 | + }; | |
| 2682 | + return { | |
| 2683 | + generate: generate, | |
| 2684 | + regenerate: regenerate, | |
| 2685 | + screenshots: screenshots, | |
| 2686 | + isLoading: isLoading, | |
| 2687 | + error: error, | |
| 2688 | + abort: abort | |
| 2689 | + }; | |
| 2690 | +}; | |
| 2691 | +var _default = useScreenshots; | |
| 2692 | +exports["default"] = _default; | |
| 2693 | + | |
| 2694 | +/***/ }), | |
| 2695 | + | |
| 2696 | +/***/ "../modules/ai/assets/js/editor/pages/form-layout/hooks/use-slider.js": | |
| 2697 | +/*!****************************************************************************!*\ | |
| 2698 | + !*** ../modules/ai/assets/js/editor/pages/form-layout/hooks/use-slider.js ***! | |
| 2699 | + \****************************************************************************/ | |
| 2700 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 2701 | + | |
| 2702 | +"use strict"; | |
| 2703 | + | |
| 2704 | + | |
| 2705 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 2706 | +Object.defineProperty(exports, "__esModule", ({ | |
| 2707 | + value: true | |
| 2708 | +})); | |
| 2709 | +exports["default"] = void 0; | |
| 2710 | +var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js")); | |
| 2711 | +var _react = __webpack_require__(/*! react */ "react"); | |
| 2712 | +var useSlider = function useSlider() { | |
| 2713 | + var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}, | |
| 2714 | + _ref$slidesCount = _ref.slidesCount, | |
| 2715 | + slidesCount = _ref$slidesCount === void 0 ? 0 : _ref$slidesCount, | |
| 2716 | + _ref$slidesPerPage = _ref.slidesPerPage, | |
| 2717 | + slidesPerPage = _ref$slidesPerPage === void 0 ? 3 : _ref$slidesPerPage, | |
| 2718 | + _ref$gapPercentage = _ref.gapPercentage, | |
| 2719 | + gapPercentage = _ref$gapPercentage === void 0 ? 2 : _ref$gapPercentage; | |
| 2720 | + var _useState = (0, _react.useState)(1), | |
| 2721 | + _useState2 = (0, _slicedToArray2.default)(_useState, 2), | |
| 2722 | + currentPage = _useState2[0], | |
| 2723 | + setCurrentPage = _useState2[1]; | |
| 2724 | + var gapsCount = slidesPerPage - 1; | |
| 2725 | + var slideWidthPercentage = (100 - gapPercentage * gapsCount) / slidesPerPage; | |
| 2726 | + var offsetXPercentage = (slideWidthPercentage + gapPercentage) * slidesPerPage * (currentPage - 1) * -1; | |
| 2727 | + var pagesCount = Math.ceil(slidesCount / slidesPerPage); | |
| 2728 | + (0, _react.useEffect)(function () { | |
| 2729 | + // In cases when the slidesCount value was reduced, we need to navigate to the last page. | |
| 2730 | + if (currentPage > 1 && currentPage > pagesCount) { | |
| 2731 | + setCurrentPage(pagesCount); | |
| 2732 | + } | |
| 2733 | + }, [pagesCount]); | |
| 2734 | + return { | |
| 2735 | + currentPage: currentPage, | |
| 2736 | + setCurrentPage: setCurrentPage, | |
| 2737 | + pagesCount: pagesCount, | |
| 2738 | + slidesPerPage: slidesPerPage, | |
| 2739 | + gapPercentage: gapPercentage, | |
| 2740 | + offsetXPercentage: offsetXPercentage, | |
| 2741 | + slideWidthPercentage: slideWidthPercentage | |
| 2742 | + }; | |
| 2743 | +}; | |
| 2744 | +var _default = useSlider; | |
| 2745 | +exports["default"] = _default; | |
| 2746 | + | |
| 2747 | +/***/ }), | |
| 2748 | + | |
| 2749 | +/***/ "../modules/ai/assets/js/editor/pages/form-layout/index.js": | |
| 2750 | +/*!*****************************************************************!*\ | |
| 2751 | + !*** ../modules/ai/assets/js/editor/pages/form-layout/index.js ***! | |
| 2752 | + \*****************************************************************/ | |
| 2753 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 2754 | + | |
| 2755 | +"use strict"; | |
| 2756 | +/* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"]; | |
| 2757 | +/* provided dependency */ var PropTypes = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js"); | |
| 2758 | + | |
| 2759 | + | |
| 2760 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 2761 | +var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js"); | |
| 2762 | +Object.defineProperty(exports, "__esModule", ({ | |
| 2763 | + value: true | |
| 2764 | +})); | |
| 2765 | +exports["default"] = void 0; | |
| 2766 | +var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); | |
| 2767 | +var _objectWithoutProperties2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/objectWithoutProperties */ "../node_modules/@babel/runtime/helpers/objectWithoutProperties.js")); | |
| 2768 | +var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js")); | |
| 2769 | +var _extends2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/extends */ "../node_modules/@babel/runtime/helpers/extends.js")); | |
| 2770 | +var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); | |
| 2771 | +var _promptErrorMessage = _interopRequireDefault(__webpack_require__(/*! ../../components/prompt-error-message */ "../modules/ai/assets/js/editor/components/prompt-error-message.js")); | |
| 2772 | +var _unsavedChangesAlert = _interopRequireDefault(__webpack_require__(/*! ./components/unsaved-changes-alert */ "../modules/ai/assets/js/editor/pages/form-layout/components/unsaved-changes-alert.js")); | |
| 2773 | +var _layoutDialog = _interopRequireDefault(__webpack_require__(/*! ./components/layout-dialog */ "../modules/ai/assets/js/editor/pages/form-layout/components/layout-dialog.js")); | |
| 2774 | +var _promptForm = _interopRequireDefault(__webpack_require__(/*! ./components/prompt-form */ "../modules/ai/assets/js/editor/pages/form-layout/components/prompt-form.js")); | |
| 2775 | +var _refreshIcon = _interopRequireDefault(__webpack_require__(/*! ../../icons/refresh-icon */ "../modules/ai/assets/js/editor/icons/refresh-icon.js")); | |
| 2776 | +var _screenshot = _interopRequireDefault(__webpack_require__(/*! ./components/screenshot */ "../modules/ai/assets/js/editor/pages/form-layout/components/screenshot.js")); | |
| 2777 | +var _useScreenshots2 = _interopRequireDefault(__webpack_require__(/*! ./hooks/use-screenshots */ "../modules/ai/assets/js/editor/pages/form-layout/hooks/use-screenshots.js")); | |
| 2778 | +var _useSlider2 = _interopRequireDefault(__webpack_require__(/*! ./hooks/use-slider */ "../modules/ai/assets/js/editor/pages/form-layout/hooks/use-slider.js")); | |
| 2779 | +var _minimizeDiagonalIcon = _interopRequireDefault(__webpack_require__(/*! ../../icons/minimize-diagonal-icon */ "../modules/ai/assets/js/editor/icons/minimize-diagonal-icon.js")); | |
| 2780 | +var _expandDiagonalIcon = _interopRequireDefault(__webpack_require__(/*! ../../icons/expand-diagonal-icon */ "../modules/ai/assets/js/editor/icons/expand-diagonal-icon.js")); | |
| 2781 | +var _excluded = ["children"]; | |
| 2782 | +function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | |
| 2783 | +function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | |
| 2784 | +var DirectionalMinimizeDiagonalIcon = (0, _ui.withDirection)(_minimizeDiagonalIcon.default); | |
| 2785 | +var DirectionalExpandDiagonalIcon = (0, _ui.withDirection)(_expandDiagonalIcon.default); | |
| 2786 | +var RegenerateButton = function RegenerateButton(props) { | |
| 2787 | + return /*#__PURE__*/_react.default.createElement(_ui.Button, (0, _extends2.default)({ | |
| 2788 | + size: "small", | |
| 2789 | + color: "secondary", | |
| 2790 | + startIcon: /*#__PURE__*/_react.default.createElement(_refreshIcon.default, null) | |
| 2791 | + }, props), __('Regenerate', 'elementor')); | |
| 2792 | +}; | |
| 2793 | +var UseLayoutButton = function UseLayoutButton(props) { | |
| 2794 | + return /*#__PURE__*/_react.default.createElement(_ui.Button, (0, _extends2.default)({ | |
| 2795 | + size: "small", | |
| 2796 | + variant: "contained" | |
| 2797 | + }, props), __('Use Layout', 'elementor')); | |
| 2798 | +}; | |
| 2799 | +UseLayoutButton.propTypes = { | |
| 2800 | + sx: PropTypes.object | |
| 2801 | +}; | |
| 2802 | +var FormLayout = function FormLayout(_ref) { | |
| 2803 | + var _screenshots$selected, _screenshots$2; | |
| 2804 | + var onClose = _ref.onClose, | |
| 2805 | + onInsert = _ref.onInsert, | |
| 2806 | + onData = _ref.onData, | |
| 2807 | + onSelect = _ref.onSelect, | |
| 2808 | + onGenerate = _ref.onGenerate, | |
| 2809 | + _ref$DialogHeaderProp = _ref.DialogHeaderProps, | |
| 2810 | + DialogHeaderProps = _ref$DialogHeaderProp === void 0 ? {} : _ref$DialogHeaderProp, | |
| 2811 | + _ref$DialogContentPro = _ref.DialogContentProps, | |
| 2812 | + DialogContentProps = _ref$DialogContentPro === void 0 ? {} : _ref$DialogContentPro; | |
| 2813 | + var _useScreenshots = (0, _useScreenshots2.default)({ | |
| 2814 | + onData: onData | |
| 2815 | + }), | |
| 2816 | + screenshots = _useScreenshots.screenshots, | |
| 2817 | + generate = _useScreenshots.generate, | |
| 2818 | + regenerate = _useScreenshots.regenerate, | |
| 2819 | + isLoading = _useScreenshots.isLoading, | |
| 2820 | + error = _useScreenshots.error, | |
| 2821 | + abort = _useScreenshots.abort; | |
| 2822 | + var screenshotOutlineOffset = '2px'; | |
| 2823 | + var _useSlider = (0, _useSlider2.default)({ | |
| 2824 | + slidesCount: screenshots.length | |
| 2825 | + }), | |
| 2826 | + currentPage = _useSlider.currentPage, | |
| 2827 | + setCurrentPage = _useSlider.setCurrentPage, | |
| 2828 | + pagesCount = _useSlider.pagesCount, | |
| 2829 | + gapPercentage = _useSlider.gapPercentage, | |
| 2830 | + slidesPerPage = _useSlider.slidesPerPage, | |
| 2831 | + offsetXPercentage = _useSlider.offsetXPercentage, | |
| 2832 | + slideWidthPercentage = _useSlider.slideWidthPercentage; | |
| 2833 | + var _useState = (0, _react.useState)(-1), | |
| 2834 | + _useState2 = (0, _slicedToArray2.default)(_useState, 2), | |
| 2835 | + selectedScreenshotIndex = _useState2[0], | |
| 2836 | + setSelectedScreenshotIndex = _useState2[1]; | |
| 2837 | + var _useState3 = (0, _react.useState)(false), | |
| 2838 | + _useState4 = (0, _slicedToArray2.default)(_useState3, 2), | |
| 2839 | + showUnsavedChangesAlert = _useState4[0], | |
| 2840 | + setShowUnsavedChangesAlert = _useState4[1]; | |
| 2841 | + var _useState5 = (0, _react.useState)(true), | |
| 2842 | + _useState6 = (0, _slicedToArray2.default)(_useState5, 2), | |
| 2843 | + isPromptEditable = _useState6[0], | |
| 2844 | + setIsPromptEditable = _useState6[1]; | |
| 2845 | + var _useState7 = (0, _react.useState)(false), | |
| 2846 | + _useState8 = (0, _slicedToArray2.default)(_useState7, 2), | |
| 2847 | + isMinimized = _useState8[0], | |
| 2848 | + setIsMinimized = _useState8[1]; | |
| 2849 | + var lastRun = (0, _react.useRef)(function () {}); | |
| 2850 | + var promptInputRef = (0, _react.useRef)(null); | |
| 2851 | + var selectedTemplate = (_screenshots$selected = screenshots[selectedScreenshotIndex]) === null || _screenshots$selected === void 0 ? void 0 : _screenshots$selected.template; | |
| 2852 | + var dialogContentChildren = DialogContentProps.children, | |
| 2853 | + dialogContentProps = (0, _objectWithoutProperties2.default)(DialogContentProps, _excluded); | |
| 2854 | + | |
| 2855 | + // When there are no screenshots the prompt field should be editable. | |
| 2856 | + var shouldFallbackToEditPrompt = !!(error && 0 === screenshots.length); | |
| 2857 | + var isPromptFormActive = isPromptEditable || shouldFallbackToEditPrompt; | |
| 2858 | + var abortAndClose = function abortAndClose() { | |
| 2859 | + abort(); | |
| 2860 | + onClose(); | |
| 2861 | + }; | |
| 2862 | + var onCloseIntent = function onCloseIntent() { | |
| 2863 | + var hasUnsavedChanges = promptInputRef.current.value.trim() !== '' || screenshots.length > 0; | |
| 2864 | + if (hasUnsavedChanges) { | |
| 2865 | + return setShowUnsavedChangesAlert(true); | |
| 2866 | + } | |
| 2867 | + abortAndClose(); | |
| 2868 | + }; | |
| 2869 | + var handleGenerate = function handleGenerate(event, prompt) { | |
| 2870 | + event.preventDefault(); | |
| 2871 | + if ('' === prompt.trim()) { | |
| 2872 | + return; | |
| 2873 | + } | |
| 2874 | + onGenerate(); | |
| 2875 | + lastRun.current = function () { | |
| 2876 | + setSelectedScreenshotIndex(-1); | |
| 2877 | + generate(prompt); | |
| 2878 | + }; | |
| 2879 | + lastRun.current(); | |
| 2880 | + setIsPromptEditable(false); | |
| 2881 | + setCurrentPage(1); | |
| 2882 | + }; | |
| 2883 | + var handleRegenerate = function handleRegenerate() { | |
| 2884 | + lastRun.current = function () { | |
| 2885 | + regenerate(promptInputRef.current.value); | |
| 2886 | + // Changing the current page to the next page number. | |
| 2887 | + setCurrentPage(pagesCount + 1); | |
| 2888 | + }; | |
| 2889 | + lastRun.current(); | |
| 2890 | + }; | |
| 2891 | + var applyTemplate = function applyTemplate() { | |
| 2892 | + onInsert(selectedTemplate); | |
| 2893 | + screenshots[selectedScreenshotIndex].sendUsageData(); | |
| 2894 | + abortAndClose(); | |
| 2895 | + }; | |
| 2896 | + var handleScreenshotClick = function handleScreenshotClick(index, template) { | |
| 2897 | + return function () { | |
| 2898 | + if (isPromptFormActive) { | |
| 2899 | + return; | |
| 2900 | + } | |
| 2901 | + setSelectedScreenshotIndex(index); | |
| 2902 | + onSelect(template); | |
| 2903 | + }; | |
| 2904 | + }; | |
| 2905 | + (0, _react.useEffect)(function () { | |
| 2906 | + var _screenshots$; | |
| 2907 | + var isFirstTemplateExist = (_screenshots$ = screenshots[0]) === null || _screenshots$ === void 0 ? void 0 : _screenshots$.template; | |
| 2908 | + if (isFirstTemplateExist) { | |
| 2909 | + onSelect(screenshots[0].template); | |
| 2910 | + setSelectedScreenshotIndex(0); | |
| 2911 | + } | |
| 2912 | + }, [(_screenshots$2 = screenshots[0]) === null || _screenshots$2 === void 0 ? void 0 : _screenshots$2.template]); | |
| 2913 | + return /*#__PURE__*/_react.default.createElement(_layoutDialog.default, { | |
| 2914 | + onClose: onCloseIntent | |
| 2915 | + }, /*#__PURE__*/_react.default.createElement(_layoutDialog.default.Header, (0, _extends2.default)({ | |
| 2916 | + onClose: onCloseIntent | |
| 2917 | + }, DialogHeaderProps), DialogHeaderProps.children, /*#__PURE__*/_react.default.createElement(_ui.Tooltip, { | |
| 2918 | + title: isMinimized ? __('Expand', 'elementor') : __('Minimize', 'elementor') | |
| 2919 | + }, /*#__PURE__*/_react.default.createElement(_ui.IconButton, { | |
| 2920 | + size: "small", | |
| 2921 | + "aria-label": "minimize", | |
| 2922 | + onClick: function onClick() { | |
| 2923 | + return setIsMinimized(function (prev) { | |
| 2924 | + return !prev; | |
| 2925 | + }); | |
| 2926 | + } | |
| 2927 | + }, isMinimized ? /*#__PURE__*/_react.default.createElement(DirectionalExpandDiagonalIcon, null) : /*#__PURE__*/_react.default.createElement(DirectionalMinimizeDiagonalIcon, null)))), /*#__PURE__*/_react.default.createElement(_layoutDialog.default.Content, (0, _extends2.default)({ | |
| 2928 | + dividers: true | |
| 2929 | + }, dialogContentProps), /*#__PURE__*/_react.default.createElement(_ui.Collapse, { | |
| 2930 | + in: !isMinimized | |
| 2931 | + }, dialogContentChildren && /*#__PURE__*/_react.default.createElement(_ui.Box, { | |
| 2932 | + sx: { | |
| 2933 | + pt: 2, | |
| 2934 | + px: 2, | |
| 2935 | + pb: 0 | |
| 2936 | + } | |
| 2937 | + }, dialogContentChildren), error && /*#__PURE__*/_react.default.createElement(_ui.Box, { | |
| 2938 | + sx: { | |
| 2939 | + pt: 2, | |
| 2940 | + px: 2, | |
| 2941 | + pb: 0 | |
| 2942 | + } | |
| 2943 | + }, /*#__PURE__*/_react.default.createElement(_promptErrorMessage.default, { | |
| 2944 | + error: error, | |
| 2945 | + onRetry: lastRun.current | |
| 2946 | + })), showUnsavedChangesAlert && /*#__PURE__*/_react.default.createElement(_unsavedChangesAlert.default, { | |
| 2947 | + open: showUnsavedChangesAlert, | |
| 2948 | + title: __('Leave Elementor AI?', 'elementor'), | |
| 2949 | + text: __("Your progress will be deleted, and can't be recovered.", 'elementor'), | |
| 2950 | + onClose: abortAndClose, | |
| 2951 | + onCancel: function onCancel() { | |
| 2952 | + return setShowUnsavedChangesAlert(false); | |
| 2953 | + } | |
| 2954 | + }), /*#__PURE__*/_react.default.createElement(_promptForm.default, { | |
| 2955 | + ref: promptInputRef, | |
| 2956 | + isActive: isPromptFormActive, | |
| 2957 | + isLoading: isLoading, | |
| 2958 | + showActions: screenshots.length > 0 || isLoading, | |
| 2959 | + onSubmit: handleGenerate, | |
| 2960 | + onBack: function onBack() { | |
| 2961 | + return setIsPromptEditable(false); | |
| 2962 | + }, | |
| 2963 | + onEdit: function onEdit() { | |
| 2964 | + return setIsPromptEditable(true); | |
| 2965 | + } | |
| 2966 | + }), (screenshots.length > 0 || isLoading) && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_ui.Divider, null), /*#__PURE__*/_react.default.createElement(_ui.Box, { | |
| 2967 | + sx: { | |
| 2968 | + p: 1.5 | |
| 2969 | + } | |
| 2970 | + }, /*#__PURE__*/_react.default.createElement(_ui.Box, { | |
| 2971 | + sx: { | |
| 2972 | + overflow: 'hidden', | |
| 2973 | + p: 0.5 | |
| 2974 | + } | |
| 2975 | + }, /*#__PURE__*/_react.default.createElement(_ui.Box, { | |
| 2976 | + sx: { | |
| 2977 | + display: 'flex', | |
| 2978 | + transition: 'all 0.4s ease', | |
| 2979 | + gap: "".concat(gapPercentage, "%"), | |
| 2980 | + transform: "translateX(".concat(offsetXPercentage, "%)") | |
| 2981 | + } | |
| 2982 | + }, screenshots.map(function (_ref2, index) { | |
| 2983 | + var screenshot = _ref2.screenshot, | |
| 2984 | + template = _ref2.template, | |
| 2985 | + isError = _ref2.isError, | |
| 2986 | + isPending = _ref2.isPending; | |
| 2987 | + return /*#__PURE__*/_react.default.createElement(_screenshot.default, { | |
| 2988 | + key: index, | |
| 2989 | + url: screenshot, | |
| 2990 | + disabled: isPromptFormActive, | |
| 2991 | + isPlaceholder: isError, | |
| 2992 | + isLoading: isPending, | |
| 2993 | + isSelected: selectedScreenshotIndex === index, | |
| 2994 | + onClick: handleScreenshotClick(index, template), | |
| 2995 | + outlineOffset: screenshotOutlineOffset, | |
| 2996 | + sx: { | |
| 2997 | + flex: "0 0 ".concat(slideWidthPercentage, "%") | |
| 2998 | + } | |
| 2999 | + }); | |
| 3000 | + })))), screenshots.length > 0 && /*#__PURE__*/_react.default.createElement(_ui.Box, { | |
| 3001 | + sx: { | |
| 3002 | + pt: 0, | |
| 3003 | + px: 2, | |
| 3004 | + pb: 2 | |
| 3005 | + }, | |
| 3006 | + display: "grid", | |
| 3007 | + gridTemplateColumns: "repeat(3, 1fr)", | |
| 3008 | + justifyItems: "center" | |
| 3009 | + }, /*#__PURE__*/_react.default.createElement(RegenerateButton, { | |
| 3010 | + onClick: handleRegenerate, | |
| 3011 | + disabled: isLoading || isPromptFormActive, | |
| 3012 | + sx: { | |
| 3013 | + justifySelf: 'start' | |
| 3014 | + } | |
| 3015 | + }), screenshots.length > slidesPerPage && /*#__PURE__*/_react.default.createElement(_ui.Pagination, { | |
| 3016 | + page: currentPage, | |
| 3017 | + count: pagesCount, | |
| 3018 | + disabled: isPromptFormActive, | |
| 3019 | + onChange: function onChange(_, page) { | |
| 3020 | + return setCurrentPage(page); | |
| 3021 | + } | |
| 3022 | + }), /*#__PURE__*/_react.default.createElement(UseLayoutButton, { | |
| 3023 | + onClick: applyTemplate, | |
| 3024 | + disabled: isPromptFormActive || -1 === selectedScreenshotIndex, | |
| 3025 | + sx: { | |
| 3026 | + justifySelf: 'end', | |
| 3027 | + gridColumn: 3 | |
| 3028 | + } | |
| 3029 | + })))))); | |
| 3030 | +}; | |
| 3031 | +FormLayout.propTypes = { | |
| 3032 | + DialogHeaderProps: PropTypes.object, | |
| 3033 | + DialogContentProps: PropTypes.object, | |
| 3034 | + onClose: PropTypes.func.isRequired, | |
| 3035 | + onInsert: PropTypes.func.isRequired, | |
| 3036 | + onData: PropTypes.func.isRequired, | |
| 3037 | + onSelect: PropTypes.func.isRequired, | |
| 3038 | + onGenerate: PropTypes.func.isRequired | |
| 3039 | +}; | |
| 3040 | +var _default = FormLayout; | |
| 3041 | +exports["default"] = _default; | |
| 3042 | + | |
| 3043 | +/***/ }), | |
| 3044 | + | |
| 3045 | +/***/ "../modules/ai/assets/js/editor/pages/form-media/components/enhance-button.js": | |
| 3046 | +/*!************************************************************************************!*\ | |
| 3047 | + !*** ../modules/ai/assets/js/editor/pages/form-media/components/enhance-button.js ***! | |
| 3048 | + \************************************************************************************/ | |
| 3049 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 3050 | + | |
| 3051 | +"use strict"; | |
| 3052 | +/* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"]; | |
| 3053 | +/* provided dependency */ var PropTypes = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js"); | |
| 3054 | + | |
| 3055 | + | |
| 3056 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 3057 | +Object.defineProperty(exports, "__esModule", ({ | |
| 3058 | + value: true | |
| 3059 | +})); | |
| 3060 | +exports["default"] = void 0; | |
| 3061 | +var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); | |
| 3062 | +var _extends2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/extends */ "../node_modules/@babel/runtime/helpers/extends.js")); | |
| 3063 | +var _objectWithoutProperties2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/objectWithoutProperties */ "../node_modules/@babel/runtime/helpers/objectWithoutProperties.js")); | |
| 3064 | +var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); | |
| 3065 | +var _wandIcon = _interopRequireDefault(__webpack_require__(/*! ../../../icons/wand-icon */ "../modules/ai/assets/js/editor/icons/wand-icon.js")); | |
| 3066 | +var _excluded = ["isLoading"]; | |
| 3067 | +var StyledWandIcon = (0, _ui.withDirection)(_wandIcon.default); | |
| 3068 | +var EnhanceButton = function EnhanceButton(_ref) { | |
| 3069 | + var isLoading = _ref.isLoading, | |
| 3070 | + props = (0, _objectWithoutProperties2.default)(_ref, _excluded); | |
| 3071 | + return /*#__PURE__*/_react.default.createElement(_ui.Tooltip, { | |
| 3072 | + title: __('Enhance prompt', 'elementor') | |
| 3073 | + }, /*#__PURE__*/_react.default.createElement(_ui.Box, { | |
| 3074 | + component: "span", | |
| 3075 | + sx: { | |
| 3076 | + cursor: props.disabled ? 'default' : 'pointer' | |
| 3077 | + } | |
| 3078 | + }, /*#__PURE__*/_react.default.createElement(_ui.IconButton, (0, _extends2.default)({ | |
| 3079 | + size: "small", | |
| 3080 | + color: "secondary" | |
| 3081 | + }, props), isLoading ? /*#__PURE__*/_react.default.createElement(_ui.CircularProgress, { | |
| 3082 | + color: "secondary", | |
| 3083 | + size: 20 | |
| 3084 | + }) : /*#__PURE__*/_react.default.createElement(StyledWandIcon, null)))); | |
| 3085 | +}; | |
| 3086 | +EnhanceButton.propTypes = { | |
| 3087 | + disabled: PropTypes.bool, | |
| 3088 | + isLoading: PropTypes.bool | |
| 3089 | +}; | |
| 3090 | +var _default = EnhanceButton; | |
| 3091 | +exports["default"] = _default; | |
| 3092 | + | |
| 3093 | +/***/ }), | |
| 3094 | + | |
| 3095 | +/***/ "../modules/ai/assets/js/editor/pages/form-media/components/generate-submit.js": | |
| 3096 | +/*!*************************************************************************************!*\ | |
| 3097 | + !*** ../modules/ai/assets/js/editor/pages/form-media/components/generate-submit.js ***! | |
| 3098 | + \*************************************************************************************/ | |
| 3099 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 3100 | + | |
| 3101 | +"use strict"; | |
| 3102 | +/* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"]; | |
| 3103 | +/* provided dependency */ var PropTypes = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js"); | |
| 3104 | + | |
| 3105 | + | |
| 3106 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 3107 | +Object.defineProperty(exports, "__esModule", ({ | |
| 3108 | + value: true | |
| 3109 | +})); | |
| 3110 | +exports["default"] = void 0; | |
| 3111 | +var _react = _interopRequireDefault(__webpack_require__(/*! react */ "react")); | |
| 3112 | +var _extends2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/extends */ "../node_modules/@babel/runtime/helpers/extends.js")); | |
| 3113 | +var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); | |
| 3114 | +var GenerateSubmit = function GenerateSubmit(props) { | |
| 3115 | + return /*#__PURE__*/_react.default.createElement(_ui.Button, (0, _extends2.default)({ | |
| 3116 | + fullWidth: true, | |
| 3117 | + size: "medium", | |
| 3118 | + type: "submit", | |
| 3119 | + variant: "contained" | |
| 3120 | + }, props), props.children || __('Generate', 'elementor')); | |
| 3121 | +}; | |
| 3122 | +GenerateSubmit.propTypes = { | |
| 3123 | + children: PropTypes.node | |
| 3124 | +}; | |
| 3125 | +var _default = GenerateSubmit; | |
| 3126 | +exports["default"] = _default; | |
| 3127 | + | |
| 3128 | +/***/ }), | |
| 3129 | + | |
| 3130 | +/***/ "../modules/ai/assets/js/editor/pages/get-started/index.js": | |
| 3131 | +/*!*****************************************************************!*\ | |
| 3132 | + !*** ../modules/ai/assets/js/editor/pages/get-started/index.js ***! | |
| 3133 | + \*****************************************************************/ | |
| 3134 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 3135 | + | |
| 3136 | +"use strict"; | |
| 3137 | +/* provided dependency */ var __ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n")["__"]; | |
| 3138 | +/* provided dependency */ var PropTypes = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js"); | |
| 3139 | + | |
| 3140 | + | |
| 3141 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 3142 | +var _typeof = __webpack_require__(/*! @babel/runtime/helpers/typeof */ "../node_modules/@babel/runtime/helpers/typeof.js"); | |
| 3143 | +Object.defineProperty(exports, "__esModule", ({ | |
| 3144 | + value: true | |
| 3145 | +})); | |
| 3146 | +exports["default"] = void 0; | |
| 3147 | +var _react = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); | |
| 3148 | +var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ "../node_modules/@babel/runtime/regenerator/index.js")); | |
| 3149 | +var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "../node_modules/@babel/runtime/helpers/asyncToGenerator.js")); | |
| 3150 | +var _slicedToArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ "../node_modules/@babel/runtime/helpers/slicedToArray.js")); | |
| 3151 | +var _ui = __webpack_require__(/*! @elementor/ui */ "@elementor/ui"); | |
| 3152 | +var _api = __webpack_require__(/*! ../../api */ "../modules/ai/assets/js/editor/api/index.js"); | |
| 3153 | +var _icons = __webpack_require__(/*! @elementor/icons */ "@elementor/icons"); | |
| 3154 | +function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | |
| 3155 | +function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | |
| 3156 | +var GetStarted = function GetStarted(_ref) { | |
| 3157 | + var onSuccess = _ref.onSuccess; | |
| 3158 | + var _useState = (0, _react.useState)(false), | |
| 3159 | + _useState2 = (0, _slicedToArray2.default)(_useState, 2), | |
| 3160 | + isTermsChecked = _useState2[0], | |
| 3161 | + setIsTermsChecked = _useState2[1]; | |
| 3162 | + var onGetStartedClick = /*#__PURE__*/function () { | |
| 3163 | + var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() { | |
| 3164 | + return _regenerator.default.wrap(function _callee$(_context) { | |
| 3165 | + while (1) switch (_context.prev = _context.next) { | |
| 3166 | + case 0: | |
| 3167 | + _context.next = 2; | |
| 3168 | + return (0, _api.setGetStarted)(); | |
| 3169 | + case 2: | |
| 3170 | + onSuccess(); | |
| 3171 | + case 3: | |
| 3172 | + case "end": | |
| 3173 | + return _context.stop(); | |
| 3174 | + } | |
| 3175 | + }, _callee); | |
| 3176 | + })); | |
| 3177 | + return function onGetStartedClick() { | |
| 3178 | + return _ref2.apply(this, arguments); | |
| 3179 | + }; | |
| 3180 | + }(); | |
| 3181 | + return /*#__PURE__*/_react.default.createElement(_ui.Stack, { | |
| 3182 | + alignItems: "center", | |
| 3183 | + gap: 1.5 | |
| 3184 | + }, /*#__PURE__*/_react.default.createElement(_icons.AIIcon, { | |
| 3185 | + sx: { | |
| 3186 | + color: 'text.primary', | |
| 3187 | + fontSize: '60px', | |
| 3188 | + mb: 1 | |
| 3189 | + } | |
| 3190 | + }), /*#__PURE__*/_react.default.createElement(_ui.Typography, { | |
| 3191 | + variant: "h4", | |
| 3192 | + sx: { | |
| 3193 | + color: 'text.primary' | |
| 3194 | + } | |
| 3195 | + }, __('Step into the future with Elementor AI', 'elementor')), /*#__PURE__*/_react.default.createElement(_ui.Typography, { | |
| 3196 | + variant: "body2" | |
| 3197 | + }, __('Create smarter with AI text and code generators built right into the editor.', 'elementor')), /*#__PURE__*/_react.default.createElement(_ui.Stack, { | |
| 3198 | + direction: "row", | |
| 3199 | + gap: 1.5, | |
| 3200 | + alignItems: "flex-start" | |
| 3201 | + }, /*#__PURE__*/_react.default.createElement(_ui.Checkbox, { | |
| 3202 | + id: "e-ai-terms-approval", | |
| 3203 | + color: "secondary", | |
| 3204 | + sx: { | |
| 3205 | + p: 0 | |
| 3206 | + }, | |
| 3207 | + onChange: function onChange() { | |
| 3208 | + return setIsTermsChecked(function (prevState) { | |
| 3209 | + return !prevState; | |
| 3210 | + }); | |
| 3211 | + } | |
| 3212 | + }), /*#__PURE__*/_react.default.createElement(_ui.Stack, null, /*#__PURE__*/_react.default.createElement(_ui.Typography, { | |
| 3213 | + variant: "caption", | |
| 3214 | + sx: { | |
| 3215 | + maxWidth: 520 | |
| 3216 | + }, | |
| 3217 | + component: "label", | |
| 3218 | + htmlFor: "e-ai-terms-approval" | |
| 3219 | + }, __('I approve the ', 'elementor'), /*#__PURE__*/_react.default.createElement(_ui.Link, { | |
| 3220 | + href: "https://go.elementor.com/ai-terms/", | |
| 3221 | + target: "_blank", | |
| 3222 | + color: "info.main" | |
| 3223 | + }, __('Terms of Service', 'elementor')), ' & ', /*#__PURE__*/_react.default.createElement(_ui.Link, { | |
| 3224 | + href: "https://go.elementor.com/ai-privacy-policy/", | |
| 3225 | + target: "_blank", | |
| 3226 | + color: "info.main" | |
| 3227 | + }, __('Privacy Policy', 'elementor')), __(' of the Elementor AI service.', 'elementor'), /*#__PURE__*/_react.default.createElement("br", null), __('This includes consenting to the collection and use of data to improve user experience.', 'elementor')))), /*#__PURE__*/_react.default.createElement(_ui.Button, { | |
| 3228 | + disabled: !isTermsChecked, | |
| 3229 | + variant: "contained", | |
| 3230 | + onClick: onGetStartedClick, | |
| 3231 | + sx: { | |
| 3232 | + mt: 1, | |
| 3233 | + '&:hover': { | |
| 3234 | + color: 'primary.contrastText' | |
| 3235 | + } | |
| 3236 | + } | |
| 3237 | + }, __('Get Started', 'elementor'))); | |
| 3238 | +}; | |
| 3239 | +GetStarted.propTypes = { | |
| 3240 | + onSuccess: PropTypes.func.isRequired | |
| 3241 | +}; | |
| 3242 | +var _default = GetStarted; | |
| 3243 | +exports["default"] = _default; | |
| 3244 | + | |
| 3245 | +/***/ }), | |
| 3246 | + | |
| 3247 | +/***/ "../modules/ai/assets/js/editor/utils/genereate-ids.js": | |
| 3248 | +/*!*************************************************************!*\ | |
| 3249 | + !*** ../modules/ai/assets/js/editor/utils/genereate-ids.js ***! | |
| 3250 | + \*************************************************************/ | |
| 3251 | +/***/ ((__unused_webpack_module, exports) => { | |
| 3252 | + | |
| 3253 | +"use strict"; | |
| 3254 | + | |
| 3255 | + | |
| 3256 | +Object.defineProperty(exports, "__esModule", ({ | |
| 3257 | + value: true | |
| 3258 | +})); | |
| 3259 | +exports.generateIds = generateIds; | |
| 3260 | +// Create missing IDs for the elements. | |
| 3261 | +function generateIds(template) { | |
| 3262 | + var _template$elements; | |
| 3263 | + template.id = elementorCommon.helpers.getUniqueId().toString(); | |
| 3264 | + if ((_template$elements = template.elements) !== null && _template$elements !== void 0 && _template$elements.length) { | |
| 3265 | + template.elements.map(function (child) { | |
| 3266 | + return generateIds(child); | |
| 3267 | + }); | |
| 3268 | + } | |
| 3269 | + return template; | |
| 3270 | +} | |
| 3271 | + | |
| 3272 | +/***/ }), | |
| 3273 | + | |
| 3274 | +/***/ "../modules/ai/assets/js/editor/utils/history.js": | |
| 3275 | +/*!*******************************************************!*\ | |
| 3276 | + !*** ../modules/ai/assets/js/editor/utils/history.js ***! | |
| 3277 | + \*******************************************************/ | |
| 3278 | +/***/ ((__unused_webpack_module, exports) => { | |
| 3279 | + | |
| 3280 | +"use strict"; | |
| 3281 | + | |
| 3282 | + | |
| 3283 | +Object.defineProperty(exports, "__esModule", ({ | |
| 3284 | + value: true | |
| 3285 | +})); | |
| 3286 | +exports.startHistoryLog = startHistoryLog; | |
| 3287 | +exports.toggleHistory = toggleHistory; | |
| 3288 | +function toggleHistory(isActive) { | |
| 3289 | + elementor.documents.getCurrent().history.setActive(isActive); | |
| 3290 | +} | |
| 3291 | + | |
| 3292 | +/** | |
| 3293 | + * @param {Object} options | |
| 3294 | + * @param { 'add' | 'change' | 'disable' | 'duplicate' | 'enable' | 'import' | 'move' | 'paste' | 'paste_style' | 'remove' | 'reset_settings' | 'reset_style' | 'selected' } options.type | |
| 3295 | + * @param { string } options.title | |
| 3296 | + * | |
| 3297 | + * @return {*} | |
| 3298 | + */ | |
| 3299 | +function startHistoryLog(_ref) { | |
| 3300 | + var type = _ref.type, | |
| 3301 | + title = _ref.title; | |
| 3302 | + var id = $e.internal('document/history/start-log', { | |
| 3303 | + type: type, | |
| 3304 | + title: title | |
| 3305 | + }); | |
| 3306 | + return function () { | |
| 3307 | + return $e.internal('document/history/end-log', { | |
| 3308 | + id: id | |
| 3309 | + }); | |
| 3310 | + }; | |
| 3311 | +} | |
| 3312 | + | |
| 3313 | +/***/ }), | |
| 3314 | + | |
| 3315 | +/***/ "../modules/ai/assets/js/editor/utils/preview-container.js": | |
| 3316 | +/*!*****************************************************************!*\ | |
| 3317 | + !*** ../modules/ai/assets/js/editor/utils/preview-container.js ***! | |
| 3318 | + \*****************************************************************/ | |
| 3319 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 3320 | + | |
| 3321 | +"use strict"; | |
| 3322 | + | |
| 3323 | + | |
| 3324 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 3325 | +Object.defineProperty(exports, "__esModule", ({ | |
| 3326 | + value: true | |
| 3327 | +})); | |
| 3328 | +exports.createPreviewContainer = createPreviewContainer; | |
| 3329 | +var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js")); | |
| 3330 | +var _toConsumableArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ "../node_modules/@babel/runtime/helpers/toConsumableArray.js")); | |
| 3331 | +var _history = __webpack_require__(/*! ./history */ "../modules/ai/assets/js/editor/utils/history.js"); | |
| 3332 | +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | |
| 3333 | +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | |
| 3334 | +var PREFIX = 'e-ai-preview-container'; | |
| 3335 | +var CLASS_HIDDEN = PREFIX + '--hidden'; | |
| 3336 | +var CLASS_IDLE = PREFIX + '--idle'; | |
| 3337 | +function createPreviewContainer() { | |
| 3338 | + var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | |
| 3339 | + var createdContainers = new Map(); | |
| 3340 | + var idleContainer = createIdleContainer(options); | |
| 3341 | + function init() { | |
| 3342 | + showContainer(idleContainer); | |
| 3343 | + } | |
| 3344 | + function getAllContainers() { | |
| 3345 | + return [].concat((0, _toConsumableArray2.default)(createdContainers.values()), [idleContainer]); | |
| 3346 | + } | |
| 3347 | + function reset() { | |
| 3348 | + deleteContainers((0, _toConsumableArray2.default)(createdContainers.values())); | |
| 3349 | + createdContainers.clear(); | |
| 3350 | + showContainer(idleContainer); | |
| 3351 | + } | |
| 3352 | + function setContent(template) { | |
| 3353 | + if (!template) { | |
| 3354 | + return; | |
| 3355 | + } | |
| 3356 | + hideContainers(getAllContainers()); | |
| 3357 | + if (!createdContainers.has(template)) { | |
| 3358 | + var newContainer = createContainer(template, options); | |
| 3359 | + createdContainers.set(template, newContainer); | |
| 3360 | + } | |
| 3361 | + showContainer(createdContainers.get(template)); | |
| 3362 | + } | |
| 3363 | + function destroy() { | |
| 3364 | + deleteContainers(getAllContainers()); | |
| 3365 | + createdContainers.clear(); | |
| 3366 | + } | |
| 3367 | + return { | |
| 3368 | + init: init, | |
| 3369 | + reset: reset, | |
| 3370 | + setContent: setContent, | |
| 3371 | + destroy: destroy | |
| 3372 | + }; | |
| 3373 | +} | |
| 3374 | +function createContainer(model) { | |
| 3375 | + var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | |
| 3376 | + (0, _history.toggleHistory)(false); | |
| 3377 | + var container = $e.run('document/elements/create', { | |
| 3378 | + container: elementor.getPreviewContainer(), | |
| 3379 | + model: _objectSpread(_objectSpread({}, model), {}, { | |
| 3380 | + id: "".concat(PREFIX, "-").concat(elementorCommon.helpers.getUniqueId().toString()) | |
| 3381 | + }), | |
| 3382 | + options: _objectSpread(_objectSpread({}, options), {}, { | |
| 3383 | + edit: false | |
| 3384 | + }) | |
| 3385 | + }); | |
| 3386 | + (0, _history.toggleHistory)(true); | |
| 3387 | + container.view.$el.addClass(CLASS_HIDDEN); | |
| 3388 | + return container; | |
| 3389 | +} | |
| 3390 | +function createIdleContainer() { | |
| 3391 | + var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; | |
| 3392 | + // Create an empty container that'll be used of UI purposes. | |
| 3393 | + var container = createContainer({ | |
| 3394 | + elType: 'container' | |
| 3395 | + }, options); | |
| 3396 | + container.view.$el.addClass(CLASS_IDLE); | |
| 3397 | + return container; | |
| 3398 | +} | |
| 3399 | +function hideContainers(containers) { | |
| 3400 | + containers.forEach(function (container) { | |
| 3401 | + container.view.$el.addClass(CLASS_HIDDEN); | |
| 3402 | + }); | |
| 3403 | +} | |
| 3404 | +function showContainer(container) { | |
| 3405 | + container.view.$el.removeClass(CLASS_HIDDEN); | |
| 3406 | + | |
| 3407 | + // Delay the scroll to avoid UI jumps when toggling between containers. | |
| 3408 | + setTimeout(function () { | |
| 3409 | + container.view.$el[0].scrollIntoView({ | |
| 3410 | + behavior: 'smooth', | |
| 3411 | + block: 'start' | |
| 3412 | + }); | |
| 3413 | + }); | |
| 3414 | +} | |
| 3415 | +function deleteContainers(containers) { | |
| 3416 | + (0, _history.toggleHistory)(false); | |
| 3417 | + $e.run('document/elements/delete', { | |
| 3418 | + containers: containers | |
| 3419 | + }); | |
| 3420 | + (0, _history.toggleHistory)(true); | |
| 3421 | +} | |
| 3422 | + | |
| 3423 | +/***/ }), | |
| 3424 | + | |
| 3425 | +/***/ "../modules/ai/assets/js/editor/utils/screenshot.js": | |
| 3426 | +/*!**********************************************************!*\ | |
| 3427 | + !*** ../modules/ai/assets/js/editor/utils/screenshot.js ***! | |
| 3428 | + \**********************************************************/ | |
| 3429 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 3430 | + | |
| 3431 | +"use strict"; | |
| 3432 | + | |
| 3433 | + | |
| 3434 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 3435 | +Object.defineProperty(exports, "__esModule", ({ | |
| 3436 | + value: true | |
| 3437 | +})); | |
| 3438 | +exports.takeScreenshot = void 0; | |
| 3439 | +var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ "../node_modules/@babel/runtime/regenerator/index.js")); | |
| 3440 | +var _toConsumableArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ "../node_modules/@babel/runtime/helpers/toConsumableArray.js")); | |
| 3441 | +var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "../node_modules/@babel/runtime/helpers/asyncToGenerator.js")); | |
| 3442 | +var _htmlToImage = __webpack_require__(/*! html-to-image */ "../node_modules/html-to-image/es/index.js"); | |
| 3443 | +var _history = __webpack_require__(/*! ./history */ "../modules/ai/assets/js/editor/utils/history.js"); | |
| 3444 | +var _genereateIds = __webpack_require__(/*! ./genereate-ids */ "../modules/ai/assets/js/editor/utils/genereate-ids.js"); | |
| 3445 | +var takeScreenshot = /*#__PURE__*/function () { | |
| 3446 | + var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(template) { | |
| 3447 | + var hiddenWrapper, container, screenshot; | |
| 3448 | + return _regenerator.default.wrap(function _callee$(_context) { | |
| 3449 | + while (1) switch (_context.prev = _context.next) { | |
| 3450 | + case 0: | |
| 3451 | + if (template) { | |
| 3452 | + _context.next = 2; | |
| 3453 | + break; | |
| 3454 | + } | |
| 3455 | + return _context.abrupt("return", ''); | |
| 3456 | + case 2: | |
| 3457 | + // Disable history so the Editor won't show our hidden container as a user action. | |
| 3458 | + (0, _history.toggleHistory)(false); | |
| 3459 | + hiddenWrapper = createHiddenWrapper(); | |
| 3460 | + container = createContainer(template); | |
| 3461 | + wrapContainer(container, hiddenWrapper); | |
| 3462 | + elementor.getPreviewView().$childViewContainer[0].appendChild(hiddenWrapper); | |
| 3463 | + | |
| 3464 | + // Wait for the container to render. | |
| 3465 | + _context.next = 9; | |
| 3466 | + return waitForContainer(container.id); | |
| 3467 | + case 9: | |
| 3468 | + _context.prev = 9; | |
| 3469 | + _context.next = 12; | |
| 3470 | + return screenshotNode(container.view.$el[0]); | |
| 3471 | + case 12: | |
| 3472 | + screenshot = _context.sent; | |
| 3473 | + _context.next = 18; | |
| 3474 | + break; | |
| 3475 | + case 15: | |
| 3476 | + _context.prev = 15; | |
| 3477 | + _context.t0 = _context["catch"](9); | |
| 3478 | + // Return an empty image url if the screenshot failed. | |
| 3479 | + screenshot = ''; | |
| 3480 | + case 18: | |
| 3481 | + deleteContainer(container); | |
| 3482 | + hiddenWrapper.remove(); | |
| 3483 | + (0, _history.toggleHistory)(true); | |
| 3484 | + return _context.abrupt("return", screenshot); | |
| 3485 | + case 22: | |
| 3486 | + case "end": | |
| 3487 | + return _context.stop(); | |
| 3488 | + } | |
| 3489 | + }, _callee, null, [[9, 15]]); | |
| 3490 | + })); | |
| 3491 | + return function takeScreenshot(_x) { | |
| 3492 | + return _ref.apply(this, arguments); | |
| 3493 | + }; | |
| 3494 | +}(); | |
| 3495 | +exports.takeScreenshot = takeScreenshot; | |
| 3496 | +function screenshotNode(node) { | |
| 3497 | + return toWebp(node, { | |
| 3498 | + quality: 0.01, | |
| 3499 | + // Transparent 1x1 pixel. | |
| 3500 | + imagePlaceholder: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=' | |
| 3501 | + }); | |
| 3502 | +} | |
| 3503 | +function toWebp(_x2) { | |
| 3504 | + return _toWebp.apply(this, arguments); | |
| 3505 | +} | |
| 3506 | +function _toWebp() { | |
| 3507 | + _toWebp = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(node) { | |
| 3508 | + var _options$quality; | |
| 3509 | + var options, | |
| 3510 | + canvas, | |
| 3511 | + _args3 = arguments; | |
| 3512 | + return _regenerator.default.wrap(function _callee3$(_context3) { | |
| 3513 | + while (1) switch (_context3.prev = _context3.next) { | |
| 3514 | + case 0: | |
| 3515 | + options = _args3.length > 1 && _args3[1] !== undefined ? _args3[1] : {}; | |
| 3516 | + _context3.next = 3; | |
| 3517 | + return (0, _htmlToImage.toCanvas)(node, options); | |
| 3518 | + case 3: | |
| 3519 | + canvas = _context3.sent; | |
| 3520 | + return _context3.abrupt("return", canvas.toDataURL('image/webp', (_options$quality = options.quality) !== null && _options$quality !== void 0 ? _options$quality : 1)); | |
| 3521 | + case 5: | |
| 3522 | + case "end": | |
| 3523 | + return _context3.stop(); | |
| 3524 | + } | |
| 3525 | + }, _callee3); | |
| 3526 | + })); | |
| 3527 | + return _toWebp.apply(this, arguments); | |
| 3528 | +} | |
| 3529 | +function createHiddenWrapper() { | |
| 3530 | + var wrapper = document.createElement('div'); | |
| 3531 | + wrapper.style.position = 'fixed'; | |
| 3532 | + wrapper.style.opacity = '0'; | |
| 3533 | + wrapper.style.inset = '0'; | |
| 3534 | + return wrapper; | |
| 3535 | +} | |
| 3536 | +function createContainer(template) { | |
| 3537 | + var model = (0, _genereateIds.generateIds)(template); | |
| 3538 | + | |
| 3539 | + // Set a custom ID, so it can be used later on in the backend. | |
| 3540 | + model.id = "e-ai-screenshot-container-".concat(model.id); | |
| 3541 | + return $e.run('document/elements/create', { | |
| 3542 | + container: elementor.getPreviewContainer(), | |
| 3543 | + model: model, | |
| 3544 | + options: { | |
| 3545 | + edit: false | |
| 3546 | + } | |
| 3547 | + }); | |
| 3548 | +} | |
| 3549 | +function deleteContainer(container) { | |
| 3550 | + return $e.run('document/elements/delete', { | |
| 3551 | + container: container | |
| 3552 | + }); | |
| 3553 | +} | |
| 3554 | +function waitForContainer(id) { | |
| 3555 | + var timeout = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 5000; | |
| 3556 | + var timeoutPromise = sleep(timeout); | |
| 3557 | + var waitPromise = new Promise(function (resolve) { | |
| 3558 | + elementorFrontend.hooks.addAction('frontend/element_ready/global', /*#__PURE__*/function () { | |
| 3559 | + var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2($element) { | |
| 3560 | + var images; | |
| 3561 | + return _regenerator.default.wrap(function _callee2$(_context2) { | |
| 3562 | + while (1) switch (_context2.prev = _context2.next) { | |
| 3563 | + case 0: | |
| 3564 | + if (!($element.data('id') === id)) { | |
| 3565 | + _context2.next = 5; | |
| 3566 | + break; | |
| 3567 | + } | |
| 3568 | + images = (0, _toConsumableArray2.default)($element[0].querySelectorAll('img')); // Wait for all images to load. | |
| 3569 | + _context2.next = 4; | |
| 3570 | + return Promise.all(images.map(waitForImage)); | |
| 3571 | + case 4: | |
| 3572 | + resolve(); | |
| 3573 | + case 5: | |
| 3574 | + case "end": | |
| 3575 | + return _context2.stop(); | |
| 3576 | + } | |
| 3577 | + }, _callee2); | |
| 3578 | + })); | |
| 3579 | + return function (_x3) { | |
| 3580 | + return _ref2.apply(this, arguments); | |
| 3581 | + }; | |
| 3582 | + }()); | |
| 3583 | + }); | |
| 3584 | + return Promise.any([timeoutPromise, waitPromise]); | |
| 3585 | +} | |
| 3586 | +function waitForImage(image) { | |
| 3587 | + if (image.complete) { | |
| 3588 | + return Promise.resolve(); | |
| 3589 | + } | |
| 3590 | + return new Promise(function (resolve) { | |
| 3591 | + image.addEventListener('load', resolve); | |
| 3592 | + image.addEventListener('error', function () { | |
| 3593 | + // Remove the image to make sure it won't break the screenshot. | |
| 3594 | + image.remove(); | |
| 3595 | + resolve(); | |
| 3596 | + }); | |
| 3597 | + }); | |
| 3598 | +} | |
| 3599 | +function sleep(ms) { | |
| 3600 | + return new Promise(function (resolve) { | |
| 3601 | + return setTimeout(resolve, ms); | |
| 3602 | + }); | |
| 3603 | +} | |
| 3604 | +function wrapContainer(container, wrapper) { | |
| 3605 | + var el = container.view.$el[0]; | |
| 3606 | + el.parentNode.insertBefore(wrapper, el); | |
| 3607 | + wrapper.appendChild(el); | |
| 3608 | +} | |
| 3609 | + | |
| 3610 | +/***/ }), | |
| 3611 | + | |
| 3612 | +/***/ "../node_modules/clsx/dist/clsx.m.js": | |
| 3613 | +/*!*******************************************!*\ | |
| 3614 | + !*** ../node_modules/clsx/dist/clsx.m.js ***! | |
| 3615 | + \*******************************************/ | |
| 3616 | +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { | |
| 3617 | + | |
| 3618 | +"use strict"; | |
| 3619 | +__webpack_require__.r(__webpack_exports__); | |
| 3620 | +/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 3621 | +/* harmony export */ clsx: () => (/* binding */ clsx), | |
| 3622 | +/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__) | |
| 3623 | +/* harmony export */ }); | |
| 3624 | +function r(e){var t,f,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=" "),n+=f);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function clsx(){for(var e,t,f=0,n="";f<arguments.length;)(e=arguments[f++])&&(t=r(e))&&(n&&(n+=" "),n+=t);return n}/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (clsx); | |
| 3625 | + | |
| 3626 | +/***/ }), | |
| 3627 | + | |
| 3628 | +/***/ "../node_modules/html-to-image/es/apply-style.js": | |
| 3629 | +/*!*******************************************************!*\ | |
| 3630 | + !*** ../node_modules/html-to-image/es/apply-style.js ***! | |
| 3631 | + \*******************************************************/ | |
| 3632 | +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { | |
| 3633 | + | |
| 3634 | +"use strict"; | |
| 3635 | +__webpack_require__.r(__webpack_exports__); | |
| 3636 | +/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 3637 | +/* harmony export */ applyStyle: () => (/* binding */ applyStyle) | |
| 3638 | +/* harmony export */ }); | |
| 3639 | +function applyStyle(node, options) { | |
| 3640 | + const { style } = node; | |
| 3641 | + if (options.backgroundColor) { | |
| 3642 | + style.backgroundColor = options.backgroundColor; | |
| 3643 | + } | |
| 3644 | + if (options.width) { | |
| 3645 | + style.width = `${options.width}px`; | |
| 3646 | + } | |
| 3647 | + if (options.height) { | |
| 3648 | + style.height = `${options.height}px`; | |
| 3649 | + } | |
| 3650 | + const manual = options.style; | |
| 3651 | + if (manual != null) { | |
| 3652 | + Object.keys(manual).forEach((key) => { | |
| 3653 | + style[key] = manual[key]; | |
| 3654 | + }); | |
| 3655 | + } | |
| 3656 | + return node; | |
| 3657 | +} | |
| 3658 | +//# sourceMappingURL=apply-style.js.map | |
| 3659 | + | |
| 3660 | +/***/ }), | |
| 3661 | + | |
| 3662 | +/***/ "../node_modules/html-to-image/es/clone-node.js": | |
| 3663 | +/*!******************************************************!*\ | |
| 3664 | + !*** ../node_modules/html-to-image/es/clone-node.js ***! | |
| 3665 | + \******************************************************/ | |
| 3666 | +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { | |
| 3667 | + | |
| 3668 | +"use strict"; | |
| 3669 | +__webpack_require__.r(__webpack_exports__); | |
| 3670 | +/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 3671 | +/* harmony export */ cloneNode: () => (/* binding */ cloneNode) | |
| 3672 | +/* harmony export */ }); | |
| 3673 | +/* harmony import */ var _clone_pseudos__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./clone-pseudos */ "../node_modules/html-to-image/es/clone-pseudos.js"); | |
| 3674 | +/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./util */ "../node_modules/html-to-image/es/util.js"); | |
| 3675 | +/* harmony import */ var _mimes__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./mimes */ "../node_modules/html-to-image/es/mimes.js"); | |
| 3676 | +/* harmony import */ var _dataurl__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./dataurl */ "../node_modules/html-to-image/es/dataurl.js"); | |
| 3677 | + | |
| 3678 | + | |
| 3679 | + | |
| 3680 | + | |
| 3681 | +async function cloneCanvasElement(canvas) { | |
| 3682 | + const dataURL = canvas.toDataURL(); | |
| 3683 | + if (dataURL === 'data:,') { | |
| 3684 | + return canvas.cloneNode(false); | |
| 3685 | + } | |
| 3686 | + return (0,_util__WEBPACK_IMPORTED_MODULE_1__.createImage)(dataURL); | |
| 3687 | +} | |
| 3688 | +async function cloneVideoElement(video, options) { | |
| 3689 | + if (video.currentSrc) { | |
| 3690 | + const canvas = document.createElement('canvas'); | |
| 3691 | + const ctx = canvas.getContext('2d'); | |
| 3692 | + canvas.width = video.clientWidth; | |
| 3693 | + canvas.height = video.clientHeight; | |
| 3694 | + ctx === null || ctx === void 0 ? void 0 : ctx.drawImage(video, 0, 0, canvas.width, canvas.height); | |
| 3695 | + const dataURL = canvas.toDataURL(); | |
| 3696 | + return (0,_util__WEBPACK_IMPORTED_MODULE_1__.createImage)(dataURL); | |
| 3697 | + } | |
| 3698 | + const poster = video.poster; | |
| 3699 | + const contentType = (0,_mimes__WEBPACK_IMPORTED_MODULE_2__.getMimeType)(poster); | |
| 3700 | + const dataURL = await (0,_dataurl__WEBPACK_IMPORTED_MODULE_3__.resourceToDataURL)(poster, contentType, options); | |
| 3701 | + return (0,_util__WEBPACK_IMPORTED_MODULE_1__.createImage)(dataURL); | |
| 3702 | +} | |
| 3703 | +async function cloneIFrameElement(iframe) { | |
| 3704 | + var _a; | |
| 3705 | + try { | |
| 3706 | + if ((_a = iframe === null || iframe === void 0 ? void 0 : iframe.contentDocument) === null || _a === void 0 ? void 0 : _a.body) { | |
| 3707 | + return (await cloneNode(iframe.contentDocument.body, {}, true)); | |
| 3708 | + } | |
| 3709 | + } | |
| 3710 | + catch (_b) { | |
| 3711 | + // Failed to clone iframe | |
| 3712 | + } | |
| 3713 | + return iframe.cloneNode(false); | |
| 3714 | +} | |
| 3715 | +async function cloneSingleNode(node, options) { | |
| 3716 | + if ((0,_util__WEBPACK_IMPORTED_MODULE_1__.isInstanceOfElement)(node, HTMLCanvasElement)) { | |
| 3717 | + return cloneCanvasElement(node); | |
| 3718 | + } | |
| 3719 | + if ((0,_util__WEBPACK_IMPORTED_MODULE_1__.isInstanceOfElement)(node, HTMLVideoElement)) { | |
| 3720 | + return cloneVideoElement(node, options); | |
| 3721 | + } | |
| 3722 | + if ((0,_util__WEBPACK_IMPORTED_MODULE_1__.isInstanceOfElement)(node, HTMLIFrameElement)) { | |
| 3723 | + return cloneIFrameElement(node); | |
| 3724 | + } | |
| 3725 | + return node.cloneNode(false); | |
| 3726 | +} | |
| 3727 | +const isSlotElement = (node) => node.tagName != null && node.tagName.toUpperCase() === 'SLOT'; | |
| 3728 | +async function cloneChildren(nativeNode, clonedNode, options) { | |
| 3729 | + var _a, _b; | |
| 3730 | + let children = []; | |
| 3731 | + if (isSlotElement(nativeNode) && nativeNode.assignedNodes) { | |
| 3732 | + children = (0,_util__WEBPACK_IMPORTED_MODULE_1__.toArray)(nativeNode.assignedNodes()); | |
| 3733 | + } | |
| 3734 | + else if ((0,_util__WEBPACK_IMPORTED_MODULE_1__.isInstanceOfElement)(nativeNode, HTMLIFrameElement) && | |
| 3735 | + ((_a = nativeNode.contentDocument) === null || _a === void 0 ? void 0 : _a.body)) { | |
| 3736 | + children = (0,_util__WEBPACK_IMPORTED_MODULE_1__.toArray)(nativeNode.contentDocument.body.childNodes); | |
| 3737 | + } | |
| 3738 | + else { | |
| 3739 | + children = (0,_util__WEBPACK_IMPORTED_MODULE_1__.toArray)(((_b = nativeNode.shadowRoot) !== null && _b !== void 0 ? _b : nativeNode).childNodes); | |
| 3740 | + } | |
| 3741 | + if (children.length === 0 || | |
| 3742 | + (0,_util__WEBPACK_IMPORTED_MODULE_1__.isInstanceOfElement)(nativeNode, HTMLVideoElement)) { | |
| 3743 | + return clonedNode; | |
| 3744 | + } | |
| 3745 | + await children.reduce((deferred, child) => deferred | |
| 3746 | + .then(() => cloneNode(child, options)) | |
| 3747 | + .then((clonedChild) => { | |
| 3748 | + if (clonedChild) { | |
| 3749 | + clonedNode.appendChild(clonedChild); | |
| 3750 | + } | |
| 3751 | + }), Promise.resolve()); | |
| 3752 | + return clonedNode; | |
| 3753 | +} | |
| 3754 | +function cloneCSSStyle(nativeNode, clonedNode) { | |
| 3755 | + const targetStyle = clonedNode.style; | |
| 3756 | + if (!targetStyle) { | |
| 3757 | + return; | |
| 3758 | + } | |
| 3759 | + const sourceStyle = window.getComputedStyle(nativeNode); | |
| 3760 | + if (sourceStyle.cssText) { | |
| 3761 | + targetStyle.cssText = sourceStyle.cssText; | |
| 3762 | + targetStyle.transformOrigin = sourceStyle.transformOrigin; | |
| 3763 | + } | |
| 3764 | + else { | |
| 3765 | + (0,_util__WEBPACK_IMPORTED_MODULE_1__.toArray)(sourceStyle).forEach((name) => { | |
| 3766 | + let value = sourceStyle.getPropertyValue(name); | |
| 3767 | + if (name === 'font-size' && value.endsWith('px')) { | |
| 3768 | + const reducedFont = Math.floor(parseFloat(value.substring(0, value.length - 2))) - 0.1; | |
| 3769 | + value = `${reducedFont}px`; | |
| 3770 | + } | |
| 3771 | + if ((0,_util__WEBPACK_IMPORTED_MODULE_1__.isInstanceOfElement)(nativeNode, HTMLIFrameElement) && | |
| 3772 | + name === 'display' && | |
| 3773 | + value === 'inline') { | |
| 3774 | + value = 'block'; | |
| 3775 | + } | |
| 3776 | + if (name === 'd' && clonedNode.getAttribute('d')) { | |
| 3777 | + value = `path(${clonedNode.getAttribute('d')})`; | |
| 3778 | + } | |
| 3779 | + targetStyle.setProperty(name, value, sourceStyle.getPropertyPriority(name)); | |
| 3780 | + }); | |
| 3781 | + } | |
| 3782 | +} | |
| 3783 | +function cloneInputValue(nativeNode, clonedNode) { | |
| 3784 | + if ((0,_util__WEBPACK_IMPORTED_MODULE_1__.isInstanceOfElement)(nativeNode, HTMLTextAreaElement)) { | |
| 3785 | + clonedNode.innerHTML = nativeNode.value; | |
| 3786 | + } | |
| 3787 | + if ((0,_util__WEBPACK_IMPORTED_MODULE_1__.isInstanceOfElement)(nativeNode, HTMLInputElement)) { | |
| 3788 | + clonedNode.setAttribute('value', nativeNode.value); | |
| 3789 | + } | |
| 3790 | +} | |
| 3791 | +function cloneSelectValue(nativeNode, clonedNode) { | |
| 3792 | + if ((0,_util__WEBPACK_IMPORTED_MODULE_1__.isInstanceOfElement)(nativeNode, HTMLSelectElement)) { | |
| 3793 | + const clonedSelect = clonedNode; | |
| 3794 | + const selectedOption = Array.from(clonedSelect.children).find((child) => nativeNode.value === child.getAttribute('value')); | |
| 3795 | + if (selectedOption) { | |
| 3796 | + selectedOption.setAttribute('selected', ''); | |
| 3797 | + } | |
| 3798 | + } | |
| 3799 | +} | |
| 3800 | +function decorate(nativeNode, clonedNode) { | |
| 3801 | + if ((0,_util__WEBPACK_IMPORTED_MODULE_1__.isInstanceOfElement)(clonedNode, Element)) { | |
| 3802 | + cloneCSSStyle(nativeNode, clonedNode); | |
| 3803 | + (0,_clone_pseudos__WEBPACK_IMPORTED_MODULE_0__.clonePseudoElements)(nativeNode, clonedNode); | |
| 3804 | + cloneInputValue(nativeNode, clonedNode); | |
| 3805 | + cloneSelectValue(nativeNode, clonedNode); | |
| 3806 | + } | |
| 3807 | + return clonedNode; | |
| 3808 | +} | |
| 3809 | +async function ensureSVGSymbols(clone, options) { | |
| 3810 | + const uses = clone.querySelectorAll ? clone.querySelectorAll('use') : []; | |
| 3811 | + if (uses.length === 0) { | |
| 3812 | + return clone; | |
| 3813 | + } | |
| 3814 | + const processedDefs = {}; | |
| 3815 | + for (let i = 0; i < uses.length; i++) { | |
| 3816 | + const use = uses[i]; | |
| 3817 | + const id = use.getAttribute('xlink:href'); | |
| 3818 | + if (id) { | |
| 3819 | + const exist = clone.querySelector(id); | |
| 3820 | + const definition = document.querySelector(id); | |
| 3821 | + if (!exist && definition && !processedDefs[id]) { | |
| 3822 | + // eslint-disable-next-line no-await-in-loop | |
| 3823 | + processedDefs[id] = (await cloneNode(definition, options, true)); | |
| 3824 | + } | |
| 3825 | + } | |
| 3826 | + } | |
| 3827 | + const nodes = Object.values(processedDefs); | |
| 3828 | + if (nodes.length) { | |
| 3829 | + const ns = 'http://www.w3.org/1999/xhtml'; | |
| 3830 | + const svg = document.createElementNS(ns, 'svg'); | |
| 3831 | + svg.setAttribute('xmlns', ns); | |
| 3832 | + svg.style.position = 'absolute'; | |
| 3833 | + svg.style.width = '0'; | |
| 3834 | + svg.style.height = '0'; | |
| 3835 | + svg.style.overflow = 'hidden'; | |
| 3836 | + svg.style.display = 'none'; | |
| 3837 | + const defs = document.createElementNS(ns, 'defs'); | |
| 3838 | + svg.appendChild(defs); | |
| 3839 | + for (let i = 0; i < nodes.length; i++) { | |
| 3840 | + defs.appendChild(nodes[i]); | |
| 3841 | + } | |
| 3842 | + clone.appendChild(svg); | |
| 3843 | + } | |
| 3844 | + return clone; | |
| 3845 | +} | |
| 3846 | +async function cloneNode(node, options, isRoot) { | |
| 3847 | + if (!isRoot && options.filter && !options.filter(node)) { | |
| 3848 | + return null; | |
| 3849 | + } | |
| 3850 | + return Promise.resolve(node) | |
| 3851 | + .then((clonedNode) => cloneSingleNode(clonedNode, options)) | |
| 3852 | + .then((clonedNode) => cloneChildren(node, clonedNode, options)) | |
| 3853 | + .then((clonedNode) => decorate(node, clonedNode)) | |
| 3854 | + .then((clonedNode) => ensureSVGSymbols(clonedNode, options)); | |
| 3855 | +} | |
| 3856 | +//# sourceMappingURL=clone-node.js.map | |
| 3857 | + | |
| 3858 | +/***/ }), | |
| 3859 | + | |
| 3860 | +/***/ "../node_modules/html-to-image/es/clone-pseudos.js": | |
| 3861 | +/*!*********************************************************!*\ | |
| 3862 | + !*** ../node_modules/html-to-image/es/clone-pseudos.js ***! | |
| 3863 | + \*********************************************************/ | |
| 3864 | +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { | |
| 3865 | + | |
| 3866 | +"use strict"; | |
| 3867 | +__webpack_require__.r(__webpack_exports__); | |
| 3868 | +/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 3869 | +/* harmony export */ clonePseudoElements: () => (/* binding */ clonePseudoElements) | |
| 3870 | +/* harmony export */ }); | |
| 3871 | +/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./util */ "../node_modules/html-to-image/es/util.js"); | |
| 3872 | + | |
| 3873 | +function formatCSSText(style) { | |
| 3874 | + const content = style.getPropertyValue('content'); | |
| 3875 | + return `${style.cssText} content: '${content.replace(/'|"/g, '')}';`; | |
| 3876 | +} | |
| 3877 | +function formatCSSProperties(style) { | |
| 3878 | + return (0,_util__WEBPACK_IMPORTED_MODULE_0__.toArray)(style) | |
| 3879 | + .map((name) => { | |
| 3880 | + const value = style.getPropertyValue(name); | |
| 3881 | + const priority = style.getPropertyPriority(name); | |
| 3882 | + return `${name}: ${value}${priority ? ' !important' : ''};`; | |
| 3883 | + }) | |
| 3884 | + .join(' '); | |
| 3885 | +} | |
| 3886 | +function getPseudoElementStyle(className, pseudo, style) { | |
| 3887 | + const selector = `.${className}:${pseudo}`; | |
| 3888 | + const cssText = style.cssText | |
| 3889 | + ? formatCSSText(style) | |
| 3890 | + : formatCSSProperties(style); | |
| 3891 | + return document.createTextNode(`${selector}{${cssText}}`); | |
| 3892 | +} | |
| 3893 | +function clonePseudoElement(nativeNode, clonedNode, pseudo) { | |
| 3894 | + const style = window.getComputedStyle(nativeNode, pseudo); | |
| 3895 | + const content = style.getPropertyValue('content'); | |
| 3896 | + if (content === '' || content === 'none') { | |
| 3897 | + return; | |
| 3898 | + } | |
| 3899 | + const className = (0,_util__WEBPACK_IMPORTED_MODULE_0__.uuid)(); | |
| 3900 | + try { | |
| 3901 | + clonedNode.className = `${clonedNode.className} ${className}`; | |
| 3902 | + } | |
| 3903 | + catch (err) { | |
| 3904 | + return; | |
| 3905 | + } | |
| 3906 | + const styleElement = document.createElement('style'); | |
| 3907 | + styleElement.appendChild(getPseudoElementStyle(className, pseudo, style)); | |
| 3908 | + clonedNode.appendChild(styleElement); | |
| 3909 | +} | |
| 3910 | +function clonePseudoElements(nativeNode, clonedNode) { | |
| 3911 | + clonePseudoElement(nativeNode, clonedNode, ':before'); | |
| 3912 | + clonePseudoElement(nativeNode, clonedNode, ':after'); | |
| 3913 | +} | |
| 3914 | +//# sourceMappingURL=clone-pseudos.js.map | |
| 3915 | + | |
| 3916 | +/***/ }), | |
| 3917 | + | |
| 3918 | +/***/ "../node_modules/html-to-image/es/dataurl.js": | |
| 3919 | +/*!***************************************************!*\ | |
| 3920 | + !*** ../node_modules/html-to-image/es/dataurl.js ***! | |
| 3921 | + \***************************************************/ | |
| 3922 | +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { | |
| 3923 | + | |
| 3924 | +"use strict"; | |
| 3925 | +__webpack_require__.r(__webpack_exports__); | |
| 3926 | +/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 3927 | +/* harmony export */ fetchAsDataURL: () => (/* binding */ fetchAsDataURL), | |
| 3928 | +/* harmony export */ isDataUrl: () => (/* binding */ isDataUrl), | |
| 3929 | +/* harmony export */ makeDataUrl: () => (/* binding */ makeDataUrl), | |
| 3930 | +/* harmony export */ resourceToDataURL: () => (/* binding */ resourceToDataURL) | |
| 3931 | +/* harmony export */ }); | |
| 3932 | +function getContentFromDataUrl(dataURL) { | |
| 3933 | + return dataURL.split(/,/)[1]; | |
| 3934 | +} | |
| 3935 | +function isDataUrl(url) { | |
| 3936 | + return url.search(/^(data:)/) !== -1; | |
| 3937 | +} | |
| 3938 | +function makeDataUrl(content, mimeType) { | |
| 3939 | + return `data:${mimeType};base64,${content}`; | |
| 3940 | +} | |
| 3941 | +async function fetchAsDataURL(url, init, process) { | |
| 3942 | + const res = await fetch(url, init); | |
| 3943 | + if (res.status === 404) { | |
| 3944 | + throw new Error(`Resource "${res.url}" not found`); | |
| 3945 | + } | |
| 3946 | + const blob = await res.blob(); | |
| 3947 | + return new Promise((resolve, reject) => { | |
| 3948 | + const reader = new FileReader(); | |
| 3949 | + reader.onerror = reject; | |
| 3950 | + reader.onloadend = () => { | |
| 3951 | + try { | |
| 3952 | + resolve(process({ res, result: reader.result })); | |
| 3953 | + } | |
| 3954 | + catch (error) { | |
| 3955 | + reject(error); | |
| 3956 | + } | |
| 3957 | + }; | |
| 3958 | + reader.readAsDataURL(blob); | |
| 3959 | + }); | |
| 3960 | +} | |
| 3961 | +const cache = {}; | |
| 3962 | +function getCacheKey(url, contentType, includeQueryParams) { | |
| 3963 | + let key = url.replace(/\?.*/, ''); | |
| 3964 | + if (includeQueryParams) { | |
| 3965 | + key = url; | |
| 3966 | + } | |
| 3967 | + // font resource | |
| 3968 | + if (/ttf|otf|eot|woff2?/i.test(key)) { | |
| 3969 | + key = key.replace(/.*\//, ''); | |
| 3970 | + } | |
| 3971 | + return contentType ? `[${contentType}]${key}` : key; | |
| 3972 | +} | |
| 3973 | +async function resourceToDataURL(resourceUrl, contentType, options) { | |
| 3974 | + const cacheKey = getCacheKey(resourceUrl, contentType, options.includeQueryParams); | |
| 3975 | + if (cache[cacheKey] != null) { | |
| 3976 | + return cache[cacheKey]; | |
| 3977 | + } | |
| 3978 | + // ref: https://developer.mozilla.org/en/docs/Web/API/XMLHttpRequest/Using_XMLHttpRequest#Bypassing_the_cache | |
| 3979 | + if (options.cacheBust) { | |
| 3980 | + // eslint-disable-next-line no-param-reassign | |
| 3981 | + resourceUrl += (/\?/.test(resourceUrl) ? '&' : '?') + new Date().getTime(); | |
| 3982 | + } | |
| 3983 | + let dataURL; | |
| 3984 | + try { | |
| 3985 | + const content = await fetchAsDataURL(resourceUrl, options.fetchRequestInit, ({ res, result }) => { | |
| 3986 | + if (!contentType) { | |
| 3987 | + // eslint-disable-next-line no-param-reassign | |
| 3988 | + contentType = res.headers.get('Content-Type') || ''; | |
| 3989 | + } | |
| 3990 | + return getContentFromDataUrl(result); | |
| 3991 | + }); | |
| 3992 | + dataURL = makeDataUrl(content, contentType); | |
| 3993 | + } | |
| 3994 | + catch (error) { | |
| 3995 | + dataURL = options.imagePlaceholder || ''; | |
| 3996 | + let msg = `Failed to fetch resource: ${resourceUrl}`; | |
| 3997 | + if (error) { | |
| 3998 | + msg = typeof error === 'string' ? error : error.message; | |
| 3999 | + } | |
| 4000 | + if (msg) { | |
| 4001 | + console.warn(msg); | |
| 4002 | + } | |
| 4003 | + } | |
| 4004 | + cache[cacheKey] = dataURL; | |
| 4005 | + return dataURL; | |
| 4006 | +} | |
| 4007 | +//# sourceMappingURL=dataurl.js.map | |
| 4008 | + | |
| 4009 | +/***/ }), | |
| 4010 | + | |
| 4011 | +/***/ "../node_modules/html-to-image/es/embed-images.js": | |
| 4012 | +/*!********************************************************!*\ | |
| 4013 | + !*** ../node_modules/html-to-image/es/embed-images.js ***! | |
| 4014 | + \********************************************************/ | |
| 4015 | +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { | |
| 4016 | + | |
| 4017 | +"use strict"; | |
| 4018 | +__webpack_require__.r(__webpack_exports__); | |
| 4019 | +/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 4020 | +/* harmony export */ embedImages: () => (/* binding */ embedImages) | |
| 4021 | +/* harmony export */ }); | |
| 4022 | +/* harmony import */ var _embed_resources__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./embed-resources */ "../node_modules/html-to-image/es/embed-resources.js"); | |
| 4023 | +/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./util */ "../node_modules/html-to-image/es/util.js"); | |
| 4024 | +/* harmony import */ var _dataurl__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./dataurl */ "../node_modules/html-to-image/es/dataurl.js"); | |
| 4025 | +/* harmony import */ var _mimes__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./mimes */ "../node_modules/html-to-image/es/mimes.js"); | |
| 4026 | + | |
| 4027 | + | |
| 4028 | + | |
| 4029 | + | |
| 4030 | +async function embedProp(propName, node, options) { | |
| 4031 | + var _a; | |
| 4032 | + const propValue = (_a = node.style) === null || _a === void 0 ? void 0 : _a.getPropertyValue(propName); | |
| 4033 | + if (propValue) { | |
| 4034 | + const cssString = await (0,_embed_resources__WEBPACK_IMPORTED_MODULE_0__.embedResources)(propValue, null, options); | |
| 4035 | + node.style.setProperty(propName, cssString, node.style.getPropertyPriority(propName)); | |
| 4036 | + return true; | |
| 4037 | + } | |
| 4038 | + return false; | |
| 4039 | +} | |
| 4040 | +async function embedBackground(clonedNode, options) { | |
| 4041 | + if (!(await embedProp('background', clonedNode, options))) { | |
| 4042 | + await embedProp('background-image', clonedNode, options); | |
| 4043 | + } | |
| 4044 | + if (!(await embedProp('mask', clonedNode, options))) { | |
| 4045 | + await embedProp('mask-image', clonedNode, options); | |
| 4046 | + } | |
| 4047 | +} | |
| 4048 | +async function embedImageNode(clonedNode, options) { | |
| 4049 | + const isImageElement = (0,_util__WEBPACK_IMPORTED_MODULE_1__.isInstanceOfElement)(clonedNode, HTMLImageElement); | |
| 4050 | + if (!(isImageElement && !(0,_dataurl__WEBPACK_IMPORTED_MODULE_2__.isDataUrl)(clonedNode.src)) && | |
| 4051 | + !((0,_util__WEBPACK_IMPORTED_MODULE_1__.isInstanceOfElement)(clonedNode, SVGImageElement) && | |
| 4052 | + !(0,_dataurl__WEBPACK_IMPORTED_MODULE_2__.isDataUrl)(clonedNode.href.baseVal))) { | |
| 4053 | + return; | |
| 4054 | + } | |
| 4055 | + const url = isImageElement ? clonedNode.src : clonedNode.href.baseVal; | |
| 4056 | + const dataURL = await (0,_dataurl__WEBPACK_IMPORTED_MODULE_2__.resourceToDataURL)(url, (0,_mimes__WEBPACK_IMPORTED_MODULE_3__.getMimeType)(url), options); | |
| 4057 | + await new Promise((resolve, reject) => { | |
| 4058 | + clonedNode.onload = resolve; | |
| 4059 | + clonedNode.onerror = reject; | |
| 4060 | + const image = clonedNode; | |
| 4061 | + if (image.decode) { | |
| 4062 | + image.decode = resolve; | |
| 4063 | + } | |
| 4064 | + if (image.loading === 'lazy') { | |
| 4065 | + image.loading = 'eager'; | |
| 4066 | + } | |
| 4067 | + if (isImageElement) { | |
| 4068 | + clonedNode.srcset = ''; | |
| 4069 | + clonedNode.src = dataURL; | |
| 4070 | + } | |
| 4071 | + else { | |
| 4072 | + clonedNode.href.baseVal = dataURL; | |
| 4073 | + } | |
| 4074 | + }); | |
| 4075 | +} | |
| 4076 | +async function embedChildren(clonedNode, options) { | |
| 4077 | + const children = (0,_util__WEBPACK_IMPORTED_MODULE_1__.toArray)(clonedNode.childNodes); | |
| 4078 | + const deferreds = children.map((child) => embedImages(child, options)); | |
| 4079 | + await Promise.all(deferreds).then(() => clonedNode); | |
| 4080 | +} | |
| 4081 | +async function embedImages(clonedNode, options) { | |
| 4082 | + if ((0,_util__WEBPACK_IMPORTED_MODULE_1__.isInstanceOfElement)(clonedNode, Element)) { | |
| 4083 | + await embedBackground(clonedNode, options); | |
| 4084 | + await embedImageNode(clonedNode, options); | |
| 4085 | + await embedChildren(clonedNode, options); | |
| 4086 | + } | |
| 4087 | +} | |
| 4088 | +//# sourceMappingURL=embed-images.js.map | |
| 4089 | + | |
| 4090 | +/***/ }), | |
| 4091 | + | |
| 4092 | +/***/ "../node_modules/html-to-image/es/embed-resources.js": | |
| 4093 | +/*!***********************************************************!*\ | |
| 4094 | + !*** ../node_modules/html-to-image/es/embed-resources.js ***! | |
| 4095 | + \***********************************************************/ | |
| 4096 | +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { | |
| 4097 | + | |
| 4098 | +"use strict"; | |
| 4099 | +__webpack_require__.r(__webpack_exports__); | |
| 4100 | +/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 4101 | +/* harmony export */ embed: () => (/* binding */ embed), | |
| 4102 | +/* harmony export */ embedResources: () => (/* binding */ embedResources), | |
| 4103 | +/* harmony export */ parseURLs: () => (/* binding */ parseURLs), | |
| 4104 | +/* harmony export */ shouldEmbed: () => (/* binding */ shouldEmbed) | |
| 4105 | +/* harmony export */ }); | |
| 4106 | +/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./util */ "../node_modules/html-to-image/es/util.js"); | |
| 4107 | +/* harmony import */ var _mimes__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./mimes */ "../node_modules/html-to-image/es/mimes.js"); | |
| 4108 | +/* harmony import */ var _dataurl__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./dataurl */ "../node_modules/html-to-image/es/dataurl.js"); | |
| 4109 | + | |
| 4110 | + | |
| 4111 | + | |
| 4112 | +const URL_REGEX = /url\((['"]?)([^'"]+?)\1\)/g; | |
| 4113 | +const URL_WITH_FORMAT_REGEX = /url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g; | |
| 4114 | +const FONT_SRC_REGEX = /src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g; | |
| 4115 | +function toRegex(url) { | |
| 4116 | + // eslint-disable-next-line no-useless-escape | |
| 4117 | + const escaped = url.replace(/([.*+?^${}()|\[\]\/\\])/g, '\\$1'); | |
| 4118 | + return new RegExp(`(url\\(['"]?)(${escaped})(['"]?\\))`, 'g'); | |
| 4119 | +} | |
| 4120 | +function parseURLs(cssText) { | |
| 4121 | + const urls = []; | |
| 4122 | + cssText.replace(URL_REGEX, (raw, quotation, url) => { | |
| 4123 | + urls.push(url); | |
| 4124 | + return raw; | |
| 4125 | + }); | |
| 4126 | + return urls.filter((url) => !(0,_dataurl__WEBPACK_IMPORTED_MODULE_2__.isDataUrl)(url)); | |
| 4127 | +} | |
| 4128 | +async function embed(cssText, resourceURL, baseURL, options, getContentFromUrl) { | |
| 4129 | + try { | |
| 4130 | + const resolvedURL = baseURL ? (0,_util__WEBPACK_IMPORTED_MODULE_0__.resolveUrl)(resourceURL, baseURL) : resourceURL; | |
| 4131 | + const contentType = (0,_mimes__WEBPACK_IMPORTED_MODULE_1__.getMimeType)(resourceURL); | |
| 4132 | + let dataURL; | |
| 4133 | + if (getContentFromUrl) { | |
| 4134 | + const content = await getContentFromUrl(resolvedURL); | |
| 4135 | + dataURL = (0,_dataurl__WEBPACK_IMPORTED_MODULE_2__.makeDataUrl)(content, contentType); | |
| 4136 | + } | |
| 4137 | + else { | |
| 4138 | + dataURL = await (0,_dataurl__WEBPACK_IMPORTED_MODULE_2__.resourceToDataURL)(resolvedURL, contentType, options); | |
| 4139 | + } | |
| 4140 | + return cssText.replace(toRegex(resourceURL), `$1${dataURL}$3`); | |
| 4141 | + } | |
| 4142 | + catch (error) { | |
| 4143 | + // pass | |
| 4144 | + } | |
| 4145 | + return cssText; | |
| 4146 | +} | |
| 4147 | +function filterPreferredFontFormat(str, { preferredFontFormat }) { | |
| 4148 | + return !preferredFontFormat | |
| 4149 | + ? str | |
| 4150 | + : str.replace(FONT_SRC_REGEX, (match) => { | |
| 4151 | + // eslint-disable-next-line no-constant-condition | |
| 4152 | + while (true) { | |
| 4153 | + const [src, , format] = URL_WITH_FORMAT_REGEX.exec(match) || []; | |
| 4154 | + if (!format) { | |
| 4155 | + return ''; | |
| 4156 | + } | |
| 4157 | + if (format === preferredFontFormat) { | |
| 4158 | + return `src: ${src};`; | |
| 4159 | + } | |
| 4160 | + } | |
| 4161 | + }); | |
| 4162 | +} | |
| 4163 | +function shouldEmbed(url) { | |
| 4164 | + return url.search(URL_REGEX) !== -1; | |
| 4165 | +} | |
| 4166 | +async function embedResources(cssText, baseUrl, options) { | |
| 4167 | + if (!shouldEmbed(cssText)) { | |
| 4168 | + return cssText; | |
| 4169 | + } | |
| 4170 | + const filteredCSSText = filterPreferredFontFormat(cssText, options); | |
| 4171 | + const urls = parseURLs(filteredCSSText); | |
| 4172 | + return urls.reduce((deferred, url) => deferred.then((css) => embed(css, url, baseUrl, options)), Promise.resolve(filteredCSSText)); | |
| 4173 | +} | |
| 4174 | +//# sourceMappingURL=embed-resources.js.map | |
| 4175 | + | |
| 4176 | +/***/ }), | |
| 4177 | + | |
| 4178 | +/***/ "../node_modules/html-to-image/es/embed-webfonts.js": | |
| 4179 | +/*!**********************************************************!*\ | |
| 4180 | + !*** ../node_modules/html-to-image/es/embed-webfonts.js ***! | |
| 4181 | + \**********************************************************/ | |
| 4182 | +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { | |
| 4183 | + | |
| 4184 | +"use strict"; | |
| 4185 | +__webpack_require__.r(__webpack_exports__); | |
| 4186 | +/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 4187 | +/* harmony export */ embedWebFonts: () => (/* binding */ embedWebFonts), | |
| 4188 | +/* harmony export */ getWebFontCSS: () => (/* binding */ getWebFontCSS) | |
| 4189 | +/* harmony export */ }); | |
| 4190 | +/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./util */ "../node_modules/html-to-image/es/util.js"); | |
| 4191 | +/* harmony import */ var _dataurl__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./dataurl */ "../node_modules/html-to-image/es/dataurl.js"); | |
| 4192 | +/* harmony import */ var _embed_resources__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./embed-resources */ "../node_modules/html-to-image/es/embed-resources.js"); | |
| 4193 | + | |
| 4194 | + | |
| 4195 | + | |
| 4196 | +const cssFetchCache = {}; | |
| 4197 | +async function fetchCSS(url) { | |
| 4198 | + let cache = cssFetchCache[url]; | |
| 4199 | + if (cache != null) { | |
| 4200 | + return cache; | |
| 4201 | + } | |
| 4202 | + const res = await fetch(url); | |
| 4203 | + const cssText = await res.text(); | |
| 4204 | + cache = { url, cssText }; | |
| 4205 | + cssFetchCache[url] = cache; | |
| 4206 | + return cache; | |
| 4207 | +} | |
| 4208 | +async function embedFonts(data, options) { | |
| 4209 | + let cssText = data.cssText; | |
| 4210 | + const regexUrl = /url\(["']?([^"')]+)["']?\)/g; | |
| 4211 | + const fontLocs = cssText.match(/url\([^)]+\)/g) || []; | |
| 4212 | + const loadFonts = fontLocs.map(async (loc) => { | |
| 4213 | + let url = loc.replace(regexUrl, '$1'); | |
| 4214 | + if (!url.startsWith('https://')) { | |
| 4215 | + url = new URL(url, data.url).href; | |
| 4216 | + } | |
| 4217 | + return (0,_dataurl__WEBPACK_IMPORTED_MODULE_1__.fetchAsDataURL)(url, options.fetchRequestInit, ({ result }) => { | |
| 4218 | + cssText = cssText.replace(loc, `url(${result})`); | |
| 4219 | + return [loc, result]; | |
| 4220 | + }); | |
| 4221 | + }); | |
| 4222 | + return Promise.all(loadFonts).then(() => cssText); | |
| 4223 | +} | |
| 4224 | +function parseCSS(source) { | |
| 4225 | + if (source == null) { | |
| 4226 | + return []; | |
| 4227 | + } | |
| 4228 | + const result = []; | |
| 4229 | + const commentsRegex = /(\/\*[\s\S]*?\*\/)/gi; | |
| 4230 | + // strip out comments | |
| 4231 | + let cssText = source.replace(commentsRegex, ''); | |
| 4232 | + // eslint-disable-next-line prefer-regex-literals | |
| 4233 | + const keyframesRegex = new RegExp('((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})', 'gi'); | |
| 4234 | + // eslint-disable-next-line no-constant-condition | |
| 4235 | + while (true) { | |
| 4236 | + const matches = keyframesRegex.exec(cssText); | |
| 4237 | + if (matches === null) { | |
| 4238 | + break; | |
| 4239 | + } | |
| 4240 | + result.push(matches[0]); | |
| 4241 | + } | |
| 4242 | + cssText = cssText.replace(keyframesRegex, ''); | |
| 4243 | + const importRegex = /@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi; | |
| 4244 | + // to match css & media queries together | |
| 4245 | + const combinedCSSRegex = '((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]' + | |
| 4246 | + '*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})'; | |
| 4247 | + // unified regex | |
| 4248 | + const unifiedRegex = new RegExp(combinedCSSRegex, 'gi'); | |
| 4249 | + // eslint-disable-next-line no-constant-condition | |
| 4250 | + while (true) { | |
| 4251 | + let matches = importRegex.exec(cssText); | |
| 4252 | + if (matches === null) { | |
| 4253 | + matches = unifiedRegex.exec(cssText); | |
| 4254 | + if (matches === null) { | |
| 4255 | + break; | |
| 4256 | + } | |
| 4257 | + else { | |
| 4258 | + importRegex.lastIndex = unifiedRegex.lastIndex; | |
| 4259 | + } | |
| 4260 | + } | |
| 4261 | + else { | |
| 4262 | + unifiedRegex.lastIndex = importRegex.lastIndex; | |
| 4263 | + } | |
| 4264 | + result.push(matches[0]); | |
| 4265 | + } | |
| 4266 | + return result; | |
| 4267 | +} | |
| 4268 | +async function getCSSRules(styleSheets, options) { | |
| 4269 | + const ret = []; | |
| 4270 | + const deferreds = []; | |
| 4271 | + // First loop inlines imports | |
| 4272 | + styleSheets.forEach((sheet) => { | |
| 4273 | + if ('cssRules' in sheet) { | |
| 4274 | + try { | |
| 4275 | + (0,_util__WEBPACK_IMPORTED_MODULE_0__.toArray)(sheet.cssRules || []).forEach((item, index) => { | |
| 4276 | + if (item.type === CSSRule.IMPORT_RULE) { | |
| 4277 | + let importIndex = index + 1; | |
| 4278 | + const url = item.href; | |
| 4279 | + const deferred = fetchCSS(url) | |
| 4280 | + .then((metadata) => embedFonts(metadata, options)) | |
| 4281 | + .then((cssText) => parseCSS(cssText).forEach((rule) => { | |
| 4282 | + try { | |
| 4283 | + sheet.insertRule(rule, rule.startsWith('@import') | |
| 4284 | + ? (importIndex += 1) | |
| 4285 | + : sheet.cssRules.length); | |
| 4286 | + } | |
| 4287 | + catch (error) { | |
| 4288 | + console.error('Error inserting rule from remote css', { | |
| 4289 | + rule, | |
| 4290 | + error, | |
| 4291 | + }); | |
| 4292 | + } | |
| 4293 | + })) | |
| 4294 | + .catch((e) => { | |
| 4295 | + console.error('Error loading remote css', e.toString()); | |
| 4296 | + }); | |
| 4297 | + deferreds.push(deferred); | |
| 4298 | + } | |
| 4299 | + }); | |
| 4300 | + } | |
| 4301 | + catch (e) { | |
| 4302 | + const inline = styleSheets.find((a) => a.href == null) || document.styleSheets[0]; | |
| 4303 | + if (sheet.href != null) { | |
| 4304 | + deferreds.push(fetchCSS(sheet.href) | |
| 4305 | + .then((metadata) => embedFonts(metadata, options)) | |
| 4306 | + .then((cssText) => parseCSS(cssText).forEach((rule) => { | |
| 4307 | + inline.insertRule(rule, sheet.cssRules.length); | |
| 4308 | + })) | |
| 4309 | + .catch((err) => { | |
| 4310 | + console.error('Error loading remote stylesheet', err); | |
| 4311 | + })); | |
| 4312 | + } | |
| 4313 | + console.error('Error inlining remote css file', e); | |
| 4314 | + } | |
| 4315 | + } | |
| 4316 | + }); | |
| 4317 | + return Promise.all(deferreds).then(() => { | |
| 4318 | + // Second loop parses rules | |
| 4319 | + styleSheets.forEach((sheet) => { | |
| 4320 | + if ('cssRules' in sheet) { | |
| 4321 | + try { | |
| 4322 | + (0,_util__WEBPACK_IMPORTED_MODULE_0__.toArray)(sheet.cssRules || []).forEach((item) => { | |
| 4323 | + ret.push(item); | |
| 4324 | + }); | |
| 4325 | + } | |
| 4326 | + catch (e) { | |
| 4327 | + console.error(`Error while reading CSS rules from ${sheet.href}`, e); | |
| 4328 | + } | |
| 4329 | + } | |
| 4330 | + }); | |
| 4331 | + return ret; | |
| 4332 | + }); | |
| 4333 | +} | |
| 4334 | +function getWebFontRules(cssRules) { | |
| 4335 | + return cssRules | |
| 4336 | + .filter((rule) => rule.type === CSSRule.FONT_FACE_RULE) | |
| 4337 | + .filter((rule) => (0,_embed_resources__WEBPACK_IMPORTED_MODULE_2__.shouldEmbed)(rule.style.getPropertyValue('src'))); | |
| 4338 | +} | |
| 4339 | +async function parseWebFontRules(node, options) { | |
| 4340 | + if (node.ownerDocument == null) { | |
| 4341 | + throw new Error('Provided element is not within a Document'); | |
| 4342 | + } | |
| 4343 | + const styleSheets = (0,_util__WEBPACK_IMPORTED_MODULE_0__.toArray)(node.ownerDocument.styleSheets); | |
| 4344 | + const cssRules = await getCSSRules(styleSheets, options); | |
| 4345 | + return getWebFontRules(cssRules); | |
| 4346 | +} | |
| 4347 | +async function getWebFontCSS(node, options) { | |
| 4348 | + const rules = await parseWebFontRules(node, options); | |
| 4349 | + const cssTexts = await Promise.all(rules.map((rule) => { | |
| 4350 | + const baseUrl = rule.parentStyleSheet ? rule.parentStyleSheet.href : null; | |
| 4351 | + return (0,_embed_resources__WEBPACK_IMPORTED_MODULE_2__.embedResources)(rule.cssText, baseUrl, options); | |
| 4352 | + })); | |
| 4353 | + return cssTexts.join('\n'); | |
| 4354 | +} | |
| 4355 | +async function embedWebFonts(clonedNode, options) { | |
| 4356 | + const cssText = options.fontEmbedCSS != null | |
| 4357 | + ? options.fontEmbedCSS | |
| 4358 | + : options.skipFonts | |
| 4359 | + ? null | |
| 4360 | + : await getWebFontCSS(clonedNode, options); | |
| 4361 | + if (cssText) { | |
| 4362 | + const styleNode = document.createElement('style'); | |
| 4363 | + const sytleContent = document.createTextNode(cssText); | |
| 4364 | + styleNode.appendChild(sytleContent); | |
| 4365 | + if (clonedNode.firstChild) { | |
| 4366 | + clonedNode.insertBefore(styleNode, clonedNode.firstChild); | |
| 4367 | + } | |
| 4368 | + else { | |
| 4369 | + clonedNode.appendChild(styleNode); | |
| 4370 | + } | |
| 4371 | + } | |
| 4372 | +} | |
| 4373 | +//# sourceMappingURL=embed-webfonts.js.map | |
| 4374 | + | |
| 4375 | +/***/ }), | |
| 4376 | + | |
| 4377 | +/***/ "../node_modules/html-to-image/es/index.js": | |
| 4378 | +/*!*************************************************!*\ | |
| 4379 | + !*** ../node_modules/html-to-image/es/index.js ***! | |
| 4380 | + \*************************************************/ | |
| 4381 | +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { | |
| 4382 | + | |
| 4383 | +"use strict"; | |
| 4384 | +__webpack_require__.r(__webpack_exports__); | |
| 4385 | +/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 4386 | +/* harmony export */ getFontEmbedCSS: () => (/* binding */ getFontEmbedCSS), | |
| 4387 | +/* harmony export */ toBlob: () => (/* binding */ toBlob), | |
| 4388 | +/* harmony export */ toCanvas: () => (/* binding */ toCanvas), | |
| 4389 | +/* harmony export */ toJpeg: () => (/* binding */ toJpeg), | |
| 4390 | +/* harmony export */ toPixelData: () => (/* binding */ toPixelData), | |
| 4391 | +/* harmony export */ toPng: () => (/* binding */ toPng), | |
| 4392 | +/* harmony export */ toSvg: () => (/* binding */ toSvg) | |
| 4393 | +/* harmony export */ }); | |
| 4394 | +/* harmony import */ var _clone_node__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./clone-node */ "../node_modules/html-to-image/es/clone-node.js"); | |
| 4395 | +/* harmony import */ var _embed_images__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./embed-images */ "../node_modules/html-to-image/es/embed-images.js"); | |
| 4396 | +/* harmony import */ var _apply_style__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./apply-style */ "../node_modules/html-to-image/es/apply-style.js"); | |
| 4397 | +/* harmony import */ var _embed_webfonts__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./embed-webfonts */ "../node_modules/html-to-image/es/embed-webfonts.js"); | |
| 4398 | +/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./util */ "../node_modules/html-to-image/es/util.js"); | |
| 4399 | + | |
| 4400 | + | |
| 4401 | + | |
| 4402 | + | |
| 4403 | + | |
| 4404 | +async function toSvg(node, options = {}) { | |
| 4405 | + const { width, height } = (0,_util__WEBPACK_IMPORTED_MODULE_4__.getImageSize)(node, options); | |
| 4406 | + const clonedNode = (await (0,_clone_node__WEBPACK_IMPORTED_MODULE_0__.cloneNode)(node, options, true)); | |
| 4407 | + await (0,_embed_webfonts__WEBPACK_IMPORTED_MODULE_3__.embedWebFonts)(clonedNode, options); | |
| 4408 | + await (0,_embed_images__WEBPACK_IMPORTED_MODULE_1__.embedImages)(clonedNode, options); | |
| 4409 | + (0,_apply_style__WEBPACK_IMPORTED_MODULE_2__.applyStyle)(clonedNode, options); | |
| 4410 | + const datauri = await (0,_util__WEBPACK_IMPORTED_MODULE_4__.nodeToDataURL)(clonedNode, width, height); | |
| 4411 | + return datauri; | |
| 4412 | +} | |
| 4413 | +async function toCanvas(node, options = {}) { | |
| 4414 | + const { width, height } = (0,_util__WEBPACK_IMPORTED_MODULE_4__.getImageSize)(node, options); | |
| 4415 | + const svg = await toSvg(node, options); | |
| 4416 | + const img = await (0,_util__WEBPACK_IMPORTED_MODULE_4__.createImage)(svg); | |
| 4417 | + const canvas = document.createElement('canvas'); | |
| 4418 | + const context = canvas.getContext('2d'); | |
| 4419 | + const ratio = options.pixelRatio || (0,_util__WEBPACK_IMPORTED_MODULE_4__.getPixelRatio)(); | |
| 4420 | + const canvasWidth = options.canvasWidth || width; | |
| 4421 | + const canvasHeight = options.canvasHeight || height; | |
| 4422 | + canvas.width = canvasWidth * ratio; | |
| 4423 | + canvas.height = canvasHeight * ratio; | |
| 4424 | + if (!options.skipAutoScale) { | |
| 4425 | + (0,_util__WEBPACK_IMPORTED_MODULE_4__.checkCanvasDimensions)(canvas); | |
| 4426 | + } | |
| 4427 | + canvas.style.width = `${canvasWidth}`; | |
| 4428 | + canvas.style.height = `${canvasHeight}`; | |
| 4429 | + if (options.backgroundColor) { | |
| 4430 | + context.fillStyle = options.backgroundColor; | |
| 4431 | + context.fillRect(0, 0, canvas.width, canvas.height); | |
| 4432 | + } | |
| 4433 | + context.drawImage(img, 0, 0, canvas.width, canvas.height); | |
| 4434 | + return canvas; | |
| 4435 | +} | |
| 4436 | +async function toPixelData(node, options = {}) { | |
| 4437 | + const { width, height } = (0,_util__WEBPACK_IMPORTED_MODULE_4__.getImageSize)(node, options); | |
| 4438 | + const canvas = await toCanvas(node, options); | |
| 4439 | + const ctx = canvas.getContext('2d'); | |
| 4440 | + return ctx.getImageData(0, 0, width, height).data; | |
| 4441 | +} | |
| 4442 | +async function toPng(node, options = {}) { | |
| 4443 | + const canvas = await toCanvas(node, options); | |
| 4444 | + return canvas.toDataURL(); | |
| 4445 | +} | |
| 4446 | +async function toJpeg(node, options = {}) { | |
| 4447 | + const canvas = await toCanvas(node, options); | |
| 4448 | + return canvas.toDataURL('image/jpeg', options.quality || 1); | |
| 4449 | +} | |
| 4450 | +async function toBlob(node, options = {}) { | |
| 4451 | + const canvas = await toCanvas(node, options); | |
| 4452 | + const blob = await (0,_util__WEBPACK_IMPORTED_MODULE_4__.canvasToBlob)(canvas); | |
| 4453 | + return blob; | |
| 4454 | +} | |
| 4455 | +async function getFontEmbedCSS(node, options = {}) { | |
| 4456 | + return (0,_embed_webfonts__WEBPACK_IMPORTED_MODULE_3__.getWebFontCSS)(node, options); | |
| 4457 | +} | |
| 4458 | +//# sourceMappingURL=index.js.map | |
| 4459 | + | |
| 4460 | +/***/ }), | |
| 4461 | + | |
| 4462 | +/***/ "../node_modules/html-to-image/es/mimes.js": | |
| 4463 | +/*!*************************************************!*\ | |
| 4464 | + !*** ../node_modules/html-to-image/es/mimes.js ***! | |
| 4465 | + \*************************************************/ | |
| 4466 | +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { | |
| 4467 | + | |
| 4468 | +"use strict"; | |
| 4469 | +__webpack_require__.r(__webpack_exports__); | |
| 4470 | +/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 4471 | +/* harmony export */ getMimeType: () => (/* binding */ getMimeType) | |
| 4472 | +/* harmony export */ }); | |
| 4473 | +const WOFF = 'application/font-woff'; | |
| 4474 | +const JPEG = 'image/jpeg'; | |
| 4475 | +const mimes = { | |
| 4476 | + woff: WOFF, | |
| 4477 | + woff2: WOFF, | |
| 4478 | + ttf: 'application/font-truetype', | |
| 4479 | + eot: 'application/vnd.ms-fontobject', | |
| 4480 | + png: 'image/png', | |
| 4481 | + jpg: JPEG, | |
| 4482 | + jpeg: JPEG, | |
| 4483 | + gif: 'image/gif', | |
| 4484 | + tiff: 'image/tiff', | |
| 4485 | + svg: 'image/svg+xml', | |
| 4486 | + webp: 'image/webp', | |
| 4487 | +}; | |
| 4488 | +function getExtension(url) { | |
| 4489 | + const match = /\.([^./]*?)$/g.exec(url); | |
| 4490 | + return match ? match[1] : ''; | |
| 4491 | +} | |
| 4492 | +function getMimeType(url) { | |
| 4493 | + const extension = getExtension(url).toLowerCase(); | |
| 4494 | + return mimes[extension] || ''; | |
| 4495 | +} | |
| 4496 | +//# sourceMappingURL=mimes.js.map | |
| 4497 | + | |
| 4498 | +/***/ }), | |
| 4499 | + | |
| 4500 | +/***/ "../node_modules/html-to-image/es/util.js": | |
| 4501 | +/*!************************************************!*\ | |
| 4502 | + !*** ../node_modules/html-to-image/es/util.js ***! | |
| 4503 | + \************************************************/ | |
| 4504 | +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { | |
| 4505 | + | |
| 4506 | +"use strict"; | |
| 4507 | +__webpack_require__.r(__webpack_exports__); | |
| 4508 | +/* harmony export */ __webpack_require__.d(__webpack_exports__, { | |
| 4509 | +/* harmony export */ canvasToBlob: () => (/* binding */ canvasToBlob), | |
| 4510 | +/* harmony export */ checkCanvasDimensions: () => (/* binding */ checkCanvasDimensions), | |
| 4511 | +/* harmony export */ createImage: () => (/* binding */ createImage), | |
| 4512 | +/* harmony export */ delay: () => (/* binding */ delay), | |
| 4513 | +/* harmony export */ getImageSize: () => (/* binding */ getImageSize), | |
| 4514 | +/* harmony export */ getPixelRatio: () => (/* binding */ getPixelRatio), | |
| 4515 | +/* harmony export */ isInstanceOfElement: () => (/* binding */ isInstanceOfElement), | |
| 4516 | +/* harmony export */ nodeToDataURL: () => (/* binding */ nodeToDataURL), | |
| 4517 | +/* harmony export */ resolveUrl: () => (/* binding */ resolveUrl), | |
| 4518 | +/* harmony export */ svgToDataURL: () => (/* binding */ svgToDataURL), | |
| 4519 | +/* harmony export */ toArray: () => (/* binding */ toArray), | |
| 4520 | +/* harmony export */ uuid: () => (/* binding */ uuid) | |
| 4521 | +/* harmony export */ }); | |
| 4522 | +function resolveUrl(url, baseUrl) { | |
| 4523 | + // url is absolute already | |
| 4524 | + if (url.match(/^[a-z]+:\/\//i)) { | |
| 4525 | + return url; | |
| 4526 | + } | |
| 4527 | + // url is absolute already, without protocol | |
| 4528 | + if (url.match(/^\/\//)) { | |
| 4529 | + return window.location.protocol + url; | |
| 4530 | + } | |
| 4531 | + // dataURI, mailto:, tel:, etc. | |
| 4532 | + if (url.match(/^[a-z]+:/i)) { | |
| 4533 | + return url; | |
| 4534 | + } | |
| 4535 | + const doc = document.implementation.createHTMLDocument(); | |
| 4536 | + const base = doc.createElement('base'); | |
| 4537 | + const a = doc.createElement('a'); | |
| 4538 | + doc.head.appendChild(base); | |
| 4539 | + doc.body.appendChild(a); | |
| 4540 | + if (baseUrl) { | |
| 4541 | + base.href = baseUrl; | |
| 4542 | + } | |
| 4543 | + a.href = url; | |
| 4544 | + return a.href; | |
| 4545 | +} | |
| 4546 | +const uuid = (() => { | |
| 4547 | + // generate uuid for className of pseudo elements. | |
| 4548 | + // We should not use GUIDs, otherwise pseudo elements sometimes cannot be captured. | |
| 4549 | + let counter = 0; | |
| 4550 | + // ref: http://stackoverflow.com/a/6248722/2519373 | |
| 4551 | + const random = () => | |
| 4552 | + // eslint-disable-next-line no-bitwise | |
| 4553 | + `0000${((Math.random() * 36 ** 4) << 0).toString(36)}`.slice(-4); | |
| 4554 | + return () => { | |
| 4555 | + counter += 1; | |
| 4556 | + return `u${random()}${counter}`; | |
| 4557 | + }; | |
| 4558 | +})(); | |
| 4559 | +function delay(ms) { | |
| 4560 | + return (args) => new Promise((resolve) => { | |
| 4561 | + setTimeout(() => resolve(args), ms); | |
| 4562 | + }); | |
| 4563 | +} | |
| 4564 | +function toArray(arrayLike) { | |
| 4565 | + const arr = []; | |
| 4566 | + for (let i = 0, l = arrayLike.length; i < l; i++) { | |
| 4567 | + arr.push(arrayLike[i]); | |
| 4568 | + } | |
| 4569 | + return arr; | |
| 4570 | +} | |
| 4571 | +function px(node, styleProperty) { | |
| 4572 | + const win = node.ownerDocument.defaultView || window; | |
| 4573 | + const val = win.getComputedStyle(node).getPropertyValue(styleProperty); | |
| 4574 | + return val ? parseFloat(val.replace('px', '')) : 0; | |
| 4575 | +} | |
| 4576 | +function getNodeWidth(node) { | |
| 4577 | + const leftBorder = px(node, 'border-left-width'); | |
| 4578 | + const rightBorder = px(node, 'border-right-width'); | |
| 4579 | + return node.clientWidth + leftBorder + rightBorder; | |
| 4580 | +} | |
| 4581 | +function getNodeHeight(node) { | |
| 4582 | + const topBorder = px(node, 'border-top-width'); | |
| 4583 | + const bottomBorder = px(node, 'border-bottom-width'); | |
| 4584 | + return node.clientHeight + topBorder + bottomBorder; | |
| 4585 | +} | |
| 4586 | +function getImageSize(targetNode, options = {}) { | |
| 4587 | + const width = options.width || getNodeWidth(targetNode); | |
| 4588 | + const height = options.height || getNodeHeight(targetNode); | |
| 4589 | + return { width, height }; | |
| 4590 | +} | |
| 4591 | +function getPixelRatio() { | |
| 4592 | + let ratio; | |
| 4593 | + let FINAL_PROCESS; | |
| 4594 | + try { | |
| 4595 | + FINAL_PROCESS = process; | |
| 4596 | + } | |
| 4597 | + catch (e) { | |
| 4598 | + // pass | |
| 4599 | + } | |
| 4600 | + const val = FINAL_PROCESS && FINAL_PROCESS.env | |
| 4601 | + ? FINAL_PROCESS.env.devicePixelRatio | |
| 4602 | + : null; | |
| 4603 | + if (val) { | |
| 4604 | + ratio = parseInt(val, 10); | |
| 4605 | + if (Number.isNaN(ratio)) { | |
| 4606 | + ratio = 1; | |
| 4607 | + } | |
| 4608 | + } | |
| 4609 | + return ratio || window.devicePixelRatio || 1; | |
| 4610 | +} | |
| 4611 | +// @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/canvas#maximum_canvas_size | |
| 4612 | +const canvasDimensionLimit = 16384; | |
| 4613 | +function checkCanvasDimensions(canvas) { | |
| 4614 | + if (canvas.width > canvasDimensionLimit || | |
| 4615 | + canvas.height > canvasDimensionLimit) { | |
| 4616 | + if (canvas.width > canvasDimensionLimit && | |
| 4617 | + canvas.height > canvasDimensionLimit) { | |
| 4618 | + if (canvas.width > canvas.height) { | |
| 4619 | + canvas.height *= canvasDimensionLimit / canvas.width; | |
| 4620 | + canvas.width = canvasDimensionLimit; | |
| 4621 | + } | |
| 4622 | + else { | |
| 4623 | + canvas.width *= canvasDimensionLimit / canvas.height; | |
| 4624 | + canvas.height = canvasDimensionLimit; | |
| 4625 | + } | |
| 4626 | + } | |
| 4627 | + else if (canvas.width > canvasDimensionLimit) { | |
| 4628 | + canvas.height *= canvasDimensionLimit / canvas.width; | |
| 4629 | + canvas.width = canvasDimensionLimit; | |
| 4630 | + } | |
| 4631 | + else { | |
| 4632 | + canvas.width *= canvasDimensionLimit / canvas.height; | |
| 4633 | + canvas.height = canvasDimensionLimit; | |
| 4634 | + } | |
| 4635 | + } | |
| 4636 | +} | |
| 4637 | +function canvasToBlob(canvas, options = {}) { | |
| 4638 | + if (canvas.toBlob) { | |
| 4639 | + return new Promise((resolve) => { | |
| 4640 | + canvas.toBlob(resolve, options.type ? options.type : 'image/png', options.quality ? options.quality : 1); | |
| 4641 | + }); | |
| 4642 | + } | |
| 4643 | + return new Promise((resolve) => { | |
| 4644 | + const binaryString = window.atob(canvas | |
| 4645 | + .toDataURL(options.type ? options.type : undefined, options.quality ? options.quality : undefined) | |
| 4646 | + .split(',')[1]); | |
| 4647 | + const len = binaryString.length; | |
| 4648 | + const binaryArray = new Uint8Array(len); | |
| 4649 | + for (let i = 0; i < len; i += 1) { | |
| 4650 | + binaryArray[i] = binaryString.charCodeAt(i); | |
| 4651 | + } | |
| 4652 | + resolve(new Blob([binaryArray], { | |
| 4653 | + type: options.type ? options.type : 'image/png', | |
| 4654 | + })); | |
| 4655 | + }); | |
| 4656 | +} | |
| 4657 | +function createImage(url) { | |
| 4658 | + return new Promise((resolve, reject) => { | |
| 4659 | + const img = new Image(); | |
| 4660 | + img.decode = () => resolve(img); | |
| 4661 | + img.onload = () => resolve(img); | |
| 4662 | + img.onerror = reject; | |
| 4663 | + img.crossOrigin = 'anonymous'; | |
| 4664 | + img.decoding = 'async'; | |
| 4665 | + img.src = url; | |
| 4666 | + }); | |
| 4667 | +} | |
| 4668 | +async function svgToDataURL(svg) { | |
| 4669 | + return Promise.resolve() | |
| 4670 | + .then(() => new XMLSerializer().serializeToString(svg)) | |
| 4671 | + .then(encodeURIComponent) | |
| 4672 | + .then((html) => `data:image/svg+xml;charset=utf-8,${html}`); | |
| 4673 | +} | |
| 4674 | +async function nodeToDataURL(node, width, height) { | |
| 4675 | + const xmlns = 'http://www.w3.org/2000/svg'; | |
| 4676 | + const svg = document.createElementNS(xmlns, 'svg'); | |
| 4677 | + const foreignObject = document.createElementNS(xmlns, 'foreignObject'); | |
| 4678 | + svg.setAttribute('width', `${width}`); | |
| 4679 | + svg.setAttribute('height', `${height}`); | |
| 4680 | + svg.setAttribute('viewBox', `0 0 ${width} ${height}`); | |
| 4681 | + foreignObject.setAttribute('width', '100%'); | |
| 4682 | + foreignObject.setAttribute('height', '100%'); | |
| 4683 | + foreignObject.setAttribute('x', '0'); | |
| 4684 | + foreignObject.setAttribute('y', '0'); | |
| 4685 | + foreignObject.setAttribute('externalResourcesRequired', 'true'); | |
| 4686 | + svg.appendChild(foreignObject); | |
| 4687 | + foreignObject.appendChild(node); | |
| 4688 | + return svgToDataURL(svg); | |
| 4689 | +} | |
| 4690 | +const isInstanceOfElement = (node, instance) => { | |
| 4691 | + if (node instanceof instance) | |
| 4692 | + return true; | |
| 4693 | + const nodePrototype = Object.getPrototypeOf(node); | |
| 4694 | + if (nodePrototype === null) | |
| 4695 | + return false; | |
| 4696 | + return (nodePrototype.constructor.name === instance.name || | |
| 4697 | + isInstanceOfElement(nodePrototype, instance)); | |
| 4698 | +}; | |
| 4699 | +//# sourceMappingURL=util.js.map | |
| 4700 | + | |
| 4701 | +/***/ }), | |
| 4702 | + | |
| 4703 | +/***/ "../node_modules/object-assign/index.js": | |
| 4704 | +/*!**********************************************!*\ | |
| 4705 | + !*** ../node_modules/object-assign/index.js ***! | |
| 4706 | + \**********************************************/ | |
| 4707 | +/***/ ((module) => { | |
| 4708 | + | |
| 4709 | +"use strict"; | |
| 4710 | +/* | |
| 4711 | +object-assign | |
| 4712 | +(c) Sindre Sorhus | |
| 4713 | +@license MIT | |
| 4714 | +*/ | |
| 4715 | + | |
| 4716 | + | |
| 4717 | +/* eslint-disable no-unused-vars */ | |
| 4718 | +var getOwnPropertySymbols = Object.getOwnPropertySymbols; | |
| 4719 | +var hasOwnProperty = Object.prototype.hasOwnProperty; | |
| 4720 | +var propIsEnumerable = Object.prototype.propertyIsEnumerable; | |
| 4721 | + | |
| 4722 | +function toObject(val) { | |
| 4723 | + if (val === null || val === undefined) { | |
| 4724 | + throw new TypeError('Object.assign cannot be called with null or undefined'); | |
| 653 | 4725 | } |
| 654 | - var init_toConsumableArray = __esmMin((() => { | |
| 655 | - init_arrayWithoutHoles(); | |
| 656 | - init_iterableToArray(); | |
| 657 | - init_unsupportedIterableToArray(); | |
| 658 | - init_nonIterableSpread(); | |
| 659 | - })); | |
| 660 | 4726 | |
| 661 | -//#endregion | |
| 662 | -//#region modules/ai/assets/js/editor/utils/history.js | |
| 663 | - function toggleHistory(isActive) { | |
| 664 | - elementor.documents.getCurrent().history.setActive(isActive); | |
| 665 | - } | |
| 666 | - /** | |
| 667 | - * @param {Object} options | |
| 668 | - * @param { 'add' | 'change' | 'disable' | 'duplicate' | 'enable' | 'import' | 'move' | 'paste' | 'paste_style' | 'remove' | 'reset_settings' | 'reset_style' | 'selected' } options.type | |
| 669 | - * @param { string } options.title | |
| 670 | - * | |
| 671 | - * @return {*} | |
| 672 | - */ | |
| 673 | - function startHistoryLog(_ref) { | |
| 674 | - var type = _ref.type; | |
| 675 | - var title = _ref.title; | |
| 676 | - var id = $e.internal("document/history/start-log", { | |
| 677 | - type, | |
| 678 | - title | |
| 679 | - }); | |
| 680 | - return function() { | |
| 681 | - return $e.internal("document/history/end-log", { id }); | |
| 682 | - }; | |
| 683 | - } | |
| 684 | - var init_history = __esmMin((() => {})); | |
| 4727 | + return Object(val); | |
| 4728 | +} | |
| 685 | 4729 | |
| 686 | -//#endregion | |
| 687 | -//#region modules/ai/assets/js/editor/utils/preview-container.js | |
| 688 | - function ownKeys$12(e, r) { | |
| 689 | - var t = Object.keys(e); | |
| 690 | - if (Object.getOwnPropertySymbols) { | |
| 691 | - var o = Object.getOwnPropertySymbols(e); | |
| 692 | - r && (o = o.filter(function(r) { | |
| 693 | - return Object.getOwnPropertyDescriptor(e, r).enumerable; | |
| 694 | - })), t.push.apply(t, o); | |
| 4730 | +function shouldUseNative() { | |
| 4731 | + try { | |
| 4732 | + if (!Object.assign) { | |
| 4733 | + return false; | |
| 695 | 4734 | } |
| 696 | - return t; | |
| 697 | - } | |
| 698 | - function _objectSpread$11(e) { | |
| 699 | - for (var r = 1; r < arguments.length; r++) { | |
| 700 | - var t = null != arguments[r] ? arguments[r] : {}; | |
| 701 | - r % 2 ? ownKeys$12(Object(t), !0).forEach(function(r) { | |
| 702 | - _defineProperty$1(e, r, t[r]); | |
| 703 | - }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$12(Object(t)).forEach(function(r) { | |
| 704 | - Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); | |
| 705 | - }); | |
| 4735 | + | |
| 4736 | + // Detect buggy property enumeration order in older V8 versions. | |
| 4737 | + | |
| 4738 | + // https://bugs.chromium.org/p/v8/issues/detail?id=4118 | |
| 4739 | + var test1 = new String('abc'); // eslint-disable-line no-new-wrappers | |
| 4740 | + test1[5] = 'de'; | |
| 4741 | + if (Object.getOwnPropertyNames(test1)[0] === '5') { | |
| 4742 | + return false; | |
| 706 | 4743 | } |
| 707 | - return e; | |
| 708 | - } | |
| 709 | - /** | |
| 710 | - * @param {Container} parentContainer | |
| 711 | - * @param {{}} containerOptions | |
| 712 | - * @return {{init, setContent, reset, destroy}} | |
| 713 | - */ | |
| 714 | - function createPreviewContainer(parentContainer) { | |
| 715 | - var containerOptions = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; | |
| 716 | - var createdContainers = /* @__PURE__ */ new Map(); | |
| 717 | - var idleContainer = createIdleContainer(parentContainer, containerOptions); | |
| 718 | - function init() { | |
| 719 | - showContainer(idleContainer); | |
| 4744 | + | |
| 4745 | + // https://bugs.chromium.org/p/v8/issues/detail?id=3056 | |
| 4746 | + var test2 = {}; | |
| 4747 | + for (var i = 0; i < 10; i++) { | |
| 4748 | + test2['_' + String.fromCharCode(i)] = i; | |
| 720 | 4749 | } |
| 721 | - function getAllContainers() { | |
| 722 | - return [].concat(_toConsumableArray(createdContainers.values()), [idleContainer]); | |
| 4750 | + var order2 = Object.getOwnPropertyNames(test2).map(function (n) { | |
| 4751 | + return test2[n]; | |
| 4752 | + }); | |
| 4753 | + if (order2.join('') !== '0123456789') { | |
| 4754 | + return false; | |
| 723 | 4755 | } |
| 724 | - function reset() { | |
| 725 | - deleteContainers(_toConsumableArray(createdContainers.values())); | |
| 726 | - createdContainers.clear(); | |
| 727 | - showContainer(idleContainer); | |
| 4756 | + | |
| 4757 | + // https://bugs.chromium.org/p/v8/issues/detail?id=3056 | |
| 4758 | + var test3 = {}; | |
| 4759 | + 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { | |
| 4760 | + test3[letter] = letter; | |
| 4761 | + }); | |
| 4762 | + if (Object.keys(Object.assign({}, test3)).join('') !== | |
| 4763 | + 'abcdefghijklmnopqrst') { | |
| 4764 | + return false; | |
| 728 | 4765 | } |
| 729 | - function setContent(template) { | |
| 730 | - if (!template) return; | |
| 731 | - hideContainers(getAllContainers()); | |
| 732 | - if (!createdContainers.has(template)) { | |
| 733 | - var newContainer = createContainer$1(parentContainer, template, containerOptions); | |
| 734 | - createdContainers.set(template, newContainer); | |
| 735 | - } | |
| 736 | - showContainer(createdContainers.get(template)); | |
| 737 | - } | |
| 738 | - function destroy() { | |
| 739 | - deleteContainers(getAllContainers()); | |
| 740 | - createdContainers.clear(); | |
| 741 | - } | |
| 742 | - return { | |
| 743 | - init, | |
| 744 | - reset, | |
| 745 | - setContent, | |
| 746 | - destroy | |
| 747 | - }; | |
| 4766 | + | |
| 4767 | + return true; | |
| 4768 | + } catch (err) { | |
| 4769 | + // We don't expect any of the above to throw, but better to be safe. | |
| 4770 | + return false; | |
| 748 | 4771 | } |
| 749 | - /** | |
| 750 | - * @param {Container} parentContainer | |
| 751 | - * @param {{}} model | |
| 752 | - * @param {{}} options | |
| 753 | - * @return {*} | |
| 754 | - */ | |
| 755 | - function createContainer$1(parentContainer, model) { | |
| 756 | - var options = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : {}; | |
| 757 | - toggleHistory(false); | |
| 758 | - var container = $e.run("document/elements/create", { | |
| 759 | - container: parentContainer, | |
| 760 | - model: _objectSpread$11(_objectSpread$11({}, model), {}, { id: "".concat(PREFIX, "-").concat(elementorCommon.helpers.getUniqueId().toString()) }), | |
| 761 | - options: _objectSpread$11(_objectSpread$11({}, options), {}, { edit: false }) | |
| 762 | - }); | |
| 763 | - toggleHistory(true); | |
| 764 | - container.view.$el.addClass(CLASS_HIDDEN); | |
| 765 | - return container; | |
| 766 | - } | |
| 767 | - /** | |
| 768 | - * @param {Container} parentContainer | |
| 769 | - * @param {{}} containerOptions | |
| 770 | - * @return {*} | |
| 771 | - */ | |
| 772 | - function createIdleContainer(parentContainer) { | |
| 773 | - var container = createContainer$1(parentContainer, { elType: "container" }, arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}); | |
| 774 | - container.view.$el.addClass(CLASS_IDLE); | |
| 775 | - return container; | |
| 776 | - } | |
| 777 | - function hideContainers(containers) { | |
| 778 | - containers.forEach(function(container) { | |
| 779 | - container.view.$el.addClass(CLASS_HIDDEN); | |
| 780 | - }); | |
| 781 | - } | |
| 782 | - function showContainer(container) { | |
| 783 | - container.view.$el.removeClass(CLASS_HIDDEN); | |
| 784 | - setTimeout(function() { | |
| 785 | - container.view.$el[0].scrollIntoView({ | |
| 786 | - behavior: "smooth", | |
| 787 | - block: "start" | |
| 788 | - }); | |
| 789 | - }); | |
| 790 | - } | |
| 791 | - function deleteContainers(containers) { | |
| 792 | - toggleHistory(false); | |
| 793 | - $e.run("document/elements/delete", { containers }); | |
| 794 | - toggleHistory(true); | |
| 795 | - } | |
| 796 | - var PREFIX, CLASS_HIDDEN, CLASS_IDLE; | |
| 797 | - var init_preview_container = __esmMin((() => { | |
| 798 | - init_defineProperty$1(); | |
| 799 | - init_toConsumableArray(); | |
| 800 | - init_history(); | |
| 801 | - __name(ownKeys$12, "ownKeys"); | |
| 802 | - __name(_objectSpread$11, "_objectSpread"); | |
| 803 | - PREFIX = "e-ai-preview-container"; | |
| 804 | - CLASS_HIDDEN = PREFIX + "--hidden"; | |
| 805 | - CLASS_IDLE = PREFIX + "--idle"; | |
| 806 | - __name(createContainer$1, "createContainer"); | |
| 807 | - })); | |
| 4772 | +} | |
| 808 | 4773 | |
| 809 | -//#endregion | |
| 810 | -//#region node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js | |
| 811 | -/** @license React v16.13.1 | |
| 812 | - * react-is.development.js | |
| 813 | - * | |
| 814 | - * Copyright (c) Facebook, Inc. and its affiliates. | |
| 815 | - * | |
| 816 | - * This source code is licensed under the MIT license found in the | |
| 817 | - * LICENSE file in the root directory of this source tree. | |
| 818 | - */ | |
| 819 | - var require_react_is_development = /* @__PURE__ */ __commonJSMin(((exports) => { | |
| 820 | - (function() { | |
| 821 | - "use strict"; | |
| 822 | - var hasSymbol = typeof Symbol === "function" && Symbol.for; | |
| 823 | - var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for("react.element") : 60103; | |
| 824 | - var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for("react.portal") : 60106; | |
| 825 | - var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for("react.fragment") : 60107; | |
| 826 | - var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for("react.strict_mode") : 60108; | |
| 827 | - var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for("react.profiler") : 60114; | |
| 828 | - var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for("react.provider") : 60109; | |
| 829 | - var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for("react.context") : 60110; | |
| 830 | - var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for("react.async_mode") : 60111; | |
| 831 | - var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for("react.concurrent_mode") : 60111; | |
| 832 | - var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for("react.forward_ref") : 60112; | |
| 833 | - var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for("react.suspense") : 60113; | |
| 834 | - var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for("react.suspense_list") : 60120; | |
| 835 | - var REACT_MEMO_TYPE = hasSymbol ? Symbol.for("react.memo") : 60115; | |
| 836 | - var REACT_LAZY_TYPE = hasSymbol ? Symbol.for("react.lazy") : 60116; | |
| 837 | - var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for("react.block") : 60121; | |
| 838 | - var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for("react.fundamental") : 60117; | |
| 839 | - var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for("react.responder") : 60118; | |
| 840 | - var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for("react.scope") : 60119; | |
| 841 | - function isValidElementType(type) { | |
| 842 | - return typeof type === "string" || typeof type === "function" || type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === "object" && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE); | |
| 843 | - } | |
| 844 | - function typeOf(object) { | |
| 845 | - if (typeof object === "object" && object !== null) { | |
| 846 | - var $$typeof = object.$$typeof; | |
| 847 | - switch ($$typeof) { | |
| 848 | - case REACT_ELEMENT_TYPE: | |
| 849 | - var type = object.type; | |
| 850 | - switch (type) { | |
| 851 | - case REACT_ASYNC_MODE_TYPE: | |
| 852 | - case REACT_CONCURRENT_MODE_TYPE: | |
| 853 | - case REACT_FRAGMENT_TYPE: | |
| 854 | - case REACT_PROFILER_TYPE: | |
| 855 | - case REACT_STRICT_MODE_TYPE: | |
| 856 | - case REACT_SUSPENSE_TYPE: return type; | |
| 857 | - default: | |
| 858 | - var $$typeofType = type && type.$$typeof; | |
| 859 | - switch ($$typeofType) { | |
| 860 | - case REACT_CONTEXT_TYPE: | |
| 861 | - case REACT_FORWARD_REF_TYPE: | |
| 862 | - case REACT_LAZY_TYPE: | |
| 863 | - case REACT_MEMO_TYPE: | |
| 864 | - case REACT_PROVIDER_TYPE: return $$typeofType; | |
| 865 | - default: return $$typeof; | |
| 866 | - } | |
| 867 | - } | |
| 868 | - case REACT_PORTAL_TYPE: return $$typeof; | |
| 869 | - } | |
| 870 | - } | |
| 871 | - } | |
| 872 | - var AsyncMode = REACT_ASYNC_MODE_TYPE; | |
| 873 | - var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE; | |
| 874 | - var ContextConsumer = REACT_CONTEXT_TYPE; | |
| 875 | - var ContextProvider = REACT_PROVIDER_TYPE; | |
| 876 | - var Element = REACT_ELEMENT_TYPE; | |
| 877 | - var ForwardRef = REACT_FORWARD_REF_TYPE; | |
| 878 | - var Fragment = REACT_FRAGMENT_TYPE; | |
| 879 | - var Lazy = REACT_LAZY_TYPE; | |
| 880 | - var Memo = REACT_MEMO_TYPE; | |
| 881 | - var Portal = REACT_PORTAL_TYPE; | |
| 882 | - var Profiler = REACT_PROFILER_TYPE; | |
| 883 | - var StrictMode = REACT_STRICT_MODE_TYPE; | |
| 884 | - var Suspense = REACT_SUSPENSE_TYPE; | |
| 885 | - var hasWarnedAboutDeprecatedIsAsyncMode = false; | |
| 886 | - function isAsyncMode(object) { | |
| 887 | - if (!hasWarnedAboutDeprecatedIsAsyncMode) { | |
| 888 | - hasWarnedAboutDeprecatedIsAsyncMode = true; | |
| 889 | - console["warn"]("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API."); | |
| 890 | - } | |
| 891 | - return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE; | |
| 892 | - } | |
| 893 | - function isConcurrentMode(object) { | |
| 894 | - return typeOf(object) === REACT_CONCURRENT_MODE_TYPE; | |
| 895 | - } | |
| 896 | - function isContextConsumer(object) { | |
| 897 | - return typeOf(object) === REACT_CONTEXT_TYPE; | |
| 898 | - } | |
| 899 | - function isContextProvider(object) { | |
| 900 | - return typeOf(object) === REACT_PROVIDER_TYPE; | |
| 901 | - } | |
| 902 | - function isElement(object) { | |
| 903 | - return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; | |
| 904 | - } | |
| 905 | - function isForwardRef(object) { | |
| 906 | - return typeOf(object) === REACT_FORWARD_REF_TYPE; | |
| 907 | - } | |
| 908 | - function isFragment(object) { | |
| 909 | - return typeOf(object) === REACT_FRAGMENT_TYPE; | |
| 910 | - } | |
| 911 | - function isLazy(object) { | |
| 912 | - return typeOf(object) === REACT_LAZY_TYPE; | |
| 913 | - } | |
| 914 | - function isMemo(object) { | |
| 915 | - return typeOf(object) === REACT_MEMO_TYPE; | |
| 916 | - } | |
| 917 | - function isPortal(object) { | |
| 918 | - return typeOf(object) === REACT_PORTAL_TYPE; | |
| 919 | - } | |
| 920 | - function isProfiler(object) { | |
| 921 | - return typeOf(object) === REACT_PROFILER_TYPE; | |
| 922 | - } | |
| 923 | - function isStrictMode(object) { | |
| 924 | - return typeOf(object) === REACT_STRICT_MODE_TYPE; | |
| 925 | - } | |
| 926 | - function isSuspense(object) { | |
| 927 | - return typeOf(object) === REACT_SUSPENSE_TYPE; | |
| 928 | - } | |
| 929 | - exports.AsyncMode = AsyncMode; | |
| 930 | - exports.ConcurrentMode = ConcurrentMode; | |
| 931 | - exports.ContextConsumer = ContextConsumer; | |
| 932 | - exports.ContextProvider = ContextProvider; | |
| 933 | - exports.Element = Element; | |
| 934 | - exports.ForwardRef = ForwardRef; | |
| 935 | - exports.Fragment = Fragment; | |
| 936 | - exports.Lazy = Lazy; | |
| 937 | - exports.Memo = Memo; | |
| 938 | - exports.Portal = Portal; | |
| 939 | - exports.Profiler = Profiler; | |
| 940 | - exports.StrictMode = StrictMode; | |
| 941 | - exports.Suspense = Suspense; | |
| 942 | - exports.isAsyncMode = isAsyncMode; | |
| 943 | - exports.isConcurrentMode = isConcurrentMode; | |
| 944 | - exports.isContextConsumer = isContextConsumer; | |
| 945 | - exports.isContextProvider = isContextProvider; | |
| 946 | - exports.isElement = isElement; | |
| 947 | - exports.isForwardRef = isForwardRef; | |
| 948 | - exports.isFragment = isFragment; | |
| 949 | - exports.isLazy = isLazy; | |
| 950 | - exports.isMemo = isMemo; | |
| 951 | - exports.isPortal = isPortal; | |
| 952 | - exports.isProfiler = isProfiler; | |
| 953 | - exports.isStrictMode = isStrictMode; | |
| 954 | - exports.isSuspense = isSuspense; | |
| 955 | - exports.isValidElementType = isValidElementType; | |
| 956 | - exports.typeOf = typeOf; | |
| 957 | - })(); | |
| 958 | - })); | |
| 4774 | +module.exports = shouldUseNative() ? Object.assign : function (target, source) { | |
| 4775 | + var from; | |
| 4776 | + var to = toObject(target); | |
| 4777 | + var symbols; | |
| 959 | 4778 | |
| 960 | -//#endregion | |
| 961 | -//#region node_modules/prop-types/node_modules/react-is/index.js | |
| 962 | - var require_react_is = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 963 | - module.exports = require_react_is_development(); | |
| 964 | - })); | |
| 4779 | + for (var s = 1; s < arguments.length; s++) { | |
| 4780 | + from = Object(arguments[s]); | |
| 965 | 4781 | |
| 966 | -//#endregion | |
| 967 | -//#region node_modules/object-assign/index.js | |
| 968 | -/* | |
| 969 | - object-assign | |
| 970 | - (c) Sindre Sorhus | |
| 971 | - @license MIT | |
| 972 | - */ | |
| 973 | - var require_object_assign = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 974 | - var getOwnPropertySymbols = Object.getOwnPropertySymbols; | |
| 975 | - var hasOwnProperty = Object.prototype.hasOwnProperty; | |
| 976 | - var propIsEnumerable = Object.prototype.propertyIsEnumerable; | |
| 977 | - function toObject(val) { | |
| 978 | - if (val === null || val === void 0) throw new TypeError("Object.assign cannot be called with null or undefined"); | |
| 979 | - return Object(val); | |
| 980 | - } | |
| 981 | - function shouldUseNative() { | |
| 982 | - try { | |
| 983 | - if (!Object.assign) return false; | |
| 984 | - var test1 = /* @__PURE__ */ new String("abc"); | |
| 985 | - test1[5] = "de"; | |
| 986 | - if (Object.getOwnPropertyNames(test1)[0] === "5") return false; | |
| 987 | - var test2 = {}; | |
| 988 | - for (var i = 0; i < 10; i++) test2["_" + String.fromCharCode(i)] = i; | |
| 989 | - if (Object.getOwnPropertyNames(test2).map(function(n) { | |
| 990 | - return test2[n]; | |
| 991 | - }).join("") !== "0123456789") return false; | |
| 992 | - var test3 = {}; | |
| 993 | - "abcdefghijklmnopqrst".split("").forEach(function(letter) { | |
| 994 | - test3[letter] = letter; | |
| 995 | - }); | |
| 996 | - if (Object.keys(Object.assign({}, test3)).join("") !== "abcdefghijklmnopqrst") return false; | |
| 997 | - return true; | |
| 998 | - } catch (err) { | |
| 999 | - return false; | |
| 4782 | + for (var key in from) { | |
| 4783 | + if (hasOwnProperty.call(from, key)) { | |
| 4784 | + to[key] = from[key]; | |
| 1000 | 4785 | } |
| 1001 | 4786 | } |
| 1002 | - module.exports = shouldUseNative() ? Object.assign : function(target, source) { | |
| 1003 | - var from; | |
| 1004 | - var to = toObject(target); | |
| 1005 | - var symbols; | |
| 1006 | - for (var s = 1; s < arguments.length; s++) { | |
| 1007 | - from = Object(arguments[s]); | |
| 1008 | - for (var key in from) if (hasOwnProperty.call(from, key)) to[key] = from[key]; | |
| 1009 | - if (getOwnPropertySymbols) { | |
| 1010 | - symbols = getOwnPropertySymbols(from); | |
| 1011 | - for (var i = 0; i < symbols.length; i++) if (propIsEnumerable.call(from, symbols[i])) to[symbols[i]] = from[symbols[i]]; | |
| 4787 | + | |
| 4788 | + if (getOwnPropertySymbols) { | |
| 4789 | + symbols = getOwnPropertySymbols(from); | |
| 4790 | + for (var i = 0; i < symbols.length; i++) { | |
| 4791 | + if (propIsEnumerable.call(from, symbols[i])) { | |
| 4792 | + to[symbols[i]] = from[symbols[i]]; | |
| 1012 | 4793 | } |
| 1013 | 4794 | } |
| 1014 | - return to; | |
| 1015 | - }; | |
| 1016 | - })); | |
| 4795 | + } | |
| 4796 | + } | |
| 1017 | 4797 | |
| 1018 | -//#endregion | |
| 1019 | -//#region node_modules/prop-types/lib/ReactPropTypesSecret.js | |
| 4798 | + return to; | |
| 4799 | +}; | |
| 4800 | + | |
| 4801 | + | |
| 4802 | +/***/ }), | |
| 4803 | + | |
| 4804 | +/***/ "../node_modules/prop-types/checkPropTypes.js": | |
| 4805 | +/*!****************************************************!*\ | |
| 4806 | + !*** ../node_modules/prop-types/checkPropTypes.js ***! | |
| 4807 | + \****************************************************/ | |
| 4808 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 4809 | + | |
| 4810 | +"use strict"; | |
| 1020 | 4811 | /** |
| 1021 | - * Copyright (c) 2013-present, Facebook, Inc. | |
| 1022 | - * | |
| 1023 | - * This source code is licensed under the MIT license found in the | |
| 1024 | - * LICENSE file in the root directory of this source tree. | |
| 1025 | - */ | |
| 1026 | - var require_ReactPropTypesSecret = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 1027 | - var ReactPropTypesSecret = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"; | |
| 1028 | - module.exports = ReactPropTypesSecret; | |
| 1029 | - })); | |
| 4812 | + * Copyright (c) 2013-present, Facebook, Inc. | |
| 4813 | + * | |
| 4814 | + * This source code is licensed under the MIT license found in the | |
| 4815 | + * LICENSE file in the root directory of this source tree. | |
| 4816 | + */ | |
| 1030 | 4817 | |
| 1031 | -//#endregion | |
| 1032 | -//#region node_modules/prop-types/lib/has.js | |
| 1033 | - var require_has = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 1034 | - module.exports = Function.call.bind(Object.prototype.hasOwnProperty); | |
| 1035 | - })); | |
| 1036 | 4818 | |
| 1037 | -//#endregion | |
| 1038 | -//#region node_modules/prop-types/checkPropTypes.js | |
| 4819 | + | |
| 4820 | +var printWarning = function() {}; | |
| 4821 | + | |
| 4822 | +if (true) { | |
| 4823 | + var ReactPropTypesSecret = __webpack_require__(/*! ./lib/ReactPropTypesSecret */ "../node_modules/prop-types/lib/ReactPropTypesSecret.js"); | |
| 4824 | + var loggedTypeFailures = {}; | |
| 4825 | + var has = __webpack_require__(/*! ./lib/has */ "../node_modules/prop-types/lib/has.js"); | |
| 4826 | + | |
| 4827 | + printWarning = function(text) { | |
| 4828 | + var message = 'Warning: ' + text; | |
| 4829 | + if (typeof console !== 'undefined') { | |
| 4830 | + console.error(message); | |
| 4831 | + } | |
| 4832 | + try { | |
| 4833 | + // --- Welcome to debugging React --- | |
| 4834 | + // This error was thrown as a convenience so that you can use this stack | |
| 4835 | + // to find the callsite that caused this warning to fire. | |
| 4836 | + throw new Error(message); | |
| 4837 | + } catch (x) { /**/ } | |
| 4838 | + }; | |
| 4839 | +} | |
| 4840 | + | |
| 1039 | 4841 | /** |
| 1040 | - * Copyright (c) 2013-present, Facebook, Inc. | |
| 1041 | - * | |
| 1042 | - * This source code is licensed under the MIT license found in the | |
| 1043 | - * LICENSE file in the root directory of this source tree. | |
| 1044 | - */ | |
| 1045 | - var require_checkPropTypes = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 1046 | - var printWarning = function() {}; | |
| 1047 | - var ReactPropTypesSecret = require_ReactPropTypesSecret(); | |
| 1048 | - var loggedTypeFailures = {}; | |
| 1049 | - var has = require_has(); | |
| 1050 | - printWarning = function(text) { | |
| 1051 | - var message = "Warning: " + text; | |
| 1052 | - if (typeof console !== "undefined") console.error(message); | |
| 1053 | - try { | |
| 1054 | - throw new Error(message); | |
| 1055 | - } catch (x) {} | |
| 1056 | - }; | |
| 1057 | - /** | |
| 1058 | - * Assert that the values match with the type specs. | |
| 1059 | - * Error messages are memorized and will only be shown once. | |
| 1060 | - * | |
| 1061 | - * @param {object} typeSpecs Map of name to a ReactPropType | |
| 1062 | - * @param {object} values Runtime values that need to be type-checked | |
| 1063 | - * @param {string} location e.g. "prop", "context", "child context" | |
| 1064 | - * @param {string} componentName Name of the component for error messages. | |
| 1065 | - * @param {?Function} getStack Returns the component stack. | |
| 1066 | - * @private | |
| 1067 | - */ | |
| 1068 | - function checkPropTypes(typeSpecs, values, location, componentName, getStack) { | |
| 1069 | - for (var typeSpecName in typeSpecs) if (has(typeSpecs, typeSpecName)) { | |
| 1070 | - var error; | |
| 1071 | - try { | |
| 1072 | - if (typeof typeSpecs[typeSpecName] !== "function") { | |
| 1073 | - var err = Error((componentName || "React class") + ": " + location + " type `" + typeSpecName + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof typeSpecs[typeSpecName] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`."); | |
| 1074 | - err.name = "Invariant Violation"; | |
| 1075 | - throw err; | |
| 1076 | - } | |
| 1077 | - error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret); | |
| 1078 | - } catch (ex) { | |
| 1079 | - error = ex; | |
| 1080 | - } | |
| 1081 | - if (error && !(error instanceof Error)) printWarning((componentName || "React class") + ": type specification of " + location + " `" + typeSpecName + "` is invalid; the type checker function must return `null` or an `Error` but returned a " + typeof error + ". You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument)."); | |
| 1082 | - if (error instanceof Error && !(error.message in loggedTypeFailures)) { | |
| 1083 | - loggedTypeFailures[error.message] = true; | |
| 1084 | - var stack = getStack ? getStack() : ""; | |
| 1085 | - printWarning("Failed " + location + " type: " + error.message + (stack != null ? stack : "")); | |
| 1086 | - } | |
| 1087 | - } | |
| 1088 | - } | |
| 1089 | - /** | |
| 1090 | - * Resets warning cache when testing. | |
| 1091 | - * | |
| 1092 | - * @private | |
| 1093 | - */ | |
| 1094 | - checkPropTypes.resetWarningCache = function() { | |
| 1095 | - loggedTypeFailures = {}; | |
| 1096 | - }; | |
| 1097 | - module.exports = checkPropTypes; | |
| 1098 | - })); | |
| 4842 | + * Assert that the values match with the type specs. | |
| 4843 | + * Error messages are memorized and will only be shown once. | |
| 4844 | + * | |
| 4845 | + * @param {object} typeSpecs Map of name to a ReactPropType | |
| 4846 | + * @param {object} values Runtime values that need to be type-checked | |
| 4847 | + * @param {string} location e.g. "prop", "context", "child context" | |
| 4848 | + * @param {string} componentName Name of the component for error messages. | |
| 4849 | + * @param {?Function} getStack Returns the component stack. | |
| 4850 | + * @private | |
| 4851 | + */ | |
| 4852 | +function checkPropTypes(typeSpecs, values, location, componentName, getStack) { | |
| 4853 | + if (true) { | |
| 4854 | + for (var typeSpecName in typeSpecs) { | |
| 4855 | + if (has(typeSpecs, typeSpecName)) { | |
| 4856 | + var error; | |
| 4857 | + // Prop type validation may throw. In case they do, we don't want to | |
| 4858 | + // fail the render phase where it didn't fail before. So we log it. | |
| 4859 | + // After these have been cleaned up, we'll let them throw. | |
| 4860 | + try { | |
| 4861 | + // This is intentionally an invariant that gets caught. It's the same | |
| 4862 | + // behavior as without this statement except with a better message. | |
| 4863 | + if (typeof typeSpecs[typeSpecName] !== 'function') { | |
| 4864 | + var err = Error( | |
| 4865 | + (componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + | |
| 4866 | + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + | |
| 4867 | + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.' | |
| 4868 | + ); | |
| 4869 | + err.name = 'Invariant Violation'; | |
| 4870 | + throw err; | |
| 4871 | + } | |
| 4872 | + error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret); | |
| 4873 | + } catch (ex) { | |
| 4874 | + error = ex; | |
| 4875 | + } | |
| 4876 | + if (error && !(error instanceof Error)) { | |
| 4877 | + printWarning( | |
| 4878 | + (componentName || 'React class') + ': type specification of ' + | |
| 4879 | + location + ' `' + typeSpecName + '` is invalid; the type checker ' + | |
| 4880 | + 'function must return `null` or an `Error` but returned a ' + typeof error + '. ' + | |
| 4881 | + 'You may have forgotten to pass an argument to the type checker ' + | |
| 4882 | + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + | |
| 4883 | + 'shape all require an argument).' | |
| 4884 | + ); | |
| 4885 | + } | |
| 4886 | + if (error instanceof Error && !(error.message in loggedTypeFailures)) { | |
| 4887 | + // Only monitor this failure once because there tends to be a lot of the | |
| 4888 | + // same error. | |
| 4889 | + loggedTypeFailures[error.message] = true; | |
| 1099 | 4890 | |
| 1100 | -//#endregion | |
| 1101 | -//#region node_modules/prop-types/factoryWithTypeCheckers.js | |
| 4891 | + var stack = getStack ? getStack() : ''; | |
| 4892 | + | |
| 4893 | + printWarning( | |
| 4894 | + 'Failed ' + location + ' type: ' + error.message + (stack != null ? stack : '') | |
| 4895 | + ); | |
| 4896 | + } | |
| 4897 | + } | |
| 4898 | + } | |
| 4899 | + } | |
| 4900 | +} | |
| 4901 | + | |
| 1102 | 4902 | /** |
| 1103 | - * Copyright (c) 2013-present, Facebook, Inc. | |
| 1104 | - * | |
| 1105 | - * This source code is licensed under the MIT license found in the | |
| 1106 | - * LICENSE file in the root directory of this source tree. | |
| 1107 | - */ | |
| 1108 | - var require_factoryWithTypeCheckers = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 1109 | - var ReactIs = require_react_is(); | |
| 1110 | - var assign = require_object_assign(); | |
| 1111 | - var ReactPropTypesSecret = require_ReactPropTypesSecret(); | |
| 1112 | - var has = require_has(); | |
| 1113 | - var checkPropTypes = require_checkPropTypes(); | |
| 1114 | - var printWarning = function() {}; | |
| 1115 | - printWarning = function(text) { | |
| 1116 | - var message = "Warning: " + text; | |
| 1117 | - if (typeof console !== "undefined") console.error(message); | |
| 1118 | - try { | |
| 1119 | - throw new Error(message); | |
| 1120 | - } catch (x) {} | |
| 1121 | - }; | |
| 1122 | - function emptyFunctionThatReturnsNull() { | |
| 1123 | - return null; | |
| 1124 | - } | |
| 1125 | - module.exports = function(isValidElement, throwOnDirectAccess) { | |
| 1126 | - var ITERATOR_SYMBOL = typeof Symbol === "function" && Symbol.iterator; | |
| 1127 | - var FAUX_ITERATOR_SYMBOL = "@@iterator"; | |
| 1128 | - /** | |
| 1129 | - * Returns the iterator method function contained on the iterable object. | |
| 1130 | - * | |
| 1131 | - * Be sure to invoke the function with the iterable as context: | |
| 1132 | - * | |
| 1133 | - * var iteratorFn = getIteratorFn(myIterable); | |
| 1134 | - * if (iteratorFn) { | |
| 1135 | - * var iterator = iteratorFn.call(myIterable); | |
| 1136 | - * ... | |
| 1137 | - * } | |
| 1138 | - * | |
| 1139 | - * @param {?object} maybeIterable | |
| 1140 | - * @return {?function} | |
| 1141 | - */ | |
| 1142 | - function getIteratorFn(maybeIterable) { | |
| 1143 | - var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]); | |
| 1144 | - if (typeof iteratorFn === "function") return iteratorFn; | |
| 1145 | - } | |
| 1146 | - /** | |
| 1147 | - * Collection of methods that allow declaration and validation of props that are | |
| 1148 | - * supplied to React components. Example usage: | |
| 1149 | - * | |
| 1150 | - * var Props = require('ReactPropTypes'); | |
| 1151 | - * var MyArticle = React.createClass({ | |
| 1152 | - * propTypes: { | |
| 1153 | - * // An optional string prop named "description". | |
| 1154 | - * description: Props.string, | |
| 1155 | - * | |
| 1156 | - * // A required enum prop named "category". | |
| 1157 | - * category: Props.oneOf(['News','Photos']).isRequired, | |
| 1158 | - * | |
| 1159 | - * // A prop named "dialog" that requires an instance of Dialog. | |
| 1160 | - * dialog: Props.instanceOf(Dialog).isRequired | |
| 1161 | - * }, | |
| 1162 | - * render: function() { ... } | |
| 1163 | - * }); | |
| 1164 | - * | |
| 1165 | - * A more formal specification of how these methods are used: | |
| 1166 | - * | |
| 1167 | - * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...) | |
| 1168 | - * decl := ReactPropTypes.{type}(.isRequired)? | |
| 1169 | - * | |
| 1170 | - * Each and every declaration produces a function with the same signature. This | |
| 1171 | - * allows the creation of custom validation functions. For example: | |
| 1172 | - * | |
| 1173 | - * var MyLink = React.createClass({ | |
| 1174 | - * propTypes: { | |
| 1175 | - * // An optional string or URI prop named "href". | |
| 1176 | - * href: function(props, propName, componentName) { | |
| 1177 | - * var propValue = props[propName]; | |
| 1178 | - * if (propValue != null && typeof propValue !== 'string' && | |
| 1179 | - * !(propValue instanceof URI)) { | |
| 1180 | - * return new Error( | |
| 1181 | - * 'Expected a string or an URI for ' + propName + ' in ' + | |
| 1182 | - * componentName | |
| 1183 | - * ); | |
| 1184 | - * } | |
| 1185 | - * } | |
| 1186 | - * }, | |
| 1187 | - * render: function() {...} | |
| 1188 | - * }); | |
| 1189 | - * | |
| 1190 | - * @internal | |
| 1191 | - */ | |
| 1192 | - var ANONYMOUS = "<<anonymous>>"; | |
| 1193 | - var ReactPropTypes = { | |
| 1194 | - array: createPrimitiveTypeChecker("array"), | |
| 1195 | - bigint: createPrimitiveTypeChecker("bigint"), | |
| 1196 | - bool: createPrimitiveTypeChecker("boolean"), | |
| 1197 | - func: createPrimitiveTypeChecker("function"), | |
| 1198 | - number: createPrimitiveTypeChecker("number"), | |
| 1199 | - object: createPrimitiveTypeChecker("object"), | |
| 1200 | - string: createPrimitiveTypeChecker("string"), | |
| 1201 | - symbol: createPrimitiveTypeChecker("symbol"), | |
| 1202 | - any: createAnyTypeChecker(), | |
| 1203 | - arrayOf: createArrayOfTypeChecker, | |
| 1204 | - element: createElementTypeChecker(), | |
| 1205 | - elementType: createElementTypeTypeChecker(), | |
| 1206 | - instanceOf: createInstanceTypeChecker, | |
| 1207 | - node: createNodeChecker(), | |
| 1208 | - objectOf: createObjectOfTypeChecker, | |
| 1209 | - oneOf: createEnumTypeChecker, | |
| 1210 | - oneOfType: createUnionTypeChecker, | |
| 1211 | - shape: createShapeTypeChecker, | |
| 1212 | - exact: createStrictShapeTypeChecker | |
| 1213 | - }; | |
| 1214 | - /** | |
| 1215 | - * inlined Object.is polyfill to avoid requiring consumers ship their own | |
| 1216 | - * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is | |
| 1217 | - */ | |
| 1218 | - function is(x, y) { | |
| 1219 | - if (x === y) return x !== 0 || 1 / x === 1 / y; | |
| 1220 | - else return x !== x && y !== y; | |
| 1221 | - } | |
| 1222 | - /** | |
| 1223 | - * We use an Error-like object for backward compatibility as people may call | |
| 1224 | - * PropTypes directly and inspect their output. However, we don't use real | |
| 1225 | - * Errors anymore. We don't inspect their stack anyway, and creating them | |
| 1226 | - * is prohibitively expensive if they are created too often, such as what | |
| 1227 | - * happens in oneOfType() for any type before the one that matched. | |
| 1228 | - */ | |
| 1229 | - function PropTypeError(message, data) { | |
| 1230 | - this.message = message; | |
| 1231 | - this.data = data && typeof data === "object" ? data : {}; | |
| 1232 | - this.stack = ""; | |
| 1233 | - } | |
| 1234 | - PropTypeError.prototype = Error.prototype; | |
| 1235 | - function createChainableTypeChecker(validate) { | |
| 1236 | - var manualPropTypeCallCache = {}; | |
| 1237 | - var manualPropTypeWarningCount = 0; | |
| 1238 | - function checkType(isRequired, props, propName, componentName, location, propFullName, secret) { | |
| 1239 | - componentName = componentName || ANONYMOUS; | |
| 1240 | - propFullName = propFullName || propName; | |
| 1241 | - if (secret !== ReactPropTypesSecret) { | |
| 1242 | - if (throwOnDirectAccess) { | |
| 1243 | - var err = /* @__PURE__ */ new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use `PropTypes.checkPropTypes()` to call them. Read more at http://fb.me/use-check-prop-types"); | |
| 1244 | - err.name = "Invariant Violation"; | |
| 1245 | - throw err; | |
| 1246 | - } else if (typeof console !== "undefined") { | |
| 1247 | - var cacheKey = componentName + ":" + propName; | |
| 1248 | - if (!manualPropTypeCallCache[cacheKey] && manualPropTypeWarningCount < 3) { | |
| 1249 | - printWarning("You are manually calling a React.PropTypes validation function for the `" + propFullName + "` prop on `" + componentName + "`. This is deprecated and will throw in the standalone `prop-types` package. You may be seeing this warning due to a third-party PropTypes library. See https://fb.me/react-warning-dont-call-proptypes for details."); | |
| 1250 | - manualPropTypeCallCache[cacheKey] = true; | |
| 1251 | - manualPropTypeWarningCount++; | |
| 1252 | - } | |
| 1253 | - } | |
| 1254 | - } | |
| 1255 | - if (props[propName] == null) { | |
| 1256 | - if (isRequired) { | |
| 1257 | - if (props[propName] === null) return new PropTypeError("The " + location + " `" + propFullName + "` is marked as required " + ("in `" + componentName + "`, but its value is `null`.")); | |
| 1258 | - return new PropTypeError("The " + location + " `" + propFullName + "` is marked as required in " + ("`" + componentName + "`, but its value is `undefined`.")); | |
| 1259 | - } | |
| 1260 | - return null; | |
| 1261 | - } else return validate(props, propName, componentName, location, propFullName); | |
| 1262 | - } | |
| 1263 | - var chainedCheckType = checkType.bind(null, false); | |
| 1264 | - chainedCheckType.isRequired = checkType.bind(null, true); | |
| 1265 | - return chainedCheckType; | |
| 1266 | - } | |
| 1267 | - function createPrimitiveTypeChecker(expectedType) { | |
| 1268 | - function validate(props, propName, componentName, location, propFullName, secret) { | |
| 1269 | - var propValue = props[propName]; | |
| 1270 | - if (getPropType(propValue) !== expectedType) { | |
| 1271 | - var preciseType = getPreciseType(propValue); | |
| 1272 | - return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + preciseType + "` supplied to `" + componentName + "`, expected ") + ("`" + expectedType + "`."), { expectedType }); | |
| 1273 | - } | |
| 1274 | - return null; | |
| 1275 | - } | |
| 1276 | - return createChainableTypeChecker(validate); | |
| 1277 | - } | |
| 1278 | - function createAnyTypeChecker() { | |
| 1279 | - return createChainableTypeChecker(emptyFunctionThatReturnsNull); | |
| 1280 | - } | |
| 1281 | - function createArrayOfTypeChecker(typeChecker) { | |
| 1282 | - function validate(props, propName, componentName, location, propFullName) { | |
| 1283 | - if (typeof typeChecker !== "function") return new PropTypeError("Property `" + propFullName + "` of component `" + componentName + "` has invalid PropType notation inside arrayOf."); | |
| 1284 | - var propValue = props[propName]; | |
| 1285 | - if (!Array.isArray(propValue)) { | |
| 1286 | - var propType = getPropType(propValue); | |
| 1287 | - return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected an array.")); | |
| 1288 | - } | |
| 1289 | - for (var i = 0; i < propValue.length; i++) { | |
| 1290 | - var error = typeChecker(propValue, i, componentName, location, propFullName + "[" + i + "]", ReactPropTypesSecret); | |
| 1291 | - if (error instanceof Error) return error; | |
| 1292 | - } | |
| 1293 | - return null; | |
| 1294 | - } | |
| 1295 | - return createChainableTypeChecker(validate); | |
| 1296 | - } | |
| 1297 | - function createElementTypeChecker() { | |
| 1298 | - function validate(props, propName, componentName, location, propFullName) { | |
| 1299 | - var propValue = props[propName]; | |
| 1300 | - if (!isValidElement(propValue)) { | |
| 1301 | - var propType = getPropType(propValue); | |
| 1302 | - return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected a single ReactElement.")); | |
| 1303 | - } | |
| 1304 | - return null; | |
| 1305 | - } | |
| 1306 | - return createChainableTypeChecker(validate); | |
| 1307 | - } | |
| 1308 | - function createElementTypeTypeChecker() { | |
| 1309 | - function validate(props, propName, componentName, location, propFullName) { | |
| 1310 | - var propValue = props[propName]; | |
| 1311 | - if (!ReactIs.isValidElementType(propValue)) { | |
| 1312 | - var propType = getPropType(propValue); | |
| 1313 | - return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected a single ReactElement type.")); | |
| 1314 | - } | |
| 1315 | - return null; | |
| 1316 | - } | |
| 1317 | - return createChainableTypeChecker(validate); | |
| 1318 | - } | |
| 1319 | - function createInstanceTypeChecker(expectedClass) { | |
| 1320 | - function validate(props, propName, componentName, location, propFullName) { | |
| 1321 | - if (!(props[propName] instanceof expectedClass)) { | |
| 1322 | - var expectedClassName = expectedClass.name || ANONYMOUS; | |
| 1323 | - var actualClassName = getClassName(props[propName]); | |
| 1324 | - return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + actualClassName + "` supplied to `" + componentName + "`, expected ") + ("instance of `" + expectedClassName + "`.")); | |
| 1325 | - } | |
| 1326 | - return null; | |
| 1327 | - } | |
| 1328 | - return createChainableTypeChecker(validate); | |
| 1329 | - } | |
| 1330 | - function createEnumTypeChecker(expectedValues) { | |
| 1331 | - if (!Array.isArray(expectedValues)) { | |
| 1332 | - if (arguments.length > 1) printWarning("Invalid arguments supplied to oneOf, expected an array, got " + arguments.length + " arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z])."); | |
| 1333 | - else printWarning("Invalid argument supplied to oneOf, expected an array."); | |
| 1334 | - return emptyFunctionThatReturnsNull; | |
| 1335 | - } | |
| 1336 | - function validate(props, propName, componentName, location, propFullName) { | |
| 1337 | - var propValue = props[propName]; | |
| 1338 | - for (var i = 0; i < expectedValues.length; i++) if (is(propValue, expectedValues[i])) return null; | |
| 1339 | - var valuesString = JSON.stringify(expectedValues, function replacer(key, value) { | |
| 1340 | - if (getPreciseType(value) === "symbol") return String(value); | |
| 1341 | - return value; | |
| 1342 | - }); | |
| 1343 | - return new PropTypeError("Invalid " + location + " `" + propFullName + "` of value `" + String(propValue) + "` " + ("supplied to `" + componentName + "`, expected one of " + valuesString + ".")); | |
| 1344 | - } | |
| 1345 | - return createChainableTypeChecker(validate); | |
| 1346 | - } | |
| 1347 | - function createObjectOfTypeChecker(typeChecker) { | |
| 1348 | - function validate(props, propName, componentName, location, propFullName) { | |
| 1349 | - if (typeof typeChecker !== "function") return new PropTypeError("Property `" + propFullName + "` of component `" + componentName + "` has invalid PropType notation inside objectOf."); | |
| 1350 | - var propValue = props[propName]; | |
| 1351 | - var propType = getPropType(propValue); | |
| 1352 | - if (propType !== "object") return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type " + ("`" + propType + "` supplied to `" + componentName + "`, expected an object.")); | |
| 1353 | - for (var key in propValue) if (has(propValue, key)) { | |
| 1354 | - var error = typeChecker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret); | |
| 1355 | - if (error instanceof Error) return error; | |
| 1356 | - } | |
| 1357 | - return null; | |
| 1358 | - } | |
| 1359 | - return createChainableTypeChecker(validate); | |
| 1360 | - } | |
| 1361 | - function createUnionTypeChecker(arrayOfTypeCheckers) { | |
| 1362 | - if (!Array.isArray(arrayOfTypeCheckers)) { | |
| 1363 | - printWarning("Invalid argument supplied to oneOfType, expected an instance of array."); | |
| 1364 | - return emptyFunctionThatReturnsNull; | |
| 1365 | - } | |
| 1366 | - for (var i = 0; i < arrayOfTypeCheckers.length; i++) { | |
| 1367 | - var checker = arrayOfTypeCheckers[i]; | |
| 1368 | - if (typeof checker !== "function") { | |
| 1369 | - printWarning("Invalid argument supplied to oneOfType. Expected an array of check functions, but received " + getPostfixForTypeWarning(checker) + " at index " + i + "."); | |
| 1370 | - return emptyFunctionThatReturnsNull; | |
| 1371 | - } | |
| 1372 | - } | |
| 1373 | - function validate(props, propName, componentName, location, propFullName) { | |
| 1374 | - var expectedTypes = []; | |
| 1375 | - for (var i = 0; i < arrayOfTypeCheckers.length; i++) { | |
| 1376 | - var checker = arrayOfTypeCheckers[i]; | |
| 1377 | - var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret); | |
| 1378 | - if (checkerResult == null) return null; | |
| 1379 | - if (checkerResult.data && has(checkerResult.data, "expectedType")) expectedTypes.push(checkerResult.data.expectedType); | |
| 1380 | - } | |
| 1381 | - var expectedTypesMessage = expectedTypes.length > 0 ? ", expected one of type [" + expectedTypes.join(", ") + "]" : ""; | |
| 1382 | - return new PropTypeError("Invalid " + location + " `" + propFullName + "` supplied to " + ("`" + componentName + "`" + expectedTypesMessage + ".")); | |
| 1383 | - } | |
| 1384 | - return createChainableTypeChecker(validate); | |
| 1385 | - } | |
| 1386 | - function createNodeChecker() { | |
| 1387 | - function validate(props, propName, componentName, location, propFullName) { | |
| 1388 | - if (!isNode(props[propName])) return new PropTypeError("Invalid " + location + " `" + propFullName + "` supplied to " + ("`" + componentName + "`, expected a ReactNode.")); | |
| 1389 | - return null; | |
| 1390 | - } | |
| 1391 | - return createChainableTypeChecker(validate); | |
| 1392 | - } | |
| 1393 | - function invalidValidatorError(componentName, location, propFullName, key, type) { | |
| 1394 | - return new PropTypeError((componentName || "React class") + ": " + location + " type `" + propFullName + "." + key + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + type + "`."); | |
| 1395 | - } | |
| 1396 | - function createShapeTypeChecker(shapeTypes) { | |
| 1397 | - function validate(props, propName, componentName, location, propFullName) { | |
| 1398 | - var propValue = props[propName]; | |
| 1399 | - var propType = getPropType(propValue); | |
| 1400 | - if (propType !== "object") return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type `" + propType + "` " + ("supplied to `" + componentName + "`, expected `object`.")); | |
| 1401 | - for (var key in shapeTypes) { | |
| 1402 | - var checker = shapeTypes[key]; | |
| 1403 | - if (typeof checker !== "function") return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker)); | |
| 1404 | - var error = checker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret); | |
| 1405 | - if (error) return error; | |
| 1406 | - } | |
| 1407 | - return null; | |
| 1408 | - } | |
| 1409 | - return createChainableTypeChecker(validate); | |
| 1410 | - } | |
| 1411 | - function createStrictShapeTypeChecker(shapeTypes) { | |
| 1412 | - function validate(props, propName, componentName, location, propFullName) { | |
| 1413 | - var propValue = props[propName]; | |
| 1414 | - var propType = getPropType(propValue); | |
| 1415 | - if (propType !== "object") return new PropTypeError("Invalid " + location + " `" + propFullName + "` of type `" + propType + "` " + ("supplied to `" + componentName + "`, expected `object`.")); | |
| 1416 | - for (var key in assign({}, props[propName], shapeTypes)) { | |
| 1417 | - var checker = shapeTypes[key]; | |
| 1418 | - if (has(shapeTypes, key) && typeof checker !== "function") return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker)); | |
| 1419 | - if (!checker) return new PropTypeError("Invalid " + location + " `" + propFullName + "` key `" + key + "` supplied to `" + componentName + "`.\nBad object: " + JSON.stringify(props[propName], null, " ") + "\nValid keys: " + JSON.stringify(Object.keys(shapeTypes), null, " ")); | |
| 1420 | - var error = checker(propValue, key, componentName, location, propFullName + "." + key, ReactPropTypesSecret); | |
| 1421 | - if (error) return error; | |
| 1422 | - } | |
| 1423 | - return null; | |
| 1424 | - } | |
| 1425 | - return createChainableTypeChecker(validate); | |
| 1426 | - } | |
| 1427 | - function isNode(propValue) { | |
| 1428 | - switch (typeof propValue) { | |
| 1429 | - case "number": | |
| 1430 | - case "string": | |
| 1431 | - case "undefined": return true; | |
| 1432 | - case "boolean": return !propValue; | |
| 1433 | - case "object": | |
| 1434 | - if (Array.isArray(propValue)) return propValue.every(isNode); | |
| 1435 | - if (propValue === null || isValidElement(propValue)) return true; | |
| 1436 | - var iteratorFn = getIteratorFn(propValue); | |
| 1437 | - if (iteratorFn) { | |
| 1438 | - var iterator = iteratorFn.call(propValue); | |
| 1439 | - var step; | |
| 1440 | - if (iteratorFn !== propValue.entries) { | |
| 1441 | - while (!(step = iterator.next()).done) if (!isNode(step.value)) return false; | |
| 1442 | - } else while (!(step = iterator.next()).done) { | |
| 1443 | - var entry = step.value; | |
| 1444 | - if (entry) { | |
| 1445 | - if (!isNode(entry[1])) return false; | |
| 1446 | - } | |
| 1447 | - } | |
| 1448 | - } else return false; | |
| 1449 | - return true; | |
| 1450 | - default: return false; | |
| 1451 | - } | |
| 1452 | - } | |
| 1453 | - function isSymbol(propType, propValue) { | |
| 1454 | - if (propType === "symbol") return true; | |
| 1455 | - if (!propValue) return false; | |
| 1456 | - if (propValue["@@toStringTag"] === "Symbol") return true; | |
| 1457 | - if (typeof Symbol === "function" && propValue instanceof Symbol) return true; | |
| 1458 | - return false; | |
| 1459 | - } | |
| 1460 | - function getPropType(propValue) { | |
| 1461 | - var propType = typeof propValue; | |
| 1462 | - if (Array.isArray(propValue)) return "array"; | |
| 1463 | - if (propValue instanceof RegExp) return "object"; | |
| 1464 | - if (isSymbol(propType, propValue)) return "symbol"; | |
| 1465 | - return propType; | |
| 1466 | - } | |
| 1467 | - function getPreciseType(propValue) { | |
| 1468 | - if (typeof propValue === "undefined" || propValue === null) return "" + propValue; | |
| 1469 | - var propType = getPropType(propValue); | |
| 1470 | - if (propType === "object") { | |
| 1471 | - if (propValue instanceof Date) return "date"; | |
| 1472 | - else if (propValue instanceof RegExp) return "regexp"; | |
| 1473 | - } | |
| 1474 | - return propType; | |
| 1475 | - } | |
| 1476 | - function getPostfixForTypeWarning(value) { | |
| 1477 | - var type = getPreciseType(value); | |
| 1478 | - switch (type) { | |
| 1479 | - case "array": | |
| 1480 | - case "object": return "an " + type; | |
| 1481 | - case "boolean": | |
| 1482 | - case "date": | |
| 1483 | - case "regexp": return "a " + type; | |
| 1484 | - default: return type; | |
| 1485 | - } | |
| 1486 | - } | |
| 1487 | - function getClassName(propValue) { | |
| 1488 | - if (!propValue.constructor || !propValue.constructor.name) return ANONYMOUS; | |
| 1489 | - return propValue.constructor.name; | |
| 1490 | - } | |
| 1491 | - ReactPropTypes.checkPropTypes = checkPropTypes; | |
| 1492 | - ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache; | |
| 1493 | - ReactPropTypes.PropTypes = ReactPropTypes; | |
| 1494 | - return ReactPropTypes; | |
| 1495 | - }; | |
| 1496 | - })); | |
| 4903 | + * Resets warning cache when testing. | |
| 4904 | + * | |
| 4905 | + * @private | |
| 4906 | + */ | |
| 4907 | +checkPropTypes.resetWarningCache = function() { | |
| 4908 | + if (true) { | |
| 4909 | + loggedTypeFailures = {}; | |
| 4910 | + } | |
| 4911 | +} | |
| 1497 | 4912 | |
| 1498 | -//#endregion | |
| 1499 | -//#region node_modules/prop-types/index.js | |
| 1500 | - var require_prop_types = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 1501 | - var ReactIs = require_react_is(); | |
| 1502 | - var throwOnDirectAccess = true; | |
| 1503 | - module.exports = require_factoryWithTypeCheckers()(ReactIs.isElement, throwOnDirectAccess); | |
| 1504 | - })); | |
| 4913 | +module.exports = checkPropTypes; | |
| 1505 | 4914 | |
| 1506 | -//#endregion | |
| 1507 | -//#region node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js | |
| 1508 | - function _arrayWithHoles(r) { | |
| 1509 | - if (Array.isArray(r)) return r; | |
| 1510 | - } | |
| 1511 | - var init_arrayWithHoles = __esmMin((() => {})); | |
| 1512 | 4915 | |
| 1513 | -//#endregion | |
| 1514 | -//#region node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js | |
| 1515 | - function _iterableToArrayLimit(r, l) { | |
| 1516 | - var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; | |
| 1517 | - if (null != t) { | |
| 1518 | - var e; | |
| 1519 | - var n; | |
| 1520 | - var i; | |
| 1521 | - var u; | |
| 1522 | - var a = []; | |
| 1523 | - var f = !0; | |
| 1524 | - var o = !1; | |
| 1525 | - try { | |
| 1526 | - if (i = (t = t.call(r)).next, 0 === l) { | |
| 1527 | - if (Object(t) !== t) return; | |
| 1528 | - f = !1; | |
| 1529 | - } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); | |
| 1530 | - } catch (r) { | |
| 1531 | - o = !0, n = r; | |
| 1532 | - } finally { | |
| 1533 | - try { | |
| 1534 | - if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; | |
| 1535 | - } finally { | |
| 1536 | - if (o) throw n; | |
| 1537 | - } | |
| 1538 | - } | |
| 1539 | - return a; | |
| 1540 | - } | |
| 1541 | - } | |
| 1542 | - var init_iterableToArrayLimit = __esmMin((() => {})); | |
| 4916 | +/***/ }), | |
| 1543 | 4917 | |
| 1544 | -//#endregion | |
| 1545 | -//#region node_modules/@babel/runtime/helpers/esm/nonIterableRest.js | |
| 1546 | - function _nonIterableRest() { | |
| 1547 | - throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); | |
| 1548 | - } | |
| 1549 | - var init_nonIterableRest = __esmMin((() => {})); | |
| 4918 | +/***/ "../node_modules/prop-types/factoryWithTypeCheckers.js": | |
| 4919 | +/*!*************************************************************!*\ | |
| 4920 | + !*** ../node_modules/prop-types/factoryWithTypeCheckers.js ***! | |
| 4921 | + \*************************************************************/ | |
| 4922 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 1550 | 4923 | |
| 1551 | -//#endregion | |
| 1552 | -//#region node_modules/@babel/runtime/helpers/esm/slicedToArray.js | |
| 1553 | - function _slicedToArray(r, e) { | |
| 1554 | - return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); | |
| 1555 | - } | |
| 1556 | - var init_slicedToArray = __esmMin((() => { | |
| 1557 | - init_arrayWithHoles(); | |
| 1558 | - init_iterableToArrayLimit(); | |
| 1559 | - init_unsupportedIterableToArray(); | |
| 1560 | - init_nonIterableRest(); | |
| 1561 | - })); | |
| 4924 | +"use strict"; | |
| 4925 | +/** | |
| 4926 | + * Copyright (c) 2013-present, Facebook, Inc. | |
| 4927 | + * | |
| 4928 | + * This source code is licensed under the MIT license found in the | |
| 4929 | + * LICENSE file in the root directory of this source tree. | |
| 4930 | + */ | |
| 1562 | 4931 | |
| 1563 | -//#endregion | |
| 1564 | -//#region modules/ai/assets/js/editor/pages/connect/index.js | |
| 1565 | - var import_prop_types$36, Connect; | |
| 1566 | - var init_connect = __esmMin((() => { | |
| 1567 | - import_prop_types$36 = /* @__PURE__ */ __toESM(require_prop_types()); | |
| 1568 | - Connect = function Connect(_ref) { | |
| 1569 | - var connectUrl = _ref.connectUrl; | |
| 1570 | - var onSuccess = _ref.onSuccess; | |
| 1571 | - var approveButtonRef = (0, react.useRef)(); | |
| 1572 | - (0, react.useEffect)(function() { | |
| 1573 | - if (!jQuery.fn.elementorConnect) return; | |
| 1574 | - jQuery(approveButtonRef.current).elementorConnect({ | |
| 1575 | - success: function success(_, data) { | |
| 1576 | - return onSuccess(data); | |
| 1577 | - }, | |
| 1578 | - error: function error() { | |
| 1579 | - throw new Error("Elementor AI: Failed to connect."); | |
| 1580 | - } | |
| 1581 | - }); | |
| 1582 | - }, []); | |
| 1583 | - return /*#__PURE__*/ react.default.createElement(_elementor_ui.Stack, { | |
| 1584 | - alignItems: "center", | |
| 1585 | - gap: 2 | |
| 1586 | - }, /*#__PURE__*/ react.default.createElement(_elementor_icons.AIIcon, { sx: { | |
| 1587 | - color: "text.primary", | |
| 1588 | - fontSize: "60px", | |
| 1589 | - mb: 1 | |
| 1590 | - } }), /*#__PURE__*/ react.default.createElement(_elementor_ui.Typography, { | |
| 1591 | - variant: "h4", | |
| 1592 | - sx: { color: "text.primary" } | |
| 1593 | - }, (0, _wordpress_i18n.__)("Step into the future with Elementor AI", "elementor")), /*#__PURE__*/ react.default.createElement(_elementor_ui.Typography, { variant: "body2" }, (0, _wordpress_i18n.__)("Create smarter with AI text and code generators built right into the editor.", "elementor")), /*#__PURE__*/ react.default.createElement(_elementor_ui.Typography, { | |
| 1594 | - variant: "caption", | |
| 1595 | - sx: { | |
| 1596 | - maxWidth: 520, | |
| 1597 | - textAlign: "center" | |
| 1598 | - } | |
| 1599 | - }, " ", (0, _wordpress_i18n.__)("By clicking \"Connect\", I approve the ", "elementor"), /*#__PURE__*/ react.default.createElement(_elementor_ui.Link, { | |
| 1600 | - href: "https://go.elementor.com/ai-terms/", | |
| 1601 | - target: "_blank", | |
| 1602 | - color: "info.main" | |
| 1603 | - }, (0, _wordpress_i18n.__)("Terms of Service", "elementor")), " & ", /*#__PURE__*/ react.default.createElement(_elementor_ui.Link, { | |
| 1604 | - href: "https://go.elementor.com/ai-privacy-policy/", | |
| 1605 | - target: "_blank", | |
| 1606 | - color: "info.main" | |
| 1607 | - }, (0, _wordpress_i18n.__)("Privacy Policy", "elementor")), (0, _wordpress_i18n.__)(" of the Elementor AI service.", "elementor")), /*#__PURE__*/ react.default.createElement(_elementor_ui.Button, { | |
| 1608 | - ref: approveButtonRef, | |
| 1609 | - href: connectUrl, | |
| 1610 | - variant: "contained", | |
| 1611 | - sx: { | |
| 1612 | - mt: 1, | |
| 1613 | - "&:hover": { color: "primary.contrastText" } | |
| 1614 | - } | |
| 1615 | - }, (0, _wordpress_i18n.__)("Connect", "elementor"))); | |
| 1616 | - }; | |
| 1617 | - Connect.propTypes = { | |
| 1618 | - connectUrl: import_prop_types$36.default.string.isRequired, | |
| 1619 | - onSuccess: import_prop_types$36.default.func.isRequired | |
| 1620 | - }; | |
| 1621 | - })); | |
| 1622 | 4932 | |
| 1623 | -//#endregion | |
| 1624 | -//#region node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js | |
| 1625 | - function _objectWithoutPropertiesLoose$1(r, e) { | |
| 1626 | - if (null == r) return {}; | |
| 1627 | - var t = {}; | |
| 1628 | - for (var n in r) if ({}.hasOwnProperty.call(r, n)) { | |
| 1629 | - if (-1 !== e.indexOf(n)) continue; | |
| 1630 | - t[n] = r[n]; | |
| 1631 | - } | |
| 1632 | - return t; | |
| 1633 | - } | |
| 1634 | - var init_objectWithoutPropertiesLoose$1 = __esmMin((() => { | |
| 1635 | - __name(_objectWithoutPropertiesLoose$1, "_objectWithoutPropertiesLoose"); | |
| 1636 | - })); | |
| 1637 | 4933 | |
| 1638 | -//#endregion | |
| 1639 | -//#region node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js | |
| 1640 | - function _objectWithoutProperties$1(e, t) { | |
| 1641 | - if (null == e) return {}; | |
| 1642 | - var o; | |
| 1643 | - var r; | |
| 1644 | - var i = _objectWithoutPropertiesLoose$1(e, t); | |
| 1645 | - if (Object.getOwnPropertySymbols) { | |
| 1646 | - var n = Object.getOwnPropertySymbols(e); | |
| 1647 | - for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); | |
| 1648 | - } | |
| 1649 | - return i; | |
| 1650 | - } | |
| 1651 | - var init_objectWithoutProperties$1 = __esmMin((() => { | |
| 1652 | - init_objectWithoutPropertiesLoose$1(); | |
| 1653 | - __name(_objectWithoutProperties$1, "_objectWithoutProperties"); | |
| 1654 | - })); | |
| 4934 | +var ReactIs = __webpack_require__(/*! react-is */ "../node_modules/prop-types/node_modules/react-is/index.js"); | |
| 4935 | +var assign = __webpack_require__(/*! object-assign */ "../node_modules/object-assign/index.js"); | |
| 1655 | 4936 | |
| 1656 | -//#endregion | |
| 1657 | -//#region node_modules/@babel/runtime/helpers/esm/extends.js | |
| 1658 | - function _extends() { | |
| 1659 | - return _extends = Object.assign ? Object.assign.bind() : function(n) { | |
| 1660 | - for (var e = 1; e < arguments.length; e++) { | |
| 1661 | - var t = arguments[e]; | |
| 1662 | - for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); | |
| 1663 | - } | |
| 1664 | - return n; | |
| 1665 | - }, _extends.apply(null, arguments); | |
| 1666 | - } | |
| 1667 | - var init_extends = __esmMin((() => {})); | |
| 4937 | +var ReactPropTypesSecret = __webpack_require__(/*! ./lib/ReactPropTypesSecret */ "../node_modules/prop-types/lib/ReactPropTypesSecret.js"); | |
| 4938 | +var has = __webpack_require__(/*! ./lib/has */ "../node_modules/prop-types/lib/has.js"); | |
| 4939 | +var checkPropTypes = __webpack_require__(/*! ./checkPropTypes */ "../node_modules/prop-types/checkPropTypes.js"); | |
| 1668 | 4940 | |
| 1669 | -//#endregion | |
| 1670 | -//#region modules/ai/assets/js/editor/components/prompt-error-message.js | |
| 1671 | - var import_prop_types$35, _excluded$9, PromptErrorMessage; | |
| 1672 | - var init_prompt_error_message = __esmMin((() => { | |
| 1673 | - init_extends(); | |
| 1674 | - init_objectWithoutProperties$1(); | |
| 1675 | - import_prop_types$35 = /* @__PURE__ */ __toESM(require_prop_types()); | |
| 1676 | - _excluded$9 = [ | |
| 1677 | - "error", | |
| 1678 | - "onRetry", | |
| 1679 | - "actionPosition" | |
| 1680 | - ]; | |
| 1681 | - PromptErrorMessage = function PromptErrorMessage(_ref) { | |
| 1682 | - var error = _ref.error; | |
| 1683 | - var _ref$onRetry = _ref.onRetry; | |
| 1684 | - var onRetry = _ref$onRetry === void 0 ? function() {} : _ref$onRetry; | |
| 1685 | - var _ref$actionPosition = _ref.actionPosition; | |
| 1686 | - var actionPosition = _ref$actionPosition === void 0 ? "default" : _ref$actionPosition; | |
| 1687 | - var props = _objectWithoutProperties$1(_ref, _excluded$9); | |
| 1688 | - function getQuotaReachedTrailMessage(featureName) { | |
| 1689 | - if (!featureName) return { | |
| 1690 | - text: /*#__PURE__*/ react.default.createElement(_elementor_ui.AlertTitle, null, (0, _wordpress_i18n.__)("It's time to upgrade.", "elementor")), | |
| 1691 | - description: (0, _wordpress_i18n.__)("Enjoy the free trial? Upgrade now for unlimited access to built-in image, text and custom code generators.", "elementor"), | |
| 1692 | - buttonText: (0, _wordpress_i18n.__)("Upgrade", "elementor"), | |
| 1693 | - buttonAction: function buttonAction() { | |
| 1694 | - return window.open("https://go.elementor.com/ai-popup-purchase-limit-reached/", "_blank"); | |
| 1695 | - } | |
| 1696 | - }; | |
| 1697 | - return { | |
| 1698 | - text: /*#__PURE__*/ react.default.createElement(_elementor_ui.AlertTitle, null, (0, _wordpress_i18n.sprintf)((0, _wordpress_i18n.__)("You've used all AI credits for %s.", "elementor"), featureName.toLowerCase())), | |
| 1699 | - description: (0, _wordpress_i18n.__)("Upgrade now to keep using this feature. You still have credits for other AI features (Text, Code, Images, Containers, etc.)", "elementor"), | |
| 1700 | - buttonText: (0, _wordpress_i18n.__)("Upgrade now", "elementor"), | |
| 1701 | - buttonAction: function buttonAction() { | |
| 1702 | - return window.open("https://go.elementor.com/ai-popup-purchase-limit-reached/", "_blank"); | |
| 1703 | - } | |
| 1704 | - }; | |
| 1705 | - } | |
| 1706 | - function getErrorMessage() { | |
| 1707 | - var _error$extra_data; | |
| 1708 | - var errMsg = error.message || error; | |
| 1709 | - var featureName = (_error$extra_data = error.extra_data) === null || _error$extra_data === void 0 ? void 0 : _error$extra_data.featureName; | |
| 1710 | - var messages = { | |
| 1711 | - default: { | |
| 1712 | - text: /*#__PURE__*/ react.default.createElement(_elementor_ui.AlertTitle, null, (0, _wordpress_i18n.__)("There was a glitch.", "elementor")), | |
| 1713 | - description: (0, _wordpress_i18n.__)("Wait a moment and give it another go, or try tweaking the prompt.", "elementor"), | |
| 1714 | - buttonText: (0, _wordpress_i18n.__)("Try again", "elementor"), | |
| 1715 | - buttonAction: onRetry | |
| 1716 | - }, | |
| 1717 | - service_outage_internal: { | |
| 1718 | - text: /*#__PURE__*/ react.default.createElement(_elementor_ui.AlertTitle, null, (0, _wordpress_i18n.__)("There was a glitch.", "elementor")), | |
| 1719 | - description: (0, _wordpress_i18n.__)("Wait a moment and give it another go.", "elementor"), | |
| 1720 | - buttonText: (0, _wordpress_i18n.__)("Try again", "elementor"), | |
| 1721 | - buttonAction: onRetry | |
| 1722 | - }, | |
| 1723 | - invalid_connect_data: { | |
| 1724 | - text: /*#__PURE__*/ react.default.createElement(_elementor_ui.AlertTitle, null, (0, _wordpress_i18n.__)("There was a glitch.", "elementor")), | |
| 1725 | - description: /*#__PURE__*/ react.default.createElement(react.default.Fragment, null, (0, _wordpress_i18n.__)("Try exiting Elementor and sign in again.", "elementor"), " ", /*#__PURE__*/ react.default.createElement("a", { | |
| 1726 | - href: "https://elementor.com/help/disconnecting-reconnecting-your-elementor-account/", | |
| 1727 | - target: "_blank", | |
| 1728 | - rel: "noreferrer" | |
| 1729 | - }, (0, _wordpress_i18n.__)("Show me how", "elementor"))), | |
| 1730 | - buttonText: (0, _wordpress_i18n.__)("Reconnect", "elementor"), | |
| 1731 | - buttonAction: function buttonAction() { | |
| 1732 | - return window.open(window.ElementorAiConfig.connect_url); | |
| 1733 | - } | |
| 1734 | - }, | |
| 1735 | - not_connected: { | |
| 1736 | - text: /*#__PURE__*/ react.default.createElement(_elementor_ui.AlertTitle, null, (0, _wordpress_i18n.__)("You aren't connected to Elementor AI.", "elementor")), | |
| 1737 | - description: (0, _wordpress_i18n.__)("Elementor AI is just a few clicks away. Connect your account to instantly create texts and custom code.", "elementor"), | |
| 1738 | - buttonText: (0, _wordpress_i18n.__)("Connect", "elementor"), | |
| 1739 | - buttonAction: function buttonAction() { | |
| 1740 | - return window.open(window.ElementorAiConfig.connect_url); | |
| 1741 | - } | |
| 1742 | - }, | |
| 1743 | - quota_reached_trail: getQuotaReachedTrailMessage(featureName), | |
| 1744 | - quota_reached_subscription: { | |
| 1745 | - text: /*#__PURE__*/ react.default.createElement(_elementor_ui.AlertTitle, null, (0, _wordpress_i18n.__)("Looks like you're out of credits.", "elementor")), | |
| 1746 | - description: (0, _wordpress_i18n.__)("Ready to take it to the next level?", "elementor"), | |
| 1747 | - buttonText: (0, _wordpress_i18n.__)("Upgrade now", "elementor"), | |
| 1748 | - buttonAction: function buttonAction() { | |
| 1749 | - return window.open("https://go.elementor.com/ai-popup-purchase-limit-reached/", "_blank"); | |
| 1750 | - } | |
| 1751 | - }, | |
| 1752 | - rate_limit_network: { | |
| 1753 | - text: /*#__PURE__*/ react.default.createElement(_elementor_ui.AlertTitle, null, (0, _wordpress_i18n.__)("Whoa! Slow down there.", "elementor")), | |
| 1754 | - description: (0, _wordpress_i18n.__)("We can’t process that many requests so fast. Try again in 15 minutes.", "elementor") | |
| 1755 | - }, | |
| 1756 | - invalid_prompts: { | |
| 1757 | - text: /*#__PURE__*/ react.default.createElement(_elementor_ui.AlertTitle, null, (0, _wordpress_i18n.__)("We were unable to generate that prompt.", "elementor")), | |
| 1758 | - description: (0, _wordpress_i18n.__)("Seems like the prompt contains words that could generate harmful content. Write a different prompt to continue.", "elementor") | |
| 1759 | - }, | |
| 1760 | - service_unavailable: { | |
| 1761 | - text: /*#__PURE__*/ react.default.createElement(_elementor_ui.AlertTitle, null, (0, _wordpress_i18n.__)("There was a glitch.", "elementor")), | |
| 1762 | - description: (0, _wordpress_i18n.__)("Wait a moment and give it another go, or try tweaking the prompt.", "elementor"), | |
| 1763 | - buttonText: (0, _wordpress_i18n.__)("Try again", "elementor"), | |
| 1764 | - buttonAction: onRetry | |
| 1765 | - }, | |
| 1766 | - request_timeout_error: { | |
| 1767 | - text: /*#__PURE__*/ react.default.createElement(_elementor_ui.AlertTitle, null, (0, _wordpress_i18n.__)("There was a glitch.", "elementor")), | |
| 1768 | - description: (0, _wordpress_i18n.__)("Wait a moment and give it another go, or try tweaking the prompt.", "elementor"), | |
| 1769 | - buttonText: (0, _wordpress_i18n.__)("Try again", "elementor"), | |
| 1770 | - buttonAction: onRetry | |
| 1771 | - }, | |
| 1772 | - invalid_token: { | |
| 1773 | - text: /*#__PURE__*/ react.default.createElement(_elementor_ui.AlertTitle, null, (0, _wordpress_i18n.__)("Try again", "elementor")), | |
| 1774 | - description: (0, _wordpress_i18n.__)("Try exiting Elementor and sign in again.", "elementor"), | |
| 1775 | - buttonText: (0, _wordpress_i18n.__)("Reconnect", "elementor"), | |
| 1776 | - buttonAction: onRetry | |
| 1777 | - }, | |
| 1778 | - file_too_large: { | |
| 1779 | - text: /*#__PURE__*/ react.default.createElement(_elementor_ui.AlertTitle, null, (0, _wordpress_i18n.__)("The file is too large.", "elementor")), | |
| 1780 | - description: (0, _wordpress_i18n.__)("Please upload a file that is less than 4MB.", "elementor") | |
| 1781 | - }, | |
| 1782 | - image_resolution_maximum_exceeded: { | |
| 1783 | - text: /*#__PURE__*/ react.default.createElement(_elementor_ui.AlertTitle, null, (0, _wordpress_i18n.__)("The image resolution exceeds the maximum allowed size.", "elementor")), | |
| 1784 | - description: (0, _wordpress_i18n.__)("Please upload a file with dimensions less than 2048x2048 pixels.", "elementor") | |
| 1785 | - }, | |
| 1786 | - external_service_unavailable: { | |
| 1787 | - text: /*#__PURE__*/ react.default.createElement(_elementor_ui.AlertTitle, null, (0, _wordpress_i18n.__)("Temporary external service issue", "elementor")), | |
| 1788 | - description: (0, _wordpress_i18n.__)("It seems that one of our partner services is temporarily unavailable. Please try again in a few minutes.", "elementor"), | |
| 1789 | - buttonText: (0, _wordpress_i18n.__)("Try Again", "elementor"), | |
| 1790 | - buttonAction: onRetry | |
| 1791 | - } | |
| 1792 | - }; | |
| 1793 | - return messages[errMsg] || messages.default; | |
| 1794 | - } | |
| 1795 | - var message = getErrorMessage(); | |
| 1796 | - var action = (message === null || message === void 0 ? void 0 : message.buttonText) && /*#__PURE__*/ react.default.createElement(_elementor_ui.Button, { | |
| 1797 | - color: "inherit", | |
| 1798 | - size: "small", | |
| 1799 | - variant: "outlined", | |
| 1800 | - onClick: message.buttonAction | |
| 1801 | - }, message.buttonText); | |
| 1802 | - return /*#__PURE__*/ react.default.createElement(_elementor_ui.Alert, _extends({ | |
| 1803 | - severity: message.severity || "error", | |
| 1804 | - action: "default" === actionPosition && action | |
| 1805 | - }, props), message.text, message.description, "bottom" === actionPosition && /*#__PURE__*/ react.default.createElement(_elementor_ui.Box, { sx: { mt: 1 } }, action)); | |
| 1806 | - }; | |
| 1807 | - PromptErrorMessage.propTypes = { | |
| 1808 | - error: import_prop_types$35.default.oneOfType([import_prop_types$35.default.object, import_prop_types$35.default.string]), | |
| 1809 | - onRetry: import_prop_types$35.default.func, | |
| 1810 | - actionPosition: import_prop_types$35.default.oneOf(["default", "bottom"]) | |
| 1811 | - }; | |
| 1812 | - })); | |
| 4941 | +var printWarning = function() {}; | |
| 1813 | 4942 | |
| 1814 | -//#endregion | |
| 1815 | -//#region modules/ai/assets/js/editor/pages/form-layout/components/unsaved-changes-alert.js | |
| 1816 | - var import_prop_types$34, _excluded$8, UnsavedChangesAlert; | |
| 1817 | - var init_unsaved_changes_alert = __esmMin((() => { | |
| 1818 | - init_extends(); | |
| 1819 | - init_objectWithoutProperties$1(); | |
| 1820 | - import_prop_types$34 = /* @__PURE__ */ __toESM(require_prop_types()); | |
| 1821 | - _excluded$8 = [ | |
| 1822 | - "onClose", | |
| 1823 | - "onCancel", | |
| 1824 | - "title", | |
| 1825 | - "text" | |
| 1826 | - ]; | |
| 1827 | - UnsavedChangesAlert = function UnsavedChangesAlert(_ref) { | |
| 1828 | - var onClose = _ref.onClose; | |
| 1829 | - var onCancel = _ref.onCancel; | |
| 1830 | - var title = _ref.title; | |
| 1831 | - var text = _ref.text; | |
| 1832 | - var props = _objectWithoutProperties$1(_ref, _excluded$8); | |
| 1833 | - return /*#__PURE__*/ react.default.createElement(_elementor_ui.Dialog, _extends({ | |
| 1834 | - "aria-labelledby": "unsaved-changes-alert-title", | |
| 1835 | - "aria-describedby": "unsaved-changes-alert-description" | |
| 1836 | - }, props), /*#__PURE__*/ react.default.createElement(_elementor_ui.DialogTitle, { id: "unsaved-changes-alert-title" }, title), /*#__PURE__*/ react.default.createElement(_elementor_ui.DialogContent, null, /*#__PURE__*/ react.default.createElement(_elementor_ui.DialogContentText, { id: "unsaved-changes-alert-description" }, text)), /*#__PURE__*/ react.default.createElement(_elementor_ui.DialogActions, null, /*#__PURE__*/ react.default.createElement(_elementor_ui.Button, { | |
| 1837 | - onClick: onCancel, | |
| 1838 | - color: "secondary" | |
| 1839 | - }, (0, _wordpress_i18n.__)("Cancel", "elementor")), /*#__PURE__*/ react.default.createElement(_elementor_ui.Button, { | |
| 1840 | - onClick: onClose, | |
| 1841 | - color: "error", | |
| 1842 | - variant: "contained" | |
| 1843 | - }, (0, _wordpress_i18n.__)("Yes, leave", "elementor")))); | |
| 1844 | - }; | |
| 1845 | - UnsavedChangesAlert.propTypes = { | |
| 1846 | - title: import_prop_types$34.default.string, | |
| 1847 | - text: import_prop_types$34.default.string, | |
| 1848 | - onCancel: import_prop_types$34.default.func, | |
| 1849 | - onClose: import_prop_types$34.default.func | |
| 1850 | - }; | |
| 1851 | - })); | |
| 4943 | +if (true) { | |
| 4944 | + printWarning = function(text) { | |
| 4945 | + var message = 'Warning: ' + text; | |
| 4946 | + if (typeof console !== 'undefined') { | |
| 4947 | + console.error(message); | |
| 4948 | + } | |
| 4949 | + try { | |
| 4950 | + // --- Welcome to debugging React --- | |
| 4951 | + // This error was thrown as a convenience so that you can use this stack | |
| 4952 | + // to find the callsite that caused this warning to fire. | |
| 4953 | + throw new Error(message); | |
| 4954 | + } catch (x) {} | |
| 4955 | + }; | |
| 4956 | +} | |
| 1852 | 4957 | |
| 1853 | -//#endregion | |
| 1854 | -//#region \0@[email protected]/helpers/esm/typeof.js | |
| 1855 | - function _typeof(o) { | |
| 1856 | - "@babel/helpers - typeof"; | |
| 1857 | - return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) { | |
| 1858 | - return typeof o; | |
| 1859 | - } : function(o) { | |
| 1860 | - return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; | |
| 1861 | - }, _typeof(o); | |
| 1862 | - } | |
| 1863 | - var init_typeof = __esmMin((() => {})); | |
| 4958 | +function emptyFunctionThatReturnsNull() { | |
| 4959 | + return null; | |
| 4960 | +} | |
| 1864 | 4961 | |
| 1865 | -//#endregion | |
| 1866 | -//#region \0@[email protected]/helpers/esm/toPrimitive.js | |
| 1867 | - function toPrimitive(t, r) { | |
| 1868 | - if ("object" != _typeof(t) || !t) return t; | |
| 1869 | - var e = t[Symbol.toPrimitive]; | |
| 1870 | - if (void 0 !== e) { | |
| 1871 | - var i = e.call(t, r || "default"); | |
| 1872 | - if ("object" != _typeof(i)) return i; | |
| 1873 | - throw new TypeError("@@toPrimitive must return a primitive value."); | |
| 1874 | - } | |
| 1875 | - return ("string" === r ? String : Number)(t); | |
| 1876 | - } | |
| 1877 | - var init_toPrimitive = __esmMin((() => { | |
| 1878 | - init_typeof(); | |
| 1879 | - })); | |
| 4962 | +module.exports = function(isValidElement, throwOnDirectAccess) { | |
| 4963 | + /* global Symbol */ | |
| 4964 | + var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; | |
| 4965 | + var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec. | |
| 1880 | 4966 | |
| 1881 | -//#endregion | |
| 1882 | -//#region \0@[email protected]/helpers/esm/toPropertyKey.js | |
| 1883 | - function toPropertyKey(t) { | |
| 1884 | - var i = toPrimitive(t, "string"); | |
| 1885 | - return "symbol" == _typeof(i) ? i : i + ""; | |
| 1886 | - } | |
| 1887 | - var init_toPropertyKey = __esmMin((() => { | |
| 1888 | - init_typeof(); | |
| 1889 | - init_toPrimitive(); | |
| 1890 | - })); | |
| 4967 | + /** | |
| 4968 | + * Returns the iterator method function contained on the iterable object. | |
| 4969 | + * | |
| 4970 | + * Be sure to invoke the function with the iterable as context: | |
| 4971 | + * | |
| 4972 | + * var iteratorFn = getIteratorFn(myIterable); | |
| 4973 | + * if (iteratorFn) { | |
| 4974 | + * var iterator = iteratorFn.call(myIterable); | |
| 4975 | + * ... | |
| 4976 | + * } | |
| 4977 | + * | |
| 4978 | + * @param {?object} maybeIterable | |
| 4979 | + * @return {?function} | |
| 4980 | + */ | |
| 4981 | + function getIteratorFn(maybeIterable) { | |
| 4982 | + var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]); | |
| 4983 | + if (typeof iteratorFn === 'function') { | |
| 4984 | + return iteratorFn; | |
| 4985 | + } | |
| 4986 | + } | |
| 1891 | 4987 | |
| 1892 | -//#endregion | |
| 1893 | -//#region \0@[email protected]/helpers/esm/defineProperty.js | |
| 1894 | - function _defineProperty(e, r, t) { | |
| 1895 | - return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, { | |
| 1896 | - value: t, | |
| 1897 | - enumerable: !0, | |
| 1898 | - configurable: !0, | |
| 1899 | - writable: !0 | |
| 1900 | - }) : e[r] = t, e; | |
| 1901 | - } | |
| 1902 | - var init_defineProperty = __esmMin((() => { | |
| 1903 | - init_toPropertyKey(); | |
| 1904 | - })); | |
| 4988 | + /** | |
| 4989 | + * Collection of methods that allow declaration and validation of props that are | |
| 4990 | + * supplied to React components. Example usage: | |
| 4991 | + * | |
| 4992 | + * var Props = require('ReactPropTypes'); | |
| 4993 | + * var MyArticle = React.createClass({ | |
| 4994 | + * propTypes: { | |
| 4995 | + * // An optional string prop named "description". | |
| 4996 | + * description: Props.string, | |
| 4997 | + * | |
| 4998 | + * // A required enum prop named "category". | |
| 4999 | + * category: Props.oneOf(['News','Photos']).isRequired, | |
| 5000 | + * | |
| 5001 | + * // A prop named "dialog" that requires an instance of Dialog. | |
| 5002 | + * dialog: Props.instanceOf(Dialog).isRequired | |
| 5003 | + * }, | |
| 5004 | + * render: function() { ... } | |
| 5005 | + * }); | |
| 5006 | + * | |
| 5007 | + * A more formal specification of how these methods are used: | |
| 5008 | + * | |
| 5009 | + * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...) | |
| 5010 | + * decl := ReactPropTypes.{type}(.isRequired)? | |
| 5011 | + * | |
| 5012 | + * Each and every declaration produces a function with the same signature. This | |
| 5013 | + * allows the creation of custom validation functions. For example: | |
| 5014 | + * | |
| 5015 | + * var MyLink = React.createClass({ | |
| 5016 | + * propTypes: { | |
| 5017 | + * // An optional string or URI prop named "href". | |
| 5018 | + * href: function(props, propName, componentName) { | |
| 5019 | + * var propValue = props[propName]; | |
| 5020 | + * if (propValue != null && typeof propValue !== 'string' && | |
| 5021 | + * !(propValue instanceof URI)) { | |
| 5022 | + * return new Error( | |
| 5023 | + * 'Expected a string or an URI for ' + propName + ' in ' + | |
| 5024 | + * componentName | |
| 5025 | + * ); | |
| 5026 | + * } | |
| 5027 | + * } | |
| 5028 | + * }, | |
| 5029 | + * render: function() {...} | |
| 5030 | + * }); | |
| 5031 | + * | |
| 5032 | + * @internal | |
| 5033 | + */ | |
| 1905 | 5034 | |
| 1906 | -//#endregion | |
| 1907 | -//#region \0@[email protected]/helpers/esm/objectSpread2.js | |
| 1908 | - function ownKeys$11(e, r) { | |
| 1909 | - var t = Object.keys(e); | |
| 1910 | - if (Object.getOwnPropertySymbols) { | |
| 1911 | - var o = Object.getOwnPropertySymbols(e); | |
| 1912 | - r && (o = o.filter(function(r) { | |
| 1913 | - return Object.getOwnPropertyDescriptor(e, r).enumerable; | |
| 1914 | - })), t.push.apply(t, o); | |
| 1915 | - } | |
| 1916 | - return t; | |
| 1917 | - } | |
| 1918 | - function _objectSpread2(e) { | |
| 1919 | - for (var r = 1; r < arguments.length; r++) { | |
| 1920 | - var t = null != arguments[r] ? arguments[r] : {}; | |
| 1921 | - r % 2 ? ownKeys$11(Object(t), !0).forEach(function(r) { | |
| 1922 | - _defineProperty(e, r, t[r]); | |
| 1923 | - }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$11(Object(t)).forEach(function(r) { | |
| 1924 | - Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); | |
| 1925 | - }); | |
| 1926 | - } | |
| 1927 | - return e; | |
| 1928 | - } | |
| 1929 | - var init_objectSpread2 = __esmMin((() => { | |
| 1930 | - init_defineProperty(); | |
| 1931 | - __name(ownKeys$11, "ownKeys"); | |
| 1932 | - })); | |
| 5035 | + var ANONYMOUS = '<<anonymous>>'; | |
| 1933 | 5036 | |
| 1934 | -//#endregion | |
| 1935 | -//#region \0@[email protected]/helpers/esm/objectWithoutPropertiesLoose.js | |
| 1936 | - function _objectWithoutPropertiesLoose(r, e) { | |
| 1937 | - if (null == r) return {}; | |
| 1938 | - var t = {}; | |
| 1939 | - for (var n in r) if ({}.hasOwnProperty.call(r, n)) { | |
| 1940 | - if (e.includes(n)) continue; | |
| 1941 | - t[n] = r[n]; | |
| 1942 | - } | |
| 1943 | - return t; | |
| 1944 | - } | |
| 1945 | - var init_objectWithoutPropertiesLoose = __esmMin((() => {})); | |
| 5037 | + // Important! | |
| 5038 | + // Keep this list in sync with production version in `./factoryWithThrowingShims.js`. | |
| 5039 | + var ReactPropTypes = { | |
| 5040 | + array: createPrimitiveTypeChecker('array'), | |
| 5041 | + bigint: createPrimitiveTypeChecker('bigint'), | |
| 5042 | + bool: createPrimitiveTypeChecker('boolean'), | |
| 5043 | + func: createPrimitiveTypeChecker('function'), | |
| 5044 | + number: createPrimitiveTypeChecker('number'), | |
| 5045 | + object: createPrimitiveTypeChecker('object'), | |
| 5046 | + string: createPrimitiveTypeChecker('string'), | |
| 5047 | + symbol: createPrimitiveTypeChecker('symbol'), | |
| 1946 | 5048 | |
| 1947 | -//#endregion | |
| 1948 | -//#region \0@[email protected]/helpers/esm/objectWithoutProperties.js | |
| 1949 | - function _objectWithoutProperties(e, t) { | |
| 1950 | - if (null == e) return {}; | |
| 1951 | - var o; | |
| 1952 | - var r; | |
| 1953 | - var i = _objectWithoutPropertiesLoose(e, t); | |
| 1954 | - if (Object.getOwnPropertySymbols) { | |
| 1955 | - var s = Object.getOwnPropertySymbols(e); | |
| 1956 | - for (r = 0; r < s.length; r++) o = s[r], t.includes(o) || {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); | |
| 1957 | - } | |
| 1958 | - return i; | |
| 1959 | - } | |
| 1960 | - var init_objectWithoutProperties = __esmMin((() => { | |
| 1961 | - init_objectWithoutPropertiesLoose(); | |
| 1962 | - })); | |
| 5049 | + any: createAnyTypeChecker(), | |
| 5050 | + arrayOf: createArrayOfTypeChecker, | |
| 5051 | + element: createElementTypeChecker(), | |
| 5052 | + elementType: createElementTypeTypeChecker(), | |
| 5053 | + instanceOf: createInstanceTypeChecker, | |
| 5054 | + node: createNodeChecker(), | |
| 5055 | + objectOf: createObjectOfTypeChecker, | |
| 5056 | + oneOf: createEnumTypeChecker, | |
| 5057 | + oneOfType: createUnionTypeChecker, | |
| 5058 | + shape: createShapeTypeChecker, | |
| 5059 | + exact: createStrictShapeTypeChecker, | |
| 5060 | + }; | |
| 1963 | 5061 | |
| 1964 | -//#endregion | |
| 1965 | -//#region node_modules/react-draggable/node_modules/clsx/dist/clsx.js | |
| 1966 | - var require_clsx = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 1967 | - function r(e) { | |
| 1968 | - var o; | |
| 1969 | - var t; | |
| 1970 | - var f = ""; | |
| 1971 | - if ("string" == typeof e || "number" == typeof e) f += e; | |
| 1972 | - else if ("object" == typeof e) if (Array.isArray(e)) { | |
| 1973 | - var n = e.length; | |
| 1974 | - for (o = 0; o < n; o++) e[o] && (t = r(e[o])) && (f && (f += " "), f += t); | |
| 1975 | - } else for (t in e) e[t] && (f && (f += " "), f += t); | |
| 1976 | - return f; | |
| 1977 | - } | |
| 1978 | - function e() { | |
| 1979 | - for (var e, o, t = 0, f = "", n = arguments.length; t < n; t++) (e = arguments[t]) && (o = r(e)) && (f && (f += " "), f += o); | |
| 1980 | - return f; | |
| 1981 | - } | |
| 1982 | - module.exports = e, module.exports.clsx = e; | |
| 1983 | - })); | |
| 5062 | + /** | |
| 5063 | + * inlined Object.is polyfill to avoid requiring consumers ship their own | |
| 5064 | + * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is | |
| 5065 | + */ | |
| 5066 | + /*eslint-disable no-self-compare*/ | |
| 5067 | + function is(x, y) { | |
| 5068 | + // SameValue algorithm | |
| 5069 | + if (x === y) { | |
| 5070 | + // Steps 1-5, 7-10 | |
| 5071 | + // Steps 6.b-6.e: +0 != -0 | |
| 5072 | + return x !== 0 || 1 / x === 1 / y; | |
| 5073 | + } else { | |
| 5074 | + // Step 6.a: NaN == NaN | |
| 5075 | + return x !== x && y !== y; | |
| 5076 | + } | |
| 5077 | + } | |
| 5078 | + /*eslint-enable no-self-compare*/ | |
| 1984 | 5079 | |
| 1985 | -//#endregion | |
| 1986 | -//#region node_modules/react-draggable/build/cjs/utils/shims.js | |
| 1987 | - var require_shims = /* @__PURE__ */ __commonJSMin(((exports) => { | |
| 1988 | - Object.defineProperty(exports, "__esModule", { value: true }); | |
| 1989 | - exports.dontSetMe = dontSetMe; | |
| 1990 | - exports.findInArray = findInArray; | |
| 1991 | - exports.int = int; | |
| 1992 | - exports.isFunction = isFunction; | |
| 1993 | - exports.isNum = isNum; | |
| 1994 | - function findInArray(array, callback) { | |
| 1995 | - for (let i = 0, length = array.length; i < length; i++) if (callback.apply(callback, [ | |
| 1996 | - array[i], | |
| 1997 | - i, | |
| 1998 | - array | |
| 1999 | - ])) return array[i]; | |
| 2000 | - } | |
| 2001 | - function isFunction(func) { | |
| 2002 | - return typeof func === "function" || Object.prototype.toString.call(func) === "[object Function]"; | |
| 2003 | - } | |
| 2004 | - function isNum(num) { | |
| 2005 | - return typeof num === "number" && !isNaN(num); | |
| 2006 | - } | |
| 2007 | - function int(a) { | |
| 2008 | - return parseInt(a, 10); | |
| 2009 | - } | |
| 2010 | - function dontSetMe(props, propName, componentName) { | |
| 2011 | - if (props[propName]) return /* @__PURE__ */ new Error(`Invalid prop ${propName} passed to ${componentName} - do not set this, set it on the child.`); | |
| 2012 | - } | |
| 2013 | - })); | |
| 5080 | + /** | |
| 5081 | + * We use an Error-like object for backward compatibility as people may call | |
| 5082 | + * PropTypes directly and inspect their output. However, we don't use real | |
| 5083 | + * Errors anymore. We don't inspect their stack anyway, and creating them | |
| 5084 | + * is prohibitively expensive if they are created too often, such as what | |
| 5085 | + * happens in oneOfType() for any type before the one that matched. | |
| 5086 | + */ | |
| 5087 | + function PropTypeError(message, data) { | |
| 5088 | + this.message = message; | |
| 5089 | + this.data = data && typeof data === 'object' ? data: {}; | |
| 5090 | + this.stack = ''; | |
| 5091 | + } | |
| 5092 | + // Make `instanceof Error` still work for returned errors. | |
| 5093 | + PropTypeError.prototype = Error.prototype; | |
| 2014 | 5094 | |
| 2015 | -//#endregion | |
| 2016 | -//#region node_modules/react-draggable/build/cjs/utils/getPrefix.js | |
| 2017 | - var require_getPrefix = /* @__PURE__ */ __commonJSMin(((exports) => { | |
| 2018 | - Object.defineProperty(exports, "__esModule", { value: true }); | |
| 2019 | - exports.browserPrefixToKey = browserPrefixToKey; | |
| 2020 | - exports.browserPrefixToStyle = browserPrefixToStyle; | |
| 2021 | - exports.default = void 0; | |
| 2022 | - exports.getPrefix = getPrefix; | |
| 2023 | - var prefixes = [ | |
| 2024 | - "Moz", | |
| 2025 | - "Webkit", | |
| 2026 | - "O", | |
| 2027 | - "ms" | |
| 2028 | - ]; | |
| 2029 | - function getPrefix() { | |
| 2030 | - var _window$document; | |
| 2031 | - let prop = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : "transform"; | |
| 2032 | - if (typeof window === "undefined") return ""; | |
| 2033 | - const style = (_window$document = window.document) === null || _window$document === void 0 || (_window$document = _window$document.documentElement) === null || _window$document === void 0 ? void 0 : _window$document.style; | |
| 2034 | - if (!style) return ""; | |
| 2035 | - if (prop in style) return ""; | |
| 2036 | - for (let i = 0; i < prefixes.length; i++) if (browserPrefixToKey(prop, prefixes[i]) in style) return prefixes[i]; | |
| 2037 | - return ""; | |
| 2038 | - } | |
| 2039 | - function browserPrefixToKey(prop, prefix) { | |
| 2040 | - return prefix ? `${prefix}${kebabToTitleCase(prop)}` : prop; | |
| 2041 | - } | |
| 2042 | - function browserPrefixToStyle(prop, prefix) { | |
| 2043 | - return prefix ? `-${prefix.toLowerCase()}-${prop}` : prop; | |
| 2044 | - } | |
| 2045 | - function kebabToTitleCase(str) { | |
| 2046 | - let out = ""; | |
| 2047 | - let shouldCapitalize = true; | |
| 2048 | - for (let i = 0; i < str.length; i++) if (shouldCapitalize) { | |
| 2049 | - out += str[i].toUpperCase(); | |
| 2050 | - shouldCapitalize = false; | |
| 2051 | - } else if (str[i] === "-") shouldCapitalize = true; | |
| 2052 | - else out += str[i]; | |
| 2053 | - return out; | |
| 2054 | - } | |
| 2055 | - exports.default = getPrefix(); | |
| 2056 | - })); | |
| 5095 | + function createChainableTypeChecker(validate) { | |
| 5096 | + if (true) { | |
| 5097 | + var manualPropTypeCallCache = {}; | |
| 5098 | + var manualPropTypeWarningCount = 0; | |
| 5099 | + } | |
| 5100 | + function checkType(isRequired, props, propName, componentName, location, propFullName, secret) { | |
| 5101 | + componentName = componentName || ANONYMOUS; | |
| 5102 | + propFullName = propFullName || propName; | |
| 2057 | 5103 | |
| 2058 | -//#endregion | |
| 2059 | -//#region node_modules/react-draggable/build/cjs/utils/domFns.js | |
| 2060 | - var require_domFns = /* @__PURE__ */ __commonJSMin(((exports) => { | |
| 2061 | - init_objectSpread2(); | |
| 2062 | - Object.defineProperty(exports, "__esModule", { value: true }); | |
| 2063 | - exports.addClassName = addClassName; | |
| 2064 | - exports.addEvent = addEvent; | |
| 2065 | - exports.addUserSelectStyles = addUserSelectStyles; | |
| 2066 | - exports.createCSSTransform = createCSSTransform; | |
| 2067 | - exports.createSVGTransform = createSVGTransform; | |
| 2068 | - exports.getTouch = getTouch; | |
| 2069 | - exports.getTouchIdentifier = getTouchIdentifier; | |
| 2070 | - exports.getTranslation = getTranslation; | |
| 2071 | - exports.innerHeight = innerHeight; | |
| 2072 | - exports.innerWidth = innerWidth; | |
| 2073 | - exports.matchesSelector = matchesSelector; | |
| 2074 | - exports.matchesSelectorAndParentsTo = matchesSelectorAndParentsTo; | |
| 2075 | - exports.offsetXYFromParent = offsetXYFromParent; | |
| 2076 | - exports.outerHeight = outerHeight; | |
| 2077 | - exports.outerWidth = outerWidth; | |
| 2078 | - exports.removeClassName = removeClassName; | |
| 2079 | - exports.removeEvent = removeEvent; | |
| 2080 | - exports.scheduleRemoveUserSelectStyles = scheduleRemoveUserSelectStyles; | |
| 2081 | - var _shims = require_shims(); | |
| 2082 | - var _getPrefix = _interopRequireWildcard(require_getPrefix()); | |
| 2083 | - function _interopRequireWildcard(e, t) { | |
| 2084 | - if ("function" == typeof WeakMap) { | |
| 2085 | - var r = /* @__PURE__ */ new WeakMap(); | |
| 2086 | - var n = /* @__PURE__ */ new WeakMap(); | |
| 2087 | - } | |
| 2088 | - return (_interopRequireWildcard = function(e, t) { | |
| 2089 | - if (!t && e && e.__esModule) return e; | |
| 2090 | - var o; | |
| 2091 | - var i; | |
| 2092 | - var f = { | |
| 2093 | - __proto__: null, | |
| 2094 | - default: e | |
| 2095 | - }; | |
| 2096 | - if (null === e || "object" != typeof e && "function" != typeof e) return f; | |
| 2097 | - if (o = t ? n : r) { | |
| 2098 | - if (o.has(e)) return o.get(e); | |
| 2099 | - o.set(e, f); | |
| 2100 | - } | |
| 2101 | - for (const 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]); | |
| 2102 | - return f; | |
| 2103 | - })(e, t); | |
| 2104 | - } | |
| 2105 | - var matchesSelectorFunc = ""; | |
| 2106 | - function matchesSelector(el, selector) { | |
| 2107 | - if (!matchesSelectorFunc) matchesSelectorFunc = (0, _shims.findInArray)([ | |
| 2108 | - "matches", | |
| 2109 | - "webkitMatchesSelector", | |
| 2110 | - "mozMatchesSelector", | |
| 2111 | - "msMatchesSelector", | |
| 2112 | - "oMatchesSelector" | |
| 2113 | - ], function(method) { | |
| 2114 | - return (0, _shims.isFunction)(el[method]); | |
| 2115 | - }); | |
| 2116 | - if (!(0, _shims.isFunction)(el[matchesSelectorFunc])) return false; | |
| 2117 | - return el[matchesSelectorFunc](selector); | |
| 2118 | - } | |
| 2119 | - function matchesSelectorAndParentsTo(el, selector, baseNode) { | |
| 2120 | - let node = el; | |
| 2121 | - do { | |
| 2122 | - if (matchesSelector(node, selector)) return true; | |
| 2123 | - if (node === baseNode) return false; | |
| 2124 | - node = node.parentNode; | |
| 2125 | - } while (node); | |
| 2126 | - return false; | |
| 2127 | - } | |
| 2128 | - function addEvent(el, event, handler, inputOptions) { | |
| 2129 | - if (!el) return; | |
| 2130 | - const options = _objectSpread2({ capture: true }, inputOptions); | |
| 2131 | - if (el.addEventListener) el.addEventListener(event, handler, options); | |
| 2132 | - else if (el.attachEvent) el.attachEvent("on" + event, handler); | |
| 2133 | - else el["on" + event] = handler; | |
| 2134 | - } | |
| 2135 | - function removeEvent(el, event, handler, inputOptions) { | |
| 2136 | - if (!el) return; | |
| 2137 | - const options = _objectSpread2({ capture: true }, inputOptions); | |
| 2138 | - if (el.removeEventListener) el.removeEventListener(event, handler, options); | |
| 2139 | - else if (el.detachEvent) el.detachEvent("on" + event, handler); | |
| 2140 | - else el["on" + event] = null; | |
| 2141 | - } | |
| 2142 | - function outerHeight(node) { | |
| 2143 | - let height = node.clientHeight; | |
| 2144 | - const computedStyle = node.ownerDocument.defaultView.getComputedStyle(node); | |
| 2145 | - height += (0, _shims.int)(computedStyle.borderTopWidth); | |
| 2146 | - height += (0, _shims.int)(computedStyle.borderBottomWidth); | |
| 2147 | - return height; | |
| 2148 | - } | |
| 2149 | - function outerWidth(node) { | |
| 2150 | - let width = node.clientWidth; | |
| 2151 | - const computedStyle = node.ownerDocument.defaultView.getComputedStyle(node); | |
| 2152 | - width += (0, _shims.int)(computedStyle.borderLeftWidth); | |
| 2153 | - width += (0, _shims.int)(computedStyle.borderRightWidth); | |
| 2154 | - return width; | |
| 2155 | - } | |
| 2156 | - function innerHeight(node) { | |
| 2157 | - let height = node.clientHeight; | |
| 2158 | - const computedStyle = node.ownerDocument.defaultView.getComputedStyle(node); | |
| 2159 | - height -= (0, _shims.int)(computedStyle.paddingTop); | |
| 2160 | - height -= (0, _shims.int)(computedStyle.paddingBottom); | |
| 2161 | - return height; | |
| 2162 | - } | |
| 2163 | - function innerWidth(node) { | |
| 2164 | - let width = node.clientWidth; | |
| 2165 | - const computedStyle = node.ownerDocument.defaultView.getComputedStyle(node); | |
| 2166 | - width -= (0, _shims.int)(computedStyle.paddingLeft); | |
| 2167 | - width -= (0, _shims.int)(computedStyle.paddingRight); | |
| 2168 | - return width; | |
| 2169 | - } | |
| 2170 | - function offsetXYFromParent(evt, offsetParent, scale) { | |
| 2171 | - const offsetParentRect = offsetParent === offsetParent.ownerDocument.body ? { | |
| 2172 | - left: 0, | |
| 2173 | - top: 0 | |
| 2174 | - } : offsetParent.getBoundingClientRect(); | |
| 2175 | - return { | |
| 2176 | - x: (evt.clientX + offsetParent.scrollLeft - offsetParentRect.left) / scale, | |
| 2177 | - y: (evt.clientY + offsetParent.scrollTop - offsetParentRect.top) / scale | |
| 2178 | - }; | |
| 2179 | - } | |
| 2180 | - function createCSSTransform(controlPos, positionOffset) { | |
| 2181 | - const translation = getTranslation(controlPos, positionOffset, "px"); | |
| 2182 | - return { [(0, _getPrefix.browserPrefixToKey)("transform", _getPrefix.default)]: translation }; | |
| 2183 | - } | |
| 2184 | - function createSVGTransform(controlPos, positionOffset) { | |
| 2185 | - return getTranslation(controlPos, positionOffset, ""); | |
| 2186 | - } | |
| 2187 | - function getTranslation(_ref, positionOffset, unitSuffix) { | |
| 2188 | - let { x, y } = _ref; | |
| 2189 | - let translation = `translate(${x}${unitSuffix},${y}${unitSuffix})`; | |
| 2190 | - if (positionOffset) translation = `translate(${`${typeof positionOffset.x === "string" ? positionOffset.x : positionOffset.x + unitSuffix}`}, ${`${typeof positionOffset.y === "string" ? positionOffset.y : positionOffset.y + unitSuffix}`})` + translation; | |
| 2191 | - return translation; | |
| 2192 | - } | |
| 2193 | - function getTouch(e, identifier) { | |
| 2194 | - return e.targetTouches && (0, _shims.findInArray)(e.targetTouches, (t) => identifier === t.identifier) || e.changedTouches && (0, _shims.findInArray)(e.changedTouches, (t) => identifier === t.identifier); | |
| 2195 | - } | |
| 2196 | - function getTouchIdentifier(e) { | |
| 2197 | - if (e.targetTouches && e.targetTouches[0]) return e.targetTouches[0].identifier; | |
| 2198 | - if (e.changedTouches && e.changedTouches[0]) return e.changedTouches[0].identifier; | |
| 2199 | - } | |
| 2200 | - function addUserSelectStyles(doc) { | |
| 2201 | - if (!doc) return; | |
| 2202 | - let styleEl = doc.getElementById("react-draggable-style-el"); | |
| 2203 | - if (!styleEl) { | |
| 2204 | - styleEl = doc.createElement("style"); | |
| 2205 | - styleEl.type = "text/css"; | |
| 2206 | - styleEl.id = "react-draggable-style-el"; | |
| 2207 | - styleEl.innerHTML = ".react-draggable-transparent-selection *::-moz-selection {all: inherit;}\n"; | |
| 2208 | - styleEl.innerHTML += ".react-draggable-transparent-selection *::selection {all: inherit;}\n"; | |
| 2209 | - doc.getElementsByTagName("head")[0].appendChild(styleEl); | |
| 2210 | - } | |
| 2211 | - if (doc.body) addClassName(doc.body, "react-draggable-transparent-selection"); | |
| 2212 | - } | |
| 2213 | - function scheduleRemoveUserSelectStyles(doc) { | |
| 2214 | - if (window.requestAnimationFrame) window.requestAnimationFrame(() => { | |
| 2215 | - removeUserSelectStyles(doc); | |
| 2216 | - }); | |
| 2217 | - else removeUserSelectStyles(doc); | |
| 2218 | - } | |
| 2219 | - function removeUserSelectStyles(doc) { | |
| 2220 | - if (!doc) return; | |
| 2221 | - try { | |
| 2222 | - if (doc.body) removeClassName(doc.body, "react-draggable-transparent-selection"); | |
| 2223 | - if (doc.selection) doc.selection.empty(); | |
| 2224 | - else { | |
| 2225 | - const selection = (doc.defaultView || window).getSelection(); | |
| 2226 | - if (selection && selection.type !== "Caret") selection.removeAllRanges(); | |
| 2227 | - } | |
| 2228 | - } catch (e) {} | |
| 2229 | - } | |
| 2230 | - function addClassName(el, className) { | |
| 2231 | - if (el.classList) el.classList.add(className); | |
| 2232 | - else if (!el.className.match(new RegExp(`(?:^|\\s)${className}(?!\\S)`))) el.className += ` ${className}`; | |
| 2233 | - } | |
| 2234 | - function removeClassName(el, className) { | |
| 2235 | - if (el.classList) el.classList.remove(className); | |
| 2236 | - else el.className = el.className.replace(new RegExp(`(?:^|\\s)${className}(?!\\S)`, "g"), ""); | |
| 2237 | - } | |
| 2238 | - })); | |
| 5104 | + if (secret !== ReactPropTypesSecret) { | |
| 5105 | + if (throwOnDirectAccess) { | |
| 5106 | + // New behavior only for users of `prop-types` package | |
| 5107 | + var err = new Error( | |
| 5108 | + 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' + | |
| 5109 | + 'Use `PropTypes.checkPropTypes()` to call them. ' + | |
| 5110 | + 'Read more at http://fb.me/use-check-prop-types' | |
| 5111 | + ); | |
| 5112 | + err.name = 'Invariant Violation'; | |
| 5113 | + throw err; | |
| 5114 | + } else if ( true && typeof console !== 'undefined') { | |
| 5115 | + // Old behavior for people using React.PropTypes | |
| 5116 | + var cacheKey = componentName + ':' + propName; | |
| 5117 | + if ( | |
| 5118 | + !manualPropTypeCallCache[cacheKey] && | |
| 5119 | + // Avoid spamming the console because they are often not actionable except for lib authors | |
| 5120 | + manualPropTypeWarningCount < 3 | |
| 5121 | + ) { | |
| 5122 | + printWarning( | |
| 5123 | + 'You are manually calling a React.PropTypes validation ' + | |
| 5124 | + 'function for the `' + propFullName + '` prop on `' + componentName + '`. This is deprecated ' + | |
| 5125 | + 'and will throw in the standalone `prop-types` package. ' + | |
| 5126 | + 'You may be seeing this warning due to a third-party PropTypes ' + | |
| 5127 | + 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.' | |
| 5128 | + ); | |
| 5129 | + manualPropTypeCallCache[cacheKey] = true; | |
| 5130 | + manualPropTypeWarningCount++; | |
| 5131 | + } | |
| 5132 | + } | |
| 5133 | + } | |
| 5134 | + if (props[propName] == null) { | |
| 5135 | + if (isRequired) { | |
| 5136 | + if (props[propName] === null) { | |
| 5137 | + return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.')); | |
| 5138 | + } | |
| 5139 | + return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.')); | |
| 5140 | + } | |
| 5141 | + return null; | |
| 5142 | + } else { | |
| 5143 | + return validate(props, propName, componentName, location, propFullName); | |
| 5144 | + } | |
| 5145 | + } | |
| 2239 | 5146 | |
| 2240 | -//#endregion | |
| 2241 | -//#region node_modules/react-draggable/build/cjs/utils/positionFns.js | |
| 2242 | - var require_positionFns = /* @__PURE__ */ __commonJSMin(((exports) => { | |
| 2243 | - Object.defineProperty(exports, "__esModule", { value: true }); | |
| 2244 | - exports.canDragX = canDragX; | |
| 2245 | - exports.canDragY = canDragY; | |
| 2246 | - exports.createCoreData = createCoreData; | |
| 2247 | - exports.createDraggableData = createDraggableData; | |
| 2248 | - exports.getBoundPosition = getBoundPosition; | |
| 2249 | - exports.getControlPosition = getControlPosition; | |
| 2250 | - exports.snapToGrid = snapToGrid; | |
| 2251 | - var _shims = require_shims(); | |
| 2252 | - var _domFns = require_domFns(); | |
| 2253 | - function getBoundPosition(draggable, x, y) { | |
| 2254 | - if (!draggable.props.bounds) return [x, y]; | |
| 2255 | - let { bounds } = draggable.props; | |
| 2256 | - bounds = typeof bounds === "string" ? bounds : cloneBounds(bounds); | |
| 2257 | - const node = findDOMNode(draggable); | |
| 2258 | - if (typeof bounds === "string") { | |
| 2259 | - const { ownerDocument } = node; | |
| 2260 | - const ownerWindow = ownerDocument.defaultView; | |
| 2261 | - let boundNode; | |
| 2262 | - if (bounds === "parent") boundNode = node.parentNode; | |
| 2263 | - else boundNode = node.getRootNode().querySelector(bounds); | |
| 2264 | - if (!(boundNode instanceof ownerWindow.HTMLElement)) throw new Error("Bounds selector \"" + bounds + "\" could not find an element."); | |
| 2265 | - const boundNodeEl = boundNode; | |
| 2266 | - const nodeStyle = ownerWindow.getComputedStyle(node); | |
| 2267 | - const boundNodeStyle = ownerWindow.getComputedStyle(boundNodeEl); | |
| 2268 | - bounds = { | |
| 2269 | - left: -node.offsetLeft + (0, _shims.int)(boundNodeStyle.paddingLeft) + (0, _shims.int)(nodeStyle.marginLeft), | |
| 2270 | - top: -node.offsetTop + (0, _shims.int)(boundNodeStyle.paddingTop) + (0, _shims.int)(nodeStyle.marginTop), | |
| 2271 | - right: (0, _domFns.innerWidth)(boundNodeEl) - (0, _domFns.outerWidth)(node) - node.offsetLeft + (0, _shims.int)(boundNodeStyle.paddingRight) - (0, _shims.int)(nodeStyle.marginRight), | |
| 2272 | - bottom: (0, _domFns.innerHeight)(boundNodeEl) - (0, _domFns.outerHeight)(node) - node.offsetTop + (0, _shims.int)(boundNodeStyle.paddingBottom) - (0, _shims.int)(nodeStyle.marginBottom) | |
| 2273 | - }; | |
| 2274 | - } | |
| 2275 | - if ((0, _shims.isNum)(bounds.right)) x = Math.min(x, bounds.right); | |
| 2276 | - if ((0, _shims.isNum)(bounds.bottom)) y = Math.min(y, bounds.bottom); | |
| 2277 | - if ((0, _shims.isNum)(bounds.left)) x = Math.max(x, bounds.left); | |
| 2278 | - if ((0, _shims.isNum)(bounds.top)) y = Math.max(y, bounds.top); | |
| 2279 | - return [x, y]; | |
| 2280 | - } | |
| 2281 | - function snapToGrid(grid, pendingX, pendingY) { | |
| 2282 | - return [Math.round(pendingX / grid[0]) * grid[0], Math.round(pendingY / grid[1]) * grid[1]]; | |
| 2283 | - } | |
| 2284 | - function canDragX(draggable) { | |
| 2285 | - return draggable.props.axis === "both" || draggable.props.axis === "x"; | |
| 2286 | - } | |
| 2287 | - function canDragY(draggable) { | |
| 2288 | - return draggable.props.axis === "both" || draggable.props.axis === "y"; | |
| 2289 | - } | |
| 2290 | - function getControlPosition(e, touchIdentifier, draggableCore) { | |
| 2291 | - const touchObj = typeof touchIdentifier === "number" ? (0, _domFns.getTouch)(e, touchIdentifier) : null; | |
| 2292 | - if (typeof touchIdentifier === "number" && !touchObj) return null; | |
| 2293 | - const node = findDOMNode(draggableCore); | |
| 2294 | - const offsetParent = draggableCore.props.offsetParent || node.offsetParent || node.ownerDocument.body; | |
| 2295 | - return (0, _domFns.offsetXYFromParent)(touchObj || e, offsetParent, draggableCore.props.scale); | |
| 2296 | - } | |
| 2297 | - function createCoreData(draggable, x, y) { | |
| 2298 | - const isStart = !(0, _shims.isNum)(draggable.lastX); | |
| 2299 | - const node = findDOMNode(draggable); | |
| 2300 | - if (isStart) return { | |
| 2301 | - node, | |
| 2302 | - deltaX: 0, | |
| 2303 | - deltaY: 0, | |
| 2304 | - lastX: x, | |
| 2305 | - lastY: y, | |
| 2306 | - x, | |
| 2307 | - y | |
| 2308 | - }; | |
| 2309 | - else return { | |
| 2310 | - node, | |
| 2311 | - deltaX: x - draggable.lastX, | |
| 2312 | - deltaY: y - draggable.lastY, | |
| 2313 | - lastX: draggable.lastX, | |
| 2314 | - lastY: draggable.lastY, | |
| 2315 | - x, | |
| 2316 | - y | |
| 2317 | - }; | |
| 2318 | - } | |
| 2319 | - function createDraggableData(draggable, coreData) { | |
| 2320 | - const scale = draggable.props.scale; | |
| 2321 | - return { | |
| 2322 | - node: coreData.node, | |
| 2323 | - x: draggable.state.x + coreData.deltaX / scale, | |
| 2324 | - y: draggable.state.y + coreData.deltaY / scale, | |
| 2325 | - deltaX: coreData.deltaX / scale, | |
| 2326 | - deltaY: coreData.deltaY / scale, | |
| 2327 | - lastX: draggable.state.x, | |
| 2328 | - lastY: draggable.state.y | |
| 2329 | - }; | |
| 2330 | - } | |
| 2331 | - function cloneBounds(bounds) { | |
| 2332 | - return { | |
| 2333 | - left: bounds.left, | |
| 2334 | - top: bounds.top, | |
| 2335 | - right: bounds.right, | |
| 2336 | - bottom: bounds.bottom | |
| 2337 | - }; | |
| 2338 | - } | |
| 2339 | - function findDOMNode(draggable) { | |
| 2340 | - const node = draggable.findDOMNode(); | |
| 2341 | - if (!node) throw new Error("<DraggableCore>: Unmounted during event!"); | |
| 2342 | - return node; | |
| 2343 | - } | |
| 2344 | - })); | |
| 5147 | + var chainedCheckType = checkType.bind(null, false); | |
| 5148 | + chainedCheckType.isRequired = checkType.bind(null, true); | |
| 2345 | 5149 | |
| 2346 | -//#endregion | |
| 2347 | -//#region node_modules/react-draggable/build/cjs/utils/log.js | |
| 2348 | - var require_log = /* @__PURE__ */ __commonJSMin(((exports) => { | |
| 2349 | - Object.defineProperty(exports, "__esModule", { value: true }); | |
| 2350 | - exports.default = log; | |
| 2351 | - function log() {} | |
| 2352 | - })); | |
| 5150 | + return chainedCheckType; | |
| 5151 | + } | |
| 2353 | 5152 | |
| 2354 | -//#endregion | |
| 2355 | -//#region node_modules/react-draggable/build/cjs/DraggableCore.js | |
| 2356 | - var require_DraggableCore = /* @__PURE__ */ __commonJSMin(((exports) => { | |
| 2357 | - Object.defineProperty(exports, "__esModule", { value: true }); | |
| 2358 | - exports.default = void 0; | |
| 2359 | - var React$47 = _interopRequireWildcard((globalThis.React)); | |
| 2360 | - var _propTypes = _interopRequireDefault(require_prop_types()); | |
| 2361 | - var _reactDom$1 = _interopRequireDefault((globalThis.ReactDOM)); | |
| 2362 | - var _domFns = require_domFns(); | |
| 2363 | - var _positionFns = require_positionFns(); | |
| 2364 | - var _shims = require_shims(); | |
| 2365 | - var _log = _interopRequireDefault(require_log()); | |
| 2366 | - function _interopRequireDefault(e) { | |
| 2367 | - return e && e.__esModule ? e : { default: e }; | |
| 2368 | - } | |
| 2369 | - function _interopRequireWildcard(e, t) { | |
| 2370 | - if ("function" == typeof WeakMap) { | |
| 2371 | - var r = /* @__PURE__ */ new WeakMap(); | |
| 2372 | - var n = /* @__PURE__ */ new WeakMap(); | |
| 2373 | - } | |
| 2374 | - return (_interopRequireWildcard = function(e, t) { | |
| 2375 | - if (!t && e && e.__esModule) return e; | |
| 2376 | - var o; | |
| 2377 | - var i; | |
| 2378 | - var f = { | |
| 2379 | - __proto__: null, | |
| 2380 | - default: e | |
| 2381 | - }; | |
| 2382 | - if (null === e || "object" != typeof e && "function" != typeof e) return f; | |
| 2383 | - if (o = t ? n : r) { | |
| 2384 | - if (o.has(e)) return o.get(e); | |
| 2385 | - o.set(e, f); | |
| 2386 | - } | |
| 2387 | - for (const 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]); | |
| 2388 | - return f; | |
| 2389 | - })(e, t); | |
| 2390 | - } | |
| 2391 | - function _defineProperty(e, r, t) { | |
| 2392 | - return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { | |
| 2393 | - value: t, | |
| 2394 | - enumerable: !0, | |
| 2395 | - configurable: !0, | |
| 2396 | - writable: !0 | |
| 2397 | - }) : e[r] = t, e; | |
| 2398 | - } | |
| 2399 | - function _toPropertyKey(t) { | |
| 2400 | - var i = _toPrimitive(t, "string"); | |
| 2401 | - return "symbol" == typeof i ? i : i + ""; | |
| 2402 | - } | |
| 2403 | - function _toPrimitive(t, r) { | |
| 2404 | - if ("object" != typeof t || !t) return t; | |
| 2405 | - var e = t[Symbol.toPrimitive]; | |
| 2406 | - if (void 0 !== e) { | |
| 2407 | - var i = e.call(t, r || "default"); | |
| 2408 | - if ("object" != typeof i) return i; | |
| 2409 | - throw new TypeError("@@toPrimitive must return a primitive value."); | |
| 2410 | - } | |
| 2411 | - return ("string" === r ? String : Number)(t); | |
| 2412 | - } | |
| 2413 | - var eventsFor = { | |
| 2414 | - touch: { | |
| 2415 | - start: "touchstart", | |
| 2416 | - move: "touchmove", | |
| 2417 | - stop: "touchend" | |
| 2418 | - }, | |
| 2419 | - mouse: { | |
| 2420 | - start: "mousedown", | |
| 2421 | - move: "mousemove", | |
| 2422 | - stop: "mouseup" | |
| 2423 | - } | |
| 2424 | - }; | |
| 2425 | - var dragEventFor = eventsFor.mouse; | |
| 2426 | - var DraggableCore = class extends React$47.Component { | |
| 2427 | - constructor() { | |
| 2428 | - super(...arguments); | |
| 2429 | - _defineProperty(this, "dragging", false); | |
| 2430 | - _defineProperty(this, "lastX", NaN); | |
| 2431 | - _defineProperty(this, "lastY", NaN); | |
| 2432 | - _defineProperty(this, "touchIdentifier", null); | |
| 2433 | - _defineProperty(this, "mounted", false); | |
| 2434 | - _defineProperty(this, "handleDragStart", (e) => { | |
| 2435 | - this.props.onMouseDown(e); | |
| 2436 | - if (!this.props.allowAnyClick && typeof e.button === "number" && e.button !== 0) return false; | |
| 2437 | - const thisNode = this.findDOMNode(); | |
| 2438 | - if (!thisNode || !thisNode.ownerDocument || !thisNode.ownerDocument.body) throw new Error("<DraggableCore> not mounted on DragStart!"); | |
| 2439 | - const { ownerDocument } = thisNode; | |
| 2440 | - if (this.props.disabled || !(e.target instanceof ownerDocument.defaultView.Node) || this.props.handle && !(0, _domFns.matchesSelectorAndParentsTo)(e.target, this.props.handle, thisNode) || this.props.cancel && (0, _domFns.matchesSelectorAndParentsTo)(e.target, this.props.cancel, thisNode)) return; | |
| 2441 | - if (e.type === "touchstart" && !this.props.allowMobileScroll) e.preventDefault(); | |
| 2442 | - const touchIdentifier = (0, _domFns.getTouchIdentifier)(e); | |
| 2443 | - this.touchIdentifier = touchIdentifier; | |
| 2444 | - const position = (0, _positionFns.getControlPosition)(e, touchIdentifier, this); | |
| 2445 | - if (position == null) return; | |
| 2446 | - const { x, y } = position; | |
| 2447 | - const coreEvent = (0, _positionFns.createCoreData)(this, x, y); | |
| 2448 | - (0, _log.default)("DraggableCore: handleDragStart: %j", coreEvent); | |
| 2449 | - (0, _log.default)("calling", this.props.onStart); | |
| 2450 | - if (this.props.onStart(e, coreEvent) === false || this.mounted === false) return; | |
| 2451 | - if (this.props.enableUserSelectHack) (0, _domFns.addUserSelectStyles)(ownerDocument); | |
| 2452 | - this.dragging = true; | |
| 2453 | - this.lastX = x; | |
| 2454 | - this.lastY = y; | |
| 2455 | - (0, _domFns.addEvent)(ownerDocument, dragEventFor.move, this.handleDrag); | |
| 2456 | - (0, _domFns.addEvent)(ownerDocument, dragEventFor.stop, this.handleDragStop); | |
| 2457 | - }); | |
| 2458 | - _defineProperty(this, "handleDrag", (e) => { | |
| 2459 | - const position = (0, _positionFns.getControlPosition)(e, this.touchIdentifier, this); | |
| 2460 | - if (position == null) return; | |
| 2461 | - let { x, y } = position; | |
| 2462 | - if (Array.isArray(this.props.grid)) { | |
| 2463 | - let deltaX = x - this.lastX; | |
| 2464 | - let deltaY = y - this.lastY; | |
| 2465 | - [deltaX, deltaY] = (0, _positionFns.snapToGrid)(this.props.grid, deltaX, deltaY); | |
| 2466 | - if (!deltaX && !deltaY) return; | |
| 2467 | - x = this.lastX + deltaX, y = this.lastY + deltaY; | |
| 2468 | - } | |
| 2469 | - const coreEvent = (0, _positionFns.createCoreData)(this, x, y); | |
| 2470 | - (0, _log.default)("DraggableCore: handleDrag: %j", coreEvent); | |
| 2471 | - if (this.props.onDrag(e, coreEvent) === false || this.mounted === false) { | |
| 2472 | - try { | |
| 2473 | - this.handleDragStop(new MouseEvent("mouseup")); | |
| 2474 | - } catch (err) { | |
| 2475 | - const event = document.createEvent("MouseEvents"); | |
| 2476 | - event.initMouseEvent("mouseup", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null); | |
| 2477 | - this.handleDragStop(event); | |
| 2478 | - } | |
| 2479 | - return; | |
| 2480 | - } | |
| 2481 | - this.lastX = x; | |
| 2482 | - this.lastY = y; | |
| 2483 | - }); | |
| 2484 | - _defineProperty(this, "handleDragStop", (e) => { | |
| 2485 | - if (!this.dragging) return; | |
| 2486 | - const position = (0, _positionFns.getControlPosition)(e, this.touchIdentifier, this); | |
| 2487 | - if (position == null) return; | |
| 2488 | - let { x, y } = position; | |
| 2489 | - if (Array.isArray(this.props.grid)) { | |
| 2490 | - let deltaX = x - this.lastX || 0; | |
| 2491 | - let deltaY = y - this.lastY || 0; | |
| 2492 | - [deltaX, deltaY] = (0, _positionFns.snapToGrid)(this.props.grid, deltaX, deltaY); | |
| 2493 | - x = this.lastX + deltaX, y = this.lastY + deltaY; | |
| 2494 | - } | |
| 2495 | - const coreEvent = (0, _positionFns.createCoreData)(this, x, y); | |
| 2496 | - if (this.props.onStop(e, coreEvent) === false || this.mounted === false) return false; | |
| 2497 | - const thisNode = this.findDOMNode(); | |
| 2498 | - if (thisNode) { | |
| 2499 | - if (this.props.enableUserSelectHack) (0, _domFns.scheduleRemoveUserSelectStyles)(thisNode.ownerDocument); | |
| 2500 | - } | |
| 2501 | - (0, _log.default)("DraggableCore: handleDragStop: %j", coreEvent); | |
| 2502 | - this.dragging = false; | |
| 2503 | - this.lastX = NaN; | |
| 2504 | - this.lastY = NaN; | |
| 2505 | - if (thisNode) { | |
| 2506 | - (0, _log.default)("DraggableCore: Removing handlers"); | |
| 2507 | - (0, _domFns.removeEvent)(thisNode.ownerDocument, dragEventFor.move, this.handleDrag); | |
| 2508 | - (0, _domFns.removeEvent)(thisNode.ownerDocument, dragEventFor.stop, this.handleDragStop); | |
| 2509 | - } | |
| 2510 | - }); | |
| 2511 | - _defineProperty(this, "onMouseDown", (e) => { | |
| 2512 | - dragEventFor = eventsFor.mouse; | |
| 2513 | - return this.handleDragStart(e); | |
| 2514 | - }); | |
| 2515 | - _defineProperty(this, "onMouseUp", (e) => { | |
| 2516 | - dragEventFor = eventsFor.mouse; | |
| 2517 | - return this.handleDragStop(e); | |
| 2518 | - }); | |
| 2519 | - _defineProperty(this, "onTouchStart", (e) => { | |
| 2520 | - dragEventFor = eventsFor.touch; | |
| 2521 | - return this.handleDragStart(e); | |
| 2522 | - }); | |
| 2523 | - _defineProperty(this, "onTouchEnd", (e) => { | |
| 2524 | - dragEventFor = eventsFor.touch; | |
| 2525 | - return this.handleDragStop(e); | |
| 2526 | - }); | |
| 2527 | - } | |
| 2528 | - componentDidMount() { | |
| 2529 | - this.mounted = true; | |
| 2530 | - const thisNode = this.findDOMNode(); | |
| 2531 | - if (thisNode) (0, _domFns.addEvent)(thisNode, eventsFor.touch.start, this.onTouchStart, { passive: false }); | |
| 2532 | - } | |
| 2533 | - componentWillUnmount() { | |
| 2534 | - this.mounted = false; | |
| 2535 | - const thisNode = this.findDOMNode(); | |
| 2536 | - if (thisNode) { | |
| 2537 | - const { ownerDocument } = thisNode; | |
| 2538 | - (0, _domFns.removeEvent)(ownerDocument, eventsFor.mouse.move, this.handleDrag); | |
| 2539 | - (0, _domFns.removeEvent)(ownerDocument, eventsFor.touch.move, this.handleDrag); | |
| 2540 | - (0, _domFns.removeEvent)(ownerDocument, eventsFor.mouse.stop, this.handleDragStop); | |
| 2541 | - (0, _domFns.removeEvent)(ownerDocument, eventsFor.touch.stop, this.handleDragStop); | |
| 2542 | - (0, _domFns.removeEvent)(thisNode, eventsFor.touch.start, this.onTouchStart, { passive: false }); | |
| 2543 | - if (this.props.enableUserSelectHack) (0, _domFns.scheduleRemoveUserSelectStyles)(ownerDocument); | |
| 2544 | - } | |
| 2545 | - } | |
| 2546 | - findDOMNode() { | |
| 2547 | - var _this$props; | |
| 2548 | - var _this$props2; | |
| 2549 | - return ((_this$props = this.props) === null || _this$props === void 0 ? void 0 : _this$props.nodeRef) ? (_this$props2 = this.props) === null || _this$props2 === void 0 || (_this$props2 = _this$props2.nodeRef) === null || _this$props2 === void 0 ? void 0 : _this$props2.current : _reactDom$1.default.findDOMNode(this); | |
| 2550 | - } | |
| 2551 | - render() { | |
| 2552 | - return /*#__PURE__*/ React$47.cloneElement(React$47.Children.only(this.props.children), { | |
| 2553 | - onMouseDown: this.onMouseDown, | |
| 2554 | - onMouseUp: this.onMouseUp, | |
| 2555 | - onTouchEnd: this.onTouchEnd | |
| 2556 | - }); | |
| 2557 | - } | |
| 2558 | - }; | |
| 2559 | - exports.default = DraggableCore; | |
| 2560 | - _defineProperty(DraggableCore, "displayName", "DraggableCore"); | |
| 2561 | - _defineProperty(DraggableCore, "propTypes", { | |
| 2562 | - /** | |
| 2563 | - * `allowAnyClick` allows dragging using any mouse button. | |
| 2564 | - * By default, we only accept the left button. | |
| 2565 | - * | |
| 2566 | - * Defaults to `false`. | |
| 2567 | - */ | |
| 2568 | - allowAnyClick: _propTypes.default.bool, | |
| 2569 | - /** | |
| 2570 | - * `allowMobileScroll` turns off cancellation of the 'touchstart' event | |
| 2571 | - * on mobile devices. Only enable this if you are having trouble with click | |
| 2572 | - * events. Prefer using 'handle' / 'cancel' instead. | |
| 2573 | - * | |
| 2574 | - * Defaults to `false`. | |
| 2575 | - */ | |
| 2576 | - allowMobileScroll: _propTypes.default.bool, | |
| 2577 | - children: _propTypes.default.node.isRequired, | |
| 2578 | - /** | |
| 2579 | - * `disabled`, if true, stops the <Draggable> from dragging. All handlers, | |
| 2580 | - * with the exception of `onMouseDown`, will not fire. | |
| 2581 | - */ | |
| 2582 | - disabled: _propTypes.default.bool, | |
| 2583 | - /** | |
| 2584 | - * By default, we add 'user-select:none' attributes to the document body | |
| 2585 | - * to prevent ugly text selection during drag. If this is causing problems | |
| 2586 | - * for your app, set this to `false`. | |
| 2587 | - */ | |
| 2588 | - enableUserSelectHack: _propTypes.default.bool, | |
| 2589 | - /** | |
| 2590 | - * `offsetParent`, if set, uses the passed DOM node to compute drag offsets | |
| 2591 | - * instead of using the parent node. | |
| 2592 | - */ | |
| 2593 | - offsetParent: function(props, propName) { | |
| 2594 | - if (props[propName] && props[propName].nodeType !== 1) throw new Error("Draggable's offsetParent must be a DOM Node."); | |
| 2595 | - }, | |
| 2596 | - /** | |
| 2597 | - * `grid` specifies the x and y that dragging should snap to. | |
| 2598 | - */ | |
| 2599 | - grid: _propTypes.default.arrayOf(_propTypes.default.number), | |
| 2600 | - /** | |
| 2601 | - * `handle` specifies a selector to be used as the handle that initiates drag. | |
| 2602 | - * | |
| 2603 | - * Example: | |
| 2604 | - * | |
| 2605 | - * ```jsx | |
| 2606 | - * let App = React.createClass({ | |
| 2607 | - * render: function () { | |
| 2608 | - * return ( | |
| 2609 | - * <Draggable handle=".handle"> | |
| 2610 | - * <div> | |
| 2611 | - * <div className="handle">Click me to drag</div> | |
| 2612 | - * <div>This is some other content</div> | |
| 2613 | - * </div> | |
| 2614 | - * </Draggable> | |
| 2615 | - * ); | |
| 2616 | - * } | |
| 2617 | - * }); | |
| 2618 | - * ``` | |
| 2619 | - */ | |
| 2620 | - handle: _propTypes.default.string, | |
| 2621 | - /** | |
| 2622 | - * `cancel` specifies a selector to be used to prevent drag initialization. | |
| 2623 | - * | |
| 2624 | - * Example: | |
| 2625 | - * | |
| 2626 | - * ```jsx | |
| 2627 | - * let App = React.createClass({ | |
| 2628 | - * render: function () { | |
| 2629 | - * return( | |
| 2630 | - * <Draggable cancel=".cancel"> | |
| 2631 | - * <div> | |
| 2632 | - * <div className="cancel">You can't drag from here</div> | |
| 2633 | - * <div>Dragging here works fine</div> | |
| 2634 | - * </div> | |
| 2635 | - * </Draggable> | |
| 2636 | - * ); | |
| 2637 | - * } | |
| 2638 | - * }); | |
| 2639 | - * ``` | |
| 2640 | - */ | |
| 2641 | - cancel: _propTypes.default.string, | |
| 2642 | - nodeRef: _propTypes.default.object, | |
| 2643 | - /** | |
| 2644 | - * Called when dragging starts. | |
| 2645 | - * If this function returns the boolean false, dragging will be canceled. | |
| 2646 | - */ | |
| 2647 | - onStart: _propTypes.default.func, | |
| 2648 | - /** | |
| 2649 | - * Called while dragging. | |
| 2650 | - * If this function returns the boolean false, dragging will be canceled. | |
| 2651 | - */ | |
| 2652 | - onDrag: _propTypes.default.func, | |
| 2653 | - /** | |
| 2654 | - * Called when dragging stops. | |
| 2655 | - * If this function returns the boolean false, the drag will remain active. | |
| 2656 | - */ | |
| 2657 | - onStop: _propTypes.default.func, | |
| 2658 | - /** | |
| 2659 | - * A workaround option which can be passed if onMouseDown needs to be accessed, | |
| 2660 | - * since it'll always be blocked (as there is internal use of onMouseDown) | |
| 2661 | - */ | |
| 2662 | - onMouseDown: _propTypes.default.func, | |
| 2663 | - /** | |
| 2664 | - * `scale`, if set, applies scaling while dragging an element | |
| 2665 | - */ | |
| 2666 | - scale: _propTypes.default.number, | |
| 2667 | - /** | |
| 2668 | - * These properties should be defined on the child, not here. | |
| 2669 | - */ | |
| 2670 | - className: _shims.dontSetMe, | |
| 2671 | - style: _shims.dontSetMe, | |
| 2672 | - transform: _shims.dontSetMe | |
| 2673 | - }); | |
| 2674 | - _defineProperty(DraggableCore, "defaultProps", { | |
| 2675 | - allowAnyClick: false, | |
| 2676 | - allowMobileScroll: false, | |
| 2677 | - disabled: false, | |
| 2678 | - enableUserSelectHack: true, | |
| 2679 | - onStart: function() {}, | |
| 2680 | - onDrag: function() {}, | |
| 2681 | - onStop: function() {}, | |
| 2682 | - onMouseDown: function() {}, | |
| 2683 | - scale: 1 | |
| 2684 | - }); | |
| 2685 | - })); | |
| 5153 | + function createPrimitiveTypeChecker(expectedType) { | |
| 5154 | + function validate(props, propName, componentName, location, propFullName, secret) { | |
| 5155 | + var propValue = props[propName]; | |
| 5156 | + var propType = getPropType(propValue); | |
| 5157 | + if (propType !== expectedType) { | |
| 5158 | + // `propValue` being instance of, say, date/regexp, pass the 'object' | |
| 5159 | + // check, but we can offer a more precise error message here rather than | |
| 5160 | + // 'of type `object`'. | |
| 5161 | + var preciseType = getPreciseType(propValue); | |
| 2686 | 5162 | |
| 2687 | -//#endregion | |
| 2688 | -//#region node_modules/react-draggable/build/cjs/Draggable.js | |
| 2689 | - var require_Draggable = /* @__PURE__ */ __commonJSMin(((exports) => { | |
| 2690 | - init_objectSpread2(); | |
| 2691 | - init_objectWithoutProperties(); | |
| 2692 | - var _excluded = [ | |
| 2693 | - "axis", | |
| 2694 | - "bounds", | |
| 2695 | - "children", | |
| 2696 | - "defaultPosition", | |
| 2697 | - "defaultClassName", | |
| 2698 | - "defaultClassNameDragging", | |
| 2699 | - "defaultClassNameDragged", | |
| 2700 | - "position", | |
| 2701 | - "positionOffset", | |
| 2702 | - "scale" | |
| 2703 | - ]; | |
| 2704 | - Object.defineProperty(exports, "__esModule", { value: true }); | |
| 2705 | - Object.defineProperty(exports, "DraggableCore", { | |
| 2706 | - enumerable: true, | |
| 2707 | - get: function() { | |
| 2708 | - return _DraggableCore.default; | |
| 2709 | - } | |
| 2710 | - }); | |
| 2711 | - exports.default = void 0; | |
| 2712 | - var React$46 = _interopRequireWildcard((globalThis.React)); | |
| 2713 | - var _propTypes = _interopRequireDefault(require_prop_types()); | |
| 2714 | - var _reactDom = _interopRequireDefault((globalThis.ReactDOM)); | |
| 2715 | - var _clsx = require_clsx(); | |
| 2716 | - var _domFns = require_domFns(); | |
| 2717 | - var _positionFns = require_positionFns(); | |
| 2718 | - var _shims = require_shims(); | |
| 2719 | - var _DraggableCore = _interopRequireDefault(require_DraggableCore()); | |
| 2720 | - var _log = _interopRequireDefault(require_log()); | |
| 2721 | - function _interopRequireDefault(e) { | |
| 2722 | - return e && e.__esModule ? e : { default: e }; | |
| 2723 | - } | |
| 2724 | - function _interopRequireWildcard(e, t) { | |
| 2725 | - if ("function" == typeof WeakMap) { | |
| 2726 | - var r = /* @__PURE__ */ new WeakMap(); | |
| 2727 | - var n = /* @__PURE__ */ new WeakMap(); | |
| 2728 | - } | |
| 2729 | - return (_interopRequireWildcard = function(e, t) { | |
| 2730 | - if (!t && e && e.__esModule) return e; | |
| 2731 | - var o; | |
| 2732 | - var i; | |
| 2733 | - var f = { | |
| 2734 | - __proto__: null, | |
| 2735 | - default: e | |
| 2736 | - }; | |
| 2737 | - if (null === e || "object" != typeof e && "function" != typeof e) return f; | |
| 2738 | - if (o = t ? n : r) { | |
| 2739 | - if (o.has(e)) return o.get(e); | |
| 2740 | - o.set(e, f); | |
| 2741 | - } | |
| 2742 | - for (const 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]); | |
| 2743 | - return f; | |
| 2744 | - })(e, t); | |
| 2745 | - } | |
| 2746 | - function _extends() { | |
| 2747 | - return _extends = Object.assign ? Object.assign.bind() : function(n) { | |
| 2748 | - for (var e = 1; e < arguments.length; e++) { | |
| 2749 | - var t = arguments[e]; | |
| 2750 | - for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); | |
| 2751 | - } | |
| 2752 | - return n; | |
| 2753 | - }, _extends.apply(null, arguments); | |
| 2754 | - } | |
| 2755 | - function _defineProperty(e, r, t) { | |
| 2756 | - return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { | |
| 2757 | - value: t, | |
| 2758 | - enumerable: !0, | |
| 2759 | - configurable: !0, | |
| 2760 | - writable: !0 | |
| 2761 | - }) : e[r] = t, e; | |
| 2762 | - } | |
| 2763 | - function _toPropertyKey(t) { | |
| 2764 | - var i = _toPrimitive(t, "string"); | |
| 2765 | - return "symbol" == typeof i ? i : i + ""; | |
| 2766 | - } | |
| 2767 | - function _toPrimitive(t, r) { | |
| 2768 | - if ("object" != typeof t || !t) return t; | |
| 2769 | - var e = t[Symbol.toPrimitive]; | |
| 2770 | - if (void 0 !== e) { | |
| 2771 | - var i = e.call(t, r || "default"); | |
| 2772 | - if ("object" != typeof i) return i; | |
| 2773 | - throw new TypeError("@@toPrimitive must return a primitive value."); | |
| 2774 | - } | |
| 2775 | - return ("string" === r ? String : Number)(t); | |
| 2776 | - } | |
| 2777 | - var Draggable = class extends React$46.Component { | |
| 2778 | - static getDerivedStateFromProps(_ref, _ref2) { | |
| 2779 | - let { position } = _ref; | |
| 2780 | - let { prevPropsPosition } = _ref2; | |
| 2781 | - if (position && (!prevPropsPosition || position.x !== prevPropsPosition.x || position.y !== prevPropsPosition.y)) { | |
| 2782 | - (0, _log.default)("Draggable: getDerivedStateFromProps %j", { | |
| 2783 | - position, | |
| 2784 | - prevPropsPosition | |
| 2785 | - }); | |
| 2786 | - return { | |
| 2787 | - x: position.x, | |
| 2788 | - y: position.y, | |
| 2789 | - prevPropsPosition: _objectSpread2({}, position) | |
| 2790 | - }; | |
| 2791 | - } | |
| 2792 | - return null; | |
| 2793 | - } | |
| 2794 | - constructor(props) { | |
| 2795 | - super(props); | |
| 2796 | - _defineProperty(this, "onDragStart", (e, coreData) => { | |
| 2797 | - (0, _log.default)("Draggable: onDragStart: %j", coreData); | |
| 2798 | - if (this.props.onStart(e, (0, _positionFns.createDraggableData)(this, coreData)) === false) return false; | |
| 2799 | - this.setState({ | |
| 2800 | - dragging: true, | |
| 2801 | - dragged: true | |
| 2802 | - }); | |
| 2803 | - }); | |
| 2804 | - _defineProperty(this, "onDrag", (e, coreData) => { | |
| 2805 | - if (!this.state.dragging) return false; | |
| 2806 | - (0, _log.default)("Draggable: onDrag: %j", coreData); | |
| 2807 | - const uiData = (0, _positionFns.createDraggableData)(this, coreData); | |
| 2808 | - const newState = { | |
| 2809 | - x: uiData.x, | |
| 2810 | - y: uiData.y, | |
| 2811 | - slackX: 0, | |
| 2812 | - slackY: 0 | |
| 2813 | - }; | |
| 2814 | - if (this.props.bounds) { | |
| 2815 | - const { x, y } = newState; | |
| 2816 | - newState.x += this.state.slackX; | |
| 2817 | - newState.y += this.state.slackY; | |
| 2818 | - const [newStateX, newStateY] = (0, _positionFns.getBoundPosition)(this, newState.x, newState.y); | |
| 2819 | - newState.x = newStateX; | |
| 2820 | - newState.y = newStateY; | |
| 2821 | - newState.slackX = this.state.slackX + (x - newState.x); | |
| 2822 | - newState.slackY = this.state.slackY + (y - newState.y); | |
| 2823 | - uiData.x = newState.x; | |
| 2824 | - uiData.y = newState.y; | |
| 2825 | - uiData.deltaX = newState.x - this.state.x; | |
| 2826 | - uiData.deltaY = newState.y - this.state.y; | |
| 2827 | - } | |
| 2828 | - if (this.props.onDrag(e, uiData) === false) return false; | |
| 2829 | - this.setState(newState); | |
| 2830 | - }); | |
| 2831 | - _defineProperty(this, "onDragStop", (e, coreData) => { | |
| 2832 | - if (!this.state.dragging) return false; | |
| 2833 | - if (this.props.onStop(e, (0, _positionFns.createDraggableData)(this, coreData)) === false) return false; | |
| 2834 | - (0, _log.default)("Draggable: onDragStop: %j", coreData); | |
| 2835 | - const newState = { | |
| 2836 | - dragging: false, | |
| 2837 | - slackX: 0, | |
| 2838 | - slackY: 0 | |
| 2839 | - }; | |
| 2840 | - if (Boolean(this.props.position)) { | |
| 2841 | - const { x, y } = this.props.position; | |
| 2842 | - newState.x = x; | |
| 2843 | - newState.y = y; | |
| 2844 | - } | |
| 2845 | - this.setState(newState); | |
| 2846 | - }); | |
| 2847 | - this.state = { | |
| 2848 | - dragging: false, | |
| 2849 | - dragged: false, | |
| 2850 | - x: props.position ? props.position.x : props.defaultPosition.x, | |
| 2851 | - y: props.position ? props.position.y : props.defaultPosition.y, | |
| 2852 | - prevPropsPosition: _objectSpread2({}, props.position), | |
| 2853 | - slackX: 0, | |
| 2854 | - slackY: 0, | |
| 2855 | - isElementSVG: false | |
| 2856 | - }; | |
| 2857 | - if (props.position && !(props.onDrag || props.onStop)) console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element."); | |
| 2858 | - } | |
| 2859 | - componentDidMount() { | |
| 2860 | - if (typeof window.SVGElement !== "undefined" && this.findDOMNode() instanceof window.SVGElement) this.setState({ isElementSVG: true }); | |
| 2861 | - } | |
| 2862 | - componentWillUnmount() { | |
| 2863 | - if (this.state.dragging) this.setState({ dragging: false }); | |
| 2864 | - } | |
| 2865 | - findDOMNode() { | |
| 2866 | - var _this$props$nodeRef$c; | |
| 2867 | - var _this$props; | |
| 2868 | - return (_this$props$nodeRef$c = (_this$props = this.props) === null || _this$props === void 0 || (_this$props = _this$props.nodeRef) === null || _this$props === void 0 ? void 0 : _this$props.current) !== null && _this$props$nodeRef$c !== void 0 ? _this$props$nodeRef$c : _reactDom.default.findDOMNode(this); | |
| 2869 | - } | |
| 2870 | - render() { | |
| 2871 | - const _this$props2 = this.props, { axis, bounds, children, defaultPosition, defaultClassName, defaultClassNameDragging, defaultClassNameDragged, position, positionOffset, scale } = _this$props2, draggableCoreProps = _objectWithoutProperties(_this$props2, _excluded); | |
| 2872 | - let style = {}; | |
| 2873 | - let svgTransform = null; | |
| 2874 | - const draggable = !Boolean(position) || this.state.dragging; | |
| 2875 | - const validPosition = position || defaultPosition; | |
| 2876 | - const transformOpts = { | |
| 2877 | - x: (0, _positionFns.canDragX)(this) && draggable ? this.state.x : validPosition.x, | |
| 2878 | - y: (0, _positionFns.canDragY)(this) && draggable ? this.state.y : validPosition.y | |
| 2879 | - }; | |
| 2880 | - if (this.state.isElementSVG) svgTransform = (0, _domFns.createSVGTransform)(transformOpts, positionOffset); | |
| 2881 | - else style = (0, _domFns.createCSSTransform)(transformOpts, positionOffset); | |
| 2882 | - const className = (0, _clsx.clsx)(children.props.className || "", defaultClassName, { | |
| 2883 | - [defaultClassNameDragging]: this.state.dragging, | |
| 2884 | - [defaultClassNameDragged]: this.state.dragged | |
| 2885 | - }); | |
| 2886 | - return /*#__PURE__*/ React$46.createElement(_DraggableCore.default, _extends({}, draggableCoreProps, { | |
| 2887 | - onStart: this.onDragStart, | |
| 2888 | - onDrag: this.onDrag, | |
| 2889 | - onStop: this.onDragStop | |
| 2890 | - }), /*#__PURE__*/ React$46.cloneElement(React$46.Children.only(children), { | |
| 2891 | - className, | |
| 2892 | - style: _objectSpread2(_objectSpread2({}, children.props.style), style), | |
| 2893 | - transform: svgTransform | |
| 2894 | - })); | |
| 2895 | - } | |
| 2896 | - }; | |
| 2897 | - exports.default = Draggable; | |
| 2898 | - _defineProperty(Draggable, "displayName", "Draggable"); | |
| 2899 | - _defineProperty(Draggable, "propTypes", _objectSpread2(_objectSpread2({}, _DraggableCore.default.propTypes), {}, { | |
| 2900 | - /** | |
| 2901 | - * `axis` determines which axis the draggable can move. | |
| 2902 | - * | |
| 2903 | - * Note that all callbacks will still return data as normal. This only | |
| 2904 | - * controls flushing to the DOM. | |
| 2905 | - * | |
| 2906 | - * 'both' allows movement horizontally and vertically. | |
| 2907 | - * 'x' limits movement to horizontal axis. | |
| 2908 | - * 'y' limits movement to vertical axis. | |
| 2909 | - * 'none' limits all movement. | |
| 2910 | - * | |
| 2911 | - * Defaults to 'both'. | |
| 2912 | - */ | |
| 2913 | - axis: _propTypes.default.oneOf([ | |
| 2914 | - "both", | |
| 2915 | - "x", | |
| 2916 | - "y", | |
| 2917 | - "none" | |
| 2918 | - ]), | |
| 2919 | - /** | |
| 2920 | - * `bounds` determines the range of movement available to the element. | |
| 2921 | - * Available values are: | |
| 2922 | - * | |
| 2923 | - * 'parent' restricts movement within the Draggable's parent node. | |
| 2924 | - * | |
| 2925 | - * Alternatively, pass an object with the following properties, all of which are optional: | |
| 2926 | - * | |
| 2927 | - * {left: LEFT_BOUND, right: RIGHT_BOUND, bottom: BOTTOM_BOUND, top: TOP_BOUND} | |
| 2928 | - * | |
| 2929 | - * All values are in px. | |
| 2930 | - * | |
| 2931 | - * Example: | |
| 2932 | - * | |
| 2933 | - * ```jsx | |
| 2934 | - * let App = React.createClass({ | |
| 2935 | - * render: function () { | |
| 2936 | - * return ( | |
| 2937 | - * <Draggable bounds={{right: 300, bottom: 300}}> | |
| 2938 | - * <div>Content</div> | |
| 2939 | - * </Draggable> | |
| 2940 | - * ); | |
| 2941 | - * } | |
| 2942 | - * }); | |
| 2943 | - * ``` | |
| 2944 | - */ | |
| 2945 | - bounds: _propTypes.default.oneOfType([ | |
| 2946 | - _propTypes.default.shape({ | |
| 2947 | - left: _propTypes.default.number, | |
| 2948 | - right: _propTypes.default.number, | |
| 2949 | - top: _propTypes.default.number, | |
| 2950 | - bottom: _propTypes.default.number | |
| 2951 | - }), | |
| 2952 | - _propTypes.default.string, | |
| 2953 | - _propTypes.default.oneOf([false]) | |
| 2954 | - ]), | |
| 2955 | - defaultClassName: _propTypes.default.string, | |
| 2956 | - defaultClassNameDragging: _propTypes.default.string, | |
| 2957 | - defaultClassNameDragged: _propTypes.default.string, | |
| 2958 | - /** | |
| 2959 | - * `defaultPosition` specifies the x and y that the dragged item should start at | |
| 2960 | - * | |
| 2961 | - * Example: | |
| 2962 | - * | |
| 2963 | - * ```jsx | |
| 2964 | - * let App = React.createClass({ | |
| 2965 | - * render: function () { | |
| 2966 | - * return ( | |
| 2967 | - * <Draggable defaultPosition={{x: 25, y: 25}}> | |
| 2968 | - * <div>I start with transformX: 25px and transformY: 25px;</div> | |
| 2969 | - * </Draggable> | |
| 2970 | - * ); | |
| 2971 | - * } | |
| 2972 | - * }); | |
| 2973 | - * ``` | |
| 2974 | - */ | |
| 2975 | - defaultPosition: _propTypes.default.shape({ | |
| 2976 | - x: _propTypes.default.number, | |
| 2977 | - y: _propTypes.default.number | |
| 2978 | - }), | |
| 2979 | - positionOffset: _propTypes.default.shape({ | |
| 2980 | - x: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]), | |
| 2981 | - y: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]) | |
| 2982 | - }), | |
| 2983 | - /** | |
| 2984 | - * `position`, if present, defines the current position of the element. | |
| 2985 | - * | |
| 2986 | - * This is similar to how form elements in React work - if no `position` is supplied, the component | |
| 2987 | - * is uncontrolled. | |
| 2988 | - * | |
| 2989 | - * Example: | |
| 2990 | - * | |
| 2991 | - * ```jsx | |
| 2992 | - * let App = React.createClass({ | |
| 2993 | - * render: function () { | |
| 2994 | - * return ( | |
| 2995 | - * <Draggable position={{x: 25, y: 25}}> | |
| 2996 | - * <div>I start with transformX: 25px and transformY: 25px;</div> | |
| 2997 | - * </Draggable> | |
| 2998 | - * ); | |
| 2999 | - * } | |
| 3000 | - * }); | |
| 3001 | - * ``` | |
| 3002 | - */ | |
| 3003 | - position: _propTypes.default.shape({ | |
| 3004 | - x: _propTypes.default.number, | |
| 3005 | - y: _propTypes.default.number | |
| 3006 | - }), | |
| 3007 | - /** | |
| 3008 | - * These properties should be defined on the child, not here. | |
| 3009 | - */ | |
| 3010 | - className: _shims.dontSetMe, | |
| 3011 | - style: _shims.dontSetMe, | |
| 3012 | - transform: _shims.dontSetMe | |
| 3013 | - })); | |
| 3014 | - _defineProperty(Draggable, "defaultProps", _objectSpread2(_objectSpread2({}, _DraggableCore.default.defaultProps), {}, { | |
| 3015 | - axis: "both", | |
| 3016 | - bounds: false, | |
| 3017 | - defaultClassName: "react-draggable", | |
| 3018 | - defaultClassNameDragging: "react-draggable-dragging", | |
| 3019 | - defaultClassNameDragged: "react-draggable-dragged", | |
| 3020 | - defaultPosition: { | |
| 3021 | - x: 0, | |
| 3022 | - y: 0 | |
| 3023 | - }, | |
| 3024 | - scale: 1 | |
| 3025 | - })); | |
| 3026 | - })); | |
| 5163 | + return new PropTypeError( | |
| 5164 | + 'Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'), | |
| 5165 | + {expectedType: expectedType} | |
| 5166 | + ); | |
| 5167 | + } | |
| 5168 | + return null; | |
| 5169 | + } | |
| 5170 | + return createChainableTypeChecker(validate); | |
| 5171 | + } | |
| 3027 | 5172 | |
| 3028 | -//#endregion | |
| 3029 | -//#region node_modules/react-draggable/build/cjs/cjs.js | |
| 3030 | - var require_cjs = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 3031 | - var { default: Draggable, DraggableCore } = require_Draggable(); | |
| 3032 | - module.exports = Draggable; | |
| 3033 | - module.exports.default = Draggable; | |
| 3034 | - module.exports.DraggableCore = DraggableCore; | |
| 3035 | - })); | |
| 5173 | + function createAnyTypeChecker() { | |
| 5174 | + return createChainableTypeChecker(emptyFunctionThatReturnsNull); | |
| 5175 | + } | |
| 3036 | 5176 | |
| 3037 | -//#endregion | |
| 3038 | -//#region modules/ai/assets/js/editor/components/dialog-header.js | |
| 3039 | - var import_prop_types$33, StyledElementorLogo, DialogHeader$1; | |
| 3040 | - var init_dialog_header = __esmMin((() => { | |
| 3041 | - init_extends(); | |
| 3042 | - import_prop_types$33 = /* @__PURE__ */ __toESM(require_prop_types()); | |
| 3043 | - StyledElementorLogo = (0, _elementor_ui.styled)(function ElementorLogo(props) { | |
| 3044 | - return /*#__PURE__*/ react.default.createElement(_elementor_ui.SvgIcon, _extends({ viewBox: "0 0 32 32" }, props), /*#__PURE__*/ react.default.createElement("path", { | |
| 3045 | - fillRule: "evenodd", | |
| 3046 | - clipRule: "evenodd", | |
| 3047 | - d: "M2.69648 24.8891C0.938383 22.2579 0 19.1645 0 16C0 11.7566 1.68571 7.68687 4.68629 4.68629C7.68687 1.68571 11.7566 0 16 0C19.1645 0 22.2579 0.938383 24.8891 2.69648C27.5203 4.45459 29.5711 6.95344 30.7821 9.87706C31.9931 12.8007 32.3099 16.0177 31.6926 19.1214C31.0752 22.2251 29.5514 25.0761 27.3137 27.3137C25.0761 29.5514 22.2251 31.0752 19.1214 31.6926C16.0177 32.3099 12.8007 31.9931 9.87706 30.7821C6.95344 29.5711 4.45459 27.5203 2.69648 24.8891ZM12.0006 9.33281H9.33437V22.6665H12.0006V9.33281ZM22.6657 9.33281H14.6669V11.9991H22.6657V9.33281ZM22.6657 14.6654H14.6669V17.3316H22.6657V14.6654ZM22.6657 20.0003H14.6669V22.6665H22.6657V20.0003Z" | |
| 3048 | - })); | |
| 3049 | - })(function(_ref) { | |
| 3050 | - var theme = _ref.theme; | |
| 3051 | - return { | |
| 3052 | - width: theme.spacing(3), | |
| 3053 | - height: theme.spacing(3), | |
| 3054 | - "& path": { fill: theme.palette.text.primary } | |
| 3055 | - }; | |
| 3056 | - }); | |
| 3057 | - DialogHeader$1 = function DialogHeader(props) { | |
| 3058 | - var hideAiBetaLogo = props.hideAiBetaLogo; | |
| 3059 | - var onClose = props.onClose; | |
| 3060 | - var children = props.children; | |
| 3061 | - return /*#__PURE__*/ react.default.createElement(_elementor_ui.AppBar, { | |
| 3062 | - sx: { fontWeight: "normal" }, | |
| 3063 | - color: "transparent", | |
| 3064 | - position: "relative" | |
| 3065 | - }, /*#__PURE__*/ react.default.createElement(_elementor_ui.Toolbar, { variant: "dense" }, !hideAiBetaLogo && /*#__PURE__*/ react.default.createElement(react.default.Fragment, null, /*#__PURE__*/ react.default.createElement(StyledElementorLogo, { sx: { mr: 1 } }), /*#__PURE__*/ react.default.createElement(_elementor_ui.Typography, { | |
| 3066 | - component: "span", | |
| 3067 | - variant: "subtitle2", | |
| 3068 | - sx: { | |
| 3069 | - fontWeight: "bold", | |
| 3070 | - textTransform: "uppercase" | |
| 3071 | - } | |
| 3072 | - }, (0, _wordpress_i18n.__)("AI", "elementor")), /*#__PURE__*/ react.default.createElement(_elementor_ui.Chip, { | |
| 3073 | - label: (0, _wordpress_i18n.__)("Beta", "elementor"), | |
| 3074 | - color: "default", | |
| 3075 | - size: "small", | |
| 3076 | - sx: { ml: 1 } | |
| 3077 | - })), /*#__PURE__*/ react.default.createElement(_elementor_ui.Stack, { | |
| 3078 | - direction: "row", | |
| 3079 | - spacing: 1, | |
| 3080 | - alignItems: "center", | |
| 3081 | - sx: { ml: hideAiBetaLogo ? 0 : "auto" } | |
| 3082 | - }, children, /*#__PURE__*/ react.default.createElement(_elementor_ui.IconButton, { | |
| 3083 | - size: "small", | |
| 3084 | - "aria-label": "close", | |
| 3085 | - onClick: onClose, | |
| 3086 | - sx: { "&.MuiButtonBase-root": { mr: -1 } } | |
| 3087 | - }, /*#__PURE__*/ react.default.createElement(_elementor_icons.XIcon, null))))); | |
| 3088 | - }; | |
| 3089 | - DialogHeader$1.propTypes = { | |
| 3090 | - onClose: import_prop_types$33.default.func.isRequired, | |
| 3091 | - hideAiBetaLogo: import_prop_types$33.default.bool, | |
| 3092 | - children: import_prop_types$33.default.oneOfType([import_prop_types$33.default.arrayOf(import_prop_types$33.default.node), import_prop_types$33.default.node]) | |
| 3093 | - }; | |
| 3094 | - })); | |
| 5177 | + function createArrayOfTypeChecker(typeChecker) { | |
| 5178 | + function validate(props, propName, componentName, location, propFullName) { | |
| 5179 | + if (typeof typeChecker !== 'function') { | |
| 5180 | + return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.'); | |
| 5181 | + } | |
| 5182 | + var propValue = props[propName]; | |
| 5183 | + if (!Array.isArray(propValue)) { | |
| 5184 | + var propType = getPropType(propValue); | |
| 5185 | + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.')); | |
| 5186 | + } | |
| 5187 | + for (var i = 0; i < propValue.length; i++) { | |
| 5188 | + var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret); | |
| 5189 | + if (error instanceof Error) { | |
| 5190 | + return error; | |
| 5191 | + } | |
| 5192 | + } | |
| 5193 | + return null; | |
| 5194 | + } | |
| 5195 | + return createChainableTypeChecker(validate); | |
| 5196 | + } | |
| 3095 | 5197 | |
| 3096 | -//#endregion | |
| 3097 | -//#region modules/ai/assets/js/editor/components/prompt-dialog.js | |
| 3098 | - function ownKeys$10(e, r) { | |
| 3099 | - var t = Object.keys(e); | |
| 3100 | - if (Object.getOwnPropertySymbols) { | |
| 3101 | - var o = Object.getOwnPropertySymbols(e); | |
| 3102 | - r && (o = o.filter(function(r) { | |
| 3103 | - return Object.getOwnPropertyDescriptor(e, r).enumerable; | |
| 3104 | - })), t.push.apply(t, o); | |
| 3105 | - } | |
| 3106 | - return t; | |
| 3107 | - } | |
| 3108 | - function _objectSpread$10(e) { | |
| 3109 | - for (var r = 1; r < arguments.length; r++) { | |
| 3110 | - var t = null != arguments[r] ? arguments[r] : {}; | |
| 3111 | - r % 2 ? ownKeys$10(Object(t), !0).forEach(function(r) { | |
| 3112 | - _defineProperty$1(e, r, t[r]); | |
| 3113 | - }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$10(Object(t)).forEach(function(r) { | |
| 3114 | - Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); | |
| 3115 | - }); | |
| 3116 | - } | |
| 3117 | - return e; | |
| 3118 | - } | |
| 3119 | - var import_prop_types$32, import_cjs, DraggablePaper, PromptDialog; | |
| 3120 | - var init_prompt_dialog = __esmMin((() => { | |
| 3121 | - init_extends(); | |
| 3122 | - init_defineProperty$1(); | |
| 3123 | - init_slicedToArray(); | |
| 3124 | - import_prop_types$32 = /* @__PURE__ */ __toESM(require_prop_types()); | |
| 3125 | - import_cjs = /* @__PURE__ */ __toESM(require_cjs()); | |
| 3126 | - init_dialog_header(); | |
| 3127 | - __name(ownKeys$10, "ownKeys"); | |
| 3128 | - __name(_objectSpread$10, "_objectSpread"); | |
| 3129 | - DraggablePaper = function DraggablePaper(props) { | |
| 3130 | - var _useState2 = _slicedToArray((0, react.useState)({ | |
| 3131 | - x: 0, | |
| 3132 | - y: 0 | |
| 3133 | - }), 2); | |
| 3134 | - var position = _useState2[0]; | |
| 3135 | - var setPosition = _useState2[1]; | |
| 3136 | - var paperRef = (0, react.useRef)(null); | |
| 3137 | - var timeout = (0, react.useRef)(null); | |
| 3138 | - var onDrag = function onDrag(_e, _ref) { | |
| 3139 | - var x = _ref.x; | |
| 3140 | - var y = _ref.y; | |
| 3141 | - return setPosition({ | |
| 3142 | - x, | |
| 3143 | - y | |
| 3144 | - }); | |
| 3145 | - }; | |
| 3146 | - var handlePositionBoundaries = function handlePositionBoundaries() { | |
| 3147 | - clearTimeout(timeout.current); | |
| 3148 | - timeout.current = setTimeout(function() { | |
| 3149 | - var _paperRef$current; | |
| 3150 | - var dialogTop = (_paperRef$current = paperRef.current) === null || _paperRef$current === void 0 ? void 0 : _paperRef$current.getBoundingClientRect().top; | |
| 3151 | - if (dialogTop < 0) setPosition(function(prev) { | |
| 3152 | - return _objectSpread$10(_objectSpread$10({}, prev), {}, { y: prev.y - dialogTop }); | |
| 3153 | - }); | |
| 3154 | - }, 50); | |
| 3155 | - }; | |
| 3156 | - (0, react.useEffect)(function() { | |
| 3157 | - var resizeObserver = new ResizeObserver(handlePositionBoundaries); | |
| 3158 | - resizeObserver.observe(paperRef.current); | |
| 3159 | - return function() { | |
| 3160 | - resizeObserver.disconnect(); | |
| 3161 | - }; | |
| 3162 | - }, []); | |
| 3163 | - return /*#__PURE__*/ react.default.createElement(import_cjs.default, { | |
| 3164 | - position, | |
| 3165 | - onDrag, | |
| 3166 | - handle: ".MuiAppBar-root", | |
| 3167 | - cancel: "[class*=\"MuiDialogContent-root\"]", | |
| 3168 | - bounds: "parent" | |
| 3169 | - }, /*#__PURE__*/ react.default.createElement(_elementor_ui.Paper, _extends({}, props, { ref: paperRef }))); | |
| 3170 | - }; | |
| 3171 | - PromptDialog = function PromptDialog(props) { | |
| 3172 | - return /*#__PURE__*/ react.default.createElement(_elementor_ui.Dialog, _extends({ | |
| 3173 | - scroll: "paper", | |
| 3174 | - open: true, | |
| 3175 | - fullWidth: true, | |
| 3176 | - hideBackdrop: true, | |
| 3177 | - PaperComponent: DraggablePaper, | |
| 3178 | - disableScrollLock: true, | |
| 3179 | - sx: { "& .MuiDialog-container": { | |
| 3180 | - alignItems: "flex-start", | |
| 3181 | - mt: "18vh" | |
| 3182 | - } }, | |
| 3183 | - PaperProps: { sx: { | |
| 3184 | - m: 0, | |
| 3185 | - maxHeight: "76vh" | |
| 3186 | - } } | |
| 3187 | - }, props), props.children); | |
| 3188 | - }; | |
| 3189 | - PromptDialog.propTypes = { | |
| 3190 | - onClose: import_prop_types$32.default.func.isRequired, | |
| 3191 | - children: import_prop_types$32.default.node, | |
| 3192 | - maxWidth: import_prop_types$32.default.oneOf([ | |
| 3193 | - "xs", | |
| 3194 | - "sm", | |
| 3195 | - "md", | |
| 3196 | - "lg", | |
| 3197 | - "xl", | |
| 3198 | - false | |
| 3199 | - ]) | |
| 3200 | - }; | |
| 3201 | - PromptDialog.Header = DialogHeader$1; | |
| 3202 | - PromptDialog.Content = _elementor_ui.DialogContent; | |
| 3203 | - })); | |
| 5198 | + function createElementTypeChecker() { | |
| 5199 | + function validate(props, propName, componentName, location, propFullName) { | |
| 5200 | + var propValue = props[propName]; | |
| 5201 | + if (!isValidElement(propValue)) { | |
| 5202 | + var propType = getPropType(propValue); | |
| 5203 | + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.')); | |
| 5204 | + } | |
| 5205 | + return null; | |
| 5206 | + } | |
| 5207 | + return createChainableTypeChecker(validate); | |
| 5208 | + } | |
| 3204 | 5209 | |
| 3205 | -//#endregion | |
| 3206 | -//#region modules/ai/assets/js/editor/pages/form-layout/components/layout-dialog.js | |
| 3207 | - function ownKeys$9(e, r) { | |
| 3208 | - var t = Object.keys(e); | |
| 3209 | - if (Object.getOwnPropertySymbols) { | |
| 3210 | - var o = Object.getOwnPropertySymbols(e); | |
| 3211 | - r && (o = o.filter(function(r) { | |
| 3212 | - return Object.getOwnPropertyDescriptor(e, r).enumerable; | |
| 3213 | - })), t.push.apply(t, o); | |
| 3214 | - } | |
| 3215 | - return t; | |
| 3216 | - } | |
| 3217 | - function _objectSpread$9(e) { | |
| 3218 | - for (var r = 1; r < arguments.length; r++) { | |
| 3219 | - var t = null != arguments[r] ? arguments[r] : {}; | |
| 3220 | - r % 2 ? ownKeys$9(Object(t), !0).forEach(function(r) { | |
| 3221 | - _defineProperty$1(e, r, t[r]); | |
| 3222 | - }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$9(Object(t)).forEach(function(r) { | |
| 3223 | - Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); | |
| 3224 | - }); | |
| 3225 | - } | |
| 3226 | - return e; | |
| 3227 | - } | |
| 3228 | - var import_prop_types$31, _excluded$7, StyledDialog, DialogHeader, StyledDialogContent, LayoutDialog; | |
| 3229 | - var init_layout_dialog = __esmMin((() => { | |
| 3230 | - init_extends(); | |
| 3231 | - init_defineProperty$1(); | |
| 3232 | - init_slicedToArray(); | |
| 3233 | - init_objectWithoutProperties$1(); | |
| 3234 | - import_prop_types$31 = /* @__PURE__ */ __toESM(require_prop_types()); | |
| 3235 | - init_prompt_dialog(); | |
| 3236 | - _excluded$7 = ["sx", "PaperProps"]; | |
| 3237 | - __name(ownKeys$9, "ownKeys"); | |
| 3238 | - __name(_objectSpread$9, "_objectSpread"); | |
| 3239 | - StyledDialog = (0, _elementor_ui.styled)(PromptDialog)(function() { | |
| 3240 | - return { | |
| 3241 | - "& .MuiDialog-container": { | |
| 3242 | - marginTop: 0, | |
| 3243 | - alignItems: "flex-end", | |
| 3244 | - paddingBottom: "16vh" | |
| 3245 | - }, | |
| 3246 | - "& .MuiPaper-root": { | |
| 3247 | - margin: 0, | |
| 3248 | - maxHeight: "80vh" | |
| 3249 | - } | |
| 3250 | - }; | |
| 3251 | - }); | |
| 3252 | - DialogHeader = function DialogHeader(_ref) { | |
| 3253 | - var onClose = _ref.onClose; | |
| 3254 | - var children = _ref.children; | |
| 3255 | - return /*#__PURE__*/ react.default.createElement(_elementor_ui.AppBar, { | |
| 3256 | - sx: { fontWeight: "normal" }, | |
| 3257 | - color: "transparent", | |
| 3258 | - position: "relative" | |
| 3259 | - }, /*#__PURE__*/ react.default.createElement(_elementor_ui.Toolbar, { variant: "dense" }, /*#__PURE__*/ react.default.createElement(_elementor_icons.AIIcon, { sx: { mr: 1 } }), /*#__PURE__*/ react.default.createElement(_elementor_ui.Typography, { | |
| 3260 | - component: "span", | |
| 3261 | - variant: "subtitle2", | |
| 3262 | - sx: { | |
| 3263 | - fontWeight: "bold", | |
| 3264 | - textTransform: "uppercase" | |
| 3265 | - } | |
| 3266 | - }, (0, _wordpress_i18n.__)("AI", "elementor")), /*#__PURE__*/ react.default.createElement(_elementor_ui.Chip, { | |
| 3267 | - label: (0, _wordpress_i18n.__)("Beta", "elementor"), | |
| 3268 | - color: "default", | |
| 3269 | - size: "small", | |
| 3270 | - sx: { ml: 1 } | |
| 3271 | - }), /*#__PURE__*/ react.default.createElement(_elementor_ui.Stack, { | |
| 3272 | - direction: "row", | |
| 3273 | - spacing: 1, | |
| 3274 | - alignItems: "center", | |
| 3275 | - sx: { ml: "auto" } | |
| 3276 | - }, children, /*#__PURE__*/ react.default.createElement(_elementor_ui.IconButton, { | |
| 3277 | - size: "small", | |
| 3278 | - "aria-label": "close", | |
| 3279 | - onClick: onClose, | |
| 3280 | - sx: { "&.MuiButtonBase-root": { mr: -1 } } | |
| 3281 | - }, /*#__PURE__*/ react.default.createElement(_elementor_icons.XIcon, null))))); | |
| 3282 | - }; | |
| 3283 | - DialogHeader.propTypes = { | |
| 3284 | - children: import_prop_types$31.default.node, | |
| 3285 | - onClose: import_prop_types$31.default.func.isRequired | |
| 3286 | - }; | |
| 3287 | - StyledDialogContent = (0, _elementor_ui.styled)(PromptDialog.Content)(function() { | |
| 3288 | - return { "&.MuiDialogContent-root": { padding: 0 } }; | |
| 3289 | - }); | |
| 3290 | - LayoutDialog = function LayoutDialog(_ref2) { | |
| 3291 | - var _ref2$sx = _ref2.sx; | |
| 3292 | - var sx = _ref2$sx === void 0 ? {} : _ref2$sx; | |
| 3293 | - var _ref2$PaperProps = _ref2.PaperProps; | |
| 3294 | - var PaperProps = _ref2$PaperProps === void 0 ? {} : _ref2$PaperProps; | |
| 3295 | - var props = _objectWithoutProperties$1(_ref2, _excluded$7); | |
| 3296 | - var _useState2 = _slicedToArray((0, react.useState)({ pointerEvents: "none" }), 2); | |
| 3297 | - var sxStyle = _useState2[0]; | |
| 3298 | - var setSxStyle = _useState2[1]; | |
| 3299 | - var timeoutRef = (0, react.useRef)(null); | |
| 3300 | - /** | |
| 3301 | - * The PromptDialog is using disableScrollLock in order to allow scrolling the page when the Dialog is opened. | |
| 3302 | - * When using the react-draggable library inside the editor, the background page scroll is not working smoothly. | |
| 3303 | - * Therefore, we need to delay the pointerEvents: none, which allowing to scroll the page content. | |
| 3304 | - */ | |
| 3305 | - return /*#__PURE__*/ react.default.createElement(StyledDialog, _extends({ | |
| 3306 | - maxWidth: "md", | |
| 3307 | - PaperProps: _objectSpread$9({ | |
| 3308 | - sx: { pointerEvents: "auto" }, | |
| 3309 | - onMouseEnter: function onMouseEnter() { | |
| 3310 | - clearTimeout(timeoutRef.current); | |
| 3311 | - setSxStyle({ pointerEvents: "all" }); | |
| 3312 | - }, | |
| 3313 | - onMouseLeave: function onMouseLeave() { | |
| 3314 | - clearTimeout(timeoutRef.current); | |
| 3315 | - timeoutRef.current = setTimeout(function() { | |
| 3316 | - setSxStyle({ pointerEvents: "none" }); | |
| 3317 | - }, 200); | |
| 3318 | - } | |
| 3319 | - }, PaperProps) | |
| 3320 | - }, props, { sx: _objectSpread$9(_objectSpread$9({}, sxStyle), sx) })); | |
| 3321 | - }; | |
| 3322 | - LayoutDialog.propTypes = { | |
| 3323 | - sx: import_prop_types$31.default.object, | |
| 3324 | - PaperProps: import_prop_types$31.default.object | |
| 3325 | - }; | |
| 3326 | - LayoutDialog.Header = DialogHeader; | |
| 3327 | - LayoutDialog.Content = StyledDialogContent; | |
| 3328 | - })); | |
| 5210 | + function createElementTypeTypeChecker() { | |
| 5211 | + function validate(props, propName, componentName, location, propFullName) { | |
| 5212 | + var propValue = props[propName]; | |
| 5213 | + if (!ReactIs.isValidElementType(propValue)) { | |
| 5214 | + var propType = getPropType(propValue); | |
| 5215 | + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement type.')); | |
| 5216 | + } | |
| 5217 | + return null; | |
| 5218 | + } | |
| 5219 | + return createChainableTypeChecker(validate); | |
| 5220 | + } | |
| 3329 | 5221 | |
| 3330 | -//#endregion | |
| 3331 | -//#region modules/ai/assets/js/editor/components/prompt-library-link.js | |
| 3332 | - var import_prop_types$30, PromptLibraryLink; | |
| 3333 | - var init_prompt_library_link = __esmMin((() => { | |
| 3334 | - import_prop_types$30 = /* @__PURE__ */ __toESM(require_prop_types()); | |
| 3335 | - PromptLibraryLink = function PromptLibraryLink(props) { | |
| 3336 | - return /*#__PURE__*/ react.default.createElement(_elementor_ui.Typography, { | |
| 3337 | - variant: "body2", | |
| 3338 | - color: "text.secondary" | |
| 3339 | - }, (0, _wordpress_i18n.__)("For more suggestions, explore our"), " ", /*#__PURE__*/ react.default.createElement(_elementor_ui.Link, { | |
| 3340 | - href: props.libraryLink, | |
| 3341 | - className: "elementor-clickable", | |
| 3342 | - target: "_blank" | |
| 3343 | - }, (0, _wordpress_i18n.__)("prompt library"))); | |
| 3344 | - }; | |
| 3345 | - PromptLibraryLink.propTypes = { libraryLink: import_prop_types$30.default.string }; | |
| 3346 | - })); | |
| 5222 | + function createInstanceTypeChecker(expectedClass) { | |
| 5223 | + function validate(props, propName, componentName, location, propFullName) { | |
| 5224 | + if (!(props[propName] instanceof expectedClass)) { | |
| 5225 | + var expectedClassName = expectedClass.name || ANONYMOUS; | |
| 5226 | + var actualClassName = getClassName(props[propName]); | |
| 5227 | + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.')); | |
| 5228 | + } | |
| 5229 | + return null; | |
| 5230 | + } | |
| 5231 | + return createChainableTypeChecker(validate); | |
| 5232 | + } | |
| 3347 | 5233 | |
| 3348 | -//#endregion | |
| 3349 | -//#region modules/ai/assets/js/editor/pages/form-layout/context/config.js | |
| 3350 | - var config_exports = /* @__PURE__ */ __exportAll({ | |
| 3351 | - ConfigProvider: () => ConfigProvider, | |
| 3352 | - LAYOUT_APP_MODES: () => LAYOUT_APP_MODES, | |
| 3353 | - MODE_LAYOUT: () => MODE_LAYOUT, | |
| 3354 | - MODE_VARIATION: () => MODE_VARIATION, | |
| 3355 | - default: () => ConfigContext, | |
| 3356 | - useConfig: () => useConfig | |
| 3357 | - }); | |
| 3358 | - var import_prop_types$29, MODE_LAYOUT, MODE_VARIATION, LAYOUT_APP_MODES, ConfigContext, useConfig, ConfigProvider; | |
| 3359 | - var init_config = __esmMin((() => { | |
| 3360 | - import_prop_types$29 = /* @__PURE__ */ __toESM(require_prop_types()); | |
| 3361 | - MODE_LAYOUT = "layout"; | |
| 3362 | - MODE_VARIATION = "variation"; | |
| 3363 | - LAYOUT_APP_MODES = [MODE_LAYOUT, MODE_VARIATION]; | |
| 3364 | - ConfigContext = react.default.createContext({}); | |
| 3365 | - useConfig = function useConfig() { | |
| 3366 | - return react.default.useContext(ConfigContext); | |
| 3367 | - }; | |
| 3368 | - ConfigProvider = function ConfigProvider(props) { | |
| 3369 | - return /*#__PURE__*/ react.default.createElement(ConfigContext.Provider, { value: { | |
| 3370 | - mode: props.mode, | |
| 3371 | - attachmentsTypes: props.attachmentsTypes, | |
| 3372 | - onClose: props.onClose, | |
| 3373 | - onConnect: props.onConnect, | |
| 3374 | - onData: props.onData, | |
| 3375 | - onInsert: props.onInsert, | |
| 3376 | - onSelect: props.onSelect, | |
| 3377 | - onGenerate: props.onGenerate, | |
| 3378 | - currentContext: props.currentContext, | |
| 3379 | - hasPro: props.hasPro | |
| 3380 | - } }, props.children); | |
| 3381 | - }; | |
| 3382 | - ConfigProvider.propTypes = { | |
| 3383 | - mode: import_prop_types$29.default.oneOf(LAYOUT_APP_MODES).isRequired, | |
| 3384 | - children: import_prop_types$29.default.node.isRequired, | |
| 3385 | - attachmentsTypes: import_prop_types$29.default.object.isRequired, | |
| 3386 | - onClose: import_prop_types$29.default.func.isRequired, | |
| 3387 | - onConnect: import_prop_types$29.default.func.isRequired, | |
| 3388 | - onData: import_prop_types$29.default.func.isRequired, | |
| 3389 | - onInsert: import_prop_types$29.default.func.isRequired, | |
| 3390 | - onSelect: import_prop_types$29.default.func.isRequired, | |
| 3391 | - onGenerate: import_prop_types$29.default.func.isRequired, | |
| 3392 | - currentContext: import_prop_types$29.default.object, | |
| 3393 | - hasPro: import_prop_types$29.default.bool | |
| 3394 | - }; | |
| 3395 | - })); | |
| 5234 | + function createEnumTypeChecker(expectedValues) { | |
| 5235 | + if (!Array.isArray(expectedValues)) { | |
| 5236 | + if (true) { | |
| 5237 | + if (arguments.length > 1) { | |
| 5238 | + printWarning( | |
| 5239 | + 'Invalid arguments supplied to oneOf, expected an array, got ' + arguments.length + ' arguments. ' + | |
| 5240 | + 'A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).' | |
| 5241 | + ); | |
| 5242 | + } else { | |
| 5243 | + printWarning('Invalid argument supplied to oneOf, expected an array.'); | |
| 5244 | + } | |
| 5245 | + } | |
| 5246 | + return emptyFunctionThatReturnsNull; | |
| 5247 | + } | |
| 3396 | 5248 | |
| 3397 | -//#endregion | |
| 3398 | -//#region modules/ai/assets/js/editor/pages/form-layout/components/prompt-autocomplete.js | |
| 3399 | - function ownKeys$8(e, r) { | |
| 3400 | - var t = Object.keys(e); | |
| 3401 | - if (Object.getOwnPropertySymbols) { | |
| 3402 | - var o = Object.getOwnPropertySymbols(e); | |
| 3403 | - r && (o = o.filter(function(r) { | |
| 3404 | - return Object.getOwnPropertyDescriptor(e, r).enumerable; | |
| 3405 | - })), t.push.apply(t, o); | |
| 3406 | - } | |
| 3407 | - return t; | |
| 3408 | - } | |
| 3409 | - function _objectSpread$8(e) { | |
| 3410 | - for (var r = 1; r < arguments.length; r++) { | |
| 3411 | - var t = null != arguments[r] ? arguments[r] : {}; | |
| 3412 | - r % 2 ? ownKeys$8(Object(t), !0).forEach(function(r) { | |
| 3413 | - _defineProperty$1(e, r, t[r]); | |
| 3414 | - }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$8(Object(t)).forEach(function(r) { | |
| 3415 | - Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); | |
| 3416 | - }); | |
| 3417 | - } | |
| 3418 | - return e; | |
| 3419 | - } | |
| 3420 | - var import_prop_types$28, _excluded$6, TextInput, PaperComponent, PromptAutocomplete; | |
| 3421 | - var init_prompt_autocomplete = __esmMin((() => { | |
| 3422 | - init_slicedToArray(); | |
| 3423 | - init_objectWithoutProperties$1(); | |
| 3424 | - init_extends(); | |
| 3425 | - init_defineProperty$1(); | |
| 3426 | - import_prop_types$28 = /* @__PURE__ */ __toESM(require_prop_types()); | |
| 3427 | - init_prompt_library_link(); | |
| 3428 | - init_config(); | |
| 3429 | - _excluded$6 = ["onSubmit"]; | |
| 3430 | - __name(ownKeys$8, "ownKeys"); | |
| 3431 | - __name(_objectSpread$8, "_objectSpread"); | |
| 3432 | - TextInput = (0, react.forwardRef)(function(props, ref) { | |
| 3433 | - return /*#__PURE__*/ react.default.createElement(_elementor_ui.TextField, _extends({ | |
| 3434 | - autoFocus: true, | |
| 3435 | - multiline: true, | |
| 3436 | - size: "small", | |
| 3437 | - maxRows: 3, | |
| 3438 | - color: "secondary", | |
| 3439 | - variant: "standard" | |
| 3440 | - }, props, { | |
| 3441 | - inputRef: ref, | |
| 3442 | - InputProps: _objectSpread$8(_objectSpread$8({}, props.InputProps), {}, { | |
| 3443 | - type: "search", | |
| 3444 | - sx: { pt: 0 } | |
| 3445 | - }) | |
| 3446 | - })); | |
| 3447 | - }); | |
| 3448 | - TextInput.propTypes = { InputProps: import_prop_types$28.default.object }; | |
| 3449 | - PaperComponent = function PaperComponent(props) { | |
| 3450 | - var libraryLink = "variation" === useConfig().mode ? "https://go.elementor.com/ai-prompt-library-variations/" : "https://go.elementor.com/ai-prompt-library-containers/"; | |
| 3451 | - return /*#__PURE__*/ react.default.createElement(_elementor_ui.Paper, _extends({}, props, { | |
| 3452 | - elevation: 8, | |
| 3453 | - sx: { borderRadius: 2 } | |
| 3454 | - }), /*#__PURE__*/ react.default.createElement(_elementor_ui.Typography, { | |
| 3455 | - component: _elementor_ui.Box, | |
| 3456 | - color: function color(theme) { | |
| 3457 | - return theme.palette.text.tertiary; | |
| 3458 | - }, | |
| 3459 | - variant: "caption", | |
| 3460 | - paddingX: 2, | |
| 3461 | - paddingY: 1 | |
| 3462 | - }, (0, _wordpress_i18n.__)("Suggested Prompts", "elementor")), /*#__PURE__*/ react.default.createElement(_elementor_ui.Divider, null), props.children, /*#__PURE__*/ react.default.createElement(_elementor_ui.Stack, { sx: { m: 2 } }, /*#__PURE__*/ react.default.createElement(PromptLibraryLink, { libraryLink }))); | |
| 3463 | - }; | |
| 3464 | - PaperComponent.propTypes = { children: import_prop_types$28.default.node }; | |
| 3465 | - PromptAutocomplete = function PromptAutocomplete(_ref) { | |
| 3466 | - var onSubmit = _ref.onSubmit; | |
| 3467 | - var props = _objectWithoutProperties$1(_ref, _excluded$6); | |
| 3468 | - var _useState2 = _slicedToArray((0, react.useState)(false), 2); | |
| 3469 | - var showSuggestions = _useState2[0]; | |
| 3470 | - var setShowSuggestions = _useState2[1]; | |
| 3471 | - var theme = (0, _elementor_ui.useTheme)(); | |
| 3472 | - var itemHeight = parseInt(theme.spacing(4)); | |
| 3473 | - return /*#__PURE__*/ react.default.createElement(_elementor_ui.Autocomplete, _extends({ | |
| 3474 | - PaperComponent, | |
| 3475 | - ListboxProps: { sx: { maxHeight: 5 * itemHeight } }, | |
| 3476 | - renderOption: function renderOption(optionProps, option) { | |
| 3477 | - return /*#__PURE__*/ react.default.createElement(_elementor_ui.Typography, _extends({}, optionProps, { | |
| 3478 | - title: option.text, | |
| 3479 | - noWrap: true, | |
| 3480 | - variant: "body2", | |
| 3481 | - component: _elementor_ui.Box, | |
| 3482 | - sx: { "&.MuiAutocomplete-option": { | |
| 3483 | - display: "block", | |
| 3484 | - minHeight: itemHeight | |
| 3485 | - } } | |
| 3486 | - }), option.text); | |
| 3487 | - }, | |
| 3488 | - freeSolo: true, | |
| 3489 | - fullWidth: true, | |
| 3490 | - disableClearable: true, | |
| 3491 | - open: showSuggestions, | |
| 3492 | - onClose: function onClose(e) { | |
| 3493 | - var _e$relatedTarget; | |
| 3494 | - return setShowSuggestions("A" === ((_e$relatedTarget = e.relatedTarget) === null || _e$relatedTarget === void 0 ? void 0 : _e$relatedTarget.tagName)); | |
| 3495 | - }, | |
| 3496 | - onKeyDown: function onKeyDown(e) { | |
| 3497 | - if ("Enter" === e.key && !e.shiftKey && !showSuggestions) onSubmit(e); | |
| 3498 | - else if ("/" === e.key && "" === e.target.value) { | |
| 3499 | - e.preventDefault(); | |
| 3500 | - setShowSuggestions(true); | |
| 3501 | - } | |
| 3502 | - } | |
| 3503 | - }, props)); | |
| 3504 | - }; | |
| 3505 | - PromptAutocomplete.propTypes = { onSubmit: import_prop_types$28.default.func.isRequired }; | |
| 3506 | - PromptAutocomplete.TextInput = TextInput; | |
| 3507 | - })); | |
| 5249 | + function validate(props, propName, componentName, location, propFullName) { | |
| 5250 | + var propValue = props[propName]; | |
| 5251 | + for (var i = 0; i < expectedValues.length; i++) { | |
| 5252 | + if (is(propValue, expectedValues[i])) { | |
| 5253 | + return null; | |
| 5254 | + } | |
| 5255 | + } | |
| 3508 | 5256 | |
| 3509 | -//#endregion | |
| 3510 | -//#region modules/ai/assets/js/editor/icons/wand-icon.js | |
| 3511 | - var WandIcon; | |
| 3512 | - var init_wand_icon = __esmMin((() => { | |
| 3513 | - init_extends(); | |
| 3514 | - WandIcon = react.default.forwardRef(function(props, ref) { | |
| 3515 | - return /*#__PURE__*/ react.default.createElement(_elementor_ui.SvgIcon, _extends({ viewBox: "0 0 24 24" }, props, { ref }), /*#__PURE__*/ react.default.createElement("path", { | |
| 3516 | - fillRule: "evenodd", | |
| 3517 | - clipRule: "evenodd", | |
| 3518 | - d: "M9 2.25C9.41421 2.25 9.75 2.58579 9.75 3C9.75 3.33152 9.8817 3.64946 10.1161 3.88388C10.3505 4.1183 10.6685 4.25 11 4.25C11.4142 4.25 11.75 4.58579 11.75 5C11.75 5.41421 11.4142 5.75 11 5.75C10.6685 5.75 10.3505 5.8817 10.1161 6.11612C9.8817 6.35054 9.75 6.66848 9.75 7C9.75 7.41421 9.41421 7.75 9 7.75C8.58579 7.75 8.25 7.41421 8.25 7C8.25 6.66848 8.1183 6.35054 7.88388 6.11612C7.64946 5.8817 7.33152 5.75 7 5.75C6.58579 5.75 6.25 5.41421 6.25 5C6.25 4.58579 6.58579 4.25 7 4.25C7.33152 4.25 7.64946 4.1183 7.88388 3.88388C8.1183 3.64946 8.25 3.33152 8.25 3C8.25 2.58579 8.58579 2.25 9 2.25ZM9 4.88746C8.98182 4.90673 8.96333 4.92576 8.94454 4.94454C8.92576 4.96333 8.90673 4.98182 8.88746 5C8.90673 5.01818 8.92576 5.03667 8.94454 5.05546C8.96333 5.07424 8.98182 5.09327 9 5.11254C9.01818 5.09327 9.03667 5.07424 9.05546 5.05546C9.07424 5.03667 9.09327 5.01818 9.11254 5C9.09327 4.98182 9.07424 4.96333 9.05546 4.94454C9.03667 4.92576 9.01818 4.90673 9 4.88746Z" | |
| 3519 | - }), /*#__PURE__*/ react.default.createElement("path", { | |
| 3520 | - fillRule: "evenodd", | |
| 3521 | - clipRule: "evenodd", | |
| 3522 | - d: "M18.5303 2.46967C18.2374 2.17678 17.7626 2.17678 17.4697 2.46967L2.46967 17.4697C2.17678 17.7626 2.17678 18.2374 2.46967 18.5303L5.46967 21.5303C5.76256 21.8232 6.23744 21.8232 6.53033 21.5303L21.5303 6.53033C21.8232 6.23744 21.8232 5.76256 21.5303 5.46967L18.5303 2.46967ZM18 7.93934L19.9393 6L18 4.06066L16.0607 6L18 7.93934ZM15 7.06066L16.9393 9L6 19.9393L4.06066 18L15 7.06066Z" | |
| 3523 | - }), /*#__PURE__*/ react.default.createElement("path", { | |
| 3524 | - fillRule: "evenodd", | |
| 3525 | - clipRule: "evenodd", | |
| 3526 | - d: "M19.75 13C19.75 12.5858 19.4142 12.25 19 12.25C18.5858 12.25 18.25 12.5858 18.25 13C18.25 13.3315 18.1183 13.6495 17.8839 13.8839C17.6495 14.1183 17.3315 14.25 17 14.25C16.5858 14.25 16.25 14.5858 16.25 15C16.25 15.4142 16.5858 15.75 17 15.75C17.3315 15.75 17.6495 15.8817 17.8839 16.1161C18.1183 16.3505 18.25 16.6685 18.25 17C18.25 17.4142 18.5858 17.75 19 17.75C19.4142 17.75 19.75 17.4142 19.75 17C19.75 16.6685 19.8817 16.3505 20.1161 16.1161C20.3505 15.8817 20.6685 15.75 21 15.75C21.4142 15.75 21.75 15.4142 21.75 15C21.75 14.5858 21.4142 14.25 21 14.25C20.6685 14.25 20.3505 14.1183 20.1161 13.8839C19.8817 13.6495 19.75 13.3315 19.75 13ZM18.9445 14.9445C18.9633 14.9258 18.9818 14.9067 19 14.8875C19.0182 14.9067 19.0367 14.9258 19.0555 14.9445C19.0742 14.9633 19.0933 14.9818 19.1125 15C19.0933 15.0182 19.0742 15.0367 19.0555 15.0555C19.0367 15.0742 19.0182 15.0933 19 15.1125C18.9818 15.0933 18.9633 15.0742 18.9445 15.0555C18.9258 15.0367 18.9067 15.0182 18.8875 15C18.9067 14.9818 18.9258 14.9633 18.9445 14.9445Z" | |
| 3527 | - })); | |
| 3528 | - }); | |
| 3529 | - })); | |
| 5257 | + var valuesString = JSON.stringify(expectedValues, function replacer(key, value) { | |
| 5258 | + var type = getPreciseType(value); | |
| 5259 | + if (type === 'symbol') { | |
| 5260 | + return String(value); | |
| 5261 | + } | |
| 5262 | + return value; | |
| 5263 | + }); | |
| 5264 | + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + String(propValue) + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.')); | |
| 5265 | + } | |
| 5266 | + return createChainableTypeChecker(validate); | |
| 5267 | + } | |
| 3530 | 5268 | |
| 3531 | -//#endregion | |
| 3532 | -//#region modules/ai/assets/js/editor/pages/form-media/components/enhance-button.js | |
| 3533 | - var import_prop_types$27, _excluded$5, StyledWandIcon, EnhanceButton; | |
| 3534 | - var init_enhance_button = __esmMin((() => { | |
| 3535 | - init_extends(); | |
| 3536 | - init_objectWithoutProperties$1(); | |
| 3537 | - import_prop_types$27 = /* @__PURE__ */ __toESM(require_prop_types()); | |
| 3538 | - init_wand_icon(); | |
| 3539 | - _excluded$5 = ["isLoading"]; | |
| 3540 | - StyledWandIcon = (0, _elementor_ui.withDirection)(WandIcon); | |
| 3541 | - EnhanceButton = function EnhanceButton(_ref) { | |
| 3542 | - var isLoading = _ref.isLoading; | |
| 3543 | - var props = _objectWithoutProperties$1(_ref, _excluded$5); | |
| 3544 | - return /*#__PURE__*/ react.default.createElement(_elementor_ui.Tooltip, { title: (0, _wordpress_i18n.__)("Enhance prompt", "elementor") }, /*#__PURE__*/ react.default.createElement(_elementor_ui.Box, { | |
| 3545 | - component: "span", | |
| 3546 | - sx: { cursor: props.disabled ? "default" : "pointer" } | |
| 3547 | - }, /*#__PURE__*/ react.default.createElement(_elementor_ui.IconButton, _extends({ | |
| 3548 | - size: "small", | |
| 3549 | - color: "secondary" | |
| 3550 | - }, props), isLoading ? /*#__PURE__*/ react.default.createElement(_elementor_ui.CircularProgress, { | |
| 3551 | - color: "secondary", | |
| 3552 | - size: 20 | |
| 3553 | - }) : /*#__PURE__*/ react.default.createElement(StyledWandIcon, { fontSize: "small" })))); | |
| 3554 | - }; | |
| 3555 | - EnhanceButton.propTypes = { | |
| 3556 | - disabled: import_prop_types$27.default.bool, | |
| 3557 | - isLoading: import_prop_types$27.default.bool | |
| 3558 | - }; | |
| 3559 | - })); | |
| 5269 | + function createObjectOfTypeChecker(typeChecker) { | |
| 5270 | + function validate(props, propName, componentName, location, propFullName) { | |
| 5271 | + if (typeof typeChecker !== 'function') { | |
| 5272 | + return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.'); | |
| 5273 | + } | |
| 5274 | + var propValue = props[propName]; | |
| 5275 | + var propType = getPropType(propValue); | |
| 5276 | + if (propType !== 'object') { | |
| 5277 | + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.')); | |
| 5278 | + } | |
| 5279 | + for (var key in propValue) { | |
| 5280 | + if (has(propValue, key)) { | |
| 5281 | + var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); | |
| 5282 | + if (error instanceof Error) { | |
| 5283 | + return error; | |
| 5284 | + } | |
| 5285 | + } | |
| 5286 | + } | |
| 5287 | + return null; | |
| 5288 | + } | |
| 5289 | + return createChainableTypeChecker(validate); | |
| 5290 | + } | |
| 3560 | 5291 | |
| 3561 | -//#endregion | |
| 3562 | -//#region modules/ai/assets/js/editor/pages/form-media/components/generate-submit.js | |
| 3563 | - var import_prop_types$26, GenerateSubmit; | |
| 3564 | - var init_generate_submit = __esmMin((() => { | |
| 3565 | - init_extends(); | |
| 3566 | - import_prop_types$26 = /* @__PURE__ */ __toESM(require_prop_types()); | |
| 3567 | - GenerateSubmit = function GenerateSubmit(props) { | |
| 3568 | - return /*#__PURE__*/ react.default.createElement(_elementor_ui.Button, _extends({ | |
| 3569 | - fullWidth: true, | |
| 3570 | - size: "medium", | |
| 3571 | - type: "submit", | |
| 3572 | - variant: "contained" | |
| 3573 | - }, props), props.children || (0, _wordpress_i18n.__)("Generate", "elementor")); | |
| 3574 | - }; | |
| 3575 | - GenerateSubmit.propTypes = { children: import_prop_types$26.default.node }; | |
| 3576 | - })); | |
| 5292 | + function createUnionTypeChecker(arrayOfTypeCheckers) { | |
| 5293 | + if (!Array.isArray(arrayOfTypeCheckers)) { | |
| 5294 | + true ? printWarning('Invalid argument supplied to oneOfType, expected an instance of array.') : 0; | |
| 5295 | + return emptyFunctionThatReturnsNull; | |
| 5296 | + } | |
| 3577 | 5297 | |
| 3578 | -//#endregion | |
| 3579 | -//#region modules/ai/assets/js/editor/icons/arrow-left-icon.js | |
| 3580 | - var ArrowLeftIcon; | |
| 3581 | - var init_arrow_left_icon = __esmMin((() => { | |
| 3582 | - init_extends(); | |
| 3583 | - ArrowLeftIcon = react.default.forwardRef(function(props, ref) { | |
| 3584 | - return /*#__PURE__*/ react.default.createElement(_elementor_ui.SvgIcon, _extends({ viewBox: "0 0 24 24" }, props, { ref }), /*#__PURE__*/ react.default.createElement("path", { | |
| 3585 | - fillRule: "evenodd", | |
| 3586 | - clipRule: "evenodd", | |
| 3587 | - d: "M9.53033 7.46967C9.82322 7.76256 9.82322 8.23744 9.53033 8.53033L6.81066 11.25H19C19.4142 11.25 19.75 11.5858 19.75 12C19.75 12.4142 19.4142 12.75 19 12.75H6.81066L9.53033 15.4697C9.82322 15.7626 9.82322 16.2374 9.53033 16.5303C9.23744 16.8232 8.76256 16.8232 8.46967 16.5303L4.46967 12.5303C4.17678 12.2374 4.17678 11.7626 4.46967 11.4697L8.46967 7.46967C8.76256 7.17678 9.23744 7.17678 9.53033 7.46967Z" | |
| 3588 | - })); | |
| 3589 | - }); | |
| 3590 | - })); | |
| 5298 | + for (var i = 0; i < arrayOfTypeCheckers.length; i++) { | |
| 5299 | + var checker = arrayOfTypeCheckers[i]; | |
| 5300 | + if (typeof checker !== 'function') { | |
| 5301 | + printWarning( | |
| 5302 | + 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' + | |
| 5303 | + 'received ' + getPostfixForTypeWarning(checker) + ' at index ' + i + '.' | |
| 5304 | + ); | |
| 5305 | + return emptyFunctionThatReturnsNull; | |
| 5306 | + } | |
| 5307 | + } | |
| 3591 | 5308 | |
| 3592 | -//#endregion | |
| 3593 | -//#region modules/ai/assets/js/editor/icons/edit-icon.js | |
| 3594 | - var EditIcon; | |
| 3595 | - var init_edit_icon = __esmMin((() => { | |
| 3596 | - init_extends(); | |
| 3597 | - EditIcon = react.default.forwardRef(function(props, ref) { | |
| 3598 | - return /*#__PURE__*/ react.default.createElement(_elementor_ui.SvgIcon, _extends({ viewBox: "0 0 24 24" }, props, { ref }), /*#__PURE__*/ react.default.createElement("path", { | |
| 3599 | - fillRule: "evenodd", | |
| 3600 | - clipRule: "evenodd", | |
| 3601 | - d: "M13.9697 4.96967C14.6408 4.29858 15.5509 3.92157 16.5 3.92157C17.4491 3.92157 18.3592 4.29858 19.0303 4.96967C19.7014 5.64075 20.0784 6.55094 20.0784 7.5C20.0784 8.44905 19.7014 9.35924 19.0303 10.0303L8.53033 20.5303C8.38968 20.671 8.19891 20.75 8 20.75H4C3.58579 20.75 3.25 20.4142 3.25 20V16C3.25 15.8011 3.32902 15.6103 3.46967 15.4697L13.9697 4.96967ZM16.5 5.42157C15.9488 5.42157 15.4201 5.64055 15.0303 6.03033L4.75 16.3107V19.25H7.68934L17.9697 8.96967C18.3595 8.57989 18.5784 8.05123 18.5784 7.5C18.5784 6.94876 18.3595 6.42011 17.9697 6.03033C17.5799 5.64055 17.0512 5.42157 16.5 5.42157Z" | |
| 3602 | - }), /*#__PURE__*/ react.default.createElement("path", { | |
| 3603 | - fillRule: "evenodd", | |
| 3604 | - clipRule: "evenodd", | |
| 3605 | - d: "M12.9697 5.96967C13.2626 5.67677 13.7374 5.67677 14.0303 5.96967L18.0303 9.96967C18.3232 10.2626 18.3232 10.7374 18.0303 11.0303C17.7374 11.3232 17.2626 11.3232 16.9697 11.0303L12.9697 7.03033C12.6768 6.73743 12.6768 6.26256 12.9697 5.96967Z" | |
| 3606 | - })); | |
| 3607 | - }); | |
| 3608 | - })); | |
| 5309 | + function validate(props, propName, componentName, location, propFullName) { | |
| 5310 | + var expectedTypes = []; | |
| 5311 | + for (var i = 0; i < arrayOfTypeCheckers.length; i++) { | |
| 5312 | + var checker = arrayOfTypeCheckers[i]; | |
| 5313 | + var checkerResult = checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret); | |
| 5314 | + if (checkerResult == null) { | |
| 5315 | + return null; | |
| 5316 | + } | |
| 5317 | + if (checkerResult.data && has(checkerResult.data, 'expectedType')) { | |
| 5318 | + expectedTypes.push(checkerResult.data.expectedType); | |
| 5319 | + } | |
| 5320 | + } | |
| 5321 | + var expectedTypesMessage = (expectedTypes.length > 0) ? ', expected one of type [' + expectedTypes.join(', ') + ']': ''; | |
| 5322 | + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`' + expectedTypesMessage + '.')); | |
| 5323 | + } | |
| 5324 | + return createChainableTypeChecker(validate); | |
| 5325 | + } | |
| 3609 | 5326 | |
| 3610 | -//#endregion | |
| 3611 | -//#region modules/ai/assets/js/editor/api/index.js | |
| 3612 | - var request, getUserInformation, getRemoteConfig, setGetStarted, setStatusFeedback, getImagePromptEnhanced, generateLayout, getLayoutPromptEnhanced; | |
| 3613 | - var init_api = __esmMin((() => { | |
| 3614 | - request = function request(endpoint) { | |
| 3615 | - var data = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; | |
| 3616 | - var immediately = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : false; | |
| 3617 | - var signal = arguments.length > 3 ? arguments[3] : void 0; | |
| 3618 | - if (Object.keys(data).length) if (window.elementorAiCurrentContext) data.context = window.elementorAiCurrentContext; | |
| 3619 | - else data.context = window.elementorWpAiCurrentContext; | |
| 3620 | - return new Promise(function(resolve, reject) { | |
| 3621 | - var ajaxData = elementorCommon.ajax.addRequest(endpoint, { | |
| 3622 | - success: resolve, | |
| 3623 | - error: reject, | |
| 3624 | - data, | |
| 3625 | - unique_id: data.unique_id | |
| 3626 | - }, immediately); | |
| 3627 | - if (signal && ajaxData.jqXhr) signal.addEventListener("abort", ajaxData.jqXhr.abort); | |
| 3628 | - }); | |
| 3629 | - }; | |
| 3630 | - getUserInformation = function getUserInformation(immediately) { | |
| 3631 | - return request("ai_get_user_information", void 0, immediately); | |
| 3632 | - }; | |
| 3633 | - getRemoteConfig = function getRemoteConfig() { | |
| 3634 | - return request("ai_get_remote_config"); | |
| 3635 | - }; | |
| 3636 | - setGetStarted = function setGetStarted() { | |
| 3637 | - return request("ai_set_get_started"); | |
| 3638 | - }; | |
| 3639 | - setStatusFeedback = function setStatusFeedback(responseId) { | |
| 3640 | - return request("ai_set_status_feedback", { response_id: responseId }, true); | |
| 3641 | - }; | |
| 3642 | - getImagePromptEnhanced = function getImagePromptEnhanced(prompt) { | |
| 3643 | - return request("ai_get_image_prompt_enhancer", { prompt }); | |
| 3644 | - }; | |
| 3645 | - generateLayout = function generateLayout(requestBody, signal) { | |
| 3646 | - return request("ai_generate_layout", requestBody, true, signal); | |
| 3647 | - }; | |
| 3648 | - getLayoutPromptEnhanced = function getLayoutPromptEnhanced(prompt, enhanceType) { | |
| 3649 | - return request("ai_get_layout_prompt_enhancer", { | |
| 3650 | - prompt, | |
| 3651 | - enhance_type: enhanceType | |
| 3652 | - }); | |
| 3653 | - }; | |
| 3654 | - })); | |
| 5327 | + function createNodeChecker() { | |
| 5328 | + function validate(props, propName, componentName, location, propFullName) { | |
| 5329 | + if (!isNode(props[propName])) { | |
| 5330 | + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.')); | |
| 5331 | + } | |
| 5332 | + return null; | |
| 5333 | + } | |
| 5334 | + return createChainableTypeChecker(validate); | |
| 5335 | + } | |
| 3655 | 5336 | |
| 3656 | -//#endregion | |
| 3657 | -//#region modules/ai/assets/js/editor/context/requests-ids.js | |
| 3658 | - function generateIds(template) { | |
| 3659 | - var _template$elements; | |
| 3660 | - template.id = getUniqueId().toString(); | |
| 3661 | - if ((_template$elements = template.elements) !== null && _template$elements !== void 0 && _template$elements.length) template.elements.map(function(child) { | |
| 3662 | - return generateIds(child); | |
| 3663 | - }); | |
| 3664 | - return template; | |
| 3665 | - } | |
| 3666 | - var import_prop_types$25, Context, useRequestIds, getUniqueId, RequestIdsProvider; | |
| 3667 | - var init_requests_ids = __esmMin((() => { | |
| 3668 | - init_slicedToArray(); | |
| 3669 | - import_prop_types$25 = /* @__PURE__ */ __toESM(require_prop_types()); | |
| 3670 | - Context = (0, react.createContext)({}); | |
| 3671 | - useRequestIds = function useRequestIds() { | |
| 3672 | - var context = (0, react.useContext)(Context); | |
| 3673 | - if (!context) throw new Error("useRequestIds must be used within a RequestIdsProvider"); | |
| 3674 | - return context; | |
| 3675 | - }; | |
| 3676 | - getUniqueId = function getUniqueId(prefix) { | |
| 3677 | - return prefix + "-" + Math.random().toString(16).substr(2, 7); | |
| 3678 | - }; | |
| 3679 | - window.EDITOR_SESSION_ID = window.EDITOR_SESSION_ID || getUniqueId("editor-session"); | |
| 3680 | - RequestIdsProvider = function RequestIdsProvider(props) { | |
| 3681 | - var editorSessionId = (0, react.useRef)(window.EDITOR_SESSION_ID); | |
| 3682 | - var sessionId = (0, react.useRef)(""); | |
| 3683 | - var generateId = (0, react.useRef)(""); | |
| 3684 | - var batchId = (0, react.useRef)(""); | |
| 3685 | - var requestId = (0, react.useRef)(""); | |
| 3686 | - sessionId.current = getUniqueId("session"); | |
| 3687 | - var setGenerate = function setGenerate() { | |
| 3688 | - generateId.current = getUniqueId("generate"); | |
| 3689 | - return generateId; | |
| 3690 | - }; | |
| 3691 | - var setBatch = function setBatch() { | |
| 3692 | - batchId.current = getUniqueId("batch"); | |
| 3693 | - return batchId; | |
| 3694 | - }; | |
| 3695 | - var setRequest = function setRequest() { | |
| 3696 | - requestId.current = getUniqueId("request"); | |
| 3697 | - return requestId; | |
| 3698 | - }; | |
| 3699 | - var _useState2 = _slicedToArray((0, react.useState)(0), 2); | |
| 3700 | - var usagePercentage = _useState2[0]; | |
| 3701 | - var setUsagePercentage = _useState2[1]; | |
| 3702 | - return /*#__PURE__*/ react.default.createElement(Context.Provider, { value: { | |
| 3703 | - editorSessionId, | |
| 3704 | - sessionId, | |
| 3705 | - generateId, | |
| 3706 | - batchId, | |
| 3707 | - requestId, | |
| 3708 | - setGenerate, | |
| 3709 | - setBatch, | |
| 3710 | - setRequest, | |
| 3711 | - usagePercentage, | |
| 3712 | - updateUsagePercentage: function updateUsagePercentage(newPercentage) { | |
| 3713 | - setUsagePercentage(newPercentage); | |
| 3714 | - } | |
| 3715 | - } }, props.children); | |
| 3716 | - }; | |
| 3717 | - RequestIdsProvider.propTypes = { children: import_prop_types$25.default.node.isRequired }; | |
| 3718 | - })); | |
| 5337 | + function invalidValidatorError(componentName, location, propFullName, key, type) { | |
| 5338 | + return new PropTypeError( | |
| 5339 | + (componentName || 'React class') + ': ' + location + ' type `' + propFullName + '.' + key + '` is invalid; ' + | |
| 5340 | + 'it must be a function, usually from the `prop-types` package, but received `' + type + '`.' | |
| 5341 | + ); | |
| 5342 | + } | |
| 3719 | 5343 | |
| 3720 | -//#endregion | |
| 3721 | -//#region modules/ai/assets/js/editor/hooks/use-prompt.js | |
| 3722 | - function ownKeys$7(e, r) { | |
| 3723 | - var t = Object.keys(e); | |
| 3724 | - if (Object.getOwnPropertySymbols) { | |
| 3725 | - var o = Object.getOwnPropertySymbols(e); | |
| 3726 | - r && (o = o.filter(function(r) { | |
| 3727 | - return Object.getOwnPropertyDescriptor(e, r).enumerable; | |
| 3728 | - })), t.push.apply(t, o); | |
| 3729 | - } | |
| 3730 | - return t; | |
| 3731 | - } | |
| 3732 | - function _objectSpread$7(e) { | |
| 3733 | - for (var r = 1; r < arguments.length; r++) { | |
| 3734 | - var t = null != arguments[r] ? arguments[r] : {}; | |
| 3735 | - r % 2 ? ownKeys$7(Object(t), !0).forEach(function(r) { | |
| 3736 | - _defineProperty$1(e, r, t[r]); | |
| 3737 | - }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$7(Object(t)).forEach(function(r) { | |
| 3738 | - Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); | |
| 3739 | - }); | |
| 3740 | - } | |
| 3741 | - return e; | |
| 3742 | - } | |
| 3743 | - var import_regenerator$8, _excluded$4, normalizeResponse, usePrompt; | |
| 3744 | - var init_use_prompt = __esmMin((() => { | |
| 3745 | - init_defineProperty$1(); | |
| 3746 | - init_slicedToArray(); | |
| 3747 | - init_objectWithoutProperties$1(); | |
| 3748 | - import_regenerator$8 = /* @__PURE__ */ __toESM(require_regenerator()); | |
| 3749 | - init_api(); | |
| 3750 | - init_requests_ids(); | |
| 3751 | - _excluded$4 = [ | |
| 3752 | - "text", | |
| 3753 | - "response_id", | |
| 3754 | - "usage", | |
| 3755 | - "images" | |
| 3756 | - ]; | |
| 3757 | - __name(ownKeys$7, "ownKeys"); | |
| 3758 | - __name(_objectSpread$7, "_objectSpread"); | |
| 3759 | - normalizeResponse = function normalizeResponse(_ref) { | |
| 3760 | - var text = _ref.text; | |
| 3761 | - var responseId = _ref.response_id; | |
| 3762 | - var usage = _ref.usage; | |
| 3763 | - var images = _ref.images; | |
| 3764 | - var optional = _objectWithoutProperties$1(_ref, _excluded$4); | |
| 3765 | - var creditsData = usage ? usage.quota - usage.usedQuota : 0; | |
| 3766 | - var normalized = { | |
| 3767 | - result: text || images, | |
| 3768 | - responseId, | |
| 3769 | - credits: Math.max(creditsData, 0), | |
| 3770 | - usagePercentage: usage === null || usage === void 0 ? void 0 : usage.usagePercentage | |
| 3771 | - }; | |
| 3772 | - if (optional.base_template_id) normalized.baseTemplateId = optional.base_template_id; | |
| 3773 | - normalized.type = optional.template_type; | |
| 3774 | - return normalized; | |
| 3775 | - }; | |
| 3776 | - usePrompt = function usePrompt(fetchData, initialState) { | |
| 3777 | - var _useState2 = _slicedToArray((0, react.useState)(false), 2); | |
| 3778 | - var isLoading = _useState2[0]; | |
| 3779 | - var setIsLoading = _useState2[1]; | |
| 3780 | - var _useState4 = _slicedToArray((0, react.useState)(""), 2); | |
| 3781 | - var error = _useState4[0]; | |
| 3782 | - var setError = _useState4[1]; | |
| 3783 | - var _useState6 = _slicedToArray((0, react.useState)(initialState), 2); | |
| 3784 | - var data = _useState6[0]; | |
| 3785 | - var setData = _useState6[1]; | |
| 3786 | - var _useRequestIds = useRequestIds(); | |
| 3787 | - var updateUsagePercentage = _useRequestIds.updateUsagePercentage; | |
| 3788 | - var usagePercentage = _useRequestIds.usagePercentage; | |
| 3789 | - var send = (0, react.useRef)(/*#__PURE__*/ function() { | |
| 3790 | - var _ref2 = _asyncToGenerator$1(/*#__PURE__*/ import_regenerator$8.default.mark(function _callee(payload) { | |
| 3791 | - return import_regenerator$8.default.wrap(function(_context) { | |
| 3792 | - while (1) switch (_context.prev = _context.next) { | |
| 3793 | - case 0: return _context.abrupt("return", payload); | |
| 3794 | - case 1: | |
| 3795 | - case "end": return _context.stop(); | |
| 3796 | - } | |
| 3797 | - }, _callee); | |
| 3798 | - })); | |
| 3799 | - return function(_x) { | |
| 3800 | - return _ref2.apply(this, arguments); | |
| 3801 | - }; | |
| 3802 | - }()); | |
| 3803 | - var sendUsageData = (0, react.useRef)(function() {}); | |
| 3804 | - (0, react.useEffect)(function() { | |
| 3805 | - var newUsageValue = data === null || data === void 0 ? void 0 : data.usagePercentage; | |
| 3806 | - if (newUsageValue && newUsageValue !== usagePercentage) updateUsagePercentage(newUsageValue); | |
| 3807 | - }, [ | |
| 3808 | - data, | |
| 3809 | - usagePercentage, | |
| 3810 | - updateUsagePercentage | |
| 3811 | - ]); | |
| 3812 | - var _useRequestIds2 = useRequestIds(); | |
| 3813 | - var setRequest = _useRequestIds2.setRequest; | |
| 3814 | - var editorSessionId = _useRequestIds2.editorSessionId; | |
| 3815 | - var sessionId = _useRequestIds2.sessionId; | |
| 3816 | - var generateId = _useRequestIds2.generateId; | |
| 3817 | - var batchId = _useRequestIds2.batchId; | |
| 3818 | - send.current = (0, react.useCallback)(/*#__PURE__*/ function() { | |
| 3819 | - var _ref3 = _asyncToGenerator$1(/*#__PURE__*/ import_regenerator$8.default.mark(function _callee2(payload) { | |
| 3820 | - return import_regenerator$8.default.wrap(function(_context2) { | |
| 3821 | - while (1) switch (_context2.prev = _context2.next) { | |
| 3822 | - case 0: return _context2.abrupt("return", new Promise(function(resolve, reject) { | |
| 3823 | - setError(""); | |
| 3824 | - setIsLoading(true); | |
| 3825 | - var requestId = setRequest(); | |
| 3826 | - var requestIds = { | |
| 3827 | - editorSessionId: editorSessionId.current, | |
| 3828 | - sessionId: sessionId.current, | |
| 3829 | - generateId: generateId.current, | |
| 3830 | - batchId: batchId.current, | |
| 3831 | - requestId: requestId.current | |
| 3832 | - }; | |
| 3833 | - payload = _objectSpread$7(_objectSpread$7({}, payload), {}, { requestIds }); | |
| 3834 | - fetchData(payload).then(function(result) { | |
| 3835 | - var normalizedData = normalizeResponse(result); | |
| 3836 | - setData(normalizedData); | |
| 3837 | - resolve(normalizedData); | |
| 3838 | - }).catch(function(err) { | |
| 3839 | - var finalError = (err === null || err === void 0 ? void 0 : err.responseText) || err; | |
| 3840 | - setError(finalError); | |
| 3841 | - reject(finalError); | |
| 3842 | - }).finally(function() { | |
| 3843 | - return setIsLoading(false); | |
| 3844 | - }); | |
| 3845 | - })); | |
| 3846 | - case 1: | |
| 3847 | - case "end": return _context2.stop(); | |
| 3848 | - } | |
| 3849 | - }, _callee2); | |
| 3850 | - })); | |
| 3851 | - return function(_x2) { | |
| 3852 | - return _ref3.apply(this, arguments); | |
| 3853 | - }; | |
| 3854 | - }(), [ | |
| 3855 | - batchId, | |
| 3856 | - editorSessionId, | |
| 3857 | - fetchData, | |
| 3858 | - generateId, | |
| 3859 | - sessionId, | |
| 3860 | - setRequest | |
| 3861 | - ]); | |
| 3862 | - sendUsageData.current = (0, react.useCallback)(function() { | |
| 3863 | - var usageData = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : data; | |
| 3864 | - return usageData.responseId && setStatusFeedback(usageData.responseId); | |
| 3865 | - }, [data]); | |
| 3866 | - return { | |
| 3867 | - isLoading, | |
| 3868 | - error, | |
| 3869 | - data, | |
| 3870 | - setResult: function setResult(result) { | |
| 3871 | - var responseId = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : null; | |
| 3872 | - var updatedResult = _objectSpread$7({}, data); | |
| 3873 | - updatedResult.result = result; | |
| 3874 | - if (responseId) updatedResult.responseId = responseId; | |
| 3875 | - setData(updatedResult); | |
| 3876 | - }, | |
| 3877 | - reset: function reset() { | |
| 3878 | - setData(function(_ref4) { | |
| 3879 | - return { | |
| 3880 | - credits: _ref4.credits, | |
| 3881 | - result: "", | |
| 3882 | - responseId: "" | |
| 3883 | - }; | |
| 3884 | - }); | |
| 3885 | - setError(""); | |
| 3886 | - setIsLoading(false); | |
| 3887 | - }, | |
| 3888 | - send: send.current, | |
| 3889 | - sendUsageData: sendUsageData.current | |
| 3890 | - }; | |
| 3891 | - }; | |
| 3892 | - })); | |
| 5344 | + function createShapeTypeChecker(shapeTypes) { | |
| 5345 | + function validate(props, propName, componentName, location, propFullName) { | |
| 5346 | + var propValue = props[propName]; | |
| 5347 | + var propType = getPropType(propValue); | |
| 5348 | + if (propType !== 'object') { | |
| 5349 | + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.')); | |
| 5350 | + } | |
| 5351 | + for (var key in shapeTypes) { | |
| 5352 | + var checker = shapeTypes[key]; | |
| 5353 | + if (typeof checker !== 'function') { | |
| 5354 | + return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker)); | |
| 5355 | + } | |
| 5356 | + var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); | |
| 5357 | + if (error) { | |
| 5358 | + return error; | |
| 5359 | + } | |
| 5360 | + } | |
| 5361 | + return null; | |
| 5362 | + } | |
| 5363 | + return createChainableTypeChecker(validate); | |
| 5364 | + } | |
| 3893 | 5365 | |
| 3894 | -//#endregion | |
| 3895 | -//#region modules/ai/assets/js/editor/hooks/use-prompt-enhancer.js | |
| 3896 | - var enhancePromptMap, getResult, usePromptEnhancer; | |
| 3897 | - var init_use_prompt_enhancer = __esmMin((() => { | |
| 3898 | - init_api(); | |
| 3899 | - init_use_prompt(); | |
| 3900 | - init_config(); | |
| 3901 | - enhancePromptMap = /* @__PURE__ */ new Map([["media", getImagePromptEnhanced], ["layout", getLayoutPromptEnhanced]]); | |
| 3902 | - getResult = function getResult(prompt, type, enhanceType) { | |
| 3903 | - if (!enhancePromptMap.has(type)) throw new Error("Invalid prompt type: ".concat(type)); | |
| 3904 | - return enhancePromptMap.get(type)(prompt, enhanceType); | |
| 3905 | - }; | |
| 3906 | - usePromptEnhancer = function usePromptEnhancer(prompt, type) { | |
| 3907 | - var mode = useConfig().mode; | |
| 3908 | - var _usePrompt = usePrompt(function() { | |
| 3909 | - return getResult(prompt, type, mode); | |
| 3910 | - }, prompt); | |
| 3911 | - var enhancedData = _usePrompt.data; | |
| 3912 | - var isEnhancing = _usePrompt.isLoading; | |
| 3913 | - return { | |
| 3914 | - enhance: _usePrompt.send, | |
| 3915 | - isEnhancing, | |
| 3916 | - enhancedPrompt: enhancedData === null || enhancedData === void 0 ? void 0 : enhancedData.result | |
| 3917 | - }; | |
| 3918 | - }; | |
| 3919 | - })); | |
| 5366 | + function createStrictShapeTypeChecker(shapeTypes) { | |
| 5367 | + function validate(props, propName, componentName, location, propFullName) { | |
| 5368 | + var propValue = props[propName]; | |
| 5369 | + var propType = getPropType(propValue); | |
| 5370 | + if (propType !== 'object') { | |
| 5371 | + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.')); | |
| 5372 | + } | |
| 5373 | + // We need to check all keys in case some are required but missing from props. | |
| 5374 | + var allKeys = assign({}, props[propName], shapeTypes); | |
| 5375 | + for (var key in allKeys) { | |
| 5376 | + var checker = shapeTypes[key]; | |
| 5377 | + if (has(shapeTypes, key) && typeof checker !== 'function') { | |
| 5378 | + return invalidValidatorError(componentName, location, propFullName, key, getPreciseType(checker)); | |
| 5379 | + } | |
| 5380 | + if (!checker) { | |
| 5381 | + return new PropTypeError( | |
| 5382 | + 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' + | |
| 5383 | + '\nBad object: ' + JSON.stringify(props[propName], null, ' ') + | |
| 5384 | + '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ') | |
| 5385 | + ); | |
| 5386 | + } | |
| 5387 | + var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); | |
| 5388 | + if (error) { | |
| 5389 | + return error; | |
| 5390 | + } | |
| 5391 | + } | |
| 5392 | + return null; | |
| 5393 | + } | |
| 3920 | 5394 | |
| 3921 | -//#endregion | |
| 3922 | -//#region modules/ai/assets/js/editor/icons/x-circle-icon.js | |
| 3923 | - var XCircleIcon; | |
| 3924 | - var init_x_circle_icon = __esmMin((() => { | |
| 3925 | - init_extends(); | |
| 3926 | - XCircleIcon = react.default.forwardRef(function(props, ref) { | |
| 3927 | - return /*#__PURE__*/ react.default.createElement(_elementor_ui.SvgIcon, _extends({ viewBox: "0 0 24 24" }, props, { ref }), /*#__PURE__*/ react.default.createElement("path", { d: "M12 2.69231C6.8595 2.69231 2.69231 6.8595 2.69231 12C2.69231 17.1405 6.8595 21.3077 12 21.3077C17.1405 21.3077 21.3077 17.1405 21.3077 12C21.3077 6.8595 17.1405 2.69231 12 2.69231ZM1 12C1 5.92487 5.92487 1 12 1C18.0751 1 23 5.92487 23 12C23 18.0751 18.0751 23 12 23C5.92487 23 1 18.0751 1 12ZM9.14527 9.14527C9.47571 8.81483 10.0115 8.81483 10.3419 9.14527L12 10.8034L13.6581 9.14527C13.9885 8.81483 14.5243 8.81483 14.8547 9.14527C15.1852 9.47571 15.1852 10.0115 14.8547 10.3419L13.1966 12L14.8547 13.6581C15.1852 13.9885 15.1852 14.5243 14.8547 14.8547C14.5243 15.1852 13.9885 15.1852 13.6581 14.8547L12 13.1966L10.3419 14.8547C10.0115 15.1852 9.47571 15.1852 9.14527 14.8547C8.81483 14.5243 8.81483 13.9885 9.14527 13.6581L10.8034 12L9.14527 10.3419C8.81483 10.0115 8.81483 9.47571 9.14527 9.14527Z" })); | |
| 3928 | - }); | |
| 3929 | - })); | |
| 5395 | + return createChainableTypeChecker(validate); | |
| 5396 | + } | |
| 3930 | 5397 | |
| 3931 | -//#endregion | |
| 3932 | -//#region modules/ai/assets/js/editor/icons/plus-circle-icon.js | |
| 3933 | - var PlusCircleIcon; | |
| 3934 | - var init_plus_circle_icon = __esmMin((() => { | |
| 3935 | - init_extends(); | |
| 3936 | - PlusCircleIcon = react.default.forwardRef(function(props, ref) { | |
| 3937 | - return /*#__PURE__*/ react.default.createElement(_elementor_ui.SvgIcon, _extends({ viewBox: "0 0 24 24" }, props, { ref }), /*#__PURE__*/ react.default.createElement("path", { d: "M12 2.69231C6.8595 2.69231 2.69231 6.8595 2.69231 12C2.69231 17.1405 6.8595 21.3077 12 21.3077C17.1405 21.3077 21.3077 17.1405 21.3077 12C21.3077 6.8595 17.1405 2.69231 12 2.69231ZM1 12C1 5.92487 5.92487 1 12 1C18.0751 1 23 5.92487 23 12C23 18.0751 18.0751 23 12 23C5.92487 23 1 18.0751 1 12ZM12 7.76923C12.4673 7.76923 12.8462 8.14807 12.8462 8.61538V11.1538H15.3846C15.8519 11.1538 16.2308 11.5327 16.2308 12C16.2308 12.4673 15.8519 12.8462 15.3846 12.8462H12.8462V15.3846C12.8462 15.8519 12.4673 16.2308 12 16.2308C11.5327 16.2308 11.1538 15.8519 11.1538 15.3846V12.8462H8.61538C8.14807 12.8462 7.76923 12.4673 7.76923 12C7.76923 11.5327 8.14807 11.1538 8.61538 11.1538H11.1538V8.61538C11.1538 8.14807 11.5327 7.76923 12 7.76923Z" })); | |
| 3938 | - }); | |
| 3939 | - })); | |
| 5398 | + function isNode(propValue) { | |
| 5399 | + switch (typeof propValue) { | |
| 5400 | + case 'number': | |
| 5401 | + case 'string': | |
| 5402 | + case 'undefined': | |
| 5403 | + return true; | |
| 5404 | + case 'boolean': | |
| 5405 | + return !propValue; | |
| 5406 | + case 'object': | |
| 5407 | + if (Array.isArray(propValue)) { | |
| 5408 | + return propValue.every(isNode); | |
| 5409 | + } | |
| 5410 | + if (propValue === null || isValidElement(propValue)) { | |
| 5411 | + return true; | |
| 5412 | + } | |
| 3940 | 5413 | |
| 3941 | -//#endregion | |
| 3942 | -//#region modules/ai/assets/js/editor/components/alert-dialog.js | |
| 3943 | - var import_prop_types$24, AlertDialog; | |
| 3944 | - var init_alert_dialog = __esmMin((() => { | |
| 3945 | - init_slicedToArray(); | |
| 3946 | - import_prop_types$24 = /* @__PURE__ */ __toESM(require_prop_types()); | |
| 3947 | - AlertDialog = function AlertDialog(props) { | |
| 3948 | - var _useState2 = _slicedToArray((0, react.useState)(true), 2); | |
| 3949 | - var isShown = _useState2[0]; | |
| 3950 | - var setIsShown = _useState2[1]; | |
| 3951 | - if (!isShown) return null; | |
| 3952 | - return /*#__PURE__*/ react.default.createElement(_elementor_ui.Dialog, { | |
| 3953 | - open: true, | |
| 3954 | - maxWidth: "lg" | |
| 3955 | - }, /*#__PURE__*/ react.default.createElement(_elementor_ui.DialogContent, { sx: { padding: 0 } }, /*#__PURE__*/ react.default.createElement(_elementor_ui.Typography, { sx: { | |
| 3956 | - textAlign: "center", | |
| 3957 | - padding: 3 | |
| 3958 | - } }, props.message), /*#__PURE__*/ react.default.createElement(_elementor_ui.Stack, { | |
| 3959 | - alignItems: "center", | |
| 3960 | - spacing: 2, | |
| 3961 | - marginBottom: 2 | |
| 3962 | - }, /*#__PURE__*/ react.default.createElement(_elementor_ui.Button, { | |
| 3963 | - variant: "contained", | |
| 3964 | - type: "button", | |
| 3965 | - color: "primary", | |
| 3966 | - onClick: function onClick() { | |
| 3967 | - var _props$onClose; | |
| 3968 | - setIsShown(false); | |
| 3969 | - (_props$onClose = props.onClose) === null || _props$onClose === void 0 || _props$onClose.call(props); | |
| 3970 | - } | |
| 3971 | - }, (0, _wordpress_i18n.__)("Close", "elementor"))))); | |
| 3972 | - }; | |
| 3973 | - AlertDialog.propTypes = { | |
| 3974 | - message: import_prop_types$24.default.string.isRequired, | |
| 3975 | - onClose: import_prop_types$24.default.func | |
| 3976 | - }; | |
| 3977 | - })); | |
| 5414 | + var iteratorFn = getIteratorFn(propValue); | |
| 5415 | + if (iteratorFn) { | |
| 5416 | + var iterator = iteratorFn.call(propValue); | |
| 5417 | + var step; | |
| 5418 | + if (iteratorFn !== propValue.entries) { | |
| 5419 | + while (!(step = iterator.next()).done) { | |
| 5420 | + if (!isNode(step.value)) { | |
| 5421 | + return false; | |
| 5422 | + } | |
| 5423 | + } | |
| 5424 | + } else { | |
| 5425 | + // Iterator will provide entry [k,v] tuples rather than values. | |
| 5426 | + while (!(step = iterator.next()).done) { | |
| 5427 | + var entry = step.value; | |
| 5428 | + if (entry) { | |
| 5429 | + if (!isNode(entry[1])) { | |
| 5430 | + return false; | |
| 5431 | + } | |
| 5432 | + } | |
| 5433 | + } | |
| 5434 | + } | |
| 5435 | + } else { | |
| 5436 | + return false; | |
| 5437 | + } | |
| 3978 | 5438 | |
| 3979 | -//#endregion | |
| 3980 | -//#region modules/ai/assets/js/editor/hooks/use-timeout.js | |
| 3981 | - var useTimeout; | |
| 3982 | - var init_use_timeout = __esmMin((() => { | |
| 3983 | - init_slicedToArray(); | |
| 3984 | - useTimeout = function useTimeout(delay) { | |
| 3985 | - var _useState2 = _slicedToArray((0, react.useState)(false), 2); | |
| 3986 | - var isTimeout = _useState2[0]; | |
| 3987 | - var setIsTimeout = _useState2[1]; | |
| 3988 | - var timeoutIdRef = (0, react.useRef)(null); | |
| 3989 | - var turnOffTimeout = function turnOffTimeout() { | |
| 3990 | - clearTimeout(timeoutIdRef.current); | |
| 3991 | - setIsTimeout(false); | |
| 3992 | - }; | |
| 3993 | - (0, react.useEffect)(function() { | |
| 3994 | - timeoutIdRef.current = setTimeout(function() { | |
| 3995 | - setIsTimeout(true); | |
| 3996 | - }, delay); | |
| 3997 | - return function() { | |
| 3998 | - clearTimeout(timeoutIdRef.current); | |
| 3999 | - }; | |
| 4000 | - }, [delay]); | |
| 4001 | - return [isTimeout, turnOffTimeout]; | |
| 4002 | - }; | |
| 4003 | - })); | |
| 5439 | + return true; | |
| 5440 | + default: | |
| 5441 | + return false; | |
| 5442 | + } | |
| 5443 | + } | |
| 4004 | 5444 | |
| 4005 | -//#endregion | |
| 4006 | -//#region modules/ai/assets/js/editor/pages/form-layout/context/remote-config.js | |
| 4007 | - var import_regenerator$7, import_prop_types$23, RemoteConfigContext, useRemoteConfig, CONFIG_KEYS, RemoteConfigProvider; | |
| 4008 | - var init_remote_config = __esmMin((() => { | |
| 4009 | - init_asyncToGenerator$1(); | |
| 4010 | - init_slicedToArray(); | |
| 4011 | - import_regenerator$7 = /* @__PURE__ */ __toESM(require_regenerator()); | |
| 4012 | - import_prop_types$23 = /* @__PURE__ */ __toESM(require_prop_types()); | |
| 4013 | - init_api(); | |
| 4014 | - RemoteConfigContext = react.default.createContext({}); | |
| 4015 | - useRemoteConfig = function useRemoteConfig() { | |
| 4016 | - return react.default.useContext(RemoteConfigContext); | |
| 4017 | - }; | |
| 4018 | - CONFIG_KEYS = { | |
| 4019 | - WEB_BASED_BUILDER_URL: "webBasedBuilderUrl", | |
| 4020 | - AUTH_TOKEN: "jwt" | |
| 4021 | - }; | |
| 4022 | - RemoteConfigProvider = function RemoteConfigProvider(props) { | |
| 4023 | - var _useState2 = _slicedToArray((0, react.useState)(false), 2); | |
| 4024 | - var isLoading = _useState2[0]; | |
| 4025 | - var setIsLoading = _useState2[1]; | |
| 4026 | - var _useState4 = _slicedToArray((0, react.useState)(false), 2); | |
| 4027 | - var isLoaded = _useState4[0]; | |
| 4028 | - var setIsLoaded = _useState4[1]; | |
| 4029 | - var _useState6 = _slicedToArray((0, react.useState)(false), 2); | |
| 4030 | - var isError = _useState6[0]; | |
| 4031 | - var setIsError = _useState6[1]; | |
| 4032 | - var _useState8 = _slicedToArray((0, react.useState)({}), 2); | |
| 4033 | - var remoteConfig = _useState8[0]; | |
| 4034 | - var setRemoteConfig = _useState8[1]; | |
| 4035 | - var fetchData = /*#__PURE__*/ function() { | |
| 4036 | - var _ref = _asyncToGenerator$1(/*#__PURE__*/ import_regenerator$7.default.mark(function _callee() { | |
| 4037 | - var result; | |
| 4038 | - return import_regenerator$7.default.wrap(function(_context) { | |
| 4039 | - while (1) switch (_context.prev = _context.next) { | |
| 4040 | - case 0: | |
| 4041 | - setIsLoading(true); | |
| 4042 | - setIsError(false); | |
| 4043 | - _context.prev = 1; | |
| 4044 | - _context.next = 2; | |
| 4045 | - return getRemoteConfig().finally(function() { | |
| 4046 | - setIsLoaded(true); | |
| 4047 | - setIsLoading(false); | |
| 4048 | - }); | |
| 4049 | - case 2: | |
| 4050 | - result = _context.sent; | |
| 4051 | - if (result.config) { | |
| 4052 | - _context.next = 3; | |
| 4053 | - break; | |
| 4054 | - } | |
| 4055 | - throw new Error("Invalid remote config"); | |
| 4056 | - case 3: | |
| 4057 | - setRemoteConfig(result.config); | |
| 4058 | - _context.next = 5; | |
| 4059 | - break; | |
| 4060 | - case 4: | |
| 4061 | - _context.prev = 4; | |
| 4062 | - _context["catch"](1); | |
| 4063 | - setIsError(true); | |
| 4064 | - setIsLoaded(true); | |
| 4065 | - setIsLoading(false); | |
| 4066 | - case 5: | |
| 4067 | - case "end": return _context.stop(); | |
| 4068 | - } | |
| 4069 | - }, _callee, null, [[1, 4]]); | |
| 4070 | - })); | |
| 4071 | - return function fetchData() { | |
| 4072 | - return _ref.apply(this, arguments); | |
| 4073 | - }; | |
| 4074 | - }(); | |
| 4075 | - (0, react.useEffect)(function() { | |
| 4076 | - window.addEventListener("elementor/connect/success", fetchData); | |
| 4077 | - return function() { | |
| 4078 | - window.removeEventListener("elementor/connect/success", fetchData); | |
| 4079 | - }; | |
| 4080 | - }, []); | |
| 4081 | - if (!isLoaded && !isLoading) fetchData(); | |
| 4082 | - return /*#__PURE__*/ react.default.createElement(RemoteConfigContext.Provider, { value: { | |
| 4083 | - isLoading, | |
| 4084 | - isLoaded, | |
| 4085 | - isError, | |
| 4086 | - remoteConfig | |
| 4087 | - } }, props.children); | |
| 4088 | - }; | |
| 4089 | - RemoteConfigProvider.propTypes = { | |
| 4090 | - children: import_prop_types$23.default.node.isRequired, | |
| 4091 | - onError: import_prop_types$23.default.func.isRequired | |
| 4092 | - }; | |
| 4093 | - })); | |
| 5445 | + function isSymbol(propType, propValue) { | |
| 5446 | + // Native Symbol. | |
| 5447 | + if (propType === 'symbol') { | |
| 5448 | + return true; | |
| 5449 | + } | |
| 4094 | 5450 | |
| 4095 | -//#endregion | |
| 4096 | -//#region modules/ai/assets/js/editor/hooks/use-user-info.js | |
| 4097 | - function ownKeys$6(e, r) { | |
| 4098 | - var t = Object.keys(e); | |
| 4099 | - if (Object.getOwnPropertySymbols) { | |
| 4100 | - var o = Object.getOwnPropertySymbols(e); | |
| 4101 | - r && (o = o.filter(function(r) { | |
| 4102 | - return Object.getOwnPropertyDescriptor(e, r).enumerable; | |
| 4103 | - })), t.push.apply(t, o); | |
| 4104 | - } | |
| 4105 | - return t; | |
| 4106 | - } | |
| 4107 | - function _objectSpread$6(e) { | |
| 4108 | - for (var r = 1; r < arguments.length; r++) { | |
| 4109 | - var t = null != arguments[r] ? arguments[r] : {}; | |
| 4110 | - r % 2 ? ownKeys$6(Object(t), !0).forEach(function(r) { | |
| 4111 | - _defineProperty$1(e, r, t[r]); | |
| 4112 | - }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$6(Object(t)).forEach(function(r) { | |
| 4113 | - Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); | |
| 4114 | - }); | |
| 4115 | - } | |
| 4116 | - return e; | |
| 4117 | - } | |
| 4118 | - var import_regenerator$6, import_prop_types$22, useUserInfo; | |
| 4119 | - var init_use_user_info = __esmMin((() => { | |
| 4120 | - init_defineProperty$1(); | |
| 4121 | - init_asyncToGenerator$1(); | |
| 4122 | - init_slicedToArray(); | |
| 4123 | - import_regenerator$6 = /* @__PURE__ */ __toESM(require_regenerator()); | |
| 4124 | - init_api(); | |
| 4125 | - import_prop_types$22 = /* @__PURE__ */ __toESM(require_prop_types()); | |
| 4126 | - __name(ownKeys$6, "ownKeys"); | |
| 4127 | - __name(_objectSpread$6, "_objectSpread"); | |
| 4128 | - useUserInfo = function useUserInfo() { | |
| 4129 | - var immediately = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : false; | |
| 4130 | - var _useState2 = _slicedToArray((0, react.useState)(false), 2); | |
| 4131 | - var isLoaded = _useState2[0]; | |
| 4132 | - var setIsLoaded = _useState2[1]; | |
| 4133 | - var _useState4 = _slicedToArray((0, react.useState)(false), 2); | |
| 4134 | - var isLoading = _useState4[0]; | |
| 4135 | - var setIsLoading = _useState4[1]; | |
| 4136 | - var _useState6 = _slicedToArray((0, react.useState)({ | |
| 4137 | - is_connected: false, | |
| 4138 | - is_get_started: false, | |
| 4139 | - connect_url: "", | |
| 4140 | - usage: { | |
| 4141 | - hasAiSubscription: false, | |
| 4142 | - quota: 0, | |
| 4143 | - usedQuota: 0 | |
| 4144 | - } | |
| 4145 | - }), 2); | |
| 4146 | - var userInfo = _useState6[0]; | |
| 4147 | - var setUserInfo = _useState6[1]; | |
| 4148 | - var credits = userInfo.usage.quota - userInfo.usage.usedQuota; | |
| 4149 | - var usagePercentage = userInfo.usage.quota ? userInfo.usage.usedQuota / userInfo.usage.quota * 100 : 0; | |
| 4150 | - var fetchData = /*#__PURE__*/ function() { | |
| 4151 | - var _ref = _asyncToGenerator$1(/*#__PURE__*/ import_regenerator$6.default.mark(function _callee() { | |
| 4152 | - var userInfoResult; | |
| 4153 | - return import_regenerator$6.default.wrap(function(_context) { | |
| 4154 | - while (1) switch (_context.prev = _context.next) { | |
| 4155 | - case 0: | |
| 4156 | - setIsLoading(true); | |
| 4157 | - _context.next = 1; | |
| 4158 | - return getUserInformation(immediately); | |
| 4159 | - case 1: | |
| 4160 | - userInfoResult = _context.sent; | |
| 4161 | - setUserInfo(function(prevState) { | |
| 4162 | - return _objectSpread$6(_objectSpread$6({}, prevState), userInfoResult); | |
| 4163 | - }); | |
| 4164 | - setIsLoaded(true); | |
| 4165 | - setIsLoading(false); | |
| 4166 | - case 2: | |
| 4167 | - case "end": return _context.stop(); | |
| 4168 | - } | |
| 4169 | - }, _callee); | |
| 4170 | - })); | |
| 4171 | - return function fetchData() { | |
| 4172 | - return _ref.apply(this, arguments); | |
| 4173 | - }; | |
| 4174 | - }(); | |
| 4175 | - if (!isLoaded && !isLoading) fetchData(); | |
| 4176 | - return { | |
| 4177 | - isLoading, | |
| 4178 | - isLoaded, | |
| 4179 | - isConnected: userInfo.is_connected, | |
| 4180 | - isGetStarted: userInfo.is_get_started, | |
| 4181 | - connectUrl: userInfo.connect_url, | |
| 4182 | - builderUrl: userInfo.usage.builderUrl, | |
| 4183 | - hasSubscription: userInfo.usage.hasAiSubscription, | |
| 4184 | - credits: credits < 0 ? 0 : credits, | |
| 4185 | - usagePercentage: Math.round(usagePercentage), | |
| 4186 | - fetchData | |
| 4187 | - }; | |
| 4188 | - }; | |
| 4189 | - useUserInfo.propTypes = { immediately: import_prop_types$22.default.bool }; | |
| 4190 | - })); | |
| 5451 | + // falsy value can't be a Symbol | |
| 5452 | + if (!propValue) { | |
| 5453 | + return false; | |
| 5454 | + } | |
| 4191 | 5455 | |
| 4192 | -//#endregion | |
| 4193 | -//#region modules/ai/assets/js/editor/pages/form-layout/components/attachments/url-dialog.js | |
| 4194 | - var import_prop_types$21, UrlDialog; | |
| 4195 | - var init_url_dialog = __esmMin((() => { | |
| 4196 | - init_slicedToArray(); | |
| 4197 | - import_prop_types$21 = /* @__PURE__ */ __toESM(require_prop_types()); | |
| 4198 | - init_alert_dialog(); | |
| 4199 | - init_use_timeout(); | |
| 4200 | - init_attachments(); | |
| 4201 | - init_remote_config(); | |
| 4202 | - init_use_user_info(); | |
| 4203 | - init_requests_ids(); | |
| 4204 | - UrlDialog = function UrlDialog(props) { | |
| 4205 | - var _useTimeout2 = _slicedToArray(useTimeout(1e4), 2); | |
| 4206 | - var isTimeout = _useTimeout2[0]; | |
| 4207 | - var turnOffTimeout = _useTimeout2[1]; | |
| 4208 | - var _useUserInfo = useUserInfo(); | |
| 4209 | - var isLoading = _useUserInfo.isLoading; | |
| 4210 | - var initialUsagePercentage = _useUserInfo.usagePercentage; | |
| 4211 | - var updateUsagePercentage = useRequestIds().updateUsagePercentage; | |
| 4212 | - var _useState2 = _slicedToArray((0, react.useState)(false), 2); | |
| 4213 | - var isInitUsageDone = _useState2[0]; | |
| 4214 | - var setIsInitUsageDone = _useState2[1]; | |
| 4215 | - var builderUrl = useRemoteConfig().remoteConfig[CONFIG_KEYS.WEB_BASED_BUILDER_URL]; | |
| 4216 | - var iframeOrigin = (builderUrl ? new URL(builderUrl) : {}).origin; | |
| 4217 | - var isOpen = (0, react.useRef)(false); | |
| 4218 | - (0, react.useEffect)(function() { | |
| 4219 | - if (!isInitUsageDone && !isLoading && (initialUsagePercentage || 0 === initialUsagePercentage)) { | |
| 4220 | - updateUsagePercentage(initialUsagePercentage); | |
| 4221 | - setIsInitUsageDone(true); | |
| 4222 | - } | |
| 4223 | - }, [ | |
| 4224 | - isLoading, | |
| 4225 | - initialUsagePercentage, | |
| 4226 | - isInitUsageDone, | |
| 4227 | - updateUsagePercentage | |
| 4228 | - ]); | |
| 4229 | - (0, react.useEffect)(function() { | |
| 4230 | - if (!isOpen.current) try { | |
| 4231 | - window.$e.run("ai-integration/open-choose-element", { url: props.url }); | |
| 4232 | - isOpen.current = true; | |
| 4233 | - } catch (error) { | |
| 4234 | - console.error(error); | |
| 4235 | - } | |
| 4236 | - }, [isOpen.current]); | |
| 4237 | - (0, react.useEffect)(function() { | |
| 4238 | - var onMessage = function onMessage(event) { | |
| 4239 | - if (event.origin !== iframeOrigin) return; | |
| 4240 | - var _event$data = event.data; | |
| 4241 | - var type = _event$data.type; | |
| 4242 | - var html = _event$data.html; | |
| 4243 | - var url = _event$data.url; | |
| 4244 | - switch (type) { | |
| 4245 | - case "element-selector/close": | |
| 4246 | - isOpen.current = false; | |
| 4247 | - props.onClose(); | |
| 4248 | - break; | |
| 4249 | - case "element-selector/loaded": | |
| 4250 | - turnOffTimeout(); | |
| 4251 | - isOpen.current = true; | |
| 4252 | - break; | |
| 4253 | - case "element-selector/attach": | |
| 4254 | - props.onAttach([{ | |
| 4255 | - type: "url", | |
| 4256 | - previewHTML: html, | |
| 4257 | - content: html, | |
| 4258 | - label: url ? new URL(url).href : "", | |
| 4259 | - source: USER_URL_SOURCE | |
| 4260 | - }]); | |
| 4261 | - break; | |
| 4262 | - } | |
| 4263 | - }; | |
| 4264 | - window.addEventListener("message", onMessage); | |
| 4265 | - return function() { | |
| 4266 | - window.removeEventListener("message", onMessage); | |
| 4267 | - }; | |
| 4268 | - }, [ | |
| 4269 | - iframeOrigin, | |
| 4270 | - props, | |
| 4271 | - turnOffTimeout | |
| 4272 | - ]); | |
| 4273 | - return /*#__PURE__*/ react.default.createElement(react.default.Fragment, null, !isOpen.current && !isTimeout && /*#__PURE__*/ react.default.createElement(_elementor_ui.Dialog, { | |
| 4274 | - open: true, | |
| 4275 | - maxWidth: "lg" | |
| 4276 | - }, /*#__PURE__*/ react.default.createElement(_elementor_ui.Typography, { sx: { | |
| 4277 | - textAlign: "center", | |
| 4278 | - padding: 3 | |
| 4279 | - } }, (0, _wordpress_i18n.__)("Loading...", "elementor"))), isTimeout && /*#__PURE__*/ react.default.createElement(AlertDialog, { | |
| 4280 | - message: (0, _wordpress_i18n.__)("The app is not responding. Please try again later. (#408)", "elementor"), | |
| 4281 | - onClose: props.onClose | |
| 4282 | - })); | |
| 4283 | - }; | |
| 4284 | - UrlDialog.propTypes = { | |
| 4285 | - onAttach: import_prop_types$21.default.func.isRequired, | |
| 4286 | - onClose: import_prop_types$21.default.func.isRequired, | |
| 4287 | - url: import_prop_types$21.default.string | |
| 4288 | - }; | |
| 4289 | - })); | |
| 5456 | + // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol' | |
| 5457 | + if (propValue['@@toStringTag'] === 'Symbol') { | |
| 5458 | + return true; | |
| 5459 | + } | |
| 4290 | 5460 | |
| 4291 | -//#endregion | |
| 4292 | -//#region modules/ai/assets/js/editor/pages/form-layout/components/attachments/library-dialog.js | |
| 4293 | - var import_prop_types$20, LibraryDialog; | |
| 4294 | - var init_library_dialog = __esmMin((() => { | |
| 4295 | - import_prop_types$20 = /* @__PURE__ */ __toESM(require_prop_types()); | |
| 4296 | - init_attachments(); | |
| 4297 | - LibraryDialog = function LibraryDialog(props) { | |
| 4298 | - var isApplyingTemplate = (0, react.useRef)(false); | |
| 4299 | - (0, react.useEffect)(function() { | |
| 4300 | - var onLibraryHide = function onLibraryHide() { | |
| 4301 | - if (isApplyingTemplate.current) return; | |
| 4302 | - props.onClose(); | |
| 4303 | - }; | |
| 4304 | - $e.components.get("library").layout.getModal().on("hide", onLibraryHide); | |
| 4305 | - return function() { | |
| 4306 | - $e.components.get("library").layout.getModal().off("hide", onLibraryHide); | |
| 4307 | - }; | |
| 4308 | - }, [props]); | |
| 4309 | - (0, react.useEffect)(function() { | |
| 4310 | - var onMessage = function onMessage(event) { | |
| 4311 | - var _event$data = event.data; | |
| 4312 | - var type = _event$data.type; | |
| 4313 | - var json = _event$data.json; | |
| 4314 | - var html = _event$data.html; | |
| 4315 | - var label = _event$data.label; | |
| 4316 | - var source = _event$data.source; | |
| 4317 | - switch (type) { | |
| 4318 | - case "library/attach:start": | |
| 4319 | - isApplyingTemplate.current = true; | |
| 4320 | - break; | |
| 4321 | - case "library/attach": | |
| 4322 | - props.onAttach([{ | |
| 4323 | - type: ATTACHMENT_TYPE_JSON, | |
| 4324 | - previewHTML: html, | |
| 4325 | - content: json, | |
| 4326 | - label, | |
| 4327 | - source | |
| 4328 | - }]); | |
| 4329 | - isApplyingTemplate.current = false; | |
| 4330 | - props.onClose(); | |
| 4331 | - break; | |
| 4332 | - } | |
| 4333 | - }; | |
| 4334 | - window.addEventListener("message", onMessage); | |
| 4335 | - return function() { | |
| 4336 | - window.removeEventListener("message", onMessage); | |
| 4337 | - }; | |
| 4338 | - }); | |
| 4339 | - $e.run("library/open", { | |
| 4340 | - toDefault: true, | |
| 4341 | - mode: "ai-attachment" | |
| 4342 | - }); | |
| 4343 | - isApplyingTemplate.current = false; | |
| 4344 | - return null; | |
| 4345 | - }; | |
| 4346 | - LibraryDialog.propTypes = { | |
| 4347 | - onAttach: import_prop_types$20.default.func.isRequired, | |
| 4348 | - onClose: import_prop_types$20.default.func.isRequired | |
| 4349 | - }; | |
| 4350 | - })); | |
| 5461 | + // Fallback for non-spec compliant Symbols which are polyfilled. | |
| 5462 | + if (typeof Symbol === 'function' && propValue instanceof Symbol) { | |
| 5463 | + return true; | |
| 5464 | + } | |
| 4351 | 5465 | |
| 4352 | -//#endregion | |
| 4353 | -//#region modules/ai/assets/js/editor/pages/form-layout/components/attachments/attach-dialog.js | |
| 4354 | - var import_prop_types$19, AttachDialog; | |
| 4355 | - var init_attach_dialog = __esmMin((() => { | |
| 4356 | - init_url_dialog(); | |
| 4357 | - import_prop_types$19 = /* @__PURE__ */ __toESM(require_prop_types()); | |
| 4358 | - init_library_dialog(); | |
| 4359 | - init_attachments(); | |
| 4360 | - AttachDialog = function AttachDialog(props) { | |
| 4361 | - var type = props.type; | |
| 4362 | - var url = props.url; | |
| 4363 | - switch (type) { | |
| 4364 | - case "url": return /*#__PURE__*/ react.default.createElement(UrlDialog, { | |
| 4365 | - url, | |
| 4366 | - onAttach: props.onAttach, | |
| 4367 | - onClose: props.onClose | |
| 4368 | - }); | |
| 4369 | - case MENU_TYPE_LIBRARY: return /*#__PURE__*/ react.default.createElement(LibraryDialog, { | |
| 4370 | - onAttach: props.onAttach, | |
| 4371 | - onClose: props.onClose | |
| 4372 | - }); | |
| 4373 | - } | |
| 4374 | - return null; | |
| 4375 | - }; | |
| 4376 | - AttachDialog.propTypes = { | |
| 4377 | - type: import_prop_types$19.default.string, | |
| 4378 | - onAttach: import_prop_types$19.default.func, | |
| 4379 | - onClose: import_prop_types$19.default.func, | |
| 4380 | - url: import_prop_types$19.default.string | |
| 4381 | - }; | |
| 4382 | - })); | |
| 5466 | + return false; | |
| 5467 | + } | |
| 4383 | 5468 | |
| 4384 | -//#endregion | |
| 4385 | -//#region modules/ai/assets/js/editor/hooks/use-introduction.js | |
| 4386 | - function useIntroduction(key) { | |
| 4387 | - var _window$elementor$con; | |
| 4388 | - var _window$elementorAdmi; | |
| 4389 | - var _globalConfig$introdu; | |
| 4390 | - var globalConfig = window.elementor ? (_window$elementor$con = window.elementor.config) === null || _window$elementor$con === void 0 ? void 0 : _window$elementor$con.user : (_window$elementorAdmi = window.elementorAdmin) === null || _window$elementorAdmi === void 0 || (_window$elementorAdmi = _window$elementorAdmi.config) === null || _window$elementorAdmi === void 0 ? void 0 : _window$elementorAdmi.user; | |
| 4391 | - var _useState2 = _slicedToArray((0, react.useState)(!!(globalConfig !== null && globalConfig !== void 0 && (_globalConfig$introdu = globalConfig.introduction) !== null && _globalConfig$introdu !== void 0 && _globalConfig$introdu[key])), 2); | |
| 4392 | - var isViewed = _useState2[0]; | |
| 4393 | - var setIsViewed = _useState2[1]; | |
| 4394 | - function markAsViewed() { | |
| 4395 | - if (!key) return Promise.reject(); | |
| 4396 | - return new Promise(function(resolve, reject) { | |
| 4397 | - if (isViewed) reject(); | |
| 4398 | - setIsViewed(true); | |
| 4399 | - elementorCommon.ajax.addRequest("introduction_viewed", { | |
| 4400 | - data: { introductionKey: key }, | |
| 4401 | - error: function error() { | |
| 4402 | - setIsViewed(false); | |
| 4403 | - reject(); | |
| 4404 | - }, | |
| 4405 | - success: function success() { | |
| 4406 | - setIsViewed(true); | |
| 4407 | - if (globalConfig !== null && globalConfig !== void 0 && globalConfig.introduction) globalConfig.introduction[key] = true; | |
| 4408 | - resolve(); | |
| 4409 | - } | |
| 4410 | - }); | |
| 4411 | - }); | |
| 4412 | - } | |
| 4413 | - return { | |
| 4414 | - isViewed, | |
| 4415 | - markAsViewed | |
| 4416 | - }; | |
| 4417 | - } | |
| 4418 | - var init_use_introduction = __esmMin((() => { | |
| 4419 | - init_slicedToArray(); | |
| 4420 | - })); | |
| 5469 | + // Equivalent of `typeof` but with special handling for array and regexp. | |
| 5470 | + function getPropType(propValue) { | |
| 5471 | + var propType = typeof propValue; | |
| 5472 | + if (Array.isArray(propValue)) { | |
| 5473 | + return 'array'; | |
| 5474 | + } | |
| 5475 | + if (propValue instanceof RegExp) { | |
| 5476 | + // Old webkits (at least until Android 4.0) return 'function' rather than | |
| 5477 | + // 'object' for typeof a RegExp. We'll normalize this here so that /bla/ | |
| 5478 | + // passes PropTypes.object. | |
| 5479 | + return 'object'; | |
| 5480 | + } | |
| 5481 | + if (isSymbol(propType, propValue)) { | |
| 5482 | + return 'symbol'; | |
| 5483 | + } | |
| 5484 | + return propType; | |
| 5485 | + } | |
| 4421 | 5486 | |
| 4422 | -//#endregion | |
| 4423 | -//#region modules/ai/assets/js/editor/pages/form-layout/components/attachments/menu.js | |
| 4424 | - var import_prop_types$18, Menu; | |
| 4425 | - var init_menu = __esmMin((() => { | |
| 4426 | - init_slicedToArray(); | |
| 4427 | - init_x_circle_icon(); | |
| 4428 | - init_plus_circle_icon(); | |
| 4429 | - import_prop_types$18 = /* @__PURE__ */ __toESM(require_prop_types()); | |
| 4430 | - init_attach_dialog(); | |
| 4431 | - init_use_introduction(); | |
| 4432 | - Menu = function Menu(props) { | |
| 4433 | - var _useState2 = _slicedToArray((0, react.useState)(false), 2); | |
| 4434 | - var isOpen = _useState2[0]; | |
| 4435 | - var setIsOpen = _useState2[1]; | |
| 4436 | - var _useState4 = _slicedToArray((0, react.useState)(null), 2); | |
| 4437 | - var selectedType = _useState4[0]; | |
| 4438 | - var setSelectedType = _useState4[1]; | |
| 4439 | - var direction = (0, _elementor_ui.useTheme)().direction; | |
| 4440 | - var anchorRef = (0, react.useRef)(null); | |
| 4441 | - var _useIntroduction = useIntroduction("e-ai-attachment-badge"); | |
| 4442 | - var isViewed = _useIntroduction.isViewed; | |
| 4443 | - var markAsViewed = _useIntroduction.markAsViewed; | |
| 4444 | - return /*#__PURE__*/ react.default.createElement(react.default.Fragment, null, /*#__PURE__*/ react.default.createElement(_elementor_ui.IconButton, { | |
| 4445 | - size: "small", | |
| 4446 | - ref: anchorRef, | |
| 4447 | - disabled: props.disabled, | |
| 4448 | - onClick: function onClick() { | |
| 4449 | - setIsOpen(true); | |
| 4450 | - if (!isViewed) markAsViewed(); | |
| 4451 | - }, | |
| 4452 | - color: "secondary" | |
| 4453 | - }, function() { | |
| 4454 | - if (isOpen) return /*#__PURE__*/ react.default.createElement(XCircleIcon, { fontSize: "small" }); | |
| 4455 | - else if (isViewed) return /*#__PURE__*/ react.default.createElement(PlusCircleIcon, { fontSize: "small" }); | |
| 4456 | - return /*#__PURE__*/ react.default.createElement(_elementor_ui.Badge, { | |
| 4457 | - color: "primary", | |
| 4458 | - badgeContent: " ", | |
| 4459 | - variant: "dot" | |
| 4460 | - }, /*#__PURE__*/ react.default.createElement(PlusCircleIcon, { fontSize: "small" })); | |
| 4461 | - }()), /*#__PURE__*/ react.default.createElement(_elementor_ui.Popover, { | |
| 4462 | - open: isOpen, | |
| 4463 | - anchorEl: anchorRef.current, | |
| 4464 | - onClose: function onClose() { | |
| 4465 | - return setIsOpen(false); | |
| 4466 | - }, | |
| 4467 | - anchorOrigin: { | |
| 4468 | - vertical: "bottom", | |
| 4469 | - horizontal: "rtl" === direction ? "right" : "left" | |
| 4470 | - }, | |
| 4471 | - transformOrigin: { | |
| 4472 | - vertical: "top", | |
| 4473 | - horizontal: "rtl" === direction ? "right" : "left" | |
| 4474 | - } | |
| 4475 | - }, /*#__PURE__*/ react.default.createElement(_elementor_ui.Stack, { sx: { width: 440 } }, props.items.map(function(item) { | |
| 4476 | - var IconComponent = item.icon; | |
| 4477 | - return /*#__PURE__*/ react.default.createElement(_elementor_ui.MenuItem, { | |
| 4478 | - key: item.type, | |
| 4479 | - onClick: function onClick() { | |
| 4480 | - setSelectedType(item.type); | |
| 4481 | - setIsOpen(false); | |
| 4482 | - } | |
| 4483 | - }, /*#__PURE__*/ react.default.createElement(_elementor_ui.ListItemIcon, null, /*#__PURE__*/ react.default.createElement(IconComponent, null)), item.title); | |
| 4484 | - }))), /*#__PURE__*/ react.default.createElement(AttachDialog, { | |
| 4485 | - type: selectedType, | |
| 4486 | - onAttach: props.onAttach, | |
| 4487 | - onClose: function onClose() { | |
| 4488 | - setIsOpen(false); | |
| 4489 | - setSelectedType(null); | |
| 4490 | - } | |
| 4491 | - })); | |
| 4492 | - }; | |
| 4493 | - Menu.propTypes = { | |
| 4494 | - items: import_prop_types$18.default.arrayOf(import_prop_types$18.default.shape({ | |
| 4495 | - title: import_prop_types$18.default.string.isRequired, | |
| 4496 | - type: import_prop_types$18.default.string.isRequired, | |
| 4497 | - icon: import_prop_types$18.default.elementType | |
| 4498 | - })).isRequired, | |
| 4499 | - onAttach: import_prop_types$18.default.func.isRequired, | |
| 4500 | - disabled: import_prop_types$18.default.bool | |
| 4501 | - }; | |
| 4502 | - })); | |
| 5487 | + // This handles more types than `getPropType`. Only used for error messages. | |
| 5488 | + // See `createPrimitiveTypeChecker`. | |
| 5489 | + function getPreciseType(propValue) { | |
| 5490 | + if (typeof propValue === 'undefined' || propValue === null) { | |
| 5491 | + return '' + propValue; | |
| 5492 | + } | |
| 5493 | + var propType = getPropType(propValue); | |
| 5494 | + if (propType === 'object') { | |
| 5495 | + if (propValue instanceof Date) { | |
| 5496 | + return 'date'; | |
| 5497 | + } else if (propValue instanceof RegExp) { | |
| 5498 | + return 'regexp'; | |
| 5499 | + } | |
| 5500 | + } | |
| 5501 | + return propType; | |
| 5502 | + } | |
| 4503 | 5503 | |
| 4504 | -//#endregion | |
| 4505 | -//#region node_modules/@babel/runtime/helpers/esm/taggedTemplateLiteral.js | |
| 4506 | - function _taggedTemplateLiteral(e, t) { | |
| 4507 | - return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, { raw: { value: Object.freeze(t) } })); | |
| 4508 | - } | |
| 4509 | - var init_taggedTemplateLiteral = __esmMin((() => {})); | |
| 5504 | + // Returns a string that is postfixed to a warning about an invalid type. | |
| 5505 | + // For example, "undefined" or "of type array" | |
| 5506 | + function getPostfixForTypeWarning(value) { | |
| 5507 | + var type = getPreciseType(value); | |
| 5508 | + switch (type) { | |
| 5509 | + case 'array': | |
| 5510 | + case 'object': | |
| 5511 | + return 'an ' + type; | |
| 5512 | + case 'boolean': | |
| 5513 | + case 'date': | |
| 5514 | + case 'regexp': | |
| 5515 | + return 'a ' + type; | |
| 5516 | + default: | |
| 5517 | + return type; | |
| 5518 | + } | |
| 5519 | + } | |
| 4510 | 5520 | |
| 4511 | -//#endregion | |
| 4512 | -//#region modules/ai/assets/js/editor/pages/form-layout/components/attachments/thumbnail.js | |
| 4513 | - var import_prop_types$17, _templateObject, THUMBNAIL_SIZE, StyledBody, Thumbnail; | |
| 4514 | - var init_thumbnail = __esmMin((() => { | |
| 4515 | - init_taggedTemplateLiteral(); | |
| 4516 | - import_prop_types$17 = /* @__PURE__ */ __toESM(require_prop_types()); | |
| 4517 | - ; | |
| 4518 | - THUMBNAIL_SIZE = 64; | |
| 4519 | - StyledBody = (0, _elementor_ui.styled)("body")(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n html, body {\n margin: 0;\n padding: 0;\n overflow: hidden;\n }\n\n body > * {\n width: 100% !important;\n }\n\n body > img {\n height: 100%;\n object-fit: cover;\n }\n\n body:has(> img) {\n height: ", "px\n }\n"])), 64); | |
| 4520 | - Thumbnail = function Thumbnail(props) { | |
| 4521 | - var _props$html$match; | |
| 4522 | - var _props$html$match2; | |
| 4523 | - var dataWidth = (_props$html$match = props.html.match("data-width=\"(?<width>\\d+)\"")) === null || _props$html$match === void 0 || (_props$html$match = _props$html$match.groups) === null || _props$html$match === void 0 ? void 0 : _props$html$match.width; | |
| 4524 | - var dataHeight = (_props$html$match2 = props.html.match("data-height=\"(?<height>\\d+)\"")) === null || _props$html$match2 === void 0 || (_props$html$match2 = _props$html$match2.groups) === null || _props$html$match2 === void 0 ? void 0 : _props$html$match2.height; | |
| 4525 | - var width = dataWidth ? parseInt(dataWidth) : 64; | |
| 4526 | - var height = dataHeight ? parseInt(dataHeight) : 64; | |
| 4527 | - var scale = 64 / Math.min(height, width); | |
| 4528 | - var top = height > width ? (64 - 64 * (height / width)) / 2 : 0; | |
| 4529 | - var left = width > height ? (64 - 64 * (width / height)) / 2 : 0; | |
| 4530 | - return /*#__PURE__*/ react.default.createElement(_elementor_ui.Box, { | |
| 4531 | - dir: "ltr", | |
| 4532 | - sx: { | |
| 4533 | - position: "relative", | |
| 4534 | - cursor: "default", | |
| 4535 | - overflow: "hidden", | |
| 4536 | - border: "1px solid", | |
| 4537 | - borderColor: "grey.300", | |
| 4538 | - borderRadius: 1, | |
| 4539 | - boxSizing: "border-box", | |
| 4540 | - width: 64, | |
| 4541 | - height: 64, | |
| 4542 | - opacity: props.disabled ? .5 : 1 | |
| 4543 | - } | |
| 4544 | - }, /*#__PURE__*/ react.default.createElement("iframe", { | |
| 4545 | - title: (0, _wordpress_i18n.__)("Preview", "elementor"), | |
| 4546 | - sandbox: "", | |
| 4547 | - srcDoc: "<style>" + StyledBody.componentStyle.rules.join("") + "</style>" + props.html, | |
| 4548 | - style: { | |
| 4549 | - border: "none", | |
| 4550 | - overflow: "hidden", | |
| 4551 | - width, | |
| 4552 | - height, | |
| 4553 | - transform: "scale(".concat(scale, ")"), | |
| 4554 | - transformOrigin: "".concat(left, "px ").concat(top, "px") | |
| 4555 | - } | |
| 4556 | - })); | |
| 4557 | - }; | |
| 4558 | - Thumbnail.propTypes = { | |
| 4559 | - html: import_prop_types$17.default.string.isRequired, | |
| 4560 | - disabled: import_prop_types$17.default.bool | |
| 4561 | - }; | |
| 4562 | - })); | |
| 5521 | + // Returns class name of the object, if any. | |
| 5522 | + function getClassName(propValue) { | |
| 5523 | + if (!propValue.constructor || !propValue.constructor.name) { | |
| 5524 | + return ANONYMOUS; | |
| 5525 | + } | |
| 5526 | + return propValue.constructor.name; | |
| 5527 | + } | |
| 4563 | 5528 | |
| 4564 | -//#endregion | |
| 4565 | -//#region modules/ai/assets/js/editor/types/attachment.js | |
| 4566 | - var import_prop_types$16, AttachmentPropType, AttachmentsTypesPropType; | |
| 4567 | - var init_attachment = __esmMin((() => { | |
| 4568 | - import_prop_types$16 = /* @__PURE__ */ __toESM(require_prop_types()); | |
| 4569 | - AttachmentPropType = import_prop_types$16.default.shape({ | |
| 4570 | - type: import_prop_types$16.default.string, | |
| 4571 | - previewHTML: import_prop_types$16.default.string, | |
| 4572 | - content: import_prop_types$16.default.string, | |
| 4573 | - label: import_prop_types$16.default.string, | |
| 4574 | - source: import_prop_types$16.default.string | |
| 4575 | - }); | |
| 4576 | - AttachmentsTypesPropType = import_prop_types$16.default.shape({ type: import_prop_types$16.default.shape({ | |
| 4577 | - promptPlaceholder: import_prop_types$16.default.string, | |
| 4578 | - promptSuggestions: import_prop_types$16.default.arrayOf(import_prop_types$16.default.shape({ text: import_prop_types$16.default.string.isRequired })), | |
| 4579 | - previewGenerator: import_prop_types$16.default.func | |
| 4580 | - }) }); | |
| 4581 | - })); | |
| 5529 | + ReactPropTypes.checkPropTypes = checkPropTypes; | |
| 5530 | + ReactPropTypes.resetWarningCache = checkPropTypes.resetWarningCache; | |
| 5531 | + ReactPropTypes.PropTypes = ReactPropTypes; | |
| 4582 | 5532 | |
| 4583 | -//#endregion | |
| 4584 | -//#region modules/ai/assets/js/editor/pages/form-layout/components/attachments/thumbnail-json.js | |
| 4585 | - var import_prop_types$15, ThumbnailJson; | |
| 4586 | - var init_thumbnail_json = __esmMin((() => { | |
| 4587 | - init_thumbnail(); | |
| 4588 | - import_prop_types$15 = /* @__PURE__ */ __toESM(require_prop_types()); | |
| 4589 | - init_attachment(); | |
| 4590 | - ThumbnailJson = function ThumbnailJson(props) { | |
| 4591 | - var _props$attachments; | |
| 4592 | - var attachment = (_props$attachments = props.attachments) === null || _props$attachments === void 0 ? void 0 : _props$attachments.find(function(item) { | |
| 4593 | - return "json" === item.type; | |
| 4594 | - }); | |
| 4595 | - if (!attachment) return null; | |
| 4596 | - if (!attachment.previewHTML) return /*#__PURE__*/ react.default.createElement(_elementor_ui.Skeleton, { | |
| 4597 | - animation: "wave", | |
| 4598 | - variant: "rounded", | |
| 4599 | - width: 60, | |
| 4600 | - height: 60 | |
| 4601 | - }); | |
| 4602 | - return /*#__PURE__*/ react.default.createElement(Thumbnail, { | |
| 4603 | - html: attachment.previewHTML, | |
| 4604 | - disabled: props.disabled | |
| 4605 | - }); | |
| 4606 | - }; | |
| 4607 | - ThumbnailJson.propTypes = { | |
| 4608 | - attachments: import_prop_types$15.default.arrayOf(AttachmentPropType).isRequired, | |
| 4609 | - disabled: import_prop_types$15.default.bool | |
| 4610 | - }; | |
| 4611 | - })); | |
| 5533 | + return ReactPropTypes; | |
| 5534 | +}; | |
| 4612 | 5535 | |
| 4613 | -//#endregion | |
| 4614 | -//#region modules/ai/assets/js/editor/pages/form-layout/components/attachments/thumbnail-url.js | |
| 4615 | - var import_prop_types$14, ThumbnailUrl; | |
| 4616 | - var init_thumbnail_url = __esmMin((() => { | |
| 4617 | - init_thumbnail(); | |
| 4618 | - import_prop_types$14 = /* @__PURE__ */ __toESM(require_prop_types()); | |
| 4619 | - init_attachment(); | |
| 4620 | - ThumbnailUrl = function ThumbnailUrl(props) { | |
| 4621 | - var _props$attachments; | |
| 4622 | - var attachment = (_props$attachments = props.attachments) === null || _props$attachments === void 0 ? void 0 : _props$attachments.find(function(item) { | |
| 4623 | - return "url" === item.type; | |
| 4624 | - }); | |
| 4625 | - if (!attachment) return null; | |
| 4626 | - return /*#__PURE__*/ react.default.createElement(_elementor_ui.Box, { sx: { | |
| 4627 | - position: "relative", | |
| 4628 | - "&:hover::before": { | |
| 4629 | - content: "\"\"", | |
| 4630 | - position: "absolute", | |
| 4631 | - userSelect: "none", | |
| 4632 | - inset: 0, | |
| 4633 | - backgroundColor: "rgba(0,0,0,0.6)", | |
| 4634 | - borderRadius: 1, | |
| 4635 | - zIndex: 1 | |
| 4636 | - }, | |
| 4637 | - "&:hover .remove-attachment": { display: "flex" } | |
| 4638 | - } }, /*#__PURE__*/ react.default.createElement(_elementor_ui.IconButton, { | |
| 4639 | - className: "remove-attachment", | |
| 4640 | - size: "small", | |
| 4641 | - "aria-label": (0, _wordpress_i18n.__)("Remove", "elementor"), | |
| 4642 | - disabled: props.disabled, | |
| 4643 | - onClick: function onClick(event) { | |
| 4644 | - event.stopPropagation(); | |
| 4645 | - props.onDetach(); | |
| 4646 | - }, | |
| 4647 | - sx: { | |
| 4648 | - display: "none", | |
| 4649 | - position: "absolute", | |
| 4650 | - insetInlineEnd: 4, | |
| 4651 | - insetBlockStart: 4, | |
| 4652 | - backgroundColor: "secondary.main", | |
| 4653 | - zIndex: 1, | |
| 4654 | - borderRadius: 1, | |
| 4655 | - p: "3px", | |
| 4656 | - "&:hover": { backgroundColor: "secondary.dark" } | |
| 4657 | - } | |
| 4658 | - }, /*#__PURE__*/ react.default.createElement(_elementor_icons.TrashIcon, { sx: { | |
| 4659 | - fontSize: "1.125rem", | |
| 4660 | - color: "common.white" | |
| 4661 | - } })), /*#__PURE__*/ react.default.createElement(Thumbnail, { | |
| 4662 | - disabled: props.disabled, | |
| 4663 | - html: attachment.previewHTML | |
| 4664 | - })); | |
| 4665 | - }; | |
| 4666 | - ThumbnailUrl.propTypes = { | |
| 4667 | - attachments: import_prop_types$14.default.arrayOf(AttachmentPropType).isRequired, | |
| 4668 | - disabled: import_prop_types$14.default.bool, | |
| 4669 | - onDetach: import_prop_types$14.default.func | |
| 4670 | - }; | |
| 4671 | - })); | |
| 4672 | 5536 | |
| 4673 | -//#endregion | |
| 4674 | -//#region modules/ai/assets/js/editor/icons/website-icon.js | |
| 4675 | - var WebsiteIcon; | |
| 4676 | - var init_website_icon = __esmMin((() => { | |
| 4677 | - init_extends(); | |
| 4678 | - WebsiteIcon = react.default.forwardRef(function(props, ref) { | |
| 4679 | - return /*#__PURE__*/ react.default.createElement(_elementor_ui.SvgIcon, _extends({ viewBox: "0 0 24 24" }, props, { ref }), /*#__PURE__*/ react.default.createElement("path", { | |
| 4680 | - fillRule: "evenodd", | |
| 4681 | - clipRule: "evenodd", | |
| 4682 | - d: "M4.16707 3.95837C4.11182 3.95837 4.05883 3.98032 4.01976 4.01939C3.98069 4.05846 3.95874 4.11145 3.95874 4.16671V6.04171H6.04207V3.95837H4.16707ZM4.16707 2.70837C3.7803 2.70837 3.40937 2.86202 3.13588 3.13551C2.86239 3.409 2.70874 3.77993 2.70874 4.16671V15.8334C2.70874 16.2201 2.86239 16.5911 3.13588 16.8646C3.40937 17.1381 3.7803 17.2917 4.16707 17.2917H15.8337C16.2205 17.2917 16.5914 17.1381 16.8649 16.8646C17.1384 16.5911 17.2921 16.2201 17.2921 15.8334V4.16671C17.2921 3.77993 17.1384 3.409 16.8649 3.13551C16.5914 2.86202 16.2205 2.70837 15.8337 2.70837H4.16707ZM7.29207 3.95837V6.04171H16.0421V4.16671C16.0421 4.11145 16.0201 4.05846 15.9811 4.01939C15.942 3.98032 15.889 3.95837 15.8337 3.95837H7.29207ZM16.0421 7.29171H3.95874V15.8334C3.95874 15.8886 3.98069 15.9416 4.01976 15.9807C4.05883 16.0198 4.11182 16.0417 4.16707 16.0417H15.8337C15.889 16.0417 15.942 16.0198 15.9811 15.9807C16.0201 15.9416 16.0421 15.8886 16.0421 15.8334V7.29171Z" | |
| 4683 | - })); | |
| 4684 | - }); | |
| 4685 | - })); | |
| 5537 | +/***/ }), | |
| 4686 | 5538 | |
| 4687 | -//#endregion | |
| 4688 | -//#region modules/ai/assets/js/editor/icons/copy-page-icon.js | |
| 4689 | - var CopyPageIcon; | |
| 4690 | - var init_copy_page_icon = __esmMin((() => { | |
| 4691 | - init_extends(); | |
| 4692 | - CopyPageIcon = react.default.forwardRef(function(props, ref) { | |
| 4693 | - return /*#__PURE__*/ react.default.createElement(_elementor_ui.SvgIcon, _extends({ viewBox: "0 0 24 24" }, props, { ref }), /*#__PURE__*/ react.default.createElement("path", { | |
| 4694 | - fillRule: "evenodd", | |
| 4695 | - clipRule: "evenodd", | |
| 4696 | - d: "M16.6667 0.208496C17.0534 0.208496 17.4244 0.362142 17.6979 0.635632C17.9714 0.909123 18.125 1.28006 18.125 1.66683V11.6668C18.125 12.0536 17.9714 12.4245 17.6979 12.698C17.4244 12.9715 17.0534 13.1252 16.6667 13.1252H14.7917V16.6668C14.7917 17.0536 14.638 17.4245 14.3645 17.698C14.091 17.9715 13.7201 18.1252 13.3333 18.1252H3.33333C2.94656 18.1252 2.57563 17.9715 2.30214 17.698C2.02865 17.4245 1.875 17.0536 1.875 16.6668V6.66683C1.875 6.28005 2.02865 5.90912 2.30214 5.63563C2.57563 5.36214 2.94656 5.2085 3.33333 5.2085H5.20833V1.66683C5.20833 1.28005 5.36198 0.909122 5.63547 0.635632C5.90896 0.362142 6.27989 0.208496 6.66667 0.208496H16.6667ZM6.66667 1.4585C6.61141 1.4585 6.55842 1.48045 6.51935 1.51952C6.48028 1.55859 6.45833 1.61158 6.45833 1.66683V3.54183H8.54167V1.4585H6.66667ZM3.125 9.79183V16.6668C3.125 16.7221 3.14695 16.7751 3.18602 16.8141C3.22509 16.8532 3.27808 16.8752 3.33333 16.8752H13.3333C13.3886 16.8752 13.4416 16.8532 13.4806 16.8141C13.5197 16.7751 13.5417 16.7221 13.5417 16.6668V13.1252H6.66667C6.27989 13.1252 5.90896 12.9715 5.63547 12.698C5.36198 12.4245 5.20833 12.0536 5.20833 11.6668V9.79183H3.125ZM5.20833 8.54183H3.125V6.66683C3.125 6.61158 3.14695 6.55859 3.18602 6.51952C3.22509 6.48045 3.27808 6.4585 3.33333 6.4585H5.20833V8.54183ZM6.45833 11.6668C6.45833 11.7221 6.48028 11.7751 6.51935 11.8141C6.55842 11.8532 6.61141 11.8752 6.66667 11.8752H16.6667C16.7219 11.8752 16.7749 11.8532 16.814 11.8141C16.853 11.7751 16.875 11.7221 16.875 11.6668V4.79183H6.45833V11.6668ZM9.79167 1.4585V3.54183H16.875V1.66683C16.875 1.61157 16.853 1.55858 16.814 1.51952C16.7749 1.48045 16.7219 1.4585 16.6667 1.4585H9.79167Z" | |
| 4697 | - })); | |
| 4698 | - }); | |
| 4699 | - })); | |
| 5539 | +/***/ "../node_modules/prop-types/index.js": | |
| 5540 | +/*!*******************************************!*\ | |
| 5541 | + !*** ../node_modules/prop-types/index.js ***! | |
| 5542 | + \*******************************************/ | |
| 5543 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 4700 | 5544 | |
| 4701 | -//#endregion | |
| 4702 | -//#region modules/ai/assets/js/editor/pages/form-layout/components/attachments.js | |
| 4703 | - var attachments_exports = /* @__PURE__ */ __exportAll({ | |
| 4704 | - ATTACHMENT_TYPE_JSON: () => ATTACHMENT_TYPE_JSON, | |
| 4705 | - ATTACHMENT_TYPE_URL: () => "url", | |
| 4706 | - ELEMENTOR_LIBRARY_SOURCE: () => ELEMENTOR_LIBRARY_SOURCE, | |
| 4707 | - MENU_TYPE_LIBRARY: () => MENU_TYPE_LIBRARY, | |
| 4708 | - USER_URL_SOURCE: () => USER_URL_SOURCE, | |
| 4709 | - USER_VARIATION_SOURCE: () => USER_VARIATION_SOURCE, | |
| 4710 | - default: () => Attachments | |
| 4711 | - }); | |
| 4712 | - var import_prop_types$13, ATTACHMENT_TYPE_JSON, ATTACHMENT_TYPE_URL, MENU_TYPE_LIBRARY, USER_VARIATION_SOURCE, ELEMENTOR_LIBRARY_SOURCE, USER_URL_SOURCE, Attachments; | |
| 4713 | - var init_attachments = __esmMin((() => { | |
| 4714 | - init_extends(); | |
| 4715 | - init_menu(); | |
| 4716 | - init_thumbnail_json(); | |
| 4717 | - init_thumbnail_url(); | |
| 4718 | - init_website_icon(); | |
| 4719 | - init_copy_page_icon(); | |
| 4720 | - import_prop_types$13 = /* @__PURE__ */ __toESM(require_prop_types()); | |
| 4721 | - init_attachment(); | |
| 4722 | - ATTACHMENT_TYPE_JSON = "json"; | |
| 4723 | - ATTACHMENT_TYPE_URL = "url"; | |
| 4724 | - MENU_TYPE_LIBRARY = "library"; | |
| 4725 | - USER_VARIATION_SOURCE = "user-variation"; | |
| 4726 | - ELEMENTOR_LIBRARY_SOURCE = "elementor-library"; | |
| 4727 | - USER_URL_SOURCE = "user-url"; | |
| 4728 | - Attachments = function Attachments(props) { | |
| 4729 | - if (!props.attachments.length) return /*#__PURE__*/ react.default.createElement(Menu, { | |
| 4730 | - disabled: props.disabled, | |
| 4731 | - onAttach: props.onAttach, | |
| 4732 | - items: [{ | |
| 4733 | - title: (0, _wordpress_i18n.__)("Reference a website", "elementor"), | |
| 4734 | - icon: WebsiteIcon, | |
| 4735 | - type: "url" | |
| 4736 | - }, { | |
| 4737 | - title: (0, _wordpress_i18n.__)("Create variations from Template Library", "elementor"), | |
| 4738 | - icon: CopyPageIcon, | |
| 4739 | - type: MENU_TYPE_LIBRARY | |
| 4740 | - }] | |
| 4741 | - }); | |
| 4742 | - return /*#__PURE__*/ react.default.createElement(_elementor_ui.Stack, { | |
| 4743 | - direction: "row", | |
| 4744 | - spacing: 1 | |
| 4745 | - }, props.attachments.map(function(attachment, index) { | |
| 4746 | - switch (attachment.type) { | |
| 4747 | - case ATTACHMENT_TYPE_JSON: return /*#__PURE__*/ react.default.createElement(ThumbnailJson, _extends({ key: index }, props)); | |
| 4748 | - case "url": return /*#__PURE__*/ react.default.createElement(ThumbnailUrl, _extends({ key: index }, props)); | |
| 4749 | - default: return null; | |
| 4750 | - } | |
| 4751 | - })); | |
| 4752 | - }; | |
| 4753 | - Attachments.propTypes = { | |
| 4754 | - attachments: import_prop_types$13.default.arrayOf(AttachmentPropType).isRequired, | |
| 4755 | - onAttach: import_prop_types$13.default.func.isRequired, | |
| 4756 | - onDetach: import_prop_types$13.default.func, | |
| 4757 | - disabled: import_prop_types$13.default.bool | |
| 4758 | - }; | |
| 4759 | - })); | |
| 5545 | +/** | |
| 5546 | + * Copyright (c) 2013-present, Facebook, Inc. | |
| 5547 | + * | |
| 5548 | + * This source code is licensed under the MIT license found in the | |
| 5549 | + * LICENSE file in the root directory of this source tree. | |
| 5550 | + */ | |
| 4760 | 5551 | |
| 4761 | -//#endregion | |
| 4762 | -//#region modules/ai/assets/js/editor/pages/form-layout/components/prompt-form.js | |
| 4763 | - var import_prop_types$12, _excluded$3, PROMPT_SUGGESTIONS, IconButtonWithTooltip, BackButton, EditButton, GenerateButton, PromptForm; | |
| 4764 | - var init_prompt_form = __esmMin((() => { | |
| 4765 | - init_slicedToArray(); | |
| 4766 | - init_extends(); | |
| 4767 | - init_objectWithoutProperties$1(); | |
| 4768 | - import_prop_types$12 = /* @__PURE__ */ __toESM(require_prop_types()); | |
| 4769 | - init_prompt_autocomplete(); | |
| 4770 | - init_enhance_button(); | |
| 4771 | - init_generate_submit(); | |
| 4772 | - init_arrow_left_icon(); | |
| 4773 | - init_edit_icon(); | |
| 4774 | - init_use_prompt_enhancer(); | |
| 4775 | - init_attachments(); | |
| 4776 | - init_config(); | |
| 4777 | - init_attachment(); | |
| 4778 | - _excluded$3 = ["tooltip"]; | |
| 4779 | - PROMPT_SUGGESTIONS = Object.freeze([ | |
| 4780 | - { text: (0, _wordpress_i18n.__)("Hero section on [topic] with heading, text, buttons on the right, and an image on the left", "elementor.com") }, | |
| 4781 | - { text: (0, _wordpress_i18n.__)("About Us section on [topic] with heading, text, and big image below", "elementor.com") }, | |
| 4782 | - { text: (0, _wordpress_i18n.__)("Team section with four image boxes showcasing team members", "elementor.com") }, | |
| 4783 | - { text: (0, _wordpress_i18n.__)("FAQ section with a toggle widget showcasing FAQs about [topic]", "elementor.com") }, | |
| 4784 | - { text: (0, _wordpress_i18n.__)("Gallery section with a carousel displaying three images at once", "elementor.com") }, | |
| 4785 | - { text: (0, _wordpress_i18n.__)("Contact section with a form for [topic]", "elementor.com") }, | |
| 4786 | - { text: (0, _wordpress_i18n.__)("Client section featuring companies' logos", "elementor.com") }, | |
| 4787 | - { text: (0, _wordpress_i18n.__)("Testimonial section with testimonials, each featuring a star rating and an image", "elementor.com") }, | |
| 4788 | - { text: (0, _wordpress_i18n.__)("Service section about [topic], showcasing four services with buttons", "elementor.com") }, | |
| 4789 | - { text: (0, _wordpress_i18n.__)("Stats section with counters displaying data about [topic]", "elementor.com") }, | |
| 4790 | - { text: (0, _wordpress_i18n.__)("Quote section with colored background, featuring a centered quote", "elementor.com") }, | |
| 4791 | - { text: (0, _wordpress_i18n.__)("Pricing section for [topic] with a pricing list", "elementor.com") }, | |
| 4792 | - { text: (0, _wordpress_i18n.__)("Subscribe section featuring a simple email form, inviting users to stay informed on [topic]", "elementor.com") } | |
| 4793 | - ]); | |
| 4794 | - IconButtonWithTooltip = function IconButtonWithTooltip(_ref) { | |
| 4795 | - var tooltip = _ref.tooltip; | |
| 4796 | - var props = _objectWithoutProperties$1(_ref, _excluded$3); | |
| 4797 | - return /*#__PURE__*/ react.default.createElement(_elementor_ui.Tooltip, { title: tooltip }, /*#__PURE__*/ react.default.createElement(_elementor_ui.Box, { | |
| 4798 | - component: "span", | |
| 4799 | - sx: { cursor: props.disabled ? "default" : "pointer" } | |
| 4800 | - }, /*#__PURE__*/ react.default.createElement(_elementor_ui.IconButton, props))); | |
| 4801 | - }; | |
| 4802 | - IconButtonWithTooltip.propTypes = { | |
| 4803 | - tooltip: import_prop_types$12.default.string, | |
| 4804 | - disabled: import_prop_types$12.default.bool | |
| 4805 | - }; | |
| 4806 | - BackButton = function BackButton(props) { | |
| 4807 | - return /*#__PURE__*/ react.default.createElement(IconButtonWithTooltip, _extends({ | |
| 4808 | - size: "small", | |
| 4809 | - color: "secondary", | |
| 4810 | - tooltip: (0, _wordpress_i18n.__)("Back to results", "elementor") | |
| 4811 | - }, props), /*#__PURE__*/ react.default.createElement(ArrowLeftIcon, null)); | |
| 4812 | - }; | |
| 4813 | - EditButton = function EditButton(props) { | |
| 4814 | - return /*#__PURE__*/ react.default.createElement(IconButtonWithTooltip, _extends({ | |
| 4815 | - size: "small", | |
| 4816 | - color: "primary", | |
| 4817 | - tooltip: (0, _wordpress_i18n.__)("Edit prompt", "elementor") | |
| 4818 | - }, props), /*#__PURE__*/ react.default.createElement(EditIcon, null)); | |
| 4819 | - }; | |
| 4820 | - GenerateButton = function GenerateButton(props) { | |
| 4821 | - return /*#__PURE__*/ react.default.createElement(GenerateSubmit, _extends({ | |
| 4822 | - size: "small", | |
| 4823 | - fullWidth: false | |
| 4824 | - }, props), (0, _wordpress_i18n.__)("Generate", "elementor")); | |
| 4825 | - }; | |
| 4826 | - PromptForm = (0, react.forwardRef)(function(_ref2, ref) { | |
| 4827 | - var _attachments$; | |
| 4828 | - var attachments = _ref2.attachments; | |
| 4829 | - var isActive = _ref2.isActive; | |
| 4830 | - var isLoading = _ref2.isLoading; | |
| 4831 | - var _ref2$showActions = _ref2.showActions; | |
| 4832 | - var showActions = _ref2$showActions === void 0 ? false : _ref2$showActions; | |
| 4833 | - var onAttach = _ref2.onAttach; | |
| 4834 | - var onDetach = _ref2.onDetach; | |
| 4835 | - var _onSubmit = _ref2.onSubmit; | |
| 4836 | - var onBack = _ref2.onBack; | |
| 4837 | - var onEdit = _ref2.onEdit; | |
| 4838 | - var _ref2$shouldResetProm = _ref2.shouldResetPrompt; | |
| 4839 | - var shouldResetPrompt = _ref2$shouldResetProm === void 0 ? false : _ref2$shouldResetProm; | |
| 4840 | - var _useState2 = _slicedToArray((0, react.useState)(""), 2); | |
| 4841 | - var prompt = _useState2[0]; | |
| 4842 | - var setPrompt = _useState2[1]; | |
| 4843 | - (0, react.useEffect)(function() { | |
| 4844 | - if (shouldResetPrompt) setPrompt(""); | |
| 4845 | - }, [shouldResetPrompt]); | |
| 4846 | - var _usePromptEnhancer = usePromptEnhancer(prompt, "layout"); | |
| 4847 | - var isEnhancing = _usePromptEnhancer.isEnhancing; | |
| 4848 | - var enhance = _usePromptEnhancer.enhance; | |
| 4849 | - var previousPrompt = (0, react.useRef)(""); | |
| 4850 | - var attachmentsTypes = useConfig().attachmentsTypes; | |
| 4851 | - var isInputDisabled = isLoading || isEnhancing || !isActive; | |
| 4852 | - var isInputEmpty = "" === prompt && !attachments.length; | |
| 4853 | - var isGenerateDisabled = isInputDisabled || isInputEmpty; | |
| 4854 | - var attachmentsConfig = attachmentsTypes[((_attachments$ = attachments[0]) === null || _attachments$ === void 0 ? void 0 : _attachments$.type) || ""]; | |
| 4855 | - var promptSuggestions = (attachmentsConfig === null || attachmentsConfig === void 0 ? void 0 : attachmentsConfig.promptSuggestions) || PROMPT_SUGGESTIONS; | |
| 4856 | - var promptPlaceholder = (attachmentsConfig === null || attachmentsConfig === void 0 ? void 0 : attachmentsConfig.promptPlaceholder) || (0, _wordpress_i18n.__)("Press '/' for suggested prompts or describe the layout you want to create", "elementor"); | |
| 4857 | - return /*#__PURE__*/ react.default.createElement(_elementor_ui.Stack, { | |
| 4858 | - component: "form", | |
| 4859 | - onSubmit: function onSubmit(e) { | |
| 4860 | - return _onSubmit(e, prompt); | |
| 4861 | - }, | |
| 4862 | - direction: "row", | |
| 4863 | - sx: { p: 3 }, | |
| 4864 | - alignItems: "start", | |
| 4865 | - gap: 1 | |
| 4866 | - }, /*#__PURE__*/ react.default.createElement(_elementor_ui.Stack, { | |
| 4867 | - direction: "row", | |
| 4868 | - alignItems: "start", | |
| 4869 | - flexGrow: 1, | |
| 4870 | - spacing: 2 | |
| 4871 | - }, showActions && (isActive ? /*#__PURE__*/ react.default.createElement(BackButton, { | |
| 4872 | - disabled: isLoading || isEnhancing, | |
| 4873 | - onClick: function handleBack() { | |
| 4874 | - setPrompt(previousPrompt.current); | |
| 4875 | - onBack(); | |
| 4876 | - } | |
| 4877 | - }) : /*#__PURE__*/ react.default.createElement(EditButton, { | |
| 4878 | - disabled: isLoading, | |
| 4879 | - onClick: function handleEdit() { | |
| 4880 | - previousPrompt.current = prompt; | |
| 4881 | - onEdit(); | |
| 4882 | - } | |
| 4883 | - })), /*#__PURE__*/ react.default.createElement(Attachments, { | |
| 4884 | - attachments, | |
| 4885 | - onAttach, | |
| 4886 | - onDetach, | |
| 4887 | - disabled: isInputDisabled | |
| 4888 | - }), /*#__PURE__*/ react.default.createElement(PromptAutocomplete, { | |
| 4889 | - value: prompt, | |
| 4890 | - disabled: isInputDisabled, | |
| 4891 | - onSubmit: function onSubmit(e) { | |
| 4892 | - return _onSubmit(e, prompt); | |
| 4893 | - }, | |
| 4894 | - options: promptSuggestions, | |
| 4895 | - onChange: function onChange(_, selectedValue) { | |
| 4896 | - return setPrompt(selectedValue.text + " "); | |
| 4897 | - }, | |
| 4898 | - renderInput: function renderInput(params) { | |
| 4899 | - return /*#__PURE__*/ react.default.createElement(PromptAutocomplete.TextInput, _extends({}, params, { | |
| 4900 | - ref, | |
| 4901 | - onChange: function onChange(e) { | |
| 4902 | - return setPrompt(e.target.value); | |
| 4903 | - }, | |
| 4904 | - placeholder: promptPlaceholder | |
| 4905 | - })); | |
| 4906 | - } | |
| 4907 | - })), /*#__PURE__*/ react.default.createElement(EnhanceButton, { | |
| 4908 | - size: "small", | |
| 4909 | - disabled: isGenerateDisabled || "" === prompt, | |
| 4910 | - isLoading: isEnhancing, | |
| 4911 | - onClick: function onClick() { | |
| 4912 | - return enhance().then(function(_ref3) { | |
| 4913 | - var result = _ref3.result; | |
| 4914 | - return setPrompt(result); | |
| 4915 | - }); | |
| 4916 | - } | |
| 4917 | - }), /*#__PURE__*/ react.default.createElement(GenerateButton, { disabled: isGenerateDisabled })); | |
| 4918 | - }); | |
| 4919 | - PromptForm.propTypes = { | |
| 4920 | - isActive: import_prop_types$12.default.bool, | |
| 4921 | - onAttach: import_prop_types$12.default.func, | |
| 4922 | - onDetach: import_prop_types$12.default.func, | |
| 4923 | - isLoading: import_prop_types$12.default.bool, | |
| 4924 | - showActions: import_prop_types$12.default.bool, | |
| 4925 | - onSubmit: import_prop_types$12.default.func.isRequired, | |
| 4926 | - onBack: import_prop_types$12.default.func.isRequired, | |
| 4927 | - onEdit: import_prop_types$12.default.func.isRequired, | |
| 4928 | - attachments: import_prop_types$12.default.arrayOf(AttachmentPropType), | |
| 4929 | - shouldResetPrompt: import_prop_types$12.default.bool | |
| 4930 | - }; | |
| 4931 | - })); | |
| 5552 | +if (true) { | |
| 5553 | + var ReactIs = __webpack_require__(/*! react-is */ "../node_modules/prop-types/node_modules/react-is/index.js"); | |
| 4932 | 5554 | |
| 4933 | -//#endregion | |
| 4934 | -//#region modules/ai/assets/js/editor/icons/refresh-icon.js | |
| 4935 | - var RefreshIcon; | |
| 4936 | - var init_refresh_icon = __esmMin((() => { | |
| 4937 | - init_extends(); | |
| 4938 | - RefreshIcon = react.default.forwardRef(function(props, ref) { | |
| 4939 | - return /*#__PURE__*/ react.default.createElement(_elementor_ui.SvgIcon, _extends({ viewBox: "0 0 24 24" }, props, { ref }), /*#__PURE__*/ react.default.createElement("path", { | |
| 4940 | - fillRule: "evenodd", | |
| 4941 | - clipRule: "evenodd", | |
| 4942 | - d: "M7.55012 4.45178C9.23098 3.48072 11.1845 3.08925 13.1097 3.33767C15.035 3.58609 16.8251 4.46061 18.2045 5.82653C19.5838 7.19245 20.4757 8.97399 20.743 10.8967C20.8 11.307 20.5136 11.6858 20.1033 11.7428C19.6931 11.7998 19.3142 11.5135 19.2572 11.1032C19.0353 9.50635 18.2945 8.02677 17.149 6.89236C16.0035 5.75795 14.5167 5.03165 12.9178 4.82534C11.3189 4.61902 9.69644 4.94414 8.30047 5.75061C7.24361 6.36117 6.36093 7.22198 5.72541 8.24995H8.00009C8.41431 8.24995 8.75009 8.58574 8.75009 8.99995C8.75009 9.41417 8.41431 9.74995 8.00009 9.74995H4.51686C4.5055 9.75021 4.49412 9.75021 4.48272 9.74995H4.00009C3.58588 9.74995 3.25009 9.41417 3.25009 8.99995V4.99995C3.25009 4.58574 3.58588 4.24995 4.00009 4.24995C4.41431 4.24995 4.75009 4.58574 4.75009 4.99995V7.00691C5.48358 5.96916 6.43655 5.0951 7.55012 4.45178Z" | |
| 4943 | - }), /*#__PURE__*/ react.default.createElement("path", { | |
| 4944 | - fillRule: "evenodd", | |
| 4945 | - clipRule: "evenodd", | |
| 4946 | - d: "M3.89686 12.2571C4.30713 12.2001 4.68594 12.4864 4.74295 12.8967C4.96487 14.4936 5.70565 15.9731 6.85119 17.1075C7.99673 18.242 9.48347 18.9683 11.0824 19.1746C12.6813 19.3809 14.3037 19.0558 15.6997 18.2493C16.7566 17.6387 17.6393 16.7779 18.2748 15.75H16.0001C15.5859 15.75 15.2501 15.4142 15.2501 15C15.2501 14.5857 15.5859 14.25 16.0001 14.25H19.4833C19.4947 14.2497 19.5061 14.2497 19.5175 14.25H20.0001C20.4143 14.25 20.7501 14.5857 20.7501 15V19C20.7501 19.4142 20.4143 19.75 20.0001 19.75C19.5859 19.75 19.2501 19.4142 19.2501 19V16.993C18.5166 18.0307 17.5636 18.9048 16.4501 19.5481C14.7692 20.5192 12.8157 20.9107 10.8904 20.6622C8.9652 20.4138 7.17504 19.5393 5.79572 18.1734C4.4164 16.8074 3.52443 15.0259 3.25723 13.1032C3.20022 12.6929 3.48658 12.3141 3.89686 12.2571Z" | |
| 4947 | - })); | |
| 4948 | - }); | |
| 4949 | - })); | |
| 5555 | + // By explicitly using `prop-types` you are opting into new development behavior. | |
| 5556 | + // http://fb.me/prop-types-in-prod | |
| 5557 | + var throwOnDirectAccess = true; | |
| 5558 | + module.exports = __webpack_require__(/*! ./factoryWithTypeCheckers */ "../node_modules/prop-types/factoryWithTypeCheckers.js")(ReactIs.isElement, throwOnDirectAccess); | |
| 5559 | +} else {} | |
| 4950 | 5560 | |
| 4951 | -//#endregion | |
| 4952 | -//#region modules/ai/assets/js/editor/pages/form-layout/components/screenshot-container.js | |
| 4953 | - var ScreenshotContainer; | |
| 4954 | - var init_screenshot_container = __esmMin((() => { | |
| 4955 | - ScreenshotContainer = (0, _elementor_ui.styled)(_elementor_ui.Box, { shouldForwardProp: function shouldForwardProp(prop) { | |
| 4956 | - return prop !== "outlineOffset"; | |
| 4957 | - } })(function(_ref) { | |
| 4958 | - var theme = _ref.theme; | |
| 4959 | - var selected = _ref.selected; | |
| 4960 | - var height = _ref.height; | |
| 4961 | - var disabled = _ref.disabled; | |
| 4962 | - var _ref$outlineOffset = _ref.outlineOffset; | |
| 4963 | - var outlineOffset = _ref$outlineOffset === void 0 ? "0px" : _ref$outlineOffset; | |
| 4964 | - var outlineColor = selected ? theme.palette.text.primary : theme.palette.text.disabled; | |
| 4965 | - var outline = "2px solid ".concat(outlineColor); | |
| 4966 | - return { | |
| 4967 | - height, | |
| 4968 | - cursor: disabled ? "default" : "pointer", | |
| 4969 | - overflow: "hidden", | |
| 4970 | - boxSizing: "border-box", | |
| 4971 | - backgroundPosition: "top center", | |
| 4972 | - backgroundSize: "100% auto", | |
| 4973 | - backgroundRepeat: "no-repeat", | |
| 4974 | - backgroundColor: theme.palette.common.white, | |
| 4975 | - borderRadius: theme.shape.borderRadius * .5, | |
| 4976 | - outlineOffset, | |
| 4977 | - outline, | |
| 4978 | - opacity: disabled ? "0.4" : "1", | |
| 4979 | - transition: "all 50ms linear", | |
| 4980 | - "&:hover": disabled ? {} : { outlineColor: theme.palette.text.primary } | |
| 4981 | - }; | |
| 4982 | - }); | |
| 4983 | - })); | |
| 4984 | 5561 | |
| 4985 | -//#endregion | |
| 4986 | -//#region modules/ai/assets/js/editor/pages/form-layout/components/screenshot-unavailable.js | |
| 4987 | - function ownKeys$5(e, r) { | |
| 4988 | - var t = Object.keys(e); | |
| 4989 | - if (Object.getOwnPropertySymbols) { | |
| 4990 | - var o = Object.getOwnPropertySymbols(e); | |
| 4991 | - r && (o = o.filter(function(r) { | |
| 4992 | - return Object.getOwnPropertyDescriptor(e, r).enumerable; | |
| 4993 | - })), t.push.apply(t, o); | |
| 4994 | - } | |
| 4995 | - return t; | |
| 4996 | - } | |
| 4997 | - function _objectSpread$5(e) { | |
| 4998 | - for (var r = 1; r < arguments.length; r++) { | |
| 4999 | - var t = null != arguments[r] ? arguments[r] : {}; | |
| 5000 | - r % 2 ? ownKeys$5(Object(t), !0).forEach(function(r) { | |
| 5001 | - _defineProperty$1(e, r, t[r]); | |
| 5002 | - }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$5(Object(t)).forEach(function(r) { | |
| 5003 | - Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); | |
| 5004 | - }); | |
| 5005 | - } | |
| 5006 | - return e; | |
| 5007 | - } | |
| 5008 | - function ScreenshotUnavailable(props) { | |
| 5009 | - return /*#__PURE__*/ react.default.createElement(ScreenshotContainer, _extends({}, props, { sx: _objectSpread$5(_objectSpread$5({}, props.sx || {}), {}, { | |
| 5010 | - display: "flex", | |
| 5011 | - alignItems: "center", | |
| 5012 | - justifyContent: "center", | |
| 5013 | - backgroundColor: "background.paper", | |
| 5014 | - color: "text.tertiary", | |
| 5015 | - fontStyle: "italic", | |
| 5016 | - fontSize: "12px", | |
| 5017 | - paddingInline: 12, | |
| 5018 | - textAlign: "center", | |
| 5019 | - lineHeight: 1.5 | |
| 5020 | - }) }), (0, _wordpress_i18n.__)("Preview unavailable", "elementor")); | |
| 5021 | - } | |
| 5022 | - var import_prop_types$11; | |
| 5023 | - var init_screenshot_unavailable = __esmMin((() => { | |
| 5024 | - init_extends(); | |
| 5025 | - init_defineProperty$1(); | |
| 5026 | - import_prop_types$11 = /* @__PURE__ */ __toESM(require_prop_types()); | |
| 5027 | - init_screenshot_container(); | |
| 5028 | - __name(ownKeys$5, "ownKeys"); | |
| 5029 | - __name(_objectSpread$5, "_objectSpread"); | |
| 5030 | - ScreenshotUnavailable.propTypes = { sx: import_prop_types$11.default.object }; | |
| 5031 | - })); | |
| 5562 | +/***/ }), | |
| 5032 | 5563 | |
| 5033 | -//#endregion | |
| 5034 | -//#region modules/ai/assets/js/editor/icons/lock-icon.js | |
| 5035 | - var LockIcon; | |
| 5036 | - var init_lock_icon = __esmMin((() => { | |
| 5037 | - init_extends(); | |
| 5038 | - LockIcon = react.default.forwardRef(function(props, ref) { | |
| 5039 | - return /*#__PURE__*/ react.default.createElement(_elementor_ui.SvgIcon, _extends({ viewBox: "0 0 24 24" }, props, { ref }), /*#__PURE__*/ react.default.createElement("path", { | |
| 5040 | - fillRule: "evenodd", | |
| 5041 | - clipRule: "evenodd", | |
| 5042 | - d: "M7.8125 11.9996C7.29473 11.9996 6.875 12.4473 6.875 12.9996V18.9996C6.875 19.5519 7.29473 19.9996 7.8125 19.9996H17.1875C17.7053 19.9996 18.125 19.5519 18.125 18.9996V12.9996C18.125 12.4473 17.7053 11.9996 17.1875 11.9996H7.8125ZM5 12.9996C5 11.3428 6.2592 9.99963 7.8125 9.99963H17.1875C18.7408 9.99963 20 11.3428 20 12.9996V18.9996C20 20.6565 18.7408 21.9996 17.1875 21.9996H7.8125C6.2592 21.9996 5 20.6565 5 18.9996V12.9996Z" | |
| 5043 | - }), /*#__PURE__*/ react.default.createElement("path", { | |
| 5044 | - fillRule: "evenodd", | |
| 5045 | - clipRule: "evenodd", | |
| 5046 | - d: "M12.5 3.90527C11.7044 3.90527 10.9413 4.22134 10.3787 4.78395C9.81607 5.34656 9.5 6.10962 9.5 6.90527V10.9053C9.5 11.4576 9.05228 11.9053 8.5 11.9053C7.94772 11.9053 7.5 11.4576 7.5 10.9053V6.90527C7.5 5.57919 8.02678 4.30742 8.96447 3.36974C9.90215 2.43206 11.1739 1.90527 12.5 1.90527C13.8261 1.90527 15.0979 2.43206 16.0355 3.36974C16.9732 4.30742 17.5 5.57919 17.5 6.90527V10.9053C17.5 11.4576 17.0523 11.9053 16.5 11.9053C15.9477 11.9053 15.5 11.4576 15.5 10.9053V6.90527C15.5 6.10962 15.1839 5.34656 14.6213 4.78395C14.0587 4.22134 13.2956 3.90527 12.5 3.90527Z" | |
| 5047 | - }), /*#__PURE__*/ react.default.createElement("path", { d: "M6 12H19V20H6V12Z" })); | |
| 5048 | - }); | |
| 5049 | - })); | |
| 5564 | +/***/ "../node_modules/prop-types/lib/ReactPropTypesSecret.js": | |
| 5565 | +/*!**************************************************************!*\ | |
| 5566 | + !*** ../node_modules/prop-types/lib/ReactPropTypesSecret.js ***! | |
| 5567 | + \**************************************************************/ | |
| 5568 | +/***/ ((module) => { | |
| 5050 | 5569 | |
| 5051 | -//#endregion | |
| 5052 | -//#region modules/ai/assets/js/editor/pages/form-layout/components/pro-template-indicator.js | |
| 5053 | - var popoverId$1, StyledContent$1, StyledArrow$1, ProTemplateIndicator; | |
| 5054 | - var init_pro_template_indicator = __esmMin((() => { | |
| 5055 | - init_slicedToArray(); | |
| 5056 | - init_lock_icon(); | |
| 5057 | - popoverId$1 = "e-pro-upgrade-popover"; | |
| 5058 | - StyledContent$1 = (0, _elementor_ui.styled)(_elementor_ui.Paper)(function(_ref) { | |
| 5059 | - var theme = _ref.theme; | |
| 5060 | - return { | |
| 5061 | - position: "relative", | |
| 5062 | - padding: theme.spacing(3), | |
| 5063 | - boxShadow: theme.shadows[4], | |
| 5064 | - zIndex: "9999" | |
| 5065 | - }; | |
| 5066 | - }); | |
| 5067 | - StyledArrow$1 = (0, _elementor_ui.styled)(_elementor_ui.Box)(function(_ref2) { | |
| 5068 | - var theme = _ref2.theme; | |
| 5069 | - return { | |
| 5070 | - position: "absolute", | |
| 5071 | - width: theme.spacing(5), | |
| 5072 | - height: theme.spacing(5), | |
| 5073 | - overflow: "hidden", | |
| 5074 | - left: "100% !important", | |
| 5075 | - transform: "translateX(-50%) translateY(-50%) rotate(var(--rotate, 0deg)) !important", | |
| 5076 | - "&::after": { | |
| 5077 | - backgroundColor: theme.palette.background.paper, | |
| 5078 | - content: "\"\"", | |
| 5079 | - display: "block", | |
| 5080 | - position: "absolute", | |
| 5081 | - width: theme.spacing(2.5), | |
| 5082 | - height: theme.spacing(2.5), | |
| 5083 | - top: "50%", | |
| 5084 | - left: "50%", | |
| 5085 | - transform: "translateX(-50%) translateY(-50%) rotate(45deg)", | |
| 5086 | - boxShadow: "5px -5px 5px 0px rgba(0, 0, 0, 0.2)", | |
| 5087 | - backgroundImage: "linear-gradient(rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.05))" | |
| 5088 | - } | |
| 5089 | - }; | |
| 5090 | - }); | |
| 5091 | - ProTemplateIndicator = function ProTemplateIndicator() { | |
| 5092 | - var actionUrl = "https://go.elementor.com/go-pro-ai/"; | |
| 5093 | - var actionLabel = (0, _wordpress_i18n.__)("Go Pro", "elementor"); | |
| 5094 | - var _useState2 = _slicedToArray((0, react.useState)(false), 2); | |
| 5095 | - var isPopoverOpen = _useState2[0]; | |
| 5096 | - var setIsPopoverOpen = _useState2[1]; | |
| 5097 | - var anchorEl = (0, react.useRef)(null); | |
| 5098 | - var arrowEl = (0, react.useRef)(null); | |
| 5099 | - return /*#__PURE__*/ react.default.createElement(_elementor_ui.Box, { | |
| 5100 | - flexDirection: "row-reverse", | |
| 5101 | - component: "span", | |
| 5102 | - display: "flex", | |
| 5103 | - onMouseLeave: function hidePopover() { | |
| 5104 | - return setIsPopoverOpen(false); | |
| 5105 | - }, | |
| 5106 | - alignItems: "center" | |
| 5107 | - }, /*#__PURE__*/ react.default.createElement(_elementor_ui.IconButton, { | |
| 5108 | - ref: anchorEl, | |
| 5109 | - onMouseEnter: function showPopover() { | |
| 5110 | - return setIsPopoverOpen(true); | |
| 5111 | - }, | |
| 5112 | - onClick: function onClick(e) { | |
| 5113 | - return e.stopPropagation(); | |
| 5114 | - }, | |
| 5115 | - "aria-owns": isPopoverOpen ? popoverId$1 : void 0, | |
| 5116 | - "aria-haspopup": "true", | |
| 5117 | - sx: { | |
| 5118 | - m: 1, | |
| 5119 | - "&:hover": { backgroundColor: "action.selected" } | |
| 5120 | - } | |
| 5121 | - }, /*#__PURE__*/ react.default.createElement(LockIcon, { sx: { color: "text.primary" } })), /*#__PURE__*/ react.default.createElement(_elementor_ui.Popper, { | |
| 5122 | - open: isPopoverOpen, | |
| 5123 | - popperOptions: { | |
| 5124 | - placement: "left-start", | |
| 5125 | - modifiers: [{ | |
| 5126 | - name: "arrow", | |
| 5127 | - enabled: true, | |
| 5128 | - options: { | |
| 5129 | - element: arrowEl.current, | |
| 5130 | - padding: 5 | |
| 5131 | - } | |
| 5132 | - }, { | |
| 5133 | - name: "offset", | |
| 5134 | - options: { offset: [0, 10] } | |
| 5135 | - }] | |
| 5136 | - }, | |
| 5137 | - anchorEl: anchorEl.current, | |
| 5138 | - sx: { | |
| 5139 | - zIndex: "9999", | |
| 5140 | - maxWidth: 300 | |
| 5141 | - } | |
| 5142 | - }, /*#__PURE__*/ react.default.createElement(StyledContent$1, null, /*#__PURE__*/ react.default.createElement(StyledArrow$1, { ref: arrowEl }), /*#__PURE__*/ react.default.createElement(_elementor_ui.Stack, { | |
| 5143 | - alignItems: "start", | |
| 5144 | - spacing: 2 | |
| 5145 | - }, /*#__PURE__*/ react.default.createElement(_elementor_ui.Chip, { | |
| 5146 | - color: "promotion", | |
| 5147 | - variant: "outlined", | |
| 5148 | - size: "small", | |
| 5149 | - label: (0, _wordpress_i18n.__)("Pro", "elementor"), | |
| 5150 | - icon: /*#__PURE__*/ react.default.createElement(LockIcon, null) | |
| 5151 | - }), /*#__PURE__*/ react.default.createElement(_elementor_ui.Typography, { variant: "body2" }, (0, _wordpress_i18n.__)("This result includes an Elementor Pro widget that's not available with your current plan. Upgrade to use all the widgets in this result.", "elementor")), /*#__PURE__*/ react.default.createElement(_elementor_ui.Button, { | |
| 5152 | - variant: "contained", | |
| 5153 | - color: "promotion", | |
| 5154 | - size: "small", | |
| 5155 | - href: actionUrl, | |
| 5156 | - target: "_blank", | |
| 5157 | - sx: { alignSelf: "flex-end" } | |
| 5158 | - }, actionLabel))))); | |
| 5159 | - }; | |
| 5160 | - })); | |
| 5570 | +"use strict"; | |
| 5571 | +/** | |
| 5572 | + * Copyright (c) 2013-present, Facebook, Inc. | |
| 5573 | + * | |
| 5574 | + * This source code is licensed under the MIT license found in the | |
| 5575 | + * LICENSE file in the root directory of this source tree. | |
| 5576 | + */ | |
| 5161 | 5577 | |
| 5162 | -//#endregion | |
| 5163 | -//#region modules/ai/assets/js/editor/pages/form-layout/components/template-badge.js | |
| 5164 | - var import_prop_types$10, TemplateBadge; | |
| 5165 | - var init_template_badge = __esmMin((() => { | |
| 5166 | - import_prop_types$10 = /* @__PURE__ */ __toESM(require_prop_types()); | |
| 5167 | - init_config(); | |
| 5168 | - init_pro_template_indicator(); | |
| 5169 | - TemplateBadge = function TemplateBadge(props) { | |
| 5170 | - var hasPro = useConfig().hasPro; | |
| 5171 | - if ("Pro" === props.type && !hasPro) return /*#__PURE__*/ react.default.createElement(ProTemplateIndicator, null); | |
| 5172 | - return null; | |
| 5173 | - }; | |
| 5174 | - TemplateBadge.propTypes = { type: import_prop_types$10.default.string }; | |
| 5175 | - })); | |
| 5176 | 5578 | |
| 5177 | -//#endregion | |
| 5178 | -//#region modules/ai/assets/js/editor/pages/form-layout/components/screenshot.js | |
| 5179 | - function ownKeys$4(e, r) { | |
| 5180 | - var t = Object.keys(e); | |
| 5181 | - if (Object.getOwnPropertySymbols) { | |
| 5182 | - var o = Object.getOwnPropertySymbols(e); | |
| 5183 | - r && (o = o.filter(function(r) { | |
| 5184 | - return Object.getOwnPropertyDescriptor(e, r).enumerable; | |
| 5185 | - })), t.push.apply(t, o); | |
| 5186 | - } | |
| 5187 | - return t; | |
| 5188 | - } | |
| 5189 | - function _objectSpread$4(e) { | |
| 5190 | - for (var r = 1; r < arguments.length; r++) { | |
| 5191 | - var t = null != arguments[r] ? arguments[r] : {}; | |
| 5192 | - r % 2 ? ownKeys$4(Object(t), !0).forEach(function(r) { | |
| 5193 | - _defineProperty$1(e, r, t[r]); | |
| 5194 | - }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$4(Object(t)).forEach(function(r) { | |
| 5195 | - Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); | |
| 5196 | - }); | |
| 5197 | - } | |
| 5198 | - return e; | |
| 5199 | - } | |
| 5200 | - var import_prop_types$9, SCREENSHOT_HEIGHT, Screenshot; | |
| 5201 | - var init_screenshot$1 = __esmMin((() => { | |
| 5202 | - init_defineProperty$1(); | |
| 5203 | - import_prop_types$9 = /* @__PURE__ */ __toESM(require_prop_types()); | |
| 5204 | - init_screenshot_container(); | |
| 5205 | - init_screenshot_unavailable(); | |
| 5206 | - init_template_badge(); | |
| 5207 | - __name(ownKeys$4, "ownKeys"); | |
| 5208 | - __name(_objectSpread$4, "_objectSpread"); | |
| 5209 | - SCREENSHOT_HEIGHT = "138px"; | |
| 5210 | - Screenshot = function Screenshot(_ref) { | |
| 5211 | - var url = _ref.url; | |
| 5212 | - var type = _ref.type; | |
| 5213 | - var _ref$isLoading = _ref.isLoading; | |
| 5214 | - var isLoading = _ref$isLoading === void 0 ? false : _ref$isLoading; | |
| 5215 | - var _ref$isSelected = _ref.isSelected; | |
| 5216 | - var isSelected = _ref$isSelected === void 0 ? false : _ref$isSelected; | |
| 5217 | - var isPlaceholder = _ref.isPlaceholder; | |
| 5218 | - var disabled = _ref.disabled; | |
| 5219 | - var onClick = _ref.onClick; | |
| 5220 | - var _ref$sx = _ref.sx; | |
| 5221 | - var sx = _ref$sx === void 0 ? {} : _ref$sx; | |
| 5222 | - var outlineOffset = _ref.outlineOffset; | |
| 5223 | - if (isPlaceholder) return /*#__PURE__*/ react.default.createElement(_elementor_ui.Box, { sx: _objectSpread$4({ height: SCREENSHOT_HEIGHT }, sx) }); | |
| 5224 | - if (isLoading) return /*#__PURE__*/ react.default.createElement(_elementor_ui.Skeleton, { | |
| 5225 | - width: "100%", | |
| 5226 | - animation: "wave", | |
| 5227 | - variant: "rounded", | |
| 5228 | - height: SCREENSHOT_HEIGHT, | |
| 5229 | - sx | |
| 5230 | - }); | |
| 5231 | - if (!url) return /*#__PURE__*/ react.default.createElement(ScreenshotUnavailable, { | |
| 5232 | - selected: isSelected, | |
| 5233 | - disabled, | |
| 5234 | - sx, | |
| 5235 | - onClick, | |
| 5236 | - height: SCREENSHOT_HEIGHT, | |
| 5237 | - outlineOffset | |
| 5238 | - }); | |
| 5239 | - return /*#__PURE__*/ react.default.createElement(ScreenshotContainer, { | |
| 5240 | - selected: isSelected, | |
| 5241 | - disabled, | |
| 5242 | - sx: _objectSpread$4({ backgroundImage: "url('".concat(url, "')") }, sx), | |
| 5243 | - onClick, | |
| 5244 | - height: SCREENSHOT_HEIGHT, | |
| 5245 | - outlineOffset | |
| 5246 | - }, /*#__PURE__*/ react.default.createElement(TemplateBadge, { type })); | |
| 5247 | - }; | |
| 5248 | - Screenshot.propTypes = { | |
| 5249 | - isSelected: import_prop_types$9.default.bool, | |
| 5250 | - isLoading: import_prop_types$9.default.bool, | |
| 5251 | - isPlaceholder: import_prop_types$9.default.bool, | |
| 5252 | - disabled: import_prop_types$9.default.bool, | |
| 5253 | - onClick: import_prop_types$9.default.func.isRequired, | |
| 5254 | - url: import_prop_types$9.default.string, | |
| 5255 | - type: import_prop_types$9.default.string, | |
| 5256 | - sx: import_prop_types$9.default.object, | |
| 5257 | - outlineOffset: import_prop_types$9.default.string | |
| 5258 | - }; | |
| 5259 | - })); | |
| 5260 | 5579 | |
| 5261 | -//#endregion | |
| 5262 | -//#region modules/ai/assets/js/editor/pages/form-layout/hooks/use-layout-prompt.js | |
| 5263 | - var useLayoutPrompt; | |
| 5264 | - var init_use_layout_prompt = __esmMin((() => { | |
| 5265 | - init_api(); | |
| 5266 | - init_use_prompt(); | |
| 5267 | - useLayoutPrompt = function useLayoutPrompt(type, initialValue) { | |
| 5268 | - return usePrompt(function(requestBody, signal) { | |
| 5269 | - requestBody.variationType = type; | |
| 5270 | - return generateLayout(requestBody, signal); | |
| 5271 | - }, initialValue); | |
| 5272 | - }; | |
| 5273 | - })); | |
| 5580 | +var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; | |
| 5274 | 5581 | |
| 5275 | -//#endregion | |
| 5276 | -//#region modules/ai/assets/js/editor/pages/form-layout/hooks/use-screenshot.js | |
| 5277 | - var import_regenerator$5, ERROR_INITIAL_VALUE, useScreenshot; | |
| 5278 | - var init_use_screenshot = __esmMin((() => { | |
| 5279 | - init_asyncToGenerator$1(); | |
| 5280 | - init_slicedToArray(); | |
| 5281 | - import_regenerator$5 = /* @__PURE__ */ __toESM(require_regenerator()); | |
| 5282 | - init_use_layout_prompt(); | |
| 5283 | - ERROR_INITIAL_VALUE = ""; | |
| 5284 | - useScreenshot = function useScreenshot(type, onData) { | |
| 5285 | - var _useState2 = _slicedToArray((0, react.useState)(ERROR_INITIAL_VALUE), 2); | |
| 5286 | - var error = _useState2[0]; | |
| 5287 | - var setError = _useState2[1]; | |
| 5288 | - var _useState4 = _slicedToArray((0, react.useState)(false), 2); | |
| 5289 | - var isLoading = _useState4[0]; | |
| 5290 | - var setIsLoading = _useState4[1]; | |
| 5291 | - var layoutData = useLayoutPrompt(type, null); | |
| 5292 | - return { | |
| 5293 | - generate: function generate(requestBody, signal) { | |
| 5294 | - setIsLoading(true); | |
| 5295 | - setError(ERROR_INITIAL_VALUE); | |
| 5296 | - return layoutData.send(requestBody, signal).then(/*#__PURE__*/ function() { | |
| 5297 | - var _ref = _asyncToGenerator$1(/*#__PURE__*/ import_regenerator$5.default.mark(function _callee(data) { | |
| 5298 | - var createdScreenshot; | |
| 5299 | - return import_regenerator$5.default.wrap(function(_context) { | |
| 5300 | - while (1) switch (_context.prev = _context.next) { | |
| 5301 | - case 0: | |
| 5302 | - _context.next = 1; | |
| 5303 | - return onData(data.result); | |
| 5304 | - case 1: | |
| 5305 | - createdScreenshot = _context.sent; | |
| 5306 | - createdScreenshot.sendUsageData = function() { | |
| 5307 | - return layoutData.sendUsageData(data); | |
| 5308 | - }; | |
| 5309 | - createdScreenshot.baseTemplateId = data.baseTemplateId; | |
| 5310 | - createdScreenshot.type = data.type; | |
| 5311 | - return _context.abrupt("return", createdScreenshot); | |
| 5312 | - case 2: | |
| 5313 | - case "end": return _context.stop(); | |
| 5314 | - } | |
| 5315 | - }, _callee); | |
| 5316 | - })); | |
| 5317 | - return function(_x) { | |
| 5318 | - return _ref.apply(this, arguments); | |
| 5319 | - }; | |
| 5320 | - }()).catch(function(err) { | |
| 5321 | - setError(err.extra_data ? err : err.message || err); | |
| 5322 | - throw err; | |
| 5323 | - }).finally(function() { | |
| 5324 | - return setIsLoading(false); | |
| 5325 | - }); | |
| 5326 | - }, | |
| 5327 | - error, | |
| 5328 | - isLoading | |
| 5329 | - }; | |
| 5330 | - }; | |
| 5331 | - })); | |
| 5582 | +module.exports = ReactPropTypesSecret; | |
| 5332 | 5583 | |
| 5333 | -//#endregion | |
| 5334 | -//#region modules/ai/assets/js/editor/pages/form-layout/hooks/use-screenshots.js | |
| 5335 | - var import_regenerator$4, PENDING_VALUE, useScreenshots; | |
| 5336 | - var init_use_screenshots = __esmMin((() => { | |
| 5337 | - init_toConsumableArray(); | |
| 5338 | - init_asyncToGenerator$1(); | |
| 5339 | - init_slicedToArray(); | |
| 5340 | - import_regenerator$4 = /* @__PURE__ */ __toESM(require_regenerator()); | |
| 5341 | - init_use_screenshot(); | |
| 5342 | - init_config(); | |
| 5343 | - init_requests_ids(); | |
| 5344 | - PENDING_VALUE = { isPending: true }; | |
| 5345 | - useScreenshots = function useScreenshots(_ref) { | |
| 5346 | - var onData = _ref.onData; | |
| 5347 | - var _useState2 = _slicedToArray((0, react.useState)([]), 2); | |
| 5348 | - var screenshots = _useState2[0]; | |
| 5349 | - var setScreenshots = _useState2[1]; | |
| 5350 | - /** | |
| 5351 | - * The ids for each request are: | |
| 5352 | - * - editorSessionId: a unique id for each editor opening | |
| 5353 | - * - sessionId: a unique id for each session. (open the AI builder) | |
| 5354 | - * - generateId: a unique id for each generate request. (prompt change) | |
| 5355 | - * - batchId: a unique id for each batch of generate requests. (generate, regenerate) | |
| 5356 | - * - requestId: a unique id for each generate request. | |
| 5357 | - */ | |
| 5358 | - var currentContext = useConfig().currentContext; | |
| 5359 | - var _useRequestIds = useRequestIds(); | |
| 5360 | - var editorSessionId = _useRequestIds.editorSessionId; | |
| 5361 | - var sessionId = _useRequestIds.sessionId; | |
| 5362 | - var setRequest = _useRequestIds.setRequest; | |
| 5363 | - var setBatch = _useRequestIds.setBatch; | |
| 5364 | - var setGenerate = _useRequestIds.setGenerate; | |
| 5365 | - var generateIdRef = (0, react.useRef)(""); | |
| 5366 | - var batchId = setBatch(); | |
| 5367 | - var screenshotsData = [ | |
| 5368 | - useScreenshot(0, onData), | |
| 5369 | - useScreenshot(1, onData), | |
| 5370 | - useScreenshot(2, onData) | |
| 5371 | - ]; | |
| 5372 | - var screenshotsGroupCount = screenshotsData.length; | |
| 5373 | - var error = screenshotsData.every(function(s) { | |
| 5374 | - return s === null || s === void 0 ? void 0 : s.error; | |
| 5375 | - }) ? screenshotsData[0].error : ""; | |
| 5376 | - var isLoading = screenshotsData.some(function(s) { | |
| 5377 | - return s === null || s === void 0 ? void 0 : s.isLoading; | |
| 5378 | - }); | |
| 5379 | - var abortController = (0, react.useRef)(null); | |
| 5380 | - var abort = function abort() { | |
| 5381 | - var _abortController$curr; | |
| 5382 | - return (_abortController$curr = abortController.current) === null || _abortController$curr === void 0 ? void 0 : _abortController$curr.abort(); | |
| 5383 | - }; | |
| 5384 | - var createScreenshots = /*#__PURE__*/ function() { | |
| 5385 | - var _ref2 = _asyncToGenerator$1(/*#__PURE__*/ import_regenerator$4.default.mark(function _callee(prompt, attachments) { | |
| 5386 | - var onGenerate; | |
| 5387 | - var onError; | |
| 5388 | - var promises; | |
| 5389 | - var results; | |
| 5390 | - var isAllFailed; | |
| 5391 | - return import_regenerator$4.default.wrap(function(_context) { | |
| 5392 | - while (1) switch (_context.prev = _context.next) { | |
| 5393 | - case 0: | |
| 5394 | - abortController.current = new AbortController(); | |
| 5395 | - onGenerate = function onGenerate(screenshot) { | |
| 5396 | - setScreenshots(function(prev) { | |
| 5397 | - var updatedData = _toConsumableArray(prev); | |
| 5398 | - var pendingIndex = updatedData.indexOf(PENDING_VALUE); | |
| 5399 | - updatedData[pendingIndex] = screenshot; | |
| 5400 | - return updatedData; | |
| 5401 | - }); | |
| 5402 | - return true; | |
| 5403 | - }; | |
| 5404 | - onError = function onError() { | |
| 5405 | - setScreenshots(function(prev) { | |
| 5406 | - var updatedData = _toConsumableArray(prev); | |
| 5407 | - var pendingIndex = updatedData.lastIndexOf(PENDING_VALUE); | |
| 5408 | - updatedData[pendingIndex] = { isError: true }; | |
| 5409 | - return updatedData; | |
| 5410 | - }); | |
| 5411 | - return false; | |
| 5412 | - }; | |
| 5413 | - promises = screenshotsData.map(function(_ref3) { | |
| 5414 | - var generate = _ref3.generate; | |
| 5415 | - return generate({ | |
| 5416 | - prompt, | |
| 5417 | - prevGeneratedIds: screenshots.map(function(screenshot) { | |
| 5418 | - return screenshot.baseTemplateId || ""; | |
| 5419 | - }), | |
| 5420 | - currentContext, | |
| 5421 | - ids: { | |
| 5422 | - editorSessionId: editorSessionId.current, | |
| 5423 | - sessionId: sessionId.current, | |
| 5424 | - generateId: generateIdRef.current, | |
| 5425 | - batchId: batchId.current, | |
| 5426 | - requestId: setRequest().current | |
| 5427 | - }, | |
| 5428 | - attachments: attachments.map(function(_ref4) { | |
| 5429 | - return { | |
| 5430 | - type: _ref4.type, | |
| 5431 | - content: _ref4.content, | |
| 5432 | - label: _ref4.label, | |
| 5433 | - source: _ref4.source | |
| 5434 | - }; | |
| 5435 | - }) | |
| 5436 | - }, abortController.current.signal).then(onGenerate).catch(onError); | |
| 5437 | - }); | |
| 5438 | - _context.next = 1; | |
| 5439 | - return Promise.all(promises); | |
| 5440 | - case 1: | |
| 5441 | - results = _context.sent; | |
| 5442 | - isAllFailed = results.every(function(value) { | |
| 5443 | - return false === value; | |
| 5444 | - }); | |
| 5445 | - if (isAllFailed) setScreenshots(function(prev) { | |
| 5446 | - var updatedData = _toConsumableArray(prev); | |
| 5447 | - updatedData.splice(screenshotsGroupCount * -1); | |
| 5448 | - return updatedData; | |
| 5449 | - }); | |
| 5450 | - case 2: | |
| 5451 | - case "end": return _context.stop(); | |
| 5452 | - } | |
| 5453 | - }, _callee); | |
| 5454 | - })); | |
| 5455 | - return function createScreenshots(_x, _x2) { | |
| 5456 | - return _ref2.apply(this, arguments); | |
| 5457 | - }; | |
| 5458 | - }(); | |
| 5459 | - return { | |
| 5460 | - generate: function generate(prompt, attachments) { | |
| 5461 | - var placeholders = Array(screenshotsGroupCount).fill(PENDING_VALUE); | |
| 5462 | - generateIdRef.current = setGenerate().current; | |
| 5463 | - setScreenshots(placeholders); | |
| 5464 | - createScreenshots(prompt, attachments); | |
| 5465 | - }, | |
| 5466 | - regenerate: function regenerate(prompt, attachments) { | |
| 5467 | - var placeholders = Array(screenshotsGroupCount).fill(PENDING_VALUE); | |
| 5468 | - setScreenshots(function(prev) { | |
| 5469 | - return [].concat(_toConsumableArray(prev), _toConsumableArray(placeholders)); | |
| 5470 | - }); | |
| 5471 | - createScreenshots(prompt, attachments); | |
| 5472 | - }, | |
| 5473 | - screenshots, | |
| 5474 | - isLoading, | |
| 5475 | - error, | |
| 5476 | - abort | |
| 5477 | - }; | |
| 5478 | - }; | |
| 5479 | - })); | |
| 5480 | 5584 | |
| 5481 | -//#endregion | |
| 5482 | -//#region modules/ai/assets/js/editor/pages/form-layout/hooks/use-slider.js | |
| 5483 | - var SCREENSHOTS_PER_PAGE, useSlider; | |
| 5484 | - var init_use_slider = __esmMin((() => { | |
| 5485 | - init_slicedToArray(); | |
| 5486 | - SCREENSHOTS_PER_PAGE = 3; | |
| 5487 | - useSlider = function useSlider() { | |
| 5488 | - var _ref = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; | |
| 5489 | - var _ref$slidesCount = _ref.slidesCount; | |
| 5490 | - var slidesCount = _ref$slidesCount === void 0 ? 0 : _ref$slidesCount; | |
| 5491 | - var _ref$slidesPerPage = _ref.slidesPerPage; | |
| 5492 | - var slidesPerPage = _ref$slidesPerPage === void 0 ? 3 : _ref$slidesPerPage; | |
| 5493 | - var _ref$gapPercentage = _ref.gapPercentage; | |
| 5494 | - var gapPercentage = _ref$gapPercentage === void 0 ? 2 : _ref$gapPercentage; | |
| 5495 | - var _useState2 = _slicedToArray((0, react.useState)(1), 2); | |
| 5496 | - var currentPage = _useState2[0]; | |
| 5497 | - var setCurrentPage = _useState2[1]; | |
| 5498 | - var slideWidthPercentage = (100 - gapPercentage * (slidesPerPage - 1)) / slidesPerPage; | |
| 5499 | - var offsetXPercentage = (slideWidthPercentage + gapPercentage) * slidesPerPage * (currentPage - 1) * -1; | |
| 5500 | - var pagesCount = Math.ceil(slidesCount / slidesPerPage); | |
| 5501 | - (0, react.useEffect)(function() { | |
| 5502 | - if (currentPage > 1 && currentPage > pagesCount) setCurrentPage(pagesCount); | |
| 5503 | - }, [pagesCount]); | |
| 5504 | - return { | |
| 5505 | - currentPage, | |
| 5506 | - setCurrentPage, | |
| 5507 | - pagesCount, | |
| 5508 | - slidesPerPage, | |
| 5509 | - gapPercentage, | |
| 5510 | - offsetXPercentage, | |
| 5511 | - slideWidthPercentage | |
| 5512 | - }; | |
| 5513 | - }; | |
| 5514 | - })); | |
| 5585 | +/***/ }), | |
| 5515 | 5586 | |
| 5516 | -//#endregion | |
| 5517 | -//#region modules/ai/assets/js/editor/icons/minimize-diagonal-icon.js | |
| 5518 | - var MinimizeDiagonalIcon; | |
| 5519 | - var init_minimize_diagonal_icon = __esmMin((() => { | |
| 5520 | - init_extends(); | |
| 5521 | - MinimizeDiagonalIcon = react.default.forwardRef(function(props, ref) { | |
| 5522 | - return /*#__PURE__*/ react.default.createElement(_elementor_ui.SvgIcon, _extends({ viewBox: "0 0 24 24" }, props, { ref }), /*#__PURE__*/ react.default.createElement("path", { | |
| 5523 | - fillRule: "evenodd", | |
| 5524 | - clipRule: "evenodd", | |
| 5525 | - d: "M3.46967 3.46967C3.76256 3.17678 4.23744 3.17678 4.53033 3.46967L9.25 8.18934V6C9.25 5.58579 9.58579 5.25 10 5.25C10.4142 5.25 10.75 5.58579 10.75 6V10C10.75 10.4142 10.4142 10.75 10 10.75H6C5.58579 10.75 5.25 10.4142 5.25 10C5.25 9.58579 5.58579 9.25 6 9.25H8.18934L3.46967 4.53033C3.17678 4.23744 3.17678 3.76256 3.46967 3.46967ZM14 13.25H18C18.4142 13.25 18.75 13.5858 18.75 14C18.75 14.4142 18.4142 14.75 18 14.75H15.8107L20.5303 19.4697C20.8232 19.7626 20.8232 20.2374 20.5303 20.5303C20.2374 20.8232 19.7626 20.8232 19.4697 20.5303L14.75 15.8107V18C14.75 18.4142 14.4142 18.75 14 18.75C13.5858 18.75 13.25 18.4142 13.25 18V14C13.25 13.5858 13.5858 13.25 14 13.25Z" | |
| 5526 | - })); | |
| 5527 | - }); | |
| 5528 | - })); | |
| 5587 | +/***/ "../node_modules/prop-types/lib/has.js": | |
| 5588 | +/*!*********************************************!*\ | |
| 5589 | + !*** ../node_modules/prop-types/lib/has.js ***! | |
| 5590 | + \*********************************************/ | |
| 5591 | +/***/ ((module) => { | |
| 5529 | 5592 | |
| 5530 | -//#endregion | |
| 5531 | -//#region modules/ai/assets/js/editor/icons/expand-diagonal-icon.js | |
| 5532 | - var ExpandDiagonalIcon; | |
| 5533 | - var init_expand_diagonal_icon = __esmMin((() => { | |
| 5534 | - init_extends(); | |
| 5535 | - ExpandDiagonalIcon = react.default.forwardRef(function(props, ref) { | |
| 5536 | - return /*#__PURE__*/ react.default.createElement(_elementor_ui.SvgIcon, _extends({ viewBox: "0 0 24 24" }, props, { ref }), /*#__PURE__*/ react.default.createElement("path", { | |
| 5537 | - fillRule: "evenodd", | |
| 5538 | - clipRule: "evenodd", | |
| 5539 | - d: "M4 3.25H8C8.41421 3.25 8.75 3.58579 8.75 4C8.75 4.41421 8.41421 4.75 8 4.75H5.81066L10.5303 9.46967C10.8232 9.76256 10.8232 10.2374 10.5303 10.5303C10.2374 10.8232 9.76256 10.8232 9.46967 10.5303L4.75 5.81066V8C4.75 8.41421 4.41421 8.75 4 8.75C3.58579 8.75 3.25 8.41421 3.25 8V4C3.25 3.58579 3.58579 3.25 4 3.25ZM13.4697 13.4697C13.7626 13.1768 14.2374 13.1768 14.5303 13.4697L19.25 18.1893V16C19.25 15.5858 19.5858 15.25 20 15.25C20.4142 15.25 20.75 15.5858 20.75 16V20C20.75 20.4142 20.4142 20.75 20 20.75H16C15.5858 20.75 15.25 20.4142 15.25 20C15.25 19.5858 15.5858 19.25 16 19.25H18.1893L13.4697 14.5303C13.1768 14.2374 13.1768 13.7626 13.4697 13.4697Z" | |
| 5540 | - })); | |
| 5541 | - }); | |
| 5542 | - })); | |
| 5593 | +module.exports = Function.call.bind(Object.prototype.hasOwnProperty); | |
| 5543 | 5594 | |
| 5544 | -//#endregion | |
| 5545 | -//#region modules/ai/assets/js/editor/pages/form-layout/components/attachments/prompt-power-notice.js | |
| 5546 | - var PromptPowerNotice; | |
| 5547 | - var init_prompt_power_notice = __esmMin((() => { | |
| 5548 | - init_use_introduction(); | |
| 5549 | - PromptPowerNotice = function PromptPowerNotice() { | |
| 5550 | - var _useIntroduction = useIntroduction("e-ai-builder-attachments-power"); | |
| 5551 | - var isViewed = _useIntroduction.isViewed; | |
| 5552 | - var markAsViewed = _useIntroduction.markAsViewed; | |
| 5553 | - if (isViewed) return null; | |
| 5554 | - return /*#__PURE__*/ react.default.createElement(_elementor_ui.Box, { sx: { | |
| 5555 | - pt: 2, | |
| 5556 | - px: 2, | |
| 5557 | - pb: 0 | |
| 5558 | - } }, /*#__PURE__*/ react.default.createElement(_elementor_ui.Alert, { | |
| 5559 | - severity: "info", | |
| 5560 | - onClose: function onClose() { | |
| 5561 | - return markAsViewed(); | |
| 5562 | - } | |
| 5563 | - }, /*#__PURE__*/ react.default.createElement(_elementor_ui.Typography, { | |
| 5564 | - variant: "body2", | |
| 5565 | - display: "inline-block", | |
| 5566 | - sx: { paddingInlineEnd: 1 } | |
| 5567 | - }, (0, _wordpress_i18n.__)("You’ve got the power.", "elementor")), /*#__PURE__*/ react.default.createElement(_elementor_ui.Typography, { | |
| 5568 | - variant: "body2", | |
| 5569 | - display: "inline-block" | |
| 5570 | - }, (0, _wordpress_i18n.__)("Craft your prompt to affect content, images and/or colors - whichever you decide.", "elementor")))); | |
| 5571 | - }; | |
| 5572 | - })); | |
| 5573 | 5595 | |
| 5574 | -//#endregion | |
| 5575 | -//#region node_modules/validator/lib/util/assertString.js | |
| 5576 | - var require_assertString = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 5577 | - Object.defineProperty(exports, "__esModule", { value: true }); | |
| 5578 | - exports.default = assertString; | |
| 5579 | - function assertString(input) { | |
| 5580 | - if (input === void 0 || input === null) throw new TypeError("Expected a string but received a ".concat(input)); | |
| 5581 | - if (input.constructor.name !== "String") throw new TypeError("Expected a string but received a ".concat(input.constructor.name)); | |
| 5582 | - } | |
| 5583 | - module.exports = exports.default; | |
| 5584 | - module.exports.default = exports.default; | |
| 5585 | - })); | |
| 5596 | +/***/ }), | |
| 5586 | 5597 | |
| 5587 | -//#endregion | |
| 5588 | -//#region node_modules/validator/lib/util/checkHost.js | |
| 5589 | - var require_checkHost = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 5590 | - Object.defineProperty(exports, "__esModule", { value: true }); | |
| 5591 | - exports.default = checkHost; | |
| 5592 | - function isRegExp(obj) { | |
| 5593 | - return Object.prototype.toString.call(obj) === "[object RegExp]"; | |
| 5594 | - } | |
| 5595 | - function checkHost(host, matches) { | |
| 5596 | - for (var i = 0; i < matches.length; i++) { | |
| 5597 | - var match = matches[i]; | |
| 5598 | - if (host === match || isRegExp(match) && match.test(host)) return true; | |
| 5599 | - } | |
| 5600 | - return false; | |
| 5601 | - } | |
| 5602 | - module.exports = exports.default; | |
| 5603 | - module.exports.default = exports.default; | |
| 5604 | - })); | |
| 5598 | +/***/ "../node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js": | |
| 5599 | +/*!************************************************************************************!*\ | |
| 5600 | + !*** ../node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js ***! | |
| 5601 | + \************************************************************************************/ | |
| 5602 | +/***/ ((__unused_webpack_module, exports) => { | |
| 5605 | 5603 | |
| 5606 | -//#endregion | |
| 5607 | -//#region node_modules/validator/lib/util/includesString.js | |
| 5608 | - var require_includesString = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 5609 | - Object.defineProperty(exports, "__esModule", { value: true }); | |
| 5610 | - exports.default = void 0; | |
| 5611 | - var includes = function includes(str, val) { | |
| 5612 | - return str.indexOf(val) !== -1; | |
| 5613 | - }; | |
| 5614 | - exports.default = includes; | |
| 5615 | - module.exports = exports.default; | |
| 5616 | - module.exports.default = exports.default; | |
| 5617 | - })); | |
| 5604 | +"use strict"; | |
| 5605 | +/** @license React v16.13.1 | |
| 5606 | + * react-is.development.js | |
| 5607 | + * | |
| 5608 | + * Copyright (c) Facebook, Inc. and its affiliates. | |
| 5609 | + * | |
| 5610 | + * This source code is licensed under the MIT license found in the | |
| 5611 | + * LICENSE file in the root directory of this source tree. | |
| 5612 | + */ | |
| 5618 | 5613 | |
| 5619 | -//#endregion | |
| 5620 | -//#region node_modules/validator/lib/util/merge.js | |
| 5621 | - var require_merge = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 5622 | - Object.defineProperty(exports, "__esModule", { value: true }); | |
| 5623 | - exports.default = merge; | |
| 5624 | - function merge() { | |
| 5625 | - var obj = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; | |
| 5626 | - var defaults = arguments.length > 1 ? arguments[1] : void 0; | |
| 5627 | - for (var key in defaults) if (typeof obj[key] === "undefined") obj[key] = defaults[key]; | |
| 5628 | - return obj; | |
| 5629 | - } | |
| 5630 | - module.exports = exports.default; | |
| 5631 | - module.exports.default = exports.default; | |
| 5632 | - })); | |
| 5633 | 5614 | |
| 5634 | -//#endregion | |
| 5635 | -//#region node_modules/validator/lib/isFQDN.js | |
| 5636 | - var require_isFQDN = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 5637 | - Object.defineProperty(exports, "__esModule", { value: true }); | |
| 5638 | - exports.default = isFQDN; | |
| 5639 | - var _assertString = _interopRequireDefault(require_assertString()); | |
| 5640 | - var _merge = _interopRequireDefault(require_merge()); | |
| 5641 | - function _interopRequireDefault(e) { | |
| 5642 | - return e && e.__esModule ? e : { default: e }; | |
| 5643 | - } | |
| 5644 | - var default_fqdn_options = { | |
| 5645 | - require_tld: true, | |
| 5646 | - allow_underscores: false, | |
| 5647 | - allow_trailing_dot: false, | |
| 5648 | - allow_numeric_tld: false, | |
| 5649 | - allow_wildcard: false, | |
| 5650 | - ignore_max_length: false | |
| 5651 | - }; | |
| 5652 | - function isFQDN(str, options) { | |
| 5653 | - (0, _assertString.default)(str); | |
| 5654 | - options = (0, _merge.default)(options, default_fqdn_options); | |
| 5655 | - if (options.allow_trailing_dot && str[str.length - 1] === ".") str = str.substring(0, str.length - 1); | |
| 5656 | - if (options.allow_wildcard === true && str.indexOf("*.") === 0) str = str.substring(2); | |
| 5657 | - var parts = str.split("."); | |
| 5658 | - var tld = parts[parts.length - 1]; | |
| 5659 | - if (options.require_tld) { | |
| 5660 | - if (parts.length < 2) return false; | |
| 5661 | - if (!options.allow_numeric_tld && !/^([a-z\u00A1-\u00A8\u00AA-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]{2,}|xn[a-z0-9-]{2,})$/i.test(tld)) return false; | |
| 5662 | - if (/\s/.test(tld)) return false; | |
| 5663 | - } | |
| 5664 | - if (!options.allow_numeric_tld && /^\d+$/.test(tld)) return false; | |
| 5665 | - return parts.every(function(part) { | |
| 5666 | - if (part.length > 63 && !options.ignore_max_length) return false; | |
| 5667 | - if (!/^[a-z_\u00a1-\uffff0-9-]+$/i.test(part)) return false; | |
| 5668 | - if (/[\uff01-\uff5e]/.test(part)) return false; | |
| 5669 | - if (/^-|-$/.test(part)) return false; | |
| 5670 | - if (!options.allow_underscores && /_/.test(part)) return false; | |
| 5671 | - return true; | |
| 5672 | - }); | |
| 5673 | - } | |
| 5674 | - module.exports = exports.default; | |
| 5675 | - module.exports.default = exports.default; | |
| 5676 | - })); | |
| 5677 | 5615 | |
| 5678 | -//#endregion | |
| 5679 | -//#region node_modules/validator/lib/isIP.js | |
| 5680 | - var require_isIP = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 5681 | - Object.defineProperty(exports, "__esModule", { value: true }); | |
| 5682 | - exports.default = isIP; | |
| 5683 | - var _assertString = _interopRequireDefault(require_assertString()); | |
| 5684 | - function _interopRequireDefault(e) { | |
| 5685 | - return e && e.__esModule ? e : { default: e }; | |
| 5686 | - } | |
| 5687 | - function _typeof(o) { | |
| 5688 | - "@babel/helpers - typeof"; | |
| 5689 | - return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) { | |
| 5690 | - return typeof o; | |
| 5691 | - } : function(o) { | |
| 5692 | - return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; | |
| 5693 | - }, _typeof(o); | |
| 5694 | - } | |
| 5695 | - /** | |
| 5696 | - 11.3. Examples | |
| 5697 | - | |
| 5698 | - The following addresses | |
| 5699 | - | |
| 5700 | - fe80::1234 (on the 1st link of the node) | |
| 5701 | - ff02::5678 (on the 5th link of the node) | |
| 5702 | - ff08::9abc (on the 10th organization of the node) | |
| 5703 | - | |
| 5704 | - would be represented as follows: | |
| 5705 | - | |
| 5706 | - fe80::1234%1 | |
| 5707 | - ff02::5678%5 | |
| 5708 | - ff08::9abc%10 | |
| 5709 | - | |
| 5710 | - (Here we assume a natural translation from a zone index to the | |
| 5711 | - <zone_id> part, where the Nth zone of any scope is translated into | |
| 5712 | - "N".) | |
| 5713 | - | |
| 5714 | - If we use interface names as <zone_id>, those addresses could also be | |
| 5715 | - represented as follows: | |
| 5716 | - | |
| 5717 | - fe80::1234%ne0 | |
| 5718 | - ff02::5678%pvc1.3 | |
| 5719 | - ff08::9abc%interface10 | |
| 5720 | - | |
| 5721 | - where the interface "ne0" belongs to the 1st link, "pvc1.3" belongs | |
| 5722 | - to the 5th link, and "interface10" belongs to the 10th organization. | |
| 5723 | - * * */ | |
| 5724 | - var IPv4SegmentFormat = "(?:[0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])"; | |
| 5725 | - var IPv4AddressFormat = "(".concat(IPv4SegmentFormat, "[.]){3}").concat(IPv4SegmentFormat); | |
| 5726 | - var IPv4AddressRegExp = new RegExp("^".concat(IPv4AddressFormat, "$")); | |
| 5727 | - var IPv6SegmentFormat = "(?:[0-9a-fA-F]{1,4})"; | |
| 5728 | - var IPv6AddressRegExp = new RegExp("^(" + "(?:".concat(IPv6SegmentFormat, ":){7}(?:").concat(IPv6SegmentFormat, "|:)|") + "(?:".concat(IPv6SegmentFormat, ":){6}(?:").concat(IPv4AddressFormat, "|:").concat(IPv6SegmentFormat, "|:)|") + "(?:".concat(IPv6SegmentFormat, ":){5}(?::").concat(IPv4AddressFormat, "|(:").concat(IPv6SegmentFormat, "){1,2}|:)|") + "(?:".concat(IPv6SegmentFormat, ":){4}(?:(:").concat(IPv6SegmentFormat, "){0,1}:").concat(IPv4AddressFormat, "|(:").concat(IPv6SegmentFormat, "){1,3}|:)|") + "(?:".concat(IPv6SegmentFormat, ":){3}(?:(:").concat(IPv6SegmentFormat, "){0,2}:").concat(IPv4AddressFormat, "|(:").concat(IPv6SegmentFormat, "){1,4}|:)|") + "(?:".concat(IPv6SegmentFormat, ":){2}(?:(:").concat(IPv6SegmentFormat, "){0,3}:").concat(IPv4AddressFormat, "|(:").concat(IPv6SegmentFormat, "){1,5}|:)|") + "(?:".concat(IPv6SegmentFormat, ":){1}(?:(:").concat(IPv6SegmentFormat, "){0,4}:").concat(IPv4AddressFormat, "|(:").concat(IPv6SegmentFormat, "){1,6}|:)|") + "(?::((?::".concat(IPv6SegmentFormat, "){0,5}:").concat(IPv4AddressFormat, "|(?::").concat(IPv6SegmentFormat, "){1,7}|:))") + ")(%[0-9a-zA-Z.]{1,})?$"); | |
| 5729 | - function isIP(ipAddress) { | |
| 5730 | - var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}; | |
| 5731 | - (0, _assertString.default)(ipAddress); | |
| 5732 | - var version = (_typeof(options) === "object" ? options.version : arguments[1]) || ""; | |
| 5733 | - if (!version) return isIP(ipAddress, { version: 4 }) || isIP(ipAddress, { version: 6 }); | |
| 5734 | - if (version.toString() === "4") return IPv4AddressRegExp.test(ipAddress); | |
| 5735 | - if (version.toString() === "6") return IPv6AddressRegExp.test(ipAddress); | |
| 5736 | - return false; | |
| 5737 | - } | |
| 5738 | - module.exports = exports.default; | |
| 5739 | - module.exports.default = exports.default; | |
| 5740 | - })); | |
| 5741 | 5616 | |
| 5742 | -//#endregion | |
| 5743 | -//#region node_modules/validator/lib/isURL.js | |
| 5744 | - var require_isURL = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 5745 | - Object.defineProperty(exports, "__esModule", { value: true }); | |
| 5746 | - exports.default = isURL; | |
| 5747 | - var _assertString = _interopRequireDefault(require_assertString()); | |
| 5748 | - var _checkHost = _interopRequireDefault(require_checkHost()); | |
| 5749 | - var _includesString = _interopRequireDefault(require_includesString()); | |
| 5750 | - var _isFQDN = _interopRequireDefault(require_isFQDN()); | |
| 5751 | - var _isIP = _interopRequireDefault(require_isIP()); | |
| 5752 | - var _merge = _interopRequireDefault(require_merge()); | |
| 5753 | - function _interopRequireDefault(e) { | |
| 5754 | - return e && e.__esModule ? e : { default: e }; | |
| 5755 | - } | |
| 5756 | - function _slicedToArray(r, e) { | |
| 5757 | - return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); | |
| 5758 | - } | |
| 5759 | - function _nonIterableRest() { | |
| 5760 | - throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); | |
| 5761 | - } | |
| 5762 | - function _unsupportedIterableToArray(r, a) { | |
| 5763 | - if (r) { | |
| 5764 | - if ("string" == typeof r) return _arrayLikeToArray(r, a); | |
| 5765 | - var t = {}.toString.call(r).slice(8, -1); | |
| 5766 | - 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; | |
| 5767 | - } | |
| 5768 | - } | |
| 5769 | - function _arrayLikeToArray(r, a) { | |
| 5770 | - (null == a || a > r.length) && (a = r.length); | |
| 5771 | - for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; | |
| 5772 | - return n; | |
| 5773 | - } | |
| 5774 | - function _iterableToArrayLimit(r, l) { | |
| 5775 | - var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; | |
| 5776 | - if (null != t) { | |
| 5777 | - var e; | |
| 5778 | - var n; | |
| 5779 | - var i; | |
| 5780 | - var u; | |
| 5781 | - var a = []; | |
| 5782 | - var f = !0; | |
| 5783 | - var o = !1; | |
| 5784 | - try { | |
| 5785 | - if (i = (t = t.call(r)).next, 0 === l) { | |
| 5786 | - if (Object(t) !== t) return; | |
| 5787 | - f = !1; | |
| 5788 | - } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); | |
| 5789 | - } catch (r) { | |
| 5790 | - o = !0, n = r; | |
| 5791 | - } finally { | |
| 5792 | - try { | |
| 5793 | - if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; | |
| 5794 | - } finally { | |
| 5795 | - if (o) throw n; | |
| 5796 | - } | |
| 5797 | - } | |
| 5798 | - return a; | |
| 5799 | - } | |
| 5800 | - } | |
| 5801 | - function _arrayWithHoles(r) { | |
| 5802 | - if (Array.isArray(r)) return r; | |
| 5803 | - } | |
| 5804 | - var default_url_options = { | |
| 5805 | - protocols: [ | |
| 5806 | - "http", | |
| 5807 | - "https", | |
| 5808 | - "ftp" | |
| 5809 | - ], | |
| 5810 | - require_tld: true, | |
| 5811 | - require_protocol: false, | |
| 5812 | - require_host: true, | |
| 5813 | - require_port: false, | |
| 5814 | - require_valid_protocol: true, | |
| 5815 | - allow_underscores: false, | |
| 5816 | - allow_trailing_dot: false, | |
| 5817 | - allow_protocol_relative_urls: false, | |
| 5818 | - allow_fragments: true, | |
| 5819 | - allow_query_components: true, | |
| 5820 | - validate_length: true, | |
| 5821 | - max_allowed_length: 2084 | |
| 5822 | - }; | |
| 5823 | - var wrapped_ipv6 = /^\[([^\]]+)\](?::([0-9]+))?$/; | |
| 5824 | - function isURL(url, options) { | |
| 5825 | - (0, _assertString.default)(url); | |
| 5826 | - if (!url || /[\s<>]/.test(url)) return false; | |
| 5827 | - if (url.indexOf("mailto:") === 0) return false; | |
| 5828 | - options = (0, _merge.default)(options, default_url_options); | |
| 5829 | - if (options.validate_length && url.length > options.max_allowed_length) return false; | |
| 5830 | - if (!options.allow_fragments && (0, _includesString.default)(url, "#")) return false; | |
| 5831 | - if (!options.allow_query_components && ((0, _includesString.default)(url, "?") || (0, _includesString.default)(url, "&"))) return false; | |
| 5832 | - var protocol; | |
| 5833 | - var auth; | |
| 5834 | - var host; | |
| 5835 | - var hostname; | |
| 5836 | - var port; | |
| 5837 | - var port_str; | |
| 5838 | - var split = url.split("#"); | |
| 5839 | - var ipv6; | |
| 5840 | - url = split.shift(); | |
| 5841 | - split = url.split("?"); | |
| 5842 | - url = split.shift(); | |
| 5843 | - var protocol_match = url.match(/^([a-z][a-z0-9+\-.]*):/i); | |
| 5844 | - var had_explicit_protocol = false; | |
| 5845 | - var cleanUpProtocol = function cleanUpProtocol(potential_protocol) { | |
| 5846 | - had_explicit_protocol = true; | |
| 5847 | - protocol = potential_protocol.toLowerCase(); | |
| 5848 | - if (options.require_valid_protocol && options.protocols.indexOf(protocol) === -1) return false; | |
| 5849 | - return url.substring(protocol_match[0].length); | |
| 5850 | - }; | |
| 5851 | - if (protocol_match) { | |
| 5852 | - var potential_protocol = protocol_match[1]; | |
| 5853 | - var after_colon = url.substring(protocol_match[0].length); | |
| 5854 | - if (!(after_colon.slice(0, 2) === "//")) { | |
| 5855 | - var first_slash_position = after_colon.indexOf("/"); | |
| 5856 | - var before_slash = first_slash_position === -1 ? after_colon : after_colon.substring(0, first_slash_position); | |
| 5857 | - var at_position = before_slash.indexOf("@"); | |
| 5858 | - if (at_position !== -1) { | |
| 5859 | - var before_at = before_slash.substring(0, at_position); | |
| 5860 | - if (/^[a-zA-Z0-9\-_.%:]*$/.test(before_at)) { | |
| 5861 | - if (options.require_protocol) return false; | |
| 5862 | - } else { | |
| 5863 | - url = cleanUpProtocol(potential_protocol); | |
| 5864 | - if (url === false) return false; | |
| 5865 | - } | |
| 5866 | - } else if (/^[0-9]/.test(after_colon)) { | |
| 5867 | - if (options.require_protocol) return false; | |
| 5868 | - } else { | |
| 5869 | - url = cleanUpProtocol(potential_protocol); | |
| 5870 | - if (url === false) return false; | |
| 5871 | - } | |
| 5872 | - } else { | |
| 5873 | - url = cleanUpProtocol(potential_protocol); | |
| 5874 | - if (url === false) return false; | |
| 5875 | - } | |
| 5876 | - } else if (options.require_protocol) return false; | |
| 5877 | - if (url.slice(0, 2) === "//") { | |
| 5878 | - if (!had_explicit_protocol && !options.allow_protocol_relative_urls) return false; | |
| 5879 | - url = url.slice(2); | |
| 5880 | - } | |
| 5881 | - if (url === "") return false; | |
| 5882 | - split = url.split("/"); | |
| 5883 | - url = split.shift(); | |
| 5884 | - if (url === "" && !options.require_host) return true; | |
| 5885 | - split = url.split("@"); | |
| 5886 | - if (split.length > 1) { | |
| 5887 | - if (options.disallow_auth) return false; | |
| 5888 | - if (split[0] === "") return false; | |
| 5889 | - auth = split.shift(); | |
| 5890 | - if (auth.indexOf(":") >= 0 && auth.split(":").length > 2) return false; | |
| 5891 | - var _auth$split2 = _slicedToArray(auth.split(":"), 2); | |
| 5892 | - var user = _auth$split2[0]; | |
| 5893 | - var password = _auth$split2[1]; | |
| 5894 | - if (user === "" && password === "") return false; | |
| 5895 | - } | |
| 5896 | - hostname = split.join("@"); | |
| 5897 | - port_str = null; | |
| 5898 | - ipv6 = null; | |
| 5899 | - var ipv6_match = hostname.match(wrapped_ipv6); | |
| 5900 | - if (ipv6_match) { | |
| 5901 | - host = ""; | |
| 5902 | - ipv6 = ipv6_match[1]; | |
| 5903 | - port_str = ipv6_match[2] || null; | |
| 5904 | - } else { | |
| 5905 | - split = hostname.split(":"); | |
| 5906 | - host = split.shift(); | |
| 5907 | - if (split.length) port_str = split.join(":"); | |
| 5908 | - } | |
| 5909 | - if (port_str !== null && port_str.length > 0) { | |
| 5910 | - port = parseInt(port_str, 10); | |
| 5911 | - if (!/^[0-9]+$/.test(port_str) || port <= 0 || port > 65535) return false; | |
| 5912 | - } else if (options.require_port) return false; | |
| 5913 | - if (options.host_whitelist) return (0, _checkHost.default)(host, options.host_whitelist); | |
| 5914 | - if (host === "" && !options.require_host) return true; | |
| 5915 | - if (!(0, _isIP.default)(host) && !(0, _isFQDN.default)(host, options) && (!ipv6 || !(0, _isIP.default)(ipv6, 6))) return false; | |
| 5916 | - host = host || ipv6; | |
| 5917 | - if (options.host_blacklist && (0, _checkHost.default)(host, options.host_blacklist)) return false; | |
| 5918 | - return true; | |
| 5919 | - } | |
| 5920 | - module.exports = exports.default; | |
| 5921 | - module.exports.default = exports.default; | |
| 5922 | - })); | |
| 5923 | 5617 | |
| 5924 | -//#endregion | |
| 5925 | -//#region modules/ai/assets/js/editor/icons/bulb-icon.js | |
| 5926 | - var BulbIcon; | |
| 5927 | - var init_bulb_icon = __esmMin((() => { | |
| 5928 | - init_extends(); | |
| 5929 | - BulbIcon = react.default.forwardRef(function(props, ref) { | |
| 5930 | - return /*#__PURE__*/ react.default.createElement(_elementor_ui.SvgIcon, _extends({}, props, { ref }), /*#__PURE__*/ react.default.createElement("svg", { | |
| 5931 | - width: "22", | |
| 5932 | - height: "22", | |
| 5933 | - viewBox: "0 0 22 22", | |
| 5934 | - fill: "none", | |
| 5935 | - xmlns: "http://www.w3.org/2000/svg" | |
| 5936 | - }, /*#__PURE__*/ react.default.createElement("g", { clipPath: "url(#clip0_10743_8902)" }, /*#__PURE__*/ react.default.createElement("path", { | |
| 5937 | - d: "M2.75 10.0833H3.66667M11 2.75V3.66667M18.3333 10.0833H19.25M5.13333 5.13333L5.775 5.775M16.8667 5.13333L16.225 5.775", | |
| 5938 | - stroke: "#2563EB", | |
| 5939 | - strokeWidth: "1.5", | |
| 5940 | - strokeLinecap: "round", | |
| 5941 | - strokeLinejoin: "round" | |
| 5942 | - }), /*#__PURE__*/ react.default.createElement("path", { | |
| 5943 | - d: "M9.16675 16.041C8.70841 15.1243 6.91205 13.2842 6.62523 12.366C6.3384 11.4477 6.34775 10.4626 6.65195 9.54997C6.95615 8.63738 7.53978 7.84362 8.32016 7.28116C9.10054 6.71869 10.0381 6.41602 11.0001 6.41602C11.962 6.41602 12.8996 6.71869 13.68 7.28116C14.4604 7.84362 15.044 8.63738 15.3482 9.54997C15.6524 10.4626 15.6618 11.4477 15.3749 12.366C15.0881 13.2842 13.2917 15.1243 12.8334 16.041C12.8334 16.041 12.7597 17.3762 12.8334 17.8743C12.8334 18.3606 12.6403 18.8269 12.2964 19.1707C11.9526 19.5145 11.4863 19.7077 11.0001 19.7077C10.5139 19.7077 10.0475 19.5145 9.70372 19.1707C9.3599 18.8269 9.16675 18.3606 9.16675 17.8743C9.2405 17.3762 9.16675 16.041 9.16675 16.041Z", | |
| 5944 | - stroke: "#2563EB", | |
| 5945 | - strokeWidth: "1.5", | |
| 5946 | - strokeLinecap: "round", | |
| 5947 | - strokeLinejoin: "round" | |
| 5948 | - }), /*#__PURE__*/ react.default.createElement("path", { | |
| 5949 | - d: "M10.0833 16.5H11.9166", | |
| 5950 | - stroke: "#2563EB", | |
| 5951 | - strokeWidth: "1.5", | |
| 5952 | - strokeLinecap: "round", | |
| 5953 | - strokeLinejoin: "round" | |
| 5954 | - })), /*#__PURE__*/ react.default.createElement("defs", null, /*#__PURE__*/ react.default.createElement("clipPath", { id: "clip0_10743_8902" }, /*#__PURE__*/ react.default.createElement("rect", { | |
| 5955 | - width: "22", | |
| 5956 | - height: "22", | |
| 5957 | - fill: "white" | |
| 5958 | - }))))); | |
| 5959 | - }); | |
| 5960 | - })); | |
| 5618 | +if (true) { | |
| 5619 | + (function() { | |
| 5620 | +'use strict'; | |
| 5961 | 5621 | |
| 5962 | -//#endregion | |
| 5963 | -//#region modules/ai/assets/js/editor/components/voice-promotion-alert.js | |
| 5964 | - function ownKeys$3(e, r) { | |
| 5965 | - var t = Object.keys(e); | |
| 5966 | - if (Object.getOwnPropertySymbols) { | |
| 5967 | - var o = Object.getOwnPropertySymbols(e); | |
| 5968 | - r && (o = o.filter(function(r) { | |
| 5969 | - return Object.getOwnPropertyDescriptor(e, r).enumerable; | |
| 5970 | - })), t.push.apply(t, o); | |
| 5971 | - } | |
| 5972 | - return t; | |
| 5973 | - } | |
| 5974 | - function _objectSpread$3(e) { | |
| 5975 | - for (var r = 1; r < arguments.length; r++) { | |
| 5976 | - var t = null != arguments[r] ? arguments[r] : {}; | |
| 5977 | - r % 2 ? ownKeys$3(Object(t), !0).forEach(function(r) { | |
| 5978 | - _defineProperty$1(e, r, t[r]); | |
| 5979 | - }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function(r) { | |
| 5980 | - Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); | |
| 5981 | - }); | |
| 5982 | - } | |
| 5983 | - return e; | |
| 5984 | - } | |
| 5985 | - var import_prop_types$8, VoicePromotionAlert; | |
| 5986 | - var init_voice_promotion_alert = __esmMin((() => { | |
| 5987 | - init_defineProperty$1(); | |
| 5988 | - init_bulb_icon(); | |
| 5989 | - init_use_introduction(); | |
| 5990 | - import_prop_types$8 = /* @__PURE__ */ __toESM(require_prop_types()); | |
| 5991 | - __name(ownKeys$3, "ownKeys"); | |
| 5992 | - __name(_objectSpread$3, "_objectSpread"); | |
| 5993 | - VoicePromotionAlert = function VoicePromotionAlert(props) { | |
| 5994 | - var _useIntroduction = useIntroduction(props.introductionKey); | |
| 5995 | - var isViewed = _useIntroduction.isViewed; | |
| 5996 | - var markAsViewed = _useIntroduction.markAsViewed; | |
| 5997 | - if (isViewed) return null; | |
| 5998 | - return /*#__PURE__*/ react.default.createElement(_elementor_ui.Box, { | |
| 5999 | - sx: _objectSpread$3({ mt: 2 }, props.sx), | |
| 6000 | - alignItems: "top" | |
| 6001 | - }, /*#__PURE__*/ react.default.createElement(_elementor_ui.Alert, { | |
| 6002 | - severity: "info", | |
| 6003 | - variant: "standard", | |
| 6004 | - icon: /*#__PURE__*/ react.default.createElement(BulbIcon, { sx: { alignSelf: "flex-start" } }), | |
| 6005 | - onClose: markAsViewed | |
| 6006 | - }, (0, _wordpress_i18n.__)("Get improved results from AI by adding personal context.", "elementor"), /*#__PURE__*/ react.default.createElement(_elementor_ui.Link, { | |
| 6007 | - onClick: function onClick() { | |
| 6008 | - return $e.route("panel/global/menu"); | |
| 6009 | - }, | |
| 6010 | - className: "elementor-clickable", | |
| 6011 | - style: { textDecoration: "none" }, | |
| 6012 | - color: "info.main", | |
| 6013 | - href: "#" | |
| 6014 | - }, (0, _wordpress_i18n.__)("Let’s do it", "elementor")))); | |
| 6015 | - }; | |
| 6016 | - VoicePromotionAlert.propTypes = { | |
| 6017 | - sx: import_prop_types$8.default.object, | |
| 6018 | - introductionKey: import_prop_types$8.default.string | |
| 6019 | - }; | |
| 6020 | - })); | |
| 5622 | +// The Symbol used to tag the ReactElement-like types. If there is no native Symbol | |
| 5623 | +// nor polyfill, then a plain number is used for performance. | |
| 5624 | +var hasSymbol = typeof Symbol === 'function' && Symbol.for; | |
| 5625 | +var REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7; | |
| 5626 | +var REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca; | |
| 5627 | +var REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb; | |
| 5628 | +var REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc; | |
| 5629 | +var REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2; | |
| 5630 | +var REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd; | |
| 5631 | +var REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary | |
| 5632 | +// (unstable) APIs that have been removed. Can we remove the symbols? | |
| 6021 | 5633 | |
| 6022 | -//#endregion | |
| 6023 | -//#region modules/ai/assets/js/editor/pages/form-layout/index.js | |
| 6024 | - var import_prop_types$7, import_isURL, _excluded$2, DirectionalMinimizeDiagonalIcon, DirectionalExpandDiagonalIcon, RegenerateButton, UseLayoutButton, isRegenerateButtonDisabled, FormLayout; | |
| 6025 | - var init_form_layout = __esmMin((() => { | |
| 6026 | - init_toConsumableArray(); | |
| 6027 | - init_objectWithoutProperties$1(); | |
| 6028 | - init_slicedToArray(); | |
| 6029 | - init_extends(); | |
| 6030 | - import_prop_types$7 = /* @__PURE__ */ __toESM(require_prop_types()); | |
| 6031 | - init_prompt_error_message(); | |
| 6032 | - init_unsaved_changes_alert(); | |
| 6033 | - init_layout_dialog(); | |
| 6034 | - init_prompt_form(); | |
| 6035 | - init_refresh_icon(); | |
| 6036 | - init_screenshot$1(); | |
| 6037 | - init_use_screenshots(); | |
| 6038 | - init_use_slider(); | |
| 6039 | - init_minimize_diagonal_icon(); | |
| 6040 | - init_expand_diagonal_icon(); | |
| 6041 | - init_config(); | |
| 6042 | - init_attachment(); | |
| 6043 | - init_prompt_power_notice(); | |
| 6044 | - init_attachments(); | |
| 6045 | - init_attach_dialog(); | |
| 6046 | - import_isURL = /* @__PURE__ */ __toESM(require_isURL()); | |
| 6047 | - init_voice_promotion_alert(); | |
| 6048 | - _excluded$2 = ["children"]; | |
| 6049 | - DirectionalMinimizeDiagonalIcon = (0, _elementor_ui.withDirection)(MinimizeDiagonalIcon); | |
| 6050 | - DirectionalExpandDiagonalIcon = (0, _elementor_ui.withDirection)(ExpandDiagonalIcon); | |
| 6051 | - RegenerateButton = function RegenerateButton(props) { | |
| 6052 | - return /*#__PURE__*/ react.default.createElement(_elementor_ui.Button, _extends({ | |
| 6053 | - size: "small", | |
| 6054 | - color: "secondary", | |
| 6055 | - startIcon: /*#__PURE__*/ react.default.createElement(RefreshIcon, null) | |
| 6056 | - }, props), (0, _wordpress_i18n.__)("Regenerate", "elementor")); | |
| 6057 | - }; | |
| 6058 | - UseLayoutButton = function UseLayoutButton(props) { | |
| 6059 | - return /*#__PURE__*/ react.default.createElement(_elementor_ui.Button, _extends({ | |
| 6060 | - size: "small", | |
| 6061 | - variant: "contained" | |
| 6062 | - }, props), (0, _wordpress_i18n.__)("Use Layout", "elementor")); | |
| 6063 | - }; | |
| 6064 | - UseLayoutButton.propTypes = { sx: import_prop_types$7.default.object }; | |
| 6065 | - isRegenerateButtonDisabled = function isRegenerateButtonDisabled(screenshots, isLoading, isPromptFormActive) { | |
| 6066 | - if (isLoading || isPromptFormActive) return true; | |
| 6067 | - return screenshots.length >= 3 * 5; | |
| 6068 | - }; | |
| 6069 | - FormLayout = function FormLayout(_ref) { | |
| 6070 | - var _screenshots$selected; | |
| 6071 | - var _screenshots$2; | |
| 6072 | - var _ref$DialogHeaderProp = _ref.DialogHeaderProps; | |
| 6073 | - var DialogHeaderProps = _ref$DialogHeaderProp === void 0 ? {} : _ref$DialogHeaderProp; | |
| 6074 | - var _ref$DialogContentPro = _ref.DialogContentProps; | |
| 6075 | - var DialogContentProps = _ref$DialogContentPro === void 0 ? {} : _ref$DialogContentPro; | |
| 6076 | - var initialAttachments = _ref.attachments; | |
| 6077 | - var _useConfig = useConfig(); | |
| 6078 | - var attachmentsTypes = _useConfig.attachmentsTypes; | |
| 6079 | - var onData = _useConfig.onData; | |
| 6080 | - var onInsert = _useConfig.onInsert; | |
| 6081 | - var onSelect = _useConfig.onSelect; | |
| 6082 | - var onClose = _useConfig.onClose; | |
| 6083 | - var onGenerate = _useConfig.onGenerate; | |
| 6084 | - var _useScreenshots = useScreenshots({ onData }); | |
| 6085 | - var screenshots = _useScreenshots.screenshots; | |
| 6086 | - var generate = _useScreenshots.generate; | |
| 6087 | - var regenerate = _useScreenshots.regenerate; | |
| 6088 | - var isLoading = _useScreenshots.isLoading; | |
| 6089 | - var error = _useScreenshots.error; | |
| 6090 | - var abort = _useScreenshots.abort; | |
| 6091 | - var screenshotOutlineOffset = "2px"; | |
| 6092 | - var _useSlider = useSlider({ slidesCount: screenshots.length }); | |
| 6093 | - var currentPage = _useSlider.currentPage; | |
| 6094 | - var setCurrentPage = _useSlider.setCurrentPage; | |
| 6095 | - var pagesCount = _useSlider.pagesCount; | |
| 6096 | - var gapPercentage = _useSlider.gapPercentage; | |
| 6097 | - var slidesPerPage = _useSlider.slidesPerPage; | |
| 6098 | - var offsetXPercentage = _useSlider.offsetXPercentage; | |
| 6099 | - var slideWidthPercentage = _useSlider.slideWidthPercentage; | |
| 6100 | - var _useState2 = _slicedToArray((0, react.useState)(-1), 2); | |
| 6101 | - var selectedScreenshotIndex = _useState2[0]; | |
| 6102 | - var setSelectedScreenshotIndex = _useState2[1]; | |
| 6103 | - var _useState4 = _slicedToArray((0, react.useState)(false), 2); | |
| 6104 | - var showUnsavedChangesAlert = _useState4[0]; | |
| 6105 | - var setShowUnsavedChangesAlert = _useState4[1]; | |
| 6106 | - var _useState6 = _slicedToArray((0, react.useState)(true), 2); | |
| 6107 | - var isPromptEditable = _useState6[0]; | |
| 6108 | - var setIsPromptEditable = _useState6[1]; | |
| 6109 | - var _useState8 = _slicedToArray((0, react.useState)([]), 2); | |
| 6110 | - var attachments = _useState8[0]; | |
| 6111 | - var setAttachments = _useState8[1]; | |
| 6112 | - var _useState0 = _slicedToArray((0, react.useState)(false), 2); | |
| 6113 | - var shouldRenderWebApp = _useState0[0]; | |
| 6114 | - var setShouldRenderWebApp = _useState0[1]; | |
| 6115 | - var _useState10 = _slicedToArray((0, react.useState)(false), 2); | |
| 6116 | - var isMinimized = _useState10[0]; | |
| 6117 | - var setIsMinimized = _useState10[1]; | |
| 6118 | - var lastRun = (0, react.useRef)(function() {}); | |
| 6119 | - var promptInputRef = (0, react.useRef)(null); | |
| 6120 | - var selectedTemplate = (_screenshots$selected = screenshots[selectedScreenshotIndex]) === null || _screenshots$selected === void 0 ? void 0 : _screenshots$selected.template; | |
| 6121 | - var dialogContentChildren = DialogContentProps.children; | |
| 6122 | - var dialogContentProps = _objectWithoutProperties$1(DialogContentProps, _excluded$2); | |
| 6123 | - var shouldFallbackToEditPrompt = !!(error && 0 === screenshots.length); | |
| 6124 | - var isPromptFormActive = isPromptEditable || shouldFallbackToEditPrompt; | |
| 6125 | - var abortAndClose = function abortAndClose() { | |
| 6126 | - abort(); | |
| 6127 | - onClose(); | |
| 6128 | - }; | |
| 6129 | - var onCloseIntent = function onCloseIntent() { | |
| 6130 | - if (promptInputRef.current.value.trim() !== "" || screenshots.length > 0) return setShowUnsavedChangesAlert(true); | |
| 6131 | - abortAndClose(); | |
| 6132 | - }; | |
| 6133 | - var handleGenerate = function handleGenerate(event, prompt) { | |
| 6134 | - event.preventDefault(); | |
| 6135 | - if ("" === prompt.trim() && 0 === attachments.length) return; | |
| 6136 | - if ((0, import_isURL.default)(prompt)) { | |
| 6137 | - setShouldRenderWebApp(true); | |
| 6138 | - return; | |
| 6139 | - } | |
| 6140 | - onGenerate(); | |
| 6141 | - lastRun.current = function() { | |
| 6142 | - setSelectedScreenshotIndex(-1); | |
| 6143 | - generate(prompt, attachments); | |
| 6144 | - }; | |
| 6145 | - lastRun.current(); | |
| 6146 | - setIsPromptEditable(false); | |
| 6147 | - setCurrentPage(1); | |
| 6148 | - }; | |
| 6149 | - var handleRegenerate = function handleRegenerate() { | |
| 6150 | - lastRun.current = function() { | |
| 6151 | - regenerate(promptInputRef.current.value, attachments); | |
| 6152 | - setCurrentPage(pagesCount + 1); | |
| 6153 | - }; | |
| 6154 | - lastRun.current(); | |
| 6155 | - }; | |
| 6156 | - var applyTemplate = function applyTemplate() { | |
| 6157 | - onInsert(selectedTemplate); | |
| 6158 | - screenshots[selectedScreenshotIndex].sendUsageData(); | |
| 6159 | - abortAndClose(); | |
| 6160 | - }; | |
| 6161 | - var handleScreenshotClick = function handleScreenshotClick(index, template) { | |
| 6162 | - return function() { | |
| 6163 | - if (isPromptFormActive) return; | |
| 6164 | - setSelectedScreenshotIndex(index); | |
| 6165 | - onSelect(template); | |
| 6166 | - }; | |
| 6167 | - }; | |
| 6168 | - /** | |
| 6169 | - * @param {Attachment[]} items | |
| 6170 | - */ | |
| 6171 | - var onAttach = function onAttach(items) { | |
| 6172 | - items.forEach(function(item) { | |
| 6173 | - if (!attachmentsTypes[item.type]) throw new Error("Invalid attachment type: ".concat(item.type)); | |
| 6174 | - var typeConfig = attachmentsTypes[item.type]; | |
| 6175 | - if (!item.previewHTML && typeConfig.previewGenerator) typeConfig.previewGenerator(item.content).then(function(html) { | |
| 6176 | - item.previewHTML = html; | |
| 6177 | - setAttachments(function(prev) { | |
| 6178 | - return prev.map(function(attachment) { | |
| 6179 | - if (attachment.content === item.content) return item; | |
| 6180 | - return attachment; | |
| 6181 | - }); | |
| 6182 | - }); | |
| 6183 | - }); | |
| 6184 | - }); | |
| 6185 | - setAttachments(items); | |
| 6186 | - setShouldRenderWebApp(false); | |
| 6187 | - setIsPromptEditable(true); | |
| 6188 | - }; | |
| 6189 | - (0, react.useEffect)(function() { | |
| 6190 | - var _screenshots$; | |
| 6191 | - if ((_screenshots$ = screenshots[0]) === null || _screenshots$ === void 0 ? void 0 : _screenshots$.template) { | |
| 6192 | - onSelect(screenshots[0].template); | |
| 6193 | - setSelectedScreenshotIndex(0); | |
| 6194 | - } | |
| 6195 | - }, [(_screenshots$2 = screenshots[0]) === null || _screenshots$2 === void 0 ? void 0 : _screenshots$2.template]); | |
| 6196 | - (0, react.useEffect)(function() { | |
| 6197 | - if (initialAttachments !== null && initialAttachments !== void 0 && initialAttachments.length) onAttach(initialAttachments); | |
| 6198 | - }, []); | |
| 6199 | - return /*#__PURE__*/ react.default.createElement(LayoutDialog, { onClose: onCloseIntent }, /*#__PURE__*/ react.default.createElement(LayoutDialog.Header, _extends({ onClose: onCloseIntent }, DialogHeaderProps), DialogHeaderProps.children, /*#__PURE__*/ react.default.createElement(_elementor_ui.Tooltip, { title: isMinimized ? (0, _wordpress_i18n.__)("Expand", "elementor") : (0, _wordpress_i18n.__)("Minimize", "elementor") }, /*#__PURE__*/ react.default.createElement(_elementor_ui.IconButton, { | |
| 6200 | - size: "small", | |
| 6201 | - "aria-label": "minimize", | |
| 6202 | - onClick: function onClick() { | |
| 6203 | - return setIsMinimized(function(prev) { | |
| 6204 | - return !prev; | |
| 6205 | - }); | |
| 6206 | - } | |
| 6207 | - }, isMinimized ? /*#__PURE__*/ react.default.createElement(DirectionalExpandDiagonalIcon, null) : /*#__PURE__*/ react.default.createElement(DirectionalMinimizeDiagonalIcon, null)))), /*#__PURE__*/ react.default.createElement(LayoutDialog.Content, _extends({ dividers: true }, dialogContentProps), /*#__PURE__*/ react.default.createElement(_elementor_ui.Collapse, { in: !isMinimized }, dialogContentChildren && /*#__PURE__*/ react.default.createElement(_elementor_ui.Box, { sx: { | |
| 6208 | - pt: 2, | |
| 6209 | - px: 2, | |
| 6210 | - pb: 0 | |
| 6211 | - } }, dialogContentChildren), attachments.length > 0 && /*#__PURE__*/ react.default.createElement(PromptPowerNotice, null), error && /*#__PURE__*/ react.default.createElement(_elementor_ui.Box, { sx: { | |
| 6212 | - pt: 2, | |
| 6213 | - px: 2, | |
| 6214 | - pb: 0 | |
| 6215 | - } }, /*#__PURE__*/ react.default.createElement(PromptErrorMessage, { | |
| 6216 | - error, | |
| 6217 | - onRetry: lastRun.current | |
| 6218 | - })), showUnsavedChangesAlert && /*#__PURE__*/ react.default.createElement(UnsavedChangesAlert, { | |
| 6219 | - open: showUnsavedChangesAlert, | |
| 6220 | - title: (0, _wordpress_i18n.__)("Leave Elementor AI?", "elementor"), | |
| 6221 | - text: (0, _wordpress_i18n.__)("Your progress will be deleted, and can't be recovered.", "elementor"), | |
| 6222 | - onClose: abortAndClose, | |
| 6223 | - onCancel: function onCancel() { | |
| 6224 | - return setShowUnsavedChangesAlert(false); | |
| 6225 | - } | |
| 6226 | - }), shouldRenderWebApp && /*#__PURE__*/ react.default.createElement(AttachDialog, { | |
| 6227 | - type: "url", | |
| 6228 | - url: promptInputRef.current.value, | |
| 6229 | - onAttach, | |
| 6230 | - onClose: function onClose() { | |
| 6231 | - setShouldRenderWebApp(false); | |
| 6232 | - } | |
| 6233 | - }), /*#__PURE__*/ react.default.createElement(PromptForm, { | |
| 6234 | - shouldResetPrompt: shouldRenderWebApp, | |
| 6235 | - ref: promptInputRef, | |
| 6236 | - isActive: isPromptFormActive, | |
| 6237 | - isLoading, | |
| 6238 | - showActions: screenshots.length > 0 || isLoading, | |
| 6239 | - attachmentsTypes, | |
| 6240 | - attachments, | |
| 6241 | - onAttach, | |
| 6242 | - onDetach: function onDetach(index) { | |
| 6243 | - setAttachments(function(prev) { | |
| 6244 | - var newAttachments = _toConsumableArray(prev); | |
| 6245 | - newAttachments.splice(index, 1); | |
| 6246 | - return newAttachments; | |
| 6247 | - }); | |
| 6248 | - setIsPromptEditable(true); | |
| 6249 | - }, | |
| 6250 | - onSubmit: handleGenerate, | |
| 6251 | - onBack: function onBack() { | |
| 6252 | - return setIsPromptEditable(false); | |
| 6253 | - }, | |
| 6254 | - onEdit: function onEdit() { | |
| 6255 | - return setIsPromptEditable(true); | |
| 6256 | - } | |
| 6257 | - }), (screenshots.length > 0 || isLoading) && /*#__PURE__*/ react.default.createElement(react.default.Fragment, null, /*#__PURE__*/ react.default.createElement(_elementor_ui.Divider, null), /*#__PURE__*/ react.default.createElement(_elementor_ui.Box, { sx: { p: 1.5 } }, /*#__PURE__*/ react.default.createElement(_elementor_ui.Box, { sx: { | |
| 6258 | - overflow: "hidden", | |
| 6259 | - p: .5 | |
| 6260 | - } }, /*#__PURE__*/ react.default.createElement(_elementor_ui.Box, { sx: { | |
| 6261 | - display: "flex", | |
| 6262 | - transition: "all 0.4s ease", | |
| 6263 | - gap: "".concat(gapPercentage, "%"), | |
| 6264 | - transform: "translateX(".concat(offsetXPercentage, "%)") | |
| 6265 | - } }, screenshots.map(function(_ref2, index) { | |
| 6266 | - var screenshot = _ref2.screenshot; | |
| 6267 | - var type = _ref2.type; | |
| 6268 | - var template = _ref2.template; | |
| 6269 | - var isError = _ref2.isError; | |
| 6270 | - var isPending = _ref2.isPending; | |
| 6271 | - return /*#__PURE__*/ react.default.createElement(Screenshot, { | |
| 6272 | - key: index, | |
| 6273 | - url: screenshot, | |
| 6274 | - type, | |
| 6275 | - disabled: isPromptFormActive, | |
| 6276 | - isPlaceholder: isError, | |
| 6277 | - isLoading: isPending, | |
| 6278 | - isSelected: selectedScreenshotIndex === index, | |
| 6279 | - onClick: handleScreenshotClick(index, template), | |
| 6280 | - outlineOffset: screenshotOutlineOffset, | |
| 6281 | - sx: { flex: "0 0 ".concat(slideWidthPercentage, "%") } | |
| 6282 | - }); | |
| 6283 | - }))), /*#__PURE__*/ react.default.createElement(VoicePromotionAlert, { introductionKey: "ai-context-layout-promotion" })), screenshots.length > 0 && /*#__PURE__*/ react.default.createElement(_elementor_ui.Box, { | |
| 6284 | - sx: { | |
| 6285 | - pt: 0, | |
| 6286 | - px: 2, | |
| 6287 | - pb: 2 | |
| 6288 | - }, | |
| 6289 | - display: "grid", | |
| 6290 | - gridTemplateColumns: "repeat(3, 1fr)", | |
| 6291 | - justifyItems: "center" | |
| 6292 | - }, /*#__PURE__*/ react.default.createElement(RegenerateButton, { | |
| 6293 | - onClick: handleRegenerate, | |
| 6294 | - disabled: isRegenerateButtonDisabled(screenshots, isLoading, isPromptFormActive), | |
| 6295 | - sx: { justifySelf: "start" } | |
| 6296 | - }), screenshots.length > slidesPerPage && /*#__PURE__*/ react.default.createElement(_elementor_ui.Pagination, { | |
| 6297 | - page: currentPage, | |
| 6298 | - count: pagesCount, | |
| 6299 | - disabled: isPromptFormActive, | |
| 6300 | - onChange: function onChange(_, page) { | |
| 6301 | - return setCurrentPage(page); | |
| 6302 | - } | |
| 6303 | - }), /*#__PURE__*/ react.default.createElement(UseLayoutButton, { | |
| 6304 | - onClick: applyTemplate, | |
| 6305 | - disabled: isPromptFormActive || -1 === selectedScreenshotIndex, | |
| 6306 | - sx: { | |
| 6307 | - justifySelf: "end", | |
| 6308 | - gridColumn: 3 | |
| 6309 | - } | |
| 6310 | - })))))); | |
| 6311 | - }; | |
| 6312 | - FormLayout.propTypes = { | |
| 6313 | - DialogHeaderProps: import_prop_types$7.default.object, | |
| 6314 | - DialogContentProps: import_prop_types$7.default.object, | |
| 6315 | - attachments: import_prop_types$7.default.arrayOf(AttachmentPropType) | |
| 6316 | - }; | |
| 6317 | - })); | |
| 5634 | +var REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf; | |
| 5635 | +var REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf; | |
| 5636 | +var REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0; | |
| 5637 | +var REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1; | |
| 5638 | +var REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8; | |
| 5639 | +var REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3; | |
| 5640 | +var REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4; | |
| 5641 | +var REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9; | |
| 5642 | +var REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5; | |
| 5643 | +var REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6; | |
| 5644 | +var REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7; | |
| 6318 | 5645 | |
| 6319 | -//#endregion | |
| 6320 | -//#region modules/ai/assets/js/editor/pages/get-started/index.js | |
| 6321 | - var import_regenerator$3, import_prop_types$6, GetStarted; | |
| 6322 | - var init_get_started = __esmMin((() => { | |
| 6323 | - init_asyncToGenerator$1(); | |
| 6324 | - init_slicedToArray(); | |
| 6325 | - import_regenerator$3 = /* @__PURE__ */ __toESM(require_regenerator()); | |
| 6326 | - import_prop_types$6 = /* @__PURE__ */ __toESM(require_prop_types()); | |
| 6327 | - init_api(); | |
| 6328 | - GetStarted = function GetStarted(_ref) { | |
| 6329 | - var onSuccess = _ref.onSuccess; | |
| 6330 | - var _useState2 = _slicedToArray((0, react.useState)(false), 2); | |
| 6331 | - var isTermsChecked = _useState2[0]; | |
| 6332 | - var setIsTermsChecked = _useState2[1]; | |
| 6333 | - var onGetStartedClick = /*#__PURE__*/ function() { | |
| 6334 | - var _ref2 = _asyncToGenerator$1(/*#__PURE__*/ import_regenerator$3.default.mark(function _callee() { | |
| 6335 | - return import_regenerator$3.default.wrap(function(_context) { | |
| 6336 | - while (1) switch (_context.prev = _context.next) { | |
| 6337 | - case 0: | |
| 6338 | - _context.next = 1; | |
| 6339 | - return setGetStarted(); | |
| 6340 | - case 1: onSuccess(); | |
| 6341 | - case 2: | |
| 6342 | - case "end": return _context.stop(); | |
| 6343 | - } | |
| 6344 | - }, _callee); | |
| 6345 | - })); | |
| 6346 | - return function onGetStartedClick() { | |
| 6347 | - return _ref2.apply(this, arguments); | |
| 6348 | - }; | |
| 6349 | - }(); | |
| 6350 | - return /*#__PURE__*/ react.default.createElement(_elementor_ui.Stack, { | |
| 6351 | - alignItems: "center", | |
| 6352 | - gap: 1.5 | |
| 6353 | - }, /*#__PURE__*/ react.default.createElement(_elementor_icons.AIIcon, { sx: { | |
| 6354 | - color: "text.primary", | |
| 6355 | - fontSize: "60px", | |
| 6356 | - mb: 1 | |
| 6357 | - } }), /*#__PURE__*/ react.default.createElement(_elementor_ui.Typography, { | |
| 6358 | - variant: "h4", | |
| 6359 | - sx: { color: "text.primary" } | |
| 6360 | - }, (0, _wordpress_i18n.__)("Step into the future with Elementor AI", "elementor")), /*#__PURE__*/ react.default.createElement(_elementor_ui.Typography, { variant: "body2" }, (0, _wordpress_i18n.__)("Create smarter with AI text and code generators built right into the editor.", "elementor")), /*#__PURE__*/ react.default.createElement(_elementor_ui.Stack, { | |
| 6361 | - direction: "row", | |
| 6362 | - gap: 1.5, | |
| 6363 | - alignItems: "flex-start" | |
| 6364 | - }, /*#__PURE__*/ react.default.createElement(_elementor_ui.Checkbox, { | |
| 6365 | - id: "e-ai-terms-approval", | |
| 6366 | - color: "secondary", | |
| 6367 | - checked: isTermsChecked, | |
| 6368 | - onClick: function onClick() { | |
| 6369 | - return setIsTermsChecked(function(prevState) { | |
| 6370 | - return !prevState; | |
| 6371 | - }); | |
| 6372 | - } | |
| 6373 | - }), /*#__PURE__*/ react.default.createElement(_elementor_ui.Stack, null, /*#__PURE__*/ react.default.createElement(_elementor_ui.Typography, { | |
| 6374 | - variant: "caption", | |
| 6375 | - sx: { maxWidth: 520 }, | |
| 6376 | - component: "label", | |
| 6377 | - htmlFor: "e-ai-terms-approval" | |
| 6378 | - }, " ", (0, _wordpress_i18n.__)("I approve the ", "elementor"), /*#__PURE__*/ react.default.createElement(_elementor_ui.Link, { | |
| 6379 | - href: "https://go.elementor.com/ai-terms/", | |
| 6380 | - target: "_blank", | |
| 6381 | - color: "info.main" | |
| 6382 | - }, (0, _wordpress_i18n.__)("Terms of Service", "elementor")), " & ", /*#__PURE__*/ react.default.createElement(_elementor_ui.Link, { | |
| 6383 | - href: "https://go.elementor.com/ai-privacy-policy/", | |
| 6384 | - target: "_blank", | |
| 6385 | - color: "info.main" | |
| 6386 | - }, (0, _wordpress_i18n.__)("Privacy Policy", "elementor")), (0, _wordpress_i18n.__)(" of the Elementor AI service.", "elementor"), /*#__PURE__*/ react.default.createElement("br", null), (0, _wordpress_i18n.__)("This includes consenting to the collection and use of data to improve user experience.", "elementor")))), /*#__PURE__*/ react.default.createElement(_elementor_ui.Button, { | |
| 6387 | - disabled: !isTermsChecked, | |
| 6388 | - variant: "contained", | |
| 6389 | - onClick: onGetStartedClick, | |
| 6390 | - sx: { | |
| 6391 | - mt: 1, | |
| 6392 | - "&:hover": { color: "primary.contrastText" } | |
| 6393 | - } | |
| 6394 | - }, (0, _wordpress_i18n.__)("Get Started", "elementor"))); | |
| 6395 | - }; | |
| 6396 | - GetStarted.propTypes = { onSuccess: import_prop_types$6.default.func.isRequired }; | |
| 6397 | - })); | |
| 5646 | +function isValidElementType(type) { | |
| 5647 | + return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill. | |
| 5648 | + type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE); | |
| 5649 | +} | |
| 6398 | 5650 | |
| 6399 | -//#endregion | |
| 6400 | -//#region modules/ai/assets/js/editor/components/loader.js | |
| 6401 | - function ownKeys$2(e, r) { | |
| 6402 | - var t = Object.keys(e); | |
| 6403 | - if (Object.getOwnPropertySymbols) { | |
| 6404 | - var o = Object.getOwnPropertySymbols(e); | |
| 6405 | - r && (o = o.filter(function(r) { | |
| 6406 | - return Object.getOwnPropertyDescriptor(e, r).enumerable; | |
| 6407 | - })), t.push.apply(t, o); | |
| 6408 | - } | |
| 6409 | - return t; | |
| 6410 | - } | |
| 6411 | - function _objectSpread$2(e) { | |
| 6412 | - for (var r = 1; r < arguments.length; r++) { | |
| 6413 | - var t = null != arguments[r] ? arguments[r] : {}; | |
| 6414 | - r % 2 ? ownKeys$2(Object(t), !0).forEach(function(r) { | |
| 6415 | - _defineProperty$1(e, r, t[r]); | |
| 6416 | - }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$2(Object(t)).forEach(function(r) { | |
| 6417 | - Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); | |
| 6418 | - }); | |
| 6419 | - } | |
| 6420 | - return e; | |
| 6421 | - } | |
| 6422 | - var import_prop_types$5, _excluded$1, Loader; | |
| 6423 | - var init_loader = __esmMin((() => { | |
| 6424 | - init_extends(); | |
| 6425 | - init_defineProperty$1(); | |
| 6426 | - init_objectWithoutProperties$1(); | |
| 6427 | - import_prop_types$5 = /* @__PURE__ */ __toESM(require_prop_types()); | |
| 6428 | - _excluded$1 = ["sx", "BoxProps"]; | |
| 6429 | - __name(ownKeys$2, "ownKeys"); | |
| 6430 | - __name(_objectSpread$2, "_objectSpread"); | |
| 6431 | - Loader = function Loader(_ref) { | |
| 6432 | - var _ref$sx = _ref.sx; | |
| 6433 | - var sx = _ref$sx === void 0 ? {} : _ref$sx; | |
| 6434 | - var _ref$BoxProps = _ref.BoxProps; | |
| 6435 | - var BoxProps = _ref$BoxProps === void 0 ? {} : _ref$BoxProps; | |
| 6436 | - var props = _objectWithoutProperties$1(_ref, _excluded$1); | |
| 6437 | - return /*#__PURE__*/ react.default.createElement(_elementor_ui.Box, _extends({ | |
| 6438 | - width: "100%", | |
| 6439 | - display: "flex", | |
| 6440 | - alignItems: "center" | |
| 6441 | - }, BoxProps, { sx: _objectSpread$2({ | |
| 6442 | - px: 1.5, | |
| 6443 | - minHeight: function minHeight(theme) { | |
| 6444 | - return theme.spacing(5); | |
| 6445 | - } | |
| 6446 | - }, BoxProps.sx || {}) }), /*#__PURE__*/ react.default.createElement(_elementor_ui.LinearProgress, _extends({ color: "secondary" }, props, { sx: _objectSpread$2({ width: "100%" }, sx) }))); | |
| 6447 | - }; | |
| 6448 | - Loader.propTypes = { | |
| 6449 | - sx: import_prop_types$5.default.object, | |
| 6450 | - BoxProps: import_prop_types$5.default.object | |
| 6451 | - }; | |
| 6452 | - })); | |
| 5651 | +function typeOf(object) { | |
| 5652 | + if (typeof object === 'object' && object !== null) { | |
| 5653 | + var $$typeof = object.$$typeof; | |
| 6453 | 5654 | |
| 6454 | -//#endregion | |
| 6455 | -//#region modules/ai/assets/js/editor/components/upgrade-chip.js | |
| 6456 | - var import_prop_types$4, popoverId, StyledContent, StyledArrow, upgradeBullets, Chip, UpgradeChip; | |
| 6457 | - var init_upgrade_chip = __esmMin((() => { | |
| 6458 | - init_slicedToArray(); | |
| 6459 | - import_prop_types$4 = /* @__PURE__ */ __toESM(require_prop_types()); | |
| 6460 | - popoverId = "e-ai-upgrade-popover"; | |
| 6461 | - StyledContent = (0, _elementor_ui.styled)(_elementor_ui.Paper)(function(_ref) { | |
| 6462 | - var theme = _ref.theme; | |
| 6463 | - return { | |
| 6464 | - position: "relative", | |
| 6465 | - "[data-popper-placement=\"top\"] &": { marginBottom: theme.spacing(2.5) }, | |
| 6466 | - "[data-popper-placement=\"bottom\"] &": { marginTop: theme.spacing(2.5) }, | |
| 6467 | - padding: theme.spacing(3), | |
| 6468 | - boxShadow: theme.shadows[4], | |
| 6469 | - zIndex: "9999" | |
| 6470 | - }; | |
| 6471 | - }); | |
| 6472 | - StyledArrow = (0, _elementor_ui.styled)(_elementor_ui.Box)(function(_ref2) { | |
| 6473 | - var theme = _ref2.theme; | |
| 6474 | - return { | |
| 6475 | - width: theme.spacing(5), | |
| 6476 | - height: theme.spacing(2.5), | |
| 6477 | - position: "absolute", | |
| 6478 | - overflow: "hidden", | |
| 6479 | - left: "50% !important", | |
| 6480 | - transform: "translateX(-50%) rotate(var(--rotate, 0deg)) !important", | |
| 6481 | - "[data-popper-placement=\"top\"] &": { top: "100%" }, | |
| 6482 | - "[data-popper-placement=\"bottom\"] &": { | |
| 6483 | - "--rotate": "180deg", | |
| 6484 | - top: "calc(".concat(theme.spacing(2.5), " * -1)") | |
| 6485 | - }, | |
| 6486 | - "&::after": { | |
| 6487 | - backgroundColor: theme.palette.background.paper, | |
| 6488 | - content: "\"\"", | |
| 6489 | - display: "block", | |
| 6490 | - position: "absolute", | |
| 6491 | - width: theme.spacing(2.5), | |
| 6492 | - height: theme.spacing(2.5), | |
| 6493 | - top: 0, | |
| 6494 | - left: "50%", | |
| 6495 | - transform: "translateX(-50%) translateY(-50%) rotate(45deg)", | |
| 6496 | - boxShadow: "1px 1px 5px 0px rgba(0, 0, 0, 0.2)", | |
| 6497 | - backgroundImage: "linear-gradient(rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.05))" | |
| 6498 | - } | |
| 6499 | - }; | |
| 6500 | - }); | |
| 6501 | - upgradeBullets = [ | |
| 6502 | - (0, _wordpress_i18n.__)("Get spot-on suggestions from AI Copilot and AI Context with appropriate designs, layouts, and content for your business.", "elementor"), | |
| 6503 | - (0, _wordpress_i18n.__)("Generate professional texts about any topic, in any tone.", "elementor"), | |
| 6504 | - (0, _wordpress_i18n.__)("Effortlessly create or enhance stunning images and bring your ideas to life.", "elementor"), | |
| 6505 | - (0, _wordpress_i18n.__)("Unleash infinite possibilities with the custom code generator.", "elementor"), | |
| 6506 | - (0, _wordpress_i18n.__)("Access 30-days of AI History with the AI Starter plan and 90-days with the Power plan.", "elementor") | |
| 6507 | - ]; | |
| 6508 | - Chip = (0, _elementor_ui.styled)(_elementor_ui.Chip)(function() { | |
| 6509 | - return { | |
| 6510 | - "& .MuiChip-label": { lineHeight: 1.5 }, | |
| 6511 | - "& .MuiSvgIcon-root.MuiChip-icon": { fontSize: "1.25rem" } | |
| 6512 | - }; | |
| 6513 | - }); | |
| 6514 | - UpgradeChip = function UpgradeChip(_ref3) { | |
| 6515 | - var _ref3$hasSubscription = _ref3.hasSubscription; | |
| 6516 | - var hasSubscription = _ref3$hasSubscription === void 0 ? false : _ref3$hasSubscription; | |
| 6517 | - var _ref3$usagePercentage = _ref3.usagePercentage; | |
| 6518 | - var usagePercentage = _ref3$usagePercentage === void 0 ? 0 : _ref3$usagePercentage; | |
| 6519 | - var _useState2 = _slicedToArray((0, react.useState)(false), 2); | |
| 6520 | - var isPopoverOpen = _useState2[0]; | |
| 6521 | - var setIsPopoverOpen = _useState2[1]; | |
| 6522 | - var anchorEl = (0, react.useRef)(null); | |
| 6523 | - var arrowEl = (0, react.useRef)(null); | |
| 6524 | - var showPopover = function showPopover() { | |
| 6525 | - return setIsPopoverOpen(true); | |
| 6526 | - }; | |
| 6527 | - var hidePopover = function hidePopover() { | |
| 6528 | - return setIsPopoverOpen(false); | |
| 6529 | - }; | |
| 6530 | - var actionUrl = "https://go.elementor.com/ai-popup-purchase-dropdown/"; | |
| 6531 | - if (hasSubscription) actionUrl = usagePercentage >= 100 ? "https://go.elementor.com/ai-popup-upgrade-limit-reached/" : "https://go.elementor.com/ai-popup-upgrade-limit-reached-80-percent/"; | |
| 6532 | - var actionLabel = hasSubscription ? (0, _wordpress_i18n.__)("Upgrade Elementor AI", "elementor") : (0, _wordpress_i18n.__)("Get Elementor AI", "elementor"); | |
| 6533 | - return /*#__PURE__*/ react.default.createElement(_elementor_ui.Box, { | |
| 6534 | - component: "span", | |
| 6535 | - "aria-owns": isPopoverOpen ? popoverId : void 0, | |
| 6536 | - "aria-haspopup": "true", | |
| 6537 | - onMouseEnter: showPopover, | |
| 6538 | - onMouseLeave: hidePopover, | |
| 6539 | - ref: anchorEl, | |
| 6540 | - display: "flex", | |
| 6541 | - alignItems: "center" | |
| 6542 | - }, /*#__PURE__*/ react.default.createElement(Chip, { | |
| 6543 | - color: "promotion", | |
| 6544 | - label: (0, _wordpress_i18n.__)("Upgrade", "elementor"), | |
| 6545 | - icon: /*#__PURE__*/ react.default.createElement(_elementor_icons.AIIcon, null), | |
| 6546 | - size: "small" | |
| 6547 | - }), /*#__PURE__*/ react.default.createElement(_elementor_ui.Popper, { | |
| 6548 | - open: isPopoverOpen, | |
| 6549 | - anchorEl: anchorEl.current, | |
| 6550 | - sx: { | |
| 6551 | - zIndex: "170001", | |
| 6552 | - maxWidth: 300 | |
| 6553 | - }, | |
| 6554 | - modifiers: [{ | |
| 6555 | - name: "arrow", | |
| 6556 | - enabled: true, | |
| 6557 | - options: { element: arrowEl.current } | |
| 6558 | - }] | |
| 6559 | - }, /*#__PURE__*/ react.default.createElement(StyledContent, null, /*#__PURE__*/ react.default.createElement(StyledArrow, { ref: arrowEl }), /*#__PURE__*/ react.default.createElement(_elementor_ui.Typography, { | |
| 6560 | - variant: "h5", | |
| 6561 | - color: "text.primary" | |
| 6562 | - }, (0, _wordpress_i18n.__)("Unlimited access to Elementor AI", "elementor")), /*#__PURE__*/ react.default.createElement(_elementor_ui.List, { sx: { mb: 1 } }, upgradeBullets.map(function(bullet, index) { | |
| 6563 | - return /*#__PURE__*/ react.default.createElement(_elementor_ui.ListItem, { | |
| 6564 | - key: index, | |
| 6565 | - disableGutters: true, | |
| 6566 | - sx: { alignItems: "flex-start" } | |
| 6567 | - }, /*#__PURE__*/ react.default.createElement(_elementor_ui.ListItemIcon, null, /*#__PURE__*/ react.default.createElement(_elementor_icons.CheckedCircleIcon, null)), /*#__PURE__*/ react.default.createElement(_elementor_ui.ListItemText, { sx: { m: 0 } }, /*#__PURE__*/ react.default.createElement(_elementor_ui.Typography, { variant: "body2" }, bullet))); | |
| 6568 | - })), /*#__PURE__*/ react.default.createElement(_elementor_ui.Button, { | |
| 6569 | - variant: "contained", | |
| 6570 | - color: "promotion", | |
| 6571 | - size: "small", | |
| 6572 | - href: actionUrl, | |
| 6573 | - target: "_blank", | |
| 6574 | - startIcon: /*#__PURE__*/ react.default.createElement(_elementor_icons.AIIcon, null), | |
| 6575 | - sx: { "&:hover": { color: "promotion.contrastText" } } | |
| 6576 | - }, actionLabel)))); | |
| 6577 | - }; | |
| 6578 | - UpgradeChip.propTypes = { | |
| 6579 | - hasSubscription: import_prop_types$4.default.bool, | |
| 6580 | - usagePercentage: import_prop_types$4.default.number | |
| 6581 | - }; | |
| 6582 | - })); | |
| 5655 | + switch ($$typeof) { | |
| 5656 | + case REACT_ELEMENT_TYPE: | |
| 5657 | + var type = object.type; | |
| 6583 | 5658 | |
| 6584 | -//#endregion | |
| 6585 | -//#region modules/ai/assets/js/editor/components/wizard-dialog.js | |
| 6586 | - function ownKeys$1(e, r) { | |
| 6587 | - var t = Object.keys(e); | |
| 6588 | - if (Object.getOwnPropertySymbols) { | |
| 6589 | - var o = Object.getOwnPropertySymbols(e); | |
| 6590 | - r && (o = o.filter(function(r) { | |
| 6591 | - return Object.getOwnPropertyDescriptor(e, r).enumerable; | |
| 6592 | - })), t.push.apply(t, o); | |
| 6593 | - } | |
| 6594 | - return t; | |
| 6595 | - } | |
| 6596 | - function _objectSpread$1(e) { | |
| 6597 | - for (var r = 1; r < arguments.length; r++) { | |
| 6598 | - var t = null != arguments[r] ? arguments[r] : {}; | |
| 6599 | - r % 2 ? ownKeys$1(Object(t), !0).forEach(function(r) { | |
| 6600 | - _defineProperty$1(e, r, t[r]); | |
| 6601 | - }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$1(Object(t)).forEach(function(r) { | |
| 6602 | - Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); | |
| 6603 | - }); | |
| 6604 | - } | |
| 6605 | - return e; | |
| 6606 | - } | |
| 6607 | - var import_prop_types$3, _excluded, WizardDialog, WizardDialogContent; | |
| 6608 | - var init_wizard_dialog = __esmMin((() => { | |
| 6609 | - init_extends(); | |
| 6610 | - init_defineProperty$1(); | |
| 6611 | - init_objectWithoutProperties$1(); | |
| 6612 | - import_prop_types$3 = /* @__PURE__ */ __toESM(require_prop_types()); | |
| 6613 | - init_dialog_header(); | |
| 6614 | - _excluded = ["sx"]; | |
| 6615 | - __name(ownKeys$1, "ownKeys"); | |
| 6616 | - __name(_objectSpread$1, "_objectSpread"); | |
| 6617 | - WizardDialog = function WizardDialog(props) { | |
| 6618 | - return /*#__PURE__*/ react.default.createElement(_elementor_ui.Dialog, { | |
| 6619 | - open: true, | |
| 6620 | - onClose: props.onClose, | |
| 6621 | - fullWidth: true, | |
| 6622 | - hideBackdrop: true, | |
| 6623 | - maxWidth: "lg", | |
| 6624 | - PaperProps: { sx: { height: "88vh" } }, | |
| 6625 | - sx: { zIndex: 9999 } | |
| 6626 | - }, props.children); | |
| 6627 | - }; | |
| 6628 | - WizardDialog.propTypes = { | |
| 6629 | - onClose: import_prop_types$3.default.func.isRequired, | |
| 6630 | - children: import_prop_types$3.default.node.isRequired | |
| 6631 | - }; | |
| 6632 | - WizardDialogContent = function WizardDialogContent(_ref) { | |
| 6633 | - var _ref$sx = _ref.sx; | |
| 6634 | - var sx = _ref$sx === void 0 ? {} : _ref$sx; | |
| 6635 | - var props = _objectWithoutProperties$1(_ref, _excluded); | |
| 6636 | - return /*#__PURE__*/ react.default.createElement(_elementor_ui.DialogContent, _extends({}, props, { sx: _objectSpread$1({ | |
| 6637 | - display: "flex", | |
| 6638 | - flexDirection: "column", | |
| 6639 | - justifyContent: "center" | |
| 6640 | - }, sx) })); | |
| 6641 | - }; | |
| 6642 | - WizardDialogContent.propTypes = { sx: import_prop_types$3.default.object }; | |
| 6643 | - WizardDialog.Header = DialogHeader$1; | |
| 6644 | - WizardDialog.Content = WizardDialogContent; | |
| 6645 | - })); | |
| 5659 | + switch (type) { | |
| 5660 | + case REACT_ASYNC_MODE_TYPE: | |
| 5661 | + case REACT_CONCURRENT_MODE_TYPE: | |
| 5662 | + case REACT_FRAGMENT_TYPE: | |
| 5663 | + case REACT_PROFILER_TYPE: | |
| 5664 | + case REACT_STRICT_MODE_TYPE: | |
| 5665 | + case REACT_SUSPENSE_TYPE: | |
| 5666 | + return type; | |
| 6646 | 5667 | |
| 6647 | -//#endregion | |
| 6648 | -//#region modules/ai/assets/js/editor/layout-content.js | |
| 6649 | - var import_prop_types$2, LayoutContent; | |
| 6650 | - var init_layout_content = __esmMin((() => { | |
| 6651 | - init_slicedToArray(); | |
| 6652 | - init_connect(); | |
| 6653 | - init_form_layout(); | |
| 6654 | - init_get_started(); | |
| 6655 | - init_loader(); | |
| 6656 | - init_upgrade_chip(); | |
| 6657 | - init_use_user_info(); | |
| 6658 | - init_wizard_dialog(); | |
| 6659 | - init_layout_dialog(); | |
| 6660 | - import_prop_types$2 = /* @__PURE__ */ __toESM(require_prop_types()); | |
| 6661 | - init_attachment(); | |
| 6662 | - init_config(); | |
| 6663 | - init_requests_ids(); | |
| 6664 | - LayoutContent = function LayoutContent(props) { | |
| 6665 | - var _useUserInfo = useUserInfo(); | |
| 6666 | - var isLoading = _useUserInfo.isLoading; | |
| 6667 | - var isConnected = _useUserInfo.isConnected; | |
| 6668 | - var isGetStarted = _useUserInfo.isGetStarted; | |
| 6669 | - var connectUrl = _useUserInfo.connectUrl; | |
| 6670 | - var fetchData = _useUserInfo.fetchData; | |
| 6671 | - var hasSubscription = _useUserInfo.hasSubscription; | |
| 6672 | - var initialUsagePercentage = _useUserInfo.usagePercentage; | |
| 6673 | - var _useConfig = useConfig(); | |
| 6674 | - var onClose = _useConfig.onClose; | |
| 6675 | - var onConnect = _useConfig.onConnect; | |
| 6676 | - var _useRequestIds = useRequestIds(); | |
| 6677 | - var updateUsagePercentage = _useRequestIds.updateUsagePercentage; | |
| 6678 | - var usagePercentage = _useRequestIds.usagePercentage; | |
| 6679 | - var _useState2 = _slicedToArray((0, react.useState)(false), 2); | |
| 6680 | - var isInitUsageDone = _useState2[0]; | |
| 6681 | - var setIsInitUsageDone = _useState2[1]; | |
| 6682 | - (0, react.useEffect)(function() { | |
| 6683 | - if (!isInitUsageDone && !isLoading && (initialUsagePercentage || 0 === initialUsagePercentage)) { | |
| 6684 | - updateUsagePercentage(initialUsagePercentage); | |
| 6685 | - setIsInitUsageDone(true); | |
| 6686 | - } | |
| 6687 | - }, [ | |
| 6688 | - isLoading, | |
| 6689 | - initialUsagePercentage, | |
| 6690 | - isInitUsageDone, | |
| 6691 | - updateUsagePercentage | |
| 6692 | - ]); | |
| 6693 | - if (isLoading || !isInitUsageDone) return /*#__PURE__*/ react.default.createElement(LayoutDialog, { onClose }, /*#__PURE__*/ react.default.createElement(LayoutDialog.Header, { onClose }), /*#__PURE__*/ react.default.createElement(LayoutDialog.Content, { dividers: true }, /*#__PURE__*/ react.default.createElement(Loader, { BoxProps: { sx: { px: 3 } } }))); | |
| 6694 | - if (!isConnected) return /*#__PURE__*/ react.default.createElement(WizardDialog, { onClose }, /*#__PURE__*/ react.default.createElement(LayoutDialog, { onClose }), /*#__PURE__*/ react.default.createElement(WizardDialog.Content, { dividers: true }, /*#__PURE__*/ react.default.createElement(Connect, { | |
| 6695 | - connectUrl, | |
| 6696 | - onSuccess: function onSuccess(data) { | |
| 6697 | - onConnect(data); | |
| 6698 | - fetchData(); | |
| 6699 | - } | |
| 6700 | - }))); | |
| 6701 | - if (!isGetStarted) return /*#__PURE__*/ react.default.createElement(WizardDialog, { onClose }, /*#__PURE__*/ react.default.createElement(LayoutDialog, { onClose }), /*#__PURE__*/ react.default.createElement(WizardDialog.Content, { dividers: true }, /*#__PURE__*/ react.default.createElement(GetStarted, { onSuccess: fetchData }))); | |
| 6702 | - var showUpgradeChip = !hasSubscription || 80 <= usagePercentage; | |
| 6703 | - return /*#__PURE__*/ react.default.createElement(FormLayout, { | |
| 6704 | - attachments: props.attachments, | |
| 6705 | - DialogHeaderProps: { children: showUpgradeChip && /*#__PURE__*/ react.default.createElement(UpgradeChip, { | |
| 6706 | - hasSubscription, | |
| 6707 | - usagePercentage | |
| 6708 | - }) } | |
| 6709 | - }); | |
| 6710 | - }; | |
| 6711 | - LayoutContent.propTypes = { attachments: import_prop_types$2.default.arrayOf(AttachmentPropType) }; | |
| 6712 | - })); | |
| 5668 | + default: | |
| 5669 | + var $$typeofType = type && type.$$typeof; | |
| 6713 | 5670 | |
| 6714 | -//#endregion | |
| 6715 | -//#region modules/ai/assets/js/editor/layout-app.js | |
| 6716 | - var import_prop_types$1, LayoutApp; | |
| 6717 | - var init_layout_app = __esmMin((() => { | |
| 6718 | - import_prop_types$1 = /* @__PURE__ */ __toESM(require_prop_types()); | |
| 6719 | - init_layout_content(); | |
| 6720 | - init_attachment(); | |
| 6721 | - init_config(); | |
| 6722 | - init_remote_config(); | |
| 6723 | - init_requests_ids(); | |
| 6724 | - LayoutApp = function LayoutApp(props) { | |
| 6725 | - return /*#__PURE__*/ react.default.createElement(RemoteConfigProvider, { onError: props.onClose }, /*#__PURE__*/ react.default.createElement(RequestIdsProvider, null, /*#__PURE__*/ react.default.createElement(ConfigProvider, { | |
| 6726 | - mode: props.mode, | |
| 6727 | - attachmentsTypes: props.attachmentsTypes, | |
| 6728 | - onClose: props.onClose, | |
| 6729 | - onConnect: props.onConnect, | |
| 6730 | - onData: props.onData, | |
| 6731 | - onInsert: props.onInsert, | |
| 6732 | - onSelect: props.onSelect, | |
| 6733 | - onGenerate: props.onGenerate, | |
| 6734 | - currentContext: props.currentContext, | |
| 6735 | - hasPro: props.hasPro | |
| 6736 | - }, /*#__PURE__*/ react.default.createElement(LayoutContent, { attachments: props.attachments })))); | |
| 6737 | - }; | |
| 6738 | - LayoutApp.propTypes = { | |
| 6739 | - mode: import_prop_types$1.default.oneOf(LAYOUT_APP_MODES).isRequired, | |
| 6740 | - attachmentsTypes: AttachmentsTypesPropType, | |
| 6741 | - attachments: import_prop_types$1.default.arrayOf(AttachmentPropType), | |
| 6742 | - onClose: import_prop_types$1.default.func.isRequired, | |
| 6743 | - onConnect: import_prop_types$1.default.func.isRequired, | |
| 6744 | - onData: import_prop_types$1.default.func.isRequired, | |
| 6745 | - onInsert: import_prop_types$1.default.func.isRequired, | |
| 6746 | - onSelect: import_prop_types$1.default.func.isRequired, | |
| 6747 | - onGenerate: import_prop_types$1.default.func.isRequired, | |
| 6748 | - currentContext: import_prop_types$1.default.object, | |
| 6749 | - hasPro: import_prop_types$1.default.bool | |
| 6750 | - }; | |
| 6751 | - })); | |
| 5671 | + switch ($$typeofType) { | |
| 5672 | + case REACT_CONTEXT_TYPE: | |
| 5673 | + case REACT_FORWARD_REF_TYPE: | |
| 5674 | + case REACT_LAZY_TYPE: | |
| 5675 | + case REACT_MEMO_TYPE: | |
| 5676 | + case REACT_PROVIDER_TYPE: | |
| 5677 | + return $$typeofType; | |
| 6752 | 5678 | |
| 6753 | -//#endregion | |
| 6754 | -//#region \0@[email protected]/helpers/esm/asyncToGenerator.js | |
| 6755 | - function asyncGeneratorStep(n, t, e, r, o, a, c) { | |
| 6756 | - try { | |
| 6757 | - var i = n[a](c); | |
| 6758 | - var u = i.value; | |
| 6759 | - } catch (n) { | |
| 6760 | - e(n); | |
| 6761 | - return; | |
| 6762 | - } | |
| 6763 | - i.done ? t(u) : Promise.resolve(u).then(r, o); | |
| 6764 | - } | |
| 6765 | - function _asyncToGenerator(n) { | |
| 6766 | - return function() { | |
| 6767 | - var t = this; | |
| 6768 | - var e = arguments; | |
| 6769 | - return new Promise(function(r, o) { | |
| 6770 | - var a = n.apply(t, e); | |
| 6771 | - function _next(n) { | |
| 6772 | - asyncGeneratorStep(a, r, o, _next, _throw, "next", n); | |
| 6773 | - } | |
| 6774 | - function _throw(n) { | |
| 6775 | - asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); | |
| 6776 | - } | |
| 6777 | - _next(void 0); | |
| 6778 | - }); | |
| 6779 | - }; | |
| 6780 | - } | |
| 6781 | - var init_asyncToGenerator = __esmMin((() => {})); | |
| 5679 | + default: | |
| 5680 | + return $$typeof; | |
| 5681 | + } | |
| 6782 | 5682 | |
| 6783 | -//#endregion | |
| 6784 | -//#region node_modules/html-to-image/es/util.js | |
| 6785 | - function resolveUrl(url, baseUrl) { | |
| 6786 | - if (url.match(/^[a-z]+:\/\//i)) return url; | |
| 6787 | - if (url.match(/^\/\//)) return window.location.protocol + url; | |
| 6788 | - if (url.match(/^[a-z]+:/i)) return url; | |
| 6789 | - const doc = document.implementation.createHTMLDocument(); | |
| 6790 | - const base = doc.createElement("base"); | |
| 6791 | - const a = doc.createElement("a"); | |
| 6792 | - doc.head.appendChild(base); | |
| 6793 | - doc.body.appendChild(a); | |
| 6794 | - if (baseUrl) base.href = baseUrl; | |
| 6795 | - a.href = url; | |
| 6796 | - return a.href; | |
| 6797 | - } | |
| 6798 | - function toArray(arrayLike) { | |
| 6799 | - const arr = []; | |
| 6800 | - for (let i = 0, l = arrayLike.length; i < l; i++) arr.push(arrayLike[i]); | |
| 6801 | - return arr; | |
| 6802 | - } | |
| 6803 | - function getStyleProperties(options = {}) { | |
| 6804 | - if (styleProps) return styleProps; | |
| 6805 | - if (options.includeStyleProperties) { | |
| 6806 | - styleProps = options.includeStyleProperties; | |
| 6807 | - return styleProps; | |
| 6808 | - } | |
| 6809 | - styleProps = toArray(window.getComputedStyle(document.documentElement)); | |
| 6810 | - return styleProps; | |
| 6811 | - } | |
| 6812 | - function px(node, styleProperty) { | |
| 6813 | - const val = (node.ownerDocument.defaultView || window).getComputedStyle(node).getPropertyValue(styleProperty); | |
| 6814 | - return val ? parseFloat(val.replace("px", "")) : 0; | |
| 6815 | - } | |
| 6816 | - function getNodeWidth(node) { | |
| 6817 | - const leftBorder = px(node, "border-left-width"); | |
| 6818 | - const rightBorder = px(node, "border-right-width"); | |
| 6819 | - return node.clientWidth + leftBorder + rightBorder; | |
| 6820 | - } | |
| 6821 | - function getNodeHeight(node) { | |
| 6822 | - const topBorder = px(node, "border-top-width"); | |
| 6823 | - const bottomBorder = px(node, "border-bottom-width"); | |
| 6824 | - return node.clientHeight + topBorder + bottomBorder; | |
| 6825 | - } | |
| 6826 | - function getImageSize(targetNode, options = {}) { | |
| 6827 | - return { | |
| 6828 | - width: options.width || getNodeWidth(targetNode), | |
| 6829 | - height: options.height || getNodeHeight(targetNode) | |
| 6830 | - }; | |
| 6831 | - } | |
| 6832 | - function getPixelRatio() { | |
| 6833 | - let ratio; | |
| 6834 | - let FINAL_PROCESS; | |
| 6835 | - try { | |
| 6836 | - FINAL_PROCESS = process; | |
| 6837 | - } catch (e) {} | |
| 6838 | - const val = FINAL_PROCESS && FINAL_PROCESS.env ? FINAL_PROCESS.env.devicePixelRatio : null; | |
| 6839 | - if (val) { | |
| 6840 | - ratio = parseInt(val, 10); | |
| 6841 | - if (Number.isNaN(ratio)) ratio = 1; | |
| 6842 | - } | |
| 6843 | - return ratio || window.devicePixelRatio || 1; | |
| 6844 | - } | |
| 6845 | - function checkCanvasDimensions(canvas) { | |
| 6846 | - if (canvas.width > canvasDimensionLimit || canvas.height > canvasDimensionLimit) if (canvas.width > canvasDimensionLimit && canvas.height > canvasDimensionLimit) if (canvas.width > canvas.height) { | |
| 6847 | - canvas.height *= canvasDimensionLimit / canvas.width; | |
| 6848 | - canvas.width = canvasDimensionLimit; | |
| 6849 | - } else { | |
| 6850 | - canvas.width *= canvasDimensionLimit / canvas.height; | |
| 6851 | - canvas.height = canvasDimensionLimit; | |
| 6852 | - } | |
| 6853 | - else if (canvas.width > canvasDimensionLimit) { | |
| 6854 | - canvas.height *= canvasDimensionLimit / canvas.width; | |
| 6855 | - canvas.width = canvasDimensionLimit; | |
| 6856 | - } else { | |
| 6857 | - canvas.width *= canvasDimensionLimit / canvas.height; | |
| 6858 | - canvas.height = canvasDimensionLimit; | |
| 6859 | - } | |
| 6860 | - } | |
| 6861 | - function createImage(url) { | |
| 6862 | - return new Promise((resolve, reject) => { | |
| 6863 | - const img = new Image(); | |
| 6864 | - img.onload = () => { | |
| 6865 | - img.decode().then(() => { | |
| 6866 | - requestAnimationFrame(() => resolve(img)); | |
| 6867 | - }); | |
| 6868 | - }; | |
| 6869 | - img.onerror = reject; | |
| 6870 | - img.crossOrigin = "anonymous"; | |
| 6871 | - img.decoding = "async"; | |
| 6872 | - img.src = url; | |
| 6873 | - }); | |
| 6874 | - } | |
| 6875 | - function svgToDataURL(_x) { | |
| 6876 | - return _svgToDataURL.apply(this, arguments); | |
| 6877 | - } | |
| 6878 | - function _svgToDataURL() { | |
| 6879 | - _svgToDataURL = _asyncToGenerator(function* (svg) { | |
| 6880 | - return Promise.resolve().then(() => new XMLSerializer().serializeToString(svg)).then(encodeURIComponent).then((html) => `data:image/svg+xml;charset=utf-8,${html}`); | |
| 6881 | - }); | |
| 6882 | - return _svgToDataURL.apply(this, arguments); | |
| 6883 | - } | |
| 6884 | - function nodeToDataURL(_x2, _x3, _x4) { | |
| 6885 | - return _nodeToDataURL.apply(this, arguments); | |
| 6886 | - } | |
| 6887 | - function _nodeToDataURL() { | |
| 6888 | - _nodeToDataURL = _asyncToGenerator(function* (node, width, height) { | |
| 6889 | - const xmlns = "http://www.w3.org/2000/svg"; | |
| 6890 | - const svg = document.createElementNS(xmlns, "svg"); | |
| 6891 | - const foreignObject = document.createElementNS(xmlns, "foreignObject"); | |
| 6892 | - svg.setAttribute("width", `${width}`); | |
| 6893 | - svg.setAttribute("height", `${height}`); | |
| 6894 | - svg.setAttribute("viewBox", `0 0 ${width} ${height}`); | |
| 6895 | - foreignObject.setAttribute("width", "100%"); | |
| 6896 | - foreignObject.setAttribute("height", "100%"); | |
| 6897 | - foreignObject.setAttribute("x", "0"); | |
| 6898 | - foreignObject.setAttribute("y", "0"); | |
| 6899 | - foreignObject.setAttribute("externalResourcesRequired", "true"); | |
| 6900 | - svg.appendChild(foreignObject); | |
| 6901 | - foreignObject.appendChild(node); | |
| 6902 | - return svgToDataURL(svg); | |
| 6903 | - }); | |
| 6904 | - return _nodeToDataURL.apply(this, arguments); | |
| 6905 | - } | |
| 6906 | - var uuid, styleProps, canvasDimensionLimit, isInstanceOfElement; | |
| 6907 | - var init_util = __esmMin((() => { | |
| 6908 | - init_asyncToGenerator(); | |
| 6909 | - uuid = (() => { | |
| 6910 | - let counter = 0; | |
| 6911 | - const random = () => `0000${(Math.random() * Math.pow(36, 4) << 0).toString(36)}`.slice(-4); | |
| 6912 | - return () => { | |
| 6913 | - counter += 1; | |
| 6914 | - return `u${random()}${counter}`; | |
| 6915 | - }; | |
| 6916 | - })(); | |
| 6917 | - styleProps = null; | |
| 6918 | - canvasDimensionLimit = 16384; | |
| 6919 | - isInstanceOfElement = (node, instance) => { | |
| 6920 | - if (node instanceof instance) return true; | |
| 6921 | - const nodePrototype = Object.getPrototypeOf(node); | |
| 6922 | - if (nodePrototype === null) return false; | |
| 6923 | - return nodePrototype.constructor.name === instance.name || isInstanceOfElement(nodePrototype, instance); | |
| 6924 | - }; | |
| 6925 | - })); | |
| 5683 | + } | |
| 6926 | 5684 | |
| 6927 | -//#endregion | |
| 6928 | -//#region node_modules/html-to-image/es/clone-pseudos.js | |
| 6929 | - function formatCSSText(style) { | |
| 6930 | - const content = style.getPropertyValue("content"); | |
| 6931 | - return `${style.cssText} content: '${content.replace(/'|"/g, "")}';`; | |
| 6932 | - } | |
| 6933 | - function formatCSSProperties(style, options) { | |
| 6934 | - return getStyleProperties(options).map((name) => { | |
| 6935 | - return `${name}: ${style.getPropertyValue(name)}${style.getPropertyPriority(name) ? " !important" : ""};`; | |
| 6936 | - }).join(" "); | |
| 6937 | - } | |
| 6938 | - function getPseudoElementStyle(className, pseudo, style, options) { | |
| 6939 | - const selector = `.${className}:${pseudo}`; | |
| 6940 | - const cssText = style.cssText ? formatCSSText(style) : formatCSSProperties(style, options); | |
| 6941 | - return document.createTextNode(`${selector}{${cssText}}`); | |
| 6942 | - } | |
| 6943 | - function clonePseudoElement(nativeNode, clonedNode, pseudo, options) { | |
| 6944 | - const style = window.getComputedStyle(nativeNode, pseudo); | |
| 6945 | - const content = style.getPropertyValue("content"); | |
| 6946 | - if (content === "" || content === "none") return; | |
| 6947 | - const className = uuid(); | |
| 6948 | - try { | |
| 6949 | - clonedNode.className = `${clonedNode.className} ${className}`; | |
| 6950 | - } catch (err) { | |
| 6951 | - return; | |
| 6952 | - } | |
| 6953 | - const styleElement = document.createElement("style"); | |
| 6954 | - styleElement.appendChild(getPseudoElementStyle(className, pseudo, style, options)); | |
| 6955 | - clonedNode.appendChild(styleElement); | |
| 6956 | - } | |
| 6957 | - function clonePseudoElements(nativeNode, clonedNode, options) { | |
| 6958 | - clonePseudoElement(nativeNode, clonedNode, ":before", options); | |
| 6959 | - clonePseudoElement(nativeNode, clonedNode, ":after", options); | |
| 6960 | - } | |
| 6961 | - var init_clone_pseudos = __esmMin((() => { | |
| 6962 | - init_util(); | |
| 6963 | - })); | |
| 5685 | + case REACT_PORTAL_TYPE: | |
| 5686 | + return $$typeof; | |
| 5687 | + } | |
| 5688 | + } | |
| 6964 | 5689 | |
| 6965 | -//#endregion | |
| 6966 | -//#region node_modules/html-to-image/es/mimes.js | |
| 6967 | - function getExtension(url) { | |
| 6968 | - const match = /\.([^./]*?)$/g.exec(url); | |
| 6969 | - return match ? match[1] : ""; | |
| 6970 | - } | |
| 6971 | - function getMimeType(url) { | |
| 6972 | - const extension = getExtension(url).toLowerCase(); | |
| 6973 | - return mimes[extension] || ""; | |
| 6974 | - } | |
| 6975 | - var WOFF, JPEG, mimes; | |
| 6976 | - var init_mimes = __esmMin((() => { | |
| 6977 | - WOFF = "application/font-woff"; | |
| 6978 | - JPEG = "image/jpeg"; | |
| 6979 | - mimes = { | |
| 6980 | - woff: WOFF, | |
| 6981 | - woff2: WOFF, | |
| 6982 | - ttf: "application/font-truetype", | |
| 6983 | - eot: "application/vnd.ms-fontobject", | |
| 6984 | - png: "image/png", | |
| 6985 | - jpg: JPEG, | |
| 6986 | - jpeg: JPEG, | |
| 6987 | - gif: "image/gif", | |
| 6988 | - tiff: "image/tiff", | |
| 6989 | - svg: "image/svg+xml", | |
| 6990 | - webp: "image/webp" | |
| 6991 | - }; | |
| 6992 | - })); | |
| 5690 | + return undefined; | |
| 5691 | +} // AsyncMode is deprecated along with isAsyncMode | |
| 6993 | 5692 | |
| 6994 | -//#endregion | |
| 6995 | -//#region node_modules/html-to-image/es/dataurl.js | |
| 6996 | - function getContentFromDataUrl(dataURL) { | |
| 6997 | - return dataURL.split(/,/)[1]; | |
| 6998 | - } | |
| 6999 | - function isDataUrl(url) { | |
| 7000 | - return url.search(/^(data:)/) !== -1; | |
| 7001 | - } | |
| 7002 | - function makeDataUrl(content, mimeType) { | |
| 7003 | - return `data:${mimeType};base64,${content}`; | |
| 7004 | - } | |
| 7005 | - function fetchAsDataURL(_x, _x2, _x3) { | |
| 7006 | - return _fetchAsDataURL.apply(this, arguments); | |
| 7007 | - } | |
| 7008 | - function _fetchAsDataURL() { | |
| 7009 | - _fetchAsDataURL = _asyncToGenerator(function* (url, init, process) { | |
| 7010 | - const res = yield fetch(url, init); | |
| 7011 | - if (res.status === 404) throw new Error(`Resource "${res.url}" not found`); | |
| 7012 | - const blob = yield res.blob(); | |
| 7013 | - return new Promise((resolve, reject) => { | |
| 7014 | - const reader = new FileReader(); | |
| 7015 | - reader.onerror = reject; | |
| 7016 | - reader.onloadend = () => { | |
| 7017 | - try { | |
| 7018 | - resolve(process({ | |
| 7019 | - res, | |
| 7020 | - result: reader.result | |
| 7021 | - })); | |
| 7022 | - } catch (error) { | |
| 7023 | - reject(error); | |
| 7024 | - } | |
| 7025 | - }; | |
| 7026 | - reader.readAsDataURL(blob); | |
| 7027 | - }); | |
| 7028 | - }); | |
| 7029 | - return _fetchAsDataURL.apply(this, arguments); | |
| 7030 | - } | |
| 7031 | - function getCacheKey(url, contentType, includeQueryParams) { | |
| 7032 | - let key = url.replace(/\?.*/, ""); | |
| 7033 | - if (includeQueryParams) key = url; | |
| 7034 | - if (/ttf|otf|eot|woff2?/i.test(key)) key = key.replace(/.*\//, ""); | |
| 7035 | - return contentType ? `[${contentType}]${key}` : key; | |
| 7036 | - } | |
| 7037 | - function resourceToDataURL(_x4, _x5, _x6) { | |
| 7038 | - return _resourceToDataURL.apply(this, arguments); | |
| 7039 | - } | |
| 7040 | - function _resourceToDataURL() { | |
| 7041 | - _resourceToDataURL = _asyncToGenerator(function* (resourceUrl, contentType, options) { | |
| 7042 | - const cacheKey = getCacheKey(resourceUrl, contentType, options.includeQueryParams); | |
| 7043 | - if (cache[cacheKey] != null) return cache[cacheKey]; | |
| 7044 | - if (options.cacheBust) resourceUrl += (/\?/.test(resourceUrl) ? "&" : "?") + (/* @__PURE__ */ new Date()).getTime(); | |
| 7045 | - let dataURL; | |
| 7046 | - try { | |
| 7047 | - dataURL = makeDataUrl(yield fetchAsDataURL(resourceUrl, options.fetchRequestInit, ({ res, result }) => { | |
| 7048 | - if (!contentType) contentType = res.headers.get("Content-Type") || ""; | |
| 7049 | - return getContentFromDataUrl(result); | |
| 7050 | - }), contentType); | |
| 7051 | - } catch (error) { | |
| 7052 | - dataURL = options.imagePlaceholder || ""; | |
| 7053 | - let msg = `Failed to fetch resource: ${resourceUrl}`; | |
| 7054 | - if (error) msg = typeof error === "string" ? error : error.message; | |
| 7055 | - if (msg) console.warn(msg); | |
| 7056 | - } | |
| 7057 | - cache[cacheKey] = dataURL; | |
| 7058 | - return dataURL; | |
| 7059 | - }); | |
| 7060 | - return _resourceToDataURL.apply(this, arguments); | |
| 7061 | - } | |
| 7062 | - var cache; | |
| 7063 | - var init_dataurl = __esmMin((() => { | |
| 7064 | - init_asyncToGenerator(); | |
| 7065 | - cache = {}; | |
| 7066 | - })); | |
| 5693 | +var AsyncMode = REACT_ASYNC_MODE_TYPE; | |
| 5694 | +var ConcurrentMode = REACT_CONCURRENT_MODE_TYPE; | |
| 5695 | +var ContextConsumer = REACT_CONTEXT_TYPE; | |
| 5696 | +var ContextProvider = REACT_PROVIDER_TYPE; | |
| 5697 | +var Element = REACT_ELEMENT_TYPE; | |
| 5698 | +var ForwardRef = REACT_FORWARD_REF_TYPE; | |
| 5699 | +var Fragment = REACT_FRAGMENT_TYPE; | |
| 5700 | +var Lazy = REACT_LAZY_TYPE; | |
| 5701 | +var Memo = REACT_MEMO_TYPE; | |
| 5702 | +var Portal = REACT_PORTAL_TYPE; | |
| 5703 | +var Profiler = REACT_PROFILER_TYPE; | |
| 5704 | +var StrictMode = REACT_STRICT_MODE_TYPE; | |
| 5705 | +var Suspense = REACT_SUSPENSE_TYPE; | |
| 5706 | +var hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated | |
| 7067 | 5707 | |
| 7068 | -//#endregion | |
| 7069 | -//#region node_modules/html-to-image/es/clone-node.js | |
| 7070 | - function cloneCanvasElement(_x) { | |
| 7071 | - return _cloneCanvasElement.apply(this, arguments); | |
| 7072 | - } | |
| 7073 | - function _cloneCanvasElement() { | |
| 7074 | - _cloneCanvasElement = _asyncToGenerator(function* (canvas) { | |
| 7075 | - const dataURL = canvas.toDataURL(); | |
| 7076 | - if (dataURL === "data:,") return canvas.cloneNode(false); | |
| 7077 | - return createImage(dataURL); | |
| 7078 | - }); | |
| 7079 | - return _cloneCanvasElement.apply(this, arguments); | |
| 7080 | - } | |
| 7081 | - function cloneVideoElement(_x2, _x3) { | |
| 7082 | - return _cloneVideoElement.apply(this, arguments); | |
| 7083 | - } | |
| 7084 | - function _cloneVideoElement() { | |
| 7085 | - _cloneVideoElement = _asyncToGenerator(function* (video, options) { | |
| 7086 | - if (video.currentSrc) { | |
| 7087 | - const canvas = document.createElement("canvas"); | |
| 7088 | - const ctx = canvas.getContext("2d"); | |
| 7089 | - canvas.width = video.clientWidth; | |
| 7090 | - canvas.height = video.clientHeight; | |
| 7091 | - ctx === null || ctx === void 0 || ctx.drawImage(video, 0, 0, canvas.width, canvas.height); | |
| 7092 | - return createImage(canvas.toDataURL()); | |
| 7093 | - } | |
| 7094 | - const poster = video.poster; | |
| 7095 | - return createImage(yield resourceToDataURL(poster, getMimeType(poster), options)); | |
| 7096 | - }); | |
| 7097 | - return _cloneVideoElement.apply(this, arguments); | |
| 7098 | - } | |
| 7099 | - function cloneIFrameElement(_x4, _x5) { | |
| 7100 | - return _cloneIFrameElement.apply(this, arguments); | |
| 7101 | - } | |
| 7102 | - function _cloneIFrameElement() { | |
| 7103 | - _cloneIFrameElement = _asyncToGenerator(function* (iframe, options) { | |
| 7104 | - var _a; | |
| 7105 | - try { | |
| 7106 | - if ((_a = iframe === null || iframe === void 0 ? void 0 : iframe.contentDocument) === null || _a === void 0 ? void 0 : _a.body) return yield cloneNode(iframe.contentDocument.body, options, true); | |
| 7107 | - } catch (_b) {} | |
| 7108 | - return iframe.cloneNode(false); | |
| 7109 | - }); | |
| 7110 | - return _cloneIFrameElement.apply(this, arguments); | |
| 7111 | - } | |
| 7112 | - function cloneSingleNode(_x6, _x7) { | |
| 7113 | - return _cloneSingleNode.apply(this, arguments); | |
| 7114 | - } | |
| 7115 | - function _cloneSingleNode() { | |
| 7116 | - _cloneSingleNode = _asyncToGenerator(function* (node, options) { | |
| 7117 | - if (isInstanceOfElement(node, HTMLCanvasElement)) return cloneCanvasElement(node); | |
| 7118 | - if (isInstanceOfElement(node, HTMLVideoElement)) return cloneVideoElement(node, options); | |
| 7119 | - if (isInstanceOfElement(node, HTMLIFrameElement)) return cloneIFrameElement(node, options); | |
| 7120 | - return node.cloneNode(isSVGElement(node)); | |
| 7121 | - }); | |
| 7122 | - return _cloneSingleNode.apply(this, arguments); | |
| 7123 | - } | |
| 7124 | - function cloneChildren(_x8, _x9, _x10) { | |
| 7125 | - return _cloneChildren.apply(this, arguments); | |
| 7126 | - } | |
| 7127 | - function _cloneChildren() { | |
| 7128 | - _cloneChildren = _asyncToGenerator(function* (nativeNode, clonedNode, options) { | |
| 7129 | - var _a; | |
| 7130 | - var _b; | |
| 7131 | - if (isSVGElement(clonedNode)) return clonedNode; | |
| 7132 | - let children = []; | |
| 7133 | - if (isSlotElement(nativeNode) && nativeNode.assignedNodes) children = toArray(nativeNode.assignedNodes()); | |
| 7134 | - else if (isInstanceOfElement(nativeNode, HTMLIFrameElement) && ((_a = nativeNode.contentDocument) === null || _a === void 0 ? void 0 : _a.body)) children = toArray(nativeNode.contentDocument.body.childNodes); | |
| 7135 | - else children = toArray(((_b = nativeNode.shadowRoot) !== null && _b !== void 0 ? _b : nativeNode).childNodes); | |
| 7136 | - if (children.length === 0 || isInstanceOfElement(nativeNode, HTMLVideoElement)) return clonedNode; | |
| 7137 | - yield children.reduce((deferred, child) => deferred.then(() => cloneNode(child, options)).then((clonedChild) => { | |
| 7138 | - if (clonedChild) clonedNode.appendChild(clonedChild); | |
| 7139 | - }), Promise.resolve()); | |
| 7140 | - return clonedNode; | |
| 7141 | - }); | |
| 7142 | - return _cloneChildren.apply(this, arguments); | |
| 7143 | - } | |
| 7144 | - function cloneCSSStyle(nativeNode, clonedNode, options) { | |
| 7145 | - const targetStyle = clonedNode.style; | |
| 7146 | - if (!targetStyle) return; | |
| 7147 | - const sourceStyle = window.getComputedStyle(nativeNode); | |
| 7148 | - if (sourceStyle.cssText) { | |
| 7149 | - targetStyle.cssText = sourceStyle.cssText; | |
| 7150 | - targetStyle.transformOrigin = sourceStyle.transformOrigin; | |
| 7151 | - } else getStyleProperties(options).forEach((name) => { | |
| 7152 | - let value = sourceStyle.getPropertyValue(name); | |
| 7153 | - if (name === "font-size" && value.endsWith("px")) value = `${Math.floor(parseFloat(value.substring(0, value.length - 2))) - .1}px`; | |
| 7154 | - if (isInstanceOfElement(nativeNode, HTMLIFrameElement) && name === "display" && value === "inline") value = "block"; | |
| 7155 | - if (name === "d" && clonedNode.getAttribute("d")) value = `path(${clonedNode.getAttribute("d")})`; | |
| 7156 | - targetStyle.setProperty(name, value, sourceStyle.getPropertyPriority(name)); | |
| 7157 | - }); | |
| 7158 | - } | |
| 7159 | - function cloneInputValue(nativeNode, clonedNode) { | |
| 7160 | - if (isInstanceOfElement(nativeNode, HTMLTextAreaElement)) clonedNode.innerHTML = nativeNode.value; | |
| 7161 | - if (isInstanceOfElement(nativeNode, HTMLInputElement)) clonedNode.setAttribute("value", nativeNode.value); | |
| 7162 | - } | |
| 7163 | - function cloneSelectValue(nativeNode, clonedNode) { | |
| 7164 | - if (isInstanceOfElement(nativeNode, HTMLSelectElement)) { | |
| 7165 | - const clonedSelect = clonedNode; | |
| 7166 | - const selectedOption = Array.from(clonedSelect.children).find((child) => nativeNode.value === child.getAttribute("value")); | |
| 7167 | - if (selectedOption) selectedOption.setAttribute("selected", ""); | |
| 7168 | - } | |
| 7169 | - } | |
| 7170 | - function decorate(nativeNode, clonedNode, options) { | |
| 7171 | - if (isInstanceOfElement(clonedNode, Element)) { | |
| 7172 | - cloneCSSStyle(nativeNode, clonedNode, options); | |
| 7173 | - clonePseudoElements(nativeNode, clonedNode, options); | |
| 7174 | - cloneInputValue(nativeNode, clonedNode); | |
| 7175 | - cloneSelectValue(nativeNode, clonedNode); | |
| 7176 | - } | |
| 7177 | - return clonedNode; | |
| 7178 | - } | |
| 7179 | - function ensureSVGSymbols(_x11, _x12) { | |
| 7180 | - return _ensureSVGSymbols.apply(this, arguments); | |
| 7181 | - } | |
| 7182 | - function _ensureSVGSymbols() { | |
| 7183 | - _ensureSVGSymbols = _asyncToGenerator(function* (clone, options) { | |
| 7184 | - const uses = clone.querySelectorAll ? clone.querySelectorAll("use") : []; | |
| 7185 | - if (uses.length === 0) return clone; | |
| 7186 | - const processedDefs = {}; | |
| 7187 | - for (let i = 0; i < uses.length; i++) { | |
| 7188 | - const id = uses[i].getAttribute("xlink:href"); | |
| 7189 | - if (id) { | |
| 7190 | - const exist = clone.querySelector(id); | |
| 7191 | - const definition = document.querySelector(id); | |
| 7192 | - if (!exist && definition && !processedDefs[id]) processedDefs[id] = yield cloneNode(definition, options, true); | |
| 7193 | - } | |
| 7194 | - } | |
| 7195 | - const nodes = Object.values(processedDefs); | |
| 7196 | - if (nodes.length) { | |
| 7197 | - const ns = "http://www.w3.org/1999/xhtml"; | |
| 7198 | - const svg = document.createElementNS(ns, "svg"); | |
| 7199 | - svg.setAttribute("xmlns", ns); | |
| 7200 | - svg.style.position = "absolute"; | |
| 7201 | - svg.style.width = "0"; | |
| 7202 | - svg.style.height = "0"; | |
| 7203 | - svg.style.overflow = "hidden"; | |
| 7204 | - svg.style.display = "none"; | |
| 7205 | - const defs = document.createElementNS(ns, "defs"); | |
| 7206 | - svg.appendChild(defs); | |
| 7207 | - for (let i = 0; i < nodes.length; i++) defs.appendChild(nodes[i]); | |
| 7208 | - clone.appendChild(svg); | |
| 7209 | - } | |
| 7210 | - return clone; | |
| 7211 | - }); | |
| 7212 | - return _ensureSVGSymbols.apply(this, arguments); | |
| 7213 | - } | |
| 7214 | - function cloneNode(_x13, _x14, _x15) { | |
| 7215 | - return _cloneNode.apply(this, arguments); | |
| 7216 | - } | |
| 7217 | - function _cloneNode() { | |
| 7218 | - _cloneNode = _asyncToGenerator(function* (node, options, isRoot) { | |
| 7219 | - if (!isRoot && options.filter && !options.filter(node)) return null; | |
| 7220 | - return Promise.resolve(node).then((clonedNode) => cloneSingleNode(clonedNode, options)).then((clonedNode) => cloneChildren(node, clonedNode, options)).then((clonedNode) => decorate(node, clonedNode, options)).then((clonedNode) => ensureSVGSymbols(clonedNode, options)); | |
| 7221 | - }); | |
| 7222 | - return _cloneNode.apply(this, arguments); | |
| 7223 | - } | |
| 7224 | - var isSlotElement, isSVGElement; | |
| 7225 | - var init_clone_node = __esmMin((() => { | |
| 7226 | - init_clone_pseudos(); | |
| 7227 | - init_util(); | |
| 7228 | - init_mimes(); | |
| 7229 | - init_dataurl(); | |
| 7230 | - init_asyncToGenerator(); | |
| 7231 | - isSlotElement = (node) => node.tagName != null && node.tagName.toUpperCase() === "SLOT"; | |
| 7232 | - isSVGElement = (node) => node.tagName != null && node.tagName.toUpperCase() === "SVG"; | |
| 7233 | - })); | |
| 5708 | +function isAsyncMode(object) { | |
| 5709 | + { | |
| 5710 | + if (!hasWarnedAboutDeprecatedIsAsyncMode) { | |
| 5711 | + hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint | |
| 7234 | 5712 | |
| 7235 | -//#endregion | |
| 7236 | -//#region node_modules/html-to-image/es/embed-resources.js | |
| 7237 | - function toRegex(url) { | |
| 7238 | - const escaped = url.replace(/([.*+?^${}()|\[\]\/\\])/g, "\\$1"); | |
| 7239 | - return new RegExp(`(url\\(['"]?)(${escaped})(['"]?\\))`, "g"); | |
| 7240 | - } | |
| 7241 | - function parseURLs(cssText) { | |
| 7242 | - const urls = []; | |
| 7243 | - cssText.replace(URL_REGEX, (raw, quotation, url) => { | |
| 7244 | - urls.push(url); | |
| 7245 | - return raw; | |
| 7246 | - }); | |
| 7247 | - return urls.filter((url) => !isDataUrl(url)); | |
| 7248 | - } | |
| 7249 | - function embed(_x, _x2, _x3, _x4, _x5) { | |
| 7250 | - return _embed.apply(this, arguments); | |
| 7251 | - } | |
| 7252 | - function _embed() { | |
| 7253 | - _embed = _asyncToGenerator(function* (cssText, resourceURL, baseURL, options, getContentFromUrl) { | |
| 7254 | - try { | |
| 7255 | - const resolvedURL = baseURL ? resolveUrl(resourceURL, baseURL) : resourceURL; | |
| 7256 | - const contentType = getMimeType(resourceURL); | |
| 7257 | - let dataURL; | |
| 7258 | - if (getContentFromUrl) dataURL = makeDataUrl(yield getContentFromUrl(resolvedURL), contentType); | |
| 7259 | - else dataURL = yield resourceToDataURL(resolvedURL, contentType, options); | |
| 7260 | - return cssText.replace(toRegex(resourceURL), `$1${dataURL}$3`); | |
| 7261 | - } catch (error) {} | |
| 7262 | - return cssText; | |
| 7263 | - }); | |
| 7264 | - return _embed.apply(this, arguments); | |
| 7265 | - } | |
| 7266 | - function filterPreferredFontFormat(str, { preferredFontFormat }) { | |
| 7267 | - return !preferredFontFormat ? str : str.replace(FONT_SRC_REGEX, (match) => { | |
| 7268 | - while (true) { | |
| 7269 | - const [src, , format] = URL_WITH_FORMAT_REGEX.exec(match) || []; | |
| 7270 | - if (!format) return ""; | |
| 7271 | - if (format === preferredFontFormat) return `src: ${src};`; | |
| 7272 | - } | |
| 7273 | - }); | |
| 7274 | - } | |
| 7275 | - function shouldEmbed(url) { | |
| 7276 | - return url.search(URL_REGEX) !== -1; | |
| 7277 | - } | |
| 7278 | - function embedResources(_x6, _x7, _x8) { | |
| 7279 | - return _embedResources.apply(this, arguments); | |
| 7280 | - } | |
| 7281 | - function _embedResources() { | |
| 7282 | - _embedResources = _asyncToGenerator(function* (cssText, baseUrl, options) { | |
| 7283 | - if (!shouldEmbed(cssText)) return cssText; | |
| 7284 | - const filteredCSSText = filterPreferredFontFormat(cssText, options); | |
| 7285 | - return parseURLs(filteredCSSText).reduce((deferred, url) => deferred.then((css) => embed(css, url, baseUrl, options)), Promise.resolve(filteredCSSText)); | |
| 7286 | - }); | |
| 7287 | - return _embedResources.apply(this, arguments); | |
| 7288 | - } | |
| 7289 | - var URL_REGEX, URL_WITH_FORMAT_REGEX, FONT_SRC_REGEX; | |
| 7290 | - var init_embed_resources = __esmMin((() => { | |
| 7291 | - init_util(); | |
| 7292 | - init_mimes(); | |
| 7293 | - init_dataurl(); | |
| 7294 | - init_asyncToGenerator(); | |
| 7295 | - URL_REGEX = /url\((['"]?)([^'"]+?)\1\)/g; | |
| 7296 | - URL_WITH_FORMAT_REGEX = /url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g; | |
| 7297 | - FONT_SRC_REGEX = /src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g; | |
| 7298 | - })); | |
| 5713 | + console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.'); | |
| 5714 | + } | |
| 5715 | + } | |
| 7299 | 5716 | |
| 7300 | -//#endregion | |
| 7301 | -//#region node_modules/html-to-image/es/embed-images.js | |
| 7302 | - function embedProp(_x, _x2, _x3) { | |
| 7303 | - return _embedProp.apply(this, arguments); | |
| 7304 | - } | |
| 7305 | - function _embedProp() { | |
| 7306 | - _embedProp = _asyncToGenerator(function* (propName, node, options) { | |
| 7307 | - var _a; | |
| 7308 | - const propValue = (_a = node.style) === null || _a === void 0 ? void 0 : _a.getPropertyValue(propName); | |
| 7309 | - if (propValue) { | |
| 7310 | - const cssString = yield embedResources(propValue, null, options); | |
| 7311 | - node.style.setProperty(propName, cssString, node.style.getPropertyPriority(propName)); | |
| 7312 | - return true; | |
| 7313 | - } | |
| 7314 | - return false; | |
| 7315 | - }); | |
| 7316 | - return _embedProp.apply(this, arguments); | |
| 7317 | - } | |
| 7318 | - function embedBackground(_x4, _x5) { | |
| 7319 | - return _embedBackground.apply(this, arguments); | |
| 7320 | - } | |
| 7321 | - function _embedBackground() { | |
| 7322 | - _embedBackground = _asyncToGenerator(function* (clonedNode, options) { | |
| 7323 | - (yield embedProp("background", clonedNode, options)) || (yield embedProp("background-image", clonedNode, options)); | |
| 7324 | - (yield embedProp("mask", clonedNode, options)) || (yield embedProp("-webkit-mask", clonedNode, options)) || (yield embedProp("mask-image", clonedNode, options)) || (yield embedProp("-webkit-mask-image", clonedNode, options)); | |
| 7325 | - }); | |
| 7326 | - return _embedBackground.apply(this, arguments); | |
| 7327 | - } | |
| 7328 | - function embedImageNode(_x6, _x7) { | |
| 7329 | - return _embedImageNode.apply(this, arguments); | |
| 7330 | - } | |
| 7331 | - function _embedImageNode() { | |
| 7332 | - _embedImageNode = _asyncToGenerator(function* (clonedNode, options) { | |
| 7333 | - const isImageElement = isInstanceOfElement(clonedNode, HTMLImageElement); | |
| 7334 | - if (!(isImageElement && !isDataUrl(clonedNode.src)) && !(isInstanceOfElement(clonedNode, SVGImageElement) && !isDataUrl(clonedNode.href.baseVal))) return; | |
| 7335 | - const url = isImageElement ? clonedNode.src : clonedNode.href.baseVal; | |
| 7336 | - const dataURL = yield resourceToDataURL(url, getMimeType(url), options); | |
| 7337 | - yield new Promise((resolve, reject) => { | |
| 7338 | - clonedNode.onload = resolve; | |
| 7339 | - clonedNode.onerror = options.onImageErrorHandler ? (...attributes) => { | |
| 7340 | - try { | |
| 7341 | - resolve(options.onImageErrorHandler(...attributes)); | |
| 7342 | - } catch (error) { | |
| 7343 | - reject(error); | |
| 7344 | - } | |
| 7345 | - } : reject; | |
| 7346 | - const image = clonedNode; | |
| 7347 | - if (image.decode) image.decode = resolve; | |
| 7348 | - if (image.loading === "lazy") image.loading = "eager"; | |
| 7349 | - if (isImageElement) { | |
| 7350 | - clonedNode.srcset = ""; | |
| 7351 | - clonedNode.src = dataURL; | |
| 7352 | - } else clonedNode.href.baseVal = dataURL; | |
| 7353 | - }); | |
| 7354 | - }); | |
| 7355 | - return _embedImageNode.apply(this, arguments); | |
| 7356 | - } | |
| 7357 | - function embedChildren(_x8, _x9) { | |
| 7358 | - return _embedChildren.apply(this, arguments); | |
| 7359 | - } | |
| 7360 | - function _embedChildren() { | |
| 7361 | - _embedChildren = _asyncToGenerator(function* (clonedNode, options) { | |
| 7362 | - const deferreds = toArray(clonedNode.childNodes).map((child) => embedImages(child, options)); | |
| 7363 | - yield Promise.all(deferreds).then(() => clonedNode); | |
| 7364 | - }); | |
| 7365 | - return _embedChildren.apply(this, arguments); | |
| 7366 | - } | |
| 7367 | - function embedImages(_x10, _x11) { | |
| 7368 | - return _embedImages.apply(this, arguments); | |
| 7369 | - } | |
| 7370 | - function _embedImages() { | |
| 7371 | - _embedImages = _asyncToGenerator(function* (clonedNode, options) { | |
| 7372 | - if (isInstanceOfElement(clonedNode, Element)) { | |
| 7373 | - yield embedBackground(clonedNode, options); | |
| 7374 | - yield embedImageNode(clonedNode, options); | |
| 7375 | - yield embedChildren(clonedNode, options); | |
| 7376 | - } | |
| 7377 | - }); | |
| 7378 | - return _embedImages.apply(this, arguments); | |
| 7379 | - } | |
| 7380 | - var init_embed_images = __esmMin((() => { | |
| 7381 | - init_embed_resources(); | |
| 7382 | - init_util(); | |
| 7383 | - init_dataurl(); | |
| 7384 | - init_mimes(); | |
| 7385 | - init_asyncToGenerator(); | |
| 7386 | - })); | |
| 5717 | + return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE; | |
| 5718 | +} | |
| 5719 | +function isConcurrentMode(object) { | |
| 5720 | + return typeOf(object) === REACT_CONCURRENT_MODE_TYPE; | |
| 5721 | +} | |
| 5722 | +function isContextConsumer(object) { | |
| 5723 | + return typeOf(object) === REACT_CONTEXT_TYPE; | |
| 5724 | +} | |
| 5725 | +function isContextProvider(object) { | |
| 5726 | + return typeOf(object) === REACT_PROVIDER_TYPE; | |
| 5727 | +} | |
| 5728 | +function isElement(object) { | |
| 5729 | + return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE; | |
| 5730 | +} | |
| 5731 | +function isForwardRef(object) { | |
| 5732 | + return typeOf(object) === REACT_FORWARD_REF_TYPE; | |
| 5733 | +} | |
| 5734 | +function isFragment(object) { | |
| 5735 | + return typeOf(object) === REACT_FRAGMENT_TYPE; | |
| 5736 | +} | |
| 5737 | +function isLazy(object) { | |
| 5738 | + return typeOf(object) === REACT_LAZY_TYPE; | |
| 5739 | +} | |
| 5740 | +function isMemo(object) { | |
| 5741 | + return typeOf(object) === REACT_MEMO_TYPE; | |
| 5742 | +} | |
| 5743 | +function isPortal(object) { | |
| 5744 | + return typeOf(object) === REACT_PORTAL_TYPE; | |
| 5745 | +} | |
| 5746 | +function isProfiler(object) { | |
| 5747 | + return typeOf(object) === REACT_PROFILER_TYPE; | |
| 5748 | +} | |
| 5749 | +function isStrictMode(object) { | |
| 5750 | + return typeOf(object) === REACT_STRICT_MODE_TYPE; | |
| 5751 | +} | |
| 5752 | +function isSuspense(object) { | |
| 5753 | + return typeOf(object) === REACT_SUSPENSE_TYPE; | |
| 5754 | +} | |
| 7387 | 5755 | |
| 7388 | -//#endregion | |
| 7389 | -//#region node_modules/html-to-image/es/apply-style.js | |
| 7390 | - function applyStyle(node, options) { | |
| 7391 | - const { style } = node; | |
| 7392 | - if (options.backgroundColor) style.backgroundColor = options.backgroundColor; | |
| 7393 | - if (options.width) style.width = `${options.width}px`; | |
| 7394 | - if (options.height) style.height = `${options.height}px`; | |
| 7395 | - const manual = options.style; | |
| 7396 | - if (manual != null) Object.keys(manual).forEach((key) => { | |
| 7397 | - style[key] = manual[key]; | |
| 7398 | - }); | |
| 7399 | - return node; | |
| 7400 | - } | |
| 7401 | - var init_apply_style = __esmMin((() => {})); | |
| 5756 | +exports.AsyncMode = AsyncMode; | |
| 5757 | +exports.ConcurrentMode = ConcurrentMode; | |
| 5758 | +exports.ContextConsumer = ContextConsumer; | |
| 5759 | +exports.ContextProvider = ContextProvider; | |
| 5760 | +exports.Element = Element; | |
| 5761 | +exports.ForwardRef = ForwardRef; | |
| 5762 | +exports.Fragment = Fragment; | |
| 5763 | +exports.Lazy = Lazy; | |
| 5764 | +exports.Memo = Memo; | |
| 5765 | +exports.Portal = Portal; | |
| 5766 | +exports.Profiler = Profiler; | |
| 5767 | +exports.StrictMode = StrictMode; | |
| 5768 | +exports.Suspense = Suspense; | |
| 5769 | +exports.isAsyncMode = isAsyncMode; | |
| 5770 | +exports.isConcurrentMode = isConcurrentMode; | |
| 5771 | +exports.isContextConsumer = isContextConsumer; | |
| 5772 | +exports.isContextProvider = isContextProvider; | |
| 5773 | +exports.isElement = isElement; | |
| 5774 | +exports.isForwardRef = isForwardRef; | |
| 5775 | +exports.isFragment = isFragment; | |
| 5776 | +exports.isLazy = isLazy; | |
| 5777 | +exports.isMemo = isMemo; | |
| 5778 | +exports.isPortal = isPortal; | |
| 5779 | +exports.isProfiler = isProfiler; | |
| 5780 | +exports.isStrictMode = isStrictMode; | |
| 5781 | +exports.isSuspense = isSuspense; | |
| 5782 | +exports.isValidElementType = isValidElementType; | |
| 5783 | +exports.typeOf = typeOf; | |
| 5784 | + })(); | |
| 5785 | +} | |
| 7402 | 5786 | |
| 7403 | -//#endregion | |
| 7404 | -//#region node_modules/html-to-image/es/embed-webfonts.js | |
| 7405 | - function fetchCSS(_x) { | |
| 7406 | - return _fetchCSS.apply(this, arguments); | |
| 7407 | - } | |
| 7408 | - function _fetchCSS() { | |
| 7409 | - _fetchCSS = _asyncToGenerator(function* (url) { | |
| 7410 | - let cache = cssFetchCache[url]; | |
| 7411 | - if (cache != null) return cache; | |
| 7412 | - cache = { | |
| 7413 | - url, | |
| 7414 | - cssText: yield (yield fetch(url)).text() | |
| 7415 | - }; | |
| 7416 | - cssFetchCache[url] = cache; | |
| 7417 | - return cache; | |
| 7418 | - }); | |
| 7419 | - return _fetchCSS.apply(this, arguments); | |
| 7420 | - } | |
| 7421 | - function embedFonts(_x3, _x4) { | |
| 7422 | - return _embedFonts.apply(this, arguments); | |
| 7423 | - } | |
| 7424 | - function _embedFonts() { | |
| 7425 | - _embedFonts = _asyncToGenerator(function* (data, options) { | |
| 7426 | - let cssText = data.cssText; | |
| 7427 | - const regexUrl = /url\(["']?([^"')]+)["']?\)/g; | |
| 7428 | - const loadFonts = (cssText.match(/url\([^)]+\)/g) || []).map(function() { | |
| 7429 | - var _ref = _asyncToGenerator(function* (loc) { | |
| 7430 | - let url = loc.replace(regexUrl, "$1"); | |
| 7431 | - if (!url.startsWith("https://")) url = new URL(url, data.url).href; | |
| 7432 | - return fetchAsDataURL(url, options.fetchRequestInit, ({ result }) => { | |
| 7433 | - cssText = cssText.replace(loc, `url(${result})`); | |
| 7434 | - return [loc, result]; | |
| 7435 | - }); | |
| 7436 | - }); | |
| 7437 | - return function(_x2) { | |
| 7438 | - return _ref.apply(this, arguments); | |
| 7439 | - }; | |
| 7440 | - }()); | |
| 7441 | - return Promise.all(loadFonts).then(() => cssText); | |
| 7442 | - }); | |
| 7443 | - return _embedFonts.apply(this, arguments); | |
| 7444 | - } | |
| 7445 | - function parseCSS(source) { | |
| 7446 | - if (source == null) return []; | |
| 7447 | - const result = []; | |
| 7448 | - let cssText = source.replace(/(\/\*[\s\S]*?\*\/)/gi, ""); | |
| 7449 | - const keyframesRegex = /* @__PURE__ */ new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})", "gi"); | |
| 7450 | - while (true) { | |
| 7451 | - const matches = keyframesRegex.exec(cssText); | |
| 7452 | - if (matches === null) break; | |
| 7453 | - result.push(matches[0]); | |
| 7454 | - } | |
| 7455 | - cssText = cssText.replace(keyframesRegex, ""); | |
| 7456 | - const importRegex = /@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi; | |
| 7457 | - const unifiedRegex = /* @__PURE__ */ new RegExp("((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})", "gi"); | |
| 7458 | - while (true) { | |
| 7459 | - let matches = importRegex.exec(cssText); | |
| 7460 | - if (matches === null) { | |
| 7461 | - matches = unifiedRegex.exec(cssText); | |
| 7462 | - if (matches === null) break; | |
| 7463 | - else importRegex.lastIndex = unifiedRegex.lastIndex; | |
| 7464 | - } else unifiedRegex.lastIndex = importRegex.lastIndex; | |
| 7465 | - result.push(matches[0]); | |
| 7466 | - } | |
| 7467 | - return result; | |
| 7468 | - } | |
| 7469 | - function getCSSRules(_x5, _x6) { | |
| 7470 | - return _getCSSRules.apply(this, arguments); | |
| 7471 | - } | |
| 7472 | - function _getCSSRules() { | |
| 7473 | - _getCSSRules = _asyncToGenerator(function* (styleSheets, options) { | |
| 7474 | - const ret = []; | |
| 7475 | - const deferreds = []; | |
| 7476 | - styleSheets.forEach((sheet) => { | |
| 7477 | - if ("cssRules" in sheet) try { | |
| 7478 | - toArray(sheet.cssRules || []).forEach((item, index) => { | |
| 7479 | - if (item.type === CSSRule.IMPORT_RULE) { | |
| 7480 | - let importIndex = index + 1; | |
| 7481 | - const url = item.href; | |
| 7482 | - const deferred = fetchCSS(url).then((metadata) => embedFonts(metadata, options)).then((cssText) => parseCSS(cssText).forEach((rule) => { | |
| 7483 | - try { | |
| 7484 | - sheet.insertRule(rule, rule.startsWith("@import") ? importIndex += 1 : sheet.cssRules.length); | |
| 7485 | - } catch (error) { | |
| 7486 | - console.error("Error inserting rule from remote css", { | |
| 7487 | - rule, | |
| 7488 | - error | |
| 7489 | - }); | |
| 7490 | - } | |
| 7491 | - })).catch((e) => { | |
| 7492 | - console.error("Error loading remote css", e.toString()); | |
| 7493 | - }); | |
| 7494 | - deferreds.push(deferred); | |
| 7495 | - } | |
| 7496 | - }); | |
| 7497 | - } catch (e) { | |
| 7498 | - const inline = styleSheets.find((a) => a.href == null) || document.styleSheets[0]; | |
| 7499 | - if (sheet.href != null) deferreds.push(fetchCSS(sheet.href).then((metadata) => embedFonts(metadata, options)).then((cssText) => parseCSS(cssText).forEach((rule) => { | |
| 7500 | - inline.insertRule(rule, inline.cssRules.length); | |
| 7501 | - })).catch((err) => { | |
| 7502 | - console.error("Error loading remote stylesheet", err); | |
| 7503 | - })); | |
| 7504 | - console.error("Error inlining remote css file", e); | |
| 7505 | - } | |
| 7506 | - }); | |
| 7507 | - return Promise.all(deferreds).then(() => { | |
| 7508 | - styleSheets.forEach((sheet) => { | |
| 7509 | - if ("cssRules" in sheet) try { | |
| 7510 | - toArray(sheet.cssRules || []).forEach((item) => { | |
| 7511 | - ret.push(item); | |
| 7512 | - }); | |
| 7513 | - } catch (e) { | |
| 7514 | - console.error(`Error while reading CSS rules from ${sheet.href}`, e); | |
| 7515 | - } | |
| 7516 | - }); | |
| 7517 | - return ret; | |
| 7518 | - }); | |
| 7519 | - }); | |
| 7520 | - return _getCSSRules.apply(this, arguments); | |
| 7521 | - } | |
| 7522 | - function getWebFontRules(cssRules) { | |
| 7523 | - return cssRules.filter((rule) => rule.type === CSSRule.FONT_FACE_RULE).filter((rule) => shouldEmbed(rule.style.getPropertyValue("src"))); | |
| 7524 | - } | |
| 7525 | - function parseWebFontRules(_x7, _x8) { | |
| 7526 | - return _parseWebFontRules.apply(this, arguments); | |
| 7527 | - } | |
| 7528 | - function _parseWebFontRules() { | |
| 7529 | - _parseWebFontRules = _asyncToGenerator(function* (node, options) { | |
| 7530 | - if (node.ownerDocument == null) throw new Error("Provided element is not within a Document"); | |
| 7531 | - return getWebFontRules(yield getCSSRules(toArray(node.ownerDocument.styleSheets), options)); | |
| 7532 | - }); | |
| 7533 | - return _parseWebFontRules.apply(this, arguments); | |
| 7534 | - } | |
| 7535 | - function normalizeFontFamily(font) { | |
| 7536 | - return font.trim().replace(/["']/g, ""); | |
| 7537 | - } | |
| 7538 | - function getUsedFonts(node) { | |
| 7539 | - const fonts = /* @__PURE__ */ new Set(); | |
| 7540 | - function traverse(node) { | |
| 7541 | - (node.style.fontFamily || getComputedStyle(node).fontFamily).split(",").forEach((font) => { | |
| 7542 | - fonts.add(normalizeFontFamily(font)); | |
| 7543 | - }); | |
| 7544 | - Array.from(node.children).forEach((child) => { | |
| 7545 | - if (child instanceof HTMLElement) traverse(child); | |
| 7546 | - }); | |
| 7547 | - } | |
| 7548 | - traverse(node); | |
| 7549 | - return fonts; | |
| 7550 | - } | |
| 7551 | - function getWebFontCSS(_x9, _x10) { | |
| 7552 | - return _getWebFontCSS.apply(this, arguments); | |
| 7553 | - } | |
| 7554 | - function _getWebFontCSS() { | |
| 7555 | - _getWebFontCSS = _asyncToGenerator(function* (node, options) { | |
| 7556 | - const rules = yield parseWebFontRules(node, options); | |
| 7557 | - const usedFonts = getUsedFonts(node); | |
| 7558 | - return (yield Promise.all(rules.filter((rule) => usedFonts.has(normalizeFontFamily(rule.style.fontFamily))).map((rule) => { | |
| 7559 | - const baseUrl = rule.parentStyleSheet ? rule.parentStyleSheet.href : null; | |
| 7560 | - return embedResources(rule.cssText, baseUrl, options); | |
| 7561 | - }))).join("\n"); | |
| 7562 | - }); | |
| 7563 | - return _getWebFontCSS.apply(this, arguments); | |
| 7564 | - } | |
| 7565 | - function embedWebFonts(_x11, _x12) { | |
| 7566 | - return _embedWebFonts.apply(this, arguments); | |
| 7567 | - } | |
| 7568 | - function _embedWebFonts() { | |
| 7569 | - _embedWebFonts = _asyncToGenerator(function* (clonedNode, options) { | |
| 7570 | - const cssText = options.fontEmbedCSS != null ? options.fontEmbedCSS : options.skipFonts ? null : yield getWebFontCSS(clonedNode, options); | |
| 7571 | - if (cssText) { | |
| 7572 | - const styleNode = document.createElement("style"); | |
| 7573 | - const sytleContent = document.createTextNode(cssText); | |
| 7574 | - styleNode.appendChild(sytleContent); | |
| 7575 | - if (clonedNode.firstChild) clonedNode.insertBefore(styleNode, clonedNode.firstChild); | |
| 7576 | - else clonedNode.appendChild(styleNode); | |
| 7577 | - } | |
| 7578 | - }); | |
| 7579 | - return _embedWebFonts.apply(this, arguments); | |
| 7580 | - } | |
| 7581 | - var cssFetchCache; | |
| 7582 | - var init_embed_webfonts = __esmMin((() => { | |
| 7583 | - init_util(); | |
| 7584 | - init_dataurl(); | |
| 7585 | - init_embed_resources(); | |
| 7586 | - init_asyncToGenerator(); | |
| 7587 | - cssFetchCache = {}; | |
| 7588 | - })); | |
| 7589 | 5787 | |
| 7590 | -//#endregion | |
| 7591 | -//#region node_modules/html-to-image/es/index.js | |
| 7592 | - function toSvg(_x) { | |
| 7593 | - return _toSvg.apply(this, arguments); | |
| 7594 | - } | |
| 7595 | - function _toSvg() { | |
| 7596 | - _toSvg = _asyncToGenerator(function* (node, options = {}) { | |
| 7597 | - const { width, height } = getImageSize(node, options); | |
| 7598 | - const clonedNode = yield cloneNode(node, options, true); | |
| 7599 | - yield embedWebFonts(clonedNode, options); | |
| 7600 | - yield embedImages(clonedNode, options); | |
| 7601 | - applyStyle(clonedNode, options); | |
| 7602 | - return yield nodeToDataURL(clonedNode, width, height); | |
| 7603 | - }); | |
| 7604 | - return _toSvg.apply(this, arguments); | |
| 7605 | - } | |
| 7606 | - function toCanvas(_x2) { | |
| 7607 | - return _toCanvas.apply(this, arguments); | |
| 7608 | - } | |
| 7609 | - function _toCanvas() { | |
| 7610 | - _toCanvas = _asyncToGenerator(function* (node, options = {}) { | |
| 7611 | - const { width, height } = getImageSize(node, options); | |
| 7612 | - const img = yield createImage(yield toSvg(node, options)); | |
| 7613 | - const canvas = document.createElement("canvas"); | |
| 7614 | - const context = canvas.getContext("2d"); | |
| 7615 | - const ratio = options.pixelRatio || getPixelRatio(); | |
| 7616 | - const canvasWidth = options.canvasWidth || width; | |
| 7617 | - const canvasHeight = options.canvasHeight || height; | |
| 7618 | - canvas.width = canvasWidth * ratio; | |
| 7619 | - canvas.height = canvasHeight * ratio; | |
| 7620 | - if (!options.skipAutoScale) checkCanvasDimensions(canvas); | |
| 7621 | - canvas.style.width = `${canvasWidth}`; | |
| 7622 | - canvas.style.height = `${canvasHeight}`; | |
| 7623 | - if (options.backgroundColor) { | |
| 7624 | - context.fillStyle = options.backgroundColor; | |
| 7625 | - context.fillRect(0, 0, canvas.width, canvas.height); | |
| 7626 | - } | |
| 7627 | - context.drawImage(img, 0, 0, canvas.width, canvas.height); | |
| 7628 | - return canvas; | |
| 7629 | - }); | |
| 7630 | - return _toCanvas.apply(this, arguments); | |
| 7631 | - } | |
| 7632 | - var init_es = __esmMin((() => { | |
| 7633 | - init_clone_node(); | |
| 7634 | - init_embed_images(); | |
| 7635 | - init_apply_style(); | |
| 7636 | - init_embed_webfonts(); | |
| 7637 | - init_util(); | |
| 7638 | - init_asyncToGenerator(); | |
| 7639 | - })); | |
| 5788 | +/***/ }), | |
| 7640 | 5789 | |
| 7641 | -//#endregion | |
| 7642 | -//#region modules/ai/assets/js/editor/utils/screenshot.js | |
| 7643 | - function screenshotNode(node) { | |
| 7644 | - return toWebp(node, { | |
| 7645 | - quality: .01, | |
| 7646 | - imagePlaceholder: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII=" | |
| 7647 | - }); | |
| 7648 | - } | |
| 7649 | - function toWebp(_x2) { | |
| 7650 | - return _toWebp.apply(this, arguments); | |
| 7651 | - } | |
| 7652 | - function _toWebp() { | |
| 7653 | - _toWebp = _asyncToGenerator$1(/*#__PURE__*/ import_regenerator$2.default.mark(function _callee3(node) { | |
| 7654 | - var _options$quality; | |
| 7655 | - var options; | |
| 7656 | - var canvas; | |
| 7657 | - var _args3 = arguments; | |
| 7658 | - return import_regenerator$2.default.wrap(function(_context3) { | |
| 7659 | - while (1) switch (_context3.prev = _context3.next) { | |
| 7660 | - case 0: | |
| 7661 | - options = _args3.length > 1 && _args3[1] !== void 0 ? _args3[1] : {}; | |
| 7662 | - _context3.next = 1; | |
| 7663 | - return toCanvas(node, options); | |
| 7664 | - case 1: | |
| 7665 | - canvas = _context3.sent; | |
| 7666 | - return _context3.abrupt("return", canvas.toDataURL("image/webp", (_options$quality = options.quality) !== null && _options$quality !== void 0 ? _options$quality : 1)); | |
| 7667 | - case 2: | |
| 7668 | - case "end": return _context3.stop(); | |
| 7669 | - } | |
| 7670 | - }, _callee3); | |
| 7671 | - })); | |
| 7672 | - return _toWebp.apply(this, arguments); | |
| 7673 | - } | |
| 7674 | - function createHiddenWrapper() { | |
| 7675 | - var wrapper = document.createElement("div"); | |
| 7676 | - wrapper.style.position = "fixed"; | |
| 7677 | - wrapper.style.opacity = "0"; | |
| 7678 | - wrapper.style.inset = "0"; | |
| 7679 | - return wrapper; | |
| 7680 | - } | |
| 7681 | - function createContainer(template) { | |
| 7682 | - var model = generateIds(template); | |
| 7683 | - model.id = "e-ai-screenshot-container-".concat(model.id); | |
| 7684 | - return $e.run("document/elements/create", { | |
| 7685 | - container: elementor.getPreviewContainer(), | |
| 7686 | - model, | |
| 7687 | - options: { edit: false } | |
| 7688 | - }); | |
| 7689 | - } | |
| 7690 | - function deleteContainer(container) { | |
| 7691 | - return $e.run("document/elements/delete", { container }); | |
| 7692 | - } | |
| 7693 | - function waitForContainer(id) { | |
| 7694 | - var timeoutPromise = sleep(arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 5e3); | |
| 7695 | - var waitPromise = new Promise(function(resolve) { | |
| 7696 | - elementorFrontend.hooks.addAction("frontend/element_ready/global", /*#__PURE__*/ function() { | |
| 7697 | - var _ref2 = _asyncToGenerator$1(/*#__PURE__*/ import_regenerator$2.default.mark(function _callee2($element) { | |
| 7698 | - var images; | |
| 7699 | - return import_regenerator$2.default.wrap(function(_context2) { | |
| 7700 | - while (1) switch (_context2.prev = _context2.next) { | |
| 7701 | - case 0: | |
| 7702 | - if (!($element.data("id") === id)) { | |
| 7703 | - _context2.next = 2; | |
| 7704 | - break; | |
| 7705 | - } | |
| 7706 | - images = _toConsumableArray($element[0].querySelectorAll("img")); | |
| 7707 | - _context2.next = 1; | |
| 7708 | - return Promise.all(images.map(waitForImage)); | |
| 7709 | - case 1: resolve(); | |
| 7710 | - case 2: | |
| 7711 | - case "end": return _context2.stop(); | |
| 7712 | - } | |
| 7713 | - }, _callee2); | |
| 7714 | - })); | |
| 7715 | - return function(_x3) { | |
| 7716 | - return _ref2.apply(this, arguments); | |
| 7717 | - }; | |
| 7718 | - }()); | |
| 7719 | - }); | |
| 7720 | - return Promise.any([timeoutPromise, waitPromise]); | |
| 7721 | - } | |
| 7722 | - function waitForImage(image) { | |
| 7723 | - if (image.complete) return Promise.resolve(); | |
| 7724 | - return new Promise(function(resolve) { | |
| 7725 | - image.addEventListener("load", resolve); | |
| 7726 | - image.addEventListener("error", function() { | |
| 7727 | - image.remove(); | |
| 7728 | - resolve(); | |
| 7729 | - }); | |
| 7730 | - }); | |
| 7731 | - } | |
| 7732 | - function sleep(ms) { | |
| 7733 | - return new Promise(function(resolve) { | |
| 7734 | - return setTimeout(resolve, ms); | |
| 7735 | - }); | |
| 7736 | - } | |
| 7737 | - function wrapContainer(container, wrapper) { | |
| 7738 | - var el = container.view.$el[0]; | |
| 7739 | - el.parentNode.insertBefore(wrapper, el); | |
| 7740 | - wrapper.appendChild(el); | |
| 7741 | - } | |
| 7742 | - var import_regenerator$2, takeScreenshot; | |
| 7743 | - var init_screenshot = __esmMin((() => { | |
| 7744 | - init_toConsumableArray(); | |
| 7745 | - init_asyncToGenerator$1(); | |
| 7746 | - import_regenerator$2 = /* @__PURE__ */ __toESM(require_regenerator()); | |
| 7747 | - init_es(); | |
| 7748 | - init_history(); | |
| 7749 | - init_requests_ids(); | |
| 7750 | - takeScreenshot = /*#__PURE__*/ function() { | |
| 7751 | - var _ref = _asyncToGenerator$1(/*#__PURE__*/ import_regenerator$2.default.mark(function _callee(template) { | |
| 7752 | - var hiddenWrapper; | |
| 7753 | - var container; | |
| 7754 | - var screenshot; | |
| 7755 | - return import_regenerator$2.default.wrap(function(_context) { | |
| 7756 | - while (1) switch (_context.prev = _context.next) { | |
| 7757 | - case 0: | |
| 7758 | - if (template) { | |
| 7759 | - _context.next = 1; | |
| 7760 | - break; | |
| 7761 | - } | |
| 7762 | - return _context.abrupt("return", ""); | |
| 7763 | - case 1: | |
| 7764 | - toggleHistory(false); | |
| 7765 | - hiddenWrapper = createHiddenWrapper(); | |
| 7766 | - container = createContainer(template); | |
| 7767 | - wrapContainer(container, hiddenWrapper); | |
| 7768 | - elementor.getPreviewView().$childViewContainer[0].appendChild(hiddenWrapper); | |
| 7769 | - _context.next = 2; | |
| 7770 | - return waitForContainer(container.id); | |
| 7771 | - case 2: | |
| 7772 | - if (!template.elements.length) { | |
| 7773 | - _context.next = 3; | |
| 7774 | - break; | |
| 7775 | - } | |
| 7776 | - _context.next = 3; | |
| 7777 | - return Promise.all(template.elements.map(function(child) { | |
| 7778 | - return waitForContainer(child.id); | |
| 7779 | - })); | |
| 7780 | - case 3: | |
| 7781 | - _context.prev = 3; | |
| 7782 | - _context.next = 4; | |
| 7783 | - return screenshotNode(container.view.$el[0]); | |
| 7784 | - case 4: | |
| 7785 | - screenshot = _context.sent; | |
| 7786 | - _context.next = 6; | |
| 7787 | - break; | |
| 7788 | - case 5: | |
| 7789 | - _context.prev = 5; | |
| 7790 | - _context["catch"](3); | |
| 7791 | - screenshot = ""; | |
| 7792 | - case 6: | |
| 7793 | - deleteContainer(container); | |
| 7794 | - hiddenWrapper.remove(); | |
| 7795 | - toggleHistory(true); | |
| 7796 | - return _context.abrupt("return", screenshot); | |
| 7797 | - case 7: | |
| 7798 | - case "end": return _context.stop(); | |
| 7799 | - } | |
| 7800 | - }, _callee, null, [[3, 5]]); | |
| 7801 | - })); | |
| 7802 | - return function takeScreenshot(_x) { | |
| 7803 | - return _ref.apply(this, arguments); | |
| 7804 | - }; | |
| 7805 | - }(); | |
| 7806 | - })); | |
| 5790 | +/***/ "../node_modules/prop-types/node_modules/react-is/index.js": | |
| 5791 | +/*!*****************************************************************!*\ | |
| 5792 | + !*** ../node_modules/prop-types/node_modules/react-is/index.js ***! | |
| 5793 | + \*****************************************************************/ | |
| 5794 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 7807 | 5795 | |
| 7808 | -//#endregion | |
| 7809 | -//#region modules/ai/assets/js/editor/layout-app-wrapper.js | |
| 7810 | - var import_prop_types, LayoutAppWrapper; | |
| 7811 | - var init_layout_app_wrapper = __esmMin((() => { | |
| 7812 | - import_prop_types = /* @__PURE__ */ __toESM(require_prop_types()); | |
| 7813 | - LayoutAppWrapper = function LayoutAppWrapper(props) { | |
| 7814 | - return /*#__PURE__*/ react.default.createElement(_elementor_ui.DirectionProvider, { rtl: props.isRTL }, /*#__PURE__*/ react.default.createElement(_elementor_ui.ThemeProvider, { colorScheme: props.colorScheme }, props.children)); | |
| 7815 | - }; | |
| 7816 | - LayoutAppWrapper.propTypes = { | |
| 7817 | - children: import_prop_types.default.node, | |
| 7818 | - isRTL: import_prop_types.default.bool, | |
| 7819 | - colorScheme: import_prop_types.default.oneOf([ | |
| 7820 | - "auto", | |
| 7821 | - "light", | |
| 7822 | - "dark" | |
| 7823 | - ]) | |
| 7824 | - }; | |
| 7825 | - })); | |
| 5796 | +"use strict"; | |
| 7826 | 5797 | |
| 7827 | -//#endregion | |
| 7828 | -//#region modules/ai/assets/js/editor/utils/editor-integration.js | |
| 7829 | - var editor_integration_exports = /* @__PURE__ */ __exportAll({ | |
| 7830 | - VARIATIONS_PROMPTS: () => VARIATIONS_PROMPTS, | |
| 7831 | - WEB_BASED_PROMPTS: () => WEB_BASED_PROMPTS, | |
| 7832 | - closePanel: () => closePanel, | |
| 7833 | - getUiConfig: () => getUiConfig, | |
| 7834 | - importToEditor: () => importToEditor, | |
| 7835 | - onConnect: () => onConnect, | |
| 7836 | - openPanel: () => openPanel, | |
| 7837 | - renderLayoutApp: () => renderLayoutApp | |
| 7838 | - }); | |
| 7839 | - var import_regenerator$1, closePanel, openPanel, onConnect, getUiConfig, VARIATIONS_PROMPTS, WEB_BASED_PROMPTS, PROMPT_PLACEHOLDER, renderLayoutApp, importToEditor; | |
| 7840 | - var init_editor_integration = __esmMin((() => { | |
| 7841 | - init_asyncToGenerator$1(); | |
| 7842 | - import_regenerator$1 = /* @__PURE__ */ __toESM(require_regenerator()); | |
| 7843 | - init_react(); | |
| 7844 | - init_preview_container(); | |
| 7845 | - init_layout_app(); | |
| 7846 | - init_screenshot(); | |
| 7847 | - init_history(); | |
| 7848 | - init_layout_app_wrapper(); | |
| 7849 | - init_requests_ids(); | |
| 7850 | - closePanel = function closePanel() { | |
| 7851 | - $e.run("panel/close"); | |
| 7852 | - $e.components.get("panel").blockUserInteractions(); | |
| 7853 | - }; | |
| 7854 | - openPanel = function openPanel() { | |
| 7855 | - $e.run("panel/open"); | |
| 7856 | - $e.components.get("panel").unblockUserInteractions(); | |
| 7857 | - }; | |
| 7858 | - onConnect = function onConnect(data) { | |
| 7859 | - elementorCommon.config.library_connect.is_connected = true; | |
| 7860 | - elementorCommon.config.library_connect.current_access_level = data.kits_access_level || data.access_level || 0; | |
| 7861 | - elementorCommon.config.library_connect.current_access_tier = data.access_tier; | |
| 7862 | - elementorCommon.config.library_connect.plan_type = data.plan_type; | |
| 7863 | - }; | |
| 7864 | - getUiConfig = function getUiConfig() { | |
| 7865 | - var _elementor; | |
| 7866 | - var _elementor$getPrefere; | |
| 7867 | - return { | |
| 7868 | - colorScheme: ((_elementor = elementor) === null || _elementor === void 0 || (_elementor$getPrefere = _elementor.getPreferences) === null || _elementor$getPrefere === void 0 ? void 0 : _elementor$getPrefere.call(_elementor, "ui_theme")) || "auto", | |
| 7869 | - isRTL: elementorCommon.config.isRTL | |
| 7870 | - }; | |
| 7871 | - }; | |
| 7872 | - VARIATIONS_PROMPTS = [ | |
| 7873 | - { text: (0, _wordpress_i18n.__)("Minimalist design with bold typography about", "elementor") }, | |
| 7874 | - { text: (0, _wordpress_i18n.__)("Elegant style with serif fonts discussing", "elementor") }, | |
| 7875 | - { text: (0, _wordpress_i18n.__)("Retro vibe with muted colors and classic fonts about", "elementor") }, | |
| 7876 | - { text: (0, _wordpress_i18n.__)("Futuristic design with neon accents about", "elementor") }, | |
| 7877 | - { text: (0, _wordpress_i18n.__)("Professional look with clean lines for", "elementor") }, | |
| 7878 | - { text: (0, _wordpress_i18n.__)("Earthy tones and organic shapes featuring", "elementor") }, | |
| 7879 | - { text: (0, _wordpress_i18n.__)("Luxurious theme with rich colors discussing", "elementor") }, | |
| 7880 | - { text: (0, _wordpress_i18n.__)("Tech-inspired style with modern fonts about", "elementor") }, | |
| 7881 | - { text: (0, _wordpress_i18n.__)("Warm hues with comforting visuals about", "elementor") } | |
| 7882 | - ]; | |
| 7883 | - WEB_BASED_PROMPTS = [ | |
| 7884 | - { text: (0, _wordpress_i18n.__)("Change the content to be about [topic]", "elementor") }, | |
| 7885 | - { text: (0, _wordpress_i18n.__)("Generate lorem ipsum placeholder text for all paragraphs", "elementor") }, | |
| 7886 | - { text: (0, _wordpress_i18n.__)("Revise the content to focus on [topic] and then translate it into Spanish", "elementor") }, | |
| 7887 | - { text: (0, _wordpress_i18n.__)("Shift the focus of the content to [topic] in order to showcase our company's mission and values", "elementor") }, | |
| 7888 | - { text: (0, _wordpress_i18n.__)("Alter the content to provide helpful tips related to [topic]", "elementor") }, | |
| 7889 | - { text: (0, _wordpress_i18n.__)("Adjust the content to include FAQs and answers for common inquiries about [topic]", "elementor") } | |
| 7890 | - ]; | |
| 7891 | - PROMPT_PLACEHOLDER = (0, _wordpress_i18n.__)("Press '/' for suggestions or describe the changes you want to apply (optional)...", "elementor"); | |
| 7892 | - renderLayoutApp = function renderLayoutApp() { | |
| 7893 | - var _options$onRenderApp; | |
| 7894 | - var options = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : { | |
| 7895 | - parentContainer: null, | |
| 7896 | - mode: "", | |
| 7897 | - at: null, | |
| 7898 | - onClose: null, | |
| 7899 | - onGenerate: null, | |
| 7900 | - onInsert: null, | |
| 7901 | - onRenderApp: null, | |
| 7902 | - onSelect: null, | |
| 7903 | - attachments: [] | |
| 7904 | - }; | |
| 7905 | - closePanel(); | |
| 7906 | - var previewContainer = createPreviewContainer(options.parentContainer, { at: options.at }); | |
| 7907 | - var _getUiConfig = getUiConfig(); | |
| 7908 | - var colorScheme = _getUiConfig.colorScheme; | |
| 7909 | - var isRTL = _getUiConfig.isRTL; | |
| 7910 | - var rootElement = document.createElement("div"); | |
| 7911 | - document.body.append(rootElement); | |
| 7912 | - var bodyStyle = window.elementorFrontend.elements.$window[0].getComputedStyle(window.elementorFrontend.elements.$body[0]); | |
| 7913 | - var unmount = react_default.render(/*#__PURE__*/ react.default.createElement(LayoutAppWrapper, { | |
| 7914 | - isRTL, | |
| 7915 | - colorScheme | |
| 7916 | - }, /*#__PURE__*/ react.default.createElement(LayoutApp, { | |
| 7917 | - mode: options.mode, | |
| 7918 | - currentContext: { body: { | |
| 7919 | - backgroundColor: bodyStyle.backgroundColor, | |
| 7920 | - backgroundImage: bodyStyle.backgroundImage | |
| 7921 | - } }, | |
| 7922 | - attachmentsTypes: { | |
| 7923 | - json: { | |
| 7924 | - promptSuggestions: VARIATIONS_PROMPTS, | |
| 7925 | - promptPlaceholder: PROMPT_PLACEHOLDER, | |
| 7926 | - previewGenerator: function() { | |
| 7927 | - var _previewGenerator = _asyncToGenerator$1(/*#__PURE__*/ import_regenerator$1.default.mark(function _callee(json) { | |
| 7928 | - var screenshot; | |
| 7929 | - return import_regenerator$1.default.wrap(function(_context) { | |
| 7930 | - while (1) switch (_context.prev = _context.next) { | |
| 7931 | - case 0: | |
| 7932 | - _context.next = 1; | |
| 7933 | - return takeScreenshot(json); | |
| 7934 | - case 1: | |
| 7935 | - screenshot = _context.sent; | |
| 7936 | - return _context.abrupt("return", "<img src=\"".concat(screenshot, "\" />")); | |
| 7937 | - case 2: | |
| 7938 | - case "end": return _context.stop(); | |
| 7939 | - } | |
| 7940 | - }, _callee); | |
| 7941 | - })); | |
| 7942 | - function previewGenerator(_x) { | |
| 7943 | - return _previewGenerator.apply(this, arguments); | |
| 7944 | - } | |
| 7945 | - return previewGenerator; | |
| 7946 | - }() | |
| 7947 | - }, | |
| 7948 | - url: { | |
| 7949 | - promptPlaceholder: PROMPT_PLACEHOLDER, | |
| 7950 | - promptSuggestions: WEB_BASED_PROMPTS | |
| 7951 | - } | |
| 7952 | - }, | |
| 7953 | - attachments: options.attachments || [], | |
| 7954 | - onClose: function onClose() { | |
| 7955 | - var _options$onClose; | |
| 7956 | - previewContainer.destroy(); | |
| 7957 | - (_options$onClose = options.onClose) === null || _options$onClose === void 0 || _options$onClose.call(options); | |
| 7958 | - unmount(); | |
| 7959 | - rootElement.remove(); | |
| 7960 | - openPanel(); | |
| 7961 | - }, | |
| 7962 | - onConnect, | |
| 7963 | - onGenerate: function onGenerate() { | |
| 7964 | - var _options$onGenerate; | |
| 7965 | - (_options$onGenerate = options.onGenerate) === null || _options$onGenerate === void 0 || _options$onGenerate.call(options, { previewContainer }); | |
| 7966 | - }, | |
| 7967 | - onData: /*#__PURE__*/ function() { | |
| 7968 | - var _ref = _asyncToGenerator$1(/*#__PURE__*/ import_regenerator$1.default.mark(function _callee2(template) { | |
| 7969 | - var screenshot; | |
| 7970 | - return import_regenerator$1.default.wrap(function(_context2) { | |
| 7971 | - while (1) switch (_context2.prev = _context2.next) { | |
| 7972 | - case 0: | |
| 7973 | - _context2.next = 1; | |
| 7974 | - return takeScreenshot(template); | |
| 7975 | - case 1: | |
| 7976 | - screenshot = _context2.sent; | |
| 7977 | - return _context2.abrupt("return", { | |
| 7978 | - screenshot, | |
| 7979 | - template | |
| 7980 | - }); | |
| 7981 | - case 2: | |
| 7982 | - case "end": return _context2.stop(); | |
| 7983 | - } | |
| 7984 | - }, _callee2); | |
| 7985 | - })); | |
| 7986 | - return function(_x2) { | |
| 7987 | - return _ref.apply(this, arguments); | |
| 7988 | - }; | |
| 7989 | - }(), | |
| 7990 | - onSelect: function onSelect(template) { | |
| 7991 | - var _options$onSelect; | |
| 7992 | - (_options$onSelect = options.onSelect) === null || _options$onSelect === void 0 || _options$onSelect.call(options); | |
| 7993 | - previewContainer.setContent(template); | |
| 7994 | - }, | |
| 7995 | - onInsert: options.onInsert, | |
| 7996 | - hasPro: elementor.helpers.hasPro() | |
| 7997 | - })), rootElement).unmount; | |
| 7998 | - (_options$onRenderApp = options.onRenderApp) === null || _options$onRenderApp === void 0 || _options$onRenderApp.call(options, { previewContainer }); | |
| 7999 | - }; | |
| 8000 | - importToEditor = function importToEditor(_ref2) { | |
| 8001 | - var parentContainer = _ref2.parentContainer; | |
| 8002 | - var at = _ref2.at; | |
| 8003 | - var template = _ref2.template; | |
| 8004 | - var historyTitle = _ref2.historyTitle; | |
| 8005 | - var _ref2$replace = _ref2.replace; | |
| 8006 | - var replace = _ref2$replace === void 0 ? false : _ref2$replace; | |
| 8007 | - var endHistoryLog = startHistoryLog({ | |
| 8008 | - type: "import", | |
| 8009 | - title: historyTitle | |
| 8010 | - }); | |
| 8011 | - if (replace) $e.run("document/elements/delete", { container: parentContainer.children.at(at) }); | |
| 8012 | - $e.run("document/elements/create", { | |
| 8013 | - container: parentContainer, | |
| 8014 | - model: generateIds(template), | |
| 8015 | - options: { | |
| 8016 | - at, | |
| 8017 | - edit: true | |
| 8018 | - } | |
| 8019 | - }); | |
| 8020 | - endHistoryLog(); | |
| 8021 | - }; | |
| 8022 | - })); | |
| 8023 | 5798 | |
| 8024 | -//#endregion | |
| 8025 | -//#region assets/dev/js/editor/utils/editor-one-events.js | |
| 8026 | - var editor_one_events_exports = /* @__PURE__ */ __exportAll({ | |
| 8027 | - EditorOneEventManager: () => EditorOneEventManager, | |
| 8028 | - createDebouncedFinderSearch: () => createDebouncedFinderSearch, | |
| 8029 | - createDebouncedWidgetPanelSearch: () => createDebouncedWidgetPanelSearch, | |
| 8030 | - default: () => EditorOneEventManager | |
| 8031 | - }); | |
| 8032 | - function ownKeys(e, r) { | |
| 8033 | - var t = Object.keys(e); | |
| 8034 | - if (Object.getOwnPropertySymbols) { | |
| 8035 | - var o = Object.getOwnPropertySymbols(e); | |
| 8036 | - r && (o = o.filter(function(r) { | |
| 8037 | - return Object.getOwnPropertyDescriptor(e, r).enumerable; | |
| 8038 | - })), t.push.apply(t, o); | |
| 8039 | - } | |
| 8040 | - return t; | |
| 8041 | - } | |
| 8042 | - function _objectSpread(e) { | |
| 8043 | - for (var r = 1; r < arguments.length; r++) { | |
| 8044 | - var t = null != arguments[r] ? arguments[r] : {}; | |
| 8045 | - r % 2 ? ownKeys(Object(t), !0).forEach(function(r) { | |
| 8046 | - _defineProperty$1(e, r, t[r]); | |
| 8047 | - }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r) { | |
| 8048 | - Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); | |
| 8049 | - }); | |
| 8050 | - } | |
| 8051 | - return e; | |
| 8052 | - } | |
| 8053 | - var EditorOneEventManager, createDebouncedFinderSearch, createDebouncedWidgetPanelSearch; | |
| 8054 | - var init_editor_one_events = __esmMin((() => { | |
| 8055 | - init_defineProperty$1(); | |
| 8056 | - EditorOneEventManager = /*#__PURE__*/ function() { | |
| 8057 | - function EditorOneEventManager() { | |
| 8058 | - _classCallCheck(this, EditorOneEventManager); | |
| 8059 | - } | |
| 8060 | - return _createClass(EditorOneEventManager, null, [ | |
| 8061 | - { | |
| 8062 | - key: "getEventsManager", | |
| 8063 | - value: function getEventsManager() { | |
| 8064 | - var _elementorCommon; | |
| 8065 | - return (_elementorCommon = elementorCommon) === null || _elementorCommon === void 0 ? void 0 : _elementorCommon.eventsManager; | |
| 8066 | - } | |
| 8067 | - }, | |
| 8068 | - { | |
| 8069 | - key: "getConfig", | |
| 8070 | - value: function getConfig() { | |
| 8071 | - var _this$getEventsManage; | |
| 8072 | - return (_this$getEventsManage = this.getEventsManager()) === null || _this$getEventsManage === void 0 ? void 0 : _this$getEventsManage.config; | |
| 8073 | - } | |
| 8074 | - }, | |
| 8075 | - { | |
| 8076 | - key: "canSendEvents", | |
| 8077 | - value: function canSendEvents() { | |
| 8078 | - var _elementorCommon2; | |
| 8079 | - return ((_elementorCommon2 = elementorCommon) === null || _elementorCommon2 === void 0 || (_elementorCommon2 = _elementorCommon2.config) === null || _elementorCommon2 === void 0 || (_elementorCommon2 = _elementorCommon2.editor_events) === null || _elementorCommon2 === void 0 ? void 0 : _elementorCommon2.can_send_events) || false; | |
| 8080 | - } | |
| 8081 | - }, | |
| 8082 | - { | |
| 8083 | - key: "isEventsManagerAvailable", | |
| 8084 | - value: function isEventsManagerAvailable() { | |
| 8085 | - var eventsManager = this.getEventsManager(); | |
| 8086 | - return eventsManager && "function" === typeof eventsManager.dispatchEvent; | |
| 8087 | - } | |
| 8088 | - }, | |
| 8089 | - { | |
| 8090 | - key: "dispatchEvent", | |
| 8091 | - value: function dispatchEvent(eventName, payload) { | |
| 8092 | - try { | |
| 8093 | - if (!this.isEventsManagerAvailable() || !this.canSendEvents()) return false; | |
| 8094 | - this.getEventsManager().dispatchEvent(eventName, payload); | |
| 8095 | - return true; | |
| 8096 | - } catch (error) { | |
| 8097 | - return false; | |
| 8098 | - } | |
| 8099 | - } | |
| 8100 | - }, | |
| 8101 | - { | |
| 8102 | - key: "toLowerSnake", | |
| 8103 | - value: function toLowerSnake(value) { | |
| 8104 | - if (!value || "string" !== typeof value) return value; | |
| 8105 | - return value.replace(/\s+/g, "_").toLowerCase(); | |
| 8106 | - } | |
| 8107 | - }, | |
| 8108 | - { | |
| 8109 | - key: "decodeHtmlEntities", | |
| 8110 | - value: function decodeHtmlEntities(text) { | |
| 8111 | - if (!text || "string" !== typeof text) return text; | |
| 8112 | - return new DOMParser().parseFromString(text, "text/html").body.textContent || text; | |
| 8113 | - } | |
| 8114 | - }, | |
| 8115 | - { | |
| 8116 | - key: "isInEditorContext", | |
| 8117 | - value: function isInEditorContext() { | |
| 8118 | - var _window$elementor; | |
| 8119 | - return "undefined" !== typeof window.elementor && !!((_window$elementor = window.elementor) !== null && _window$elementor !== void 0 && _window$elementor.documents); | |
| 8120 | - } | |
| 8121 | - }, | |
| 8122 | - { | |
| 8123 | - key: "getFinderContext", | |
| 8124 | - value: function getFinderContext() { | |
| 8125 | - var _config$appTypes; | |
| 8126 | - var _config$appTypes2; | |
| 8127 | - var _config$locations; | |
| 8128 | - var _config$locations2; | |
| 8129 | - var config = this.getConfig(); | |
| 8130 | - var isEditor = this.isInEditorContext(); | |
| 8131 | - return { | |
| 8132 | - windowName: isEditor ? config === null || config === void 0 || (_config$appTypes = config.appTypes) === null || _config$appTypes === void 0 ? void 0 : _config$appTypes.editor : config === null || config === void 0 || (_config$appTypes2 = config.appTypes) === null || _config$appTypes2 === void 0 ? void 0 : _config$appTypes2.wpAdmin, | |
| 8133 | - targetLocation: this.toLowerSnake(isEditor ? config === null || config === void 0 || (_config$locations = config.locations) === null || _config$locations === void 0 ? void 0 : _config$locations.topBar : config === null || config === void 0 || (_config$locations2 = config.locations) === null || _config$locations2 === void 0 ? void 0 : _config$locations2.sidebar) | |
| 8134 | - }; | |
| 8135 | - } | |
| 8136 | - }, | |
| 8137 | - { | |
| 8138 | - key: "createBasePayload", | |
| 8139 | - value: function createBasePayload() { | |
| 8140 | - var _config$appTypes$edit; | |
| 8141 | - var _config$appTypes3; | |
| 8142 | - var overrides = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; | |
| 8143 | - var config = this.getConfig(); | |
| 8144 | - return _objectSpread({ window_name: (_config$appTypes$edit = config === null || config === void 0 || (_config$appTypes3 = config.appTypes) === null || _config$appTypes3 === void 0 ? void 0 : _config$appTypes3.editor) !== null && _config$appTypes$edit !== void 0 ? _config$appTypes$edit : "editor" }, overrides); | |
| 8145 | - } | |
| 8146 | - }, | |
| 8147 | - { | |
| 8148 | - key: "sendTopBarPublishDropdown", | |
| 8149 | - value: function sendTopBarPublishDropdown(targetName) { | |
| 8150 | - var _config$names; | |
| 8151 | - var _config$triggers; | |
| 8152 | - var _config$targetTypes; | |
| 8153 | - var _config$interactionRe; | |
| 8154 | - var _config$locations3; | |
| 8155 | - var _config$secondaryLoca; | |
| 8156 | - var _config$targetTypes2; | |
| 8157 | - var config = this.getConfig(); | |
| 8158 | - return this.dispatchEvent(config === null || config === void 0 || (_config$names = config.names) === null || _config$names === void 0 || (_config$names = _config$names.editorOne) === null || _config$names === void 0 ? void 0 : _config$names.topBarPublishDropdown, this.createBasePayload({ | |
| 8159 | - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers = config.triggers) === null || _config$triggers === void 0 ? void 0 : _config$triggers.click), | |
| 8160 | - target_type: config === null || config === void 0 || (_config$targetTypes = config.targetTypes) === null || _config$targetTypes === void 0 ? void 0 : _config$targetTypes.dropdownItem, | |
| 8161 | - target_name: targetName, | |
| 8162 | - interaction_result: config === null || config === void 0 || (_config$interactionRe = config.interactionResults) === null || _config$interactionRe === void 0 ? void 0 : _config$interactionRe.actionSelected, | |
| 8163 | - target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations3 = config.locations) === null || _config$locations3 === void 0 ? void 0 : _config$locations3.topBar), | |
| 8164 | - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca = config.secondaryLocations) === null || _config$secondaryLoca === void 0 ? void 0 : _config$secondaryLoca.publishDropdown), | |
| 8165 | - location_l2: config === null || config === void 0 || (_config$targetTypes2 = config.targetTypes) === null || _config$targetTypes2 === void 0 ? void 0 : _config$targetTypes2.dropdownItem, | |
| 8166 | - interaction_description: "User selected an action from the publish dropdown" | |
| 8167 | - })); | |
| 8168 | - } | |
| 8169 | - }, | |
| 8170 | - { | |
| 8171 | - key: "sendTopBarPageList", | |
| 8172 | - value: function sendTopBarPageList(targetName) { | |
| 8173 | - var _config$names2; | |
| 8174 | - var _config$triggers2; | |
| 8175 | - var _config$targetTypes3; | |
| 8176 | - var _config$interactionRe2; | |
| 8177 | - var _config$interactionRe3; | |
| 8178 | - var _config$locations4; | |
| 8179 | - var _config$secondaryLoca2; | |
| 8180 | - var _config$targetTypes4; | |
| 8181 | - var isCreate = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false; | |
| 8182 | - var config = this.getConfig(); | |
| 8183 | - return this.dispatchEvent(config === null || config === void 0 || (_config$names2 = config.names) === null || _config$names2 === void 0 || (_config$names2 = _config$names2.editorOne) === null || _config$names2 === void 0 ? void 0 : _config$names2.topBarPageList, this.createBasePayload({ | |
| 8184 | - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers2 = config.triggers) === null || _config$triggers2 === void 0 ? void 0 : _config$triggers2.click), | |
| 8185 | - target_type: config === null || config === void 0 || (_config$targetTypes3 = config.targetTypes) === null || _config$targetTypes3 === void 0 ? void 0 : _config$targetTypes3.dropdownItem, | |
| 8186 | - target_name: targetName, | |
| 8187 | - interaction_result: isCreate ? config === null || config === void 0 || (_config$interactionRe2 = config.interactionResults) === null || _config$interactionRe2 === void 0 ? void 0 : _config$interactionRe2.create : config === null || config === void 0 || (_config$interactionRe3 = config.interactionResults) === null || _config$interactionRe3 === void 0 ? void 0 : _config$interactionRe3.navigate, | |
| 8188 | - target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations4 = config.locations) === null || _config$locations4 === void 0 ? void 0 : _config$locations4.topBar), | |
| 8189 | - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca2 = config.secondaryLocations) === null || _config$secondaryLoca2 === void 0 ? void 0 : _config$secondaryLoca2.pageListDropdown), | |
| 8190 | - location_l2: config === null || config === void 0 || (_config$targetTypes4 = config.targetTypes) === null || _config$targetTypes4 === void 0 ? void 0 : _config$targetTypes4.dropdownItem, | |
| 8191 | - interaction_description: "User selected an action from the page list dropdown" | |
| 8192 | - })); | |
| 8193 | - } | |
| 8194 | - }, | |
| 8195 | - { | |
| 8196 | - key: "sendSiteSettingsSession", | |
| 8197 | - value: function sendSiteSettingsSession(_ref) { | |
| 8198 | - var _config$names3; | |
| 8199 | - var _config$triggers3; | |
| 8200 | - var _config$interactionRe4; | |
| 8201 | - var _config$locations5; | |
| 8202 | - var _config$secondaryLoca3; | |
| 8203 | - var targetType = _ref.targetType; | |
| 8204 | - var _ref$visitedItems = _ref.visitedItems; | |
| 8205 | - var visitedItems = _ref$visitedItems === void 0 ? [] : _ref$visitedItems; | |
| 8206 | - var _ref$savedItems = _ref.savedItems; | |
| 8207 | - var savedItems = _ref$savedItems === void 0 ? [] : _ref$savedItems; | |
| 8208 | - var state = _ref.state; | |
| 8209 | - var config = this.getConfig(); | |
| 8210 | - return this.dispatchEvent(config === null || config === void 0 || (_config$names3 = config.names) === null || _config$names3 === void 0 || (_config$names3 = _config$names3.editorOne) === null || _config$names3 === void 0 ? void 0 : _config$names3.siteSettingsSession, this.createBasePayload({ | |
| 8211 | - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers3 = config.triggers) === null || _config$triggers3 === void 0 ? void 0 : _config$triggers3.click), | |
| 8212 | - target_type: targetType, | |
| 8213 | - target_name: "site_settings", | |
| 8214 | - interaction_result: config === null || config === void 0 || (_config$interactionRe4 = config.interactionResults) === null || _config$interactionRe4 === void 0 ? void 0 : _config$interactionRe4.sessionEnd, | |
| 8215 | - target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations5 = config.locations) === null || _config$locations5 === void 0 ? void 0 : _config$locations5.leftPanel), | |
| 8216 | - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca3 = config.secondaryLocations) === null || _config$secondaryLoca3 === void 0 ? void 0 : _config$secondaryLoca3.siteSettings), | |
| 8217 | - interaction_description: "Records areas visited as part of the site setting session", | |
| 8218 | - metadata: { | |
| 8219 | - visited_items: visitedItems, | |
| 8220 | - saved_items: savedItems | |
| 8221 | - }, | |
| 8222 | - state | |
| 8223 | - })); | |
| 8224 | - } | |
| 8225 | - }, | |
| 8226 | - { | |
| 8227 | - key: "sendELibraryNav", | |
| 8228 | - value: function sendELibraryNav(tabName) { | |
| 8229 | - var _config$names4; | |
| 8230 | - var _config$triggers4; | |
| 8231 | - var _config$targetTypes5; | |
| 8232 | - var _config$interactionRe5; | |
| 8233 | - var _config$locations6; | |
| 8234 | - var _config$secondaryLoca4; | |
| 8235 | - var config = this.getConfig(); | |
| 8236 | - return this.dispatchEvent(config === null || config === void 0 || (_config$names4 = config.names) === null || _config$names4 === void 0 || (_config$names4 = _config$names4.editorOne) === null || _config$names4 === void 0 ? void 0 : _config$names4.eLibraryNav, this.createBasePayload({ | |
| 8237 | - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers4 = config.triggers) === null || _config$triggers4 === void 0 ? void 0 : _config$triggers4.tabSelect), | |
| 8238 | - target_type: config === null || config === void 0 || (_config$targetTypes5 = config.targetTypes) === null || _config$targetTypes5 === void 0 ? void 0 : _config$targetTypes5.tab, | |
| 8239 | - target_name: this.toLowerSnake(tabName), | |
| 8240 | - interaction_result: config === null || config === void 0 || (_config$interactionRe5 = config.interactionResults) === null || _config$interactionRe5 === void 0 ? void 0 : _config$interactionRe5.tabChanged, | |
| 8241 | - target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations6 = config.locations) === null || _config$locations6 === void 0 ? void 0 : _config$locations6.elementorLibrary), | |
| 8242 | - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca4 = config.secondaryLocations) === null || _config$secondaryLoca4 === void 0 ? void 0 : _config$secondaryLoca4.libraryTabs), | |
| 8243 | - interaction_description: "User navigates within elementor library" | |
| 8244 | - })); | |
| 8245 | - } | |
| 8246 | - }, | |
| 8247 | - { | |
| 8248 | - key: "sendELibraryInsert", | |
| 8249 | - value: function sendELibraryInsert(_ref2) { | |
| 8250 | - var _config$triggers5; | |
| 8251 | - var _config$targetTypes6; | |
| 8252 | - var _config$interactionRe6; | |
| 8253 | - var _config$locations7; | |
| 8254 | - var _config$secondaryLoca5; | |
| 8255 | - var _config$names5; | |
| 8256 | - var assetId = _ref2.assetId; | |
| 8257 | - var assetName = _ref2.assetName; | |
| 8258 | - var libraryType = _ref2.libraryType; | |
| 8259 | - var _ref2$proRequired = _ref2.proRequired; | |
| 8260 | - var proRequired = _ref2$proRequired === void 0 ? false : _ref2$proRequired; | |
| 8261 | - var config = this.getConfig(); | |
| 8262 | - var payload = this.createBasePayload({ | |
| 8263 | - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers5 = config.triggers) === null || _config$triggers5 === void 0 ? void 0 : _config$triggers5.insert), | |
| 8264 | - target_type: config === null || config === void 0 || (_config$targetTypes6 = config.targetTypes) === null || _config$targetTypes6 === void 0 ? void 0 : _config$targetTypes6.button, | |
| 8265 | - target_name: String(assetId), | |
| 8266 | - interaction_result: config === null || config === void 0 || (_config$interactionRe6 = config.interactionResults) === null || _config$interactionRe6 === void 0 ? void 0 : _config$interactionRe6.assetInserted, | |
| 8267 | - target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations7 = config.locations) === null || _config$locations7 === void 0 ? void 0 : _config$locations7.elementorLibrary), | |
| 8268 | - location_l1: this.toLowerSnake(libraryType), | |
| 8269 | - location_l2: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca5 = config.secondaryLocations) === null || _config$secondaryLoca5 === void 0 ? void 0 : _config$secondaryLoca5.assetCard), | |
| 8270 | - interaction_description: "User inserts block/pages from elementor library", | |
| 8271 | - metadata: { | |
| 8272 | - template_id: String(assetId), | |
| 8273 | - template_name: this.decodeHtmlEntities(assetName) || "" | |
| 8274 | - } | |
| 8275 | - }); | |
| 8276 | - if (proRequired) payload.state = "pro_plan_required"; | |
| 8277 | - return this.dispatchEvent(config === null || config === void 0 || (_config$names5 = config.names) === null || _config$names5 === void 0 || (_config$names5 = _config$names5.editorOne) === null || _config$names5 === void 0 ? void 0 : _config$names5.eLibraryInsert, payload); | |
| 8278 | - } | |
| 8279 | - }, | |
| 8280 | - { | |
| 8281 | - key: "sendELibraryFavorite", | |
| 8282 | - value: function sendELibraryFavorite(_ref3) { | |
| 8283 | - var _config$triggers6; | |
| 8284 | - var _config$targetTypes7; | |
| 8285 | - var _config$interactionRe7; | |
| 8286 | - var _config$locations8; | |
| 8287 | - var _config$secondaryLoca6; | |
| 8288 | - var _config$names6; | |
| 8289 | - var assetId = _ref3.assetId; | |
| 8290 | - var assetName = _ref3.assetName; | |
| 8291 | - var libraryType = _ref3.libraryType; | |
| 8292 | - var isFavorite = _ref3.isFavorite; | |
| 8293 | - var _ref3$proRequired = _ref3.proRequired; | |
| 8294 | - var proRequired = _ref3$proRequired === void 0 ? false : _ref3$proRequired; | |
| 8295 | - var config = this.getConfig(); | |
| 8296 | - var payload = this.createBasePayload({ | |
| 8297 | - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers6 = config.triggers) === null || _config$triggers6 === void 0 ? void 0 : _config$triggers6.click), | |
| 8298 | - target_type: config === null || config === void 0 || (_config$targetTypes7 = config.targetTypes) === null || _config$targetTypes7 === void 0 ? void 0 : _config$targetTypes7.toggle, | |
| 8299 | - target_name: String(assetId), | |
| 8300 | - interaction_result: config === null || config === void 0 || (_config$interactionRe7 = config.interactionResults) === null || _config$interactionRe7 === void 0 ? void 0 : _config$interactionRe7.assetFavorite, | |
| 8301 | - target_value: Boolean(isFavorite), | |
| 8302 | - target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations8 = config.locations) === null || _config$locations8 === void 0 ? void 0 : _config$locations8.elementorLibrary), | |
| 8303 | - location_l1: this.toLowerSnake(libraryType), | |
| 8304 | - location_l2: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca6 = config.secondaryLocations) === null || _config$secondaryLoca6 === void 0 ? void 0 : _config$secondaryLoca6.assetCard), | |
| 8305 | - interaction_description: "User favorite block/pages from elementor library", | |
| 8306 | - metadata: { | |
| 8307 | - template_id: String(assetId), | |
| 8308 | - template_name: this.decodeHtmlEntities(assetName) || "" | |
| 8309 | - } | |
| 8310 | - }); | |
| 8311 | - if (proRequired) payload.state = "pro_plan_required"; | |
| 8312 | - return this.dispatchEvent(config === null || config === void 0 || (_config$names6 = config.names) === null || _config$names6 === void 0 || (_config$names6 = _config$names6.editorOne) === null || _config$names6 === void 0 ? void 0 : _config$names6.eLibraryFavorite, payload); | |
| 8313 | - } | |
| 8314 | - }, | |
| 8315 | - { | |
| 8316 | - key: "sendELibraryGenerateAi", | |
| 8317 | - value: function sendELibraryGenerateAi(_ref4) { | |
| 8318 | - var _config$names7; | |
| 8319 | - var _config$triggers7; | |
| 8320 | - var _config$targetTypes8; | |
| 8321 | - var _config$interactionRe8; | |
| 8322 | - var _config$locations9; | |
| 8323 | - var _config$secondaryLoca7; | |
| 8324 | - var assetId = _ref4.assetId; | |
| 8325 | - var assetName = _ref4.assetName; | |
| 8326 | - var libraryType = _ref4.libraryType; | |
| 8327 | - var config = this.getConfig(); | |
| 8328 | - return this.dispatchEvent(config === null || config === void 0 || (_config$names7 = config.names) === null || _config$names7 === void 0 || (_config$names7 = _config$names7.editorOne) === null || _config$names7 === void 0 ? void 0 : _config$names7.eLibraryGenerateAi, this.createBasePayload({ | |
| 8329 | - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers7 = config.triggers) === null || _config$triggers7 === void 0 ? void 0 : _config$triggers7.click), | |
| 8330 | - target_type: config === null || config === void 0 || (_config$targetTypes8 = config.targetTypes) === null || _config$targetTypes8 === void 0 ? void 0 : _config$targetTypes8.button, | |
| 8331 | - target_name: String(assetId), | |
| 8332 | - interaction_result: config === null || config === void 0 || (_config$interactionRe8 = config.interactionResults) === null || _config$interactionRe8 === void 0 ? void 0 : _config$interactionRe8.aiGenerate, | |
| 8333 | - target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations9 = config.locations) === null || _config$locations9 === void 0 ? void 0 : _config$locations9.elementorLibrary), | |
| 8334 | - location_l1: this.toLowerSnake(libraryType), | |
| 8335 | - location_l2: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca7 = config.secondaryLocations) === null || _config$secondaryLoca7 === void 0 ? void 0 : _config$secondaryLoca7.assetCard), | |
| 8336 | - interaction_description: "User generated block/page based on a library asset", | |
| 8337 | - metadata: { | |
| 8338 | - template_id: String(assetId), | |
| 8339 | - template_name: this.decodeHtmlEntities(assetName) || "" | |
| 8340 | - } | |
| 8341 | - })); | |
| 8342 | - } | |
| 8343 | - }, | |
| 8344 | - { | |
| 8345 | - key: "sendFinderSearchInput", | |
| 8346 | - value: function sendFinderSearchInput(_ref5) { | |
| 8347 | - var _config$triggers8; | |
| 8348 | - var _config$targetTypes9; | |
| 8349 | - var _config$interactionRe9; | |
| 8350 | - var _config$interactionRe0; | |
| 8351 | - var _config$secondaryLoca8; | |
| 8352 | - var _config$names8; | |
| 8353 | - var resultsCount = _ref5.resultsCount; | |
| 8354 | - var _ref5$searchTerm = _ref5.searchTerm; | |
| 8355 | - var searchTerm = _ref5$searchTerm === void 0 ? null : _ref5$searchTerm; | |
| 8356 | - var config = this.getConfig(); | |
| 8357 | - var hasResults = resultsCount > 0; | |
| 8358 | - var finderContext = this.getFinderContext(); | |
| 8359 | - var payload = this.createBasePayload({ | |
| 8360 | - window_name: finderContext.windowName, | |
| 8361 | - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers8 = config.triggers) === null || _config$triggers8 === void 0 ? void 0 : _config$triggers8.typing), | |
| 8362 | - target_type: config === null || config === void 0 || (_config$targetTypes9 = config.targetTypes) === null || _config$targetTypes9 === void 0 ? void 0 : _config$targetTypes9.searchInput, | |
| 8363 | - target_name: "finder", | |
| 8364 | - interaction_result: hasResults ? config === null || config === void 0 || (_config$interactionRe9 = config.interactionResults) === null || _config$interactionRe9 === void 0 ? void 0 : _config$interactionRe9.resultsUpdated : config === null || config === void 0 || (_config$interactionRe0 = config.interactionResults) === null || _config$interactionRe0 === void 0 ? void 0 : _config$interactionRe0.noResults, | |
| 8365 | - target_location: finderContext.targetLocation, | |
| 8366 | - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca8 = config.secondaryLocations) === null || _config$secondaryLoca8 === void 0 ? void 0 : _config$secondaryLoca8.finder), | |
| 8367 | - interaction_description: "Finder search input, follows debounce behavior", | |
| 8368 | - metadata: { results_count: resultsCount } | |
| 8369 | - }); | |
| 8370 | - if (!hasResults && searchTerm) payload.metadata.search_term = searchTerm; | |
| 8371 | - return this.dispatchEvent(config === null || config === void 0 || (_config$names8 = config.names) === null || _config$names8 === void 0 || (_config$names8 = _config$names8.editorOne) === null || _config$names8 === void 0 ? void 0 : _config$names8.finderSearchInput, payload); | |
| 8372 | - } | |
| 8373 | - }, | |
| 8374 | - { | |
| 8375 | - key: "sendFinderResultSelect", | |
| 8376 | - value: function sendFinderResultSelect(choice) { | |
| 8377 | - var _config$names9; | |
| 8378 | - var _config$triggers9; | |
| 8379 | - var _config$targetTypes0; | |
| 8380 | - var _config$interactionRe1; | |
| 8381 | - var _config$secondaryLoca9; | |
| 8382 | - var _config$secondaryLoca0; | |
| 8383 | - var config = this.getConfig(); | |
| 8384 | - var finderContext = this.getFinderContext(); | |
| 8385 | - return this.dispatchEvent(config === null || config === void 0 || (_config$names9 = config.names) === null || _config$names9 === void 0 || (_config$names9 = _config$names9.editorOne) === null || _config$names9 === void 0 ? void 0 : _config$names9.finderResultSelect, this.createBasePayload({ | |
| 8386 | - window_name: finderContext.windowName, | |
| 8387 | - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers9 = config.triggers) === null || _config$triggers9 === void 0 ? void 0 : _config$triggers9.click), | |
| 8388 | - target_type: config === null || config === void 0 || (_config$targetTypes0 = config.targetTypes) === null || _config$targetTypes0 === void 0 ? void 0 : _config$targetTypes0.searchResult, | |
| 8389 | - target_name: choice, | |
| 8390 | - interaction_result: config === null || config === void 0 || (_config$interactionRe1 = config.interactionResults) === null || _config$interactionRe1 === void 0 ? void 0 : _config$interactionRe1.selected, | |
| 8391 | - target_location: finderContext.targetLocation, | |
| 8392 | - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca9 = config.secondaryLocations) === null || _config$secondaryLoca9 === void 0 ? void 0 : _config$secondaryLoca9.finder), | |
| 8393 | - location_l2: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca0 = config.secondaryLocations) === null || _config$secondaryLoca0 === void 0 ? void 0 : _config$secondaryLoca0.finderResults), | |
| 8394 | - interaction_description: "Finder search results was selected" | |
| 8395 | - })); | |
| 8396 | - } | |
| 8397 | - }, | |
| 8398 | - { | |
| 8399 | - key: "sendCanvasEmptyBoxAction", | |
| 8400 | - value: function sendCanvasEmptyBoxAction(_ref6) { | |
| 8401 | - var _config$triggers0; | |
| 8402 | - var _config$targetTypes1; | |
| 8403 | - var _config$interactionRe10; | |
| 8404 | - var _config$locations0; | |
| 8405 | - var _config$secondaryLoca1; | |
| 8406 | - var _config$names0; | |
| 8407 | - var targetName = _ref6.targetName; | |
| 8408 | - var _ref6$metadata = _ref6.metadata; | |
| 8409 | - var metadata = _ref6$metadata === void 0 ? {} : _ref6$metadata; | |
| 8410 | - var _ref6$containerCreate = _ref6.containerCreated; | |
| 8411 | - var containerCreated = _ref6$containerCreate === void 0 ? null : _ref6$containerCreate; | |
| 8412 | - var config = this.getConfig(); | |
| 8413 | - var payload = this.createBasePayload({ | |
| 8414 | - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers0 = config.triggers) === null || _config$triggers0 === void 0 ? void 0 : _config$triggers0.click), | |
| 8415 | - target_type: config === null || config === void 0 || (_config$targetTypes1 = config.targetTypes) === null || _config$targetTypes1 === void 0 ? void 0 : _config$targetTypes1.buttons, | |
| 8416 | - target_name: targetName, | |
| 8417 | - interaction_result: config === null || config === void 0 || (_config$interactionRe10 = config.interactionResults) === null || _config$interactionRe10 === void 0 ? void 0 : _config$interactionRe10.selected, | |
| 8418 | - target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations0 = config.locations) === null || _config$locations0 === void 0 ? void 0 : _config$locations0.canvas), | |
| 8419 | - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca1 = config.secondaryLocations) === null || _config$secondaryLoca1 === void 0 ? void 0 : _config$secondaryLoca1.emptyBox), | |
| 8420 | - interaction_description: "Empty box on canvas actions" | |
| 8421 | - }); | |
| 8422 | - if (Object.keys(metadata).length > 0) payload.metadata = metadata; | |
| 8423 | - if (containerCreated !== null) payload.state = containerCreated; | |
| 8424 | - return this.dispatchEvent(config === null || config === void 0 || (_config$names0 = config.names) === null || _config$names0 === void 0 || (_config$names0 = _config$names0.editorOne) === null || _config$names0 === void 0 ? void 0 : _config$names0.canvasEmptyBoxAction, payload); | |
| 8425 | - } | |
| 8426 | - }, | |
| 8427 | - { | |
| 8428 | - key: "sendWidgetPanelSearch", | |
| 8429 | - value: function sendWidgetPanelSearch(_ref7) { | |
| 8430 | - var _config$triggers1; | |
| 8431 | - var _config$targetTypes10; | |
| 8432 | - var _config$interactionRe11; | |
| 8433 | - var _config$interactionRe12; | |
| 8434 | - var _config$locations1; | |
| 8435 | - var _config$locations10; | |
| 8436 | - var _config$secondaryLoca10; | |
| 8437 | - var _config$names1; | |
| 8438 | - var resultsCount = _ref7.resultsCount; | |
| 8439 | - var _ref7$userInput = _ref7.userInput; | |
| 8440 | - var userInput = _ref7$userInput === void 0 ? null : _ref7$userInput; | |
| 8441 | - var config = this.getConfig(); | |
| 8442 | - var hasResults = resultsCount > 0; | |
| 8443 | - var payload = this.createBasePayload({ | |
| 8444 | - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers1 = config.triggers) === null || _config$triggers1 === void 0 ? void 0 : _config$triggers1.typing), | |
| 8445 | - target_type: config === null || config === void 0 || (_config$targetTypes10 = config.targetTypes) === null || _config$targetTypes10 === void 0 ? void 0 : _config$targetTypes10.searchWidget, | |
| 8446 | - target_name: "search_widget", | |
| 8447 | - interaction_result: hasResults ? config === null || config === void 0 || (_config$interactionRe11 = config.interactionResults) === null || _config$interactionRe11 === void 0 ? void 0 : _config$interactionRe11.resultsUpdated : config === null || config === void 0 || (_config$interactionRe12 = config.interactionResults) === null || _config$interactionRe12 === void 0 ? void 0 : _config$interactionRe12.noResults, | |
| 8448 | - target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations1 = config.locations) === null || _config$locations1 === void 0 ? void 0 : _config$locations1.leftPanel), | |
| 8449 | - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$locations10 = config.locations) === null || _config$locations10 === void 0 ? void 0 : _config$locations10.widgetPanel), | |
| 8450 | - location_l2: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca10 = config.secondaryLocations) === null || _config$secondaryLoca10 === void 0 ? void 0 : _config$secondaryLoca10.searchBar), | |
| 8451 | - interaction_description: "Widget search input, follows debounce behavior" | |
| 8452 | - }); | |
| 8453 | - if (!hasResults && userInput) payload.metadata = { user_input: userInput }; | |
| 8454 | - return this.dispatchEvent(config === null || config === void 0 || (_config$names1 = config.names) === null || _config$names1 === void 0 || (_config$names1 = _config$names1.editorOne) === null || _config$names1 === void 0 ? void 0 : _config$names1.widgetPanelSearch, payload); | |
| 8455 | - } | |
| 8456 | - }, | |
| 8457 | - { | |
| 8458 | - key: "createWpDashPayload", | |
| 8459 | - value: function createWpDashPayload() { | |
| 8460 | - var _config$appTypes$wpDa; | |
| 8461 | - var _config$appTypes4; | |
| 8462 | - var _config$locations11; | |
| 8463 | - var overrides = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {}; | |
| 8464 | - var config = this.getConfig(); | |
| 8465 | - return this.createBasePayload(_objectSpread({ | |
| 8466 | - window_name: (_config$appTypes$wpDa = config === null || config === void 0 || (_config$appTypes4 = config.appTypes) === null || _config$appTypes4 === void 0 ? void 0 : _config$appTypes4.wpDash) !== null && _config$appTypes$wpDa !== void 0 ? _config$appTypes$wpDa : "wpdash", | |
| 8467 | - target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations11 = config.locations) === null || _config$locations11 === void 0 ? void 0 : _config$locations11.wpDashAdmin), | |
| 8468 | - location_l2: "" | |
| 8469 | - }, overrides)); | |
| 8470 | - } | |
| 8471 | - }, | |
| 8472 | - { | |
| 8473 | - key: "sendWpDashElementorMenuClick", | |
| 8474 | - value: function sendWpDashElementorMenuClick() { | |
| 8475 | - var _config$names10; | |
| 8476 | - var _config$triggers10; | |
| 8477 | - var _config$targetTypes11; | |
| 8478 | - var _config$interactionRe13; | |
| 8479 | - var _config$secondaryLoca11; | |
| 8480 | - var config = this.getConfig(); | |
| 8481 | - return this.dispatchEvent(config === null || config === void 0 || (_config$names10 = config.names) === null || _config$names10 === void 0 || (_config$names10 = _config$names10.editorOne) === null || _config$names10 === void 0 ? void 0 : _config$names10.wpDashElementorMenuClick, this.createWpDashPayload({ | |
| 8482 | - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers10 = config.triggers) === null || _config$triggers10 === void 0 ? void 0 : _config$triggers10.click), | |
| 8483 | - target_type: config === null || config === void 0 || (_config$targetTypes11 = config.targetTypes) === null || _config$targetTypes11 === void 0 ? void 0 : _config$targetTypes11.wpDashAdminMenuItem, | |
| 8484 | - target_name: "elementor_menu_item", | |
| 8485 | - interaction_result: config === null || config === void 0 || (_config$interactionRe13 = config.interactionResults) === null || _config$interactionRe13 === void 0 ? void 0 : _config$interactionRe13.elementorSideMenuOpened, | |
| 8486 | - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca11 = config.secondaryLocations) === null || _config$secondaryLoca11 === void 0 ? void 0 : _config$secondaryLoca11.wpDashElementorCoreMenu), | |
| 8487 | - interaction_description: "core_user_clicked_elementor_menu_item" | |
| 8488 | - })); | |
| 8489 | - } | |
| 8490 | - }, | |
| 8491 | - { | |
| 8492 | - key: "sendWpDashEditorSubMenuHover", | |
| 8493 | - value: function sendWpDashEditorSubMenuHover() { | |
| 8494 | - var _config$names11; | |
| 8495 | - var _config$triggers11; | |
| 8496 | - var _config$targetTypes12; | |
| 8497 | - var _config$interactionRe14; | |
| 8498 | - var _config$secondaryLoca12; | |
| 8499 | - var config = this.getConfig(); | |
| 8500 | - return this.dispatchEvent(config === null || config === void 0 || (_config$names11 = config.names) === null || _config$names11 === void 0 || (_config$names11 = _config$names11.editorOne) === null || _config$names11 === void 0 ? void 0 : _config$names11.wpDashEditorSubMenuHover, this.createWpDashPayload({ | |
| 8501 | - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers11 = config.triggers) === null || _config$triggers11 === void 0 ? void 0 : _config$triggers11.hover), | |
| 8502 | - target_type: config === null || config === void 0 || (_config$targetTypes12 = config.targetTypes) === null || _config$targetTypes12 === void 0 ? void 0 : _config$targetTypes12.wpDashEditorMenu, | |
| 8503 | - target_name: "wpdash_editor_sub_menu", | |
| 8504 | - interaction_result: config === null || config === void 0 || (_config$interactionRe14 = config.interactionResults) === null || _config$interactionRe14 === void 0 ? void 0 : _config$interactionRe14.editorSubMenuOpened, | |
| 8505 | - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca12 = config.secondaryLocations) === null || _config$secondaryLoca12 === void 0 ? void 0 : _config$secondaryLoca12.wpDashElementorCoreSubMenu), | |
| 8506 | - interaction_description: "core_user_hovered_sub_menu" | |
| 8507 | - })); | |
| 8508 | - } | |
| 8509 | - }, | |
| 8510 | - { | |
| 8511 | - key: "sendWpDashThemeBuilderClick", | |
| 8512 | - value: function sendWpDashThemeBuilderClick() { | |
| 8513 | - var _config$names12; | |
| 8514 | - var _config$triggers12; | |
| 8515 | - var _config$targetTypes13; | |
| 8516 | - var _config$interactionRe15; | |
| 8517 | - var _config$secondaryLoca13; | |
| 8518 | - var config = this.getConfig(); | |
| 8519 | - return this.dispatchEvent(config === null || config === void 0 || (_config$names12 = config.names) === null || _config$names12 === void 0 || (_config$names12 = _config$names12.editorOne) === null || _config$names12 === void 0 ? void 0 : _config$names12.wpDashThemeBuilderClick, this.createWpDashPayload({ | |
| 8520 | - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers12 = config.triggers) === null || _config$triggers12 === void 0 ? void 0 : _config$triggers12.click), | |
| 8521 | - target_type: config === null || config === void 0 || (_config$targetTypes13 = config.targetTypes) === null || _config$targetTypes13 === void 0 ? void 0 : _config$targetTypes13.wpDashSubMenuItem, | |
| 8522 | - target_name: "theme_builder_menu_item", | |
| 8523 | - interaction_result: config === null || config === void 0 || (_config$interactionRe15 = config.interactionResults) === null || _config$interactionRe15 === void 0 ? void 0 : _config$interactionRe15.themeBuilderPromotionWindow, | |
| 8524 | - location_l1: this.toLowerSnake(config === null || config === void 0 || (_config$secondaryLoca13 = config.secondaryLocations) === null || _config$secondaryLoca13 === void 0 ? void 0 : _config$secondaryLoca13.wpDashThemeBuilder), | |
| 8525 | - interaction_description: "core_user_clicked_theme_builder_menu_item" | |
| 8526 | - })); | |
| 8527 | - } | |
| 8528 | - }, | |
| 8529 | - { | |
| 8530 | - key: "sendSidebarMenuItemClicked", | |
| 8531 | - value: function sendSidebarMenuItemClicked(_ref8) { | |
| 8532 | - var eventId = _ref8.eventId; | |
| 8533 | - var groupEventId = _ref8.groupEventId; | |
| 8534 | - try { | |
| 8535 | - var _config$windowNames; | |
| 8536 | - var _config$triggers13; | |
| 8537 | - var _config$targetTypes14; | |
| 8538 | - var _config$interactionRe16; | |
| 8539 | - var _config$locations12; | |
| 8540 | - var _config$names13; | |
| 8541 | - var config = this.getConfig(); | |
| 8542 | - var payload = this.createBasePayload({ | |
| 8543 | - window_name: config === null || config === void 0 || (_config$windowNames = config.windowNames) === null || _config$windowNames === void 0 ? void 0 : _config$windowNames.sidebarMenu, | |
| 8544 | - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers13 = config.triggers) === null || _config$triggers13 === void 0 ? void 0 : _config$triggers13.click), | |
| 8545 | - target_type: config === null || config === void 0 || (_config$targetTypes14 = config.targetTypes) === null || _config$targetTypes14 === void 0 ? void 0 : _config$targetTypes14.link, | |
| 8546 | - target_name: eventId, | |
| 8547 | - interaction_result: config === null || config === void 0 || (_config$interactionRe16 = config.interactionResults) === null || _config$interactionRe16 === void 0 ? void 0 : _config$interactionRe16.pageOpened, | |
| 8548 | - target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations12 = config.locations) === null || _config$locations12 === void 0 ? void 0 : _config$locations12.sidebar) | |
| 8549 | - }); | |
| 8550 | - if (groupEventId) payload.location_l1 = groupEventId; | |
| 8551 | - return this.dispatchEvent(config === null || config === void 0 || (_config$names13 = config.names) === null || _config$names13 === void 0 || (_config$names13 = _config$names13.editorOne) === null || _config$names13 === void 0 ? void 0 : _config$names13.sidebarMenuItemClicked, payload); | |
| 8552 | - } catch (error) { | |
| 8553 | - return false; | |
| 8554 | - } | |
| 8555 | - } | |
| 8556 | - }, | |
| 8557 | - { | |
| 8558 | - key: "sendSidebarMenuGroupToggled", | |
| 8559 | - value: function sendSidebarMenuGroupToggled(_ref9) { | |
| 8560 | - var eventId = _ref9.eventId; | |
| 8561 | - var isExpanded = _ref9.isExpanded; | |
| 8562 | - try { | |
| 8563 | - var _config$interactionRe17; | |
| 8564 | - var _config$interactionRe18; | |
| 8565 | - var _config$names14; | |
| 8566 | - var _config$windowNames2; | |
| 8567 | - var _config$triggers14; | |
| 8568 | - var _config$targetTypes15; | |
| 8569 | - var _config$locations13; | |
| 8570 | - var config = this.getConfig(); | |
| 8571 | - var interactionResult = isExpanded ? config === null || config === void 0 || (_config$interactionRe17 = config.interactionResults) === null || _config$interactionRe17 === void 0 ? void 0 : _config$interactionRe17.expanded : config === null || config === void 0 || (_config$interactionRe18 = config.interactionResults) === null || _config$interactionRe18 === void 0 ? void 0 : _config$interactionRe18.collapsed; | |
| 8572 | - return this.dispatchEvent(config === null || config === void 0 || (_config$names14 = config.names) === null || _config$names14 === void 0 || (_config$names14 = _config$names14.editorOne) === null || _config$names14 === void 0 ? void 0 : _config$names14.sidebarMenuGroupToggled, this.createBasePayload({ | |
| 8573 | - window_name: config === null || config === void 0 || (_config$windowNames2 = config.windowNames) === null || _config$windowNames2 === void 0 ? void 0 : _config$windowNames2.sidebarMenu, | |
| 8574 | - interaction_type: this.toLowerSnake(config === null || config === void 0 || (_config$triggers14 = config.triggers) === null || _config$triggers14 === void 0 ? void 0 : _config$triggers14.click), | |
| 8575 | - target_type: config === null || config === void 0 || (_config$targetTypes15 = config.targetTypes) === null || _config$targetTypes15 === void 0 ? void 0 : _config$targetTypes15.toggle, | |
| 8576 | - target_name: eventId, | |
| 8577 | - interaction_result: interactionResult, | |
| 8578 | - target_location: this.toLowerSnake(config === null || config === void 0 || (_config$locations13 = config.locations) === null || _config$locations13 === void 0 ? void 0 : _config$locations13.sidebar) | |
| 8579 | - })); | |
| 8580 | - } catch (error) { | |
| 8581 | - return false; | |
| 8582 | - } | |
| 8583 | - } | |
| 8584 | - } | |
| 8585 | - ]); | |
| 8586 | - }(); | |
| 8587 | - createDebouncedFinderSearch = function createDebouncedFinderSearch() { | |
| 8588 | - var delay = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 300; | |
| 8589 | - return _.debounce(function(resultsCount, searchTerm) { | |
| 8590 | - EditorOneEventManager.sendFinderSearchInput({ | |
| 8591 | - resultsCount, | |
| 8592 | - searchTerm | |
| 8593 | - }); | |
| 8594 | - }, delay); | |
| 8595 | - }; | |
| 8596 | - createDebouncedWidgetPanelSearch = function createDebouncedWidgetPanelSearch() { | |
| 8597 | - var delay = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : 2e3; | |
| 8598 | - return _.debounce(function(resultsCount, userInput) { | |
| 8599 | - EditorOneEventManager.sendWidgetPanelSearch({ | |
| 8600 | - resultsCount, | |
| 8601 | - userInput | |
| 8602 | - }); | |
| 8603 | - }, delay); | |
| 8604 | - }; | |
| 8605 | - })); | |
| 5799 | +if (false) {} else { | |
| 5800 | + module.exports = __webpack_require__(/*! ./cjs/react-is.development.js */ "../node_modules/prop-types/node_modules/react-is/cjs/react-is.development.js"); | |
| 5801 | +} | |
| 8606 | 5802 | |
| 8607 | -//#endregion | |
| 8608 | -//#region modules/ai/assets/js/editor/ai-layout-behavior.js | |
| 8609 | - init_classCallCheck(); | |
| 8610 | - init_createClass(); | |
| 8611 | - init_defineProperty$1(); | |
| 8612 | - init_editor_integration(); | |
| 8613 | - init_config(); | |
| 8614 | - init_editor_one_events(); | |
| 8615 | - function _callSuper$1(t, o, e) { | |
| 8616 | - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$1() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); | |
| 8617 | - } | |
| 8618 | - __name(_callSuper$1, "_callSuper"); | |
| 8619 | - function _isNativeReflectConstruct$1() { | |
| 8620 | - try { | |
| 8621 | - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); | |
| 8622 | - } catch (t) {} | |
| 8623 | - return (_isNativeReflectConstruct$1 = function _isNativeReflectConstruct() { | |
| 8624 | - return !!t; | |
| 8625 | - })(); | |
| 8626 | - } | |
| 8627 | - __name(_isNativeReflectConstruct$1, "_isNativeReflectConstruct"); | |
| 8628 | - var AiLayoutBehavior = /*#__PURE__*/ function(_Marionette$Behavior) { | |
| 8629 | - function AiLayoutBehavior() { | |
| 8630 | - var _this; | |
| 8631 | - _classCallCheck(this, AiLayoutBehavior); | |
| 8632 | - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key]; | |
| 8633 | - _this = _callSuper$1(this, AiLayoutBehavior, [].concat(args)); | |
| 8634 | - _defineProperty$1(_this, "previewContainer", null); | |
| 8635 | - return _this; | |
| 8636 | - } | |
| 8637 | - _inherits(AiLayoutBehavior, _Marionette$Behavior); | |
| 8638 | - return _createClass(AiLayoutBehavior, [ | |
| 8639 | - { | |
| 8640 | - key: "ui", | |
| 8641 | - value: function ui() { | |
| 8642 | - return { | |
| 8643 | - aiButton: ".e-ai-layout-button", | |
| 8644 | - addTemplateButton: ".elementor-add-template-button" | |
| 8645 | - }; | |
| 8646 | - } | |
| 8647 | - }, | |
| 8648 | - { | |
| 8649 | - key: "events", | |
| 8650 | - value: function events() { | |
| 8651 | - return { "click @ui.aiButton": "onAiButtonClick" }; | |
| 8652 | - } | |
| 8653 | - }, | |
| 8654 | - { | |
| 8655 | - key: "onAiButtonClick", | |
| 8656 | - value: function onAiButtonClick(e) { | |
| 8657 | - e.stopPropagation(); | |
| 8658 | - EditorOneEventManager.sendCanvasEmptyBoxAction({ targetName: "generate_with_ai" }); | |
| 8659 | - window.elementorAiCurrentContext = this.getOption("context"); | |
| 8660 | - renderLayoutApp({ | |
| 8661 | - parentContainer: elementor.getPreviewContainer(), | |
| 8662 | - mode: MODE_LAYOUT, | |
| 8663 | - at: this.view.getOption("at"), | |
| 8664 | - onInsert: this.onInsert.bind(this), | |
| 8665 | - onRenderApp: function onRenderApp(args) { | |
| 8666 | - args.previewContainer.init(); | |
| 8667 | - }, | |
| 8668 | - onGenerate: function onGenerate(args) { | |
| 8669 | - args.previewContainer.reset(); | |
| 8670 | - } | |
| 8671 | - }); | |
| 8672 | - } | |
| 8673 | - }, | |
| 8674 | - { | |
| 8675 | - key: "hideDropArea", | |
| 8676 | - value: function hideDropArea() { | |
| 8677 | - this.view.onCloseButtonClick(); | |
| 8678 | - } | |
| 8679 | - }, | |
| 8680 | - { | |
| 8681 | - key: "onInsert", | |
| 8682 | - value: function onInsert(template) { | |
| 8683 | - this.hideDropArea(); | |
| 8684 | - importToEditor({ | |
| 8685 | - parentContainer: elementor.getPreviewContainer(), | |
| 8686 | - at: this.view.getOption("at"), | |
| 8687 | - template, | |
| 8688 | - historyTitle: (0, _wordpress_i18n.__)("AI Layout", "elementor") | |
| 8689 | - }); | |
| 8690 | - } | |
| 8691 | - }, | |
| 8692 | - { | |
| 8693 | - key: "onRender", | |
| 8694 | - value: function onRender() { | |
| 8695 | - var $button = jQuery("<button>", { | |
| 8696 | - type: "button", | |
| 8697 | - class: "e-ai-layout-button elementor-add-section-area-button e-button-primary", | |
| 8698 | - title: (0, _wordpress_i18n.__)("Build with AI", "elementor"), | |
| 8699 | - "aria-label": (0, _wordpress_i18n.__)("Build with AI", "elementor") | |
| 8700 | - }); | |
| 8701 | - $button.html("\n <div class=\"e-ai-layout-button--sparkle\"></div>\n <div class=\"e-ai-layout-button--sparkle\"></div>\n <div class=\"e-ai-layout-button--sparkle\"></div>\n <div class=\"e-ai-layout-button--sparkle\"></div>\n <div class=\"e-ai-layout-button--sparkle\"></div>\n <div class=\"e-ai-layout-button--sparkle\"></div>\n <div class=\"e-ai-layout-button--sparkle\"></div>\n <i class=\"eicon-ai\" aria-hidden=\"true\"></i>\n "); | |
| 8702 | - this.ui.addTemplateButton.after($button); | |
| 8703 | - } | |
| 8704 | - } | |
| 8705 | - ]); | |
| 8706 | - }(Marionette.Behavior); | |
| 8707 | 5803 | |
| 8708 | -//#endregion | |
| 8709 | -//#region modules/ai/assets/js/editor/integration/library/apply-template-for-ai-behavior.js | |
| 8710 | - var require_apply_template_for_ai_behavior = /* @__PURE__ */ __commonJSMin(((exports, module) => { | |
| 8711 | - var _require = (init_editor_integration(), __toCommonJS(editor_integration_exports)); | |
| 8712 | - var renderLayoutApp = _require.renderLayoutApp; | |
| 8713 | - var importToEditor = _require.importToEditor; | |
| 8714 | - var MODE_VARIATION = (init_config(), __toCommonJS(config_exports)).MODE_VARIATION; | |
| 8715 | - var __$1 = (globalThis.wp.i18n).__; | |
| 8716 | - var _require4 = (init_attachments(), __toCommonJS(attachments_exports)); | |
| 8717 | - var ATTACHMENT_TYPE_JSON = _require4.ATTACHMENT_TYPE_JSON; | |
| 8718 | - var ELEMENTOR_LIBRARY_SOURCE = _require4.ELEMENTOR_LIBRARY_SOURCE; | |
| 8719 | - var EditorOneEventManager = (init_editor_one_events(), __toCommonJS(editor_one_events_exports)).EditorOneEventManager; | |
| 8720 | - var ApplyTemplateForAiBehavior = Marionette.Behavior.extend({ | |
| 8721 | - ui: { | |
| 8722 | - applyButton: ".elementor-template-library-template-apply-ai", | |
| 8723 | - generateVariation: ".elementor-template-library-template-generate-variation" | |
| 8724 | - }, | |
| 8725 | - events: { | |
| 8726 | - "click @ui.applyButton": "onApplyButtonClick", | |
| 8727 | - "click @ui.generateVariation": "onGenerateVariationClick" | |
| 8728 | - }, | |
| 8729 | - trackAiGenerate: function trackAiGenerate(model) { | |
| 8730 | - EditorOneEventManager.sendELibraryGenerateAi({ | |
| 8731 | - assetId: model.get("template_id"), | |
| 8732 | - assetName: model.get("title"), | |
| 8733 | - libraryType: model.get("type") || model.get("source") | |
| 8734 | - }); | |
| 8735 | - }, | |
| 8736 | - onGenerateVariationClick: function onGenerateVariationClick() { | |
| 8737 | - var _libraryComponent$man; | |
| 8738 | - var args = { model: this.view.model }; | |
| 8739 | - this.trackAiGenerate(this.view.model); | |
| 8740 | - var libraryComponent = $e.components.get("library"); | |
| 8741 | - var at = (_libraryComponent$man = libraryComponent.manager.modalConfig) === null || _libraryComponent$man === void 0 || (_libraryComponent$man = _libraryComponent$man.importOptions) === null || _libraryComponent$man === void 0 ? void 0 : _libraryComponent$man.at; | |
| 8742 | - libraryComponent.downloadTemplate(args, function(data) { | |
| 8743 | - var model = args.model; | |
| 8744 | - var attachment = { | |
| 8745 | - type: ATTACHMENT_TYPE_JSON, | |
| 8746 | - previewHTML: "<img src=\"".concat(model.get("thumbnail"), "\" />"), | |
| 8747 | - content: data.content[0], | |
| 8748 | - label: "".concat(model.get("template_id"), " - ").concat(model.get("title")), | |
| 8749 | - source: ELEMENTOR_LIBRARY_SOURCE | |
| 8750 | - }; | |
| 8751 | - renderLayoutApp({ | |
| 8752 | - parentContainer: elementor.getPreviewContainer(), | |
| 8753 | - mode: MODE_VARIATION, | |
| 8754 | - at, | |
| 8755 | - attachments: [attachment], | |
| 8756 | - onInsert: function onInsert(template) { | |
| 8757 | - importToEditor({ | |
| 8758 | - parentContainer: elementor.getPreviewContainer(), | |
| 8759 | - at, | |
| 8760 | - template, | |
| 8761 | - historyTitle: __$1("AI Variation from library", "elementor") | |
| 8762 | - }); | |
| 8763 | - } | |
| 8764 | - }); | |
| 8765 | - $e.run("library/close"); | |
| 8766 | - }); | |
| 8767 | - }, | |
| 8768 | - onApplyButtonClick: function onApplyButtonClick() { | |
| 8769 | - var args = { model: this.view.model }; | |
| 8770 | - this.trackAiGenerate(this.view.model); | |
| 8771 | - this.ui.applyButton.addClass("elementor-disabled"); | |
| 8772 | - var activeSource = args.model.get("source"); | |
| 8773 | - if (elementor.hooks.applyFilters("templates/source/is-remote", "remote" === activeSource, activeSource) && !elementor.config.library_connect.is_connected) { | |
| 8774 | - $e.route("library/connect", args); | |
| 8775 | - return; | |
| 8776 | - } | |
| 8777 | - $e.run("library/generate-ai-variation", args); | |
| 8778 | - } | |
| 8779 | - }); | |
| 8780 | - module.exports = ApplyTemplateForAiBehavior; | |
| 8781 | - })); | |
| 5804 | +/***/ }), | |
| 8782 | 5805 | |
| 8783 | -//#endregion | |
| 8784 | -//#region modules/ai/assets/js/editor/layout-module.js | |
| 8785 | - init_asyncToGenerator$1(); | |
| 8786 | - init_classCallCheck(); | |
| 8787 | - init_createClass(); | |
| 8788 | - init_defineProperty$1(); | |
| 8789 | - var import_regenerator = /* @__PURE__ */ __toESM(require_regenerator()); | |
| 8790 | - init_editor_integration(); | |
| 8791 | - init_config(); | |
| 8792 | - var import_apply_template_for_ai_behavior = /* @__PURE__ */ __toESM(require_apply_template_for_ai_behavior()); | |
| 8793 | - init_attachments(); | |
| 8794 | - function _callSuper(t, o, e) { | |
| 8795 | - return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); | |
| 8796 | - } | |
| 8797 | - function _isNativeReflectConstruct() { | |
| 8798 | - try { | |
| 8799 | - var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function() {})); | |
| 8800 | - } catch (t) {} | |
| 8801 | - return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { | |
| 8802 | - return !!t; | |
| 8803 | - })(); | |
| 8804 | - } | |
| 8805 | - var AI_ATTACHMENT = "ai-attachment"; | |
| 8806 | - var Module = /*#__PURE__*/ function(_elementorModules$edi) { | |
| 8807 | - function Module() { | |
| 8808 | - var _this; | |
| 8809 | - _classCallCheck(this, Module); | |
| 8810 | - for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) args[_key] = arguments[_key]; | |
| 8811 | - _this = _callSuper(this, Module, [].concat(args)); | |
| 8812 | - _defineProperty$1(_this, "registerVariationsContextMenu", function(groups, currentElement) { | |
| 8813 | - var saveGroup = groups.find(function(group) { | |
| 8814 | - return "save" === group.name; | |
| 8815 | - }); | |
| 8816 | - if (!saveGroup) return groups; | |
| 8817 | - var contextMenu = { | |
| 8818 | - name: "ai", | |
| 8819 | - icon: "eicon-ai", | |
| 8820 | - isEnabled: function isEnabled() { | |
| 8821 | - return 0 !== currentElement.getContainer().children.length; | |
| 8822 | - }, | |
| 8823 | - title: (0, _wordpress_i18n.__)("Generate variations with AI", "elementor"), | |
| 8824 | - callback: function() { | |
| 8825 | - var _callback = _asyncToGenerator$1(/*#__PURE__*/ import_regenerator.default.mark(function _callee() { | |
| 8826 | - var container; | |
| 8827 | - var json; | |
| 8828 | - var attachments; | |
| 8829 | - return import_regenerator.default.wrap(function(_context) { | |
| 8830 | - while (1) switch (_context.prev = _context.next) { | |
| 8831 | - case 0: | |
| 8832 | - container = currentElement.getContainer(); | |
| 8833 | - json = container.model.toJSON({ remove: ["default"] }); | |
| 8834 | - attachments = [{ | |
| 8835 | - type: "json", | |
| 8836 | - previewHTML: "", | |
| 8837 | - content: json, | |
| 8838 | - label: container.model.get("title"), | |
| 8839 | - source: USER_VARIATION_SOURCE | |
| 8840 | - }]; | |
| 8841 | - renderLayoutApp({ | |
| 8842 | - parentContainer: container.parent, | |
| 8843 | - mode: MODE_VARIATION, | |
| 8844 | - at: container.view._index, | |
| 8845 | - attachments, | |
| 8846 | - onSelect: function onSelect() { | |
| 8847 | - container.view.$el.hide(); | |
| 8848 | - }, | |
| 8849 | - onClose: function onClose() { | |
| 8850 | - container.view.$el.show(); | |
| 8851 | - }, | |
| 8852 | - onInsert: function onInsert(template) { | |
| 8853 | - importToEditor({ | |
| 8854 | - parentContainer: container.parent, | |
| 8855 | - at: container.view._index, | |
| 8856 | - template, | |
| 8857 | - historyTitle: (0, _wordpress_i18n.__)("AI Variation", "elementor"), | |
| 8858 | - replace: true | |
| 8859 | - }); | |
| 8860 | - } | |
| 8861 | - }); | |
| 8862 | - case 1: | |
| 8863 | - case "end": return _context.stop(); | |
| 8864 | - } | |
| 8865 | - }, _callee); | |
| 8866 | - })); | |
| 8867 | - function callback() { | |
| 8868 | - return _callback.apply(this, arguments); | |
| 8869 | - } | |
| 8870 | - return callback; | |
| 8871 | - }() | |
| 8872 | - }; | |
| 8873 | - saveGroup.actions.unshift(contextMenu); | |
| 8874 | - return groups; | |
| 8875 | - }); | |
| 8876 | - return _this; | |
| 8877 | - } | |
| 8878 | - _inherits(Module, _elementorModules$edi); | |
| 8879 | - return _createClass(Module, [ | |
| 8880 | - { | |
| 8881 | - key: "onElementorInit", | |
| 8882 | - value: function onElementorInit() { | |
| 8883 | - var _this2 = this; | |
| 8884 | - elementor.hooks.addFilter("views/add-section/behaviors", this.registerAiLayoutBehavior); | |
| 8885 | - elementor.hooks.addFilter("elements/container/contextMenuGroups", this.registerVariationsContextMenu); | |
| 8886 | - elementor.hooks.addFilter("elementor/editor/template-library/template/behaviors", this.registerLibraryActionButtonBehavior); | |
| 8887 | - elementor.hooks.addFilter("elementor/editor/template-library/template/action-button", this.filterLibraryActionButtonTemplate, 11); | |
| 8888 | - $e.commands.register("library", "generate-ai-variation", function(args) { | |
| 8889 | - return _this2.applyTemplate(args); | |
| 8890 | - }); | |
| 8891 | - } | |
| 8892 | - }, | |
| 8893 | - { | |
| 8894 | - key: "applyTemplate", | |
| 8895 | - value: function applyTemplate(args) { | |
| 8896 | - window.postMessage({ type: "library/attach:start" }); | |
| 8897 | - $e.components.get("library").downloadTemplate(args, function(data) { | |
| 8898 | - var model = args.model; | |
| 8899 | - window.postMessage({ | |
| 8900 | - type: "library/attach", | |
| 8901 | - json: data.content[0], | |
| 8902 | - html: "<img src=\"".concat(model.get("thumbnail"), "\" />"), | |
| 8903 | - label: "".concat(model.get("template_id"), " - ").concat(model.get("title")), | |
| 8904 | - source: ELEMENTOR_LIBRARY_SOURCE | |
| 8905 | - }, window.location.origin); | |
| 8906 | - }); | |
| 8907 | - } | |
| 8908 | - }, | |
| 8909 | - { | |
| 8910 | - key: "registerLibraryActionButtonBehavior", | |
| 8911 | - value: function registerLibraryActionButtonBehavior(behaviors) { | |
| 8912 | - behaviors.applyAiTemplate = { behaviorClass: import_apply_template_for_ai_behavior.default }; | |
| 8913 | - return behaviors; | |
| 8914 | - } | |
| 8915 | - }, | |
| 8916 | - { | |
| 8917 | - key: "registerAiLayoutBehavior", | |
| 8918 | - value: function registerAiLayoutBehavior(behaviors) { | |
| 8919 | - behaviors.ai = { | |
| 8920 | - behaviorClass: AiLayoutBehavior, | |
| 8921 | - context: { documentType: window.elementor.documents.getCurrent().config.type } | |
| 8922 | - }; | |
| 8923 | - return behaviors; | |
| 8924 | - } | |
| 8925 | - }, | |
| 8926 | - { | |
| 8927 | - key: "filterLibraryActionButtonTemplate", | |
| 8928 | - value: function filterLibraryActionButtonTemplate(viewId) { | |
| 8929 | - var modalConfig = $e.components.get("library").manager.modalConfig; | |
| 8930 | - if ("#tmpl-elementor-template-library-insert-button" !== viewId) return viewId; | |
| 8931 | - if ($e.routes.current.library !== "library/templates/blocks") return viewId; | |
| 8932 | - if ("ai-attachment" === modalConfig.mode) viewId = "#tmpl-elementor-template-library-apply-ai-button"; | |
| 8933 | - else viewId = "#tmpl-elementor-template-library-insert-and-ai-variations-buttons"; | |
| 8934 | - return viewId; | |
| 8935 | - } | |
| 8936 | - } | |
| 8937 | - ]); | |
| 8938 | - }(elementorModules.editor.utils.Module); | |
| 8939 | - new Module(); | |
| 5806 | +/***/ "../node_modules/react-draggable/build/cjs/Draggable.js": | |
| 5807 | +/*!**************************************************************!*\ | |
| 5808 | + !*** ../node_modules/react-draggable/build/cjs/Draggable.js ***! | |
| 5809 | + \**************************************************************/ | |
| 5810 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 8940 | 5811 | |
| 8941 | -//#endregion | |
| 8942 | -})(wp.i18n, React, ReactDOM, elementorV2.ui, elementorV2.icons); | |
| 5812 | +"use strict"; | |
| 5813 | + | |
| 5814 | + | |
| 5815 | +function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } | |
| 5816 | + | |
| 5817 | +Object.defineProperty(exports, "__esModule", ({ | |
| 5818 | + value: true | |
| 5819 | +})); | |
| 5820 | +Object.defineProperty(exports, "DraggableCore", ({ | |
| 5821 | + enumerable: true, | |
| 5822 | + get: function get() { | |
| 5823 | + return _DraggableCore.default; | |
| 5824 | + } | |
| 5825 | +})); | |
| 5826 | +exports["default"] = void 0; | |
| 5827 | + | |
| 5828 | +var React = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); | |
| 5829 | + | |
| 5830 | +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js")); | |
| 5831 | + | |
| 5832 | +var _reactDom = _interopRequireDefault(__webpack_require__(/*! react-dom */ "react-dom")); | |
| 5833 | + | |
| 5834 | +var _clsx2 = _interopRequireDefault(__webpack_require__(/*! clsx */ "../node_modules/clsx/dist/clsx.m.js")); | |
| 5835 | + | |
| 5836 | +var _domFns = __webpack_require__(/*! ./utils/domFns */ "../node_modules/react-draggable/build/cjs/utils/domFns.js"); | |
| 5837 | + | |
| 5838 | +var _positionFns = __webpack_require__(/*! ./utils/positionFns */ "../node_modules/react-draggable/build/cjs/utils/positionFns.js"); | |
| 5839 | + | |
| 5840 | +var _shims = __webpack_require__(/*! ./utils/shims */ "../node_modules/react-draggable/build/cjs/utils/shims.js"); | |
| 5841 | + | |
| 5842 | +var _DraggableCore = _interopRequireDefault(__webpack_require__(/*! ./DraggableCore */ "../node_modules/react-draggable/build/cjs/DraggableCore.js")); | |
| 5843 | + | |
| 5844 | +var _log = _interopRequireDefault(__webpack_require__(/*! ./utils/log */ "../node_modules/react-draggable/build/cjs/utils/log.js")); | |
| 5845 | + | |
| 5846 | +var _excluded = ["axis", "bounds", "children", "defaultPosition", "defaultClassName", "defaultClassNameDragging", "defaultClassNameDragged", "position", "positionOffset", "scale"]; | |
| 5847 | + | |
| 5848 | +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
| 5849 | + | |
| 5850 | +function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | |
| 5851 | + | |
| 5852 | +function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | |
| 5853 | + | |
| 5854 | +function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); } | |
| 5855 | + | |
| 5856 | +function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; } | |
| 5857 | + | |
| 5858 | +function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } | |
| 5859 | + | |
| 5860 | +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | |
| 5861 | + | |
| 5862 | +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | |
| 5863 | + | |
| 5864 | +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } | |
| 5865 | + | |
| 5866 | +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } | |
| 5867 | + | |
| 5868 | +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } | |
| 5869 | + | |
| 5870 | +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } | |
| 5871 | + | |
| 5872 | +function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } | |
| 5873 | + | |
| 5874 | +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } | |
| 5875 | + | |
| 5876 | +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | |
| 5877 | + | |
| 5878 | +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } | |
| 5879 | + | |
| 5880 | +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } | |
| 5881 | + | |
| 5882 | +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); } | |
| 5883 | + | |
| 5884 | +function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } | |
| 5885 | + | |
| 5886 | +function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } | |
| 5887 | + | |
| 5888 | +function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); } | |
| 5889 | + | |
| 5890 | +function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } | |
| 5891 | + | |
| 5892 | +function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } | |
| 5893 | + | |
| 5894 | +function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } | |
| 5895 | + | |
| 5896 | +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | |
| 5897 | + | |
| 5898 | +// | |
| 5899 | +// Define <Draggable> | |
| 5900 | +// | |
| 5901 | +var Draggable = /*#__PURE__*/function (_React$Component) { | |
| 5902 | + _inherits(Draggable, _React$Component); | |
| 5903 | + | |
| 5904 | + var _super = _createSuper(Draggable); | |
| 5905 | + | |
| 5906 | + function Draggable(props | |
| 5907 | + /*: DraggableProps*/ | |
| 5908 | + ) { | |
| 5909 | + var _this; | |
| 5910 | + | |
| 5911 | + _classCallCheck(this, Draggable); | |
| 5912 | + | |
| 5913 | + _this = _super.call(this, props); | |
| 5914 | + | |
| 5915 | + _defineProperty(_assertThisInitialized(_this), "onDragStart", function (e, coreData) { | |
| 5916 | + (0, _log.default)('Draggable: onDragStart: %j', coreData); // Short-circuit if user's callback killed it. | |
| 5917 | + | |
| 5918 | + var shouldStart = _this.props.onStart(e, (0, _positionFns.createDraggableData)(_assertThisInitialized(_this), coreData)); // Kills start event on core as well, so move handlers are never bound. | |
| 5919 | + | |
| 5920 | + | |
| 5921 | + if (shouldStart === false) return false; | |
| 5922 | + | |
| 5923 | + _this.setState({ | |
| 5924 | + dragging: true, | |
| 5925 | + dragged: true | |
| 5926 | + }); | |
| 5927 | + }); | |
| 5928 | + | |
| 5929 | + _defineProperty(_assertThisInitialized(_this), "onDrag", function (e, coreData) { | |
| 5930 | + if (!_this.state.dragging) return false; | |
| 5931 | + (0, _log.default)('Draggable: onDrag: %j', coreData); | |
| 5932 | + var uiData = (0, _positionFns.createDraggableData)(_assertThisInitialized(_this), coreData); | |
| 5933 | + var newState | |
| 5934 | + /*: $Shape<DraggableState>*/ | |
| 5935 | + = { | |
| 5936 | + x: uiData.x, | |
| 5937 | + y: uiData.y | |
| 5938 | + }; // Keep within bounds. | |
| 5939 | + | |
| 5940 | + if (_this.props.bounds) { | |
| 5941 | + // Save original x and y. | |
| 5942 | + var x = newState.x, | |
| 5943 | + y = newState.y; // Add slack to the values used to calculate bound position. This will ensure that if | |
| 5944 | + // we start removing slack, the element won't react to it right away until it's been | |
| 5945 | + // completely removed. | |
| 5946 | + | |
| 5947 | + newState.x += _this.state.slackX; | |
| 5948 | + newState.y += _this.state.slackY; // Get bound position. This will ceil/floor the x and y within the boundaries. | |
| 5949 | + | |
| 5950 | + var _getBoundPosition = (0, _positionFns.getBoundPosition)(_assertThisInitialized(_this), newState.x, newState.y), | |
| 5951 | + _getBoundPosition2 = _slicedToArray(_getBoundPosition, 2), | |
| 5952 | + newStateX = _getBoundPosition2[0], | |
| 5953 | + newStateY = _getBoundPosition2[1]; | |
| 5954 | + | |
| 5955 | + newState.x = newStateX; | |
| 5956 | + newState.y = newStateY; // Recalculate slack by noting how much was shaved by the boundPosition handler. | |
| 5957 | + | |
| 5958 | + newState.slackX = _this.state.slackX + (x - newState.x); | |
| 5959 | + newState.slackY = _this.state.slackY + (y - newState.y); // Update the event we fire to reflect what really happened after bounds took effect. | |
| 5960 | + | |
| 5961 | + uiData.x = newState.x; | |
| 5962 | + uiData.y = newState.y; | |
| 5963 | + uiData.deltaX = newState.x - _this.state.x; | |
| 5964 | + uiData.deltaY = newState.y - _this.state.y; | |
| 5965 | + } // Short-circuit if user's callback killed it. | |
| 5966 | + | |
| 5967 | + | |
| 5968 | + var shouldUpdate = _this.props.onDrag(e, uiData); | |
| 5969 | + | |
| 5970 | + if (shouldUpdate === false) return false; | |
| 5971 | + | |
| 5972 | + _this.setState(newState); | |
| 5973 | + }); | |
| 5974 | + | |
| 5975 | + _defineProperty(_assertThisInitialized(_this), "onDragStop", function (e, coreData) { | |
| 5976 | + if (!_this.state.dragging) return false; // Short-circuit if user's callback killed it. | |
| 5977 | + | |
| 5978 | + var shouldContinue = _this.props.onStop(e, (0, _positionFns.createDraggableData)(_assertThisInitialized(_this), coreData)); | |
| 5979 | + | |
| 5980 | + if (shouldContinue === false) return false; | |
| 5981 | + (0, _log.default)('Draggable: onDragStop: %j', coreData); | |
| 5982 | + var newState | |
| 5983 | + /*: $Shape<DraggableState>*/ | |
| 5984 | + = { | |
| 5985 | + dragging: false, | |
| 5986 | + slackX: 0, | |
| 5987 | + slackY: 0 | |
| 5988 | + }; // If this is a controlled component, the result of this operation will be to | |
| 5989 | + // revert back to the old position. We expect a handler on `onDragStop`, at the least. | |
| 5990 | + | |
| 5991 | + var controlled = Boolean(_this.props.position); | |
| 5992 | + | |
| 5993 | + if (controlled) { | |
| 5994 | + var _this$props$position = _this.props.position, | |
| 5995 | + x = _this$props$position.x, | |
| 5996 | + y = _this$props$position.y; | |
| 5997 | + newState.x = x; | |
| 5998 | + newState.y = y; | |
| 5999 | + } | |
| 6000 | + | |
| 6001 | + _this.setState(newState); | |
| 6002 | + }); | |
| 6003 | + | |
| 6004 | + _this.state = { | |
| 6005 | + // Whether or not we are currently dragging. | |
| 6006 | + dragging: false, | |
| 6007 | + // Whether or not we have been dragged before. | |
| 6008 | + dragged: false, | |
| 6009 | + // Current transform x and y. | |
| 6010 | + x: props.position ? props.position.x : props.defaultPosition.x, | |
| 6011 | + y: props.position ? props.position.y : props.defaultPosition.y, | |
| 6012 | + prevPropsPosition: _objectSpread({}, props.position), | |
| 6013 | + // Used for compensating for out-of-bounds drags | |
| 6014 | + slackX: 0, | |
| 6015 | + slackY: 0, | |
| 6016 | + // Can only determine if SVG after mounting | |
| 6017 | + isElementSVG: false | |
| 6018 | + }; | |
| 6019 | + | |
| 6020 | + if (props.position && !(props.onDrag || props.onStop)) { | |
| 6021 | + // eslint-disable-next-line no-console | |
| 6022 | + console.warn('A `position` was applied to this <Draggable>, without drag handlers. This will make this ' + 'component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the ' + '`position` of this element.'); | |
| 6023 | + } | |
| 6024 | + | |
| 6025 | + return _this; | |
| 6026 | + } | |
| 6027 | + | |
| 6028 | + _createClass(Draggable, [{ | |
| 6029 | + key: "componentDidMount", | |
| 6030 | + value: function componentDidMount() { | |
| 6031 | + // Check to see if the element passed is an instanceof SVGElement | |
| 6032 | + if (typeof window.SVGElement !== 'undefined' && this.findDOMNode() instanceof window.SVGElement) { | |
| 6033 | + this.setState({ | |
| 6034 | + isElementSVG: true | |
| 6035 | + }); | |
| 6036 | + } | |
| 6037 | + } | |
| 6038 | + }, { | |
| 6039 | + key: "componentWillUnmount", | |
| 6040 | + value: function componentWillUnmount() { | |
| 6041 | + this.setState({ | |
| 6042 | + dragging: false | |
| 6043 | + }); // prevents invariant if unmounted while dragging | |
| 6044 | + } // React Strict Mode compatibility: if `nodeRef` is passed, we will use it instead of trying to find | |
| 6045 | + // the underlying DOM node ourselves. See the README for more information. | |
| 6046 | + | |
| 6047 | + }, { | |
| 6048 | + key: "findDOMNode", | |
| 6049 | + value: function findDOMNode() | |
| 6050 | + /*: ?HTMLElement*/ | |
| 6051 | + { | |
| 6052 | + var _this$props$nodeRef$c, _this$props, _this$props$nodeRef; | |
| 6053 | + | |
| 6054 | + return (_this$props$nodeRef$c = (_this$props = this.props) === null || _this$props === void 0 ? void 0 : (_this$props$nodeRef = _this$props.nodeRef) === null || _this$props$nodeRef === void 0 ? void 0 : _this$props$nodeRef.current) !== null && _this$props$nodeRef$c !== void 0 ? _this$props$nodeRef$c : _reactDom.default.findDOMNode(this); | |
| 6055 | + } | |
| 6056 | + }, { | |
| 6057 | + key: "render", | |
| 6058 | + value: function render() | |
| 6059 | + /*: ReactElement<any>*/ | |
| 6060 | + { | |
| 6061 | + var _clsx; | |
| 6062 | + | |
| 6063 | + var _this$props2 = this.props, | |
| 6064 | + axis = _this$props2.axis, | |
| 6065 | + bounds = _this$props2.bounds, | |
| 6066 | + children = _this$props2.children, | |
| 6067 | + defaultPosition = _this$props2.defaultPosition, | |
| 6068 | + defaultClassName = _this$props2.defaultClassName, | |
| 6069 | + defaultClassNameDragging = _this$props2.defaultClassNameDragging, | |
| 6070 | + defaultClassNameDragged = _this$props2.defaultClassNameDragged, | |
| 6071 | + position = _this$props2.position, | |
| 6072 | + positionOffset = _this$props2.positionOffset, | |
| 6073 | + scale = _this$props2.scale, | |
| 6074 | + draggableCoreProps = _objectWithoutProperties(_this$props2, _excluded); | |
| 6075 | + | |
| 6076 | + var style = {}; | |
| 6077 | + var svgTransform = null; // If this is controlled, we don't want to move it - unless it's dragging. | |
| 6078 | + | |
| 6079 | + var controlled = Boolean(position); | |
| 6080 | + var draggable = !controlled || this.state.dragging; | |
| 6081 | + var validPosition = position || defaultPosition; | |
| 6082 | + var transformOpts = { | |
| 6083 | + // Set left if horizontal drag is enabled | |
| 6084 | + x: (0, _positionFns.canDragX)(this) && draggable ? this.state.x : validPosition.x, | |
| 6085 | + // Set top if vertical drag is enabled | |
| 6086 | + y: (0, _positionFns.canDragY)(this) && draggable ? this.state.y : validPosition.y | |
| 6087 | + }; // If this element was SVG, we use the `transform` attribute. | |
| 6088 | + | |
| 6089 | + if (this.state.isElementSVG) { | |
| 6090 | + svgTransform = (0, _domFns.createSVGTransform)(transformOpts, positionOffset); | |
| 6091 | + } else { | |
| 6092 | + // Add a CSS transform to move the element around. This allows us to move the element around | |
| 6093 | + // without worrying about whether or not it is relatively or absolutely positioned. | |
| 6094 | + // If the item you are dragging already has a transform set, wrap it in a <span> so <Draggable> | |
| 6095 | + // has a clean slate. | |
| 6096 | + style = (0, _domFns.createCSSTransform)(transformOpts, positionOffset); | |
| 6097 | + } // Mark with class while dragging | |
| 6098 | + | |
| 6099 | + | |
| 6100 | + var className = (0, _clsx2.default)(children.props.className || '', defaultClassName, (_clsx = {}, _defineProperty(_clsx, defaultClassNameDragging, this.state.dragging), _defineProperty(_clsx, defaultClassNameDragged, this.state.dragged), _clsx)); // Reuse the child provided | |
| 6101 | + // This makes it flexible to use whatever element is wanted (div, ul, etc) | |
| 6102 | + | |
| 6103 | + return /*#__PURE__*/React.createElement(_DraggableCore.default, _extends({}, draggableCoreProps, { | |
| 6104 | + onStart: this.onDragStart, | |
| 6105 | + onDrag: this.onDrag, | |
| 6106 | + onStop: this.onDragStop | |
| 6107 | + }), /*#__PURE__*/React.cloneElement(React.Children.only(children), { | |
| 6108 | + className: className, | |
| 6109 | + style: _objectSpread(_objectSpread({}, children.props.style), style), | |
| 6110 | + transform: svgTransform | |
| 6111 | + })); | |
| 6112 | + } | |
| 6113 | + }], [{ | |
| 6114 | + key: "getDerivedStateFromProps", | |
| 6115 | + value: // React 16.3+ | |
| 6116 | + // Arity (props, state) | |
| 6117 | + function getDerivedStateFromProps(_ref, _ref2) | |
| 6118 | + /*: ?$Shape<DraggableState>*/ | |
| 6119 | + { | |
| 6120 | + var position = _ref.position; | |
| 6121 | + var prevPropsPosition = _ref2.prevPropsPosition; | |
| 6122 | + | |
| 6123 | + // Set x/y if a new position is provided in props that is different than the previous. | |
| 6124 | + if (position && (!prevPropsPosition || position.x !== prevPropsPosition.x || position.y !== prevPropsPosition.y)) { | |
| 6125 | + (0, _log.default)('Draggable: getDerivedStateFromProps %j', { | |
| 6126 | + position: position, | |
| 6127 | + prevPropsPosition: prevPropsPosition | |
| 6128 | + }); | |
| 6129 | + return { | |
| 6130 | + x: position.x, | |
| 6131 | + y: position.y, | |
| 6132 | + prevPropsPosition: _objectSpread({}, position) | |
| 6133 | + }; | |
| 6134 | + } | |
| 6135 | + | |
| 6136 | + return null; | |
| 6137 | + } | |
| 6138 | + }]); | |
| 6139 | + | |
| 6140 | + return Draggable; | |
| 6141 | +}(React.Component); | |
| 6142 | + | |
| 6143 | +exports["default"] = Draggable; | |
| 6144 | + | |
| 6145 | +_defineProperty(Draggable, "displayName", 'Draggable'); | |
| 6146 | + | |
| 6147 | +_defineProperty(Draggable, "propTypes", _objectSpread(_objectSpread({}, _DraggableCore.default.propTypes), {}, { | |
| 6148 | + /** | |
| 6149 | + * `axis` determines which axis the draggable can move. | |
| 6150 | + * | |
| 6151 | + * Note that all callbacks will still return data as normal. This only | |
| 6152 | + * controls flushing to the DOM. | |
| 6153 | + * | |
| 6154 | + * 'both' allows movement horizontally and vertically. | |
| 6155 | + * 'x' limits movement to horizontal axis. | |
| 6156 | + * 'y' limits movement to vertical axis. | |
| 6157 | + * 'none' limits all movement. | |
| 6158 | + * | |
| 6159 | + * Defaults to 'both'. | |
| 6160 | + */ | |
| 6161 | + axis: _propTypes.default.oneOf(['both', 'x', 'y', 'none']), | |
| 6162 | + | |
| 6163 | + /** | |
| 6164 | + * `bounds` determines the range of movement available to the element. | |
| 6165 | + * Available values are: | |
| 6166 | + * | |
| 6167 | + * 'parent' restricts movement within the Draggable's parent node. | |
| 6168 | + * | |
| 6169 | + * Alternatively, pass an object with the following properties, all of which are optional: | |
| 6170 | + * | |
| 6171 | + * {left: LEFT_BOUND, right: RIGHT_BOUND, bottom: BOTTOM_BOUND, top: TOP_BOUND} | |
| 6172 | + * | |
| 6173 | + * All values are in px. | |
| 6174 | + * | |
| 6175 | + * Example: | |
| 6176 | + * | |
| 6177 | + * ```jsx | |
| 6178 | + * let App = React.createClass({ | |
| 6179 | + * render: function () { | |
| 6180 | + * return ( | |
| 6181 | + * <Draggable bounds={{right: 300, bottom: 300}}> | |
| 6182 | + * <div>Content</div> | |
| 6183 | + * </Draggable> | |
| 6184 | + * ); | |
| 6185 | + * } | |
| 6186 | + * }); | |
| 6187 | + * ``` | |
| 6188 | + */ | |
| 6189 | + bounds: _propTypes.default.oneOfType([_propTypes.default.shape({ | |
| 6190 | + left: _propTypes.default.number, | |
| 6191 | + right: _propTypes.default.number, | |
| 6192 | + top: _propTypes.default.number, | |
| 6193 | + bottom: _propTypes.default.number | |
| 6194 | + }), _propTypes.default.string, _propTypes.default.oneOf([false])]), | |
| 6195 | + defaultClassName: _propTypes.default.string, | |
| 6196 | + defaultClassNameDragging: _propTypes.default.string, | |
| 6197 | + defaultClassNameDragged: _propTypes.default.string, | |
| 6198 | + | |
| 6199 | + /** | |
| 6200 | + * `defaultPosition` specifies the x and y that the dragged item should start at | |
| 6201 | + * | |
| 6202 | + * Example: | |
| 6203 | + * | |
| 6204 | + * ```jsx | |
| 6205 | + * let App = React.createClass({ | |
| 6206 | + * render: function () { | |
| 6207 | + * return ( | |
| 6208 | + * <Draggable defaultPosition={{x: 25, y: 25}}> | |
| 6209 | + * <div>I start with transformX: 25px and transformY: 25px;</div> | |
| 6210 | + * </Draggable> | |
| 6211 | + * ); | |
| 6212 | + * } | |
| 6213 | + * }); | |
| 6214 | + * ``` | |
| 6215 | + */ | |
| 6216 | + defaultPosition: _propTypes.default.shape({ | |
| 6217 | + x: _propTypes.default.number, | |
| 6218 | + y: _propTypes.default.number | |
| 6219 | + }), | |
| 6220 | + positionOffset: _propTypes.default.shape({ | |
| 6221 | + x: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]), | |
| 6222 | + y: _propTypes.default.oneOfType([_propTypes.default.number, _propTypes.default.string]) | |
| 6223 | + }), | |
| 6224 | + | |
| 6225 | + /** | |
| 6226 | + * `position`, if present, defines the current position of the element. | |
| 6227 | + * | |
| 6228 | + * This is similar to how form elements in React work - if no `position` is supplied, the component | |
| 6229 | + * is uncontrolled. | |
| 6230 | + * | |
| 6231 | + * Example: | |
| 6232 | + * | |
| 6233 | + * ```jsx | |
| 6234 | + * let App = React.createClass({ | |
| 6235 | + * render: function () { | |
| 6236 | + * return ( | |
| 6237 | + * <Draggable position={{x: 25, y: 25}}> | |
| 6238 | + * <div>I start with transformX: 25px and transformY: 25px;</div> | |
| 6239 | + * </Draggable> | |
| 6240 | + * ); | |
| 6241 | + * } | |
| 6242 | + * }); | |
| 6243 | + * ``` | |
| 6244 | + */ | |
| 6245 | + position: _propTypes.default.shape({ | |
| 6246 | + x: _propTypes.default.number, | |
| 6247 | + y: _propTypes.default.number | |
| 6248 | + }), | |
| 6249 | + | |
| 6250 | + /** | |
| 6251 | + * These properties should be defined on the child, not here. | |
| 6252 | + */ | |
| 6253 | + className: _shims.dontSetMe, | |
| 6254 | + style: _shims.dontSetMe, | |
| 6255 | + transform: _shims.dontSetMe | |
| 6256 | +})); | |
| 6257 | + | |
| 6258 | +_defineProperty(Draggable, "defaultProps", _objectSpread(_objectSpread({}, _DraggableCore.default.defaultProps), {}, { | |
| 6259 | + axis: 'both', | |
| 6260 | + bounds: false, | |
| 6261 | + defaultClassName: 'react-draggable', | |
| 6262 | + defaultClassNameDragging: 'react-draggable-dragging', | |
| 6263 | + defaultClassNameDragged: 'react-draggable-dragged', | |
| 6264 | + defaultPosition: { | |
| 6265 | + x: 0, | |
| 6266 | + y: 0 | |
| 6267 | + }, | |
| 6268 | + scale: 1 | |
| 6269 | +})); | |
| 6270 | + | |
| 6271 | +/***/ }), | |
| 6272 | + | |
| 6273 | +/***/ "../node_modules/react-draggable/build/cjs/DraggableCore.js": | |
| 6274 | +/*!******************************************************************!*\ | |
| 6275 | + !*** ../node_modules/react-draggable/build/cjs/DraggableCore.js ***! | |
| 6276 | + \******************************************************************/ | |
| 6277 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 6278 | + | |
| 6279 | +"use strict"; | |
| 6280 | + | |
| 6281 | + | |
| 6282 | +function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } | |
| 6283 | + | |
| 6284 | +Object.defineProperty(exports, "__esModule", ({ | |
| 6285 | + value: true | |
| 6286 | +})); | |
| 6287 | +exports["default"] = void 0; | |
| 6288 | + | |
| 6289 | +var React = _interopRequireWildcard(__webpack_require__(/*! react */ "react")); | |
| 6290 | + | |
| 6291 | +var _propTypes = _interopRequireDefault(__webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js")); | |
| 6292 | + | |
| 6293 | +var _reactDom = _interopRequireDefault(__webpack_require__(/*! react-dom */ "react-dom")); | |
| 6294 | + | |
| 6295 | +var _domFns = __webpack_require__(/*! ./utils/domFns */ "../node_modules/react-draggable/build/cjs/utils/domFns.js"); | |
| 6296 | + | |
| 6297 | +var _positionFns = __webpack_require__(/*! ./utils/positionFns */ "../node_modules/react-draggable/build/cjs/utils/positionFns.js"); | |
| 6298 | + | |
| 6299 | +var _shims = __webpack_require__(/*! ./utils/shims */ "../node_modules/react-draggable/build/cjs/utils/shims.js"); | |
| 6300 | + | |
| 6301 | +var _log = _interopRequireDefault(__webpack_require__(/*! ./utils/log */ "../node_modules/react-draggable/build/cjs/utils/log.js")); | |
| 6302 | + | |
| 6303 | +function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | |
| 6304 | + | |
| 6305 | +function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | |
| 6306 | + | |
| 6307 | +function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | |
| 6308 | + | |
| 6309 | +function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } | |
| 6310 | + | |
| 6311 | +function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } | |
| 6312 | + | |
| 6313 | +function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } | |
| 6314 | + | |
| 6315 | +function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; } | |
| 6316 | + | |
| 6317 | +function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } | |
| 6318 | + | |
| 6319 | +function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; } | |
| 6320 | + | |
| 6321 | +function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } | |
| 6322 | + | |
| 6323 | +function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } | |
| 6324 | + | |
| 6325 | +function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } | |
| 6326 | + | |
| 6327 | +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); } | |
| 6328 | + | |
| 6329 | +function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } | |
| 6330 | + | |
| 6331 | +function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } | |
| 6332 | + | |
| 6333 | +function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); } | |
| 6334 | + | |
| 6335 | +function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } | |
| 6336 | + | |
| 6337 | +function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } | |
| 6338 | + | |
| 6339 | +function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } | |
| 6340 | + | |
| 6341 | +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | |
| 6342 | + | |
| 6343 | +// Simple abstraction for dragging events names. | |
| 6344 | +var eventsFor = { | |
| 6345 | + touch: { | |
| 6346 | + start: 'touchstart', | |
| 6347 | + move: 'touchmove', | |
| 6348 | + stop: 'touchend' | |
| 6349 | + }, | |
| 6350 | + mouse: { | |
| 6351 | + start: 'mousedown', | |
| 6352 | + move: 'mousemove', | |
| 6353 | + stop: 'mouseup' | |
| 6354 | + } | |
| 6355 | +}; // Default to mouse events. | |
| 6356 | + | |
| 6357 | +var dragEventFor = eventsFor.mouse; | |
| 6358 | +/*:: type DraggableCoreState = { | |
| 6359 | + dragging: boolean, | |
| 6360 | + lastX: number, | |
| 6361 | + lastY: number, | |
| 6362 | + touchIdentifier: ?number | |
| 6363 | +};*/ | |
| 6364 | + | |
| 6365 | +/*:: export type DraggableData = { | |
| 6366 | + node: HTMLElement, | |
| 6367 | + x: number, y: number, | |
| 6368 | + deltaX: number, deltaY: number, | |
| 6369 | + lastX: number, lastY: number, | |
| 6370 | +};*/ | |
| 6371 | + | |
| 6372 | +/*:: export type DraggableEventHandler = (e: MouseEvent, data: DraggableData) => void | false;*/ | |
| 6373 | + | |
| 6374 | +/*:: export type ControlPosition = {x: number, y: number};*/ | |
| 6375 | + | |
| 6376 | +/*:: export type PositionOffsetControlPosition = {x: number|string, y: number|string};*/ | |
| 6377 | + | |
| 6378 | +/*:: export type DraggableCoreDefaultProps = { | |
| 6379 | + allowAnyClick: boolean, | |
| 6380 | + disabled: boolean, | |
| 6381 | + enableUserSelectHack: boolean, | |
| 6382 | + onStart: DraggableEventHandler, | |
| 6383 | + onDrag: DraggableEventHandler, | |
| 6384 | + onStop: DraggableEventHandler, | |
| 6385 | + onMouseDown: (e: MouseEvent) => void, | |
| 6386 | + scale: number, | |
| 6387 | +};*/ | |
| 6388 | + | |
| 6389 | +/*:: export type DraggableCoreProps = { | |
| 6390 | + ...DraggableCoreDefaultProps, | |
| 6391 | + cancel: string, | |
| 6392 | + children: ReactElement<any>, | |
| 6393 | + offsetParent: HTMLElement, | |
| 6394 | + grid: [number, number], | |
| 6395 | + handle: string, | |
| 6396 | + nodeRef?: ?React.ElementRef<any>, | |
| 6397 | +};*/ | |
| 6398 | + | |
| 6399 | +// | |
| 6400 | +// Define <DraggableCore>. | |
| 6401 | +// | |
| 6402 | +// <DraggableCore> is for advanced usage of <Draggable>. It maintains minimal internal state so it can | |
| 6403 | +// work well with libraries that require more control over the element. | |
| 6404 | +// | |
| 6405 | +var DraggableCore = /*#__PURE__*/function (_React$Component) { | |
| 6406 | + _inherits(DraggableCore, _React$Component); | |
| 6407 | + | |
| 6408 | + var _super = _createSuper(DraggableCore); | |
| 6409 | + | |
| 6410 | + function DraggableCore() { | |
| 6411 | + var _this; | |
| 6412 | + | |
| 6413 | + _classCallCheck(this, DraggableCore); | |
| 6414 | + | |
| 6415 | + for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { | |
| 6416 | + args[_key] = arguments[_key]; | |
| 6417 | + } | |
| 6418 | + | |
| 6419 | + _this = _super.call.apply(_super, [this].concat(args)); | |
| 6420 | + | |
| 6421 | + _defineProperty(_assertThisInitialized(_this), "state", { | |
| 6422 | + dragging: false, | |
| 6423 | + // Used while dragging to determine deltas. | |
| 6424 | + lastX: NaN, | |
| 6425 | + lastY: NaN, | |
| 6426 | + touchIdentifier: null | |
| 6427 | + }); | |
| 6428 | + | |
| 6429 | + _defineProperty(_assertThisInitialized(_this), "mounted", false); | |
| 6430 | + | |
| 6431 | + _defineProperty(_assertThisInitialized(_this), "handleDragStart", function (e) { | |
| 6432 | + // Make it possible to attach event handlers on top of this one. | |
| 6433 | + _this.props.onMouseDown(e); // Only accept left-clicks. | |
| 6434 | + | |
| 6435 | + | |
| 6436 | + if (!_this.props.allowAnyClick && typeof e.button === 'number' && e.button !== 0) return false; // Get nodes. Be sure to grab relative document (could be iframed) | |
| 6437 | + | |
| 6438 | + var thisNode = _this.findDOMNode(); | |
| 6439 | + | |
| 6440 | + if (!thisNode || !thisNode.ownerDocument || !thisNode.ownerDocument.body) { | |
| 6441 | + throw new Error('<DraggableCore> not mounted on DragStart!'); | |
| 6442 | + } | |
| 6443 | + | |
| 6444 | + var ownerDocument = thisNode.ownerDocument; // Short circuit if handle or cancel prop was provided and selector doesn't match. | |
| 6445 | + | |
| 6446 | + if (_this.props.disabled || !(e.target instanceof ownerDocument.defaultView.Node) || _this.props.handle && !(0, _domFns.matchesSelectorAndParentsTo)(e.target, _this.props.handle, thisNode) || _this.props.cancel && (0, _domFns.matchesSelectorAndParentsTo)(e.target, _this.props.cancel, thisNode)) { | |
| 6447 | + return; | |
| 6448 | + } // Prevent scrolling on mobile devices, like ipad/iphone. | |
| 6449 | + // Important that this is after handle/cancel. | |
| 6450 | + | |
| 6451 | + | |
| 6452 | + if (e.type === 'touchstart') e.preventDefault(); // Set touch identifier in component state if this is a touch event. This allows us to | |
| 6453 | + // distinguish between individual touches on multitouch screens by identifying which | |
| 6454 | + // touchpoint was set to this element. | |
| 6455 | + | |
| 6456 | + var touchIdentifier = (0, _domFns.getTouchIdentifier)(e); | |
| 6457 | + | |
| 6458 | + _this.setState({ | |
| 6459 | + touchIdentifier: touchIdentifier | |
| 6460 | + }); // Get the current drag point from the event. This is used as the offset. | |
| 6461 | + | |
| 6462 | + | |
| 6463 | + var position = (0, _positionFns.getControlPosition)(e, touchIdentifier, _assertThisInitialized(_this)); | |
| 6464 | + if (position == null) return; // not possible but satisfies flow | |
| 6465 | + | |
| 6466 | + var x = position.x, | |
| 6467 | + y = position.y; // Create an event object with all the data parents need to make a decision here. | |
| 6468 | + | |
| 6469 | + var coreEvent = (0, _positionFns.createCoreData)(_assertThisInitialized(_this), x, y); | |
| 6470 | + (0, _log.default)('DraggableCore: handleDragStart: %j', coreEvent); // Call event handler. If it returns explicit false, cancel. | |
| 6471 | + | |
| 6472 | + (0, _log.default)('calling', _this.props.onStart); | |
| 6473 | + | |
| 6474 | + var shouldUpdate = _this.props.onStart(e, coreEvent); | |
| 6475 | + | |
| 6476 | + if (shouldUpdate === false || _this.mounted === false) return; // Add a style to the body to disable user-select. This prevents text from | |
| 6477 | + // being selected all over the page. | |
| 6478 | + | |
| 6479 | + if (_this.props.enableUserSelectHack) (0, _domFns.addUserSelectStyles)(ownerDocument); // Initiate dragging. Set the current x and y as offsets | |
| 6480 | + // so we know how much we've moved during the drag. This allows us | |
| 6481 | + // to drag elements around even if they have been moved, without issue. | |
| 6482 | + | |
| 6483 | + _this.setState({ | |
| 6484 | + dragging: true, | |
| 6485 | + lastX: x, | |
| 6486 | + lastY: y | |
| 6487 | + }); // Add events to the document directly so we catch when the user's mouse/touch moves outside of | |
| 6488 | + // this element. We use different events depending on whether or not we have detected that this | |
| 6489 | + // is a touch-capable device. | |
| 6490 | + | |
| 6491 | + | |
| 6492 | + (0, _domFns.addEvent)(ownerDocument, dragEventFor.move, _this.handleDrag); | |
| 6493 | + (0, _domFns.addEvent)(ownerDocument, dragEventFor.stop, _this.handleDragStop); | |
| 6494 | + }); | |
| 6495 | + | |
| 6496 | + _defineProperty(_assertThisInitialized(_this), "handleDrag", function (e) { | |
| 6497 | + // Get the current drag point from the event. This is used as the offset. | |
| 6498 | + var position = (0, _positionFns.getControlPosition)(e, _this.state.touchIdentifier, _assertThisInitialized(_this)); | |
| 6499 | + if (position == null) return; | |
| 6500 | + var x = position.x, | |
| 6501 | + y = position.y; // Snap to grid if prop has been provided | |
| 6502 | + | |
| 6503 | + if (Array.isArray(_this.props.grid)) { | |
| 6504 | + var deltaX = x - _this.state.lastX, | |
| 6505 | + deltaY = y - _this.state.lastY; | |
| 6506 | + | |
| 6507 | + var _snapToGrid = (0, _positionFns.snapToGrid)(_this.props.grid, deltaX, deltaY); | |
| 6508 | + | |
| 6509 | + var _snapToGrid2 = _slicedToArray(_snapToGrid, 2); | |
| 6510 | + | |
| 6511 | + deltaX = _snapToGrid2[0]; | |
| 6512 | + deltaY = _snapToGrid2[1]; | |
| 6513 | + if (!deltaX && !deltaY) return; // skip useless drag | |
| 6514 | + | |
| 6515 | + x = _this.state.lastX + deltaX, y = _this.state.lastY + deltaY; | |
| 6516 | + } | |
| 6517 | + | |
| 6518 | + var coreEvent = (0, _positionFns.createCoreData)(_assertThisInitialized(_this), x, y); | |
| 6519 | + (0, _log.default)('DraggableCore: handleDrag: %j', coreEvent); // Call event handler. If it returns explicit false, trigger end. | |
| 6520 | + | |
| 6521 | + var shouldUpdate = _this.props.onDrag(e, coreEvent); | |
| 6522 | + | |
| 6523 | + if (shouldUpdate === false || _this.mounted === false) { | |
| 6524 | + try { | |
| 6525 | + // $FlowIgnore | |
| 6526 | + _this.handleDragStop(new MouseEvent('mouseup')); | |
| 6527 | + } catch (err) { | |
| 6528 | + // Old browsers | |
| 6529 | + var event = ((document.createEvent('MouseEvents') | |
| 6530 | + /*: any*/ | |
| 6531 | + ) | |
| 6532 | + /*: MouseTouchEvent*/ | |
| 6533 | + ); // I see why this insanity was deprecated | |
| 6534 | + // $FlowIgnore | |
| 6535 | + | |
| 6536 | + event.initMouseEvent('mouseup', true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null); | |
| 6537 | + | |
| 6538 | + _this.handleDragStop(event); | |
| 6539 | + } | |
| 6540 | + | |
| 6541 | + return; | |
| 6542 | + } | |
| 6543 | + | |
| 6544 | + _this.setState({ | |
| 6545 | + lastX: x, | |
| 6546 | + lastY: y | |
| 6547 | + }); | |
| 6548 | + }); | |
| 6549 | + | |
| 6550 | + _defineProperty(_assertThisInitialized(_this), "handleDragStop", function (e) { | |
| 6551 | + if (!_this.state.dragging) return; | |
| 6552 | + var position = (0, _positionFns.getControlPosition)(e, _this.state.touchIdentifier, _assertThisInitialized(_this)); | |
| 6553 | + if (position == null) return; | |
| 6554 | + var x = position.x, | |
| 6555 | + y = position.y; // Snap to grid if prop has been provided | |
| 6556 | + | |
| 6557 | + if (Array.isArray(_this.props.grid)) { | |
| 6558 | + var deltaX = x - _this.state.lastX || 0; | |
| 6559 | + var deltaY = y - _this.state.lastY || 0; | |
| 6560 | + | |
| 6561 | + var _snapToGrid3 = (0, _positionFns.snapToGrid)(_this.props.grid, deltaX, deltaY); | |
| 6562 | + | |
| 6563 | + var _snapToGrid4 = _slicedToArray(_snapToGrid3, 2); | |
| 6564 | + | |
| 6565 | + deltaX = _snapToGrid4[0]; | |
| 6566 | + deltaY = _snapToGrid4[1]; | |
| 6567 | + x = _this.state.lastX + deltaX, y = _this.state.lastY + deltaY; | |
| 6568 | + } | |
| 6569 | + | |
| 6570 | + var coreEvent = (0, _positionFns.createCoreData)(_assertThisInitialized(_this), x, y); // Call event handler | |
| 6571 | + | |
| 6572 | + var shouldContinue = _this.props.onStop(e, coreEvent); | |
| 6573 | + | |
| 6574 | + if (shouldContinue === false || _this.mounted === false) return false; | |
| 6575 | + | |
| 6576 | + var thisNode = _this.findDOMNode(); | |
| 6577 | + | |
| 6578 | + if (thisNode) { | |
| 6579 | + // Remove user-select hack | |
| 6580 | + if (_this.props.enableUserSelectHack) (0, _domFns.removeUserSelectStyles)(thisNode.ownerDocument); | |
| 6581 | + } | |
| 6582 | + | |
| 6583 | + (0, _log.default)('DraggableCore: handleDragStop: %j', coreEvent); // Reset the el. | |
| 6584 | + | |
| 6585 | + _this.setState({ | |
| 6586 | + dragging: false, | |
| 6587 | + lastX: NaN, | |
| 6588 | + lastY: NaN | |
| 6589 | + }); | |
| 6590 | + | |
| 6591 | + if (thisNode) { | |
| 6592 | + // Remove event handlers | |
| 6593 | + (0, _log.default)('DraggableCore: Removing handlers'); | |
| 6594 | + (0, _domFns.removeEvent)(thisNode.ownerDocument, dragEventFor.move, _this.handleDrag); | |
| 6595 | + (0, _domFns.removeEvent)(thisNode.ownerDocument, dragEventFor.stop, _this.handleDragStop); | |
| 6596 | + } | |
| 6597 | + }); | |
| 6598 | + | |
| 6599 | + _defineProperty(_assertThisInitialized(_this), "onMouseDown", function (e) { | |
| 6600 | + dragEventFor = eventsFor.mouse; // on touchscreen laptops we could switch back to mouse | |
| 6601 | + | |
| 6602 | + return _this.handleDragStart(e); | |
| 6603 | + }); | |
| 6604 | + | |
| 6605 | + _defineProperty(_assertThisInitialized(_this), "onMouseUp", function (e) { | |
| 6606 | + dragEventFor = eventsFor.mouse; | |
| 6607 | + return _this.handleDragStop(e); | |
| 6608 | + }); | |
| 6609 | + | |
| 6610 | + _defineProperty(_assertThisInitialized(_this), "onTouchStart", function (e) { | |
| 6611 | + // We're on a touch device now, so change the event handlers | |
| 6612 | + dragEventFor = eventsFor.touch; | |
| 6613 | + return _this.handleDragStart(e); | |
| 6614 | + }); | |
| 6615 | + | |
| 6616 | + _defineProperty(_assertThisInitialized(_this), "onTouchEnd", function (e) { | |
| 6617 | + // We're on a touch device now, so change the event handlers | |
| 6618 | + dragEventFor = eventsFor.touch; | |
| 6619 | + return _this.handleDragStop(e); | |
| 6620 | + }); | |
| 6621 | + | |
| 6622 | + return _this; | |
| 6623 | + } | |
| 6624 | + | |
| 6625 | + _createClass(DraggableCore, [{ | |
| 6626 | + key: "componentDidMount", | |
| 6627 | + value: function componentDidMount() { | |
| 6628 | + this.mounted = true; // Touch handlers must be added with {passive: false} to be cancelable. | |
| 6629 | + // https://developers.google.com/web/updates/2017/01/scrolling-intervention | |
| 6630 | + | |
| 6631 | + var thisNode = this.findDOMNode(); | |
| 6632 | + | |
| 6633 | + if (thisNode) { | |
| 6634 | + (0, _domFns.addEvent)(thisNode, eventsFor.touch.start, this.onTouchStart, { | |
| 6635 | + passive: false | |
| 6636 | + }); | |
| 6637 | + } | |
| 6638 | + } | |
| 6639 | + }, { | |
| 6640 | + key: "componentWillUnmount", | |
| 6641 | + value: function componentWillUnmount() { | |
| 6642 | + this.mounted = false; // Remove any leftover event handlers. Remove both touch and mouse handlers in case | |
| 6643 | + // some browser quirk caused a touch event to fire during a mouse move, or vice versa. | |
| 6644 | + | |
| 6645 | + var thisNode = this.findDOMNode(); | |
| 6646 | + | |
| 6647 | + if (thisNode) { | |
| 6648 | + var ownerDocument = thisNode.ownerDocument; | |
| 6649 | + (0, _domFns.removeEvent)(ownerDocument, eventsFor.mouse.move, this.handleDrag); | |
| 6650 | + (0, _domFns.removeEvent)(ownerDocument, eventsFor.touch.move, this.handleDrag); | |
| 6651 | + (0, _domFns.removeEvent)(ownerDocument, eventsFor.mouse.stop, this.handleDragStop); | |
| 6652 | + (0, _domFns.removeEvent)(ownerDocument, eventsFor.touch.stop, this.handleDragStop); | |
| 6653 | + (0, _domFns.removeEvent)(thisNode, eventsFor.touch.start, this.onTouchStart, { | |
| 6654 | + passive: false | |
| 6655 | + }); | |
| 6656 | + if (this.props.enableUserSelectHack) (0, _domFns.removeUserSelectStyles)(ownerDocument); | |
| 6657 | + } | |
| 6658 | + } // React Strict Mode compatibility: if `nodeRef` is passed, we will use it instead of trying to find | |
| 6659 | + // the underlying DOM node ourselves. See the README for more information. | |
| 6660 | + | |
| 6661 | + }, { | |
| 6662 | + key: "findDOMNode", | |
| 6663 | + value: function findDOMNode() | |
| 6664 | + /*: ?HTMLElement*/ | |
| 6665 | + { | |
| 6666 | + var _this$props, _this$props2, _this$props2$nodeRef; | |
| 6667 | + | |
| 6668 | + return (_this$props = this.props) !== null && _this$props !== void 0 && _this$props.nodeRef ? (_this$props2 = this.props) === null || _this$props2 === void 0 ? void 0 : (_this$props2$nodeRef = _this$props2.nodeRef) === null || _this$props2$nodeRef === void 0 ? void 0 : _this$props2$nodeRef.current : _reactDom.default.findDOMNode(this); | |
| 6669 | + } | |
| 6670 | + }, { | |
| 6671 | + key: "render", | |
| 6672 | + value: function render() | |
| 6673 | + /*: React.Element<any>*/ | |
| 6674 | + { | |
| 6675 | + // Reuse the child provided | |
| 6676 | + // This makes it flexible to use whatever element is wanted (div, ul, etc) | |
| 6677 | + return /*#__PURE__*/React.cloneElement(React.Children.only(this.props.children), { | |
| 6678 | + // Note: mouseMove handler is attached to document so it will still function | |
| 6679 | + // when the user drags quickly and leaves the bounds of the element. | |
| 6680 | + onMouseDown: this.onMouseDown, | |
| 6681 | + onMouseUp: this.onMouseUp, | |
| 6682 | + // onTouchStart is added on `componentDidMount` so they can be added with | |
| 6683 | + // {passive: false}, which allows it to cancel. See | |
| 6684 | + // https://developers.google.com/web/updates/2017/01/scrolling-intervention | |
| 6685 | + onTouchEnd: this.onTouchEnd | |
| 6686 | + }); | |
| 6687 | + } | |
| 6688 | + }]); | |
| 6689 | + | |
| 6690 | + return DraggableCore; | |
| 6691 | +}(React.Component); | |
| 6692 | + | |
| 6693 | +exports["default"] = DraggableCore; | |
| 6694 | + | |
| 6695 | +_defineProperty(DraggableCore, "displayName", 'DraggableCore'); | |
| 6696 | + | |
| 6697 | +_defineProperty(DraggableCore, "propTypes", { | |
| 6698 | + /** | |
| 6699 | + * `allowAnyClick` allows dragging using any mouse button. | |
| 6700 | + * By default, we only accept the left button. | |
| 6701 | + * | |
| 6702 | + * Defaults to `false`. | |
| 6703 | + */ | |
| 6704 | + allowAnyClick: _propTypes.default.bool, | |
| 6705 | + | |
| 6706 | + /** | |
| 6707 | + * `disabled`, if true, stops the <Draggable> from dragging. All handlers, | |
| 6708 | + * with the exception of `onMouseDown`, will not fire. | |
| 6709 | + */ | |
| 6710 | + disabled: _propTypes.default.bool, | |
| 6711 | + | |
| 6712 | + /** | |
| 6713 | + * By default, we add 'user-select:none' attributes to the document body | |
| 6714 | + * to prevent ugly text selection during drag. If this is causing problems | |
| 6715 | + * for your app, set this to `false`. | |
| 6716 | + */ | |
| 6717 | + enableUserSelectHack: _propTypes.default.bool, | |
| 6718 | + | |
| 6719 | + /** | |
| 6720 | + * `offsetParent`, if set, uses the passed DOM node to compute drag offsets | |
| 6721 | + * instead of using the parent node. | |
| 6722 | + */ | |
| 6723 | + offsetParent: function offsetParent(props | |
| 6724 | + /*: DraggableCoreProps*/ | |
| 6725 | + , propName | |
| 6726 | + /*: $Keys<DraggableCoreProps>*/ | |
| 6727 | + ) { | |
| 6728 | + if (props[propName] && props[propName].nodeType !== 1) { | |
| 6729 | + throw new Error('Draggable\'s offsetParent must be a DOM Node.'); | |
| 6730 | + } | |
| 6731 | + }, | |
| 6732 | + | |
| 6733 | + /** | |
| 6734 | + * `grid` specifies the x and y that dragging should snap to. | |
| 6735 | + */ | |
| 6736 | + grid: _propTypes.default.arrayOf(_propTypes.default.number), | |
| 6737 | + | |
| 6738 | + /** | |
| 6739 | + * `handle` specifies a selector to be used as the handle that initiates drag. | |
| 6740 | + * | |
| 6741 | + * Example: | |
| 6742 | + * | |
| 6743 | + * ```jsx | |
| 6744 | + * let App = React.createClass({ | |
| 6745 | + * render: function () { | |
| 6746 | + * return ( | |
| 6747 | + * <Draggable handle=".handle"> | |
| 6748 | + * <div> | |
| 6749 | + * <div className="handle">Click me to drag</div> | |
| 6750 | + * <div>This is some other content</div> | |
| 6751 | + * </div> | |
| 6752 | + * </Draggable> | |
| 6753 | + * ); | |
| 6754 | + * } | |
| 6755 | + * }); | |
| 6756 | + * ``` | |
| 6757 | + */ | |
| 6758 | + handle: _propTypes.default.string, | |
| 6759 | + | |
| 6760 | + /** | |
| 6761 | + * `cancel` specifies a selector to be used to prevent drag initialization. | |
| 6762 | + * | |
| 6763 | + * Example: | |
| 6764 | + * | |
| 6765 | + * ```jsx | |
| 6766 | + * let App = React.createClass({ | |
| 6767 | + * render: function () { | |
| 6768 | + * return( | |
| 6769 | + * <Draggable cancel=".cancel"> | |
| 6770 | + * <div> | |
| 6771 | + * <div className="cancel">You can't drag from here</div> | |
| 6772 | + * <div>Dragging here works fine</div> | |
| 6773 | + * </div> | |
| 6774 | + * </Draggable> | |
| 6775 | + * ); | |
| 6776 | + * } | |
| 6777 | + * }); | |
| 6778 | + * ``` | |
| 6779 | + */ | |
| 6780 | + cancel: _propTypes.default.string, | |
| 6781 | + | |
| 6782 | + /* If running in React Strict mode, ReactDOM.findDOMNode() is deprecated. | |
| 6783 | + * Unfortunately, in order for <Draggable> to work properly, we need raw access | |
| 6784 | + * to the underlying DOM node. If you want to avoid the warning, pass a `nodeRef` | |
| 6785 | + * as in this example: | |
| 6786 | + * | |
| 6787 | + * function MyComponent() { | |
| 6788 | + * const nodeRef = React.useRef(null); | |
| 6789 | + * return ( | |
| 6790 | + * <Draggable nodeRef={nodeRef}> | |
| 6791 | + * <div ref={nodeRef}>Example Target</div> | |
| 6792 | + * </Draggable> | |
| 6793 | + * ); | |
| 6794 | + * } | |
| 6795 | + * | |
| 6796 | + * This can be used for arbitrarily nested components, so long as the ref ends up | |
| 6797 | + * pointing to the actual child DOM node and not a custom component. | |
| 6798 | + */ | |
| 6799 | + nodeRef: _propTypes.default.object, | |
| 6800 | + | |
| 6801 | + /** | |
| 6802 | + * Called when dragging starts. | |
| 6803 | + * If this function returns the boolean false, dragging will be canceled. | |
| 6804 | + */ | |
| 6805 | + onStart: _propTypes.default.func, | |
| 6806 | + | |
| 6807 | + /** | |
| 6808 | + * Called while dragging. | |
| 6809 | + * If this function returns the boolean false, dragging will be canceled. | |
| 6810 | + */ | |
| 6811 | + onDrag: _propTypes.default.func, | |
| 6812 | + | |
| 6813 | + /** | |
| 6814 | + * Called when dragging stops. | |
| 6815 | + * If this function returns the boolean false, the drag will remain active. | |
| 6816 | + */ | |
| 6817 | + onStop: _propTypes.default.func, | |
| 6818 | + | |
| 6819 | + /** | |
| 6820 | + * A workaround option which can be passed if onMouseDown needs to be accessed, | |
| 6821 | + * since it'll always be blocked (as there is internal use of onMouseDown) | |
| 6822 | + */ | |
| 6823 | + onMouseDown: _propTypes.default.func, | |
| 6824 | + | |
| 6825 | + /** | |
| 6826 | + * `scale`, if set, applies scaling while dragging an element | |
| 6827 | + */ | |
| 6828 | + scale: _propTypes.default.number, | |
| 6829 | + | |
| 6830 | + /** | |
| 6831 | + * These properties should be defined on the child, not here. | |
| 6832 | + */ | |
| 6833 | + className: _shims.dontSetMe, | |
| 6834 | + style: _shims.dontSetMe, | |
| 6835 | + transform: _shims.dontSetMe | |
| 6836 | +}); | |
| 6837 | + | |
| 6838 | +_defineProperty(DraggableCore, "defaultProps", { | |
| 6839 | + allowAnyClick: false, | |
| 6840 | + // by default only accept left click | |
| 6841 | + disabled: false, | |
| 6842 | + enableUserSelectHack: true, | |
| 6843 | + onStart: function onStart() {}, | |
| 6844 | + onDrag: function onDrag() {}, | |
| 6845 | + onStop: function onStop() {}, | |
| 6846 | + onMouseDown: function onMouseDown() {}, | |
| 6847 | + scale: 1 | |
| 6848 | +}); | |
| 6849 | + | |
| 6850 | +/***/ }), | |
| 6851 | + | |
| 6852 | +/***/ "../node_modules/react-draggable/build/cjs/cjs.js": | |
| 6853 | +/*!********************************************************!*\ | |
| 6854 | + !*** ../node_modules/react-draggable/build/cjs/cjs.js ***! | |
| 6855 | + \********************************************************/ | |
| 6856 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 6857 | + | |
| 6858 | +"use strict"; | |
| 6859 | + | |
| 6860 | + | |
| 6861 | +var _require = __webpack_require__(/*! ./Draggable */ "../node_modules/react-draggable/build/cjs/Draggable.js"), | |
| 6862 | + Draggable = _require.default, | |
| 6863 | + DraggableCore = _require.DraggableCore; // Previous versions of this lib exported <Draggable> as the root export. As to no-// them, or TypeScript, we export *both* as the root and as 'default'. | |
| 6864 | +// See https://github.com/mzabriskie/react-draggable/pull/254 | |
| 6865 | +// and https://github.com/mzabriskie/react-draggable/issues/266 | |
| 6866 | + | |
| 6867 | + | |
| 6868 | +module.exports = Draggable; | |
| 6869 | +module.exports["default"] = Draggable; | |
| 6870 | +module.exports.DraggableCore = DraggableCore; | |
| 6871 | + | |
| 6872 | +/***/ }), | |
| 6873 | + | |
| 6874 | +/***/ "../node_modules/react-draggable/build/cjs/utils/domFns.js": | |
| 6875 | +/*!*****************************************************************!*\ | |
| 6876 | + !*** ../node_modules/react-draggable/build/cjs/utils/domFns.js ***! | |
| 6877 | + \*****************************************************************/ | |
| 6878 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 6879 | + | |
| 6880 | +"use strict"; | |
| 6881 | + | |
| 6882 | + | |
| 6883 | +function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); } | |
| 6884 | + | |
| 6885 | +Object.defineProperty(exports, "__esModule", ({ | |
| 6886 | + value: true | |
| 6887 | +})); | |
| 6888 | +exports.addClassName = addClassName; | |
| 6889 | +exports.addEvent = addEvent; | |
| 6890 | +exports.addUserSelectStyles = addUserSelectStyles; | |
| 6891 | +exports.createCSSTransform = createCSSTransform; | |
| 6892 | +exports.createSVGTransform = createSVGTransform; | |
| 6893 | +exports.getTouch = getTouch; | |
| 6894 | +exports.getTouchIdentifier = getTouchIdentifier; | |
| 6895 | +exports.getTranslation = getTranslation; | |
| 6896 | +exports.innerHeight = innerHeight; | |
| 6897 | +exports.innerWidth = innerWidth; | |
| 6898 | +exports.matchesSelector = matchesSelector; | |
| 6899 | +exports.matchesSelectorAndParentsTo = matchesSelectorAndParentsTo; | |
| 6900 | +exports.offsetXYFromParent = offsetXYFromParent; | |
| 6901 | +exports.outerHeight = outerHeight; | |
| 6902 | +exports.outerWidth = outerWidth; | |
| 6903 | +exports.removeClassName = removeClassName; | |
| 6904 | +exports.removeEvent = removeEvent; | |
| 6905 | +exports.removeUserSelectStyles = removeUserSelectStyles; | |
| 6906 | + | |
| 6907 | +var _shims = __webpack_require__(/*! ./shims */ "../node_modules/react-draggable/build/cjs/utils/shims.js"); | |
| 6908 | + | |
| 6909 | +var _getPrefix = _interopRequireWildcard(__webpack_require__(/*! ./getPrefix */ "../node_modules/react-draggable/build/cjs/utils/getPrefix.js")); | |
| 6910 | + | |
| 6911 | +function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | |
| 6912 | + | |
| 6913 | +function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | |
| 6914 | + | |
| 6915 | +function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; } | |
| 6916 | + | |
| 6917 | +function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; } | |
| 6918 | + | |
| 6919 | +function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } | |
| 6920 | + | |
| 6921 | +var matchesSelectorFunc = ''; | |
| 6922 | + | |
| 6923 | +function matchesSelector(el | |
| 6924 | +/*: Node*/ | |
| 6925 | +, selector | |
| 6926 | +/*: string*/ | |
| 6927 | +) | |
| 6928 | +/*: boolean*/ | |
| 6929 | +{ | |
| 6930 | + if (!matchesSelectorFunc) { | |
| 6931 | + matchesSelectorFunc = (0, _shims.findInArray)(['matches', 'webkitMatchesSelector', 'mozMatchesSelector', 'msMatchesSelector', 'oMatchesSelector'], function (method) { | |
| 6932 | + // $FlowIgnore: Doesn't think elements are indexable | |
| 6933 | + return (0, _shims.isFunction)(el[method]); | |
| 6934 | + }); | |
| 6935 | + } // Might not be found entirely (not an Element?) - in that case, bail | |
| 6936 | + // $FlowIgnore: Doesn't think elements are indexable | |
| 6937 | + | |
| 6938 | + | |
| 6939 | + if (!(0, _shims.isFunction)(el[matchesSelectorFunc])) return false; // $FlowIgnore: Doesn't think elements are indexable | |
| 6940 | + | |
| 6941 | + return el[matchesSelectorFunc](selector); | |
| 6942 | +} // Works up the tree to the draggable itself attempting to match selector. | |
| 6943 | + | |
| 6944 | + | |
| 6945 | +function matchesSelectorAndParentsTo(el | |
| 6946 | +/*: Node*/ | |
| 6947 | +, selector | |
| 6948 | +/*: string*/ | |
| 6949 | +, baseNode | |
| 6950 | +/*: Node*/ | |
| 6951 | +) | |
| 6952 | +/*: boolean*/ | |
| 6953 | +{ | |
| 6954 | + var node = el; | |
| 6955 | + | |
| 6956 | + do { | |
| 6957 | + if (matchesSelector(node, selector)) return true; | |
| 6958 | + if (node === baseNode) return false; | |
| 6959 | + node = node.parentNode; | |
| 6960 | + } while (node); | |
| 6961 | + | |
| 6962 | + return false; | |
| 6963 | +} | |
| 6964 | + | |
| 6965 | +function addEvent(el | |
| 6966 | +/*: ?Node*/ | |
| 6967 | +, event | |
| 6968 | +/*: string*/ | |
| 6969 | +, handler | |
| 6970 | +/*: Function*/ | |
| 6971 | +, inputOptions | |
| 6972 | +/*: Object*/ | |
| 6973 | +) | |
| 6974 | +/*: void*/ | |
| 6975 | +{ | |
| 6976 | + if (!el) return; | |
| 6977 | + | |
| 6978 | + var options = _objectSpread({ | |
| 6979 | + capture: true | |
| 6980 | + }, inputOptions); // $FlowIgnore[method-unbinding] | |
| 6981 | + | |
| 6982 | + | |
| 6983 | + if (el.addEventListener) { | |
| 6984 | + el.addEventListener(event, handler, options); | |
| 6985 | + } else if (el.attachEvent) { | |
| 6986 | + el.attachEvent('on' + event, handler); | |
| 6987 | + } else { | |
| 6988 | + // $FlowIgnore: Doesn't think elements are indexable | |
| 6989 | + el['on' + event] = handler; | |
| 6990 | + } | |
| 6991 | +} | |
| 6992 | + | |
| 6993 | +function removeEvent(el | |
| 6994 | +/*: ?Node*/ | |
| 6995 | +, event | |
| 6996 | +/*: string*/ | |
| 6997 | +, handler | |
| 6998 | +/*: Function*/ | |
| 6999 | +, inputOptions | |
| 7000 | +/*: Object*/ | |
| 7001 | +) | |
| 7002 | +/*: void*/ | |
| 7003 | +{ | |
| 7004 | + if (!el) return; | |
| 7005 | + | |
| 7006 | + var options = _objectSpread({ | |
| 7007 | + capture: true | |
| 7008 | + }, inputOptions); // $FlowIgnore[method-unbinding] | |
| 7009 | + | |
| 7010 | + | |
| 7011 | + if (el.removeEventListener) { | |
| 7012 | + el.removeEventListener(event, handler, options); | |
| 7013 | + } else if (el.detachEvent) { | |
| 7014 | + el.detachEvent('on' + event, handler); | |
| 7015 | + } else { | |
| 7016 | + // $FlowIgnore: Doesn't think elements are indexable | |
| 7017 | + el['on' + event] = null; | |
| 7018 | + } | |
| 7019 | +} | |
| 7020 | + | |
| 7021 | +function outerHeight(node | |
| 7022 | +/*: HTMLElement*/ | |
| 7023 | +) | |
| 7024 | +/*: number*/ | |
| 7025 | +{ | |
| 7026 | + // This is deliberately excluding margin for our calculations, since we are using | |
| 7027 | + // offsetTop which is including margin. See getBoundPosition | |
| 7028 | + var height = node.clientHeight; | |
| 7029 | + var computedStyle = node.ownerDocument.defaultView.getComputedStyle(node); | |
| 7030 | + height += (0, _shims.int)(computedStyle.borderTopWidth); | |
| 7031 | + height += (0, _shims.int)(computedStyle.borderBottomWidth); | |
| 7032 | + return height; | |
| 7033 | +} | |
| 7034 | + | |
| 7035 | +function outerWidth(node | |
| 7036 | +/*: HTMLElement*/ | |
| 7037 | +) | |
| 7038 | +/*: number*/ | |
| 7039 | +{ | |
| 7040 | + // This is deliberately excluding margin for our calculations, since we are using | |
| 7041 | + // offsetLeft which is including margin. See getBoundPosition | |
| 7042 | + var width = node.clientWidth; | |
| 7043 | + var computedStyle = node.ownerDocument.defaultView.getComputedStyle(node); | |
| 7044 | + width += (0, _shims.int)(computedStyle.borderLeftWidth); | |
| 7045 | + width += (0, _shims.int)(computedStyle.borderRightWidth); | |
| 7046 | + return width; | |
| 7047 | +} | |
| 7048 | + | |
| 7049 | +function innerHeight(node | |
| 7050 | +/*: HTMLElement*/ | |
| 7051 | +) | |
| 7052 | +/*: number*/ | |
| 7053 | +{ | |
| 7054 | + var height = node.clientHeight; | |
| 7055 | + var computedStyle = node.ownerDocument.defaultView.getComputedStyle(node); | |
| 7056 | + height -= (0, _shims.int)(computedStyle.paddingTop); | |
| 7057 | + height -= (0, _shims.int)(computedStyle.paddingBottom); | |
| 7058 | + return height; | |
| 7059 | +} | |
| 7060 | + | |
| 7061 | +function innerWidth(node | |
| 7062 | +/*: HTMLElement*/ | |
| 7063 | +) | |
| 7064 | +/*: number*/ | |
| 7065 | +{ | |
| 7066 | + var width = node.clientWidth; | |
| 7067 | + var computedStyle = node.ownerDocument.defaultView.getComputedStyle(node); | |
| 7068 | + width -= (0, _shims.int)(computedStyle.paddingLeft); | |
| 7069 | + width -= (0, _shims.int)(computedStyle.paddingRight); | |
| 7070 | + return width; | |
| 7071 | +} | |
| 7072 | +/*:: interface EventWithOffset { | |
| 7073 | + clientX: number, clientY: number | |
| 7074 | +}*/ | |
| 7075 | + | |
| 7076 | + | |
| 7077 | +// Get from offsetParent | |
| 7078 | +function offsetXYFromParent(evt | |
| 7079 | +/*: EventWithOffset*/ | |
| 7080 | +, offsetParent | |
| 7081 | +/*: HTMLElement*/ | |
| 7082 | +, scale | |
| 7083 | +/*: number*/ | |
| 7084 | +) | |
| 7085 | +/*: ControlPosition*/ | |
| 7086 | +{ | |
| 7087 | + var isBody = offsetParent === offsetParent.ownerDocument.body; | |
| 7088 | + var offsetParentRect = isBody ? { | |
| 7089 | + left: 0, | |
| 7090 | + top: 0 | |
| 7091 | + } : offsetParent.getBoundingClientRect(); | |
| 7092 | + var x = (evt.clientX + offsetParent.scrollLeft - offsetParentRect.left) / scale; | |
| 7093 | + var y = (evt.clientY + offsetParent.scrollTop - offsetParentRect.top) / scale; | |
| 7094 | + return { | |
| 7095 | + x: x, | |
| 7096 | + y: y | |
| 7097 | + }; | |
| 7098 | +} | |
| 7099 | + | |
| 7100 | +function createCSSTransform(controlPos | |
| 7101 | +/*: ControlPosition*/ | |
| 7102 | +, positionOffset | |
| 7103 | +/*: PositionOffsetControlPosition*/ | |
| 7104 | +) | |
| 7105 | +/*: Object*/ | |
| 7106 | +{ | |
| 7107 | + var translation = getTranslation(controlPos, positionOffset, 'px'); | |
| 7108 | + return _defineProperty({}, (0, _getPrefix.browserPrefixToKey)('transform', _getPrefix.default), translation); | |
| 7109 | +} | |
| 7110 | + | |
| 7111 | +function createSVGTransform(controlPos | |
| 7112 | +/*: ControlPosition*/ | |
| 7113 | +, positionOffset | |
| 7114 | +/*: PositionOffsetControlPosition*/ | |
| 7115 | +) | |
| 7116 | +/*: string*/ | |
| 7117 | +{ | |
| 7118 | + var translation = getTranslation(controlPos, positionOffset, ''); | |
| 7119 | + return translation; | |
| 7120 | +} | |
| 7121 | + | |
| 7122 | +function getTranslation(_ref2, positionOffset | |
| 7123 | +/*: PositionOffsetControlPosition*/ | |
| 7124 | +, unitSuffix | |
| 7125 | +/*: string*/ | |
| 7126 | +) | |
| 7127 | +/*: string*/ | |
| 7128 | +{ | |
| 7129 | + var x = _ref2.x, | |
| 7130 | + y = _ref2.y; | |
| 7131 | + var translation = "translate(".concat(x).concat(unitSuffix, ",").concat(y).concat(unitSuffix, ")"); | |
| 7132 | + | |
| 7133 | + if (positionOffset) { | |
| 7134 | + var defaultX = "".concat(typeof positionOffset.x === 'string' ? positionOffset.x : positionOffset.x + unitSuffix); | |
| 7135 | + var defaultY = "".concat(typeof positionOffset.y === 'string' ? positionOffset.y : positionOffset.y + unitSuffix); | |
| 7136 | + translation = "translate(".concat(defaultX, ", ").concat(defaultY, ")") + translation; | |
| 7137 | + } | |
| 7138 | + | |
| 7139 | + return translation; | |
| 7140 | +} | |
| 7141 | + | |
| 7142 | +function getTouch(e | |
| 7143 | +/*: MouseTouchEvent*/ | |
| 7144 | +, identifier | |
| 7145 | +/*: number*/ | |
| 7146 | +) | |
| 7147 | +/*: ?{clientX: number, clientY: number}*/ | |
| 7148 | +{ | |
| 7149 | + return e.targetTouches && (0, _shims.findInArray)(e.targetTouches, function (t) { | |
| 7150 | + return identifier === t.identifier; | |
| 7151 | + }) || e.changedTouches && (0, _shims.findInArray)(e.changedTouches, function (t) { | |
| 7152 | + return identifier === t.identifier; | |
| 7153 | + }); | |
| 7154 | +} | |
| 7155 | + | |
| 7156 | +function getTouchIdentifier(e | |
| 7157 | +/*: MouseTouchEvent*/ | |
| 7158 | +) | |
| 7159 | +/*: ?number*/ | |
| 7160 | +{ | |
| 7161 | + if (e.targetTouches && e.targetTouches[0]) return e.targetTouches[0].identifier; | |
| 7162 | + if (e.changedTouches && e.changedTouches[0]) return e.changedTouches[0].identifier; | |
| 7163 | +} // User-select Hacks: | |
| 7164 | +// | |
| 7165 | +// Useful for preventing blue highlights all over everything when dragging. | |
| 7166 | +// Note we're passing `document` b/c we could be iframed | |
| 7167 | + | |
| 7168 | + | |
| 7169 | +function addUserSelectStyles(doc | |
| 7170 | +/*: ?Document*/ | |
| 7171 | +) { | |
| 7172 | + if (!doc) return; | |
| 7173 | + var styleEl = doc.getElementById('react-draggable-style-el'); | |
| 7174 | + | |
| 7175 | + if (!styleEl) { | |
| 7176 | + styleEl = doc.createElement('style'); | |
| 7177 | + styleEl.type = 'text/css'; | |
| 7178 | + styleEl.id = 'react-draggable-style-el'; | |
| 7179 | + styleEl.innerHTML = '.react-draggable-transparent-selection *::-moz-selection {all: inherit;}\n'; | |
| 7180 | + styleEl.innerHTML += '.react-draggable-transparent-selection *::selection {all: inherit;}\n'; | |
| 7181 | + doc.getElementsByTagName('head')[0].appendChild(styleEl); | |
| 7182 | + } | |
| 7183 | + | |
| 7184 | + if (doc.body) addClassName(doc.body, 'react-draggable-transparent-selection'); | |
| 7185 | +} | |
| 7186 | + | |
| 7187 | +function removeUserSelectStyles(doc | |
| 7188 | +/*: ?Document*/ | |
| 7189 | +) { | |
| 7190 | + if (!doc) return; | |
| 7191 | + | |
| 7192 | + try { | |
| 7193 | + if (doc.body) removeClassName(doc.body, 'react-draggable-transparent-selection'); // $FlowIgnore: IE | |
| 7194 | + | |
| 7195 | + if (doc.selection) { | |
| 7196 | + // $FlowIgnore: IE | |
| 7197 | + doc.selection.empty(); | |
| 7198 | + } else { | |
| 7199 | + // Remove selection caused by scroll, unless it's a focused input | |
| 7200 | + // (we use doc.defaultView in case we're in an iframe) | |
| 7201 | + var selection = (doc.defaultView || window).getSelection(); | |
| 7202 | + | |
| 7203 | + if (selection && selection.type !== 'Caret') { | |
| 7204 | + selection.removeAllRanges(); | |
| 7205 | + } | |
| 7206 | + } | |
| 7207 | + } catch (e) {// probably IE | |
| 7208 | + } | |
| 7209 | +} | |
| 7210 | + | |
| 7211 | +function addClassName(el | |
| 7212 | +/*: HTMLElement*/ | |
| 7213 | +, className | |
| 7214 | +/*: string*/ | |
| 7215 | +) { | |
| 7216 | + if (el.classList) { | |
| 7217 | + el.classList.add(className); | |
| 7218 | + } else { | |
| 7219 | + if (!el.className.match(new RegExp("(?:^|\\s)".concat(className, "(?!\\S)")))) { | |
| 7220 | + el.className += " ".concat(className); | |
| 7221 | + } | |
| 7222 | + } | |
| 7223 | +} | |
| 7224 | + | |
| 7225 | +function removeClassName(el | |
| 7226 | +/*: HTMLElement*/ | |
| 7227 | +, className | |
| 7228 | +/*: string*/ | |
| 7229 | +) { | |
| 7230 | + if (el.classList) { | |
| 7231 | + el.classList.remove(className); | |
| 7232 | + } else { | |
| 7233 | + el.className = el.className.replace(new RegExp("(?:^|\\s)".concat(className, "(?!\\S)"), 'g'), ''); | |
| 7234 | + } | |
| 7235 | +} | |
| 7236 | + | |
| 7237 | +/***/ }), | |
| 7238 | + | |
| 7239 | +/***/ "../node_modules/react-draggable/build/cjs/utils/getPrefix.js": | |
| 7240 | +/*!********************************************************************!*\ | |
| 7241 | + !*** ../node_modules/react-draggable/build/cjs/utils/getPrefix.js ***! | |
| 7242 | + \********************************************************************/ | |
| 7243 | +/***/ ((__unused_webpack_module, exports) => { | |
| 7244 | + | |
| 7245 | +"use strict"; | |
| 7246 | + | |
| 7247 | + | |
| 7248 | +Object.defineProperty(exports, "__esModule", ({ | |
| 7249 | + value: true | |
| 7250 | +})); | |
| 7251 | +exports.browserPrefixToKey = browserPrefixToKey; | |
| 7252 | +exports.browserPrefixToStyle = browserPrefixToStyle; | |
| 7253 | +exports["default"] = void 0; | |
| 7254 | +exports.getPrefix = getPrefix; | |
| 7255 | +var prefixes = ['Moz', 'Webkit', 'O', 'ms']; | |
| 7256 | + | |
| 7257 | +function getPrefix() | |
| 7258 | +/*: string*/ | |
| 7259 | +{ | |
| 7260 | + var _window$document, _window$document$docu; | |
| 7261 | + | |
| 7262 | + var prop | |
| 7263 | + /*: string*/ | |
| 7264 | + = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'transform'; | |
| 7265 | + // Ensure we're running in an environment where there is actually a global | |
| 7266 | + // `window` obj | |
| 7267 | + if (typeof window === 'undefined') return ''; // If we're in a pseudo-browser server-side environment, this access | |
| 7268 | + // path may not exist, so bail out if it doesn't. | |
| 7269 | + | |
| 7270 | + var style = (_window$document = window.document) === null || _window$document === void 0 ? void 0 : (_window$document$docu = _window$document.documentElement) === null || _window$document$docu === void 0 ? void 0 : _window$document$docu.style; | |
| 7271 | + if (!style) return ''; | |
| 7272 | + if (prop in style) return ''; | |
| 7273 | + | |
| 7274 | + for (var i = 0; i < prefixes.length; i++) { | |
| 7275 | + if (browserPrefixToKey(prop, prefixes[i]) in style) return prefixes[i]; | |
| 7276 | + } | |
| 7277 | + | |
| 7278 | + return ''; | |
| 7279 | +} | |
| 7280 | + | |
| 7281 | +function browserPrefixToKey(prop | |
| 7282 | +/*: string*/ | |
| 7283 | +, prefix | |
| 7284 | +/*: string*/ | |
| 7285 | +) | |
| 7286 | +/*: string*/ | |
| 7287 | +{ | |
| 7288 | + return prefix ? "".concat(prefix).concat(kebabToTitleCase(prop)) : prop; | |
| 7289 | +} | |
| 7290 | + | |
| 7291 | +function browserPrefixToStyle(prop | |
| 7292 | +/*: string*/ | |
| 7293 | +, prefix | |
| 7294 | +/*: string*/ | |
| 7295 | +) | |
| 7296 | +/*: string*/ | |
| 7297 | +{ | |
| 7298 | + return prefix ? "-".concat(prefix.toLowerCase(), "-").concat(prop) : prop; | |
| 7299 | +} | |
| 7300 | + | |
| 7301 | +function kebabToTitleCase(str | |
| 7302 | +/*: string*/ | |
| 7303 | +) | |
| 7304 | +/*: string*/ | |
| 7305 | +{ | |
| 7306 | + var out = ''; | |
| 7307 | + var shouldCapitalize = true; | |
| 7308 | + | |
| 7309 | + for (var i = 0; i < str.length; i++) { | |
| 7310 | + if (shouldCapitalize) { | |
| 7311 | + out += str[i].toUpperCase(); | |
| 7312 | + shouldCapitalize = false; | |
| 7313 | + } else if (str[i] === '-') { | |
| 7314 | + shouldCapitalize = true; | |
| 7315 | + } else { | |
| 7316 | + out += str[i]; | |
| 7317 | + } | |
| 7318 | + } | |
| 7319 | + | |
| 7320 | + return out; | |
| 7321 | +} // Default export is the prefix itself, like 'Moz', 'Webkit', etc | |
| 7322 | +// Note that you may have to re-test for certain things; for instance, Chrome 50 | |
| 7323 | +// can handle unprefixed `transform`, but not unprefixed `user-select` | |
| 7324 | + | |
| 7325 | + | |
| 7326 | +var _default = (getPrefix() | |
| 7327 | +/*: string*/ | |
| 7328 | +); | |
| 7329 | + | |
| 7330 | +exports["default"] = _default; | |
| 7331 | + | |
| 7332 | +/***/ }), | |
| 7333 | + | |
| 7334 | +/***/ "../node_modules/react-draggable/build/cjs/utils/log.js": | |
| 7335 | +/*!**************************************************************!*\ | |
| 7336 | + !*** ../node_modules/react-draggable/build/cjs/utils/log.js ***! | |
| 7337 | + \**************************************************************/ | |
| 7338 | +/***/ ((__unused_webpack_module, exports) => { | |
| 7339 | + | |
| 7340 | +"use strict"; | |
| 7341 | + | |
| 7342 | + | |
| 7343 | +Object.defineProperty(exports, "__esModule", ({ | |
| 7344 | + value: true | |
| 7345 | +})); | |
| 7346 | +exports["default"] = log; | |
| 7347 | + | |
| 7348 | +/*eslint no-console:0*/ | |
| 7349 | +function log() { | |
| 7350 | + var _console; | |
| 7351 | + | |
| 7352 | + if (false) {} | |
| 7353 | +} | |
| 7354 | + | |
| 7355 | +/***/ }), | |
| 7356 | + | |
| 7357 | +/***/ "../node_modules/react-draggable/build/cjs/utils/positionFns.js": | |
| 7358 | +/*!**********************************************************************!*\ | |
| 7359 | + !*** ../node_modules/react-draggable/build/cjs/utils/positionFns.js ***! | |
| 7360 | + \**********************************************************************/ | |
| 7361 | +/***/ ((__unused_webpack_module, exports, __webpack_require__) => { | |
| 7362 | + | |
| 7363 | +"use strict"; | |
| 7364 | + | |
| 7365 | + | |
| 7366 | +Object.defineProperty(exports, "__esModule", ({ | |
| 7367 | + value: true | |
| 7368 | +})); | |
| 7369 | +exports.canDragX = canDragX; | |
| 7370 | +exports.canDragY = canDragY; | |
| 7371 | +exports.createCoreData = createCoreData; | |
| 7372 | +exports.createDraggableData = createDraggableData; | |
| 7373 | +exports.getBoundPosition = getBoundPosition; | |
| 7374 | +exports.getControlPosition = getControlPosition; | |
| 7375 | +exports.snapToGrid = snapToGrid; | |
| 7376 | + | |
| 7377 | +var _shims = __webpack_require__(/*! ./shims */ "../node_modules/react-draggable/build/cjs/utils/shims.js"); | |
| 7378 | + | |
| 7379 | +var _domFns = __webpack_require__(/*! ./domFns */ "../node_modules/react-draggable/build/cjs/utils/domFns.js"); | |
| 7380 | + | |
| 7381 | +function getBoundPosition(draggable | |
| 7382 | +/*: Draggable*/ | |
| 7383 | +, x | |
| 7384 | +/*: number*/ | |
| 7385 | +, y | |
| 7386 | +/*: number*/ | |
| 7387 | +) | |
| 7388 | +/*: [number, number]*/ | |
| 7389 | +{ | |
| 7390 | + // If no bounds, short-circuit and move on | |
| 7391 | + if (!draggable.props.bounds) return [x, y]; // Clone new bounds | |
| 7392 | + | |
| 7393 | + var bounds = draggable.props.bounds; | |
| 7394 | + bounds = typeof bounds === 'string' ? bounds : cloneBounds(bounds); | |
| 7395 | + var node = findDOMNode(draggable); | |
| 7396 | + | |
| 7397 | + if (typeof bounds === 'string') { | |
| 7398 | + var ownerDocument = node.ownerDocument; | |
| 7399 | + var ownerWindow = ownerDocument.defaultView; | |
| 7400 | + var boundNode; | |
| 7401 | + | |
| 7402 | + if (bounds === 'parent') { | |
| 7403 | + boundNode = node.parentNode; | |
| 7404 | + } else { | |
| 7405 | + boundNode = ownerDocument.querySelector(bounds); | |
| 7406 | + } | |
| 7407 | + | |
| 7408 | + if (!(boundNode instanceof ownerWindow.HTMLElement)) { | |
| 7409 | + throw new Error('Bounds selector "' + bounds + '" could not find an element.'); | |
| 7410 | + } | |
| 7411 | + | |
| 7412 | + var boundNodeEl | |
| 7413 | + /*: HTMLElement*/ | |
| 7414 | + = boundNode; // for Flow, can't seem to refine correctly | |
| 7415 | + | |
| 7416 | + var nodeStyle = ownerWindow.getComputedStyle(node); | |
| 7417 | + var boundNodeStyle = ownerWindow.getComputedStyle(boundNodeEl); // Compute bounds. This is a pain with padding and offsets but this gets it exactly right. | |
| 7418 | + | |
| 7419 | + bounds = { | |
| 7420 | + left: -node.offsetLeft + (0, _shims.int)(boundNodeStyle.paddingLeft) + (0, _shims.int)(nodeStyle.marginLeft), | |
| 7421 | + top: -node.offsetTop + (0, _shims.int)(boundNodeStyle.paddingTop) + (0, _shims.int)(nodeStyle.marginTop), | |
| 7422 | + right: (0, _domFns.innerWidth)(boundNodeEl) - (0, _domFns.outerWidth)(node) - node.offsetLeft + (0, _shims.int)(boundNodeStyle.paddingRight) - (0, _shims.int)(nodeStyle.marginRight), | |
| 7423 | + bottom: (0, _domFns.innerHeight)(boundNodeEl) - (0, _domFns.outerHeight)(node) - node.offsetTop + (0, _shims.int)(boundNodeStyle.paddingBottom) - (0, _shims.int)(nodeStyle.marginBottom) | |
| 7424 | + }; | |
| 7425 | + } // Keep x and y below right and bottom limits... | |
| 7426 | + | |
| 7427 | + | |
| 7428 | + if ((0, _shims.isNum)(bounds.right)) x = Math.min(x, bounds.right); | |
| 7429 | + if ((0, _shims.isNum)(bounds.bottom)) y = Math.min(y, bounds.bottom); // But above left and top limits. | |
| 7430 | + | |
| 7431 | + if ((0, _shims.isNum)(bounds.left)) x = Math.max(x, bounds.left); | |
| 7432 | + if ((0, _shims.isNum)(bounds.top)) y = Math.max(y, bounds.top); | |
| 7433 | + return [x, y]; | |
| 7434 | +} | |
| 7435 | + | |
| 7436 | +function snapToGrid(grid | |
| 7437 | +/*: [number, number]*/ | |
| 7438 | +, pendingX | |
| 7439 | +/*: number*/ | |
| 7440 | +, pendingY | |
| 7441 | +/*: number*/ | |
| 7442 | +) | |
| 7443 | +/*: [number, number]*/ | |
| 7444 | +{ | |
| 7445 | + var x = Math.round(pendingX / grid[0]) * grid[0]; | |
| 7446 | + var y = Math.round(pendingY / grid[1]) * grid[1]; | |
| 7447 | + return [x, y]; | |
| 7448 | +} | |
| 7449 | + | |
| 7450 | +function canDragX(draggable | |
| 7451 | +/*: Draggable*/ | |
| 7452 | +) | |
| 7453 | +/*: boolean*/ | |
| 7454 | +{ | |
| 7455 | + return draggable.props.axis === 'both' || draggable.props.axis === 'x'; | |
| 7456 | +} | |
| 7457 | + | |
| 7458 | +function canDragY(draggable | |
| 7459 | +/*: Draggable*/ | |
| 7460 | +) | |
| 7461 | +/*: boolean*/ | |
| 7462 | +{ | |
| 7463 | + return draggable.props.axis === 'both' || draggable.props.axis === 'y'; | |
| 7464 | +} // Get {x, y} positions from event. | |
| 7465 | + | |
| 7466 | + | |
| 7467 | +function getControlPosition(e | |
| 7468 | +/*: MouseTouchEvent*/ | |
| 7469 | +, touchIdentifier | |
| 7470 | +/*: ?number*/ | |
| 7471 | +, draggableCore | |
| 7472 | +/*: DraggableCore*/ | |
| 7473 | +) | |
| 7474 | +/*: ?ControlPosition*/ | |
| 7475 | +{ | |
| 7476 | + var touchObj = typeof touchIdentifier === 'number' ? (0, _domFns.getTouch)(e, touchIdentifier) : null; | |
| 7477 | + if (typeof touchIdentifier === 'number' && !touchObj) return null; // not the right touch | |
| 7478 | + | |
| 7479 | + var node = findDOMNode(draggableCore); // User can provide an offsetParent if desired. | |
| 7480 | + | |
| 7481 | + var offsetParent = draggableCore.props.offsetParent || node.offsetParent || node.ownerDocument.body; | |
| 7482 | + return (0, _domFns.offsetXYFromParent)(touchObj || e, offsetParent, draggableCore.props.scale); | |
| 7483 | +} // Create an data object exposed by <DraggableCore>'s events | |
| 7484 | + | |
| 7485 | + | |
| 7486 | +function createCoreData(draggable | |
| 7487 | +/*: DraggableCore*/ | |
| 7488 | +, x | |
| 7489 | +/*: number*/ | |
| 7490 | +, y | |
| 7491 | +/*: number*/ | |
| 7492 | +) | |
| 7493 | +/*: DraggableData*/ | |
| 7494 | +{ | |
| 7495 | + var state = draggable.state; | |
| 7496 | + var isStart = !(0, _shims.isNum)(state.lastX); | |
| 7497 | + var node = findDOMNode(draggable); | |
| 7498 | + | |
| 7499 | + if (isStart) { | |
| 7500 | + // If this is our first move, use the x and y as last coords. | |
| 7501 | + return { | |
| 7502 | + node: node, | |
| 7503 | + deltaX: 0, | |
| 7504 | + deltaY: 0, | |
| 7505 | + lastX: x, | |
| 7506 | + lastY: y, | |
| 7507 | + x: x, | |
| 7508 | + y: y | |
| 7509 | + }; | |
| 7510 | + } else { | |
| 7511 | + // Otherwise calculate proper values. | |
| 7512 | + return { | |
| 7513 | + node: node, | |
| 7514 | + deltaX: x - state.lastX, | |
| 7515 | + deltaY: y - state.lastY, | |
| 7516 | + lastX: state.lastX, | |
| 7517 | + lastY: state.lastY, | |
| 7518 | + x: x, | |
| 7519 | + y: y | |
| 7520 | + }; | |
| 7521 | + } | |
| 7522 | +} // Create an data exposed by <Draggable>'s events | |
| 7523 | + | |
| 7524 | + | |
| 7525 | +function createDraggableData(draggable | |
| 7526 | +/*: Draggable*/ | |
| 7527 | +, coreData | |
| 7528 | +/*: DraggableData*/ | |
| 7529 | +) | |
| 7530 | +/*: DraggableData*/ | |
| 7531 | +{ | |
| 7532 | + var scale = draggable.props.scale; | |
| 7533 | + return { | |
| 7534 | + node: coreData.node, | |
| 7535 | + x: draggable.state.x + coreData.deltaX / scale, | |
| 7536 | + y: draggable.state.y + coreData.deltaY / scale, | |
| 7537 | + deltaX: coreData.deltaX / scale, | |
| 7538 | + deltaY: coreData.deltaY / scale, | |
| 7539 | + lastX: draggable.state.x, | |
| 7540 | + lastY: draggable.state.y | |
| 7541 | + }; | |
| 7542 | +} // A lot faster than stringify/parse | |
| 7543 | + | |
| 7544 | + | |
| 7545 | +function cloneBounds(bounds | |
| 7546 | +/*: Bounds*/ | |
| 7547 | +) | |
| 7548 | +/*: Bounds*/ | |
| 7549 | +{ | |
| 7550 | + return { | |
| 7551 | + left: bounds.left, | |
| 7552 | + top: bounds.top, | |
| 7553 | + right: bounds.right, | |
| 7554 | + bottom: bounds.bottom | |
| 7555 | + }; | |
| 7556 | +} | |
| 7557 | + | |
| 7558 | +function findDOMNode(draggable | |
| 7559 | +/*: Draggable | DraggableCore*/ | |
| 7560 | +) | |
| 7561 | +/*: HTMLElement*/ | |
| 7562 | +{ | |
| 7563 | + var node = draggable.findDOMNode(); | |
| 7564 | + | |
| 7565 | + if (!node) { | |
| 7566 | + throw new Error('<DraggableCore>: Unmounted during event!'); | |
| 7567 | + } // $FlowIgnore we can't assert on HTMLElement due to tests... FIXME | |
| 7568 | + | |
| 7569 | + | |
| 7570 | + return node; | |
| 7571 | +} | |
| 7572 | + | |
| 7573 | +/***/ }), | |
| 7574 | + | |
| 7575 | +/***/ "../node_modules/react-draggable/build/cjs/utils/shims.js": | |
| 7576 | +/*!****************************************************************!*\ | |
| 7577 | + !*** ../node_modules/react-draggable/build/cjs/utils/shims.js ***! | |
| 7578 | + \****************************************************************/ | |
| 7579 | +/***/ ((__unused_webpack_module, exports) => { | |
| 7580 | + | |
| 7581 | +"use strict"; | |
| 7582 | + | |
| 7583 | + | |
| 7584 | +Object.defineProperty(exports, "__esModule", ({ | |
| 7585 | + value: true | |
| 7586 | +})); | |
| 7587 | +exports.dontSetMe = dontSetMe; | |
| 7588 | +exports.findInArray = findInArray; | |
| 7589 | +exports.int = int; | |
| 7590 | +exports.isFunction = isFunction; | |
| 7591 | +exports.isNum = isNum; | |
| 7592 | + | |
| 7593 | +// @credits https://gist.github.com/rogozhnikoff/a43cfed27c41e4e68cdc | |
| 7594 | +function findInArray(array | |
| 7595 | +/*: Array<any> | TouchList*/ | |
| 7596 | +, callback | |
| 7597 | +/*: Function*/ | |
| 7598 | +) | |
| 7599 | +/*: any*/ | |
| 7600 | +{ | |
| 7601 | + for (var i = 0, length = array.length; i < length; i++) { | |
| 7602 | + if (callback.apply(callback, [array[i], i, array])) return array[i]; | |
| 7603 | + } | |
| 7604 | +} | |
| 7605 | + | |
| 7606 | +function isFunction(func | |
| 7607 | +/*: any*/ | |
| 7608 | +) | |
| 7609 | +/*: boolean %checks*/ | |
| 7610 | +{ | |
| 7611 | + // $FlowIgnore[method-unbinding] | |
| 7612 | + return typeof func === 'function' || Object.prototype.toString.call(func) === '[object Function]'; | |
| 7613 | +} | |
| 7614 | + | |
| 7615 | +function isNum(num | |
| 7616 | +/*: any*/ | |
| 7617 | +) | |
| 7618 | +/*: boolean %checks*/ | |
| 7619 | +{ | |
| 7620 | + return typeof num === 'number' && !isNaN(num); | |
| 7621 | +} | |
| 7622 | + | |
| 7623 | +function int(a | |
| 7624 | +/*: string*/ | |
| 7625 | +) | |
| 7626 | +/*: number*/ | |
| 7627 | +{ | |
| 7628 | + return parseInt(a, 10); | |
| 7629 | +} | |
| 7630 | + | |
| 7631 | +function dontSetMe(props | |
| 7632 | +/*: Object*/ | |
| 7633 | +, propName | |
| 7634 | +/*: string*/ | |
| 7635 | +, componentName | |
| 7636 | +/*: string*/ | |
| 7637 | +) | |
| 7638 | +/*: ?Error*/ | |
| 7639 | +{ | |
| 7640 | + if (props[propName]) { | |
| 7641 | + return new Error("Invalid prop ".concat(propName, " passed to ").concat(componentName, " - do not set this, set it on the child.")); | |
| 7642 | + } | |
| 7643 | +} | |
| 7644 | + | |
| 7645 | +/***/ }), | |
| 7646 | + | |
| 7647 | +/***/ "react": | |
| 7648 | +/*!************************!*\ | |
| 7649 | + !*** external "React" ***! | |
| 7650 | + \************************/ | |
| 7651 | +/***/ ((module) => { | |
| 7652 | + | |
| 7653 | +"use strict"; | |
| 7654 | +module.exports = React; | |
| 7655 | + | |
| 7656 | +/***/ }), | |
| 7657 | + | |
| 7658 | +/***/ "react-dom": | |
| 7659 | +/*!***************************!*\ | |
| 7660 | + !*** external "ReactDOM" ***! | |
| 7661 | + \***************************/ | |
| 7662 | +/***/ ((module) => { | |
| 7663 | + | |
| 7664 | +"use strict"; | |
| 7665 | +module.exports = ReactDOM; | |
| 7666 | + | |
| 7667 | +/***/ }), | |
| 7668 | + | |
| 7669 | +/***/ "@elementor/icons": | |
| 7670 | +/*!************************************!*\ | |
| 7671 | + !*** external "elementorV2.icons" ***! | |
| 7672 | + \************************************/ | |
| 7673 | +/***/ ((module) => { | |
| 7674 | + | |
| 7675 | +"use strict"; | |
| 7676 | +module.exports = elementorV2.icons; | |
| 7677 | + | |
| 7678 | +/***/ }), | |
| 7679 | + | |
| 7680 | +/***/ "@elementor/ui": | |
| 7681 | +/*!*********************************!*\ | |
| 7682 | + !*** external "elementorV2.ui" ***! | |
| 7683 | + \*********************************/ | |
| 7684 | +/***/ ((module) => { | |
| 7685 | + | |
| 7686 | +"use strict"; | |
| 7687 | +module.exports = elementorV2.ui; | |
| 7688 | + | |
| 7689 | +/***/ }), | |
| 7690 | + | |
| 7691 | +/***/ "@wordpress/i18n": | |
| 7692 | +/*!**************************!*\ | |
| 7693 | + !*** external "wp.i18n" ***! | |
| 7694 | + \**************************/ | |
| 7695 | +/***/ ((module) => { | |
| 7696 | + | |
| 7697 | +"use strict"; | |
| 7698 | +module.exports = wp.i18n; | |
| 7699 | + | |
| 7700 | +/***/ }), | |
| 7701 | + | |
| 7702 | +/***/ "../node_modules/@babel/runtime/helpers/arrayLikeToArray.js": | |
| 7703 | +/*!******************************************************************!*\ | |
| 7704 | + !*** ../node_modules/@babel/runtime/helpers/arrayLikeToArray.js ***! | |
| 7705 | + \******************************************************************/ | |
| 7706 | +/***/ ((module) => { | |
| 7707 | + | |
| 7708 | +function _arrayLikeToArray(arr, len) { | |
| 7709 | + if (len == null || len > arr.length) len = arr.length; | |
| 7710 | + for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; | |
| 7711 | + return arr2; | |
| 7712 | +} | |
| 7713 | +module.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 7714 | + | |
| 7715 | +/***/ }), | |
| 7716 | + | |
| 7717 | +/***/ "../node_modules/@babel/runtime/helpers/arrayWithHoles.js": | |
| 7718 | +/*!****************************************************************!*\ | |
| 7719 | + !*** ../node_modules/@babel/runtime/helpers/arrayWithHoles.js ***! | |
| 7720 | + \****************************************************************/ | |
| 7721 | +/***/ ((module) => { | |
| 7722 | + | |
| 7723 | +function _arrayWithHoles(arr) { | |
| 7724 | + if (Array.isArray(arr)) return arr; | |
| 7725 | +} | |
| 7726 | +module.exports = _arrayWithHoles, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 7727 | + | |
| 7728 | +/***/ }), | |
| 7729 | + | |
| 7730 | +/***/ "../node_modules/@babel/runtime/helpers/arrayWithoutHoles.js": | |
| 7731 | +/*!*******************************************************************!*\ | |
| 7732 | + !*** ../node_modules/@babel/runtime/helpers/arrayWithoutHoles.js ***! | |
| 7733 | + \*******************************************************************/ | |
| 7734 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 7735 | + | |
| 7736 | +var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray.js */ "../node_modules/@babel/runtime/helpers/arrayLikeToArray.js"); | |
| 7737 | +function _arrayWithoutHoles(arr) { | |
| 7738 | + if (Array.isArray(arr)) return arrayLikeToArray(arr); | |
| 7739 | +} | |
| 7740 | +module.exports = _arrayWithoutHoles, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 7741 | + | |
| 7742 | +/***/ }), | |
| 7743 | + | |
| 7744 | +/***/ "../node_modules/@babel/runtime/helpers/assertThisInitialized.js": | |
| 7745 | +/*!***********************************************************************!*\ | |
| 7746 | + !*** ../node_modules/@babel/runtime/helpers/assertThisInitialized.js ***! | |
| 7747 | + \***********************************************************************/ | |
| 7748 | +/***/ ((module) => { | |
| 7749 | + | |
| 7750 | +function _assertThisInitialized(self) { | |
| 7751 | + if (self === void 0) { | |
| 7752 | + throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); | |
| 7753 | + } | |
| 7754 | + return self; | |
| 7755 | +} | |
| 7756 | +module.exports = _assertThisInitialized, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 7757 | + | |
| 7758 | +/***/ }), | |
| 7759 | + | |
| 7760 | +/***/ "../node_modules/@babel/runtime/helpers/asyncToGenerator.js": | |
| 7761 | +/*!******************************************************************!*\ | |
| 7762 | + !*** ../node_modules/@babel/runtime/helpers/asyncToGenerator.js ***! | |
| 7763 | + \******************************************************************/ | |
| 7764 | +/***/ ((module) => { | |
| 7765 | + | |
| 7766 | +function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { | |
| 7767 | + try { | |
| 7768 | + var info = gen[key](arg); | |
| 7769 | + var value = info.value; | |
| 7770 | + } catch (error) { | |
| 7771 | + reject(error); | |
| 7772 | + return; | |
| 7773 | + } | |
| 7774 | + if (info.done) { | |
| 7775 | + resolve(value); | |
| 7776 | + } else { | |
| 7777 | + Promise.resolve(value).then(_next, _throw); | |
| 7778 | + } | |
| 7779 | +} | |
| 7780 | +function _asyncToGenerator(fn) { | |
| 7781 | + return function () { | |
| 7782 | + var self = this, | |
| 7783 | + args = arguments; | |
| 7784 | + return new Promise(function (resolve, reject) { | |
| 7785 | + var gen = fn.apply(self, args); | |
| 7786 | + function _next(value) { | |
| 7787 | + asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); | |
| 7788 | + } | |
| 7789 | + function _throw(err) { | |
| 7790 | + asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); | |
| 7791 | + } | |
| 7792 | + _next(undefined); | |
| 7793 | + }); | |
| 7794 | + }; | |
| 7795 | +} | |
| 7796 | +module.exports = _asyncToGenerator, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 7797 | + | |
| 7798 | +/***/ }), | |
| 7799 | + | |
| 7800 | +/***/ "../node_modules/@babel/runtime/helpers/classCallCheck.js": | |
| 7801 | +/*!****************************************************************!*\ | |
| 7802 | + !*** ../node_modules/@babel/runtime/helpers/classCallCheck.js ***! | |
| 7803 | + \****************************************************************/ | |
| 7804 | +/***/ ((module) => { | |
| 7805 | + | |
| 7806 | +function _classCallCheck(instance, Constructor) { | |
| 7807 | + if (!(instance instanceof Constructor)) { | |
| 7808 | + throw new TypeError("Cannot call a class as a function"); | |
| 7809 | + } | |
| 7810 | +} | |
| 7811 | +module.exports = _classCallCheck, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 7812 | + | |
| 7813 | +/***/ }), | |
| 7814 | + | |
| 7815 | +/***/ "../node_modules/@babel/runtime/helpers/createClass.js": | |
| 7816 | +/*!*************************************************************!*\ | |
| 7817 | + !*** ../node_modules/@babel/runtime/helpers/createClass.js ***! | |
| 7818 | + \*************************************************************/ | |
| 7819 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 7820 | + | |
| 7821 | +var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ "../node_modules/@babel/runtime/helpers/toPropertyKey.js"); | |
| 7822 | +function _defineProperties(target, props) { | |
| 7823 | + for (var i = 0; i < props.length; i++) { | |
| 7824 | + var descriptor = props[i]; | |
| 7825 | + descriptor.enumerable = descriptor.enumerable || false; | |
| 7826 | + descriptor.configurable = true; | |
| 7827 | + if ("value" in descriptor) descriptor.writable = true; | |
| 7828 | + Object.defineProperty(target, toPropertyKey(descriptor.key), descriptor); | |
| 7829 | + } | |
| 7830 | +} | |
| 7831 | +function _createClass(Constructor, protoProps, staticProps) { | |
| 7832 | + if (protoProps) _defineProperties(Constructor.prototype, protoProps); | |
| 7833 | + if (staticProps) _defineProperties(Constructor, staticProps); | |
| 7834 | + Object.defineProperty(Constructor, "prototype", { | |
| 7835 | + writable: false | |
| 7836 | + }); | |
| 7837 | + return Constructor; | |
| 7838 | +} | |
| 7839 | +module.exports = _createClass, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 7840 | + | |
| 7841 | +/***/ }), | |
| 7842 | + | |
| 7843 | +/***/ "../node_modules/@babel/runtime/helpers/defineProperty.js": | |
| 7844 | +/*!****************************************************************!*\ | |
| 7845 | + !*** ../node_modules/@babel/runtime/helpers/defineProperty.js ***! | |
| 7846 | + \****************************************************************/ | |
| 7847 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 7848 | + | |
| 7849 | +var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ "../node_modules/@babel/runtime/helpers/toPropertyKey.js"); | |
| 7850 | +function _defineProperty(obj, key, value) { | |
| 7851 | + key = toPropertyKey(key); | |
| 7852 | + if (key in obj) { | |
| 7853 | + Object.defineProperty(obj, key, { | |
| 7854 | + value: value, | |
| 7855 | + enumerable: true, | |
| 7856 | + configurable: true, | |
| 7857 | + writable: true | |
| 7858 | + }); | |
| 7859 | + } else { | |
| 7860 | + obj[key] = value; | |
| 7861 | + } | |
| 7862 | + return obj; | |
| 7863 | +} | |
| 7864 | +module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 7865 | + | |
| 7866 | +/***/ }), | |
| 7867 | + | |
| 7868 | +/***/ "../node_modules/@babel/runtime/helpers/extends.js": | |
| 7869 | +/*!*********************************************************!*\ | |
| 7870 | + !*** ../node_modules/@babel/runtime/helpers/extends.js ***! | |
| 7871 | + \*********************************************************/ | |
| 7872 | +/***/ ((module) => { | |
| 7873 | + | |
| 7874 | +function _extends() { | |
| 7875 | + module.exports = _extends = Object.assign ? Object.assign.bind() : function (target) { | |
| 7876 | + for (var i = 1; i < arguments.length; i++) { | |
| 7877 | + var source = arguments[i]; | |
| 7878 | + for (var key in source) { | |
| 7879 | + if (Object.prototype.hasOwnProperty.call(source, key)) { | |
| 7880 | + target[key] = source[key]; | |
| 7881 | + } | |
| 7882 | + } | |
| 7883 | + } | |
| 7884 | + return target; | |
| 7885 | + }, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 7886 | + return _extends.apply(this, arguments); | |
| 7887 | +} | |
| 7888 | +module.exports = _extends, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 7889 | + | |
| 7890 | +/***/ }), | |
| 7891 | + | |
| 7892 | +/***/ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js": | |
| 7893 | +/*!****************************************************************!*\ | |
| 7894 | + !*** ../node_modules/@babel/runtime/helpers/getPrototypeOf.js ***! | |
| 7895 | + \****************************************************************/ | |
| 7896 | +/***/ ((module) => { | |
| 7897 | + | |
| 7898 | +function _getPrototypeOf(o) { | |
| 7899 | + module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { | |
| 7900 | + return o.__proto__ || Object.getPrototypeOf(o); | |
| 7901 | + }, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 7902 | + return _getPrototypeOf(o); | |
| 7903 | +} | |
| 7904 | +module.exports = _getPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 7905 | + | |
| 7906 | +/***/ }), | |
| 7907 | + | |
| 7908 | +/***/ "../node_modules/@babel/runtime/helpers/inherits.js": | |
| 7909 | +/*!**********************************************************!*\ | |
| 7910 | + !*** ../node_modules/@babel/runtime/helpers/inherits.js ***! | |
| 7911 | + \**********************************************************/ | |
| 7912 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 7913 | + | |
| 7914 | +var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ "../node_modules/@babel/runtime/helpers/setPrototypeOf.js"); | |
| 7915 | +function _inherits(subClass, superClass) { | |
| 7916 | + if (typeof superClass !== "function" && superClass !== null) { | |
| 7917 | + throw new TypeError("Super expression must either be null or a function"); | |
| 7918 | + } | |
| 7919 | + subClass.prototype = Object.create(superClass && superClass.prototype, { | |
| 7920 | + constructor: { | |
| 7921 | + value: subClass, | |
| 7922 | + writable: true, | |
| 7923 | + configurable: true | |
| 7924 | + } | |
| 7925 | + }); | |
| 7926 | + Object.defineProperty(subClass, "prototype", { | |
| 7927 | + writable: false | |
| 7928 | + }); | |
| 7929 | + if (superClass) setPrototypeOf(subClass, superClass); | |
| 7930 | +} | |
| 7931 | +module.exports = _inherits, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 7932 | + | |
| 7933 | +/***/ }), | |
| 7934 | + | |
| 7935 | +/***/ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js": | |
| 7936 | +/*!***********************************************************************!*\ | |
| 7937 | + !*** ../node_modules/@babel/runtime/helpers/interopRequireDefault.js ***! | |
| 7938 | + \***********************************************************************/ | |
| 7939 | +/***/ ((module) => { | |
| 7940 | + | |
| 7941 | +function _interopRequireDefault(obj) { | |
| 7942 | + return obj && obj.__esModule ? obj : { | |
| 7943 | + "default": obj | |
| 7944 | + }; | |
| 7945 | +} | |
| 7946 | +module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 7947 | + | |
| 7948 | +/***/ }), | |
| 7949 | + | |
| 7950 | +/***/ "../node_modules/@babel/runtime/helpers/iterableToArray.js": | |
| 7951 | +/*!*****************************************************************!*\ | |
| 7952 | + !*** ../node_modules/@babel/runtime/helpers/iterableToArray.js ***! | |
| 7953 | + \*****************************************************************/ | |
| 7954 | +/***/ ((module) => { | |
| 7955 | + | |
| 7956 | +function _iterableToArray(iter) { | |
| 7957 | + if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); | |
| 7958 | +} | |
| 7959 | +module.exports = _iterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 7960 | + | |
| 7961 | +/***/ }), | |
| 7962 | + | |
| 7963 | +/***/ "../node_modules/@babel/runtime/helpers/iterableToArrayLimit.js": | |
| 7964 | +/*!**********************************************************************!*\ | |
| 7965 | + !*** ../node_modules/@babel/runtime/helpers/iterableToArrayLimit.js ***! | |
| 7966 | + \**********************************************************************/ | |
| 7967 | +/***/ ((module) => { | |
| 7968 | + | |
| 7969 | +function _iterableToArrayLimit(arr, i) { | |
| 7970 | + var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; | |
| 7971 | + if (null != _i) { | |
| 7972 | + var _s, | |
| 7973 | + _e, | |
| 7974 | + _x, | |
| 7975 | + _r, | |
| 7976 | + _arr = [], | |
| 7977 | + _n = !0, | |
| 7978 | + _d = !1; | |
| 7979 | + try { | |
| 7980 | + if (_x = (_i = _i.call(arr)).next, 0 === i) { | |
| 7981 | + if (Object(_i) !== _i) return; | |
| 7982 | + _n = !1; | |
| 7983 | + } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); | |
| 7984 | + } catch (err) { | |
| 7985 | + _d = !0, _e = err; | |
| 7986 | + } finally { | |
| 7987 | + try { | |
| 7988 | + if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; | |
| 7989 | + } finally { | |
| 7990 | + if (_d) throw _e; | |
| 7991 | + } | |
| 7992 | + } | |
| 7993 | + return _arr; | |
| 7994 | + } | |
| 7995 | +} | |
| 7996 | +module.exports = _iterableToArrayLimit, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 7997 | + | |
| 7998 | +/***/ }), | |
| 7999 | + | |
| 8000 | +/***/ "../node_modules/@babel/runtime/helpers/nonIterableRest.js": | |
| 8001 | +/*!*****************************************************************!*\ | |
| 8002 | + !*** ../node_modules/@babel/runtime/helpers/nonIterableRest.js ***! | |
| 8003 | + \*****************************************************************/ | |
| 8004 | +/***/ ((module) => { | |
| 8005 | + | |
| 8006 | +function _nonIterableRest() { | |
| 8007 | + throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); | |
| 8008 | +} | |
| 8009 | +module.exports = _nonIterableRest, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 8010 | + | |
| 8011 | +/***/ }), | |
| 8012 | + | |
| 8013 | +/***/ "../node_modules/@babel/runtime/helpers/nonIterableSpread.js": | |
| 8014 | +/*!*******************************************************************!*\ | |
| 8015 | + !*** ../node_modules/@babel/runtime/helpers/nonIterableSpread.js ***! | |
| 8016 | + \*******************************************************************/ | |
| 8017 | +/***/ ((module) => { | |
| 8018 | + | |
| 8019 | +function _nonIterableSpread() { | |
| 8020 | + throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); | |
| 8021 | +} | |
| 8022 | +module.exports = _nonIterableSpread, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 8023 | + | |
| 8024 | +/***/ }), | |
| 8025 | + | |
| 8026 | +/***/ "../node_modules/@babel/runtime/helpers/objectWithoutProperties.js": | |
| 8027 | +/*!*************************************************************************!*\ | |
| 8028 | + !*** ../node_modules/@babel/runtime/helpers/objectWithoutProperties.js ***! | |
| 8029 | + \*************************************************************************/ | |
| 8030 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 8031 | + | |
| 8032 | +var objectWithoutPropertiesLoose = __webpack_require__(/*! ./objectWithoutPropertiesLoose.js */ "../node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js"); | |
| 8033 | +function _objectWithoutProperties(source, excluded) { | |
| 8034 | + if (source == null) return {}; | |
| 8035 | + var target = objectWithoutPropertiesLoose(source, excluded); | |
| 8036 | + var key, i; | |
| 8037 | + if (Object.getOwnPropertySymbols) { | |
| 8038 | + var sourceSymbolKeys = Object.getOwnPropertySymbols(source); | |
| 8039 | + for (i = 0; i < sourceSymbolKeys.length; i++) { | |
| 8040 | + key = sourceSymbolKeys[i]; | |
| 8041 | + if (excluded.indexOf(key) >= 0) continue; | |
| 8042 | + if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; | |
| 8043 | + target[key] = source[key]; | |
| 8044 | + } | |
| 8045 | + } | |
| 8046 | + return target; | |
| 8047 | +} | |
| 8048 | +module.exports = _objectWithoutProperties, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 8049 | + | |
| 8050 | +/***/ }), | |
| 8051 | + | |
| 8052 | +/***/ "../node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js": | |
| 8053 | +/*!******************************************************************************!*\ | |
| 8054 | + !*** ../node_modules/@babel/runtime/helpers/objectWithoutPropertiesLoose.js ***! | |
| 8055 | + \******************************************************************************/ | |
| 8056 | +/***/ ((module) => { | |
| 8057 | + | |
| 8058 | +function _objectWithoutPropertiesLoose(source, excluded) { | |
| 8059 | + if (source == null) return {}; | |
| 8060 | + var target = {}; | |
| 8061 | + var sourceKeys = Object.keys(source); | |
| 8062 | + var key, i; | |
| 8063 | + for (i = 0; i < sourceKeys.length; i++) { | |
| 8064 | + key = sourceKeys[i]; | |
| 8065 | + if (excluded.indexOf(key) >= 0) continue; | |
| 8066 | + target[key] = source[key]; | |
| 8067 | + } | |
| 8068 | + return target; | |
| 8069 | +} | |
| 8070 | +module.exports = _objectWithoutPropertiesLoose, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 8071 | + | |
| 8072 | +/***/ }), | |
| 8073 | + | |
| 8074 | +/***/ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js": | |
| 8075 | +/*!***************************************************************************!*\ | |
| 8076 | + !*** ../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js ***! | |
| 8077 | + \***************************************************************************/ | |
| 8078 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 8079 | + | |
| 8080 | +var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]); | |
| 8081 | +var assertThisInitialized = __webpack_require__(/*! ./assertThisInitialized.js */ "../node_modules/@babel/runtime/helpers/assertThisInitialized.js"); | |
| 8082 | +function _possibleConstructorReturn(self, call) { | |
| 8083 | + if (call && (_typeof(call) === "object" || typeof call === "function")) { | |
| 8084 | + return call; | |
| 8085 | + } else if (call !== void 0) { | |
| 8086 | + throw new TypeError("Derived constructors may only return object or undefined"); | |
| 8087 | + } | |
| 8088 | + return assertThisInitialized(self); | |
| 8089 | +} | |
| 8090 | +module.exports = _possibleConstructorReturn, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 8091 | + | |
| 8092 | +/***/ }), | |
| 8093 | + | |
| 8094 | +/***/ "../node_modules/@babel/runtime/helpers/regeneratorRuntime.js": | |
| 8095 | +/*!********************************************************************!*\ | |
| 8096 | + !*** ../node_modules/@babel/runtime/helpers/regeneratorRuntime.js ***! | |
| 8097 | + \********************************************************************/ | |
| 8098 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 8099 | + | |
| 8100 | +var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]); | |
| 8101 | +function _regeneratorRuntime() { | |
| 8102 | + "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ | |
| 8103 | + module.exports = _regeneratorRuntime = function _regeneratorRuntime() { | |
| 8104 | + return exports; | |
| 8105 | + }, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 8106 | + var exports = {}, | |
| 8107 | + Op = Object.prototype, | |
| 8108 | + hasOwn = Op.hasOwnProperty, | |
| 8109 | + defineProperty = Object.defineProperty || function (obj, key, desc) { | |
| 8110 | + obj[key] = desc.value; | |
| 8111 | + }, | |
| 8112 | + $Symbol = "function" == typeof Symbol ? Symbol : {}, | |
| 8113 | + iteratorSymbol = $Symbol.iterator || "@@iterator", | |
| 8114 | + asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", | |
| 8115 | + toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; | |
| 8116 | + function define(obj, key, value) { | |
| 8117 | + return Object.defineProperty(obj, key, { | |
| 8118 | + value: value, | |
| 8119 | + enumerable: !0, | |
| 8120 | + configurable: !0, | |
| 8121 | + writable: !0 | |
| 8122 | + }), obj[key]; | |
| 8123 | + } | |
| 8124 | + try { | |
| 8125 | + define({}, ""); | |
| 8126 | + } catch (err) { | |
| 8127 | + define = function define(obj, key, value) { | |
| 8128 | + return obj[key] = value; | |
| 8129 | + }; | |
| 8130 | + } | |
| 8131 | + function wrap(innerFn, outerFn, self, tryLocsList) { | |
| 8132 | + var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, | |
| 8133 | + generator = Object.create(protoGenerator.prototype), | |
| 8134 | + context = new Context(tryLocsList || []); | |
| 8135 | + return defineProperty(generator, "_invoke", { | |
| 8136 | + value: makeInvokeMethod(innerFn, self, context) | |
| 8137 | + }), generator; | |
| 8138 | + } | |
| 8139 | + function tryCatch(fn, obj, arg) { | |
| 8140 | + try { | |
| 8141 | + return { | |
| 8142 | + type: "normal", | |
| 8143 | + arg: fn.call(obj, arg) | |
| 8144 | + }; | |
| 8145 | + } catch (err) { | |
| 8146 | + return { | |
| 8147 | + type: "throw", | |
| 8148 | + arg: err | |
| 8149 | + }; | |
| 8150 | + } | |
| 8151 | + } | |
| 8152 | + exports.wrap = wrap; | |
| 8153 | + var ContinueSentinel = {}; | |
| 8154 | + function Generator() {} | |
| 8155 | + function GeneratorFunction() {} | |
| 8156 | + function GeneratorFunctionPrototype() {} | |
| 8157 | + var IteratorPrototype = {}; | |
| 8158 | + define(IteratorPrototype, iteratorSymbol, function () { | |
| 8159 | + return this; | |
| 8160 | + }); | |
| 8161 | + var getProto = Object.getPrototypeOf, | |
| 8162 | + NativeIteratorPrototype = getProto && getProto(getProto(values([]))); | |
| 8163 | + NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); | |
| 8164 | + var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); | |
| 8165 | + function defineIteratorMethods(prototype) { | |
| 8166 | + ["next", "throw", "return"].forEach(function (method) { | |
| 8167 | + define(prototype, method, function (arg) { | |
| 8168 | + return this._invoke(method, arg); | |
| 8169 | + }); | |
| 8170 | + }); | |
| 8171 | + } | |
| 8172 | + function AsyncIterator(generator, PromiseImpl) { | |
| 8173 | + function invoke(method, arg, resolve, reject) { | |
| 8174 | + var record = tryCatch(generator[method], generator, arg); | |
| 8175 | + if ("throw" !== record.type) { | |
| 8176 | + var result = record.arg, | |
| 8177 | + value = result.value; | |
| 8178 | + return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { | |
| 8179 | + invoke("next", value, resolve, reject); | |
| 8180 | + }, function (err) { | |
| 8181 | + invoke("throw", err, resolve, reject); | |
| 8182 | + }) : PromiseImpl.resolve(value).then(function (unwrapped) { | |
| 8183 | + result.value = unwrapped, resolve(result); | |
| 8184 | + }, function (error) { | |
| 8185 | + return invoke("throw", error, resolve, reject); | |
| 8186 | + }); | |
| 8187 | + } | |
| 8188 | + reject(record.arg); | |
| 8189 | + } | |
| 8190 | + var previousPromise; | |
| 8191 | + defineProperty(this, "_invoke", { | |
| 8192 | + value: function value(method, arg) { | |
| 8193 | + function callInvokeWithMethodAndArg() { | |
| 8194 | + return new PromiseImpl(function (resolve, reject) { | |
| 8195 | + invoke(method, arg, resolve, reject); | |
| 8196 | + }); | |
| 8197 | + } | |
| 8198 | + return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); | |
| 8199 | + } | |
| 8200 | + }); | |
| 8201 | + } | |
| 8202 | + function makeInvokeMethod(innerFn, self, context) { | |
| 8203 | + var state = "suspendedStart"; | |
| 8204 | + return function (method, arg) { | |
| 8205 | + if ("executing" === state) throw new Error("Generator is already running"); | |
| 8206 | + if ("completed" === state) { | |
| 8207 | + if ("throw" === method) throw arg; | |
| 8208 | + return doneResult(); | |
| 8209 | + } | |
| 8210 | + for (context.method = method, context.arg = arg;;) { | |
| 8211 | + var delegate = context.delegate; | |
| 8212 | + if (delegate) { | |
| 8213 | + var delegateResult = maybeInvokeDelegate(delegate, context); | |
| 8214 | + if (delegateResult) { | |
| 8215 | + if (delegateResult === ContinueSentinel) continue; | |
| 8216 | + return delegateResult; | |
| 8217 | + } | |
| 8218 | + } | |
| 8219 | + if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { | |
| 8220 | + if ("suspendedStart" === state) throw state = "completed", context.arg; | |
| 8221 | + context.dispatchException(context.arg); | |
| 8222 | + } else "return" === context.method && context.abrupt("return", context.arg); | |
| 8223 | + state = "executing"; | |
| 8224 | + var record = tryCatch(innerFn, self, context); | |
| 8225 | + if ("normal" === record.type) { | |
| 8226 | + if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; | |
| 8227 | + return { | |
| 8228 | + value: record.arg, | |
| 8229 | + done: context.done | |
| 8230 | + }; | |
| 8231 | + } | |
| 8232 | + "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); | |
| 8233 | + } | |
| 8234 | + }; | |
| 8235 | + } | |
| 8236 | + function maybeInvokeDelegate(delegate, context) { | |
| 8237 | + var methodName = context.method, | |
| 8238 | + method = delegate.iterator[methodName]; | |
| 8239 | + if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator["return"] && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; | |
| 8240 | + var record = tryCatch(method, delegate.iterator, context.arg); | |
| 8241 | + if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; | |
| 8242 | + var info = record.arg; | |
| 8243 | + return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); | |
| 8244 | + } | |
| 8245 | + function pushTryEntry(locs) { | |
| 8246 | + var entry = { | |
| 8247 | + tryLoc: locs[0] | |
| 8248 | + }; | |
| 8249 | + 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); | |
| 8250 | + } | |
| 8251 | + function resetTryEntry(entry) { | |
| 8252 | + var record = entry.completion || {}; | |
| 8253 | + record.type = "normal", delete record.arg, entry.completion = record; | |
| 8254 | + } | |
| 8255 | + function Context(tryLocsList) { | |
| 8256 | + this.tryEntries = [{ | |
| 8257 | + tryLoc: "root" | |
| 8258 | + }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); | |
| 8259 | + } | |
| 8260 | + function values(iterable) { | |
| 8261 | + if (iterable) { | |
| 8262 | + var iteratorMethod = iterable[iteratorSymbol]; | |
| 8263 | + if (iteratorMethod) return iteratorMethod.call(iterable); | |
| 8264 | + if ("function" == typeof iterable.next) return iterable; | |
| 8265 | + if (!isNaN(iterable.length)) { | |
| 8266 | + var i = -1, | |
| 8267 | + next = function next() { | |
| 8268 | + for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; | |
| 8269 | + return next.value = undefined, next.done = !0, next; | |
| 8270 | + }; | |
| 8271 | + return next.next = next; | |
| 8272 | + } | |
| 8273 | + } | |
| 8274 | + return { | |
| 8275 | + next: doneResult | |
| 8276 | + }; | |
| 8277 | + } | |
| 8278 | + function doneResult() { | |
| 8279 | + return { | |
| 8280 | + value: undefined, | |
| 8281 | + done: !0 | |
| 8282 | + }; | |
| 8283 | + } | |
| 8284 | + return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { | |
| 8285 | + value: GeneratorFunctionPrototype, | |
| 8286 | + configurable: !0 | |
| 8287 | + }), defineProperty(GeneratorFunctionPrototype, "constructor", { | |
| 8288 | + value: GeneratorFunction, | |
| 8289 | + configurable: !0 | |
| 8290 | + }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { | |
| 8291 | + var ctor = "function" == typeof genFun && genFun.constructor; | |
| 8292 | + return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); | |
| 8293 | + }, exports.mark = function (genFun) { | |
| 8294 | + return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; | |
| 8295 | + }, exports.awrap = function (arg) { | |
| 8296 | + return { | |
| 8297 | + __await: arg | |
| 8298 | + }; | |
| 8299 | + }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { | |
| 8300 | + return this; | |
| 8301 | + }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { | |
| 8302 | + void 0 === PromiseImpl && (PromiseImpl = Promise); | |
| 8303 | + var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); | |
| 8304 | + return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { | |
| 8305 | + return result.done ? result.value : iter.next(); | |
| 8306 | + }); | |
| 8307 | + }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { | |
| 8308 | + return this; | |
| 8309 | + }), define(Gp, "toString", function () { | |
| 8310 | + return "[object Generator]"; | |
| 8311 | + }), exports.keys = function (val) { | |
| 8312 | + var object = Object(val), | |
| 8313 | + keys = []; | |
| 8314 | + for (var key in object) keys.push(key); | |
| 8315 | + return keys.reverse(), function next() { | |
| 8316 | + for (; keys.length;) { | |
| 8317 | + var key = keys.pop(); | |
| 8318 | + if (key in object) return next.value = key, next.done = !1, next; | |
| 8319 | + } | |
| 8320 | + return next.done = !0, next; | |
| 8321 | + }; | |
| 8322 | + }, exports.values = values, Context.prototype = { | |
| 8323 | + constructor: Context, | |
| 8324 | + reset: function reset(skipTempReset) { | |
| 8325 | + if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); | |
| 8326 | + }, | |
| 8327 | + stop: function stop() { | |
| 8328 | + this.done = !0; | |
| 8329 | + var rootRecord = this.tryEntries[0].completion; | |
| 8330 | + if ("throw" === rootRecord.type) throw rootRecord.arg; | |
| 8331 | + return this.rval; | |
| 8332 | + }, | |
| 8333 | + dispatchException: function dispatchException(exception) { | |
| 8334 | + if (this.done) throw exception; | |
| 8335 | + var context = this; | |
| 8336 | + function handle(loc, caught) { | |
| 8337 | + return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; | |
| 8338 | + } | |
| 8339 | + for (var i = this.tryEntries.length - 1; i >= 0; --i) { | |
| 8340 | + var entry = this.tryEntries[i], | |
| 8341 | + record = entry.completion; | |
| 8342 | + if ("root" === entry.tryLoc) return handle("end"); | |
| 8343 | + if (entry.tryLoc <= this.prev) { | |
| 8344 | + var hasCatch = hasOwn.call(entry, "catchLoc"), | |
| 8345 | + hasFinally = hasOwn.call(entry, "finallyLoc"); | |
| 8346 | + if (hasCatch && hasFinally) { | |
| 8347 | + if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); | |
| 8348 | + if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); | |
| 8349 | + } else if (hasCatch) { | |
| 8350 | + if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); | |
| 8351 | + } else { | |
| 8352 | + if (!hasFinally) throw new Error("try statement without catch or finally"); | |
| 8353 | + if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); | |
| 8354 | + } | |
| 8355 | + } | |
| 8356 | + } | |
| 8357 | + }, | |
| 8358 | + abrupt: function abrupt(type, arg) { | |
| 8359 | + for (var i = this.tryEntries.length - 1; i >= 0; --i) { | |
| 8360 | + var entry = this.tryEntries[i]; | |
| 8361 | + if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { | |
| 8362 | + var finallyEntry = entry; | |
| 8363 | + break; | |
| 8364 | + } | |
| 8365 | + } | |
| 8366 | + finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); | |
| 8367 | + var record = finallyEntry ? finallyEntry.completion : {}; | |
| 8368 | + return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); | |
| 8369 | + }, | |
| 8370 | + complete: function complete(record, afterLoc) { | |
| 8371 | + if ("throw" === record.type) throw record.arg; | |
| 8372 | + return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; | |
| 8373 | + }, | |
| 8374 | + finish: function finish(finallyLoc) { | |
| 8375 | + for (var i = this.tryEntries.length - 1; i >= 0; --i) { | |
| 8376 | + var entry = this.tryEntries[i]; | |
| 8377 | + if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; | |
| 8378 | + } | |
| 8379 | + }, | |
| 8380 | + "catch": function _catch(tryLoc) { | |
| 8381 | + for (var i = this.tryEntries.length - 1; i >= 0; --i) { | |
| 8382 | + var entry = this.tryEntries[i]; | |
| 8383 | + if (entry.tryLoc === tryLoc) { | |
| 8384 | + var record = entry.completion; | |
| 8385 | + if ("throw" === record.type) { | |
| 8386 | + var thrown = record.arg; | |
| 8387 | + resetTryEntry(entry); | |
| 8388 | + } | |
| 8389 | + return thrown; | |
| 8390 | + } | |
| 8391 | + } | |
| 8392 | + throw new Error("illegal catch attempt"); | |
| 8393 | + }, | |
| 8394 | + delegateYield: function delegateYield(iterable, resultName, nextLoc) { | |
| 8395 | + return this.delegate = { | |
| 8396 | + iterator: values(iterable), | |
| 8397 | + resultName: resultName, | |
| 8398 | + nextLoc: nextLoc | |
| 8399 | + }, "next" === this.method && (this.arg = undefined), ContinueSentinel; | |
| 8400 | + } | |
| 8401 | + }, exports; | |
| 8402 | +} | |
| 8403 | +module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 8404 | + | |
| 8405 | +/***/ }), | |
| 8406 | + | |
| 8407 | +/***/ "../node_modules/@babel/runtime/helpers/setPrototypeOf.js": | |
| 8408 | +/*!****************************************************************!*\ | |
| 8409 | + !*** ../node_modules/@babel/runtime/helpers/setPrototypeOf.js ***! | |
| 8410 | + \****************************************************************/ | |
| 8411 | +/***/ ((module) => { | |
| 8412 | + | |
| 8413 | +function _setPrototypeOf(o, p) { | |
| 8414 | + module.exports = _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { | |
| 8415 | + o.__proto__ = p; | |
| 8416 | + return o; | |
| 8417 | + }, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 8418 | + return _setPrototypeOf(o, p); | |
| 8419 | +} | |
| 8420 | +module.exports = _setPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 8421 | + | |
| 8422 | +/***/ }), | |
| 8423 | + | |
| 8424 | +/***/ "../node_modules/@babel/runtime/helpers/slicedToArray.js": | |
| 8425 | +/*!***************************************************************!*\ | |
| 8426 | + !*** ../node_modules/@babel/runtime/helpers/slicedToArray.js ***! | |
| 8427 | + \***************************************************************/ | |
| 8428 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 8429 | + | |
| 8430 | +var arrayWithHoles = __webpack_require__(/*! ./arrayWithHoles.js */ "../node_modules/@babel/runtime/helpers/arrayWithHoles.js"); | |
| 8431 | +var iterableToArrayLimit = __webpack_require__(/*! ./iterableToArrayLimit.js */ "../node_modules/@babel/runtime/helpers/iterableToArrayLimit.js"); | |
| 8432 | +var unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray.js */ "../node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js"); | |
| 8433 | +var nonIterableRest = __webpack_require__(/*! ./nonIterableRest.js */ "../node_modules/@babel/runtime/helpers/nonIterableRest.js"); | |
| 8434 | +function _slicedToArray(arr, i) { | |
| 8435 | + return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest(); | |
| 8436 | +} | |
| 8437 | +module.exports = _slicedToArray, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 8438 | + | |
| 8439 | +/***/ }), | |
| 8440 | + | |
| 8441 | +/***/ "../node_modules/@babel/runtime/helpers/toConsumableArray.js": | |
| 8442 | +/*!*******************************************************************!*\ | |
| 8443 | + !*** ../node_modules/@babel/runtime/helpers/toConsumableArray.js ***! | |
| 8444 | + \*******************************************************************/ | |
| 8445 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 8446 | + | |
| 8447 | +var arrayWithoutHoles = __webpack_require__(/*! ./arrayWithoutHoles.js */ "../node_modules/@babel/runtime/helpers/arrayWithoutHoles.js"); | |
| 8448 | +var iterableToArray = __webpack_require__(/*! ./iterableToArray.js */ "../node_modules/@babel/runtime/helpers/iterableToArray.js"); | |
| 8449 | +var unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray.js */ "../node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js"); | |
| 8450 | +var nonIterableSpread = __webpack_require__(/*! ./nonIterableSpread.js */ "../node_modules/@babel/runtime/helpers/nonIterableSpread.js"); | |
| 8451 | +function _toConsumableArray(arr) { | |
| 8452 | + return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread(); | |
| 8453 | +} | |
| 8454 | +module.exports = _toConsumableArray, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 8455 | + | |
| 8456 | +/***/ }), | |
| 8457 | + | |
| 8458 | +/***/ "../node_modules/@babel/runtime/helpers/toPrimitive.js": | |
| 8459 | +/*!*************************************************************!*\ | |
| 8460 | + !*** ../node_modules/@babel/runtime/helpers/toPrimitive.js ***! | |
| 8461 | + \*************************************************************/ | |
| 8462 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 8463 | + | |
| 8464 | +var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]); | |
| 8465 | +function _toPrimitive(input, hint) { | |
| 8466 | + if (_typeof(input) !== "object" || input === null) return input; | |
| 8467 | + var prim = input[Symbol.toPrimitive]; | |
| 8468 | + if (prim !== undefined) { | |
| 8469 | + var res = prim.call(input, hint || "default"); | |
| 8470 | + if (_typeof(res) !== "object") return res; | |
| 8471 | + throw new TypeError("@@toPrimitive must return a primitive value."); | |
| 8472 | + } | |
| 8473 | + return (hint === "string" ? String : Number)(input); | |
| 8474 | +} | |
| 8475 | +module.exports = _toPrimitive, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 8476 | + | |
| 8477 | +/***/ }), | |
| 8478 | + | |
| 8479 | +/***/ "../node_modules/@babel/runtime/helpers/toPropertyKey.js": | |
| 8480 | +/*!***************************************************************!*\ | |
| 8481 | + !*** ../node_modules/@babel/runtime/helpers/toPropertyKey.js ***! | |
| 8482 | + \***************************************************************/ | |
| 8483 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 8484 | + | |
| 8485 | +var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]); | |
| 8486 | +var toPrimitive = __webpack_require__(/*! ./toPrimitive.js */ "../node_modules/@babel/runtime/helpers/toPrimitive.js"); | |
| 8487 | +function _toPropertyKey(arg) { | |
| 8488 | + var key = toPrimitive(arg, "string"); | |
| 8489 | + return _typeof(key) === "symbol" ? key : String(key); | |
| 8490 | +} | |
| 8491 | +module.exports = _toPropertyKey, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 8492 | + | |
| 8493 | +/***/ }), | |
| 8494 | + | |
| 8495 | +/***/ "../node_modules/@babel/runtime/helpers/typeof.js": | |
| 8496 | +/*!********************************************************!*\ | |
| 8497 | + !*** ../node_modules/@babel/runtime/helpers/typeof.js ***! | |
| 8498 | + \********************************************************/ | |
| 8499 | +/***/ ((module) => { | |
| 8500 | + | |
| 8501 | +function _typeof(obj) { | |
| 8502 | + "@babel/helpers - typeof"; | |
| 8503 | + | |
| 8504 | + return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { | |
| 8505 | + return typeof obj; | |
| 8506 | + } : function (obj) { | |
| 8507 | + return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; | |
| 8508 | + }, module.exports.__esModule = true, module.exports["default"] = module.exports), _typeof(obj); | |
| 8509 | +} | |
| 8510 | +module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 8511 | + | |
| 8512 | +/***/ }), | |
| 8513 | + | |
| 8514 | +/***/ "../node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js": | |
| 8515 | +/*!****************************************************************************!*\ | |
| 8516 | + !*** ../node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js ***! | |
| 8517 | + \****************************************************************************/ | |
| 8518 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 8519 | + | |
| 8520 | +var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray.js */ "../node_modules/@babel/runtime/helpers/arrayLikeToArray.js"); | |
| 8521 | +function _unsupportedIterableToArray(o, minLen) { | |
| 8522 | + if (!o) return; | |
| 8523 | + if (typeof o === "string") return arrayLikeToArray(o, minLen); | |
| 8524 | + var n = Object.prototype.toString.call(o).slice(8, -1); | |
| 8525 | + if (n === "Object" && o.constructor) n = o.constructor.name; | |
| 8526 | + if (n === "Map" || n === "Set") return Array.from(o); | |
| 8527 | + if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen); | |
| 8528 | +} | |
| 8529 | +module.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports; | |
| 8530 | + | |
| 8531 | +/***/ }), | |
| 8532 | + | |
| 8533 | +/***/ "../node_modules/@babel/runtime/regenerator/index.js": | |
| 8534 | +/*!***********************************************************!*\ | |
| 8535 | + !*** ../node_modules/@babel/runtime/regenerator/index.js ***! | |
| 8536 | + \***********************************************************/ | |
| 8537 | +/***/ ((module, __unused_webpack_exports, __webpack_require__) => { | |
| 8538 | + | |
| 8539 | +// TODO(Babel 8): Remove this file. | |
| 8540 | + | |
| 8541 | +var runtime = __webpack_require__(/*! ../helpers/regeneratorRuntime */ "../node_modules/@babel/runtime/helpers/regeneratorRuntime.js")(); | |
| 8542 | +module.exports = runtime; | |
| 8543 | + | |
| 8544 | +// Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736= | |
| 8545 | +try { | |
| 8546 | + regeneratorRuntime = runtime; | |
| 8547 | +} catch (accidentalStrictMode) { | |
| 8548 | + if (typeof globalThis === "object") { | |
| 8549 | + globalThis.regeneratorRuntime = runtime; | |
| 8550 | + } else { | |
| 8551 | + Function("r", "regeneratorRuntime = r")(runtime); | |
| 8552 | + } | |
| 8553 | +} | |
| 8554 | + | |
| 8555 | + | |
| 8556 | +/***/ }) | |
| 8557 | + | |
| 8558 | +/******/ }); | |
| 8559 | +/************************************************************************/ | |
| 8560 | +/******/ // The module cache | |
| 8561 | +/******/ var __webpack_module_cache__ = {}; | |
| 8562 | +/******/ | |
| 8563 | +/******/ // The require function | |
| 8564 | +/******/ function __webpack_require__(moduleId) { | |
| 8565 | +/******/ // Check if module is in cache | |
| 8566 | +/******/ var cachedModule = __webpack_module_cache__[moduleId]; | |
| 8567 | +/******/ if (cachedModule !== undefined) { | |
| 8568 | +/******/ return cachedModule.exports; | |
| 8569 | +/******/ } | |
| 8570 | +/******/ // Create a new module (and put it into the cache) | |
| 8571 | +/******/ var module = __webpack_module_cache__[moduleId] = { | |
| 8572 | +/******/ // no module.id needed | |
| 8573 | +/******/ // no module.loaded needed | |
| 8574 | +/******/ exports: {} | |
| 8575 | +/******/ }; | |
| 8576 | +/******/ | |
| 8577 | +/******/ // Execute the module function | |
| 8578 | +/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); | |
| 8579 | +/******/ | |
| 8580 | +/******/ // Return the exports of the module | |
| 8581 | +/******/ return module.exports; | |
| 8582 | +/******/ } | |
| 8583 | +/******/ | |
| 8584 | +/************************************************************************/ | |
| 8585 | +/******/ /* webpack/runtime/define property getters */ | |
| 8586 | +/******/ (() => { | |
| 8587 | +/******/ // define getter functions for harmony exports | |
| 8588 | +/******/ __webpack_require__.d = (exports, definition) => { | |
| 8589 | +/******/ for(var key in definition) { | |
| 8590 | +/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { | |
| 8591 | +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); | |
| 8592 | +/******/ } | |
| 8593 | +/******/ } | |
| 8594 | +/******/ }; | |
| 8595 | +/******/ })(); | |
| 8596 | +/******/ | |
| 8597 | +/******/ /* webpack/runtime/hasOwnProperty shorthand */ | |
| 8598 | +/******/ (() => { | |
| 8599 | +/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) | |
| 8600 | +/******/ })(); | |
| 8601 | +/******/ | |
| 8602 | +/******/ /* webpack/runtime/make namespace object */ | |
| 8603 | +/******/ (() => { | |
| 8604 | +/******/ // define __esModule on exports | |
| 8605 | +/******/ __webpack_require__.r = (exports) => { | |
| 8606 | +/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { | |
| 8607 | +/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); | |
| 8608 | +/******/ } | |
| 8609 | +/******/ Object.defineProperty(exports, '__esModule', { value: true }); | |
| 8610 | +/******/ }; | |
| 8611 | +/******/ })(); | |
| 8612 | +/******/ | |
| 8613 | +/************************************************************************/ | |
| 8614 | +var __webpack_exports__ = {}; | |
| 8615 | +// This entry need to be wrapped in an IIFE because it need to be in strict mode. | |
| 8616 | +(() => { | |
| 8617 | +"use strict"; | |
| 8618 | +var exports = __webpack_exports__; | |
| 8619 | +/*!*******************************************************!*\ | |
| 8620 | + !*** ../modules/ai/assets/js/editor/layout-module.js ***! | |
| 8621 | + \*******************************************************/ | |
| 8622 | + | |
| 8623 | + | |
| 8624 | +var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); | |
| 8625 | +Object.defineProperty(exports, "__esModule", ({ | |
| 8626 | + value: true | |
| 8627 | +})); | |
| 8628 | +exports["default"] = void 0; | |
| 8629 | +var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); | |
| 8630 | +var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); | |
| 8631 | +var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); | |
| 8632 | +var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); | |
| 8633 | +var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); | |
| 8634 | +var _aiLayoutBehavior = _interopRequireDefault(__webpack_require__(/*! ./ai-layout-behavior */ "../modules/ai/assets/js/editor/ai-layout-behavior.js")); | |
| 8635 | +function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; } | |
| 8636 | +function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } | |
| 8637 | +var Module = /*#__PURE__*/function (_elementorModules$edi) { | |
| 8638 | + (0, _inherits2.default)(Module, _elementorModules$edi); | |
| 8639 | + var _super = _createSuper(Module); | |
| 8640 | + function Module() { | |
| 8641 | + (0, _classCallCheck2.default)(this, Module); | |
| 8642 | + return _super.apply(this, arguments); | |
| 8643 | + } | |
| 8644 | + (0, _createClass2.default)(Module, [{ | |
| 8645 | + key: "onElementorInit", | |
| 8646 | + value: function onElementorInit() { | |
| 8647 | + elementor.hooks.addFilter('views/add-section/behaviors', this.registerAiLayoutBehavior); | |
| 8648 | + } | |
| 8649 | + }, { | |
| 8650 | + key: "registerAiLayoutBehavior", | |
| 8651 | + value: function registerAiLayoutBehavior(behaviors) { | |
| 8652 | + behaviors.ai = { | |
| 8653 | + behaviorClass: _aiLayoutBehavior.default | |
| 8654 | + }; | |
| 8655 | + return behaviors; | |
| 8656 | + } | |
| 8657 | + }]); | |
| 8658 | + return Module; | |
| 8659 | +}(elementorModules.editor.utils.Module); | |
| 8660 | +exports["default"] = Module; | |
| 8661 | +new Module(); | |
| 8662 | +})(); | |
| 8663 | + | |
| 8664 | +/******/ })() | |
| 8665 | +; | |
| 8943 | 8666 | //# sourceMappingURL=ai-layout.js.map |