.updraftcentral_wizard_option { width: 45%; float: left; text-align: center; } .updraftcentral_wizard_option label { margin-bottom: 8px; } #updraftcentral_keys_table { display: none; } .create_key_container { border: 1px solid; border-radius: 4px; padding: 0 0 6px 6px; margin-bottom: 8px; } .updraftcentral-subheading { font-size: 14px; margin-top: -10px; margin-bottom: 20px; } .updraftcentral-data-consent { font-size: 13px; margin-bottom: 10px; } #updraftcentral_keys_table { width: 100%; } #updraftcentral_stage1_go { cursor: pointer; } .updraftcentral_wizard_option > div { margin-top: 5px; } #updraftcentral_keys_table td { line-height: 1.4em; } #updraftcentral_keys_table .updraftcentral_key_delete { display: inline-block; margin-top: 4px; margin-bottom: 4px; } #updraftcentral_keys_table .updraft_debugrow td { min-width: auto !important; } /*! elementor - v3.29.0 - 04-06-2025 */ /******/ (() => { // webpackBootstrap /******/ var __webpack_modules__ = ({ /***/ "../node_modules/@babel/runtime/helpers/asyncToGenerator.js": /*!******************************************************************!*\ !*** ../node_modules/@babel/runtime/helpers/asyncToGenerator.js ***! \******************************************************************/ /***/ ((module) => { function asyncGeneratorStep(n, t, e, r, o, a, c) { try { var i = n[a](c), u = i.value; } catch (n) { return void e(n); } i.done ? t(u) : Promise.resolve(u).then(r, o); } function _asyncToGenerator(n) { return function () { var t = this, e = arguments; return new Promise(function (r, o) { var a = n.apply(t, e); function _next(n) { asyncGeneratorStep(a, r, o, _next, _throw, "next", n); } function _throw(n) { asyncGeneratorStep(a, r, o, _next, _throw, "throw", n); } _next(void 0); }); }; } module.exports = _asyncToGenerator, 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/regeneratorRuntime.js": /*!********************************************************************!*\ !*** ../node_modules/@babel/runtime/helpers/regeneratorRuntime.js ***! \********************************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { var _typeof = (__webpack_require__(/*! ./typeof.js */ "../node_modules/@babel/runtime/helpers/typeof.js")["default"]); function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ module.exports = _regeneratorRuntime = function _regeneratorRuntime() { return e; }, module.exports.__esModule = true, module.exports["default"] = module.exports; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator["return"] && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, "catch": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; } module.exports = _regeneratorRuntime, 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/regenerator/index.js": /*!***********************************************************!*\ !*** ../node_modules/@babel/runtime/regenerator/index.js ***! \***********************************************************/ /***/ ((module, __unused_webpack_exports, __webpack_require__) => { // TODO(Babel 8): Remove this file. var runtime = __webpack_require__(/*! ../helpers/regeneratorRuntime */ "../node_modules/@babel/runtime/helpers/regeneratorRuntime.js")(); module.exports = runtime; // Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736= try { regeneratorRuntime = runtime; } catch (accidentalStrictMode) { if (typeof globalThis === "object") { globalThis.regeneratorRuntime = runtime; } else { Function("r", "regeneratorRuntime = r")(runtime); } } /***/ }) /******/ }); /************************************************************************/ /******/ // 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; /******/ } /******/ /******/ // expose the modules object (__webpack_modules__) /******/ __webpack_require__.m = __webpack_modules__; /******/ /************************************************************************/ /******/ /* webpack/runtime/ensure chunk */ /******/ (() => { /******/ __webpack_require__.f = {}; /******/ // This file contains only the entry chunk. /******/ // The chunk loading function for additional chunks /******/ __webpack_require__.e = (chunkId) => { /******/ return Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => { /******/ __webpack_require__.f[key](chunkId, promises); /******/ return promises; /******/ }, [])); /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/get javascript chunk filename */ /******/ (() => { /******/ // This function allow to reference async chunks /******/ __webpack_require__.u = (chunkId) => { /******/ // return url for filenames not based on template /******/ if (chunkId === "modules_nested-tabs_assets_js_editor_module_js") return "0d1a75a41cae2a76432a.bundle.js"; /******/ // return url for filenames based on template /******/ return undefined; /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/global */ /******/ (() => { /******/ __webpack_require__.g = (function() { /******/ if (typeof globalThis === 'object') return globalThis; /******/ try { /******/ return this || new Function('return this')(); /******/ } catch (e) { /******/ if (typeof window === 'object') return window; /******/ } /******/ })(); /******/ })(); /******/ /******/ /* webpack/runtime/hasOwnProperty shorthand */ /******/ (() => { /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) /******/ })(); /******/ /******/ /* webpack/runtime/load script */ /******/ (() => { /******/ var inProgress = {}; /******/ var dataWebpackPrefix = "elementor:"; /******/ // loadScript function to load a script via script tag /******/ __webpack_require__.l = (url, done, key, chunkId) => { /******/ if(inProgress[url]) { inProgress[url].push(done); return; } /******/ var script, needAttach; /******/ if(key !== undefined) { /******/ var scripts = document.getElementsByTagName("script"); /******/ for(var i = 0; i < scripts.length; i++) { /******/ var s = scripts[i]; /******/ if(s.getAttribute("src") == url || s.getAttribute("data-webpack") == dataWebpackPrefix + key) { script = s; break; } /******/ } /******/ } /******/ if(!script) { /******/ needAttach = true; /******/ script = document.createElement('script'); /******/ /******/ script.charset = 'utf-8'; /******/ script.timeout = 120; /******/ if (__webpack_require__.nc) { /******/ script.setAttribute("nonce", __webpack_require__.nc); /******/ } /******/ script.setAttribute("data-webpack", dataWebpackPrefix + key); /******/ /******/ script.src = url; /******/ } /******/ inProgress[url] = [done]; /******/ var onScriptComplete = (prev, event) => { /******/ // avoid mem leaks in IE. /******/ script.onerror = script.onload = null; /******/ clearTimeout(timeout); /******/ var doneFns = inProgress[url]; /******/ delete inProgress[url]; /******/ script.parentNode && script.parentNode.removeChild(script); /******/ doneFns && doneFns.forEach((fn) => (fn(event))); /******/ if(prev) return prev(event); /******/ } /******/ var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000); /******/ script.onerror = onScriptComplete.bind(null, script.onerror); /******/ script.onload = onScriptComplete.bind(null, script.onload); /******/ needAttach && document.head.appendChild(script); /******/ }; /******/ })(); /******/ /******/ /* webpack/runtime/publicPath */ /******/ (() => { /******/ var scriptUrl; /******/ if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + ""; /******/ var document = __webpack_require__.g.document; /******/ if (!scriptUrl && document) { /******/ if (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT') /******/ scriptUrl = document.currentScript.src; /******/ if (!scriptUrl) { /******/ var scripts = document.getElementsByTagName("script"); /******/ if(scripts.length) { /******/ var i = scripts.length - 1; /******/ while (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src; /******/ } /******/ } /******/ } /******/ // When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration /******/ // or pass an empty string ("") and set the __webpack_public_path__ variable from your code to use your own logic. /******/ if (!scriptUrl) throw new Error("Automatic publicPath is not supported in this browser"); /******/ scriptUrl = scriptUrl.replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/"); /******/ __webpack_require__.p = scriptUrl; /******/ })(); /******/ /******/ /* webpack/runtime/jsonp chunk loading */ /******/ (() => { /******/ // no baseURI /******/ /******/ // object to store loaded and loading chunks /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched /******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded /******/ var installedChunks = { /******/ "nested-tabs": 0 /******/ }; /******/ /******/ __webpack_require__.f.j = (chunkId, promises) => { /******/ // JSONP chunk loading for javascript /******/ var installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined; /******/ if(installedChunkData !== 0) { // 0 means "already installed". /******/ /******/ // a Promise means "currently loading". /******/ if(installedChunkData) { /******/ promises.push(installedChunkData[2]); /******/ } else { /******/ if(true) { // all chunks have JS /******/ // setup Promise in chunk cache /******/ var promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject])); /******/ promises.push(installedChunkData[2] = promise); /******/ /******/ // start chunk loading /******/ var url = __webpack_require__.p + __webpack_require__.u(chunkId); /******/ // create error before stack unwound to get useful stacktrace later /******/ var error = new Error(); /******/ var loadingEnded = (event) => { /******/ if(__webpack_require__.o(installedChunks, chunkId)) { /******/ installedChunkData = installedChunks[chunkId]; /******/ if(installedChunkData !== 0) installedChunks[chunkId] = undefined; /******/ if(installedChunkData) { /******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type); /******/ var realSrc = event && event.target && event.target.src; /******/ error.message = 'Loading chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')'; /******/ error.name = 'ChunkLoadError'; /******/ error.type = errorType; /******/ error.request = realSrc; /******/ installedChunkData[1](error); /******/ } /******/ } /******/ }; /******/ __webpack_require__.l(url, loadingEnded, "chunk-" + chunkId, chunkId); /******/ } /******/ } /******/ } /******/ }; /******/ /******/ // no prefetching /******/ /******/ // no preloaded /******/ /******/ // no HMR /******/ /******/ // no HMR manifest /******/ /******/ // no on chunks loaded /******/ /******/ // install a JSONP callback for chunk loading /******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => { /******/ var [chunkIds, moreModules, runtime] = data; /******/ // add "moreModules" to the modules object, /******/ // then flag all "chunkIds" as loaded and fire callback /******/ var moduleId, chunkId, i = 0; /******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) { /******/ for(moduleId in moreModules) { /******/ if(__webpack_require__.o(moreModules, moduleId)) { /******/ __webpack_require__.m[moduleId] = moreModules[moduleId]; /******/ } /******/ } /******/ if(runtime) var result = runtime(__webpack_require__); /******/ } /******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data); /******/ for(;i < chunkIds.length; i++) { /******/ chunkId = chunkIds[i]; /******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) { /******/ installedChunks[chunkId][0](); /******/ } /******/ installedChunks[chunkId] = 0; /******/ } /******/ /******/ } /******/ /******/ var chunkLoadingGlobal = self["webpackChunkelementor"] = self["webpackChunkelementor"] || []; /******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0)); /******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal)); /******/ })(); /******/ /************************************************************************/ var __webpack_exports__ = {}; // This entry needs to be wrapped in an IIFE because it needs to be in strict mode. (() => { "use strict"; /*!********************************************************!*\ !*** ../modules/nested-tabs/assets/js/editor/index.js ***! \********************************************************/ var _interopRequireDefault = __webpack_require__(/*! @babel/runtime/helpers/interopRequireDefault */ "../node_modules/@babel/runtime/helpers/interopRequireDefault.js"); var _regenerator = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/regenerator */ "../node_modules/@babel/runtime/regenerator/index.js")); var _asyncToGenerator2 = _interopRequireDefault(__webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ "../node_modules/@babel/runtime/helpers/asyncToGenerator.js")); elementorCommon.elements.$window.on('elementor/nested-element-type-loaded', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee() { return _regenerator.default.wrap(function _callee$(_context) { while (1) switch (_context.prev = _context.next) { case 0: _context.next = 2; return __webpack_require__.e(/*! import() */ "modules_nested-tabs_assets_js_editor_module_js").then(__webpack_require__.bind(__webpack_require__, /*! ../editor/module */ "../modules/nested-tabs/assets/js/editor/module.js")); case 2: _context.t0 = _context.sent.default; new _context.t0(); case 4: case "end": return _context.stop(); } }, _callee); }))); })(); /******/ })() ; //# sourceMappingURL=nested-tabs.js.map/*! * Font Awesome Free 5.15.3 by @fontawesome - https://fontawesome.com * License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) */ @font-face{font-family:"Font Awesome 5 Free";font-style:normal;font-weight:900;font-display:block;src:url(../webfonts/fa-solid-900.eot);src:url(../webfonts/fa-solid-900.eot?#iefix) format("embedded-opentype"),url(../webfonts/fa-solid-900.woff2) format("woff2"),url(../webfonts/fa-solid-900.woff) format("woff"),url(../webfonts/fa-solid-900.ttf) format("truetype"),url(../webfonts/fa-solid-900.svg#fontawesome) format("svg")}.fa,.fas{font-family:"Font Awesome 5 Free";font-weight:900}/*! elementor-pro - v3.29.0 - 04-06-2025 */ .woocommerce .elementor-widget-woocommerce-product-rating .elementor-widget-container .woocommerce-product-rating,.woocommerce .elementor-widget-woocommerce-product-rating:not(:has(.elementor-widget-container)) .woocommerce-product-rating{align-items:center;display:flex;margin-bottom:0}.woocommerce .elementor-widget-woocommerce-product-rating .elementor-widget-container .star-rating,.woocommerce .elementor-widget-woocommerce-product-rating:not(:has(.elementor-widget-container)) .star-rating{margin-top:0}.elementor-product-rating--align-left .woocommerce-product-rating{justify-content:flex-end}.elementor-product-rating--align-right .woocommerce-product-rating{justify-content:flex-start}.elementor-product-rating--align-center .woocommerce-product-rating{justify-content:center}.elementor-product-rating--align-justify .woocommerce-product-rating .woocommerce-review-link{margin-right:auto}@keyframes elementor-animation-pulse { 25% { transform: scale(1.1); } 75% { transform: scale(0.9); } } .elementor-animation-pulse:active, .elementor-animation-pulse:focus, .elementor-animation-pulse:hover { animation-name: elementor-animation-pulse; animation-duration: 1s; animation-timing-function: linear; animation-iteration-count: infinite; } @keyframes zoomInUp { from { opacity: 0; transform: scale3d(0.1, 0.1, 0.1) translate3d(0, 1000px, 0); animation-timing-function: cubic-bezier(0.55, 0.055, 0.675, 0.19); } 60% { opacity: 1; transform: scale3d(0.475, 0.475, 0.475) translate3d(0, -60px, 0); animation-timing-function: cubic-bezier(0.175, 0.885, 0.32, 1); } } .zoomInUp { animation-name: zoomInUp; }
Who we are

Thank you for using the Stylemix Themes. We are an US based company, creating WordPress themes and plugins to enhance your website building experience.

Providing consent to both our Terms and Conditions and this Privacy Policy is necessary in order to use our support services.

Definitions

Throughout this document, we may use certain words or phrases, and it is important that you understand the meaning of them. The following is a non-exhaustive list of definitions of words and phrases found in this document:

What personal data we collect and why we collect it

We are an US based company and operate web servers and CDN service hosted in the US by DigitalOcean. Our hosting provider adheres to the EU/US "privacy_policy.php", ensuring that your data is securely stored and GDPR compliant. For more information on DigitalOcean privacy policy, please see here: DigitalOcean Privacy Policy.

Purchase Data

To use our themes and plugins and receive support, you have to register one or more Envato purchase codes on our site. These purchase codes will be stored together with support expiration dates and your website domain. This is required for us to provide you with downloads, product support and other customer services. We manage all this data according to Envato policies and rulers, as well as GDPR requirements.

Identifying Data

If you register on our website, we store your chosen username and your email address and any additional personal information added by yourself to your user profile. You can see, edit, or delete your personal information at any time (except changing your username). Website administrators can also see and edit this information.

The information we collect from you to the extent that it is private is disclosed only in accordance with our Terms of Service and/or this Privacy Policy.

Support Data

In order to receive technical support, you need to register on our Site or use a Live Chat facilities provided by Intercom. Only the data you explicitly provided is sent to our Site or Live Chat. You can see the Intercom privacy policy here: Intercom Terms & Policies.

Non-Identifying Data

As is true of most websites, we gather certain information automatically and store it in log files. In addition, when you use our Services, we may collect certain information automatically from your device. This information may include internet protocol (IP) addresses, browser type, internet service provider (ISP), referring/exit pages, operating system, date/time stamp, clickstream data, landing page, and referring URL. To collect this information, a cookie may be set on your computer or device when you visit our Services. Cookies contain a small amount of information that allows our web servers to recognize you.

We store information that we collect through cookies, log files, and/or clear gifs to record your preferences. We may also automatically collect information about your use of features of our Services, about the functionality of our Services, frequency of visits, and other information related to your interactions with the Services. We may track your use across different websites and services. In some countries, including countries in the European Economic Area ("EEA"), the information referenced above in this paragraph may be considered personal information under applicable data protection laws. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, this information alone cannot usually be used to identify you.

Comments

// tipsy, facebook style tooltips for jquery // version 1.0.0a // (c) 2008-2010 jason frame [jason@onehackoranother.com] // released under the MIT license (function($) { function maybeCall(thing, ctx) { return (typeof thing == 'function') ? (thing.call(ctx)) : thing; }; function isElementInDOM(ele) { while (ele = ele.parentNode) { if (ele == document) return true; } return false; }; function Tipsy(element, options) { this.$element = $(element); this.options = options; this.enabled = true; this.fixTitle(); }; Tipsy.prototype = { show: function() { var title = this.getTitle(); if (title && this.enabled) { var $tip = this.tip(); $tip.find('.tipsy-inner')[this.options.html ? 'html' : 'text'](title); $tip[0].className = 'tipsy'; // reset classname in case of dynamic gravity $tip.remove().css({top: 0, left: 0, visibility: 'hidden', display: 'block'}).prependTo(document.body); var pos = $.extend({}, this.$element.offset(), { width: this.$element[0].offsetWidth, height: this.$element[0].offsetHeight }); var actualWidth = $tip[0].offsetWidth, actualHeight = $tip[0].offsetHeight, gravity = maybeCall(this.options.gravity, this.$element[0]); var tp; switch (gravity.charAt(0)) { case 'n': tp = {top: pos.top + pos.height + this.options.offset, left: pos.left + pos.width / 2 - actualWidth / 2}; break; case 's': tp = {top: pos.top - actualHeight - this.options.offset, left: pos.left + pos.width / 2 - actualWidth / 2}; break; case 'e': tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth - this.options.offset}; break; case 'w': tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width + this.options.offset}; break; } if (gravity.length == 2) { if (gravity.charAt(1) == 'w') { tp.left = pos.left + pos.width / 2 - 15; } else { tp.left = pos.left + pos.width / 2 - actualWidth + 15; } } $tip.css(tp).addClass('tipsy-' + gravity); $tip.find('.tipsy-arrow')[0].className = 'tipsy-arrow tipsy-arrow-' + gravity.charAt(0); if (this.options.className) { $tip.addClass(maybeCall(this.options.className, this.$element[0])); } if (this.options.fade) { $tip.stop().css({opacity: 0, display: 'block', visibility: 'visible'}).animate({opacity: this.options.opacity}); } else { $tip.css({visibility: 'visible', opacity: this.options.opacity}); } } }, hide: function() { if (this.options.fade) { this.tip().stop().fadeOut(function() { $(this).remove(); }); } else { this.tip().remove(); } }, fixTitle: function() { var $e = this.$element; if ($e.attr('title') || typeof($e.attr('original-title')) != 'string') { $e.attr('original-title', $e.attr('title') || '').removeAttr('title'); } }, getTitle: function() { var title, $e = this.$element, o = this.options; this.fixTitle(); var title, o = this.options; if (typeof o.title == 'string') { title = $e.attr(o.title == 'title' ? 'original-title' : o.title); } else if (typeof o.title == 'function') { title = o.title.call($e[0]); } title = ('' + title).replace(/(^\s*|\s*$)/, ""); return title || o.fallback; }, tip: function() { if (!this.$tip) { this.$tip = $('
').html('
'); this.$tip.data('tipsy-pointee', this.$element[0]); } return this.$tip; }, validate: function() { if (!this.$element[0].parentNode) { this.hide(); this.$element = null; this.options = null; } }, enable: function() { this.enabled = true; }, disable: function() { this.enabled = false; }, toggleEnabled: function() { this.enabled = !this.enabled; } }; $.fn.tipsy = function(options) { if (options === true) { return this.data('tipsy'); } else if (typeof options == 'string') { var tipsy = this.data('tipsy'); if (tipsy) tipsy[options](); return this; } options = $.extend({}, $.fn.tipsy.defaults, options); function get(ele) { var tipsy = $.data(ele, 'tipsy'); if (!tipsy) { tipsy = new Tipsy(ele, $.fn.tipsy.elementOptions(ele, options)); $.data(ele, 'tipsy', tipsy); } return tipsy; } function enter() { var tipsy = get(this); tipsy.hoverState = 'in'; if (options.delayIn == 0) { tipsy.show(); } else { tipsy.fixTitle(); setTimeout(function() { if (tipsy.hoverState == 'in') tipsy.show(); }, options.delayIn); } }; function leave() { var tipsy = get(this); tipsy.hoverState = 'out'; if (options.delayOut == 0) { tipsy.hide(); } else { setTimeout(function() { if (tipsy.hoverState == 'out') tipsy.hide(); }, options.delayOut); } }; if (!options.live) this.each(function() { get(this); }); if (options.trigger != 'manual') { var binder = options.live ? 'live' : 'bind', eventIn = options.trigger == 'hover' ? 'mouseenter' : 'focus', eventOut = options.trigger == 'hover' ? 'mouseleave' : 'blur'; this[binder](eventIn, enter)[binder](eventOut, leave); } return this; }; $.fn.tipsy.defaults = { className: null, delayIn: 0, delayOut: 0, fade: false, fallback: '', gravity: 'n', html: false, live: false, offset: 0, opacity: 0.8, title: 'title', trigger: 'hover' }; $.fn.tipsy.revalidate = function() { $('.tipsy').each(function() { var pointee = $.data(this, 'tipsy-pointee'); if (!pointee || !isElementInDOM(pointee)) { $(this).remove(); } }); }; // Overwrite this method to provide options on a per-element basis. // For example, you could store the gravity in a 'tipsy-gravity' attribute: // return $.extend({}, options, {gravity: $(ele).attr('tipsy-gravity') || 'n' }); // (remember - do not modify 'options' in place!) $.fn.tipsy.elementOptions = function(ele, options) { return $.metadata ? $.extend({}, options, $(ele).metadata()) : options; }; $.fn.tipsy.autoNS = function() { return $(this).offset().top > ($(document).scrollTop() + $(window).height() / 2) ? 's' : 'n'; }; $.fn.tipsy.autoWE = function() { return $(this).offset().left > ($(document).scrollLeft() + $(window).width() / 2) ? 'e' : 'w'; }; /** * yields a closure of the supplied parameters, producing a function that takes * no arguments and is suitable for use as an autogravity function like so: * * @param margin (int) - distance from the viewable region edge that an * element should be before setting its tooltip's gravity to be away * from that edge. * @param prefer (string, e.g. 'n', 'sw', 'w') - the direction to prefer * if there are no viewable region edges effecting the tooltip's * gravity. It will try to vary from this minimally, for example, * if 'sw' is preferred and an element is near the right viewable * region edge, but not the top edge, it will set the gravity for * that element's tooltip to be 'se', preserving the southern * component. */ $.fn.tipsy.autoBounds = function(margin, prefer) { return function() { var dir = {ns: prefer[0], ew: (prefer.length > 1 ? prefer[1] : false)}, boundTop = $(document).scrollTop() + margin, boundLeft = $(document).scrollLeft() + margin, $this = $(this); if ($this.offset().top < boundTop) dir.ns = 'n'; if ($this.offset().left < boundLeft) dir.ew = 'w'; if ($(window).width() + $(document).scrollLeft() - $this.offset().left < margin) dir.ew = 'e'; if ($(window).height() + $(document).scrollTop() - $this.offset().top < margin) dir.ns = 's'; return dir.ns + (dir.ew ? dir.ew : ''); } }; })(jQuery); var sbiBuilder, sbiStorage = window.localStorage, sketch = VueColor.Sketch, dummyLightBoxComponent = 'sbi-dummy-lightbox-component'; Vue.component( dummyLightBoxComponent , { template: '#' + dummyLightBoxComponent, props: ['customizerFeedData','parent','dummyLightBoxScreen'] }); /** * VueJS Global App Builder * * @since 4.0 */ sbiBuilder = new Vue({ el: '#sbi-builder-app', http: { emulateJSON: true, emulateHTTP: true }, components: { 'sketch-picker': sketch, }, mixins: [VueClickaway.mixin], data: { nonce: sbi_builder.nonce, admin_nonce: sbi_builder.admin_nonce, template: sbi_builder.feedInitOutput, templateRender: false, updatedTimeStamp: new Date().getTime(), feedSettingsDomOptions: null, $parent: this, plugins: sbi_builder.installPluginsPopup, dismissLite: sbi_builder.instagram_feed_dismiss_lite, supportPageUrl: sbi_builder.supportPageUrl, builderUrl: sbi_builder.builderUrl, pluginType: sbi_builder.pluginType, genericText: sbi_builder.genericText, ajaxHandler: sbi_builder.ajax_handler, adminPostURL: sbi_builder.adminPostURL, widgetsPageURL: sbi_builder.widgetsPageURL, themeSupportsWidgets: sbi_builder.themeSupportsWidgets, translatedText: sbi_builder.translatedText, socialShareLink: sbi_builder.socialShareLink, licenseType: sbi_builder.licenseType, freeCtaShowFeatures: false, upgradeUrl: sbi_builder.upgradeUrl, pluginUrl: sbi_builder.pluginUrl, welcomeScreen: sbi_builder.welcomeScreen, allFeedsScreen: sbi_builder.allFeedsScreen, extensionsPopup: sbi_builder.extensionsPopup, mainFooterScreen: sbi_builder.mainFooterScreen, embedPopupScreen: sbi_builder.embedPopupScreen, selectSourceScreen: sbi_builder.selectSourceScreen, customizeScreensText: sbi_builder.customizeScreens, dialogBoxPopupScreen: sbi_builder.dialogBoxPopupScreen, selectFeedTypeScreen: sbi_builder.selectFeedTypeScreen, addFeaturedPostScreen: sbi_builder.addFeaturedPostScreen, addFeaturedAlbumScreen: sbi_builder.addFeaturedAlbumScreen, addVideosPostScreen: sbi_builder.addVideosPostScreen, dummyLightBoxData: sbi_builder.dummyLightBoxData, dummyLightBoxScreen : false, svgIcons: sbi_builder.svgIcons, feedsList: sbi_builder.feeds, manualSourcePopupInit: sbi_builder.manualSourcePopupInit, feedTypes: sbi_builder.feedTypes, socialInfo: sbi_builder.socialInfo, sourcesList: sbi_builder.sources, links: sbi_builder.links, legacyFeedsList: sbi_builder.legacyFeeds, activeExtensions: sbi_builder.activeExtensions, advancedFeedTypes: sbi_builder.advancedFeedTypes, //Selected Feed type => User Hashtag Tagged selectedFeed: ['user'], selectedFeedPopup: [], selectedSources: [], selectedSourcesPopup: [], selectedSourcesTagged: [], selectedSourcesTaggedPopup: [], selectedSourcesUser: [], selectedSourcesUserPopup: [], selectedHastags: [], selectedHastagsPopup: [], hashtagInputText: '', hashtagOrderBy: 'recent', viewsActive: { //Screens where the footer widget is disabled footerDiabledScreens: [ 'welcome', 'selectFeed' ], footerWidget: false, // welcome, selectFeed pageScreen: 'welcome', // feedsType, selectSource, feedsTypeGetProcess selectedFeedSection: 'feedsType', sourcePopup: false, feedtypesPopup: false, feedtypesCustomizerPopup: false, sourcesListPopup: false, // step_1 [Add New Source] , step_2 [Connect to a user pages/groups], step_3 [Add Manually] sourcePopupScreen: 'redirect_1', // creation or customizer sourcePopupType: 'creation', extensionsPopupElement: false, feedTypeElement: null, instanceFeedActive: null, clipboardCopiedNotif: false, legacyFeedsShown: false, editName: false, embedPopup: false, embedPopupScreen: 'step_1', embedPopupSelectedPage: null, moderationMode: false, // onboarding onboardingPopup: sbi_builder.allFeedsScreen.onboarding.active, onboardingStep: 1, // customizer onboarding onboardingCustomizerPopup: sbi_builder.customizeScreens.onboarding.active, // plugin install popup installPluginPopup: false, installPluginModal: 'facebook' }, //Feeds Pagination feedPagination: { feedsCount: sbi_builder.feedsCount != undefined ? sbi_builder.feedsCount : null, pagesNumber: 1, currentPage: 1, itemsPerPage: sbi_builder.itemsPerPage != undefined ? sbi_builder.itemsPerPage : null, }, //Add New Source newSourceData: sbi_builder.newSourceData ? sbi_builder.newSourceData : null, sourceConnectionURLs: sbi_builder.sourceConnectionURLs, returnedApiSourcesList: [], addNewSource: { typeSelected: 'page', manualSourceID: null, manualSourceToken: null }, selectedSourcesToConnect: [], //Feeds Types Get Info extraProcessFeedsTypes: [ //'events', 'singlealbum', 'featuredpost', 'videos' ], isCreateProcessGood: false, feedCreationInfoUrl: null, feedTypeOnSourcePopup: 'user', feedsSelected: [], selectedBulkAction: false, singleAlbumFeedInfo: { url: '', info: {}, success: false, isError: false }, featuredPostFeedInfo: { url: '', info: {}, success: false, isError: false }, videosTypeInfo: { type: 'all', info: {}, playListUrl: null, success: false, playListUrlError: false }, customizerFeedDataInitial: null, customizerFeedData: sbi_builder.customizerFeedData, wordpressPageLists: sbi_builder.wordpressPageLists, iscustomizerScreen: (sbi_builder.customizerFeedData != undefined && sbi_builder.customizerFeedData != false), customizerSidebarBuilder: sbi_builder.customizerSidebarBuilder, customizerScreens: { activeTab: 'customize', printedType: {}, activeSection: null, previewScreen: 'desktop', sourceExpanded: null, sourcesChoosed: [], inputNameWidth: '0px', activeSectionData: null, parentActiveSection: null, //For nested Setions parentActiveSectionData: null, //For nested Setions activeColorPicker: null, popupBackButton: ['hashtag', 'tagged', 'socialwall', 'feedLayout', 'headerLayout', 'postStyling', 'lightbox', 'filtermoderation', 'shoppablefeed'] }, previewScreens: [ 'desktop', 'tablet', 'mobile' ], nestedStylingSection: [ ], expandedCaptions: [], sourceToDelete: {}, feedToDelete: {}, dialogBox: { active: false, type: null, //deleteSourceCustomizer heading: null, description: null, customButtons: undefined }, feedStyle: '', expandedPostText: [], showedSocialShareTooltip: null, showedCommentSection: [], //LightBox Object lightBox: { visibility: 'hidden', type: null, post: null, activeImage: null, albumIndex: 0, videoSource: null }, highLightedSection: 'all', shoppableFeed: { postId: null, postMedia: null, postCaption: null, postShoppableUrl: '' }, moderationSettings: { list_type_selected: null, allow_list: [], block_list: [] }, customBlockModerationlistTemp: '', tooltip: { text: '', hover: false, hoverType: 'outside' }, //Loading Bar fullScreenLoader: false, appLoaded: false, previewLoaded: false, loadingBar: true, notificationElement: { type: 'success', // success, error, warning, message text: '', shown: null }, //Moderation & Shoppable Mode moderationShoppableMode: false, moderationShoppableModeAjaxDone: false, moderationShoppableModeOffset: 0, onboardingWizardContent : sbi_builder.onboardingWizardContent, currentOnboardingWizardStep : 0, onboardingWizardStepContent : {}, currentOnboardingWizardActiveSettings : {}, onboardingSuccessMessages : sbi_builder.onboardingWizardContent.successMessages, onboardingSuccessMessagesDisplay : [], onboardingWizardDone : 'false', isSetupPage : sbi_builder.isSetupPage, setupLicencekey : '', setupLicencekeyError : null, licenseLoading : false }, watch: { feedPreviewOutput: function () { return this.feedPreviewMaker() }, }, computed: { feedStyleOutput: function () { return this.customizerStyleMaker(); }, singleHolderData: function () { return this.singleHolderParams(); }, getModerationShoppableMode: function () { return false; } }, updated: function () { if (this.customizerFeedData) { this.setShortcodeGlobalSettings(true); } }, created: function () { var self = this; this.$parent = self; if (self.customizerFeedData) { self.template = String("
" + self.template + "
"); self.setShortcodeGlobalSettings(true); self.feedSettingsDomOptions = self.jsonParse(jQuery("html").find("#sb_instagram").attr('data-options')); self.selectedSources = self.customizerFeedData.settings.id; self.selectedSourcesUser = self.customizerFeedData.settings.id; self.selectedSourcesTagged = self.customizerFeedData.settings.tagged; self.selectedHastags = self.customizerFeedData.settings.hashtag; self.selectedFeed = self.getCustomizerSelectedFeedsType(); self.selectedFeedPopup = self.getCustomizerSelectedFeedsType(); self.customizerFeedData.settings.shoppablelist = self.jsonParse(self.customizerFeedData.settings.shoppablelist) ? self.jsonParse(self.customizerFeedData.settings.shoppablelist) : []; self.customizerFeedData.settings.moderationlist = self.jsonParse(self.customizerFeedData.settings.moderationlist) ? self.jsonParse(self.customizerFeedData.settings.moderationlist) : self.moderationSettings; Object.assign(self.moderationSettings, self.customizerFeedData.settings.moderationlist); self.customBlockModerationlistTemp = `${self.customizerFeedData.settings.customBlockModerationlist}`; self.customizerFeedDataInitial = JSON.parse(JSON.stringify(self.customizerFeedData)); self.updatedTimeStamp = new Date().getTime(); } if (self.customizerFeedData == undefined) { self.feedPagination.pagesNumber = self.feedPagination.feedsCount != null ? Math.ceil(self.feedPagination.feedsCount / self.feedPagination.itemsPerPage) : 1 } window.addEventListener('beforeunload', (event) => { if (self.customizerFeedData) { self.leaveWindowHandler(event); } }); if(self?.onboardingWizardContent !== undefined){ self?.onboardingWizardContent.steps.forEach( step => { self.onboardingWizardStepContent[step.id] = step; } ); self.checkActiveOnboardingWizardSettings() } self.loadingBar = false; /* Onboarding - move elements so the position is in context */ self.positionOnboarding(); setTimeout(function () { self.positionOnboarding(); }, 500); if( sbiStorage?.isSetupPage !== 'true' && sbiStorage?.isSetupPage !== true ){ self.appLoaded = true; } if(sbiStorage?.setCurrentStep !== undefined){ self.currentOnboardingWizardStep = 1; sbiStorage.removeItem("setCurrentStep"); } }, methods: { updateColorValue: function (id) { var self = this; self.customizerFeedData.settings[id] = (self.customizerFeedData.settings[id].a == 1) ? self.customizerFeedData.settings[id].hex : self.customizerFeedData.settings[id].hex8; }, /** * Leave Window Handler * * @since 6.0 */ leaveWindowHandler: function (ev) { var self = this, updateFeedData = { action: 'sbi_feed_saver_manager_recache_feed', feedID: self.customizerFeedData.feed_info.id, }; self.ajaxPost(updateFeedData, function (_ref) { var data = _ref.data; }); }, /** * Show & Hide View * * @since 6.0 */ activateView: function (viewName, sourcePopupType = 'creation', ajaxAction = false) { var self = this; if (viewName === 'extensionsPopupElement' && self.customizerFeedData !== undefined && (self.viewsActive.extensionsPopupElement == 'tagged' || self.viewsActive.extensionsPopupElement == 'hashtag')) { self.activateView('feedtypesPopup'); } self.viewsActive[viewName] = (self.viewsActive[viewName] == false) ? true : false; if (viewName === 'sourcePopup') { self.viewsActive.sourcePopupType = sourcePopupType; if (self.customizerFeedData != undefined && sourcePopupType != 'updateCustomizer') { Object.assign(self.customizerScreens.sourcesChoosed, self.customizerFeedData.settings.sources); } if (self.customizerFeedData != undefined && sourcePopupType == 'updateCustomizer') { //self.viewsActive.sourcesListPopup = true; //self.viewsActive.sourcePopupType = 'customizer'; //self.viewsActive.sourcePopup = true; //self.customizerFeedData.settings.sources = self.customizerScreens.sourcesChoosed; } if (ajaxAction !== false) { self.customizerControlAjaxAction(ajaxAction); } } if (viewName === 'feedtypesPopup') { self.viewsActive.feedTypeElement = null; } if (viewName == 'editName') { document.getElementById("sbi-csz-hd-input").focus(); } if (viewName == 'embedPopup' && ajaxAction == true) { self.saveFeedSettings(); } if ((viewName == 'sourcePopup' || viewName == 'sourcePopupType') && sourcePopupType == 'creationRedirect') { self.viewsActive.sourcePopupScreen = 'redirect_1'; setTimeout(function () { self.$refs.addSourceRef.processIFConnect() }, 3500); } sbiBuilder.$forceUpdate(); self.movePopUp(); }, /** * Show/Hide View or Redirect to plugin dashboard page * * @since 4.0 */ activateViewOrRedirect: function (viewName, pluginName, plugin) { var self = this; if (plugin.installed && plugin.activated) { window.location = plugin.dashboard_permalink; return; } self.viewsActive[viewName] = (self.viewsActive[viewName] == false) ? true : false; if (viewName == 'installPluginPopup') { self.viewsActive.installPluginModal = pluginName; } self.movePopUp(); sbiBuilder.$forceUpdate(); }, movePopUp: function () { var overlay = document.querySelectorAll("sb-fs-boss"); if (overlay.length > 0) { document.getElementById("wpbody-content").prepend(overlay[0]); } }, /** * Check if View is Active * * @since 4.0 * * @return boolean */ checkActiveView: function (viewName) { return this.viewsActive[viewName]; }, /** * Switch & Change Feed Screens * * @since 4.0 */ switchScreen: function (screenType, screenName) { this.viewsActive[screenType] = screenName; sbiBuilder.$forceUpdate(); }, /** * Check if Value is Empty * * @since 4.0 * * @return boolean */ checkNotEmpty: function (value) { return value != null && value.replace(/ /gi, '') != ''; }, /** * Check if Value exists in Array Object * * @since 4.0 * * @return boolean */ checkObjectArrayElement: function (objectArray, object, byWhat) { var objectResult = objectArray.filter(function (elem) { return elem[byWhat] == object[byWhat]; }); return (objectResult.length > 0) ? true : false; }, /** * Check if Data Setting is Enabled * * @since 4.0 * * @return boolean */ valueIsEnabled: function (value) { return value == 1 || value == true || value == 'true' || value == 'on'; }, /** * Parse JSON * * @since 4.0 * * @return jsonObject / Boolean */ jsonParse: function (jsonString) { try { return JSON.parse(jsonString); } catch (e) { return false; } }, /** * Ajax Post Action * * @since 4.0 */ ajaxPost: function (data, callback) { var self = this; data['nonce'] = data.nonce ? data.nonce : this.nonce; self.$http.post(self.ajaxHandler, data).then(callback); }, /** * Check if Object has Nested Property * * @since 4.0 * * @return boolean */ hasOwnNestedProperty: function (obj, propertyPath) { if (!propertyPath) { return false; } var properties = propertyPath.split('.'); for (var i = 0; i < properties.length; i++) { var prop = properties[i]; if (!obj || !obj.hasOwnProperty(prop)) { return false; } else { obj = obj[prop]; } } return true; }, /** * Feed List Pagination * * @since 4.0 */ feedListPagination: function (type) { var self = this, currentPage = self.feedPagination.currentPage, pagesNumber = self.feedPagination.pagesNumber; self.loadingBar = true; if ((currentPage != 1 && type == 'prev') || (currentPage < pagesNumber && type == 'next')) { self.feedPagination.currentPage = (type == 'next') ? (currentPage < pagesNumber ? (parseInt(currentPage) + 1) : pagesNumber) : (currentPage > 1 ? (parseInt(currentPage) - 1) : 1); var postData = { action: 'sbi_feed_saver_manager_get_feed_list_page', page: self.feedPagination.currentPage }; self.ajaxPost(postData, function (_ref) { var data = _ref.data; if (data) { self.feedsList = data; } self.loadingBar = false; }); sbiBuilder.$forceUpdate(); } }, /** * Choose Feed Type * * @since 6.0 */ chooseFeedType: function (feedTypeEl, iscustomizerPopup = false) { var self = this; if (feedTypeEl.type == 'user') { self.selectedFeed = 'user'; } else { self.viewsActive.extensionsPopupElement = feedTypeEl.type; if (self.customizerFeedData !== undefined) { self.viewsActive['feedtypesPopup'] = false; } } sbiBuilder.$forceUpdate(); }, /** * Choose Feed Type * * @since 6.0 */ selectFeedTypePopup: function (feedTypeEl) { var self = this; if (feedTypeEl.type != 'socialwall') { if (!self.selectedFeedPopup.includes(feedTypeEl.type) && !self.selectedFeed.includes(feedTypeEl.type)) { self.selectedFeedPopup.push(feedTypeEl.type); } else { self.selectedFeedPopup.splice(self.selectedFeedPopup.indexOf(feedTypeEl.type), 1); } } }, /** * Check Selected Feed Type * * @since 6.0 */ checkFeedTypeSelect: function (feedTypeEl) { var self = this; if (self.customizerFeedData) { return self.selectedFeedPopup.includes(feedTypeEl.type) && feedTypeEl.type != 'socialwall' } return self.selectedFeed.includes(feedTypeEl.type) && feedTypeEl.type != 'socialwall' }, /** * Confirm Add Feed Type Poup * * @since 6.0 */ addFeedTypePopup: function () { var self = this; self.selectedFeed = self.selectedFeedPopup.concat(self.selectedFeed); self.activateView('feedtypesPopup'); if (self.customizerFeedData) { self.activateView('feedtypesCustomizerPopup'); } }, /** * Returns The Selected Feeds Type * For Customizer PopUp * * @since 6.0 */ getCustomizerSelectedFeedsType: function () { var self = this, customizerSettings = self.customizerFeedData.settings; switch (customizerSettings.type) { case 'user': return ['user']; break; case 'hashtag': return ['hashtag']; break; case 'tagged': return ['tagged']; break; case 'mixed': var feedTypes = []; if (customizerSettings.id.length > 0) { feedTypes.push('user'); } if (customizerSettings.hashtag.length > 0) { feedTypes.push('hashtag'); } if (customizerSettings.tagged.length > 0) { feedTypes.push('tagged'); } return feedTypes; break; } }, /** * Choose Feed Type * * @since 6.0 */ checkMultipleFeedType: function () { return this.selectedFeed.length > 1; }, /** * Check if Feed Type Source is Active * * @since 6.0 */ checkMultipleFeedTypeActive: function (feedTypeID) { return this.selectedFeed.length >= 1 && this.selectedFeed.includes(feedTypeID); }, /** * Customizer * Check if Feed Type Source is Active * * @since 6.0 */ checkMultipleFeedTypeActiveCustomizer: function (feedTypeID) { return this.customizerFeedData.settings.type == feedTypeID || (this.customizerFeedData.settings.type == 'mixed' && this.checkFeedTypeHasSources(feedTypeID)); }, /** * Customizer * Check if Feed Type Has Sources * * @since 6.0 */ checkFeedTypeHasSources: function (feedTypeID) { var self = this; switch (feedTypeID) { case 'user': return self.createSourcesArray(self.customizerFeedData.settings.id).length > 0; break; case 'hashtag': return self.createSourcesArray(self.customizerFeedData.settings.hashtag).length > 0; break; case 'tagged': return self.createSourcesArray(self.customizerFeedData.settings.tagged).length > 0; break; } return false; }, /** * Customizer * Toggle the Feed Types in Popup * * @since 6.0 */ openFeedTypesPopupCustomizer: function () { var self = this; self.selectedSourcesUserPopup = self.createSourcesArray(self.selectedSourcesUser); self.selectedSourcesTaggedPopup = self.createSourcesArray(self.selectedSourcesTagged); self.selectedHastagsPopup = self.createSourcesArray(self.selectedHastags); self.activateView('feedtypesCustomizerPopup') }, /** * Customizer * Toggle the Feed Types in Popup * * @since 6.0 */ toggleFeedTypesChooserPopup: function () { var self = this; self.activateView('feedtypesCustomizerPopup'); self.activateView('feedtypesPopup'); }, /** * Customizer * Toggle the Feed Types With Sources Popup * * @since 6.0 */ toggleFeedTypesSourcesPopup: function () { var self = this; self.activateView('sourcesListPopup'); if (self.customizerFeedData) { self.activateView('feedtypesCustomizerPopup'); } }, /** * Customizer * Update Feed Type * & Sources/Hashtags * @since 6.0 */ updateFeedTypeAndSourcesCustomizer: function () { var self = this; self.selectedSourcesUser = JSON.parse(JSON.stringify(self.createSourcesArray(self.selectedSourcesUserPopup))); self.selectedSourcesTagged = JSON.parse(JSON.stringify(self.createSourcesArray(self.selectedSourcesTaggedPopup))); self.selectedHastags = JSON.parse(JSON.stringify(self.createSourcesArray(self.getFeedHashtagsSaverPopup()))); self.customizerFeedData.settings.type = self.getFeedTypeSaver(); self.customizerFeedData.settings.id = self.getFeedIdSourcesSaver(); self.customizerFeedData.settings.tagged = self.getFeedIdSourcesTaggedSaver(); self.customizerFeedData.settings.hashtag = self.getFeedHashtagsSaver(); /**/ self.customizerControlAjaxAction('feedFlyPreview'); self.activateView('feedtypesCustomizerPopup'); }, /** * Customizer * Cancel Feed Types * & Sources/Hashtags * @since 6.0 */ cancelFeedTypeAndSourcesCustomizer: function () { var self = this; if ( JSON.stringify(self.createSourcesArray(self.selectedSourcesUser)) === JSON.stringify(self.createSourcesArray(self.selectedSourcesUserPopup)) && JSON.stringify(self.createSourcesArray(self.selectedSourcesTagged)) === JSON.stringify(self.createSourcesArray(self.selectedSourcesTaggedPopup)) && JSON.stringify(self.createSourcesArray(self.selectedHastags)) === JSON.stringify(self.createSourcesArray(self.getFeedHashtagsSaverPopup())) && JSON.stringify(self.selectedFeedPopup) === JSON.stringify(self.selectedFeed) ) { self.viewsActive['feedtypesPopup'] = false; self.viewsActive['feedtypesCustomizerPopup'] = false; } else { self.openDialogBox('unsavedFeedSources'); } }, /** * Customizer * Update Feed Type * & Sources/Hashtags * @since 6.0 */ getFeedHashtagsSaverPopup: function () { var self = this; if (self.checkNotEmpty(self.hashtagInputText)) { self.hashtagWriteDetectPopup(true); } return self.selectedHastagsPopup; }, /** * If max number of source types are added (3) * * @since 6.0 */ maxTypesAdded: function () { return this.selectedFeed.length >= 3; }, /** * Check if Feed Type Source is Active * * @since 6.0 */ removeFeedTypeSource: function (feedTypeID) { var self = this; self.selectedFeed.splice(self.selectedFeed.indexOf(feedTypeID), 1); if (feedTypeID == 'user') { self.selectedSourcesUser = []; } else if (feedTypeID == 'tagged') { self.selectedSourcesTagged = []; } else if (feedTypeID == 'hashtag') { self.selectedHastags = []; } }, /** * Choose Feed Type * * @since 6.0 */ checkSingleFeedType: function (feedType) { return this.selectedFeed.length == 1 && this.selectedFeed[0] == feedType; }, //Check Feed Creation Process Sources & Hashtags creationProcessCheckSourcesHashtags: function () { var self = this; if (self.selectedFeed.length > 1) { var number = 0; if (self.selectedFeed.includes('user') && self.selectedSourcesUser.length >= 1) { number += 1; } if (self.selectedFeed.includes('tagged') && self.selectedSourcesTagged.length >= 1) { number += 1; } if (self.selectedFeed.includes('hashtag') && self.selectedHastags.length >= 1) { number += 1; } return (number > 0); } else { if (self.selectedFeed.length == 1 && self.selectedFeed[0] == 'hashtag') { return (self.selectedHastags.length >= 1 || self.checkNotEmpty(self.hashtagInputText)) } } return self.selectedSources.length > 0 ? true : false; }, /* Feed Creation Process */ creationProcessCheckAction: function () { var self = this, checkBtnNext = false; switch (self.viewsActive.selectedFeedSection) { case 'feedsType': checkBtnNext = self.selectedFeed != null ? true : false; window.sbiSelectedFeed = self.selectedFeed; break; case 'selectSource': checkBtnNext = self.creationProcessCheckSourcesHashtags(); break; case 'feedsTypeGetProcess': break; } return checkBtnNext; }, //Next Click in the Creation Process creationProcessNext: function () { var self = this; switch (self.viewsActive.selectedFeedSection) { case 'feedsType': if (self.selectedFeed !== null) { if (self.selectedFeed === 'socialwall') { window.location.href = sbi_builder.pluginsInfo.social_wall.settingsPage; return; } self.switchScreen('selectedFeedSection', 'selectSource'); } break; case 'selectSource': if (self.selectedSources.length > 0 || self.creationProcessCheckSourcesHashtags()) { if (self.checkPeronalAccount()) { self.hashtagWriteDetect(true); self.isCreateProcessGood = self.creationProcessCheckSourcesHashtags(); } else { self.$refs.personalAccountRef.personalAccountPopup = true; } } break; case 'feedsTypeGetProcess': break; } if (self.isCreateProcessGood) { self.submitNewFeed(); } }, changeVideoSource: function (videoSource) { this.videosTypeInfo.type = videoSource; sbiBuilder.$forceUpdate(); }, //Next Click in the Onboarding Process onboardingNext: function () { this.viewsActive.onboardingStep++; this.onboardingHideShow(); sbiBuilder.$forceUpdate(); }, //Previous Click in the Onboarding Process onboardingPrev: function () { this.viewsActive.onboardingStep--; this.onboardingHideShow(); sbiBuilder.$forceUpdate(); }, onboardingHideShow: function () { var tooltips = document.querySelectorAll(".sb-onboarding-tooltip"); for (var i = 0; i < tooltips.length; i++) { tooltips[i].style.display = "none"; } document.querySelectorAll(".sb-onboarding-tooltip-" + this.viewsActive.onboardingStep)[0].style.display = "block"; if (this.viewsActive.onboardingCustomizerPopup) { if (this.viewsActive.onboardingStep === 2) { this.switchCustomizerTab('customize'); } else if (this.viewsActive.onboardingStep === 3) { this.switchCustomizerTab('settings'); } } }, //Close Click in the Onboarding Process onboardingClose: function () { var self = this, wasActive = self.viewsActive.onboardingPopup ? 'newuser' : 'customizer'; document.getElementById("sbi-builder-app").classList.remove('sb-onboarding-active'); this.switchCustomizerTab('customize'); self.viewsActive.onboardingPopup = false; self.viewsActive.onboardingCustomizerPopup = false; self.viewsActive.onboardingStep = 0; var postData = { action: 'sbi_dismiss_onboarding', was_active: wasActive }; self.ajaxPost(postData, function (_ref) { var data = _ref.data; }); sbiBuilder.$forceUpdate(); }, positionOnboarding: function () { var self = this, onboardingElem = document.querySelectorAll(".sb-onboarding-overlay")[0], wrapElem = document.getElementById("sbi-builder-app"); if (onboardingElem === null || typeof onboardingElem === 'undefined') { return; } if (self.viewsActive.onboardingCustomizerPopup && self.iscustomizerScreen) { if (document.getElementById("sb-onboarding-tooltip-customizer-1") !== null) { wrapElem.classList.add('sb-onboarding-active'); var step1El = document.querySelectorAll(".sbi-csz-header")[0]; if( step1El !== undefined ){ step1El.appendChild(document.getElementById("sb-onboarding-tooltip-customizer-1")); } var step2El = document.querySelectorAll(".sb-customizer-sidebar-sec1")[0]; if( step2El !== undefined ){ step2El.appendChild(document.getElementById("sb-onboarding-tooltip-customizer-2")); } var step3El = document.querySelectorAll(".sb-customizer-sidebar-sec1")[0]; if( step3El !== undefined ){ step3El.appendChild(document.getElementById("sb-onboarding-tooltip-customizer-3")); } self.onboardingHideShow(); } } else if (self.viewsActive.onboardingPopup && !self.iscustomizerScreen) { if (sbi_builder.allFeedsScreen.onboarding.type === 'single') { if (document.getElementById("sb-onboarding-tooltip-single-1") !== null) { wrapElem.classList.add('sb-onboarding-active'); var step1El = document.querySelectorAll(".sbi-fb-wlcm-header .sb-positioning-wrap")[0]; if( step1El !== undefined ){ step1El.appendChild(document.getElementById("sb-onboarding-tooltip-single-1")); } var step2El = document.querySelectorAll(".sbi-table-wrap")[0]; if( step2El !== undefined ){ step2El.appendChild(document.getElementById("sb-onboarding-tooltip-single-2")); } self.onboardingHideShow(); } } else { if (document.getElementById("sb-onboarding-tooltip-multiple-1") !== null) { wrapElem.classList.add('sb-onboarding-active'); var step1El = document.querySelectorAll(".sbi-fb-wlcm-header .sb-positioning-wrap")[0]; if( step1El !== undefined ){ step1El.appendChild(document.getElementById("sb-onboarding-tooltip-multiple-1")); } var step2El = document.querySelectorAll(".sbi-fb-lgc-ctn")[0]; if( step2El !== undefined ){ step2El.appendChild(document.getElementById("sb-onboarding-tooltip-multiple-2")); } var step3El = document.querySelectorAll(".sbi-legacy-table-wrap")[0]; if( step3El !== undefined ){ step3El.appendChild(document.getElementById("sb-onboarding-tooltip-multiple-3")); } self.activateView('legacyFeedsShown'); self.onboardingHideShow(); } } } }, //Back Click in the Creation Process creationProcessBack: function () { var self = this; switch (self.viewsActive.selectedFeedSection) { case 'feedsType': self.switchScreen('pageScreen', 'welcome'); break; case 'selectSource': self.switchScreen('selectedFeedSection', 'feedsType'); break; case 'feedsTypeGetProcess': self.switchScreen('selectedFeedSection', 'selectSource'); break; } sbiBuilder.$forceUpdate(); }, getSelectedSourceName: function (sourceID) { var self = this; var sourceInfo = self.sourcesList.filter(function (source) { return source.account_id == sourceID; }); return (sourceInfo.length > 0) ? sourceInfo[0].username : ''; }, getSourceIdSelected: function () { var self = this; if (self.selectedFeed.length == 1 && self.selectedFeed[0] != 'hashtag') { return self.selectedSources[0]; } else if (self.selectedSourcesUser.length >= 1 && self.selectedFeed.length > 1 && self.selectedFeed.includes('user')) { return self.selectedSourcesUser[0]; } else if (self.selectedSourcesTagged.length >= 1 && self.selectedFeed.length > 1 && self.selectedFeed.includes('tagged')) { return self.selectedSourcesTagged[0]; } return 'Instagram Feed'; }, //Return Feed Type getFeedTypeSaver: function () { var self = this; if (self.selectedFeed.length > 1) { return 'mixed'; } return self.selectedFeed[0]; }, //Return Sources ID, getFeedIdSourcesSaver: function () { var self = this; if ((self.selectedFeed.length > 1 && self.selectedFeed.includes('user')) || self.customizerFeedData) { return self.selectedSourcesUser; } return (self.selectedFeed.length == 1 && self.selectedFeed.includes('user')) ? self.selectedSources : ""; }, //Return Sources ID getFeedIdSourcesTaggedSaver: function () { var self = this; if ((self.selectedFeed.length > 1 && self.selectedFeed.includes('tagged')) || self.customizerFeedData) { return self.selectedSourcesTagged; } return (self.selectedFeed.length == 1 && self.selectedFeed.includes('tagged')) ? self.selectedSources : ""; }, //Return Hashtag Saver getFeedHashtagsSaver: function () { var self = this; if (self.selectedFeed.length == 1 && self.selectedFeed[0] == 'hashtag' && self.checkNotEmpty(self.hashtagInputText)) { self.hashtagWriteDetect(true); } if ((self.selectedFeed.length > 1 && self.selectedFeed.includes('hashtag')) || (self.selectedFeed.length == 1 && self.selectedFeed[0] == 'hashtag')) { return self.selectedHastags; } return []; }, //Create & Submit New Feed submitNewFeed: function () { var self = this, newFeedData = { action: 'sbi_feed_saver_manager_builder_update', sources: self.getFeedIdSourcesSaver(), tagged: self.getFeedIdSourcesTaggedSaver(), hashtag: self.getFeedHashtagsSaver(), order: self.hashtagOrderBy, new_insert: 'true', sourcename: self.getSelectedSourceName(self.getSourceIdSelected()), //feedtype : self.selectedFeed, type: self.getFeedTypeSaver() }; self.fullScreenLoader = true; self.ajaxPost(newFeedData, function (_ref) { var data = _ref.data; if (data.feed_id && data.success) { window.location = self.builderUrl + '&feed_id=' + data.feed_id; } }); }, //Select Sources selectSource: function (source) { var self = this; if ((source.account_type != 'personal' && self.selectedFeed[0] == 'tagged') || self.selectedFeed[0] == 'user') { if (self.selectedSources.includes(source.account_id)) { self.selectedSources.splice(self.selectedSources.indexOf(source.account_id), 1); } else { self.selectedSources.push(source.account_id); } } }, //Source Ative isSourceSelectActive: function (source) { var self = this; if (self.selectedSources.includes(source.account_id)) { return (source.account_type != 'personal' && self.selectedFeed[0] == 'tagged') || self.selectedFeed[0] == 'user'; } return false; }, //Check if source is Disabled checkSourceDisabled: function (source) { var self = this; return (source.account_type == 'personal' && self.selectedFeed[0] == 'tagged'); }, //Open Add Source List Popup openSourceListPopup: function (feedTypeID) { var self = this; self.feedTypeOnSourcePopup = feedTypeID; if (self.feedTypeOnSourcePopup == 'tagged') { self.selectedSourcesPopup = self.createSourcesArray(self.selectedSourcesTagged); } else if (self.feedTypeOnSourcePopup == 'user') { self.selectedSourcesPopup = self.createSourcesArray(self.selectedSourcesUser); } self.activateView('sourcesListPopup'); if (self.customizerFeedData) { self.activateView('feedtypesCustomizerPopup'); } }, //Check if source is Disabled POPUP checkSourceDisabledPopup: function (source) { var self = this; return (source.account_type == 'personal' && self.feedTypeOnSourcePopup == 'tagged'); }, //Source Active POPUP isSourceSelectActivePopup: function (source) { var self = this; if (self.selectedSourcesPopup.includes(source.account_id)) { return (source.account_type != 'personal' && self.feedTypeOnSourcePopup == 'tagged') || self.feedTypeOnSourcePopup == 'user'; } return false; }, //Select Sources POPUP selectSourcePopup: function (source) { var self = this; if ((source.account_type != 'personal' && self.feedTypeOnSourcePopup == 'tagged') || self.feedTypeOnSourcePopup == 'user') { if (self.selectedSourcesPopup.includes(source.account_id)) { self.selectedSourcesPopup.splice(self.selectedSourcesPopup.indexOf(source.account_id), 1); } else { self.selectedSourcesPopup.push(source.account_id); } } }, //Return Choosed Feed Type returnSelectedSourcesByType: function (feedType) { var self = this, sourcesListByType = []; if (feedType == 'user') { sourcesListByType = self.sourcesList.filter(function (source) { return (self.customizerFeedData) ? self.selectedSourcesUserPopup.includes(source.account_id) : self.selectedSourcesUser.includes(source.account_id); }); } else if (feedType == 'tagged') { sourcesListByType = self.sourcesList.filter(function (source) { return (self.customizerFeedData) ? self.selectedSourcesTaggedPopup.includes(source.account_id) : self.selectedSourcesTagged.includes(source.account_id); }); } return sourcesListByType; }, //Remove Source From Feed Type removeSourceFromFeedType: function (source, feedType) { var self = this; if (feedType == 'user') { if (self.customizerFeedData) { self.selectedSourcesUserPopup.splice(self.selectedSourcesUserPopup.indexOf(source.account_id), 1) } else { self.selectedSourcesUser.splice(self.selectedSourcesUser.indexOf(source.account_id), 1) } } else if (feedType == 'tagged') { if (self.customizerFeedData) { self.selectedSourcesTaggedPopup.splice(self.selectedSourcesTaggedPopup.indexOf(source.account_id), 1) } else { self.selectedSourcesTagged.splice(self.selectedSourcesTagged.indexOf(source.account_id), 1) } } }, /* Return Selected Sources / Hashtags on The Customizer Control */ returnSelectedSourcesByTypeCustomizer: function (feedType) { var self = this, sourcesListNameByType = []; if (feedType == 'user') { sourcesListNameByType = self.sourcesList.filter(function (source) { return self.customizerFeedData.settings.id.includes(source.account_id); }); } if (feedType == 'tagged') { sourcesListNameByType = self.sourcesList.filter(function (source) { return self.customizerFeedData.settings.tagged.includes(source.account_id); }); } if (feedType == 'hashtag') { sourcesListNameByType = Array.isArray(self.customizerFeedData.settings.hashtag) ? self.customizerFeedData.settings.hashtag : self.customizerFeedData.settings.hashtag.split(','); } return sourcesListNameByType; }, //Check if source are Array createSourcesArray: function (element) { var self = this; if (Array.isArray(element) && element.length == 1 && !this.checkNotEmpty(element[0])) { return []; } var arrayResult = Array.isArray(element) ? Array.from(element) : Array.from(element.split(',')); return arrayResult.filter(function (el) { return el != null && self.checkNotEmpty(el); }); }, // Add Source to Feed Type addSourceToFeedType: function () { var self = this; if (self.feedTypeOnSourcePopup == 'tagged') { if (!self.customizerFeedData) { self.selectedSourcesTagged = self.createSourcesArray(self.selectedSourcesPopup); self.selectedSourcesTaggedPopup = self.createSourcesArray(self.selectedSourcesTagged); } else { self.selectedSourcesTaggedPopup = self.createSourcesArray(self.selectedSourcesPopup); } } else if (self.feedTypeOnSourcePopup == 'user') { if (!self.customizerFeedData) { self.selectedSourcesUser = self.createSourcesArray(self.selectedSourcesPopup); self.selectedSourcesUserPopup = self.createSourcesArray(self.selectedSourcesUser); } else { self.selectedSourcesUserPopup = self.createSourcesArray(self.selectedSourcesPopup); } } self.activateView('sourcesListPopup'); if (self.customizerFeedData) { self.activateView('feedtypesCustomizerPopup'); } }, //Detect Hashtag Writing hashtagWriteDetectPopup: function (isProcess = false) { var self = this, target = window.event; if (target.keyCode == 188 || isProcess == true) { self.hashtagInputText = self.hashtagInputText.replace(',', ''); if (self.checkNotEmpty(self.hashtagInputText)) { if (self.hashtagInputText[0] !== '#') { self.hashtagInputText = '#' + self.hashtagInputText; } self.selectedHastagsPopup = self.createSourcesArray(self.selectedHastagsPopup); self.selectedHastagsPopup.push(self.hashtagInputText); } self.hashtagInputText = ''; } }, //Detect Hashtag Writing hashtagWriteDetect: function (isProcess = false) { var self = this, target = window.event; if (target.keyCode == 188 || isProcess == true) { self.hashtagInputText = self.hashtagInputText.replace(',', ''); if (self.checkNotEmpty(self.hashtagInputText)) { if (self.hashtagInputText[0] !== '#') { self.hashtagInputText = '#' + self.hashtagInputText; } self.selectedHastags = self.createSourcesArray(self.selectedHastags); self.selectedHastags.push(self.hashtagInputText); self.selectedHastagsPopup = self.createSourcesArray(self.selectedHastags); } self.hashtagInputText = ''; } }, //Remove Hashtag from List removeHashtag: function (hashtag) { var self = this; if (self.customizerFeedData) { self.selectedHastagsPopup.splice(self.selectedHastagsPopup.indexOf(hashtag), 1); } else { self.selectedHastags.splice(self.selectedHastags.indexOf(hashtag), 1); } }, processDomList: function (selector, attributes) { document.querySelectorAll(selector).forEach(function (element) { attributes.map(function (attrName) { element.setAttribute(attrName[0], attrName[1]); }); }); }, openTooltipBig: function () { var self = this, elem = window.event.currentTarget; self.processDomList('.sbi-fb-onbrd-tltp-elem', [['data-active', 'false']]); elem.querySelector('.sbi-fb-onbrd-tltp-elem').setAttribute('data-active', 'true'); sbiBuilder.$forceUpdate(); }, closeTooltipBig: function () { var self = this; self.processDomList('.sbi-fb-onbrd-tltp-elem', [['data-active', 'false']]); window.event.stopPropagation(); sbiBuilder.$forceUpdate(); }, /* FEEDS List Actions */ /** * Switch Bulk Action * * @since 4.0 */ bulkActionClick: function () { var self = this; switch (self.selectedBulkAction) { case 'delete': if (self.feedsSelected.length > 0) { self.openDialogBox('deleteMultipleFeeds') } break; } sbiBuilder.$forceUpdate(); }, /** * Duplicate Feed * * @since 4.0 */ feedActionDuplicate: function (feed) { var self = this, feedsDuplicateData = { action: 'sbi_feed_saver_manager_duplicate_feed', feed_id: feed.id }; self.ajaxPost(feedsDuplicateData, function (_ref) { var data = _ref.data; self.feedsList = Object.values(Object.assign({}, data)); //self.feedsList = data; }); sbiBuilder.$forceUpdate(); }, /** * Delete Feed * * @since 4.0 */ feedActionDelete: function (feeds_ids) { var self = this, feedsDeleteData = { action: 'sbi_feed_saver_manager_delete_feeds', feeds_ids: feeds_ids }; self.ajaxPost(feedsDeleteData, function (_ref) { var data = _ref.data; self.feedsList = Object.values(Object.assign({}, data)); self.feedsSelected = []; }); }, /** * View Feed Instances * * @since 4.0 */ viewFeedInstances: function (feed) { var self = this; self.viewsActive.instanceFeedActive = feed; self.movePopUp(); sbiBuilder.$forceUpdate(); }, /** * Select All Feeds in List * * @since 4.0 */ selectAllFeedCheckBox: function () { var self = this; if (!self.checkAllFeedsActive()) { self.feedsSelected = []; self.feedsList.forEach(function (feed) { self.feedsSelected.push(feed.id); }); } else { self.feedsSelected = []; } }, /** * Select Single Feed in List * * @since 4.0 */ selectFeedCheckBox: function (feedID) { if (this.feedsSelected.includes(feedID)) { this.feedsSelected.splice(this.feedsSelected.indexOf(feedID), 1); } else { this.feedsSelected.push(feedID); } sbiBuilder.$forceUpdate(); }, /** * Check if All Feeds are Selected * * @since 4.0 */ checkAllFeedsActive: function () { var self = this, result = true; self.feedsList.forEach(function (feed) { if (!self.feedsSelected.includes(feed.id)) { result = false; } }); return result; }, /** * Copy text to clipboard * * @since 4.0 */ copyToClipBoard: function (value) { var self = this; const el = document.createElement('textarea'); el.className = 'sbi-fb-cp-clpboard'; el.value = value; document.body.appendChild(el); el.select(); document.execCommand('copy'); document.body.removeChild(el); self.notificationElement = { type: 'success', text: this.genericText.copiedClipboard, shown: "shown" }; setTimeout(function () { self.notificationElement.shown = "hidden"; }, 3000); sbiBuilder.$forceUpdate(); }, /*------------------------------------------- CUSTOMIZER FUNCTIONS -------------------------------------------*/ /** * HighLight Section * * @since 4.0 */ isSectionHighLighted: function (sectionName) { var self = this; return (self.highLightedSection === sectionName || self.highLightedSection === 'all') }, /** * Enable Highlight Section * * @since 4.0 */ enableHighLightSection: function (sectionId) { var self = this, listPostSection = ['customize_feedlayout', 'customize_colorschemes', 'customize_posts', 'post_style', 'individual_elements'], headerSection = ['customize_header'], followButtonSection = ['customize_followbutton'], loadeMoreSection = ['customize_loadmorebutton'], lightBoxSection = ['customize_lightbox'], domBody = document.getElementsByTagName("body")[0]; self.dummyLightBoxScreen = false; domBody.classList.remove("no-overflow"); if (listPostSection.includes(sectionId)) { self.highLightedSection = 'postList'; self.scrollToHighLightedSection("sbi_images"); } else if (headerSection.includes(sectionId)) { self.highLightedSection = 'header'; self.scrollToHighLightedSection("sb_instagram_header"); } else if (followButtonSection.includes(sectionId)) { self.highLightedSection = 'followButton'; self.scrollToHighLightedSection("sbi_load"); } else if (loadeMoreSection.includes(sectionId)) { self.highLightedSection = 'loadMore'; self.scrollToHighLightedSection("sbi_load"); } else if( lightBoxSection.includes(sectionId) ){ self.highLightedSection = 'lightBox'; self.dummyLightBoxScreen = true; document.body.scrollTop = 0; document.documentElement.scrollTop = 0; domBody.classList.add("no-overflow"); } else { self.highLightedSection = 'all'; domBody.classList.remove("no-overflow"); } }, /** * Scroll to Highlighted Section * * @since 4.0 */ scrollToHighLightedSection: function (sectionId) { const element = document.getElementById(sectionId) !== undefined && document.getElementById(sectionId) !== null ? document.getElementById(sectionId) : (document.getElementsByClassName(sectionId)[0] !== undefined && document.getElementsByClassName(sectionId)[0] !== null ? document.getElementsByClassName(sectionId)[0] : null); if (element != undefined && element != null) { const y = element.getBoundingClientRect().top - 120 + window.pageYOffset - 10; window.scrollTo({ top: y, behavior: 'smooth' }); } }, /** * Enable & Show Color Picker * * @since 4.0 */ showColorPickerPospup: function (controlId) { this.customizerScreens.activeColorPicker = controlId; }, /** * Hide Color Picker * * @since 4.0 */ hideColorPickerPospup: function () { this.customizerScreens.activeColorPicker = null; }, switchCustomizerPreviewDevice: function (previewScreen) { var self = this; self.customizerScreens.previewScreen = previewScreen; self.loadingBar = true; window.sbi_preview_device = previewScreen; setTimeout(function () { self.setShortcodeGlobalSettings(true); self.loadingBar = false; }, 200); sbiBuilder.$forceUpdate(); }, switchCustomizerTab: function (tabId) { var self = this, domBody = document.getElementsByTagName("body")[0]; self.customizerScreens.activeTab = tabId; self.customizerScreens.activeSection = null; self.customizerScreens.activeSectionData = null; self.highLightedSection = 'all'; self.dummyLightBoxScreen = false; //self.dummyLightBoxData.visibility = 'hidden'; domBody.classList.remove("no-overflow"); if (self.moderationShoppableModeAjaxDone && self.getModerationShoppableMode == false) { self.customizerControlAjaxAction('feedFlyPreview'); } sbiBuilder.$forceUpdate(); }, switchCustomizerSection: function (sectionId, section, isNested = false, isBackElements) { var self = this; self.customizerScreens.parentActiveSection = null; self.customizerScreens.parentActiveSectionData = null; if (isNested) { self.customizerScreens.parentActiveSection = self.customizerScreens.activeSection; self.customizerScreens.parentActiveSectionData = self.customizerScreens.activeSectionData; } self.customizerScreens.activeSection = sectionId; self.customizerScreens.activeSectionData = section; self.enableHighLightSection(sectionId); if (sectionId === 'settings_filters_moderation') { self.viewsActive['moderationMode'] = false; } sbiBuilder.$forceUpdate(); }, switchNestedSection: function (sectionId, section) { var self = this; if (section !== null) { self.customizerScreens.activeSection = sectionId; self.customizerScreens.activeSectionData = section; } else { var sectionArray = sectionId['sections']; var elementSectionData = self.customizerSidebarBuilder; sectionArray.map(function (elm, index) { elementSectionData = (elementSectionData[elm] != undefined && elementSectionData[elm] != null) ? elementSectionData[elm] : null; }); if (elementSectionData != null) { self.customizerScreens.activeSection = sectionId['id']; self.customizerScreens.activeSectionData = elementSectionData; } } sbiBuilder.$forceUpdate(); }, backToPostElements: function () { var self = this, individual_elements = self.customizerSidebarBuilder['customize'].sections.customize_posts.nested_sections.individual_elements; self.customizerScreens.activeSection = 'customize_posts'; self.customizerScreens.activeSectionData = self.customizerSidebarBuilder['customize'].sections.customize_posts; self.switchCustomizerSection('individual_elements', individual_elements, true, true); sbiBuilder.$forceUpdate(); }, changeSettingValue: function (settingID, value, doProcess = true, ajaxAction = false) { var self = this; if (settingID == 'layout' && value !== 'grid') { self.viewsActive.extensionsPopupElement = 'feedLayout'; } else if (settingID == 'headerstyle' && value !== 'standard') { self.viewsActive.extensionsPopupElement = 'headerLayout'; } else if (settingID == 'sortby' && value == 'likes') { window.open('https://smashballoon.com/instagram-feed/demo/?utm_campaign=instagram-free&utm_source=customizer&utm_medium=load-more', '_blank'); } else { if (doProcess) { self.customizerFeedData.settings[settingID] = value; } if (ajaxAction !== false) { self.customizerControlAjaxAction(ajaxAction, settingID); } self.regenerateLayout(settingID); } }, //Shortcode Global Layout Settings regenerateLayout: function (settingID) { var self = this, regenerateFeedHTML = [ 'layout' ], relayoutFeed = [ 'layout', 'carouselarrows', 'carouselpag', 'carouselautoplay', 'carouseltime', 'carouselloop', 'carouselrows', 'cols', 'colstablet', 'colsmobile', 'highlighttype', 'highlightoffset', 'highlightpattern', 'highlightids', 'highlighthashtag', 'imagepadding' ]; if (relayoutFeed.includes(settingID)) { setTimeout(function () { self.setShortcodeGlobalSettings(true); }, 200) } }, //Get Number of Columns depending on the Preview Screen getColsPreviewScreen: function () { var self = this; if (self.getModerationShoppableMode) { return 4; } switch (self.customizerScreens.previewScreen) { case 'mobile': return self.customizerFeedData.settings.colsmobile break; case 'tablet': return self.customizerFeedData.settings.colstablet break; default: return self.customizerFeedData.settings.cols break; } }, //Get Post Number depending on the Preview Screen getPostNumberPreviewScreen: function () { var self = this; switch (self.customizerScreens.previewScreen) { case 'mobile': return self.customizerFeedData.settings.nummobile break; case 'tablet': return self.customizerFeedData.settings.nummobile break; default: return self.customizerFeedData.settings.num break; } }, //Get Customizer Additional CSS Classes getAdditionalCustomizerClasses: function () { var self = this, additionalCssClasses = ''; if (self.getModerationShoppableMode) { additionalCssClasses += ' sbi-customizer-ms-modes '; } return additionalCssClasses; }, //Shortcode Global Layout Settings setShortcodeGlobalSettings: function (flyPreview = false) { var self = this, instagramFeed = jQuery("html").find("#sb_instagram"), feedSettings = self.jsonParse(instagramFeed.attr('data-options')), customizerSettings = self.customizerFeedData.settings; if (JSON.stringify(self.feedSettingsDomOptions) !== JSON.stringify(feedSettings) || flyPreview == true) { if (customizerSettings.layout == 'grid' || self.getModerationShoppableMode) { feedSettings = self.gridShortcodeSettings(feedSettings, instagramFeed); } else if (customizerSettings.layout == 'carousel') { feedSettings = self.carouselShortcodeSettings(feedSettings, instagramFeed, customizerSettings); } else if (customizerSettings.layout == 'masonry') { feedSettings = self.masonryShortcodeSettings(feedSettings, instagramFeed, customizerSettings); } else if (customizerSettings.layout == 'highlight') { feedSettings = self.highlightShortcodeSettings(feedSettings, instagramFeed, customizerSettings); } if (flyPreview === true) { if (customizerSettings['id'][0] !== undefined) { var headerSourceId = customizerSettings['id'][0]; newHeaderData = null; var newHeaderDataMap = self.sourcesList.map(function (source) { if (source.account_id === headerSourceId) { newHeaderData = source != undefined ? source : null; } }); if (newHeaderData !== null && newHeaderData.header_data !== null) { self.customizerFeedData.header = newHeaderData; self.customizerFeedData.headerData = newHeaderData.header_data; } } } instagramFeed.attr("data-options", JSON.stringify(feedSettings)); //setTimeout(function(){ window.sbi_init() //},200) self.feedSettingsDomOptions = feedSettings; } jQuery('body').find('#sbi_load .sbi_load_btn').unbind('click') }, //Grid Shortcode Settings gridShortcodeSettings: function (feedSettings, instagramFeed) { var self = this; feedSettings['grid'] = true; self.destroyHighlightLayout(instagramFeed); self.destroyMasonryLayout(instagramFeed); self.destoryOwl(instagramFeed); delete feedSettings['carousel']; delete feedSettings['masonry']; delete feedSettings['highlight']; return feedSettings; }, //Masonry Shortcode Settings masonryShortcodeSettings: function (feedSettings, instagramFeed) { var self = this; feedSettings['masonry'] = true; self.destroyHighlightLayout(instagramFeed); self.destoryOwl(instagramFeed); delete feedSettings['grid']; delete feedSettings['carousel']; delete feedSettings['highlight']; jQuery('.sbi_photo img').show(); return feedSettings; }, //Carousel Shortcode Settings carouselShortcodeSettings: function (feedSettings, instagramFeed, customizerSettings) { var self = this, arrows = self.valueIsEnabled(customizerSettings['carouselarrows']), pag = self.valueIsEnabled(customizerSettings['carouselpag']), autoplay = self.valueIsEnabled(customizerSettings['carouselautoplay']), time = autoplay ? parseInt(customizerSettings['carouseltime']) : false, loop = self.checkNotEmpty(customizerSettings['carouselloop']) && customizerSettings['carouselloop'] !== 'rewind' ? false : true, rows = customizerSettings['carouselrows'] ? Math.min(parseInt(customizerSettings['carouselrows']), 2) : 1; feedSettings['carousel'] = [arrows, pag, autoplay, time, loop, rows]; self.destoryOwl(instagramFeed); self.destroyHighlightLayout(instagramFeed); self.destroyMasonryLayout(instagramFeed); delete feedSettings['grid']; delete feedSettings['masonry']; delete feedSettings['highlight']; return feedSettings; }, //Highlight Shortcode Settings highlightShortcodeSettings: function (feedSettings, instagramFeed, customizerSettings) { var self = this, type = customizerSettings['highlighttype'].trim(); pattern = customizerSettings['highlightpattern'].trim(); offset = parseInt(customizerSettings['highlightoffset']), hashtag = customizerSettings['highlighthashtag'].replace(',', '|').replace('#', '').replace(' ', '').trim(), ids = customizerSettings['highlightids'].replace(',', '|').replace('sbi_', '').replace(' ', '').trim(); feedSettings['highlight'] = [type, pattern, offset, hashtag, ids]; self.destroyHighlightLayout(instagramFeed); self.destroyMasonryLayout(instagramFeed); self.destoryOwl(instagramFeed); delete feedSettings['carousel']; delete feedSettings['masonry']; delete feedSettings['grid']; return feedSettings; }, //destroy Owl destoryOwl: function (instagramFeed) { var self = this; var owlCarouselCtn = instagramFeed.find('.sbi_carousel'); if (instagramFeed.find('#sbi_images').hasClass('sbi_carousel')) { //self.customizerControlAjaxAction("feedFlyPreview"); /* if( instagramFeed.hasClass('sbi_carousel_2_row') ){ owlCarouselCtn.find('.sbi_owl2row-item').each( function(index, element) { if(jQuery(element).children().length == 0){ jQuery(element).remove() }else{ jQuery("#sbi_images").append(jQuery(element).html()) } jQuery(element).parents('.sbi-owl-item').remove(); }); }else{ owlCarouselCtn.find('.sbi-owl-item').each( function(index, element) { if(jQuery(element).children().length == 0){ jQuery(element).remove() }else{ jQuery("#sbi_images").append(jQuery(element).html()) } jQuery(element).parents('.sbi-owl-item').remove(); }); } owlCarouselCtn.find('.sbi-owl-item,.sbi-owl-stage,.sbi-owl-stage-outer,.sbi-owl-nav,.sbi-owl-nav').remove(); owlCarouselCtn.removeClass('sbi_carousel'); instagramFeed.removeClass('sbi_carousel_2_row'); jQuery("#sb_instagram").removeClass('2rows'); owlCarouselCtn.sbiOwlCarousel('destroy'); */ } }, //Destroy Masonry Layout destroyMasonryLayout: function (instagramFeed) { var self = this; if (instagramFeed.hasClass('sbi_masonry')) { instagramFeed.find('#sbi_images').css({ 'height': 'unset' }); instagramFeed.find('.sbi_item').each(function () { jQuery(this).attr({ 'style': '' }); }); jQuery("#sbi_images").smashotope('destroy'); instagramFeed.removeClass('sbi_masonry') } }, //Destroy Highlight Layout destroyHighlightLayout: function (instagramFeed) { var self = this; if (instagramFeed.hasClass('sbi_highlight')) { instagramFeed.find('#sbi_images').css({ 'height': 'unset' }); instagramFeed.find('.sbi_item').each(function () { jQuery(this).attr({ 'style': '' }); }); jQuery("#sbi_images").smashotope('destroy'); instagramFeed.removeClass('sbi_highlight') } }, //Tablet Cols Classes getTabletColsClass: function () { var self = this, customizerSettings = self.customizerFeedData.settings; return ' sbi_tab_col_' + parseInt(customizerSettings.colstablet); }, //Mobile Cols Classes getMobileColsClass: function () { var self = this, customizerSettings = self.customizerFeedData.settings, disableMobile = self.valueIsEnabled(customizerSettings.disablemobile); if (disableMobile === 'false') disableMobile = ''; if (disableMobile !== ' sbi_disable_mobile' && customizerSettings.colsmobile !== 'same') { var colsmobile = parseInt(customizerSettings.colsmobile) > 0 ? parseInt(customizerSettings.colsmobile) : 'auto'; return ' sbi_mob_col_' + colsmobile; } else { var colsmobile = parseInt(customizerSettings.cols) > 0 ? parseInt(customizerSettings.cols) : 4; return ' sbi_disable_mobile sbi_mob_col_' + parseInt(customizerSettings.cols); } }, //Header Classes getHeaderClass: function (headerType) { //return ' header'; var self = this, customizerSettings = self.customizerFeedData.settings, headerClasses = 'sb_instagram_header '; headerClasses += 'sbi_feed_type_user'; headerClasses += customizerSettings['headerstyle'] === 'centered' && headerType === 'normal' ? ' sbi_centered' : ''; headerClasses += ['medium', 'large'].includes(customizerSettings['headersize']) ? ' sbi_' + customizerSettings['headersize'] : ''; headerClasses += self.getHeaderAvatar() === false ? ' sbi_no_avatar' : ''; headerClasses += self.getPaletteClass('_header'); if (customizerSettings.headeroutside) { headerClasses += ' sbi_header_outside'; } return headerClasses; }, //Header Name getHeaderName: function () { var self = this, headerData = self.customizerFeedData.headerData; if (self.hasOwnNestedProperty(headerData, 'name') && self.checkNotEmpty(headerData['name'])) { return headerData['name']; } else if (self.hasOwnNestedProperty(headerData, 'data.full_name')) { return headerData['data']['full_name']; } return self.getHeaderUserName(); }, //Header User Name getHeaderUserName: function () { var self = this, headerData = self.customizerFeedData.headerData; if (self.hasOwnNestedProperty(headerData, 'username') && self.checkNotEmpty(headerData['username'])) { return headerData['username']; } else if (self.hasOwnNestedProperty(headerData, 'user.username')) { return headerData['user']['username']; } else if (self.hasOwnNestedProperty(headerData, 'data.username')) { return headerData['data']['username']; } return ''; }, //Header Media Count getHeaderMediaCount: function () { var self = this, headerData = self.customizerFeedData.headerData; if (self.hasOwnNestedProperty(headerData, 'data.counts.media')) { return headerData['data']['counts']['media']; } else if (self.hasOwnNestedProperty(headerData, 'counts.media')) { return headerData['counts']['media']; } else if (self.hasOwnNestedProperty(headerData, 'media_count')) { return headerData['media_count']; } return ''; }, //Header Followers Count getHeaderFollowersCount: function () { var self = this, headerData = self.customizerFeedData.headerData; if (self.hasOwnNestedProperty(headerData, 'data.counts.followed_by')) { return headerData['data']['counts']['followed_by']; } else if (self.hasOwnNestedProperty(headerData, 'counts.followed_by')) { return headerData['counts']['followed_by']; } else if (self.hasOwnNestedProperty(headerData, 'followers_count')) { return headerData['followers_count']; } return ''; }, //Header Avatar getHeaderAvatar: function () { var self = this, customizerSettings = self.customizerFeedData.settings, headerData = self.customizerFeedData.headerData, header = self.customizerFeedData.header; if (self.checkNotEmpty(customizerSettings['customavatar'])) { return customizerSettings['customavatar']; } else if (header['local_avatar_url'] != false && self.checkNotEmpty(header['local_avatar_url'])) { return header['local_avatar_url']; } else { if (self.hasOwnNestedProperty(headerData, 'profile_picture')) { return headerData['profile_picture']; } else if (self.hasOwnNestedProperty(headerData, 'profile_picture_url')) { return headerData['profile_picture_url']; } else if (self.hasOwnNestedProperty(headerData, 'user.profile_picture')) { return headerData['user']['profile_picture']; } else if (self.hasOwnNestedProperty(headerData, 'data.profile_picture')) { return headerData['data']['profile_picture']; } } return self.pluginUrl + 'img/thumb-placeholder.png'; }, //Header Bio getHeaderBio: function () { var self = this, customizerSettings = self.customizerFeedData.settings, headerData = self.customizerFeedData.headerData; if (self.checkNotEmpty(customizerSettings['custombio'])) { return customizerSettings['custombio']; } else if (self.hasOwnNestedProperty(headerData, 'data.bio')) { return headerData['data']['bio']; } else if (self.hasOwnNestedProperty(headerData, 'bio')) { return headerData['bio']; } else if (self.hasOwnNestedProperty(headerData, 'biography')) { return headerData['biography']; } return ''; }, //Header Text Class getTextHeaderClass: function () { var self = this, customizerSettings = self.customizerFeedData.settings, headerData = self.customizerFeedData.headerData, headerClass = 'sbi_header_text ', shouldShowBio = self.checkNotEmpty(self.getHeaderBio()) ? self.valueIsEnabled(customizerSettings['showbio']) : false, shouldShowInfo = shouldShowBio || self.valueIsEnabled(customizerSettings['showfollowers']); headerClass += !shouldShowBio ? 'sbi_no_bio ' : '', headerClass += !shouldShowInfo ? 'sbi_no_info' : ''; return headerClass; }, //Get Story Delays getStoryDelays: function () { var self = this, customizerSettings = self.customizerFeedData.settings; return self.checkNotEmpty(customizerSettings['storiestime']) ? Math.max(500, parseInt(customizerSettings['storiestime'])) : 5000; }, //Get Story Data getStoryData: function () { var self = this, customizerSettings = self.customizerFeedData.settings, headerData = self.customizerFeedData.headerData; if (self.hasOwnNestedProperty(headerData, 'stories') && headerData.stories.length > 0 && self.valueIsEnabled(customizerSettings['stories'])) { return headerData['stories']; } return false; }, //Image Chooser imageChooser: function (settingID) { var self = this; var uploader = wp.media({ frame: 'post', title: 'Media Uploader', button: { text: 'Choose Media' }, library: { type: 'image' }, multiple: false }).on('close', function () { var selection = uploader.state().get('selection'); if (selection.length != 0) { attachment = selection.first().toJSON(); self.customizerFeedData.settings[settingID] = attachment.url; } }).open(); }, //Change Switcher Settings changeSwitcherSettingValue: function (settingID, onValue, offValue, ajaxAction = false) { var self = this; self.customizerFeedData.settings[settingID] = self.customizerFeedData.settings[settingID] == onValue ? offValue : onValue; if (ajaxAction !== false) { self.customizerControlAjaxAction(ajaxAction); } if (settingID == 'disablelightbox' || settingID == 'shoppablefeed') { if (self.valueIsEnabled(self.customizerFeedData.settings['disablelightbox']) || self.valueIsEnabled(self.customizerFeedData.settings['shoppablefeed'])) { jQuery('body').find('.sbi_link').addClass('sbi_disable_lightbox'); } else { jQuery('body').find('.sbi_link').removeClass('sbi_disable_lightbox'); } } self.regenerateLayout(settingID); }, //Checkbox List changeCheckboxListValue: function (settingID, value, ajaxAction = false) { var self = this, settingValue = self.customizerFeedData.settings[settingID].split(','); if (!Array.isArray(settingValue)) { settingValue = [settingValue]; } if (settingValue.includes(value)) { settingValue.splice(settingValue.indexOf(value), 1); } else { settingValue.push(value); } self.customizerFeedData.settings[settingID] = settingValue.join(','); }, //Section Checkbox changeCheckboxSectionValue: function (settingID, value, ajaxAction = false) { var self = this; var settingValue = self.customizerFeedData.settings[settingID]; if (!Array.isArray(settingValue) && settingID == 'type') { settingValue = [settingValue]; } if (settingValue.includes(value)) { settingValue.splice(settingValue.indexOf(value), 1); } else { settingValue.push(value); } if (settingID == 'type') { self.processFeedTypesSources(settingValue); } //settingValue = (settingValue.length == 1 && settingID == 'type') ? settingValue[0] : settingValue; self.customizerFeedData.settings[settingID] = settingValue; if (ajaxAction !== false) { self.customizerControlAjaxAction(ajaxAction); } event.stopPropagation() }, checkboxSectionValueExists: function (settingID, value) { var self = this; var settingValue = self.customizerFeedData.settings[settingID]; return settingValue.includes(value) ? true : false; }, /** * Check Control Condition * * @since 4.0 */ checkControlCondition: function (conditionsArray = [], checkExtensionActive = false, checkExtensionActiveDimmed = false) { var self = this, isConditionTrue = 0; Object.keys(conditionsArray).map(function (condition, index) { if (conditionsArray[condition].indexOf(self.customizerFeedData.settings[condition]) !== -1) isConditionTrue += 1 }); var extensionCondition = checkExtensionActive != undefined && checkExtensionActive != false ? self.checkExtensionActive(checkExtensionActive) : true, extensionCondition = checkExtensionActiveDimmed != undefined && checkExtensionActiveDimmed != false && !self.checkExtensionActive(checkExtensionActiveDimmed) ? false : extensionCondition; return (isConditionTrue == Object.keys(conditionsArray).length) ? (extensionCondition) : false; }, /** * Check Color Override Condition * * @since 4.0 */ checkControlOverrideColor: function (overrideConditionsArray = []) { var self = this, isConditionTrue = 0; overrideConditionsArray.map(function (condition, index) { if (self.checkNotEmpty(self.customizerFeedData.settings[condition]) && self.customizerFeedData.settings[condition].replace(/ /gi, '') != '#') { isConditionTrue += 1 } }); return (isConditionTrue >= 1) ? true : false; }, /** * Show Control * * @since 4.0 */ isControlShown: function (control) { var self = this; if (control.checkViewDisabled != undefined) { return !self.viewsActive[control.checkViewDisabled]; } if (control.checkView != undefined) { return !self.viewsActive[control.checkView]; } if (control.checkExtension != undefined && control.checkExtension != false && !self.checkExtensionActive(control.checkExtension)) { return self.checkExtensionActive(control.checkExtension); } if (control.conditionDimmed != undefined && self.checkControlCondition(control.conditionDimmed)) return self.checkControlCondition(control.conditionDimmed); if (control.overrideColorCondition != undefined) { return self.checkControlOverrideColor(control.overrideColorCondition); } return (control.conditionHide != undefined && control.condition != undefined || control.checkExtension != undefined) ? self.checkControlCondition(control.condition, control.checkExtension) : true; }, checkExtensionActive: function (extension) { var self = this; return self.activeExtensions[extension]; }, expandSourceInfo: function (sourceId) { var self = this; self.customizerScreens.sourceExpanded = (self.customizerScreens.sourceExpanded === sourceId) ? null : sourceId; window.event.stopPropagation() }, resetColor: function (controlId) { this.customizerFeedData.settings[controlId] = ''; }, //Source Active Customizer isSourceActiveCustomizer: function (source) { var self = this; return ( Array.isArray(self.customizerFeedData.settings.sources.map) || self.customizerFeedData.settings.sources instanceof Object ) && self.customizerScreens.sourcesChoosed.map(s => s.account_id).includes(source.account_id); //self.customizerFeedData.settings.sources.map(s => s.account_id).includes(source.account_id); }, //Choose Source From Customizer selectSourceCustomizer: function (source, isRemove = false) { var self = this, isMultifeed = (self.activeExtensions['multifeed'] !== undefined && self.activeExtensions['multifeed'] == true), sourcesListMap = Array.isArray(self.customizerFeedData.settings.sources) || self.customizerFeedData.settings.sources instanceof Object ? self.customizerFeedData.settings.sources.map(s => s.account_id) : []; if (isMultifeed) { if (self.customizerScreens.sourcesChoosed.map(s => s.account_id).includes(source.account_id)) { var indexToRemove = self.customizerScreens.sourcesChoosed.findIndex(src => src.account_id === source.account_id); self.customizerScreens.sourcesChoosed.splice(indexToRemove, 1); if (isRemove) { self.customizerFeedData.settings.sources.splice(indexToRemove, 1); } } else { self.customizerScreens.sourcesChoosed.push(source); } } else { self.customizerScreens.sourcesChoosed = (sourcesListMap.includes(source)) ? [] : [source]; } sbiBuilder.$forceUpdate(); }, closeSourceCustomizer: function () { var self = this; self.viewsActive['sourcePopup'] = false; //self.customizerFeedData.settings.sources = self.customizerScreens.sourcesChoosed; sbiBuilder.$forceUpdate(); }, customizerFeedTypePrint: function () { var self = this, combinedTypes = self.feedTypes.concat(self.advancedFeedTypes); result = combinedTypes.filter(function (tp) { return tp.type === self.customizerFeedData.settings.feedtype }); self.customizerScreens.printedType = result.length > 0 ? result[0] : []; return result.length > 0 ? true : false; }, choosedFeedTypeCustomizer: function (feedType) { var self = this, result = false; if ( (self.viewsActive.feedTypeElement === null && self.customizerFeedData.settings.feedtype === feedType) || (self.viewsActive.feedTypeElement !== null && self.viewsActive.feedTypeElement == feedType) ) { result = true; } return result; }, updateFeedTypeCustomizer: function () { var self = this; if (self.viewsActive.feedTypeElement === 'socialwall') { window.location.href = sbi_builder.pluginsInfo.social_wall.settingsPage; return; } self.setType(self.viewsActive.feedTypeElement); self.customizerFeedData.settings.feedtype = self.viewsActive.feedTypeElement; self.viewsActive.feedTypeElement = null; self.viewsActive.feedtypesPopup = false; self.customizerControlAjaxAction('feedFlyPreview'); sbiBuilder.$forceUpdate(); }, updateInputWidth: function () { this.customizerScreens.inputNameWidth = ((document.getElementById("sbi-csz-hd-input").value.length + 6) * 8) + 'px'; }, feedPreviewMaker: function () { var self = this; return self.template; //return self.template == null ? null : "
" + self.template + "
"; }, customizerStyleMaker: function () { var self = this; if (self.customizerSidebarBuilder) { self.feedStyle = ''; Object.values(self.customizerSidebarBuilder).map(function (tab) { self.customizerSectionStyle(tab.sections); }); return ''; } return false; }, escapeHTML: function (text) { return text.replace(/&/g, "&") .replace(//g, ">") .replace(/"/g, """) .replace(/'/g, "'"); }, /** * Get Feed Preview Global CSS Class * * @since 4.0 * @return String */ getPaletteClass: function (context = '') { var self = this, colorPalette = self.customizerFeedData.settings.colorpalette; if (self.checkNotEmpty(colorPalette)) { var feedID = colorPalette === 'custom' ? ('_' + self.customizerFeedData.feed_info.id) : ''; return colorPalette !== 'inherit' ? ' sbi' + context + '_palette_' + colorPalette + feedID : ''; } return ''; }, customizerSectionStyle: function (sections) { var self = this; Object.values(sections).map(function (section) { if (section.controls) { Object.values(section.controls).map(function (control) { self.returnControlStyle(control); }); } if (section.nested_sections) { self.customizerSectionStyle(section.nested_sections); Object.values(section.nested_sections).map(function (nestedSections) { Object.values(nestedSections.controls).map(function (nestedControl) { if (nestedControl.section) { self.customizerSectionStyle(nestedControl); } }); }); } }); }, returnControlStyle: function (control) { var self = this; if (control.style) { Object.entries(control.style).map(function (css) { var condition = control.condition != undefined || control.checkExtension != undefined ? self.checkControlCondition(control.condition, control.checkExtension) : true; if (condition) { self.feedStyle += css[0] + '{' + css[1].replace("{{value}}", self.customizerFeedData.settings[control.id]) + '}'; } }); } }, /** * Customizer Control Ajax * Some of the customizer controls need to perform Ajax * Calls in order to update the preview * * @since 6.0 */ customizerControlAjaxAction: function (actionType, settingID = false) { var self = this; switch (actionType) { case 'feedFlyPreview': self.loadingBar = true; self.templateRender = false; var previewFeedData = { action: 'sbi_feed_saver_manager_fly_preview', feedID: self.customizerFeedData.feed_info.id, previewSettings: self.customizerFeedData.settings, feedName: self.customizerFeedData.feed_info.feed_name, }; if (self.getModerationShoppableMode) { previewFeedData['moderationShoppableMode'] = true; previewFeedData['offset'] = self.moderationShoppableModeOffset; } self.ajaxPost(previewFeedData, function (_ref) { var data = _ref.data; if (data !== false) { self.updatedTimeStamp = new Date().getTime(); self.template = String("
" + data + "
"); self.moderationShoppableModeAjaxDone = self.getModerationShoppableMode ? true : false; self.processNotification("previewUpdated"); } else { self.processNotification("unkownError"); } jQuery('body').find('#sbi_load .sbi_load_btn').unbind('click') }); break; case 'feedPreviewRender': setTimeout(function () { }, 150); break; } }, /** * Ajax Action : Save Feed Settings * * @since 4.0 */ saveFeedSettings: function (leavePage = false) { var self = this, sources = [], updateFeedData = { action: 'sbi_feed_saver_manager_builder_update', update_feed: 'true', feed_id: self.customizerFeedData.feed_info.id, feed_name: self.customizerFeedData.feed_info.feed_name, settings: self.customizerFeedData.settings, sources: self.getFeedIdSourcesSaver(), tagged: self.getFeedIdSourcesTaggedSaver(), hashtag: self.getFeedHashtagsSaver(), type: self.getFeedTypeSaver(), shoppablelist: self.customizerFeedData.settings.shoppablelist, moderationlist: self.customizerFeedData.settings.moderationlist }; self.loadingBar = true; self.ajaxPost(updateFeedData, function (_ref) { var data = _ref.data; if (data && data.success === true) { self.processNotification('feedSaved'); self.customizerFeedDataInitial = self.customizerFeedData; if (leavePage === true) { setTimeout(function () { window.location.href = self.builderUrl; }, 1500) } } else { self.processNotification('feedSavedError'); } }); sbiBuilder.$forceUpdate(); }, /** * Ajax Action : Clear Single Feed Cache * Update Feed Preview Too * @since 4.0 */ clearSingleFeedCache: function () { var self = this, sources = [], clearFeedData = { action: 'sbi_feed_saver_manager_clear_single_feed_cache', feedID: self.customizerFeedData.feed_info.id, previewSettings: self.customizerFeedData.settings, feedName: self.customizerFeedData.feed_info.feed_name, }; self.loadingBar = true; self.ajaxPost(clearFeedData, function (_ref) { var data = _ref.data; if (data !== false) { self.processNotification('cacheCleared'); } else { self.processNotification("unkownError"); } }) sbiBuilder.$forceUpdate(); }, /** * Clear & Reset Color Override * * @since 4.0 */ resetColorOverride: function (settingID) { this.customizerFeedData.settings[settingID] = ''; }, /** * Moderation & Shoppable Mode Pagination * * @since 4.0 */ moderationModePagination: function (type) { var self = this; if (type == 'next') { self.moderationShoppableModeOffset = self.moderationShoppableModeOffset + 1; } if (type == 'previous') { self.moderationShoppableModeOffset = self.moderationShoppableModeOffset > 0 ? (self.moderationShoppableModeOffset - 1) : 0; } self.customizerControlAjaxAction('feedFlyPreview'); }, /** * Remove Source Form List Multifeed * * @since 4.0 */ removeSourceCustomizer: function (type, args = []) { var self = this; Object.assign(self.customizerScreens.sourcesChoosed, self.customizerFeedData.settings.sources); self.selectSourceCustomizer(args, true); sbiBuilder.$forceUpdate(); window.event.stopPropagation(); }, /** * Custom Flied CLick * Action * @since 6.0 */ fieldCustomClickAction: function (clickAction) { var self = this; switch (clickAction) { case 'clearCommentCache': self.clearCommentCache(); break; } }, /** * Clear Comment Cache * Action * @since 6.0 */ clearCommentCache: function () { var self = this; self.loadingBar = true; var clearCommentCacheData = { action: 'sbi_feed_saver_manager_clear_comments_cache', }; self.ajaxPost(clearCommentCacheData, function (_ref) { var data = _ref.data; if (data === 'success') { self.processNotification("commentCacheCleared"); } else { self.processNotification("unkownError"); } }); }, /** * Open Dialog Box * * @since 4.0 */ openDialogBox: function (type, args = []) { var self = this, heading = self.dialogBoxPopupScreen[type].heading, description = self.dialogBoxPopupScreen[type].description, customButtons = self.dialogBoxPopupScreen[type].customButtons; switch (type) { case "deleteSourceCustomizer": self.sourceToDelete = args; heading = heading.replace("#", self.sourceToDelete.username); break; case "deleteSingleFeed": self.feedToDelete = args; heading = heading.replace("#", self.feedToDelete.feed_name); break; case "deleteSource": self.sourceToDelete = args; heading = heading.replace("#", self.sourceToDelete.username); break; } self.dialogBox = { active: true, type: type, heading: heading, description: description, customButtons: customButtons }; window.event.stopPropagation(); }, /** * Confirm Dialog Box Actions * * @since 4.0 */ confirmDialogAction: function () { var self = this; switch (self.dialogBox.type) { case 'deleteSourceCustomizer': self.selectSourceCustomizer(self.sourceToDelete, true); self.customizerControlAjaxAction('feedFlyPreview'); break; case 'deleteSingleFeed': self.feedActionDelete([self.feedToDelete.id]); break; case 'deleteMultipleFeeds': self.feedActionDelete(self.feedsSelected); break; case 'backAllToFeed': //Save & Exist; self.saveFeedSettings(true); break; case 'unsavedFeedSources': self.updateFeedTypeAndSourcesCustomizer(); break; case 'deleteSource': self.deleteSource(self.sourceToDelete); break; } }, /** * Show Tooltip on Hover * * @since 4.0 */ toggleElementTooltip: function (tooltipText, type, align = 'center') { var self = this, target = window.event.currentTarget, tooltip = (target != undefined && target != null) ? document.querySelector('.sb-control-elem-tltp-content') : null; if (tooltip != null && type == 'show') { self.tooltip.text = tooltipText; var position = target.getBoundingClientRect(), left = position.left + 10, top = position.top - 10; tooltip.style.left = left + 'px'; tooltip.style.top = top + 'px'; tooltip.style.textAlign = align; self.tooltip.hover = true; } if (type == 'hide') { setTimeout(function () { if (self.tooltip.hoverType != 'inside') { self.tooltip.hover = false; } }, 200) } }, /** * Hover Tooltip * * @since 4.0 */ hoverTooltip: function (type, hoverType) { this.tooltip.hover = type; this.tooltip.hoverType = hoverType; }, /** * Loading Bar & Notification * * @since 4.0 */ processNotification: function (notificationType) { var self = this, notification = self.genericText.notification[notificationType]; self.loadingBar = false; self.notificationElement = { type: notification.type, text: notification.text, shown: "shown" }; setTimeout(function () { self.notificationElement.shown = "hidden"; }, 5000); }, /** * Return Account Avatar * * @since 4.0 * * @return string */ returnAccountAvatar: function (source) { if (typeof source.local_avatar_url !== "undefined" && source.local_avatar_url !== '') { return source.local_avatar_url; } if (typeof source.avatar_url !== "undefined" && source.avatar_url !== '') { return source.avatar_url; } return false; }, /** * Returns the caption for posts * * @since 6.0 * * @return string */ getPostCaption: function (caption, postID) { var self = this, customizerSettings = self.customizerFeedData.settings; caption = caption.replace(//g, ">").replace(/<br>|<br \/>/g, '
'); if (self.checkNotEmpty(customizerSettings.captionlength)) { return '' + (self.expandedCaptions.includes(postID) ? caption : caption.substring(0, parseInt(customizerSettings.captionlength))) + '' + (caption.length > parseInt(customizerSettings.captionlength) ? ' ...' : ''); } var captionLength = !self.checkNotEmpty(customizerSettings.captionlength) ? 50 : parseInt(customizerSettings.captionlength); return '' + caption.substring(0, captionLength) + ''; }, /** * Check if Post Is a Shoppable Post * * @since 6.0 * * @return boolean */ checkPostShoppableFeed: function (postId) { var self = this, customizerSettings = self.customizerFeedData.settings; return typeof self.customizerFeedData.settings.shoppablelist === 'object' && customizerSettings.shoppablelist[postId] !== undefined; }, /** * Open Shoppable Control for adding new Post * * @since 6.0 */ openPostShoppableFeed: function (postId, media, caption = '') { var self = this, customizerSettings = self.customizerFeedData.settings; self.shoppableFeed.postId = postId; self.shoppableFeed.postShoppableUrl = (typeof self.customizerFeedData.settings.shoppablelist === 'object' && customizerSettings.shoppablelist[postId] !== undefined) ? customizerSettings.shoppablelist[postId] : ''; self.shoppableFeed.postMedia = media; self.shoppableFeed.postCaption = caption; }, /** * Save Post Shoppable Feed * * @since 6.0 */ addPostShoppableFeed: function () { var self = this, customizerSettings = self.customizerFeedData.settings; if (self.checkNotEmpty(self.shoppableFeed.postShoppableUrl)) { self.customizerFeedData.settings.shoppablelist = (typeof self.customizerFeedData.settings.shoppablelist === 'object') ? self.customizerFeedData.settings.shoppablelist : {}; self.customizerFeedData.settings.shoppablelist[self.shoppableFeed.postId] = self.shoppableFeed.postShoppableUrl; self.shoppableFeed = { postId: null, postMedia: null, postCaption: null, postShoppableUrl: '' }; } else { delete self.customizerFeedData.settings.shoppablelist[self.shoppableFeed.postId]; } }, /** * Cancel Post Shoppable Feed * * @since 6.0 */ cancelPostShoppableFeed: function () { var self = this; if (!self.checkNotEmpty(self.shoppableFeed.postShoppableUrl)) { delete self.customizerFeedData.settings.shoppablelist[self.shoppableFeed.postId]; } self.shoppableFeed = { postId: null, postMedia: null, postCaption: null, postShoppableUrl: '' }; }, /** * Open Moderation Mode * * @since 6.0 */ openModerationMode: function () { var self = this; Object.assign(self.moderationSettings, self.customizerFeedData.settings.moderationlist); self.customBlockModerationlistTemp = `${self.customizerFeedData.settings.customBlockModerationlist}`; self.activateView('moderationMode'); }, /** * Switch Moderation List Type * * @since 6.0 */ switchModerationListType: function (moderationlistType) { var self = this; self.moderationSettings.list_type_selected = moderationlistType; }, /** * Switch Moderation List Type * * @since 6.0 */ saveModerationSettings: function () { var self = this; Object.assign(self.customizerFeedData.settings.moderationlist, self.moderationSettings); self.customizerFeedData.settings.customBlockModerationlist = `${self.customBlockModerationlistTemp}`; self.activateView('moderationMode'); }, /** * Check Post in Moderation Mode * * @since 6.0 */ checkPostModertationMode: function (postID) { var self = this; if (self.moderationSettings.list_type_selected == "allow") { if (self.moderationSettings.allow_list.includes(postID) || self.moderationSettings.allow_list.includes(postID.toString())) { return 'active'; } else { return 'inactive'; } } if (self.moderationSettings.list_type_selected == "block") { var combinedBlockedList = Array.from(self.moderationSettings.block_list.concat(self.customBlockModerationlistTemp.split(','))); if (combinedBlockedList.includes(postID) || combinedBlockedList.includes(postID.toString())) { return 'inactive'; } else { return 'active'; } } }, checkPostModertationModeAttribute: function (postID) { return ''; }, /** * Add Post To Moderation List * Depending on * * @since 6.0 */ addPostToModerationList: function (postID) { var self = this; if (self.moderationSettings.list_type_selected == "allow") { if (self.moderationSettings.allow_list.includes(postID)) { self.moderationSettings.allow_list.push(postID); self.moderationSettings.allow_list.splice(self.moderationSettings.allow_list.indexOf(postID), 1); self.moderationSettings.allow_list.splice(self.moderationSettings.allow_list.indexOf(postID.toString()), 1); } else { self.moderationSettings.allow_list.push(postID); } } if (self.moderationSettings.list_type_selected == "block") { if (self.moderationSettings.block_list.includes(postID)) { self.moderationSettings.block_list.push(postID); self.moderationSettings.block_list.splice(self.moderationSettings.block_list.indexOf(postID), 1); self.moderationSettings.block_list.splice(self.moderationSettings.block_list.indexOf(postID.toString()), 1); } else { self.moderationSettings.block_list.push(postID); } } }, /** * Choose Hashtag Order By * * @since 6.0 */ selectedHastagOrderBy: function (orderBy) { if (this.customizerFeedData != undefined) { this.customizerFeedData.settings.order = orderBy; } else { this.hashtagOrderBy = orderBy; } }, ctaToggleFeatures: function () { this.freeCtaShowFeatures = !this.freeCtaShowFeatures; }, /** * Check Personal Account Info * * @since 6.0.8 */ checkPeronalAccount: function () { let self = this; if (self.selectedSources.length > 0) { let sourceInfo = self.sourcesList.filter(function (source) { return source.account_id == self.selectedSources[0]; }); sourceInfo = sourceInfo[0] ? sourceInfo[0] : []; if (sourceInfo?.header_data?.account_type && sourceInfo?.header_data?.account_type.toLowerCase() === 'personal' && self.checkSinglePersonalData(sourceInfo?.header_data?.biography) && self.checkSinglePersonalData(sourceInfo?.local_avatar) ) { self.$refs.personalAccountRef.personalAccountInfo.id = sourceInfo.account_id; self.$refs.personalAccountRef.personalAccountInfo.username = sourceInfo.username; return false } } return true; }, checkSinglePersonalData: function (data) { return data === false || data === undefined || (data !== undefined && data !== false && !this.checkNotEmpty(data)); }, /** * Cancel Personal Account * * @since 6.0.8 */ cancelPersonalAccountUpdate: function () { let self = this; self.submitNewFeed(); }, /** * Triggered When updating Personal Account info * * @since 6.0.8 */ successPersonalAccountUpdate: function () { let self = this; self.processNotification('personalAccountUpdated'); this.creationProcessNext(); }, /** * Next Wizard Step * * @since 6.3 */ nextWizardStep : function( action = false ){ const self = this; if( action === 'submit' ){ self.submitWizardData() } if( self.currentOnboardingWizardStep < self.onboardingWizardContent.steps.length ){ self.currentOnboardingWizardStep +=1; } }, // submitWizardData : function(){ const self = this, wizardData = { action: 'sbi_feed_saver_manager_process_wizard', data: JSON.stringify(self.currentOnboardingWizardActiveSettings) }; self.ajaxPost(wizardData, function (_ref) { }); if( self.sourcesList.length > 0 ){ self.onboardingSuccessMessagesDisplay.push( self.onboardingSuccessMessages.connectAccount ); } self.onboardingSuccessMessagesDisplay.push( self.onboardingSuccessMessages.setupFeatures ); const settingsValues = Object.values(self.currentOnboardingWizardActiveSettings), settingsKeys = Object.keys(self.currentOnboardingWizardActiveSettings); settingsValues.map( ( st, stInd ) => { if( st?.plugins && st?.plugins === 'smash' ){ self.onboardingSuccessMessagesDisplay.push( self.onboardingSuccessMessages.feedPlugins.replace('#', settingsKeys[stInd]) ); }else if( st?.id === 'reviews' ){ self.onboardingSuccessMessagesDisplay.push( 'Reviews Feed ' + self.genericText.installed ); }else if( st?.type === 'install_plugins' ){ self.onboardingSuccessMessagesDisplay.push( ' ' + st?.pluginName + ' ' + self.genericText.installed ); } } ) setTimeout(function(){ self.onboardingWizardDone = 'true'; }, 100) sbiBuilder.$forceUpdate(); }, /** * Previous Wizard Step * * @since 6.3 */ previousWizardStep : function(){ const self = this; if( self.currentOnboardingWizardStep > 0 ){ self.currentOnboardingWizardStep -=1; } }, /** * Delete Source Ajax * * @since 4.0 */ deleteSource: function (sourceToDelete) { var self = this, deleteSourceData = { action: 'sbi_feed_saver_manager_delete_source', source_id: sourceToDelete.id, username : sourceToDelete.username, nonce : self.admin_nonce }; self.ajaxPost(deleteSourceData, function (_ref) { var data = _ref.data; self.sourcesList = data; }); }, //Get Source Avatarr getSourceListAvatar: function ( headerData ) { var self = this if (headerData['local_avatar_url'] != false && self.checkNotEmpty(headerData['local_avatar_url'])) { return headerData['local_avatar_url']; } else { if (self.hasOwnNestedProperty(headerData, 'profile_picture')) { return headerData['profile_picture']; } else if (self.hasOwnNestedProperty(headerData, 'profile_picture_url')) { return headerData['profile_picture_url']; } else if (self.hasOwnNestedProperty(headerData, 'user.profile_picture')) { return headerData['user']['profile_picture']; } else if (self.hasOwnNestedProperty(headerData, 'data.profile_picture')) { return headerData['data']['profile_picture']; } } return self.onboardingWizardContent.userIcon; }, //Switcher Onboarding Wizard Click switcherOnboardingWizardClick : function ( elem ) { const self = this; if( elem?.uncheck === true ){ return false; } if(self.currentOnboardingWizardActiveSettings[elem?.data?.id] !== undefined){ delete self.currentOnboardingWizardActiveSettings[elem.data.id]; }else{ self.currentOnboardingWizardActiveSettings[elem.data.id] = elem.data; } sbiBuilder.$forceUpdate(); }, switcherOnboardingWizardCheckActive : function ( elem ) { const self = this; if( elem?.uncheck === true ){ return elem?.active; }else{ return self.currentOnboardingWizardActiveSettings[elem?.data?.id] !== undefined ? 'true' : 'false' } }, checkActiveOnboardingWizardSettings : function (){ const self = this, currentStepContentSteps = self.onboardingWizardContent.steps; currentStepContentSteps.map( (step, stepId) => { let = currentStepContentValues = Object.values(step), currentStepContentKeys = Object.keys(step); currentStepContentValues.map( (sec, secId) => { if( (self.onboardingWizardContent.saveSettings.includes(currentStepContentKeys[secId])) ){ currentStepContentValues[secId].forEach( elem => { if( elem.active === true && elem?.data){ self.currentOnboardingWizardActiveSettings[elem.data.id] = elem.data; } } ); } }); }); }, dismissOnboardingWizard : function(){ const self = this, dismissWizardData = { action: 'sbi_feed_saver_manager_dismiss_wizard' }; self.ajaxPost(dismissWizardData, function (_ref) { window.location = self.builderUrl; }); sbiBuilder.$forceUpdate(); }, //One CLick Upgrade runOneClickUpgrade : function(){ const self = this, oneClickUpgradeData = { action: 'sbi_maybe_upgrade_redirect', license_key: self.setupLicencekey, nonce : self.admin_nonce }; self.setupLicencekeyError = null if( self.checkNotEmpty( self.setupLicencekey ) ){ self.licenseLoading = true; self.ajaxPost(oneClickUpgradeData, function (_ref) { var data = _ref.data; if (data.success === false) { self.licenseLoading = false; if (typeof data.data !== 'undefined') { self.setupLicencekeyError = data.data.message } } if (data.success === true) { window.location.href = data.data.url } }); } } } }); function sbiBuilderToggleCaption(postID) { if (sbiBuilder.expandedCaptions.includes(postID)) { sbiBuilder.expandedCaptions.splice(sbiBuilder.expandedCaptions.indexOf(postID), 1); } else { sbiBuilder.expandedCaptions.push(postID); } } jQuery(document).ready(function () { jQuery('body').find('#sbi_load .sbi_load_btn').unbind('click') }) .elementor-lightbox { --lightbox-ui-color: rgba(238, 238, 238, 0.9); --lightbox-ui-color-hover: #fff; --lightbox-text-color: var(--lightbox-ui-color); --lightbox-header-icons-size: 20px; --lightbox-navigation-icons-size: 25px; } .elementor-lightbox:not(.elementor-popup-modal) .dialog-header, .elementor-lightbox:not(.elementor-popup-modal) .dialog-message { text-align: center; } .elementor-lightbox .dialog-header { display: none; } .elementor-lightbox .dialog-widget-content { background: none; box-shadow: none; width: 100%; height: 100%; } .elementor-lightbox .dialog-message { animation-duration: 0.3s; height: 100%; } .elementor-lightbox .dialog-message.dialog-lightbox-message { padding: 0; } .elementor-lightbox .dialog-lightbox-close-button { cursor: pointer; position: absolute; font-size: var(--lightbox-header-icons-size); inset-inline-end: 0.75em; margin-top: 13px; padding: 0.25em; z-index: 2; line-height: 1; display: flex; } .elementor-lightbox .dialog-lightbox-close-button svg { height: 1em; width: 1em; } .elementor-lightbox .dialog-lightbox-close-button, .elementor-lightbox .elementor-swiper-button { color: var(--lightbox-ui-color); transition: all 0.3s; opacity: 1; } .elementor-lightbox .dialog-lightbox-close-button svg, .elementor-lightbox .elementor-swiper-button svg { fill: var(--lightbox-ui-color); } .elementor-lightbox .dialog-lightbox-close-button:hover, .elementor-lightbox .elementor-swiper-button:hover { color: var(--lightbox-ui-color-hover); } .elementor-lightbox .dialog-lightbox-close-button:hover svg, .elementor-lightbox .elementor-swiper-button:hover svg { fill: var(--lightbox-ui-color-hover); } .elementor-lightbox .swiper { height: 100%; } .elementor-lightbox .elementor-lightbox-item { display: flex; align-items: center; justify-content: center; position: relative; padding: 70px; box-sizing: border-box; height: 100%; margin: auto; } @media (max-width: 767px) { .elementor-lightbox .elementor-lightbox-item { padding: 70px 0; } } .elementor-lightbox .elementor-lightbox-image { max-height: 100%; user-select: none; } .elementor-lightbox .elementor-lightbox-image, .elementor-lightbox .elementor-lightbox-image:hover { opacity: 1; filter: none; border: none; } .elementor-lightbox .elementor-lightbox-image { box-shadow: 0 0 30px rgba(0, 0, 0, 0.3), 0 0 8px -5px rgba(0, 0, 0, 0.3); border-radius: 2px; } .elementor-lightbox .elementor-video-container { width: 100%; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); } .elementor-lightbox .elementor-video-container .elementor-video-square, .elementor-lightbox .elementor-video-container .elementor-video-landscape, .elementor-lightbox .elementor-video-container .elementor-video-portrait { width: 100%; height: 100%; margin: auto; } .elementor-lightbox .elementor-video-container .elementor-video-square iframe, .elementor-lightbox .elementor-video-container .elementor-video-landscape iframe, .elementor-lightbox .elementor-video-container .elementor-video-portrait iframe { border: 0; background-color: #000; } .elementor-lightbox .elementor-video-container .elementor-video-square iframe, .elementor-lightbox .elementor-video-container .elementor-video-square video, .elementor-lightbox .elementor-video-container .elementor-video-landscape iframe, .elementor-lightbox .elementor-video-container .elementor-video-landscape video, .elementor-lightbox .elementor-video-container .elementor-video-portrait iframe, .elementor-lightbox .elementor-video-container .elementor-video-portrait video { aspect-ratio: var(--video-aspect-ratio, 1.77777); } .elementor-lightbox .elementor-video-container .elementor-video-square iframe, .elementor-lightbox .elementor-video-container .elementor-video-square video { width: min(90vh, 90vw); height: min(90vh, 90vw); } .elementor-lightbox .elementor-video-container .elementor-video-landscape iframe, .elementor-lightbox .elementor-video-container .elementor-video-landscape video { width: 100%; max-height: 90vh; height: auto; } .elementor-lightbox .elementor-video-container .elementor-video-portrait iframe, .elementor-lightbox .elementor-video-container .elementor-video-portrait video { height: 100%; max-width: 90vw; } @media (min-width: 1025px) { .elementor-lightbox .elementor-video-container .elementor-video-landscape { width: 85vw; max-height: 85vh; } .elementor-lightbox .elementor-video-container .elementor-video-portrait { height: 85vh; max-width: 85vw; } } @media (max-width: 1024px) { .elementor-lightbox .elementor-video-container .elementor-video-landscape { width: 95vw; max-height: 95vh; } .elementor-lightbox .elementor-video-container .elementor-video-portrait { height: 95vh; max-width: 95vw; } } .elementor-lightbox .swiper .elementor-swiper-button-prev { left: 0; } .elementor-lightbox .swiper .elementor-swiper-button-next { right: 0; } .elementor-lightbox .swiper .swiper-pagination-fraction { width: max-content; color: #ffffff; } .elementor-lightbox .elementor-swiper-button:focus { outline-width: 1px; } .elementor-lightbox .elementor-swiper-button-prev, .elementor-lightbox .elementor-swiper-button-next { height: 100%; display: flex; align-items: center; width: 15%; justify-content: center; font-size: var(--lightbox-navigation-icons-size); } @media (max-width: 1024px) { .elementor-lightbox .elementor-swiper-button-prev:active, .elementor-lightbox .elementor-swiper-button-next:active { -webkit-tap-highlight-color: transparent; /* fallback for some Androids */ -webkit-tap-highlight-color: rgba(0, 0, 0, 0); } .elementor-lightbox .elementor-swiper-button-prev svg, .elementor-lightbox .elementor-swiper-button-prev i, .elementor-lightbox .elementor-swiper-button-next svg, .elementor-lightbox .elementor-swiper-button-next i { cursor: pointer; } .elementor-lightbox .elementor-swiper-button-prev svg:active, .elementor-lightbox .elementor-swiper-button-prev i:active, .elementor-lightbox .elementor-swiper-button-next svg:active, .elementor-lightbox .elementor-swiper-button-next i:active { outline: none; background-color: rgba(0, 0, 0, 0.5); } } @media (max-width: 767px) { .elementor-lightbox .elementor-swiper-button:focus { outline: none; } .elementor-lightbox .elementor-swiper-button-prev, .elementor-lightbox .elementor-swiper-button-next { width: 20%; } .elementor-lightbox .elementor-swiper-button-prev:active, .elementor-lightbox .elementor-swiper-button-next:active { -webkit-tap-highlight-color: transparent; /* fallback for some Androids */ -webkit-tap-highlight-color: rgba(0, 0, 0, 0); } .elementor-lightbox .elementor-swiper-button-prev i, .elementor-lightbox .elementor-swiper-button-next i { padding: 10px; background-color: rgba(0, 0, 0, 0.5); } .elementor-lightbox .elementor-swiper-button-prev svg, .elementor-lightbox .elementor-swiper-button-prev i, .elementor-lightbox .elementor-swiper-button-next svg, .elementor-lightbox .elementor-swiper-button-next i { cursor: pointer; } .elementor-lightbox .elementor-swiper-button-prev svg:active, .elementor-lightbox .elementor-swiper-button-prev i:active, .elementor-lightbox .elementor-swiper-button-next svg:active, .elementor-lightbox .elementor-swiper-button-next i:active { outline: none; background-color: rgba(0, 0, 0, 0.5); } .elementor-lightbox .elementor-swiper-button-prev { left: 0; justify-content: flex-start; } .elementor-lightbox .elementor-swiper-button-next { right: 0; justify-content: flex-end; } } .elementor-slideshow__counter { color: currentColor; font-size: 0.75em; width: max-content; } .elementor-slideshow__header, .elementor-slideshow__footer { position: absolute; left: 0; width: 100%; padding: 15px 20px; transition: 0.3s; } .elementor-slideshow__footer { color: var(--lightbox-text-color); } .elementor-slideshow__header { color: var(--lightbox-ui-color); display: flex; flex-direction: row-reverse; font-size: var(--lightbox-header-icons-size); padding-inline-start: 1em; padding-inline-end: 2.6em; top: 0; align-items: center; z-index: 10; } .elementor-slideshow__header > i, .elementor-slideshow__header > svg { cursor: pointer; padding: 0.25em; margin: 0 0.35em; } .elementor-slideshow__header > i { font-size: inherit; } .elementor-slideshow__header > i:hover { color: var(--lightbox-ui-color-hover); } .elementor-slideshow__header > svg { box-sizing: content-box; fill: var(--lightbox-ui-color); height: 1em; width: 1em; } .elementor-slideshow__header > svg:hover { fill: var(--lightbox-ui-color-hover); } .elementor-slideshow__header .elementor-slideshow__counter { margin-inline-end: auto; } .elementor-slideshow__header .elementor-icon-share { z-index: 5; } .elementor-slideshow__share-menu { background-color: rgba(0, 0, 0, 0); width: 0; height: 0; position: absolute; overflow: hidden; transition: background-color 400ms; } .elementor-slideshow__share-menu .elementor-slideshow__share-links a { color: #0C0D0E; } .elementor-slideshow__share-links { display: block; position: absolute; min-width: 200px; inset-inline-end: 2.8em; top: 3em; background-color: #fff; border-radius: 3px; padding: 14px 20px; transform: scale(0); opacity: 0; transform-origin: 90% 10%; transition: all 250ms 100ms; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3); } .elementor-slideshow__share-links a { text-align: start; color: #3f444b; font-size: 12px; line-height: 2.5; display: block; opacity: 0; transition: opacity 500ms 100ms; } .elementor-slideshow__share-links a:hover { color: #000; } .elementor-slideshow__share-links a i, .elementor-slideshow__share-links a svg { margin-inline-end: 0.75em; } .elementor-slideshow__share-links a i { font-size: 1.25em; } .elementor-slideshow__share-links a svg { height: 1.25em; width: 1.25em; } .elementor-slideshow__share-links:before { content: ""; display: block; position: absolute; top: 1px; inset-inline-end: 0.5em; border: 0.45em solid; border-color: transparent transparent #fff transparent; transform: translateY(-100%) scaleX(0.7); } .elementor-slideshow__footer { bottom: 0; z-index: 5; position: fixed; } .elementor-slideshow__title, .elementor-slideshow__description { margin: 0; } .elementor-slideshow__title { font-size: 16px; font-weight: bold; } .elementor-slideshow__description { font-size: 14px; } .elementor-slideshow--ui-hidden .elementor-slideshow__header, .elementor-slideshow--ui-hidden .elementor-slideshow__footer { opacity: 0; pointer-events: none; } .elementor-slideshow--ui-hidden .elementor-swiper-button-prev, .elementor-slideshow--ui-hidden .elementor-swiper-button-next { opacity: 0; } .elementor-slideshow--fullscreen-mode .elementor-video-container { width: 100%; } .elementor-slideshow--zoom-mode .elementor-slideshow__header, .elementor-slideshow--zoom-mode .elementor-slideshow__footer { background-color: rgba(0, 0, 0, 0.5); } .elementor-slideshow--zoom-mode .elementor-swiper-button-prev, .elementor-slideshow--zoom-mode .elementor-swiper-button-next { opacity: 0; pointer-events: none; } .elementor-slideshow--share-mode .elementor-slideshow__share-menu { top: 0; left: 0; width: 100vw; height: 100vh; opacity: 1; cursor: default; background-color: rgba(0, 0, 0, 0.5); } .elementor-slideshow--share-mode .elementor-slideshow__share-links { transform: scale(1); } .elementor-slideshow--share-mode .elementor-slideshow__share-links, .elementor-slideshow--share-mode .elementor-slideshow__share-links a { opacity: 1; } .elementor-slideshow--share-mode .elementor-slideshow__share-links .eicon-twitter { color: #1DA1F2; } .elementor-slideshow--share-mode .elementor-slideshow__share-links .eicon-facebook { color: #3b5998; } .elementor-slideshow--share-mode .elementor-slideshow__share-links .eicon-pinterest { color: #bd081c; } .elementor-slideshow--share-mode .elementor-slideshow__share-links .eicon-download-bold { color: #9DA5AE; } .elementor-slideshow--share-mode .elementor-slideshow__share-links .e-eicon-twitter { fill: #1DA1F2; } .elementor-slideshow--share-mode .elementor-slideshow__share-links .e-eicon-facebook { fill: #3b5998; } .elementor-slideshow--share-mode .elementor-slideshow__share-links .e-eicon-pinterest { fill: #bd081c; } .elementor-slideshow--share-mode .elementor-slideshow__share-links .e-eicon-download-bold { fill: #9DA5AE; } .elementor-slideshow--share-mode .eicon-share-arrow { z-index: 2; } /*# sourceMappingURL=lightbox.css.map */

{ "name": "freemius-wordpress-sdk", "description": "Monetization, analytics, and marketing automation platform for plugin & theme developers.", "author": "Freemius, Inc.", "license": "GPL-3.0", "homepage": "https://freemius.com", "version": "2.4.3", "main": "gulpfile.js", "dependencies": {}, "scripts": { "test": "echo \"Error: no test specified\" && exit 1", "prune": "rimraf .codeclimate.yml .git .github .gitignore .travis.yml gulpfile.js composer.json" }, "repository": "Freemius/wordpress-sdk.git", "devDependencies": { "gulp": "^3.9.1", "gulp-clean": "^0.3.2", "gulp-fs": "0.0.2", "gulp-gettext": "^0.3.0", "gulp-path": "^3.0.3", "gulp-pofill": "^1.0.0", "gulp-rename": "^1.2.2", "gulp-sort": "^2.0.0", "gulp-transifex": "^0.1.17", "gulp-wp-pot": "^1.3.5" } }
/*! * Dialogs Manager v4.9.4 * https://github.com/kobizz/dialogs-manager * * Copyright Kobi Zaltzberg * Released under the MIT license * https://github.com/kobizz/dialogs-manager/blob/master/LICENSE.txt */ (function($, global) { 'use strict'; /* * Dialog Manager */ var DialogsManager = { widgetsTypes: {}, createWidgetType: function(typeName, properties, Parent) { if (!Parent) { Parent = this.Widget; } var WidgetType = function() { Parent.apply(this, arguments); }; var prototype = WidgetType.prototype = new Parent(typeName); prototype.types = prototype.types.concat([typeName]); $.extend(prototype, properties); prototype.constructor = WidgetType; WidgetType.extend = function(typeName, properties) { return DialogsManager.createWidgetType(typeName, properties, WidgetType); }; return WidgetType; }, addWidgetType: function(typeName, properties, Parent) { if (properties && properties.prototype instanceof this.Widget) { return this.widgetsTypes[typeName] = properties; } return this.widgetsTypes[typeName] = this.createWidgetType(typeName, properties, Parent); }, getWidgetType: function(widgetType) { return this.widgetsTypes[widgetType]; } }; /* * Dialog Manager instances constructor */ DialogsManager.Instance = function() { var self = this, elements = {}, settings = {}; self.openDialogs = []; var initElements = function() { elements.body = $('body'); }; var initSettings = function(options) { var defaultSettings = { classPrefix: 'dialog', effects: { show: 'fadeIn', hide: 'fadeOut' } }; $.extend(settings, defaultSettings, options); }; this.createWidget = function(widgetType, properties) { var WidgetTypeConstructor = DialogsManager.getWidgetType(widgetType), widget = new WidgetTypeConstructor(widgetType); properties = properties || {}; widget.init(self, properties); return widget; }; this.getSettings = function(property) { if (property) { return settings[property]; } return Object.create(settings); }; this.maybeLoadAssets = async function () { const isFrontend = !! window.elementorFrontend?.utils?.assetsLoader; if ( ! isFrontend ) { return; } try { await elementorFrontend.utils.assetsLoader.load( 'style', 'dialog' ); } catch ( error ) { console.error( 'Failed to load assets:', error ); } }; this.init = function (settings) { this.maybeLoadAssets(); initSettings(settings); initElements(); return self; }; self.init(); }; /* * Widget types constructor */ DialogsManager.Widget = function(widgetName) { var self = this, settings = {}, events = {}, elements = {}, hideTimeOut = 0, baseClosureMethods = ['refreshPosition']; var bindEvents = function() { var windows = [elements.window]; if (elements.iframe) { windows.push(jQuery(elements.iframe[0].contentWindow)); } windows.forEach(function(window) { if (settings.hide.onEscKeyPress) { window.on('keyup', onWindowKeyUp); } if (settings.hide.onOutsideClick) { window[0].addEventListener('click', hideOnOutsideClick, true); } if (settings.hide.onOutsideContextMenu) { window[0].addEventListener('contextmenu', hideOnOutsideClick, true); } if (settings.position.autoRefresh) { window.on('resize', self.refreshPosition); } }); if (settings.hide.onClick || settings.hide.onBackgroundClick) { elements.widget.on('click', hideOnClick); } }; var callEffect = function(intent, params) { var effect = settings.effects[intent], $widget = elements.widget; if ('function' === typeof effect) { effect.apply($widget, params); } else { if ($widget[effect]) { $widget[effect].apply($widget, params); } else { throw 'Reference Error: The effect ' + effect + ' not found'; } } }; var ensureClosureMethods = function() { var closureMethodsNames = baseClosureMethods.concat(self.getClosureMethods()); $.each(closureMethodsNames, function() { var methodName = this, oldMethod = self[methodName]; self[methodName] = function() { oldMethod.apply(self, arguments); }; }); }; var fixIframePosition = function(position) { if (! position.my) { return; } var horizontalOffsetRegex = /left|right/, extraOffsetRegex = /([+-]\d+)?$/, iframeOffset = elements.iframe.offset(), iframeWindow = elements.iframe[0].contentWindow, myParts = position.my.split(' '), fixedParts = []; if (myParts.length === 1) { if (horizontalOffsetRegex.test(myParts[0])) { myParts.push('center'); } else { myParts.unshift('center'); } } myParts.forEach(function(part, index) { var fixedPart = part.replace(extraOffsetRegex, function(partOffset) { partOffset = +partOffset || 0; if (! index) { partOffset += iframeOffset.left - iframeWindow.scrollX; } else { partOffset += iframeOffset.top - iframeWindow.scrollY; } if (partOffset >= 0) { partOffset = '+' + partOffset; } return partOffset; }); fixedParts.push(fixedPart); }); position.my = fixedParts.join(' '); }; var hideOnClick = function(event) { if (isContextMenuClickEvent(event)) { return; } if (settings.hide.onClick) { if ($(event.target).closest(settings.selectors.preventClose).length) { return; } } else if (event.target !== this) { return; } self.hide(); }; var isIgnoredTarget = function(event) { if (! settings.hide.ignore) { return false; } return !! $(event.target).closest(settings.hide.ignore).length; }; var hideOnOutsideClick = function(event) { if (isContextMenuClickEvent(event) || $(event.target).closest(elements.widget).length || isIgnoredTarget(event)) { return; } self.hide(); }; var initElements = function() { self.addElement('widget'); self.addElement('header'); self.addElement('message'); self.addElement('window', window); self.addElement('body', document.body); self.addElement('container', settings.container); if (settings.iframe) { self.addElement('iframe', settings.iframe); } if (settings.closeButton) { if ( settings.closeButtonClass ) { // Backwards compatibility settings.closeButtonOptions.iconClass = settings.closeButtonClass; } const $button = $('', settings.closeButtonOptions.attributes), $buttonIcon = $(settings.closeButtonOptions.iconElement).addClass(settings.closeButtonOptions.iconClass); $button.append($buttonIcon); self.addElement('closeButton', $button); } var id = self.getSettings('id'); if (id) { self.setID(id); } var classes = []; $.each(self.types, function() { classes.push(settings.classes.globalPrefix + '-type-' + this); }); classes.push(self.getSettings('className')); elements.widget .addClass(classes.join(' ')) .attr({ 'aria-modal': true, 'role': 'document', 'tabindex': 0, }); }; var initSettings = function(parent, userSettings) { var parentSettings = $.extend(true, {}, parent.getSettings()); settings = { headerMessage: '', message: '', effects: parentSettings.effects, classes: { globalPrefix: parentSettings.classPrefix, prefix: parentSettings.classPrefix + '-' + widgetName, preventScroll: parentSettings.classPrefix + '-prevent-scroll', }, selectors: { preventClose: '.' + parentSettings.classPrefix + '-prevent-close', }, container: 'body', preventScroll: false, iframe: null, closeButton: false, closeButtonOptions: { iconClass: parentSettings.classPrefix + '-close-button-icon', attributes: { role: 'button', 'tabindex': 0, 'aria-label': 'Close', href: '#', }, iconElement: '', }, position: { element: 'widget', my: 'center', at: 'center', enable: true, autoRefresh: false, }, hide: { auto: false, autoDelay: 5000, onClick: false, onOutsideClick: true, onOutsideContextMenu: false, onBackgroundClick: true, onEscKeyPress: true, ignore: '', }, }; $.extend(true, settings, self.getDefaultSettings(), userSettings); initSettingsEvents(); }; var initSettingsEvents = function() { $.each(settings, function(settingKey) { var eventName = settingKey.match(/^on([A-Z].*)/); if (!eventName) { return; } eventName = eventName[1].charAt(0).toLowerCase() + eventName[1].slice(1); self.on(eventName, this); }); }; var isContextMenuClickEvent = function(event) { // Firefox fires `click` event on every `contextmenu` event. return event.type === 'click' && event.button === 2; }; var normalizeClassName = function(name) { return name.replace(/([a-z])([A-Z])/g, function() { return arguments[1] + '-' + arguments[2].toLowerCase(); }); }; var onWindowKeyUp = function(event) { var ESC_KEY = 27, keyCode = event.which; if (ESC_KEY === keyCode) { self.hide(); } }; var unbindEvents = function() { var windows = [elements.window]; if (elements.iframe) { windows.push(jQuery(elements.iframe[0].contentWindow)); } windows.forEach(function(window) { if (settings.hide.onEscKeyPress) { window.off('keyup', onWindowKeyUp); } if (settings.hide.onOutsideClick) { window[0].removeEventListener('click', hideOnOutsideClick, true); } if (settings.hide.onOutsideContextMenu) { window[0].removeEventListener('contextmenu', hideOnOutsideClick, true); } if (settings.position.autoRefresh) { window.off('resize', self.refreshPosition); } }); if (settings.hide.onClick || settings.hide.onBackgroundClick) { elements.widget.off('click', hideOnClick); } }; this.addElement = function(name, element, classes) { var $newElement = elements[name] = $(element || '
'), normalizedName = normalizeClassName(name); classes = classes ? classes + ' ' : ''; classes += settings.classes.globalPrefix + '-' + normalizedName; classes += ' ' + settings.classes.prefix + '-' + normalizedName; $newElement.addClass(classes); return $newElement; }; this.destroy = function() { const widgetId = self.getElements('widget')?.attr('id'), index = self.parent.openDialogs.lastIndexOf(widgetId); if (index !== -1) { self.parent.openDialogs.splice(index, 1); } unbindEvents(); elements.widget.remove(); self.trigger('destroy'); return self; }; this.getElements = function(item) { return item ? elements[item] : elements; }; this.getSettings = function(setting) { var copy = Object.create(settings); if (setting) { return copy[setting]; } return copy; }; this.hide = function() { if (! self.isVisible()) { return; } const widgetId = self.getElements('widget')?.attr('id'), openDialogs = self.parent.openDialogs, topDialogId = openDialogs[openDialogs.length - 1]; if (topDialogId !== widgetId) { return; } openDialogs.pop(); clearTimeout(hideTimeOut); callEffect('hide', arguments); unbindEvents(); if (settings.preventScroll) { self.getElements('body').removeClass(settings.classes.preventScroll); } self.trigger('hide'); return self; }; this.init = function(parent, properties) { if (!(parent instanceof DialogsManager.Instance)) { throw 'The ' + self.widgetName + ' must to be initialized from an instance of DialogsManager.Instance'; } self.parent = parent; ensureClosureMethods(); self.trigger('init', properties); initSettings(parent, properties); initElements(); self.buildWidget(); self.attachEvents(); self.trigger('ready'); return self; }; this.isVisible = function() { return elements.widget.is(':visible'); }; this.on = function(eventName, callback) { if ('object' === typeof eventName) { $.each(eventName, function(singleEventName) { self.on(singleEventName, this); }); return self; } var eventNames = eventName.split(' '); eventNames.forEach(function(singleEventName) { if (!events[singleEventName]) { events[singleEventName] = []; } events[singleEventName].push(callback); }); return self; }; this.off = function(eventName, callback) { if (! events[ eventName ]) { return self; } if (! callback) { delete events[eventName]; return self; } var callbackIndex = events[eventName].indexOf(callback); if (-1 !== callbackIndex) { events[eventName].splice(callbackIndex, 1); } return self; }; this.refreshPosition = function() { if (! settings.position.enable) { return; } var position = $.extend({}, settings.position); if (elements[position.of]) { position.of = elements[position.of]; } if (! position.of) { position.of = window; } if (settings.iframe) { fixIframePosition(position); } elements[position.element].position(position); }; this.setID = function(id) { elements.widget.attr('id', id); return self; }; this.setHeaderMessage = function(message) { self.getElements('header').html(message); return self; }; this.setMessage = function(message) { elements.message.html(message); return self; }; this.setSettings = function(key, value) { if (jQuery.isPlainObject(value)) { $.extend(true, settings[key], value); } else { settings[key] = value; } return self; }; this.show = function() { clearTimeout(hideTimeOut); elements.widget.appendTo(elements.container).hide(); callEffect('show', arguments); self.refreshPosition(); if (settings.hide.auto) { hideTimeOut = setTimeout(self.hide, settings.hide.autoDelay); } bindEvents(); if (settings.preventScroll) { self.getElements('body').addClass(settings.classes.preventScroll); } self.trigger('show'); const widgetId = self.getElements('widget')?.attr('id'); self.parent.openDialogs.push(widgetId); return self; }; this.trigger = function(eventName, params) { var methodName = 'on' + eventName[0].toUpperCase() + eventName.slice(1); if (self[methodName]) { self[methodName](params); } var callbacks = events[eventName]; if (!callbacks) { return; } $.each(callbacks, function(index, callback) { callback.call(self, params); }); return self; }; }; DialogsManager.Widget.prototype.types = []; // Inheritable widget methods DialogsManager.Widget.prototype.buildWidget = function() { var elements = this.getElements(), settings = this.getSettings(); elements.widget.append(elements.header, elements.message); this.setHeaderMessage(settings.headerMessage); this.setMessage(settings.message); if (this.getSettings('closeButton')) { elements.widget.prepend(elements.closeButton); } }; DialogsManager.Widget.prototype.attachEvents = function() { var self = this; if (self.getSettings('closeButton')) { self.getElements('closeButton').on('click', function(event) { event.preventDefault(); self.hide(); }); } }; DialogsManager.Widget.prototype.getDefaultSettings = function() { return {}; }; DialogsManager.Widget.prototype.getClosureMethods = function() { return []; }; DialogsManager.Widget.prototype.onHide = function() { }; DialogsManager.Widget.prototype.onShow = function() { }; DialogsManager.Widget.prototype.onInit = function() { }; DialogsManager.Widget.prototype.onReady = function() { }; DialogsManager.widgetsTypes.simple = DialogsManager.Widget; DialogsManager.addWidgetType('buttons', { activeKeyUp: function(event) { var TAB_KEY = 9; if (event.which === TAB_KEY) { event.preventDefault(); } if (this.hotKeys[event.which]) { this.hotKeys[event.which](this); } }, activeKeyDown: function(event) { if (!this.focusedButton) { return; } var TAB_KEY = 9; if (event.which === TAB_KEY) { event.preventDefault(); var currentButtonIndex = this.focusedButton.index(), nextButtonIndex; if (event.shiftKey) { nextButtonIndex = currentButtonIndex - 1; if (nextButtonIndex < 0) { nextButtonIndex = this.buttons.length - 1; } } else { nextButtonIndex = currentButtonIndex + 1; if (nextButtonIndex >= this.buttons.length) { nextButtonIndex = 0; } } this.focusedButton = this.buttons[nextButtonIndex].trigger('focus'); } }, addButton: function(options) { var self = this, settings = self.getSettings(), buttonSettings = jQuery.extend(settings.button, options); var classes = options.classes ? options.classes + ' ' : ''; classes += settings.classes.globalPrefix + '-button'; var $button = self.addElement(options.name, $('<' + buttonSettings.tag + '>').html(options.text), classes); self.buttons.push($button); var buttonFn = function() { if (settings.hide.onButtonClick) { self.hide(); } if ('function' === typeof options.callback) { options.callback.call(this, self); } }; $button.on('click', buttonFn); if (options.hotKey) { this.hotKeys[options.hotKey] = buttonFn; } this.getElements('buttonsWrapper').append($button); if (options.focus) { this.focusedButton = $button; } return self; }, bindHotKeys: function() { this.getElements('window').on({ keyup: this.activeKeyUp, keydown: this.activeKeyDown }); }, buildWidget: function() { DialogsManager.Widget.prototype.buildWidget.apply(this, arguments); var $buttonsWrapper = this.addElement('buttonsWrapper'); this.getElements('widget').append($buttonsWrapper); }, getClosureMethods: function() { return [ 'activeKeyUp', 'activeKeyDown' ]; }, getDefaultSettings: function() { return { hide: { onButtonClick: true }, button: { tag: 'button' } }; }, onHide: function() { this.unbindHotKeys(); }, onInit: function() { this.buttons = []; this.hotKeys = {}; this.focusedButton = null; }, onShow: function() { this.bindHotKeys(); if (!this.focusedButton) { this.focusedButton = this.buttons[0]; } if (this.focusedButton) { this.focusedButton.trigger('focus'); } }, unbindHotKeys: function() { this.getElements('window').off({ keyup: this.activeKeyUp, keydown: this.activeKeyDown }); } }); DialogsManager.addWidgetType('lightbox', DialogsManager.getWidgetType('buttons').extend('lightbox', { getDefaultSettings: function() { var settings = DialogsManager.getWidgetType('buttons').prototype.getDefaultSettings.apply(this, arguments); return $.extend(true, settings, { contentWidth: 'auto', contentHeight: 'auto', position: { element: 'widgetContent', of: 'widget', autoRefresh: true } }); }, buildWidget: function() { DialogsManager.getWidgetType('buttons').prototype.buildWidget.apply(this, arguments); var $widgetContent = this.addElement('widgetContent'), elements = this.getElements(); $widgetContent.append(elements.header, elements.message, elements.buttonsWrapper); elements.widget.html($widgetContent); if (elements.closeButton) { $widgetContent.prepend(elements.closeButton); } }, onReady: function() { var elements = this.getElements(), settings = this.getSettings(); if ('auto' !== settings.contentWidth) { elements.message.width(settings.contentWidth); } if ('auto' !== settings.contentHeight) { elements.message.height(settings.contentHeight); } } })); DialogsManager.addWidgetType('confirm', DialogsManager.getWidgetType('lightbox').extend('confirm', { onReady: function() { DialogsManager.getWidgetType('lightbox').prototype.onReady.apply(this, arguments); var strings = this.getSettings('strings'), isDefaultCancel = this.getSettings('defaultOption') === 'cancel'; this.addButton({ name: 'cancel', text: strings.cancel, callback: function(widget) { widget.trigger('cancel'); }, focus: isDefaultCancel }); this.addButton({ name: 'ok', text: strings.confirm, callback: function(widget) { widget.trigger('confirm'); }, focus: !isDefaultCancel }); }, getDefaultSettings: function() { var settings = DialogsManager.getWidgetType('lightbox').prototype.getDefaultSettings.apply(this, arguments); settings.strings = { confirm: 'OK', cancel: 'Cancel' }; settings.defaultOption = 'cancel'; return settings; } })); DialogsManager.addWidgetType('alert', DialogsManager.getWidgetType('lightbox').extend('alert', { onReady: function() { DialogsManager.getWidgetType('lightbox').prototype.onReady.apply(this, arguments); var strings = this.getSettings('strings'); this.addButton({ name: 'ok', text: strings.confirm, callback: function(widget) { widget.trigger('confirm'); } }); }, getDefaultSettings: function() { var settings = DialogsManager.getWidgetType('lightbox').prototype.getDefaultSettings.apply(this, arguments); settings.strings = { confirm: 'OK' }; return settings; } })); // Exporting the DialogsManager variable to global global.DialogsManager = DialogsManager; })( typeof jQuery !== 'undefined' ? jQuery : typeof require === 'function' && require('jquery'), (typeof module !== 'undefined' && typeof module.exports !== 'undefined') ? module.exports : window ); !function(i){"use strict";var n;redux.field_objects=redux.field_objects||{},redux.field_objects.tabbed=redux.field_objects.tabbed||{},redux.field_objects.tabbed.getOptName=function(e){var d=e.parents().find(".redux-ajax-security").data("opt-name");return void 0===(d=void 0===d?e.parents(".redux-container").data("opt-name"):d)?redux:redux.optName},redux.field_objects.tabbed.init=function(e){e=i.redux.getSelector(e,"tabbed"),i(e).each(function(){var a=i(this),e=a;(e=a.hasClass("redux-field-container")?e:a.parents(".redux-field-container:first")).is(":hidden")||e.hasClass("redux-field-init")&&(e.removeClass("redux-field-init"),n=redux.field_objects.tabbed.getOptName(a),a.find(".redux-tabbed").each(function(){var e=a,d=e.find(".redux-tabbed-nav a"),t=e.find(".redux-tabbed-content");i.redux.initFields(),d.on("click",function(e){e.preventDefault();var e=i(this),d=e.index(),d=t.eq(d);e.addClass("redux-tabbed-active").siblings().removeClass("redux-tabbed-active"),d.removeClass("hidden").siblings().addClass("hidden"),i.redux.initFields()})}))})},redux.field_objects.tabbed.check_parents_dependencies=function(a){var r="";return n.required_child.hasOwnProperty(a)?i.each(n.required_child[a],function(e,d){var t;return(t=i("#"+n.args.opt_name+"-"+d.parent)).hasClass("hide")?r=!1:!1!==r?(null!==(t=t.serializeForm())&&"object"==typeof t&&t.hasOwnProperty(n.args.opt_name)&&(t=(void 0===t[n.args.opt_name][d.parent]?Object.values(t[n.args.opt_name])[0]:t[n.args.opt_name])[d.parent]),t=t=i("#"+n.args.opt_name+"-"+a).hasClass("redux-container-media")?t.url:t,r=i.redux.check_dependencies_visibility(t,d),!1):void 0}):r=!0,r}}(jQuery);