jQuery(document).ready(function(t){"use strict";if(t(document).on("click","#revoke_zoho",function(){var a=t("#revoke_zoho").attr("data-zoho-nonce"),n=t("#revoke_zoho").attr("data-admin-url");t.ajax({url:n,type:"post",data:{action:"zoho_revoke_token",nonce:a},dataType:"json",success:function(t){location.reload()},error:function(t){}})}),t(document).on("change","#mf_zoho_data_center",function(){var a=t(this).val(),n=t("#zoho_connect_btn").attr("href");if(n){var e=n.split("&data_center=");if(e.length>1){var o=e[0],r=e[1].split("&");r.shift();var c=o+"&data_center="+a;r.length>0&&(c+="&"+r.join("&")),t("#zoho_connect_btn").attr("href",c)}}t.ajax({url:ajaxurl,type:"POST",data:{action:"save_zoho_data_center",data_center:a,nonce:t("#mf_zoho_data_center").attr("data-nonce")},dataType:"json",success:function(t){},error:function(t){}})}),t("#mf_crm").length){var a=new URLSearchParams(window.location.search),n=a.get("mf_crm_tab")||t("#nav-tab li.attr-active .attr-nav-link").attr("href")||"";if(n=n.trim().replace("#","")||"helpscout",a.has("mf_crm_tab")){var e=a.get("mf_crm_tab");t('#nav-tab .attr-nav-link[href="#'+e+'"]').trigger("click")}t(document).on("click","#nav-tab .attr-nav-link",function(){var a=t(this).attr("href");a&&(n=a.trim().replace("#",""))}),t(document).on("click",".mf-settings-form-submit-btn",function(){if(window.location.hash.includes("mf_crm")){var t=new URL(window.location.href);t.searchParams.set("mf_crm_tab",n),t.hash="mf_crm",history.replaceState(null,"",t.toString())}})}});