Submit
Path:
~
/
home
/
getwphos
/
public_html
/
deerguard
/
wp-content
/
plugins
/
elementor
/
assets
/
js
/
File Content:
cloud-library-screenshot.js
/*! elementor - v3.29.0 - 04-06-2025 */ /******/ (() => { // webpackBootstrap /******/ var __webpack_modules__ = ({ /***/ "../node_modules/@babel/runtime/helpers/arrayLikeToArray.js": /*!******************************************************************!*\ !*** ../node_modules/@babel/runtime/helpers/arrayLikeToArray.js ***! \******************************************************************/ /***/ ((module) => { function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } module.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports["default"] = module.exports; /***/ }), /***/ "../node_modules/@babel/runtime/helpers/arrayWithoutHoles.js": /*!*******************************************************************!*\ !*** ../node_modules/@babel/runtime/helpers/arrayWithoutHoles.js ***! \*******************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray.js */ "../node_modules/@babel/runtime/helpers/arrayLikeToArray.js"); function _arrayWithoutHoles(r) { if (Array.isArray(r)) return arrayLikeToArray(r); } module.exports = _arrayWithoutHoles, module.exports.__esModule = true, module.exports["default"] = module.exports; /***/ }), /***/ "../node_modules/@babel/runtime/helpers/assertThisInitialized.js": /*!***********************************************************************!*\ !*** ../node_modules/@babel/runtime/helpers/assertThisInitialized.js ***! \***********************************************************************/ /***/ ((module) => { function _assertThisInitialized(e) { if (void 0 === e) throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); return e; } module.exports = _assertThisInitialized, module.exports.__esModule = true, module.exports["default"] = module.exports; /***/ }), /***/ "../node_modules/@babel/runtime/helpers/classCallCheck.js": /*!****************************************************************!*\ !*** ../node_modules/@babel/runtime/helpers/classCallCheck.js ***! \****************************************************************/ /***/ ((module) => { function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); } module.exports = _classCallCheck, module.exports.__esModule = true, module.exports["default"] = module.exports; /***/ }), /***/ "../node_modules/@babel/runtime/helpers/createClass.js": /*!*************************************************************!*\ !*** ../node_modules/@babel/runtime/helpers/createClass.js ***! \*************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ "../node_modules/@babel/runtime/helpers/toPropertyKey.js"); function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, toPropertyKey(o.key), o); } } function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; } module.exports = _createClass, module.exports.__esModule = true, module.exports["default"] = module.exports; /***/ }), /***/ "../node_modules/@babel/runtime/helpers/defineProperty.js": /*!****************************************************************!*\ !*** ../node_modules/@babel/runtime/helpers/defineProperty.js ***! \****************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ "../node_modules/@babel/runtime/helpers/toPropertyKey.js"); function _defineProperty(e, r, t) { return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; } module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports; /***/ }), /***/ "../node_modules/@babel/runtime/helpers/get.js": /*!*****************************************************!*\ !*** ../node_modules/@babel/runtime/helpers/get.js ***! \*****************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var superPropBase = __webpack_require__(/*! ./superPropBase.js */ "../node_modules/@babel/runtime/helpers/superPropBase.js"); function _get() { return module.exports = _get = "undefined" != typeof Reflect && Reflect.get ? Reflect.get.bind() : function (e, t, r) { var p = superPropBase(e, t); if (p) { var n = Object.getOwnPropertyDescriptor(p, t); return n.get ? n.get.call(arguments.length < 3 ? e : r) : n.value; } }, module.exports.__esModule = true, module.exports["default"] = module.exports, _get.apply(null, arguments); } module.exports = _get, module.exports.__esModule = true, module.exports["default"] = module.exports; /***/ }), /***/ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js": /*!****************************************************************!*\ !*** ../node_modules/@babel/runtime/helpers/getPrototypeOf.js ***! \****************************************************************/ /***/ ((module) => { function _getPrototypeOf(t) { return module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) { return t.__proto__ || Object.getPrototypeOf(t); }, module.exports.__esModule = true, module.exports["default"] = module.exports, _getPrototypeOf(t); } module.exports = _getPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports; /***/ }), /***/ "../node_modules/@babel/runtime/helpers/inherits.js": /*!**********************************************************!*\ !*** ../node_modules/@babel/runtime/helpers/inherits.js ***! \**********************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ "../node_modules/@babel/runtime/helpers/setPrototypeOf.js"); function _inherits(t, e) { if ("function" != typeof e && null !== e) throw new TypeError("Super expression must either be null or a function"); t.prototype = Object.create(e && e.prototype, { constructor: { value: t, writable: !0, configurable: !0 } }), Object.defineProperty(t, "prototype", { writable: !1 }), e && setPrototypeOf(t, e); } module.exports = _inherits, module.exports.__esModule = true, module.exports["default"] = module.exports; /***/ }), /***/ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js": /*!***********************************************************************!*\ !*** ../node_modules/@babel/runtime/helpers/interopRequireDefault.js ***! \***********************************************************************/ /***/ ((module) => { function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; } module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports["default"] = module.exports; /***/ }), /***/ "../node_modules/@babel/runtime/helpers/iterableToArray.js": /*!*****************************************************************!*\ !*** ../node_modules/@babel/runtime/helpers/iterableToArray.js ***! \*****************************************************************/ /***/ ((module) => { function _iterableToArray(r) { if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r); } module.exports = _iterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports; /***/ }), /***/ "../node_modules/@babel/runtime/helpers/nonIterableSpread.js": /*!*******************************************************************!*\ !*** ../node_modules/@babel/runtime/helpers/nonIterableSpread.js ***! \*******************************************************************/ /***/ ((module) => { function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } module.exports = _nonIterableSpread, module.exports.__esModule = true, module.exports["default"] = module.exports; /***/ }), /***/ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js": /*!***************************************************************************!*\ !*** ../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js ***! \***************************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]); var assertThisInitialized = __webpack_require__(/*! ./assertThisInitialized.js */ "../node_modules/@babel/runtime/helpers/assertThisInitialized.js"); function _possibleConstructorReturn(t, e) { if (e && ("object" == _typeof(e) || "function" == typeof e)) return e; if (void 0 !== e) throw new TypeError("Derived constructors may only return object or undefined"); return assertThisInitialized(t); } module.exports = _possibleConstructorReturn, module.exports.__esModule = true, module.exports["default"] = module.exports; /***/ }), /***/ "../node_modules/@babel/runtime/helpers/readOnlyError.js": /*!***************************************************************!*\ !*** ../node_modules/@babel/runtime/helpers/readOnlyError.js ***! \***************************************************************/ /***/ ((module) => { function _readOnlyError(r) { throw new TypeError('"' + r + '" is read-only'); } module.exports = _readOnlyError, module.exports.__esModule = true, module.exports["default"] = module.exports; /***/ }), /***/ "../node_modules/@babel/runtime/helpers/setPrototypeOf.js": /*!****************************************************************!*\ !*** ../node_modules/@babel/runtime/helpers/setPrototypeOf.js ***! \****************************************************************/ /***/ ((module) => { function _setPrototypeOf(t, e) { return module.exports = _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) { return t.__proto__ = e, t; }, module.exports.__esModule = true, module.exports["default"] = module.exports, _setPrototypeOf(t, e); } module.exports = _setPrototypeOf, module.exports.__esModule = true, module.exports["default"] = module.exports; /***/ }), /***/ "../node_modules/@babel/runtime/helpers/superPropBase.js": /*!***************************************************************!*\ !*** ../node_modules/@babel/runtime/helpers/superPropBase.js ***! \***************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var getPrototypeOf = __webpack_require__(/*! ./getPrototypeOf.js */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js"); function _superPropBase(t, o) { for (; !{}.hasOwnProperty.call(t, o) && null !== (t = getPrototypeOf(t));); return t; } module.exports = _superPropBase, module.exports.__esModule = true, module.exports["default"] = module.exports; /***/ }), /***/ "../node_modules/@babel/runtime/helpers/toConsumableArray.js": /*!*******************************************************************!*\ !*** ../node_modules/@babel/runtime/helpers/toConsumableArray.js ***! \*******************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var arrayWithoutHoles = __webpack_require__(/*! ./arrayWithoutHoles.js */ "../node_modules/@babel/runtime/helpers/arrayWithoutHoles.js"); var iterableToArray = __webpack_require__(/*! ./iterableToArray.js */ "../node_modules/@babel/runtime/helpers/iterableToArray.js"); var unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray.js */ "../node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js"); var nonIterableSpread = __webpack_require__(/*! ./nonIterableSpread.js */ "../node_modules/@babel/runtime/helpers/nonIterableSpread.js"); function _toConsumableArray(r) { return arrayWithoutHoles(r) || iterableToArray(r) || unsupportedIterableToArray(r) || nonIterableSpread(); } module.exports = _toConsumableArray, module.exports.__esModule = true, module.exports["default"] = module.exports; /***/ }), /***/ "../node_modules/@babel/runtime/helpers/toPrimitive.js": /*!*************************************************************!*\ !*** ../node_modules/@babel/runtime/helpers/toPrimitive.js ***! \*************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]); function toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } module.exports = toPrimitive, module.exports.__esModule = true, module.exports["default"] = module.exports; /***/ }), /***/ "../node_modules/@babel/runtime/helpers/toPropertyKey.js": /*!***************************************************************!*\ !*** ../node_modules/@babel/runtime/helpers/toPropertyKey.js ***! \***************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]); var toPrimitive = __webpack_require__(/*! ./toPrimitive.js */ "../node_modules/@babel/runtime/helpers/toPrimitive.js"); function toPropertyKey(t) { var i = toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } module.exports = toPropertyKey, module.exports.__esModule = true, module.exports["default"] = module.exports; /***/ }), /***/ "../node_modules/@babel/runtime/helpers/typeof.js": /*!********************************************************!*\ !*** ../node_modules/@babel/runtime/helpers/typeof.js ***! \********************************************************/ /***/ ((module) => { function _typeof(o) { "@babel/helpers - typeof"; return module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, module.exports.__esModule = true, module.exports["default"] = module.exports, _typeof(o); } module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports; /***/ }), /***/ "../node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js": /*!****************************************************************************!*\ !*** ../node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js ***! \****************************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray.js */ "../node_modules/@babel/runtime/helpers/arrayLikeToArray.js"); function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? arrayLikeToArray(r, a) : void 0; } } module.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports["default"] = module.exports; /***/ }) /******/ }); /************************************************************************/ /******/ // The module cache /******/ var __webpack_module_cache__ = {}; /******/ /******/ // The require function /******/ function __webpack_require__(moduleId) { /******/ // Check if module is in cache /******/ var cachedModule = __webpack_module_cache__[moduleId]; /******/ if (cachedModule !== undefined) { /******/ return cachedModule.exports; /******/ } /******/ // Create a new module (and put it into the cache) /******/ var module = __webpack_module_cache__[moduleId] = { /******/ // no module.id needed /******/ // no module.loaded needed /******/ exports: {} /******/ }; /******/ /******/ // Execute the module function /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); /******/ /******/ // Return the exports of the module /******/ return module.exports; /******/ } /******/ /************************************************************************/ // This entry needs to be wrapped in an IIFE because it needs to be in strict mode. (() => { "use strict"; /*!****************************************************************!*\ !*** ../modules/cloud-library/assets/js/preview/screenshot.js ***! \****************************************************************/ var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); var _readOnlyError2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/readOnlyError */ "../node_modules/@babel/runtime/helpers/readOnlyError.js")); var _toConsumableArray2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ "../node_modules/@babel/runtime/helpers/toConsumableArray.js")); var _defineProperty2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/defineProperty */ "../node_modules/@babel/runtime/helpers/defineProperty.js")); var _classCallCheck2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ "../node_modules/@babel/runtime/helpers/classCallCheck.js")); var _createClass2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/createClass */ "../node_modules/@babel/runtime/helpers/createClass.js")); var _possibleConstructorReturn2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ "../node_modules/@babel/runtime/helpers/possibleConstructorReturn.js")); var _getPrototypeOf2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ "../node_modules/@babel/runtime/helpers/getPrototypeOf.js")); var _get2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/get */ "../node_modules/@babel/runtime/helpers/get.js")); var _inherits2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/inherits */ "../node_modules/@babel/runtime/helpers/inherits.js")); function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); } function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _superPropGet(t, o, e, r) { var p = (0, _get2.default)((0, _getPrototypeOf2.default)(1 & r ? t.prototype : t), o, e); return 2 & r && "function" == typeof p ? function (t) { return p.apply(e, t); } : p; } /* global ElementorScreenshotConfig */ var Screenshot = /*#__PURE__*/function (_elementorModules$Vie) { function Screenshot() { (0, _classCallCheck2.default)(this, Screenshot); return _callSuper(this, Screenshot, arguments); } (0, _inherits2.default)(Screenshot, _elementorModules$Vie); return (0, _createClass2.default)(Screenshot, [{ key: "getDefaultSettings", value: function getDefaultSettings() { return _objectSpread({ empty_content_headline: 'Empty Content.', crop: { width: 1200, height: 1500 }, excluded_external_css_urls: ['https://kit-pro.fontawesome.com'], external_images_urls: ['https://i.ytimg.com' // Youtube images domain. ], timeout: 15000, // Wait until screenshot taken or fail in 15 secs. render_timeout: 5000, // Wait until all the element will be loaded or 5 sec and then take screenshot. timerLabel: null, timer_label: "".concat(ElementorScreenshotConfig.post_id, " - timer"), image_placeholder: 'data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQABAAACAkQBADs=', isDebug: elementorCommonConfig.isElementorDebug, isDebugSvg: false }, ElementorScreenshotConfig); } }, { key: "getDefaultElements", value: function getDefaultElements() { var $elementor = jQuery(ElementorScreenshotConfig.selector); var $sections = $elementor.find('.elementor-section-wrap > .elementor-section, .elementor > .elementor-section'); return { $elementor: $elementor, $sections: $sections, $firstSection: $sections.first(), $notElementorElements: elementorCommon.elements.$body.find('> *:not(style, link)').not($elementor), $head: jQuery('head') }; } }, { key: "onInit", value: function onInit() { _superPropGet(Screenshot, "onInit", this, 3)([]); this.log('Screenshot init', 'time'); /** * Hold the timeout timer * * @type {number|null} */ this.timeoutTimer = setTimeout(this.screenshotFailed.bind(this), this.getSettings('timeout')); return this.captureScreenshot(); } /** * The main method for this class. */ }, { key: "captureScreenshot", value: function captureScreenshot() { if (!this.elements.$elementor.length) { elementorCommon.helpers.consoleWarn('Screenshots: The content of this page is empty, the module will create a fake conent just for this screenshot.'); this.createFakeContent(); } this.removeUnnecessaryElements(); this.handleIFrames(); this.removeFirstSectionMargin(); this.handleLinks(); this.loadExternalCss(); this.loadExternalImages(); return Promise.resolve().then(this.createImage.bind(this)).then(this.createImageElement.bind(this)).then(this.cropCanvas.bind(this)).then(this.save.bind(this)).then(this.screenshotSucceed.bind(this)).catch(this.screenshotFailed.bind(this)); } /** * Fake content for documents that dont have any content. */ }, { key: "createFakeContent", value: function createFakeContent() { this.elements.$elementor = jQuery('<div>').css({ height: this.getSettings('crop.height'), width: this.getSettings('crop.width'), display: 'flex', alignItems: 'center', justifyContent: 'center' }); this.elements.$elementor.append(jQuery('<h1>').css({ fontSize: '85px' }).html(this.getSettings('empty_content_headline'))); document.body.prepend(this.elements.$elementor); } /** * CSS from another server cannot be loaded with the current dom to image library. * this method take all the links from another domain and proxy them. */ }, { key: "loadExternalCss", value: function loadExternalCss() { var _this = this; var excludedUrls = [this.getSettings('home_url')].concat((0, _toConsumableArray2.default)(this.getSettings('excluded_external_css_urls'))); var notSelector = excludedUrls.map(function (url) { return "[href^=\"".concat(url, "\"]"); }).join(', '); jQuery('link').not(notSelector).each(function (index, el) { var $link = jQuery(el), $newLink = $link.clone(); $newLink.attr('href', _this.getScreenshotProxyUrl($link.attr('href'))); _this.elements.$head.append($newLink); $link.remove(); }); } /** * Make a proxy to images urls that has some problems with cross origin (like youtube). */ }, { key: "loadExternalImages", value: function loadExternalImages() { var _this2 = this; var selector = this.getSettings('external_images_urls').map(function (url) { return "img[src^=\"".concat(url, "\"]"); }).join(', '); jQuery(selector).each(function (index, el) { var $img = jQuery(el); $img.attr('src', _this2.getScreenshotProxyUrl($img.attr('src'))); }); } /** * Html to images libraries can not snapshot IFrames * this method convert all the IFrames to some other elements. */ }, { key: "handleIFrames", value: function handleIFrames() { this.elements.$elementor.find('iframe').each(function (index, el) { var $iframe = jQuery(el), $iframeMask = jQuery('<div />', { css: { background: 'gray', width: $iframe.width(), height: $iframe.height() } }); $iframe.before($iframeMask); $iframe.remove(); }); } /** * Remove all the sections that should not be in the screenshot. */ }, { key: "removeUnnecessaryElements", value: function removeUnnecessaryElements() { var _this3 = this; var currentHeight = 0; this.elements.$sections.filter(function (index, el) { var shouldBeRemoved = false; if (currentHeight >= _this3.getSettings('crop.height')) { shouldBeRemoved = true; } currentHeight += jQuery(el).outerHeight(); return shouldBeRemoved; }).each(function (index, el) { el.remove(); }); // Some 3rd party plugins inject elements into the dom, so this method removes all // the elements that was injected, to make sure that it capture a screenshot only of the post itself. this.elements.$notElementorElements.remove(); } /** * Some urls make some problems to the svg parser. * this method convert all the urls to just '/'. */ }, { key: "handleLinks", value: function handleLinks() { elementorCommon.elements.$body.find('a').attr('href', '/'); } /** * Remove unnecessary margin from the first element of the post (singles and footers). */ }, { key: "removeFirstSectionMargin", value: function removeFirstSectionMargin() { this.elements.$firstSection.css({ marginTop: 0 }); } /** * Creates a png image. * * @return {Promise<unknown>} URI containing image data */ }, { key: "createImage", value: function createImage() { var _this4 = this; var pageLoadedPromise = new Promise(function (resolve) { window.addEventListener('load', function () { resolve(); }); }); var timeOutPromise = new Promise(function (resolve) { setTimeout(function () { resolve(); }, _this4.getSettings('render_timeout')); }); return Promise.race([pageLoadedPromise, timeOutPromise]).then(function () { _this4.log('Start creating screenshot.'); if (_this4.getSettings('isDebugSvg')) { domtoimage.toSvg(document.body, { imagePlaceholder: _this4.getSettings('image_placeholder') }).then(function (svg) { return _this4.download(svg); }); return Promise.reject('Debug SVG.'); } // TODO: Extract to util function. var isSafari = /^((?!chrome|android).)*safari/i.test(window.userAgent); // Safari browser has some problems with the images that dom-to-images // library creates, so in this specific case the screenshot uses html2canvas. // Note that dom-to-image creates more accurate screenshot in "not safari" browsers. if (isSafari) { _this4.log('Creating screenshot with "html2canvas"'); return html2canvas(document.body).then(function (canvas) { return canvas.toDataURL('image/png'); }); } _this4.log('Creating screenshot with "dom-to-image"'); return domtoimage.toPng(document.body, { imagePlaceholder: _this4.getSettings('image_placeholder') }); }); } /** * Download a uri, use for debugging the svg that created from dom to image libraries. * * @param {string} uri */ }, { key: "download", value: function download(uri) { var $link = jQuery('<a/>', { href: uri, download: 'debugSvg.svg', html: 'Download SVG' }); elementorCommon.elements.$body.append($link); $link.trigger('click'); } /** * Creates fake image element to get the size of the image later on. * * @param {string} dataUrl * @return {Promise<HTMLImageElement>} Image Element */ }, { key: "createImageElement", value: function createImageElement(dataUrl) { var image = new Image(); image.src = dataUrl; return new Promise(function (resolve) { image.onload = function () { return resolve(image); }; }); } /** * Crop the image to requested sizes. * * @param {HTMLImageElement} image * @return {Promise<unknown>} Canvas */ }, { key: "cropCanvas", value: function cropCanvas(image) { var width = this.getSettings('crop.width'); var height = this.getSettings('crop.height'); var cropCanvas = document.createElement('canvas'), cropContext = cropCanvas.getContext('2d'), ratio = width / image.width; cropCanvas.width = width; cropCanvas.height = height > image.height ? image.height : height; cropContext.drawImage(image, 0, 0, image.width, image.height, 0, 0, image.width * ratio, image.height * ratio); return Promise.resolve(cropCanvas); } /** * Send the image to the server. * * @param {HTMLCanvasElement} canvas * @return {Promise<unknown>} Screenshot URL */ }, { key: "save", value: function save(canvas) { var _this5 = this; var isTemplate = this.getSettings('template_id'); var endpoint = isTemplate ? 'save_template_screenshot' : 'screenshot_save'; var data = _objectSpread(_objectSpread({}, isTemplate ? { template_id: this.getSettings('template_id') } : { post_id: this.getSettings('post_id') }), {}, { screenshot: canvas.toDataURL('image/png') }); return new Promise(function (resolve, reject) { elementorCommon.ajax.addRequest(endpoint, { data: data, success: function success(url) { _this5.log("Screenshot created: ".concat(encodeURI(url))); resolve(url); }, error: function error() { _this5.log('Failed to create screenshot.'); reject(); } }); }); } /** * Mark this post screenshot as failed. * @param {Error} e */ }, { key: "markAsFailed", value: function markAsFailed(e) { var _this6 = this; return new Promise(function (resolve, reject) { var templateId = _this6.getSettings('template_id'); var postId = _this6.getSettings('post_id'); var route = templateId ? 'template_screenshot_failed' : 'screenshot_failed'; var data = templateId ? { template_id: templateId, error: e.message || e.toString() } : { post_id: postId }; elementorCommon.ajax.addRequest(route, { data: data, success: function success() { _this6.log("Marked as failed."); resolve(); }, error: function error() { _this6.log('Failed to mark this screenshot as failed.'); reject(); } }); }); } /** * @param {string} url * @return {string} Screenshot Proxy URL */ }, { key: "getScreenshotProxyUrl", value: function getScreenshotProxyUrl(url) { return "".concat(this.getSettings('home_url'), "?screenshot_proxy&nonce=").concat(this.getSettings('nonce'), "&href=").concat(url); } /** * Notify that the screenshot has been succeed. * * @param {string} imageUrl */ }, { key: "screenshotSucceed", value: function screenshotSucceed(imageUrl) { this.screenshotDone(true, imageUrl); } /** * Notify that the screenshot has been failed. * * @param {Error} e */ }, { key: "screenshotFailed", value: function screenshotFailed(e) { var _this7 = this; this.log(e, null); this.markAsFailed(e).then(function () { return _this7.screenshotDone(false); }); } /** * Final method of the screenshot. * * @param {boolean} success * @param {string} imageUrl */ }, { key: "screenshotDone", value: function screenshotDone(success) { var imageUrl = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null; clearTimeout(this.timeoutTimer); this.timeoutTimer = null; var templateId = this.getSettings('template_id'); var postId = this.getSettings('post_id'); var message = templateId ? 'library/capture-screenshot-done' : 'capture-screenshot-done'; // Send the message to the parent window and not to the top. // e.g: The `Theme builder` is loaded into an iFrame so the message of the screenshot // should be sent to the `Theme builder` window and not to the top window. window.parent.postMessage({ name: message, success: success, id: templateId ? templateId : postId, imageUrl: imageUrl }, '*'); this.log("Screenshot ".concat(success ? 'Succeed' : 'Failed', "."), 'timeEnd'); } /** * Log messages for debugging. * * @param {any} message * @param {string?} timerMethod */ }, { key: "log", value: function log(message) { var timerMethod = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'timeLog'; if (!this.getSettings('isDebug')) { return; } // eslint-disable-next-line no-console console.log('string' === typeof message ? "".concat(this.getSettings('post_id'), " - ").concat(message) : message); if (timerMethod) { // eslint-disable-next-line no-console console[timerMethod](this.getSettings('timer_label')); } } }]); }(elementorModules.ViewModule); jQuery(function () { new Screenshot(); }); })(); /******/ })() ; //# sourceMappingURL=cloud-library-screenshot.js.map
Edit
Rename
Chmod
Delete
FILE
FOLDER
Name
Size
Permission
Action
packages
---
0755
025905cd015671d0a830.bundle.min.js
4102 bytes
0644
056b8f3bbbcabf026cd1.bundle.js
44877 bytes
0644
0d1a75a41cae2a76432a.bundle.js
15095 bytes
0644
0f7962315cd2e100f80e.bundle.min.js
36898 bytes
0644
2e387c4154cbf63565b2.bundle.min.js
23677 bytes
0644
3ac06e8b9c2e8f04c57d.bundle.min.js
13406 bytes
0644
4573680c5d8b9b2d9f17.bundle.min.js
5438 bytes
0644
513d3f05d575dabcdc35.bundle.js
63581 bytes
0644
56a155a8adcef506ce8a.bundle.js
271244 bytes
0644
5b6ef966b71e5cf670d8.bundle.min.js
5096 bytes
0644
947434f8f98ed29acc17.bundle.js
113943 bytes
0644
accordion.36aa4c8c4eba17bc8e03.bundle.min.js
3793 bytes
0644
accordion.7b5b5744bdd225280eca.bundle.js
8086 bytes
0644
adbbe9b5d6b520e98e4c.bundle.js
14519 bytes
0644
admin-feedback.js
4612 bytes
0644
admin-feedback.min.js
1959 bytes
0644
admin-modules.js
37153 bytes
0644
admin-modules.min.js
17495 bytes
0644
admin-modules.min.js.LICENSE.txt
149 bytes
0644
admin-notifications.js
315181 bytes
0644
admin-notifications.min.js
90596 bytes
0644
admin-notifications.min.js.LICENSE.txt
249 bytes
0644
admin-top-bar.js
69044 bytes
0644
admin-top-bar.min.js
12611 bytes
0644
admin.js
116564 bytes
0644
admin.min.js
55723 bytes
0644
admin.min.js.LICENSE.txt
149 bytes
0644
ai-admin.js
1981895 bytes
0644
ai-admin.min.js
619403 bytes
0644
ai-admin.min.js.LICENSE.txt
511 bytes
0644
ai-gutenberg.js
2116655 bytes
0644
ai-gutenberg.min.js
648858 bytes
0644
ai-gutenberg.min.js.LICENSE.txt
672 bytes
0644
ai-layout.js
496830 bytes
0644
ai-layout.min.js
193000 bytes
0644
ai-layout.min.js.LICENSE.txt
149 bytes
0644
ai-media-library.js
2099327 bytes
0644
ai-media-library.min.js
643796 bytes
0644
ai-media-library.min.js.LICENSE.txt
672 bytes
0644
ai-unify-product-images.js
2095187 bytes
0644
ai-unify-product-images.min.js
640519 bytes
0644
ai-unify-product-images.min.js.LICENSE.txt
672 bytes
0644
ai.js
2153878 bytes
0644
ai.min.js
666255 bytes
0644
ai.min.js.LICENSE.txt
672 bytes
0644
alert.42cc1d522ef5c60bf874.bundle.min.js
658 bytes
0644
alert.b696182ec6f18a35bc69.bundle.js
1445 bytes
0644
announcements-app.js
101111 bytes
0644
announcements-app.min.js
28104 bytes
0644
announcements-app.min.js.LICENSE.txt
149 bytes
0644
app-loader.js
261466 bytes
0644
app-loader.min.js
90736 bytes
0644
app-packages.js
352758 bytes
0644
app-packages.min.js
122957 bytes
0644
app-packages.min.js.LICENSE.txt
149 bytes
0644
app.js
822376 bytes
0644
app.min.js
291943 bytes
0644
app.min.js.LICENSE.txt
149 bytes
0644
atomic-widgets-editor.js
88737 bytes
0644
atomic-widgets-editor.min.js
34889 bytes
0644
beta-tester.js
21458 bytes
0644
beta-tester.min.js
8870 bytes
0644
c4dcba54ff9219690f00.bundle.min.js
59769 bytes
0644
cf70912a0f34653ad242.bundle.js
25979 bytes
0644
checklist.js
400149 bytes
0644
checklist.min.js
129465 bytes
0644
checklist.min.js.LICENSE.txt
399 bytes
0644
cloud-library-screenshot.js
36265 bytes
0644
cloud-library-screenshot.min.js
14956 bytes
0644
common-modules.js
296260 bytes
0644
common-modules.min.js
104017 bytes
0644
common.js
408987 bytes
0644
common.min.js
154563 bytes
0644
common.min.js.LICENSE.txt
149 bytes
0644
contact-buttons.7c9983ed0d4964b951c2.bundle.min.js
8713 bytes
0644
contact-buttons.c21325756a91b795f8e4.bundle.js
14886 bytes
0644
container-converter.js
52177 bytes
0644
container-converter.min.js
18550 bytes
0644
container-editor-handlers.11e3f73cbe2c3c5ffe24.bundle.js
18454 bytes
0644
container-editor-handlers.7e9a94a0cd0958b8c9ad.bundle.min.js
9646 bytes
0644
counter.12335f45aaa79d244f24.bundle.min.js
946 bytes
0644
counter.f359dee9199f5aad06c6.bundle.js
1933 bytes
0644
dev-tools.js
23856 bytes
0644
dev-tools.min.js
7627 bytes
0644
e-home-screen.js
109439 bytes
0644
e-home-screen.min.js
27743 bytes
0644
e-react-promotions.js
124477 bytes
0644
e-react-promotions.min.js
39714 bytes
0644
e-wc-product-editor.js
106998 bytes
0644
e-wc-product-editor.min.js
17211 bytes
0644
e-wc-product-editor.min.js.LICENSE.txt
160 bytes
0644
e5d6feb1b1d6cf52126f.bundle.js
11262 bytes
0644
editor-document.js
71618 bytes
0644
editor-document.min.js
25915 bytes
0644
editor-environment-v2.js
640 bytes
0644
editor-environment-v2.min.js
246 bytes
0644
editor-loader-v1.js
372 bytes
0644
editor-loader-v1.min.js
88 bytes
0644
editor-loader-v2.js
861 bytes
0644
editor-loader-v2.min.js
444 bytes
0644
editor-modules.js
117667 bytes
0644
editor-modules.min.js
51200 bytes
0644
editor-modules.min.js.LICENSE.txt
149 bytes
0644
editor-notifications.js
325456 bytes
0644
editor-notifications.min.js
94579 bytes
0644
editor-notifications.min.js.LICENSE.txt
249 bytes
0644
editor-v4-opt-in-alphachip.js
59756 bytes
0644
editor-v4-opt-in-alphachip.min.js
8558 bytes
0644
editor-v4-opt-in.js
168726 bytes
0644
editor-v4-opt-in.min.js
55797 bytes
0644
editor-v4-opt-in.min.js.LICENSE.txt
338 bytes
0644
editor-v4-welcome-opt-in.js
60457 bytes
0644
editor-v4-welcome-opt-in.min.js
9600 bytes
0644
editor.js
3376402 bytes
0644
editor.min.js
1413642 bytes
0644
editor.min.js.LICENSE.txt
2000 bytes
0644
element-manager-admin.js
169014 bytes
0644
element-manager-admin.min.js
48187 bytes
0644
element-manager-admin.min.js.LICENSE.txt
310 bytes
0644
elementor-admin-bar.js
18643 bytes
0644
elementor-admin-bar.min.js
7359 bytes
0644
floating-bars.7efeeb8b098e55999ff1.bundle.js
15148 bytes
0644
floating-bars.c1e9838906b386709cd4.bundle.min.js
7943 bytes
0644
floating-elements-modal.js
34512 bytes
0644
floating-elements-modal.min.js
14530 bytes
0644
frontend-modules.js
181469 bytes
0644
frontend-modules.min.js
48393 bytes
0644
frontend.js
100836 bytes
0644
frontend.min.js
32876 bytes
0644
gutenberg.js
7653 bytes
0644
gutenberg.min.js
4100 bytes
0644
image-carousel.1a3e0c6222562304eed5.bundle.js
945 bytes
0644
image-carousel.6167d20b95b33386757b.bundle.min.js
448 bytes
0644
import-export-admin.js
15062 bytes
0644
import-export-admin.min.js
6306 bytes
0644
kit-elements-defaults-editor.js
84627 bytes
0644
kit-elements-defaults-editor.min.js
34775 bytes
0644
kit-elements-defaults-editor.min.js.LICENSE.txt
149 bytes
0644
kit-library.09cb71ec3fbb128f4e25.bundle.min.js
90757 bytes
0644
kit-library.b0f0ab89c95fe1f6fde3.bundle.js
227198 bytes
0644
lightbox.64a93c50cbfc18fcc89b.bundle.min.js
28984 bytes
0644
lightbox.74688eb10c7852662847.bundle.js
49977 bytes
0644
media-hints.js
11982 bytes
0644
media-hints.min.js
6170 bytes
0644
nested-accordion.a0f28ea648b29da812a1.bundle.js
19215 bytes
0644
nested-accordion.c546968f7aebebc356f2.bundle.min.js
9833 bytes
0644
nested-accordion.js
26854 bytes
0644
nested-accordion.min.js
12622 bytes
0644
nested-accordion.min.js.LICENSE.txt
149 bytes
0644
nested-elements.js
20713 bytes
0644
nested-elements.min.js
6451 bytes
0644
nested-tabs.1fde581754604147f6d7.bundle.min.js
11441 bytes
0644
nested-tabs.213892f3e7a826d32481.bundle.js
21299 bytes
0644
nested-tabs.js
26814 bytes
0644
nested-tabs.min.js
12617 bytes
0644
nested-tabs.min.js.LICENSE.txt
149 bytes
0644
nested-title-keyboard-handler.967db65f6ba460c1f2e9.bundle.js
8062 bytes
0644
nested-title-keyboard-handler.fc9d01c2cd0ef46d20fd.bundle.min.js
4358 bytes
0644
new-template.js
15470 bytes
0644
new-template.min.js
6809 bytes
0644
notes.js
24327 bytes
0644
notes.min.js
9275 bytes
0644
onboarding.16755744e5ca197ffd37.bundle.js
132473 bytes
0644
onboarding.e841402524a178024fff.bundle.min.js
61124 bytes
0644
progress.3200f67fe8fb78924bea.bundle.min.js
833 bytes
0644
progress.5d8492a023e85c6cc0e0.bundle.js
1980 bytes
0644
responsive-bar.js
25426 bytes
0644
responsive-bar.min.js
11609 bytes
0644
section-editor-handlers.46a034cbaaa10c6afa92.bundle.js
3498 bytes
0644
section-editor-handlers.e92172888b8bf1cc1517.bundle.min.js
1792 bytes
0644
section-frontend-handlers.d0665d28b9f0b188fe4f.bundle.js
1047 bytes
0644
section-frontend-handlers.d85ab872da118940910d.bundle.min.js
489 bytes
0644
shared-editor-handlers.22c8f376e58bdba40f71.bundle.js
2608 bytes
0644
shared-editor-handlers.a182e3f9ce3b8b1e4b74.bundle.min.js
1389 bytes
0644
shared-frontend-handlers.30dc2f9c080845a413a6.bundle.min.js
8541 bytes
0644
shared-frontend-handlers.a82dc0e60728c9cb9860.bundle.js
16268 bytes
0644
styleguide-app-initiator.js
34775 bytes
0644
styleguide-app-initiator.min.js
15259 bytes
0644
styleguide-app-initiator.min.js.LICENSE.txt
149 bytes
0644
styleguide-app.51d4579e75a5f39265bc.bundle.min.js
27437 bytes
0644
styleguide-app.a6e297c616479b98c03d.bundle.js
68872 bytes
0644
styleguide.js
99166 bytes
0644
styleguide.min.js
45199 bytes
0644
tabs.537e7a0f178447960143.bundle.min.js
3755 bytes
0644
tabs.e808857358793ac13db5.bundle.js
8013 bytes
0644
text-editor.bd4eccbd156d0b1fc3cf.bundle.js
3105 bytes
0644
text-editor.c084ef86600b6f11690d.bundle.min.js
1394 bytes
0644
text-path.795be0048f5240994e8b.bundle.js
71140 bytes
0644
text-path.b4771a659cee68861d30.bundle.min.js
26461 bytes
0644
text-path.b4771a659cee68861d30.bundle.min.js.LICENSE.txt
188 bytes
0644
toggle.375da8e2f6fed12731c2.bundle.js
8117 bytes
0644
toggle.a6177e2e3c2bc8864bef.bundle.min.js
3823 bytes
0644
video.6ebfa2c3f5493cb2eaaf.bundle.min.js
3279 bytes
0644
video.d862fafddbe5d05459f3.bundle.js
6640 bytes
0644
web-cli.js
493081 bytes
0644
web-cli.min.js
172994 bytes
0644
web-cli.min.js.LICENSE.txt
149 bytes
0644
webpack.runtime.js
16620 bytes
0644
webpack.runtime.min.js
5700 bytes
0644
wp-audio.c91cab3152c3f241f266.bundle.js
797 bytes
0644
wp-audio.c9624cb6e5dc9de86abd.bundle.min.js
366 bytes
0644
N4ST4R_ID | Naxtarrr