Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Bower components Debian packages RPM packages NuGet packages

jsarnowski / jsarnowski/blocksy-companion-pro   php

Repository URL to install this package:

Version: 1.8.76 

/ bundle / account.js

!function(){"use strict";var e={n:function(t){var r=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(r,{a:r}),r},d:function(t,r){for(var o in r)e.o(r,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:r[o]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}},t=window.ctEvents,r=e.n(t),o=window.ctFrontend;function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function a(e){return function(e){if(Array.isArray(e))return c(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return c(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?c(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,o=new Array(t);r<t;r++)o[r]=e[r];return o}var i=function(e){a(e.querySelectorAll(".g-recaptcha, .anr_captcha_field")).map((function(e){e.classList.contains("anr_captcha_field")?grecaptcha.reset(parseFloat(e.firstElementChild.id.replace("anr_captcha_field_",""))-1):grecaptcha.reset(e.gID)}))},s=function(e){return new Promise((function(t){(function(e,t){return!(!window.WFLSVars||!parseInt(WFLSVars.useCAPTCHA)||(function(e,t){var r=function(e){var t=jQuery();return a(e.querySelectorAll("input")).map((function(e){t=t.add(e)})),t}(t);if("object"===("undefined"==typeof grecaptcha?"undefined":n(grecaptcha)))grecaptcha.ready((function(){grecaptcha.execute(WFLSVars.recaptchasitekey,{action:"login"}).then((function(t){var o=jQuery("#wfls-captcha-token");o.length?o.val(t):r.length&&((o=jQuery('<input type="hidden" name="wfls-captcha-token" id="wfls-captcha-token" />')).val(t),r.parent().append(o)),"function"==typeof e&&e(!0)}))}));else{var o=jQuery("#wfls-captcha-token");o.length?o.val("grecaptcha-missing"):r.length&&((o=jQuery('<input type="hidden" name="wfls-captcha-token" id="wfls-captcha-token" />')).val("grecaptcha-missing"),r.parent().append(o)),"function"==typeof e&&e(!0)}}((function(){return e()}),t),0))})(t,e)||t()}))},l=window.jQuery,u=e.n(l);function d(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,o=new Array(t);r<t;r++)o[r]=e[r];return o}var f=function(e){var t=e.querySelector('[name*="submit"]');t&&t.classList.add("ct-loading")},m=function(e){var t=e.querySelector('[name*="submit"]');t&&t.classList.remove("ct-loading")},p=function(e,t){var r=t.screen,o=void 0===r?"login":r;e.querySelector(".ct-".concat(o,"-form"))||(o="login"),e.querySelector("ul")&&e.querySelector("ul .ct-".concat(o))&&(e.querySelector("ul .active").classList.remove("active"),e.querySelector("ul .ct-".concat(o)).classList.add("active")),e.querySelector('[class*="-form"].active').classList.remove("active"),e.querySelector(".ct-".concat(o,"-form")).classList.add("active"),e.querySelector(".ct-".concat(o,"-form form"))&&e.querySelector(".ct-".concat(o,"-form form")).reset(),e.querySelector(".ct-account-form").classList.remove("ct-error");var n=e.querySelector(".ct-".concat(o,"-form")).querySelector(".ct-form-notification");n&&n.remove();var c=e.querySelector(".ct-".concat(o,"-form")).querySelector(".ct-form-notification-error");c&&c.remove(),function(e){a(e.querySelectorAll(".g-recaptcha, .anr_captcha_field")).map((function(e){e.gID||(e.innerHTML="",e.gID=grecaptcha.render(e))}))}(e)},h=function(e,t){var r=e.querySelector(".ct-form-notification-error");r&&r.remove(),e.closest(".ct-account-form").classList.remove("ct-error"),t&&(e.insertAdjacentHTML("afterbegin",'<div class="ct-form-notification-error">'.concat(t,"</div>")),requestAnimationFrame((function(){e.closest(".ct-account-form").classList.add("ct-error")})))},y=function(e,t){var r=(new DOMParser).parseFromString(t,"text/html"),o=r.querySelector("#login_error"),n="";return o&&(n=o.innerHTML),h(e,n),{hasError:!!o,doc:r}},g=function(e,t){var r=e.querySelector(".ct-form-notification");r&&r.remove(),e.closest(".ct-account-form").classList.remove("ct-error"),t&&e.insertAdjacentHTML("afterbegin",'<div class="ct-form-notification">'.concat(t,"</div>"))},w=function(e,t){var r=(new DOMParser).parseFromString(t,"text/html"),o=r.querySelector(".message"),n="";return o&&(n=o.innerHTML),g(e,n),{doc:r}},v="";(0,o.registerDynamicChunk)("blocksy_account",{mount:function(e,t){var n=t.event;if(n.preventDefault(),!v){var a=document.querySelector("#account-modal");if(!a)return void(location=document.querySelector('[data-id="account"]')?document.querySelector('[data-id="account"]').href:e.href);v=a.innerHTML,a.remove()}var c=document.querySelector(".ct-drawer-canvas").lastElementChild;c.id="account-modal";var l=ct_localizations.dynamic_styles_selectors.find((function(e){return c.matches(e.selector)})),b=function(){c.innerHTML=v,function(e){if(e&&!e.hasListeners){e.hasListeners=!0;var t=e.querySelector('[name="loginform"]'),o=e.querySelector('[name="registerform"]'),n=e.querySelector('[name="lostpasswordform"]');if(e.addEventListener("click",(function(r){r.target.href&&r.target.href.indexOf("lostpassword")>-1&&(p(e,{screen:"forgot-password"}),r.preventDefault()),r.target.href&&r.target.classList.contains("showlogin")&&(p(e,{screen:"login"}),r.preventDefault()),r.target.href&&(r.target.href.indexOf("wp-login")>-1||t&&r.target.href===t.action||r.target.href.indexOf("login")>-1||"yes"===r.target.dataset.login)&&-1===r.target.href.indexOf("lostpassword")&&(p(e,{screen:"login"}),r.preventDefault())}),!0),(c=e.querySelectorAll(".show-password-input"),function(e){if(Array.isArray(e))return d(e)}(c)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(c)||function(e,t){if(e){if("string"==typeof e)return d(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?d(e,t):void 0}}(c)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()).map((function(e){e.addEventListener("click",(function(t){e.previousElementSibling.type="password"===e.previousElementSibling.type?"text":"password"}))})),t&&t.addEventListener("submit",(function(e){if(e.preventDefault(),!window.ct_customizer_localizations){f(t);var r=new FormData(t),o="".concat(ct_localizations.ajax_url,"?action=blc_implement_user_login");if(window.WFLSVars&&!t.loginProceed)return r.append("action","wordfence_ls_authenticate"),o=WFLSVars.ajaxurl,void s(t).then((function(){fetch(o,{method:t.method,body:r}).then((function(e){return e.json()})).then((function(e){m(t);var r=!!e.error,o=t.closest(".ct-login-form"),n=t.closest(".ct-login-form").querySelector("form");if(r&&h(o,e.error),e.message&&g(n,e.message),e.login)if(e.jwt){if(!jQuery("#wfls-token").length){var a=jQuery('<div id="wfls-prompt-overlay-blocksy"></div>'),c=jQuery('<div id="wfls-prompt-wrapper"></div>'),s=jQuery('<label for="wfls-token">2FA Code <a href="javascript:void(0)" class="wfls-2fa-code-help wfls-tooltip-trigger" title="The 2FA Code can be found within the authenticator app you used when first activating two-factor authentication. You may also use one of your recovery codes."><i class="dashicons dashicons-editor-help"></i></a></label>'),l=jQuery('<input type="text" name="wfls-token" id="wfls-token" aria-describedby="wfls-token-error" class="input" value="" size="6" autocomplete="off"/>'),u=jQuery('<label for="wfls-remember-device"><input name="wfls-remember-device" type="checkbox" id="wfls-remember-device" class="ct-checkbox" value="1" /> Remember for 30 days</label>');c.append(s),c.append(l),parseInt(WFLSVars.allowremember)&&c.append(u),a.append(c),jQuery(n).prepend(a),new jQuery.Zebra_Tooltips(jQuery(".wfls-tooltip-trigger"))}var d=jQuery("#wfls-token-jwt");d.length||(d=jQuery('<input type="hidden" name="wfls-token-jwt" id="wfls-token-jwt" value=""/>'),jQuery("#wfls-prompt-overlay-blocksy").append(d)),jQuery("#wfls-token-jwt").val(e.jwt)}else fetch("".concat(ct_localizations.ajax_url,"?action=blc_implement_user_login"),{method:t.method,body:new FormData(t)}).then((function(e){return e.text()})).then((function(e){location=t.querySelector('[name="redirect_to"]').value}));e.combined&&(t.loginProceed=!0,fetch("".concat(ct_localizations.ajax_url,"?action=blc_implement_user_login"),{method:t.method,body:new FormData(t)}).then((function(e){return e.text()})).then((function(e){location=t.querySelector('[name="redirect_to"]').value}))),(!r||r&&-1===t.closest(".ct-login-form").querySelector(".ct-form-notification-error").innerHTML.indexOf("Captcha"))&&i(t.closest(".ct-login-form"))}))}));s(t).then((function(){fetch(o,{method:t.method,body:r}).then((function(e){return e.text()})).then((function(e){m(t);var r=y(t.closest(".ct-login-form"),e),o=(r.doc,r.hasError);o||setTimeout((function(){location=t.querySelector('[name="redirect_to"]').value}),2e3),(!o||o&&-1===t.closest(".ct-login-form").querySelector(".ct-form-notification-error").innerHTML.indexOf("Captcha"))&&i(t.closest(".ct-login-form"))}))}))}})),o){o.addEventListener("submit",(function(e){e.preventDefault(),window.ct_customizer_localizations||(f(o),s(o).then((function(){return fetch("".concat(ct_localizations.ajax_url,"?action=blc_implement_user_registration"),{method:o.method,body:new FormData(o)}).then((function(e){return e.text()})).then((function(e){var t=y(o.closest(".ct-register-form"),e),n=(t.doc,t.hasError);m(o),n||w(o.closest(".ct-register-form"),e),r().trigger("blocksy:account:register:".concat(n?"error":"success")),n||o.querySelector('[name="redirect_to"]')&&o.querySelector('[name="role"][value="seller"]:checked')&&(location=o.querySelector('[name="redirect_to"]').value),(!n||n&&-1===o.closest(".ct-register-form").querySelector(".ct-form-notification-error").innerHTML.indexOf("Captcha"))&&i(o.closest(".ct-register-form"))}))})))}));var a=o.querySelector("#user_pass_register");a&&function(e){var t=function(){var t=e.closest("form");!function(e,t){var r=u()(e).find(".woocommerce-password-strength");""===u()(t).val()?(r.hide(),u()(document.body).trigger("wc-password-strength-hide")):0===r.length?(u()(t.nextElementSibling).after('<div class="woocommerce-password-strength" aria-live="polite"></div>'),u()(document.body).trigger("wc-password-strength-added")):(r.show(),u()(document.body).trigger("wc-password-strength-show"))}(t,e);var r=function(e,t){var r=u()(e).find(".woocommerce-password-strength"),o=u()(e).find(".woocommerce-password-hint"),n='<small class="woocommerce-password-hint">'+wc_password_strength_meter_params.i18n_password_hint+"</small>",a=wp.passwordStrength.meter(u()(t).val(),wp.passwordStrength.userInputDisallowedList()),c="";if(r.removeClass("short bad good strong"),o.remove(),r.is(":hidden"))return a;switch(a<wc_password_strength_meter_params.min_password_strength&&(c=" - "+wc_password_strength_meter_params.i18n_password_error),a){case 0:r.addClass("short").html(pwsL10n.short+c),r.after(n);break;case 1:case 2:r.addClass("bad").html(pwsL10n.bad+c),r.after(n);break;case 3:r.addClass("good").html(pwsL10n.good+c);break;case 4:r.addClass("strong").html(pwsL10n.strong+c);break;case 5:r.addClass("short").html(pwsL10n.mismatch)}return a}(t,e),o=u()(t).find('button[name="wp-submit"]');e.value.length>0&&r<wc_password_strength_meter_params.min_password_strength&&-1!==r?o.attr("disabled","disabled").addClass("disabled"):o.prop("disabled",!1).removeClass("disabled")};e.addEventListener("keyup",t),e.addEventListener("change",t)}(a)}n&&n.addEventListener("submit",(function(e){e.preventDefault(),window.ct_customizer_localizations||(f(n),fetch("".concat(ct_localizations.ajax_url,"?action=blc_implement_user_lostpassword"),{method:n.method,body:new FormData(n)}).then((function(e){return e.text()})).then((function(e){var t=y(n.closest(".ct-forgot-password-form"),e),r=(t.doc,t.hasError);m(n),r||w(n.closest(".ct-forgot-password-form"),e),(!r||r&&-1===n.closest(".ct-forgot-password-form").querySelector(".ct-form-notification-error").innerHTML.indexOf("Captcha"))&&i(n.closest(".ct-forgot-password-form"))})))})),["login","register","forgot-password"].map((function(t){Array.from(e.querySelectorAll(".ct-".concat(t))).map((function(r){r.addEventListener("click",(function(r){r.preventDefault(),p(e,{screen:t})})),r.addEventListener("keyup",(function(r){13===r.keyCode&&(r.preventDefault(),p(e,{screen:t}))}))}))}))}var c}(c),p(c,{screen:e.dataset.view||"login"}),window.anr_onloadCallback&&window.anr_onloadCallback(),window.Dokan_Vendor_Registration&&window.Dokan_Vendor_Registration.init(),r().trigger("ct:overlay:handle-click",{e:n,href:"#account-modal",options:{openStrategy:"skip",isModal:!0}})};l?(0,o.loadStyle)(l.url).then((function(){b()})):b()}}),r().on("ct:modal:closed",(function(e){e.closest("#account-modal")&&e.remove()}))}();