/* jshint esversion: 6, sub:true */ function emailotpauthn_separat_box(pelm){if(window.emailotpauthn_jsvariables.isoneinputbox==1)return true;var eotpa_in1=pelm.querySelector("#eotpa_otc-1");var eotpainptdiv=pelm.querySelector("#eotpainputdiv");if(eotpainptdiv!=null){var eotpa_ins=eotpainptdiv.querySelectorAll("input");var splitNumber=function(e){var data=e.data||e.target.value;if(isNaN(data)||!data){e.target.value="";setqueryelemattr(pelm,".otperror",4,window.emailotpauthn_jsvariables.extrnltxt_059);return;}
if(data.length===1)return;data=data.replace("-","").replace(".","");popuNext(e.target,data);};var popuNext=function(el,data){el.value=data[0];data=data.substring(1);el.focus();if(el.nextElementSibling&&data.length){popuNext(el.nextElementSibling,data);}};eotpa_ins.forEach(function(input){input.addEventListener("keyup",function(e){if(e.keyCode===16||e.keyCode==9||e.keyCode==224||e.keyCode==18||e.keyCode==17){return;}
if((e.keyCode===8||e.keyCode===37)&&this.previousElementSibling&&this.previousElementSibling.tagName==="INPUT"){this.previousElementSibling.focus();}else if(e.keyCode!==8&&this.nextElementSibling){this.nextElementSibling.focus();}
if(e.target.value.length>1){splitNumber(e);}
eotpa_updateInput(eotpa_ins,pelm);if(e.target.id=="eotpa_otc-6"&&e.keyCode==13){pelm.querySelector("#submitOtp").click();}});input.addEventListener("input",function(e){if(e.target.value.length>1){splitNumber(e);}
eotpa_updateInput(eotpa_ins,pelm);});input.addEventListener("focus",function(e){if(this===eotpa_in1)return;if(eotpa_in1.value==""){eotpa_in1.focus();}
if(this.previousElementSibling.value==""){this.previousElementSibling.focus();}});});eotpa_in1.addEventListener("input",splitNumber);}}
function eotpa_updateInput(eotpa_insp,pelem){var inputValue=Array.from(eotpa_insp).reduce(function(email_otp,input){email_otp+=(input.value.length)?input.value:"";return email_otp;},"");pelem.querySelector("#email_otp").value=inputValue;}