Current File : /home/n742ef5/.trash/wp-content.3/plugins/security-malware-firewall/js/spbc-settings.min.js
function spbc_switchTab(e,t){var s=e.classList[1].replace("spbc_tab_nav-",""),c=new URLSearchParams(window.location.search),n=(c.set("spbc_tab",s),window.location.hash),n=window.location.pathname+"?"+c.toString()+n;if(history.replaceState(null,"",n),"backups"!==c.get("spbc_tab")&&jQuery(".spbc_tab_nav-backups").hide(),jQuery(".spbc_tab_nav").removeClass("spbc_tab_nav--active"),jQuery(".spbc_tab").removeClass("spbc_tab--active"),jQuery(e).addClass("spbc_tab_nav--active"),jQuery(".spbc_tab-"+s).addClass("spbc_tab--active"),jQuery(e).data("loaded")){if(t&&t.action)switch(t.action){case"highlight":spbcHighlightElement(t.target,t.times);break;case"click":setTimeout(function(){jQuery("#"+t.additional.target).click()},500)}}else{n={action:"spbc_settings__draw_elements",tab_name:s,security:spbcSettings.ajax_nonce},t={callback:spbc_draw_settings_callback,notJson:!0,additional:t||null};spbc_sendAJAXRequest(n,t,e)}}function spbc_draw_settings_callback(e,t,s,c){jQuery(c).data("loaded",!0),jQuery(".spbc_tab-"+t.tab_name).replaceWith(e);c=jQuery(".spbc_tab-"+t.tab_name);if(c.addClass("spbc_tab--active"),jQuery(document).off("click",".spbc_long_description__show"),jQuery(document).on("click",".spbc_long_description__show",function(){spbc_settings__show_description(self=jQuery(this),self.attr("setting"))}),jQuery(document).off("click",".spbc_long_recommendation__show"),jQuery(document).on("click",".spbc_long_recommendation__show",function(){spbc_settings__show_recommendation(self=jQuery(this),self.attr("setting"))}),s.additional)switch(s.additional.action){case"highlight":spbcHighlightElement(s.additional.target,s.additional.times);break;case"click":setTimeout(function(){jQuery("#"+s.additional.target).click()},500)}jQuery(c).on("click",".spbc_hint-send_"+t.tab_name,function(){jQuery(".spbc_hint-send_"+t.tab_name).hide(),spbc_sendAJAXRequest({action:"spbc_send_"+t.tab_name,tab_name:t.tab_name},{callback:spbc_send_logs_callback})}),window.location.hash&&document.getElementById(window.location.hash.substring(1)).scrollIntoView()}function spbc_send_logs_callback(e,t,s,c){jQuery(".spbc_tab_nav-"+t.tab_name).data("loaded",!1),spbc_switchTab(document.getElementsByClassName("spbc_tab_nav-"+t.tab_name)[0])}function spbcSettingsDependenciesbyId(e,o){"string"==typeof e&&((tmp=[]).push(e),e=tmp),o=void 0===o?null:+o,e.forEach(function(e,t,s){function c(){a.setAttribute("disabled","disabled")}function n(){a.removeAttribute("disabled")}var a=document.getElementById("spbc_setting_"+e);(null!==o?1===o?n:c:null===a.getAttribute("disabled")?c:n)()})}function spbcSettingsDependencies(e,o){e="string"==typeof e?e.split(","):e,o=void 0===o?+event.target.checked:+o,e.forEach(function(e,t,s){document.getElementsByName("spbc_settings["+e+"]").forEach(function(e,t,s){function c(){e.setAttribute("disabled","disabled")}function n(){e.removeAttribute("disabled")}(null!==o?1===o?n:c:null===e.getAttribute("disabled")?c:n)();var a=e.getAttribute("children");null!==a&&spbcSettingsDependencies(a,o&&e.checked)})})}function spbc_settings__show_description(e,t){function n(e){void 0!==e&&(0!=jQuery(e.target).parent(".spbc_long_desc").length&&!jQuery(e.target).hasClass("spbc_long_desc__cancel")||jQuery(e.target).hasClass("spbc_long_description__show"))||(jQuery(".spbc_long_desc").remove(),jQuery(document).off("click",n))}n(),e.after("<div id='spbc_long_desc__"+t+"' class='spbc_long_desc'></div>");var s=jQuery("#spbc_long_desc__"+t);s.append("<i class='spbc-icon-spin1 animate-spin'></i>").append("<div class='spbc_long_desc__angle_top_left'></div>").css({top:e.position().top+25,left:e.position().left+5}),spbc_sendAJAXRequest({action:"spbc_settings__get_description",setting_id:t},{spinner:s.children("img"),callback:function(e,t,s,c){c.empty().append("<div class='spbc_long_desc__angle_top_left'></div>").append("<i class='spbc_long_desc__cancel spbc-icon-cancel'></i>").append("<h3 class='spbc_long_desc__title'>"+e.title+"</h3>").append("<p>"+e.desc+"</p>"),jQuery(document).on("click",n)}},s)}function spbc_settings__show_recommendation(e,t){function n(e){void 0!==e&&(0!=jQuery(e.target).parent(".spbc_long_desc").length&&!jQuery(e.target).hasClass("spbc_long_desc__cancel")||jQuery(e.target).hasClass("spbc_long_recommendation__show"))||(jQuery(".spbc_long_desc").remove(),jQuery(document).off("click",n))}n(),e.after("<div id='spbc_long_desc__"+t+"' class='spbc_long_desc'></div>");var s=jQuery("#spbc_long_desc__"+t);s.append("<i class='spbc-icon-spin1 animate-spin'></i>").append("<div class='spbc_long_desc__angle_top_left'></div>").css({top:e.position().top+25,left:e.position().left+5}),spbc_sendAJAXRequest({action:"spbc_settings__get_recommendation",setting_id:t},{spinner:s.children("img"),callback:function(e,t,s,c){c.empty().append("<div class='spbc_long_desc__angle_top_left'></div>").append("<i class='spbc_long_desc__cancel spbc-icon-cancel'></i>").append("<h3 class='spbc_long_desc__title' style='margin-right: 2em;'>"+e.title+"</h3>").append("<p>"+e.desc+"</p>"),jQuery(document).on("click",n)}},s)}function spbcStartShowHide(){jQuery(".spbcShortText").off("mouseover").on("mouseover",function(){jQuery(this).next().show()}).off("mouseout").on("mouseout",function(){jQuery(this).next().hide()}),jQuery(".spbcFullText").off("mouseout").on("mouseout",function(){jQuery(this).hide()}).off("mouseover").on("mouseover",function(){jQuery(this).show()})}function spbctGenerateConfirmationCode(){var e={},t={success:!1};return e.security=spbcSettings.ajax_nonce,e.action="spbc_generate_confirmation_code",jQuery.ajax({type:"POST",async:!1,url:spbcSettings.ajaxurl,data:e,success:function(e){e.success?t.success=!0:t.text=e.data}}),t}function spbctCheckConfirmationCode(e,t,s){var c=e,e={};e.security=spbcSettings.ajax_nonce,e.action="spbc_check_confirmation_code",e.code=jQuery("#confirmation-code input").val(),jQuery.ajax({type:"POST",async:!1,url:spbcSettings.ajaxurl,data:e,success:function(e){e.success?(jQuery("[name *= 2fa__enable]").attr("checked",""),c.checked=!0,jQuery("#spbc_setting_2fa__roles").removeAttr("disabled"),jQuery("#spbc_setting_2fa__roles > option:first").attr("selected","selected"),clearTimeout(t),s.remove(),jQuery("#confirmation-code").dialog("close")):alert("Code verification failed!")}})}function spbc_banner_check(){var n=setInterval(function(){spbc_sendAJAXRequest({action:"spbc_settings__check_renew_banner"},{callback:function(e,t,s,c){e.close_renew_banner&&(jQuery("#spbc_renew_notice").length&&jQuery("#spbc_renew_notice").hide("slow"),jQuery("#spbc_trial_notice").length&&jQuery("#spbc_trial_notice").hide("slow"),clearInterval(n))}})},6e4)}function spbcToggleClass(t,s){for(let e=0;e<t.length;e++)t[e].classList.toggle(s)}String.prototype.printf=function(){var e,t=this;for(e in arguments)var s=t.substring(0,t.indexOf("%s",0)),c=t.substring(t.indexOf("%s",0)+2,t.length),t=s+arguments[e]+c;return t},jQuery(document).ready(function(){jQuery("#spbc_gdpr_open_modal").on("click",function(){jQuery("#gdpr_dialog").dialog({modal:!0,show:!0,position:{my:"center",at:"center",of:window},width:jQuery("#wpbody").width()/100*70,height:"auto",title:"GDPR compliance",draggable:!1,resizable:!1,closeText:"Close"})}),jQuery(document).on("click","[name*=fa__enable]:not([value=0]),#confirmation-code--resend",function(e){e.preventDefault(),jQuery("#confirmation-code--resend").attr("disabled","disabled").append('<div class="circle circle--small -animation--circle -animation--30s "><div class="circle-inner"></div></div>');var t=setTimeout(function(){jQuery("#confirmation-code--resend").removeAttr("disabled"),jQuery("#confirmation-code--resend>.circle").remove()},3e4),s=spbctGenerateConfirmationCode();s.success?(jQuery("#confirmation-code input").val(""),jQuery("#confirmation-code").dialog({modal:!0,title:"Confirmation code",width:310,buttons:{Cancel:function(){jQuery(this).dialog("close"),clearTimeout(t),jQuery("#confirmation-code--resend>.circle").remove()},Ok:function(){spbctCheckConfirmationCode(e.target,t,jQuery("#confirmation-code--resend>.circle"))}},draggable:!1,resizable:!1})):alert(s.text)}),(jQuery("#spbc_renew_notice").length||jQuery("#spbc_trial_notice").length)&&spbc_banner_check(),jQuery("#spbc_button__sync").on("click",function(){jQuery("#spbc_button__sync_regular").hide(),jQuery("#spbc_button__sync_action").show(),spbc_sendAJAXRequest({action:"spbc_sync"},{timeout:25e3,button:document.getElementById("spbc_button__sync"),spinner:[jQuery("#spbc_button__sync .spbc_preloader_button")],callback:function(e,t,s,c){jQuery("#spbc_button__sync .spbc_success").show(300),setTimeout(function(){jQuery("#spbc_button__sync .spbc_success").hide(300)},2e3),jQuery("#spbc_button__sync_regular").show(),jQuery("#spbc_button__sync_action").hide(),e.reload&&(spbc_switchTab(jQuery(".spbc_tab_nav-scanner")[0]),document.location.reload())}})}),spbcSettings.key_changed&&jQuery("#spbc_button__sync").click(),jQuery(document).on("click","#spbc_setting_get_key_auto",function(){spbc_sendAJAXRequest({action:"spbc_get_key_auto"},{timeout:25e3,button:document.getElementById("spbc_setting_get_key_auto"),spinner:jQuery("#spbc_setting_get_key_auto .spbc_preloader_button"),callback:function(e,t,s,c){jQuery("#spbc_setting_get_key_auto .spbc_success").show(300),setTimeout(function(){jQuery("#spbc_setting_get_key_auto .spbc_success").hide(300)},2e3),e.reload&&document.location.reload(),e.msg&&spbcModal.open().putError(e.msg),e.getTemplates&&(spbcModal.loaded=e.getTemplates,spbcModal.open(),document.addEventListener("spbcModalClosed",function(e){document.location.reload()}))}})}),jQuery(document).on("click","#spbc_settings_templates_import_button",function(){jQuery("#spbc-ajax-result").remove();var n,e=jQuery("option:selected",jQuery("#spbc_settings_templates_import"));jQuery("#spbc_settings_templates_import_name").css("border-color","inherit"),void 0===e.data("id")?console.log('Attribute "data-id" not set for the option.'):(e={template_id:e.data("id"),template_name:e.data("name"),settings:e.data("settings")},n=this,spbc_sendAJAXRequest({action:"spbc_settings_templates_import",data:e},{timeout:25e3,button:n,spinner:jQuery("#spbc_settings_templates_import_button .spbc_preloader_button"),callback:function(e,t,s,c){e.success?(jQuery("<p id='spbc-ajax-result' class='success'>"+e.data+"</p>").insertAfter(jQuery(n)),jQuery("#spbc_settings_templates_import_button .spbc_success").show(300),setTimeout(function(){jQuery("#spbc_settings_templates_import_button .spbc_success").hide(300)},2e3),document.addEventListener("spbcModalClosed",function(e){document.location.reload()}),setTimeout(function(){spbcModal.close()},2e3)):jQuery("<p id='spbc-ajax-result' class='error'>"+e.data+"</p>").insertAfter(jQuery(n))}}))}),jQuery(document).on("click","#spbc_settings_templates_export_button",function(){jQuery("#spbc-ajax-result").remove();var e=jQuery("option:selected",jQuery("#spbc_settings_templates_export")),t=jQuery("#spbc_settings_templates_export_name");if(t.css("border-color","inherit"),void 0===e.data("id"))console.log('Attribute "data-id" not set for the option.');else{if("new_template"===e.data("id")){var s=t.val();if(""===s)return void t.css("border-color","red");s={template_name:s}}else s={template_id:e.data("id")};var n=this;spbc_sendAJAXRequest({action:"spbc_settings_templates_export",data:s},{timeout:25e3,button:n,spinner:jQuery("#spbc_settings_templates_export_button .spbc_preloader_button"),callback:function(e,t,s,c){e.success?(jQuery("<p id='spbc-ajax-result' class='success'>"+e.data+"</p>").insertAfter(jQuery(n)),jQuery("#spbc_settings_templates_export_button .spbc_success").show(300),setTimeout(function(){jQuery("#spbc_settings_templates_export_button .spbc_success").hide(300)},2e3),document.addEventListener("spbcModalClosed",function(e){document.location.reload()}),setTimeout(function(){spbcModal.close()},2e3)):jQuery("<p id='spbc-ajax-result' class='error'>"+e.data+"</p>").insertAfter(jQuery(n))}})}}),jQuery(document).on("click","#spbc_settings_templates_reset_button",function(){var n=this;spbc_sendAJAXRequest({action:"spbc_settings_templates_reset"},{timeout:25e3,button:n,spinner:jQuery("#spbc_settings_templates_reset_button .spbc_preloader_button"),callback:function(e,t,s,c){e.success?(jQuery("<p id='spbc-ajax-result' class='success'>"+e.data+"</p>").insertAfter(jQuery(n)),jQuery("#spbc_settings_templates_reset_button .spbc_success").show(300),setTimeout(function(){jQuery("#spbc_settings_templates_reset_button .spbc_success").hide(300)},2e3),document.addEventListener("spbcModalClosed",function(e){document.location.reload()}),setTimeout(function(){spbcModal.close()},2e3)):jQuery("<p id='spbc-ajax-result' class='error'>"+e.data+"</p>").insertAfter(jQuery(n))}})}),jQuery(document).on("change","#spbc_settings_templates_export",function(){"new_template"===jQuery("option:selected",this).data("id")?jQuery(this).parent().parent().find("#spbc_settings_templates_export_name").show():jQuery(this).parent().parent().find("#spbc_settings_templates_export_name").hide()}),jQuery(".spbc_tab_nav-summary").data("loaded",!0),jQuery(".spbc_tabs_nav_wrapper").on("click",".spbc_tab_nav",function(e){spbc_switchTab(e.currentTarget)});var e={target:location.search.match(/spbc_target=(\S*?)(&|$)/)?location.search.match(/spbc_target=(\S*?)(&|$)/)[1]:null,action:location.search.match(/spbc_action=(\S*?)(&|$)/)?location.search.match(/spbc_action=(\S*?)(&|$)/)[1]:null,times:location.search.match(/spbc_times=(\S*?)(&|$)/)?location.search.match(/spbc_times=(\S*?)(&|$)/)[1]:3},t=(e.target=location.search.match(/spbc_highlight=(\S*?)(&|$)/)?location.search.match(/spbc_highlight=(\S*?)(&|$)/)[1]:e.target,e.action=-1!=location.search.search(/spbc_highlight=(\S*?)(&|$)/)?"highlight":e.action,document.getElementsByClassName("spbc_tab_nav-"+(location.search.match(/spbc_tab=(\S*?)(&|$)/)?location.search.match(/spbc_tab=(\S*?)(&|$)/)[1]:""))[0]||null),s=(t||(+spbcSettings.debug?t=document.getElementsByClassName("spbc_tab_nav-debug")[0]:+spbcSettings.wpms&&!+spbcSettings.is_main_site?t=document.getElementsByClassName("spbc_tab_nav-security_log")[0]:+spbcSettings.key_is_ok&&+spbcSettings.secfw_enabled?t=document.getElementsByClassName("spbc_tab_nav-traffic_control")[0]:+spbcSettings.key_is_ok?t=document.getElementsByClassName("spbc_tab_nav-scanner")[0]:(t=document.getElementsByClassName("spbc_tab_nav-settings_general")[0],e={target:"spbc_key",action:"highlight",times:3})),t&&spbc_switchTab(t,e),!1);jQuery(document).on("keyup",function(e){17==(e.which||e.keyCode)&&(s=!1)}),jQuery(document).on("keydown",function(e){var t;116==(e.which||e.keyCode)&&s?(e.preventDefault(),"scanner"!==(t=jQuery(".spbc_tab_nav--active")[0]).classList[1].replace("spbc_tab_nav-","")&&(jQuery(t).data("loaded",!1),spbc_switchTab(t))):17==(e.which||e.keyCode)&&(s=!0)}),jQuery(document).on("click","#spbc-change-account-email",function(e){e.preventDefault();var e=jQuery(this),t=jQuery("#spbc-account-email"),s=t.text();spbcToggleClass(e,"active"),e.hasClass("active")?(e.text(e.data("save-text")),t.attr("contenteditable","true"),t.focus(),t.on("keydown",function(e){"Enter"===e.code&&e.preventDefault()}),t.on("input",function(e){"insertParagraph"===e.inputType&&e.preventDefault()})):(spbc_sendAJAXRequest({action:"spbc_update_account_email",accountEmail:s},{timeout:5e3,callback:function(e,t,s,c){void 0!==e.success&&"ok"===e.success&&void 0!==e.manuallyLink&&jQuery("#spbc-key-manually-link").attr("href",e.manuallyLink),void 0!==e.error&&jQuery("#spbc-account-email").css("border-color","red")},errorOutput:function(e){spbcModal.loaded=e,spbcModal.open()}}),t.attr("contenteditable","false"),e.text(e.data("default-text")))})});
//# sourceMappingURL=spbc-settings.min.js.map