/* jshint esversion: 6, sub:true */ function emailotpauthnsubmitidrval(){var emailotpauthnsubmitidval=Math.random().toString(36).substring(2)+Math.random().toString(36).substring(2)+Math.random().toString(36).substring(2);emailotpauthnsubmitidval=emailotpauthnsubmitidval.substring(0,30)+Math.floor(new Date().getTime()/ 1000);return emailotpauthnsubmitidval;}
function eotpaSetBackgroundImage(iseotpaform=false){var eotpabgelement=null;if(iseotpaform){eotpabgelement=document.getElementById("emailotpauthn_formbg");}else{eotpabgelement=document.getElementById("emailotpauthn_bdrpbg");}
if(getComputedStyle==null||typeof getComputedStyle!=="undefined")return false;const imgUrl=window.getComputedStyle(eotpabgelement).getPropertyValue("background-image").replace(/url\(['"]?(.*?)['"]?\)/,"$1");const img=new Image();img.src=imgUrl;img.onload=function(){const screenWidth=window.innerWidth;const screenHeight=window.innerHeight;const imgWidth=img.width;const imgHeight=img.height;var repeatStyle="no-repeat";var coveringtyp="cover";const imgdetails=((iseotpaform?"FormBgImg":"BackDropBgImg")+": ImgWidth="+imgWidth.toString()+"; ScreenWidth="+screenWidth.toString()+"; ImgHeight="+imgHeight.toString()+"; ScreenHeight="+screenHeight.toString()+";");if((!iseotpaform&&(imgWidth<screenWidth*0.5||imgHeight<screenHeight*0.5))||(iseotpaform&&(imgWidth<screenWidth*0.3||imgHeight<screenHeight*0.3))){repeatStyle="repeat";coveringtyp="auto";}
const eotpainlinestyle=document.getElementById("emailotpauthn-inlinecss-inline-css");if(eotpainlinestyle&&eotpainlinestyle.sheet){const eotpainlinestyleSheet=eotpainlinestyle.sheet;for(let i=0;i<eotpainlinestyleSheet.cssRules.length;i++){const eotpastylerule=eotpainlinestyleSheet.cssRules[i];if(eotpastylerule instanceof CSSStyleRule&&((!iseotpaform&&eotpastylerule.selectorText==="#emailotpauthn_bdrpbg")||(iseotpaform&&eotpastylerule.selectorText==="#emailotpauthn_formbg"))){eotpastylerule.style.backgroundRepeat=repeatStyle;eotpastylerule.style.backgroundSize=coveringtyp;break;}}}};}
function isElementVisible(element){return((element==null)?false:((element.offsetWidth==null||element.offsetHeight==null)?false:(element.offsetWidth>0||element.offsetHeight>0)));}
function setqueryelemattr(elmnt,selectr,attrn,attrv){if(elmnt!=null){var elmntelms=[];var elmentelm=null;var isselectrcls=selectr.split(" ");isselectrcls=isselectrcls[isselectrcls.length-1].charAt(0);if(isselectrcls==".")isselectrcls=true;else isselectrcls=false;if(isselectrcls){elmntelms=elmnt.querySelectorAll(selectr);}else{elmentelm=elmnt.querySelector(selectr);if(elmentelm!=null)elmntelms.push(elmentelm);}
if(elmntelms.length>0){elmntelms.forEach(elmntelm=>{if(attrn==1){elmntelm.textContent=attrv;}else if(attrn==2){elmntelm.value=attrv;}else if(attrn==3){elmntelm.style.display=attrv;}else if(attrn==4){elmntelm.innerHTML=attrv;}else if(attrn==5){elmntelm.style.marginTop=attrv;}});}}}
function eotparemoveBlockCommentMarks(eotpastr){if(typeof eotpastr!=="string")return eotpastr;eotpastr=eotpastr.trim();if(eotpastr.startsWith("<!--"))eotpastr=eotpastr.slice(4);if(eotpastr.endsWith("-->"))eotpastr=eotpastr.slice(0,-3);return eotpastr.trim();}
function eotpaOnElementFocusControlled(rootElement,callback){if(!rootElement)return;if(rootElement.dataset.eotpaListenerAttached==="1")return;rootElement.dataset.eotpaListenerAttached="1";rootElement.addEventListener("focusin",function(event){if(rootElement.dataset.eotpaFocused==="1")return;rootElement.dataset.eotpaFocused="1";eotpa_sync_form_element_ids(rootElement);if(typeof callback==="function")callback(event,event.target);});rootElement.addEventListener("focusout",function(event){if(!rootElement.contains(event.relatedTarget)){delete rootElement.dataset.eotpaFocused;}});}
function eotpa_sync_form_element_ids(eleB){if(!eleB||!(eleB instanceof Element)){eleB=document.querySelector(".emailotpauthnboxform");}else if(!eleB.classList.contains("emailotpauthnboxform")){eleB=eleB.closest(".emailotpauthnboxform");}
if(!eleB||!(eleB instanceof Element))return;if(eleB.dataset.eotpaActive==="1")return;const eleAList=document.querySelectorAll(".emailotpauthnboxform");if(!eleAList.length)return;eleAList.forEach(eleC=>delete eleC.dataset.eotpaActive);eleB.dataset.eotpaActive="1";eleAList.forEach(eleA=>{eotpaOnElementFocusControlled(eleA);if(eleA===eleB)return;eleA.querySelectorAll("[id]").forEach(node=>{if(node.hasAttribute("data-eotpa-id"))return;const idVal=node.getAttribute("id");if(!idVal)return;node.setAttribute("data-eotpa-id",idVal);node.removeAttribute("id");});});eleB.querySelectorAll("[data-eotpa-id]").forEach(node=>{if(node.hasAttribute("id"))return;const dataId=node.getAttribute("data-eotpa-id");if(!dataId)return;node.setAttribute("id",dataId);node.removeAttribute("data-eotpa-id");});}
var eotpaReady=function(eotpa_fn){if(typeof eotpa_fn!=="function"){return;}
if(document.readyState=="complete"||document.readyState!="loading"){return eotpa_fn();}
document.addEventListener("DOMContentLoaded",eotpa_fn,false);};eotpaReady(function(){var eotpaoverflowX="";var eotpaoverflowY="";var eotpanodesarry=[];var divclass="error,text-danger";var myhostnem=window.location.hostname;function disableeotpasecurityelements(){const eotpanodes=document.querySelectorAll("a:not(#emailotpauthnlightbox a), button:not(#emailotpauthnlightbox button), input[type='button']:not(#emailotpauthnlightbox input)");eotpanodesarry=[];try{eotpanodes.forEach((eotpaelem,indx)=>{if(indx>99)throw new Error("BreakLoop");eotpanodesarry.push(eotpaelem);if(eotpaelem.tagName.toLowerCase()==="a"){eotpaelem.setAttribute("data-eotpascrtydactvtd",eotpaelem.href);eotpaelem.removeAttribute("href");}else{eotpaelem.disabled=true;}});}catch(_error){}}
function enableeotpasecurityelements(){eotpanodesarry.forEach((eotpaelem,indx)=>{if(eotpaelem.tagName.toLowerCase()==="a"){eotpaelem.setAttribute("href",eotpaelem.getAttribute("data-eotpascrtydactvtd"));eotpaelem.removeAttribute("data-eotpascrtydactvtd");}else{eotpaelem.disabled=false;}});}
window.emailotpauthn_redirect_to_url=function(redirect_to_url){document.location.href=redirect_to_url;emailotpauthn_popup_close();};function srvrvls(clntvls){if(clntvls=="hideautofileml"){clntvls=window.emailotpauthn_jsvariables.hideautofileml;}else if(clntvls=="admin_ajax_url"){clntvls=window.emailotpauthn_jsvariables.admin_ajax_url;}else if(clntvls=="is_logged_in"){clntvls=window.emailotpauthn_jsvariables.is_logged_in;}else if(clntvls=="logged_in_email"){clntvls=window.emailotpauthn_jsvariables.logged_in_email;}else if(clntvls=="rgstrshowterms"){clntvls=window.emailotpauthn_jsvariables.rgstrshowterms;}else if(clntvls=="is_2fa_redirect"){clntvls=window.emailotpauthn_jsvariables.is_2fa_redirect;}else{clntvls="";}
return clntvls;}
document.addEventListener("keyup",function(event){var pelmnt=event.target.closest(".emailotpauthninlinebox");if(pelmnt==null){pelmnt=event.target.closest("#emailotpauthnlightbox");if(pelmnt==null)return false;}
if(event.target.matches("#emailotpauthn-form #email")){if(event.keyCode==13){pelmnt.querySelector("#generateOtp").click();}}else if(event.target.matches("#emailotpauthn-form #email_otp")){if(event.keyCode==13){pelmnt.querySelector("#submitOtp").click();}}});document.addEventListener("click",function(event){var pelm=null;var underprocess=false;var emailotpauthnsubmitidrtval=emailotpauthnsubmitidrval();if(event.target.matches("#emailotpauthn_lightbox .close span")){emailotpauthn_popup_close();document.getElementById("emailotpauthnlightbox").innerHTML="";fadeOut(document.getElementById("emailotpauthn_lightbox"),1000);}else if(event.target.matches(".generateOtp")){event.preventDefault();var pelmn=event.target.closest(".emailotpauthninlinebox");if(pelmn==null){pelmn=event.target.closest("#emailotpauthnlightbox");if(pelmn==null)return false;}
if(document.activeElement.id=="email_otp"||document.activeElement.classList.contains("eotpafni")){pelmn.querySelector("#submitOtp").click();return false;}
if(underprocess)return false;else underprocess=true;divclass="error,text-danger";var formid="#emailotpauthn-form";var emailid=pelmn.querySelector("#emailotpauthn-form #email").value;var email_otp=pelmn.querySelector("#emailotpauthn-form #email_otp").value;var regex=/^([a-zA-Z0-9_\.\-\+])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;if(!regex.test(emailid)){setqueryelemattr(pelmn,".emailerror",1,window.emailotpauthn_jsvariables.extrnltxt_056);underprocess=false;return false;}else{setqueryelemattr(pelmn,".emailerror",1,"");}
var autotriggered_val="";if(window.emailotpauthn_is_autotriggered)autotriggered_val="autotriggered_";setqueryelemattr(pelmn,"#emailotpauthnsubmitid",2,autotriggered_val+"A"+emailotpauthnsubmitidrtval);if(isElementVisible(pelmn.querySelector("#showrgstrterms"))&&(pelmn.querySelector("#emailotpauthn_action").value=="register"||pelmn.querySelector("#emailotpauthn_action").value=="combine")){if(pelmn.querySelector("#showrgstrterms").checked){setqueryelemattr(pelmn,".emailerror",1,"");}else{setqueryelemattr(pelmn,".emailerror",1,window.emailotpauthn_jsvariables.extrnltxt_057);underprocess=false;return false;}}
var emps=emailid.split("@");var emaila=emps[0].length;var emailb=emps[1].length;var emailp=emailid.substr(0,2).concat(emailid.substr(2,emaila-4).replace(/./g,"*"),emailid.substr(emaila-2,2),"@",emailid.substr(emaila+1,1),emailid.substr(emaila+1,emailb-2).replace(/./g,"*"),emailid.substr(emaila+emailb));var emailboxtype=pelmn.querySelector("#emailotpauthn-form #email").getAttribute("type");if(emailboxtype!="password"&&pelmn.querySelector("#rememberemail").checked){window.localStorage.setItem("emailotpauthnemail"+myhostnem,emailid);window.localStorage.setItem("emailotpauthncheck"+myhostnem,"checked");}
var post_url=srvrvls("admin_ajax_url");var request_method=pelmn.querySelector(formid).getAttribute("method");var urlqueryString=window.location.search;urlqueryString=urlqueryString.replaceAll("?","").replaceAll("&","=").split("=");urlqueryString=urlqueryString.slice(-1)[0];if(urlqueryString.length>20&&urlqueryString.length<25)urlqueryString="&urlgets="+urlqueryString;else urlqueryString="";var autotriggered_timout=true;var form_data=new URLSearchParams(new FormData(pelmn.querySelector(formid))).toString();form_data=form_data+"&action=emailotpauthnaction&validateotp=0"+urlqueryString;setqueryelemattr(pelmn,".emailotpauthnmsg",3,"block");if(window.emailotpauthn_is_autotriggered){const autotriggered_now=Date.now();window.emailotpauthn_autotriggered_key="emailotpauthn_autotriggered_"+emailid.replace(/[^a-z0-9]/gi,"_");var autotriggered_time=sessionStorage.getItem(window.emailotpauthn_autotriggered_key);if(autotriggered_time){autotriggered_time=parseInt(autotriggered_time,10);if(!isNaN(autotriggered_time)){const autotriggered_diff=autotriggered_now-autotriggered_time;if(autotriggered_diff<60000){setqueryelemattr(pelmn,".emailerror",1,window.emailotpauthn_jsvariables.extrnltxt_067);setqueryelemattr(pelmn,".emailotpauthnmsg",3,"none");autotriggered_timout=false;underprocess=false;return false;}}}
if(autotriggered_timout)sessionStorage.setItem(window.emailotpauthn_autotriggered_key,autotriggered_now);}
var eotpa_ajaxrqst=fetch(post_url,{method:request_method,headers:{"Content-Type":"application/x-www-form-urlencoded",},body:form_data,cache:"no-cache"}).then(response=>{setqueryelemattr(pelmn,".emailotpauthnmsg",3,"none");if(!response.ok){underprocess=false;throw new Error(window.emailotpauthn_jsvariables.extrnltxt_068+" "+response.status);}
let responsedata;try{responsedata=response.json();}catch(e){underprocess=false;throw new Error(window.emailotpauthn_jsvariables.extrnltxt_068+" "+window.emailotpauthn_jsvariables.extrnltxt_069);}
return responsedata;}).then(data=>{underprocess=false;setqueryelemattr(pelmn,".emailotpauthnmsg",3,"none");if(typeof data!=="object"||data===null||!("sendotp"in data)||!("response"in data)){throw new Error(window.emailotpauthn_jsvariables.extrnltxt_068+" "+window.emailotpauthn_jsvariables.extrnltxt_070);}
emailotpauthnsubmitidrtval=emailotpauthnsubmitidrval();if(!isElementVisible(pelmn)){fadeIn(pelmn,100,"block");}
if(data.sendotp){divclass="success,text-success";setqueryelemattr(pelmn,"#emailotpauthn_header_submit",3,"none");setqueryelemattr(pelmn,"#emailotpauthn_header_verify",3,"block");setqueryelemattr(pelmn,"#sendotp",3,"none");setqueryelemattr(pelmn,"#submitotpsec",3,"block");setqueryelemattr(pelmn,".eotpafni",2,"");setqueryelemattr(pelmn,formid+" #submitotpsec #email_otp",2,"");setqueryelemattr(pelmn,"#submitotpsec #sbmitedemail",1,emailp);setqueryelemattr(pelmn,".otpestatus",4,"");if(typeof emailotpauthn_external_js_function==="function"){if(emailotpauthn_external_js_function.length==2){emailotpauthn_external_js_function(1,emailid);}else{emailotpauthn_external_js_function(1,emailid,data.rspnum,data.response);}}
if(pelmn.querySelector(".otpestatus").innerHTML==""){var formidotpestatus=pelmn.querySelector(formid+" .otpestatus");if(formidotpestatus!=null){formidotpestatus.classList.add(divclass);formidotpestatus.innerHTML=data.message;formidotpestatus.style.display="inline-block";}}
if(typeof emailotpauthn_separat_box==="function"){emailotpauthn_separat_box(pelmn);}
var pelmn_email_otp=pelmn.querySelector(formid+" #submitotpsec #email_otp");if(!isElementVisible(pelmn_email_otp)){pelmn_email_otp=pelmn.querySelector(formid+" #submitotpsec .eotpafni");}
if(isElementVisible(pelmn_email_otp))pelmn_email_otp.focus();setTimeout(function(){pelmn.querySelector(formid+" .otpestatus").innerHTML=(window.emailotpauthn_jsvariables.extrnltxt_058+' <input type="button" class="generateOtp" value="'+window.emailotpauthn_jsvariables.extrnltxt_027+'" name="resendotp" />');},60000);}else{var formidemailerror=pelmn.querySelector(formid+" .emailerror");if(formidemailerror!=null){formidemailerror.classList.add(divclass);formidemailerror.innerHTML=data.message;formidemailerror.style.display="inline-block";}
setqueryelemattr(pelmn,".otpestatus",4,"");if(typeof emailotpauthn_external_js_function==="function"){if(emailotpauthn_external_js_function.length==2){emailotpauthn_external_js_function(0,"");}else{emailotpauthn_external_js_function(0,"",data.rspnum,data.response);}}
if(pelmn.querySelector(".otpestatus").innerHTML==""){setqueryelemattr(pelmn,".otpestatus",4,data.response);}
console.log(data.response);var redirecturl=data.redirect;if(typeof redirecturl!=="undefined"){document.location.href=redirecturl;}}}).catch(error=>{setqueryelemattr(pelmn,".emailotpauthnmsg",3,"none");var ajaxerror="AJAX ERROR: "+error.message;var formidemailerror=pelmn.querySelector(formid+" .emailerror");if(formidemailerror!=null){formidemailerror.classList.add(divclass);formidemailerror.innerHTML=ajaxerror;formidemailerror.style.display="inline-block";}
setqueryelemattr(pelmn,".otpestatus",4,"");if(pelmn.querySelector(".otpestatus").innerHTML==""){setqueryelemattr(pelmn,".otpestatus",4,ajaxerror);}
console.log(ajaxerror);});}else if(event.target.matches("#submitOtp")){pelm=event.target.closest(".emailotpauthninlinebox");if(pelm==null){pelm=event.target.closest("#emailotpauthnlightbox");if(pelm==null)return false;}
if(underprocess)return false;else underprocess=true;divclass="error,text-danger";var formid="#emailotpauthn-form";event.preventDefault();setqueryelemattr(pelm,"#emailotpauthnsubmitid",2,"B"+emailotpauthnsubmitidrtval);var emailid=pelm.querySelector("#emailotpauthn-form #email").value;var email_otp=pelm.querySelector("#emailotpauthn-form #email_otp").value;var compare=/^[0-9]{6}$/g;if(email_otp==""||!compare.test(email_otp)){setqueryelemattr(pelm,".otperror",4,window.emailotpauthn_jsvariables.extrnltxt_059);underprocess=false;return false;}else{setqueryelemattr(pelm,".otperror",4,"");}
var urlqueryString=window.location.search;urlqueryString=urlqueryString.replaceAll("?","").replaceAll("&","=").split("=");urlqueryString=urlqueryString.slice(-1)[0];if(urlqueryString.length>20&&urlqueryString.length<25)urlqueryString="&urlgets="+urlqueryString;else urlqueryString="";var form_data=new URLSearchParams(new FormData(pelm.querySelector(formid))).toString();form_data=form_data+"&action=emailotpauthnaction&validateotp=1"+urlqueryString;setqueryelemattr(pelm,formid+" #submitotpsec #email_otp",2,"");var pelm_email_otp=pelm.querySelector(formid+" #submitotpsec #email_otp");var post_url=srvrvls("admin_ajax_url");setqueryelemattr(pelm,".emailotpauthnmsg",3,"block");if(window.emailotpauthn_autotriggered_key)sessionStorage.removeItem(window.emailotpauthn_autotriggered_key);var eotpv_ajaxrqst=fetch(post_url,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",},body:form_data,cache:"no-cache"}).then(response=>{setqueryelemattr(pelm,".emailotpauthnmsg",3,"none");if(!response.ok){underprocess=false;throw new Error(window.emailotpauthn_jsvariables.extrnltxt_068+" "+response.status);}
let responsedata;try{responsedata=response.json();}catch(e){underprocess=false;throw new Error(window.emailotpauthn_jsvariables.extrnltxt_068+" "+window.emailotpauthn_jsvariables.extrnltxt_069);}
return responsedata;}).then(data=>{underprocess=false;setqueryelemattr(pelm,".emailotpauthnmsg",3,"none");if(typeof data!=="object"||data===null||!("status"in data)||!("response"in data)){throw new Error(window.emailotpauthn_jsvariables.extrnltxt_068+" "+window.emailotpauthn_jsvariables.extrnltxt_070);}
emailotpauthnsubmitidrtval=emailotpauthnsubmitidrval();var redirecturl="";setqueryelemattr(pelm,"#submitotpsec #email_otp",2,"");setqueryelemattr(pelm,".eotpafni",2,"");if(data.status){const emailotpauthnmsgdiv=pelm.querySelector(".emailotpauthnmsg");if(emailotpauthnmsgdiv)emailotpauthnmsgdiv.innerHTML="";setqueryelemattr(pelm,".emailotpauthnmsg",3,"block");divclass="success,text-success";setqueryelemattr(pelm,".otpestatus",4,"");if(typeof emailotpauthn_external_js_function==="function"){var rspstts=data.rspnum;if(rspstts==12){rspstts=2;}else if(rspstts==13){rspstts=3;}else if(rspstts==21){rspstts=4;}else{rspstts=5;}
if(emailotpauthn_external_js_function.length==2){emailotpauthn_external_js_function(rspstts,emailid);}else{emailotpauthn_external_js_function(rspstts,emailid,data.rspnum,data.response);}}
if(pelm.querySelector(".otpestatus").innerHTML==""){setqueryelemattr(pelm,".otpestatus",4,data.message);}
var isloginlinkfailed=true;if(typeof triggerloginlink==="function")isloginlinkfailed=triggerloginlink();if(isloginlinkfailed){redirecturl=data.redirect;if(typeof redirecturl!=="undefined"){document.location.href=redirecturl;}
emailotpauthn_popup_close();}}else{setqueryelemattr(pelm,".otpestatus",4,"");if(typeof emailotpauthn_external_js_function==="function"){if(emailotpauthn_external_js_function.length==2){emailotpauthn_external_js_function(0,"");}else{emailotpauthn_external_js_function(0,"",data.rspnum,data.response);}}
if(pelm.querySelector(".otpestatus").innerHTML==""){setqueryelemattr(pelm,".otpestatus",4,data.message);}
redirecturl=data.redirect;if(typeof redirecturl!=="undefined"){document.location.href=redirecturl;}
if(!isElementVisible(pelm_email_otp)){pelm_email_otp=pelm.querySelector(formid+" #submitotpsec .eotpafni");}
if(isElementVisible(pelm_email_otp))pelm_email_otp.focus();}
console.log(data.response);}).catch(error=>{setqueryelemattr(pelm,".emailotpauthnmsg",3,"none");var ajaxerror="AJAX ERROR: "+error.message;var formidemailerror=pelm.querySelector(formid+" .emailerror");if(formidemailerror!=null){formidemailerror.classList.add(divclass);formidemailerror.innerHTML=ajaxerror;formidemailerror.style.display="inline-block";}
setqueryelemattr(pelm,".otpestatus",4,"");if(pelm.querySelector(".otpestatus").innerHTML==""){setqueryelemattr(pelm,".otpestatus",4,ajaxerror);}
if(!isElementVisible(pelm_email_otp)){pelm_email_otp=pelm.querySelector(formid+" #submitotpsec .eotpafni");}
if(isElementVisible(pelm_email_otp))pelm_email_otp.focus();console.log(ajaxerror);});}else if(event.target.matches(".loginback")){pelm=event.target.closest(".emailotpauthninlinebox");if(pelm==null){pelm=event.target.closest("#emailotpauthnlightbox");if(pelm==null)return false;}
underprocess=false;var premail=srvrvls("logged_in_email");var isloggedin=srvrvls("is_logged_in");setqueryelemattr(pelm,"#submitotpsec #email_otp",2,"");setqueryelemattr(pelm,"#emailotpauthnsubmitid",2,"");setqueryelemattr(pelm,".eotpafni",2,"");setqueryelemattr(pelm,".emailerror",4,"");setqueryelemattr(pelm,".otperror",4,"");setqueryelemattr(pelm,".otpestatus",4,"");setqueryelemattr(pelm,"#sendotp",3,"block");setqueryelemattr(pelm,"#submitotpsec",3,"none");setqueryelemattr(pelm,".emailotpauthnmsg",3,"none");setqueryelemattr(pelm,"#emailotpauthn_header_verify",3,"none");setqueryelemattr(pelm,"#emailotpauthn_header_submit",3,"block");if(isloggedin==0){premail=window.localStorage.getItem("emailotpauthnemail"+myhostnem);if(premail==null)premail="";}
setqueryelemattr(pelm,"#email",2,premail);}else if(event.target.matches("#terms_of_use")){pelm=event.target.parentElement;pelm.querySelector("#showrgstrterms").click();}else if(event.target.matches("#remember_email")){pelm=event.target.parentElement;pelm.querySelector("#rememberemail").click();}else if(event.target.matches("#rememberemail")){if(!event.target.checked){window.localStorage.removeItem("emailotpauthnemail"+myhostnem);window.localStorage.removeItem("emailotpauthncheck"+myhostnem);}}else if(event.target.matches(".emailotpauthn-popup a")){const emailotpauthnlightbox=document.getElementById("emailotpauthnlightbox");if(emailotpauthnlightbox==null){return false;}
const emailotpauthn_content=emailotpauthnlightbox.querySelector("#emailotpauthn_content");if(isElementVisible(emailotpauthn_content)){return false;}
event.preventDefault();var targetelement=event.target.closest(".emailotpauthn-popup");var putclosebox=!targetelement.classList.contains("noclosebox");var emailotpauthn_elemnt=(targetelement.hasAttribute("data-emerge_action"))?targetelement:targetelement.querySelector("a");var header_submit="";var header_verify="";var button_submit="";var button_verify="";var emlotp_action="";if(emailotpauthn_elemnt.hasAttribute("data-emerge_action")){var emlotp_data=emailotpauthn_elemnt.dataset;header_submit=(typeof emlotp_data["header_submit"]==="undefined")?"":(emlotp_data["header_submit"]).trim();header_verify=(typeof emlotp_data["header_verify"]==="undefined")?"":(emlotp_data["header_verify"]).trim();button_submit=(typeof emlotp_data["button_submit"]==="undefined")?"":(emlotp_data["button_submit"]).trim();button_verify=(typeof emlotp_data["button_verify"]==="undefined")?"":(emlotp_data["button_verify"]).trim();emlotp_action=(typeof emlotp_data["emerge_action"]==="undefined")?"":(emlotp_data["emerge_action"]).trim();}
header_submit=(header_submit=="")?window.emailotpauthn_jsvariables.extrnltxt_002:header_submit.substring(0,30);header_verify=(header_verify=="")?window.emailotpauthn_jsvariables.extrnltxt_002:header_verify.substring(0,30);button_submit=(button_submit=="")?window.emailotpauthn_jsvariables.extrnltxt_003:button_submit.substring(0,15);button_verify=(button_verify=="")?window.emailotpauthn_jsvariables.extrnltxt_004:button_verify.substring(0,15);emlotp_action=(emlotp_action=="")?"":emlotp_action.toLowerCase();var isshowterm=srvrvls("rgstrshowterms");var emailotpauthn_light_box=document.querySelector("#emailotpauthnBox");var emailotpauthn_lightbox_content=eotparemoveBlockCommentMarks(emailotpauthn_light_box.querySelector("#emailotpauthn_contact").innerHTML);const emailotpauthn_lightbox_elem=document.createElement("div");emailotpauthn_lightbox_elem.id="emailotpauthn_lightbox";const emailotpauthn_bdrpbg_elem=document.createElement("div");emailotpauthn_bdrpbg_elem.id="emailotpauthn_bdrpbg";emailotpauthn_bdrpbg_elem.dataset.imgdtls="None";const emailotpauthn_lightbg_elem=document.createElement("div");emailotpauthn_lightbg_elem.id="emailotpauthn_lightbg";emailotpauthn_lightbox_elem.appendChild(emailotpauthn_bdrpbg_elem);emailotpauthn_lightbox_elem.appendChild(emailotpauthn_lightbg_elem);const emailotpauthn_content_elem=document.createElement("div");emailotpauthn_content_elem.id="emailotpauthn_content";if(putclosebox){const emailotpauthn_close_elem=document.createElement("div");emailotpauthn_close_elem.id="emailotpauthn_close";emailotpauthn_close_elem.classList.add("close","wp-exclude-emoji");const emailotpauthn_span_elem=document.createElement("span");emailotpauthn_span_elem.innerHTML="&#x2716;";emailotpauthn_close_elem.appendChild(emailotpauthn_span_elem);emailotpauthn_content_elem.appendChild(emailotpauthn_close_elem);}
var defemailadr=window.localStorage.getItem("emailotpauthnemail"+myhostnem);var defcheckbox=window.localStorage.getItem("emailotpauthncheck"+myhostnem);if(defemailadr==null)defemailadr="";if(defcheckbox==null)defcheckbox="";if(emailotpauthn_lightbox_content.includes('type="password"'))
emailotpauthn_lightbox_content=emailotpauthn_lightbox_content.replace('id="rememberemaildiv"','id="rememberemaildiv" style="display:none!important;"');emailotpauthn_lightbox_content=emailotpauthn_lightbox_content.replace('id="email" value=""','id="email" value="'+defemailadr+'"');emailotpauthn_lightbox_content=emailotpauthn_lightbox_content.replace('id="rememberemail"','id="rememberemail" '+defcheckbox);emailotpauthn_content_elem.innerHTML=emailotpauthn_content_elem.innerHTML+emailotpauthn_lightbox_content;emailotpauthn_lightbox_elem.appendChild(emailotpauthn_content_elem);emailotpauthnlightbox.appendChild(emailotpauthn_lightbox_elem);var emailotpauthn_lightbox_elm=document.getElementById("emailotpauthn_lightbox");if(emailotpauthn_lightbox_elm){var isshwnterm=false;if(emlotp_action==""){setqueryelemattr(emailotpauthn_lightbox_elm,"#showrgstrtermsdiv",3,"none");}else{if(isshowterm==1&&(emlotp_action=="register"||emlotp_action=="combine")){setqueryelemattr(emailotpauthn_lightbox_elm,"#showrgstrtermsdiv",3,"inline-block");isshwnterm=true;}else{setqueryelemattr(emailotpauthn_lightbox_elm,"#showrgstrtermsdiv",3,"none");}}
if(emailotpauthn_lightbox_elm.querySelector("#emailotpauthn_header_submit")){if(emailotpauthn_lightbox_elm.querySelector("#emailotpauthn_header_submit").classList.contains("this_code_is_important")==false){setqueryelemattr(emailotpauthn_lightbox_elm,"#emailotpauthn_header_submit",1,header_submit);setqueryelemattr(emailotpauthn_lightbox_elm,"#emailotpauthn_header_verify",1,header_verify);setqueryelemattr(emailotpauthn_lightbox_elm,"#generateOtp",2,button_submit);setqueryelemattr(emailotpauthn_lightbox_elm,"#submitOtp",2,button_verify);}}
setqueryelemattr(emailotpauthn_lightbox_elm,"#emailotpauthn_action",2,emlotp_action);var ishideaeml=srvrvls("hideautofileml");if(ishideaeml==1){if(isshwnterm){setqueryelemattr(emailotpauthn_lightbox_elm,"#showrmbremaildiv",3,"none");}else{setqueryelemattr(emailotpauthn_lightbox_elm,"#rememberemaildiv",3,"none");}}
setqueryelemattr(emailotpauthn_lightbox_elm,".emailotpauthnmsg",3,"none");setqueryelemattr(emailotpauthn_lightbox_elm,"#submitotpsec #email_otp",2,"");setqueryelemattr(emailotpauthn_lightbox_elm,"#emailotpauthnsubmitid",2,"");setqueryelemattr(emailotpauthn_lightbox_elm,".eotpafni",2,"");setqueryelemattr(emailotpauthn_lightbox_elm,".emailerror",4,"");setqueryelemattr(emailotpauthn_lightbox_elm,".otperror",4,"");setqueryelemattr(emailotpauthn_lightbox_elm,".otpestatus",4,"");if(emailotpauthn_lightbox_elm.querySelector("#generateOtp")){if(emailotpauthn_lightbox_elm.querySelector("#generateOtp").value.toLowerCase()=="2fa"){setqueryelemattr(document,"#emailotpauthnlightbox",3,"none");}else{emailotpauthn_popup_open();setqueryelemattr(document,"#emailotpauthnlightbox",3,"block");if(typeof triggerloginlink==="function"&&!window.eotpa_generetotp_clicked)triggerloginlink(emailotpauthn_lightbox_elm);}}}}});function fadeOut(t,e){if(t!=null){let l=1;const a=l/(e/50),n=setInterval((()=>{l>0?(l-=a,t.style.opacity=l):(clearInterval(n),t.style.display="none");}),50);}}
function fadeIn(t,e,d="",cb=null){if(t!=null){t.style.opacity=0;t.style.display=d;let l=0;const a=1 /(e / 50);const n=setInterval(()=>{if(l<1){l+=a;t.style.opacity=l;}else{clearInterval(n);t.style.opacity=1;if(typeof cb==="function")cb();}},50);}}
function emailotpauthn_showhide(){const eotpa_vactions=["verify_user","verify_all","ratify_user","ratify_all"];const eotpapopupelms=document.querySelectorAll(".emailotpauthn-popup");eotpapopupelms.forEach(eotpapopupelm=>{var emailotpauthn_action=eotpapopupelm.dataset.emerge_action;var emailotpauthn_elemnt=(typeof emailotpauthn_action==="undefined")?eotpapopupelm.querySelector("a"):eotpapopupelm;emailotpauthn_action=emailotpauthn_elemnt.dataset.emerge_action;emailotpauthn_action=(typeof emailotpauthn_action==="undefined")?"":emailotpauthn_action.toLowerCase().trim();var isloggedin=srvrvls("is_logged_in");if(emailotpauthn_action!=""){if(isloggedin==1&&!eotpa_vactions.includes(emailotpauthn_action))eotpapopupelm.style.display="none";}});const eotpainlinelms=document.querySelectorAll(".emailotpauthninlinebox");eotpainlinelms.forEach(eotpainlinelm=>{if(eotpainlinelm.querySelector("#emailotpauthn-form #emailotpauthn_action")){var emailotpauthn_action=eotpainlinelm.querySelector("#emailotpauthn-form #emailotpauthn_action").value;emailotpauthn_action=(typeof emailotpauthn_action==="undefined")?"":emailotpauthn_action.toLowerCase().trim();var isloggedin=srvrvls("is_logged_in");if(emailotpauthn_action!=""){if(isloggedin==1&&!eotpa_vactions.includes(emailotpauthn_action))eotpainlinelm.style.display="none";}}});}
emailotpauthn_showhide();function emailotpauthn_inlineformload(){const eotpainlnelms=document.querySelectorAll(".emailotpauthninlinebox");if(eotpainlnelms.length<1){return false;}
var defemailadr=window.localStorage.getItem("emailotpauthnemail"+myhostnem);var defcheckbox=window.localStorage.getItem("emailotpauthncheck"+myhostnem);if(defemailadr==null)defemailadr="";if(defcheckbox==null)defcheckbox="";var emailotpauthn_inlinebox_content="";var isshwnterm=false;var emlotp_action="";var isshowterm="";var ishideaeml="";var emailotpauthn_first_form=null;eotpainlnelms.forEach((vn,vi)=>{emailotpauthn_inlinebox_content="<div id=\"emailotpauthn_content\">"+eotparemoveBlockCommentMarks(vn.querySelector("#emailotpauthn_contact").innerHTML)+"</div>";if(emailotpauthn_inlinebox_content.includes('type="password"'))
emailotpauthn_inlinebox_content=emailotpauthn_inlinebox_content.replace('id="rememberemaildiv"','id="rememberemaildiv" style="display:none!important;"');emailotpauthn_inlinebox_content=emailotpauthn_inlinebox_content.replace('id="email" value=""','id="email" value="'+defemailadr+'"');emailotpauthn_inlinebox_content=emailotpauthn_inlinebox_content.replace('id="rememberemail"','id="rememberemail" '+defcheckbox);vn.querySelector("#emailotpauthn_contact").innerHTML=emailotpauthn_inlinebox_content;isshwnterm=false;if(vn.querySelector("#emailotpauthn-form #emailotpauthn_action")){emlotp_action=vn.querySelector("#emailotpauthn-form #emailotpauthn_action").value;isshowterm=srvrvls("rgstrshowterms");if(emlotp_action==""){setqueryelemattr(vn,"#showrgstrtermsdiv",3,"none");}else{if(isshowterm==1&&(emlotp_action=="register"||emlotp_action=="combine")){setqueryelemattr(vn,"#showrgstrtermsdiv",3,"inline-block");isshwnterm=true;}else{setqueryelemattr(vn,"#showrgstrtermsdiv",3,"none");}}}
ishideaeml=srvrvls("hideautofileml");if(ishideaeml==1){if(isshwnterm){setqueryelemattr(vn,"#showrmbremaildiv",3,"none");}else{setqueryelemattr(vn,"#rememberemaildiv",3,"none");}}
setqueryelemattr(vn,".emailotpauthnmsg",3,"none");setqueryelemattr(vn,"#emailotpauthn-form #email",2,"");setqueryelemattr(vn,"#submitotpsec #email_otp",2,"");setqueryelemattr(vn,"#emailotpauthnsubmitid",2,"");setqueryelemattr(vn,".eotpafni",2,"");setqueryelemattr(vn,".emailerror",4,"");setqueryelemattr(vn,".otperror",4,"");setqueryelemattr(vn,".otpestatus",4,"");if(emailotpauthn_first_form===null)emailotpauthn_first_form=vn;});if(emailotpauthn_first_form)window.eotpa_first_inline_form=emailotpauthn_first_form;}
function emailotpauthn_2faformload(){var email2fardrct=srvrvls("is_2fa_redirect");if(email2fardrct>0){var email2fa=srvrvls("logged_in_email");if(email2fa.length>1){var is_sc_link=false;var eotpa2faform="";var eotpa2faspan=document.querySelector('.emailotpauthn-popup[data-button_submit="2fa"]');if(eotpa2faspan==null){eotpa2faform=document.getElementById("emailotpauthninlinebox2fa");if(eotpa2faform==null)return 0;}else{var eotpa2falink=eotpa2faspan.getElementsByTagName("a")[0];if(eotpa2falink==null){return 0;}else{is_sc_link=true;window.eotpa_generetotp_clicked=true;eotpa2falink.click();eotpa2faform=document.getElementById("emailotpauthnlightbox");if(eotpa2faform==null)return 0;}}
setqueryelemattr(eotpa2faform,"#emailotpauthn-form #email",2,email2fa);eotpa2faform.querySelector("#emailotpauthn-form #email").setAttribute("type","password");setqueryelemattr(eotpa2faform,"#generateOtp",2,("******"));const target2faform=is_sc_link?document.getElementById("emailotpauthnlightbox"):document.getElementById("emailotpauthninlinebox2fa");fadeIn(target2faform,100,"block",()=>{if(isElementVisible(eotpa2faform)&&eotpa2faform.querySelector("#generateOtp")){window.emailotpauthn_is_autotriggered=true;eotpa2faform.querySelector("#generateOtp").click();}});if(is_sc_link)return 1;else return 2;}}
return 0;}
function emailotpauthn_autopopupload(){var eotpa2faspan=document.querySelector('.emailotpauthn-popup.autopopup:not([data-button_submit="2fa"])');if(eotpa2faspan!=null){var eotpa2falink=eotpa2faspan.getElementsByTagName("a")[0];if(eotpa2falink!=null){eotpa2falink.click();return 1;}}
return 0;}
function emailotpauthn_popup_open(){if(window.emailotpauthn_jsvariables.hidescrollbars==1){if(!eotpaoverflowX)eotpaoverflowX=document.body.style.overflowX;if(!eotpaoverflowY)eotpaoverflowY=document.body.style.overflowY;if(!eotpaoverflowX)eotpaoverflowX=window.getComputedStyle(document.body).overflowX;if(!eotpaoverflowY)eotpaoverflowY=window.getComputedStyle(document.body).overflowY;if(eotpaoverflowX)document.body.style.overflowX="hidden";if(eotpaoverflowY)document.body.style.overflowY="hidden";}
return true;}
function emailotpauthn_popup_close(){if(window.emailotpauthn_jsvariables.hidescrollbars==1){if(eotpaoverflowX)document.body.style.overflowX=eotpaoverflowX;if(eotpaoverflowY)document.body.style.overflowY=eotpaoverflowY;}
enableeotpasecurityelements();}
function emailotpauthn_auto_2fa_inline_load(){emailotpauthn_inlineformload();var is_autoppup_found=emailotpauthn_2faformload();if(is_autoppup_found==0)is_autoppup_found=emailotpauthn_autopopupload();var sync_form_element_box=false;if(is_autoppup_found==1){emailotpauthn_popup_open();const emailotpauthn_content_elm=emailotpauthnlightbox.querySelector("#emailotpauthn_content");if(isElementVisible(emailotpauthn_content_elm)){sync_form_element_box=emailotpauthn_content_elm;disableeotpasecurityelements();}}
eotpaSetBackgroundImage(true);eotpaSetBackgroundImage();eotpa_sync_form_element_ids(sync_form_element_box);if(is_autoppup_found==0&&typeof triggerloginlink==="function"&&window.eotpa_first_inline_form)triggerloginlink(window.eotpa_first_inline_form);}
emailotpauthn_auto_2fa_inline_load();});