text: function _(e){return document.getElementById(e)}function signUpPageValidation(){errors=[];var e=document.querySelector('input[name="username"]').value,t=document.getElementsByName("password1")[0].value,n=document.getElementsByName("password2")[0].value,a=document.querySelector('input[name="first_name"]').value,r=document.querySelector('input[name="last_name"]').value,o=document.querySelector('input[name="email"]').value;return REGX.username.test(e)||errors.push("Username must be between 4 to 16 characters long."),REGX.nameREGX.test(a)||errors.push("First name should not contain any special character or digit."),REGX.nameREGX.test(r)||errors.push("Last name should not contain any special character or digit."),REGX.emailREGX.test(o)||errors.push("Please enter a valid email."),t!=n&&errors.push("Password and Confirm Password are different."),txt="",errors.forEach(signUpErrors),""===txt||(_("error-log").innerHTML=txt,!1)}function signUpErrors(e,t,n){txt=txt+'<li style="color:red;font-weight:bold;font-size:0.85em;">*'+e+"</li>"}function logInPageValidation(){var e=document.querySelector('input[name="username"]').value;return!!REGX.username.test(e)||(_("login-error").innerHTML='<p style="color:red;">Username must be between 8 to 16 characters long</p>',!1)}function TogglePassword(){var e=document.querySelector('input[name="password1"]'),t=document.querySelector('input[name="password2"]');"password"===e.type&&"password"===t.type?(e.type="text",t.type="text"):(e.type="password",t.type="password")}function logInPasswordToggle(){var e=document.querySelector('input[name="password"]');"password"===e.type?e.type="text":e.type="password"}function changePassword(){var e=document.querySelector('input[name="old_password"]'),t=document.querySelector('input[name="new_password1"]'),n=document.querySelector('input[name="new_password2"]');"password"===e.type&&"password"===t.type&&"password"==n.type?(e.type="text",t.type="text",n.type="text"):(e.type="password",t.type="password",n.type="password")}function validateAddSubject(){return"Please Choose"!=document.getElementsByName("teacher")[0].value}function validateprofile(){var e=document.querySelector("input[name='phone_number']").value,t=document.querySelector("input[name='whatsapp_number']").value,n=/^\+(91)[6-9]\d{9}$/g.test(e),a=/^\+(91)[6-9]\d{9}$/g.test(t);return txt="",n||(txt+="Phone no. must be valid Indian phone number.<br>"),a||(txt+="Whatsapp no. must be valid indian phone numbe.<br>"),txt='<p style="color:red;text-align:center;">'+txt+"</p>",_("profile-errors").innerHTML=txt,!(!n||!a)}function forgotPasswordValidate(){var e=document.getElementsByName("email")[0].value;return!!REGX.emailREGX.test(e)||(txt="You have entered a non-valid email.",document.getElementById("password-reset-error").textContent=txt,!1)}function uniqueid(){var e=document.getElementsByName("join_key")[0].value;return!!REGX.uniqueIdREGX.test(e)||(txt="Unique id would have 7 to 15 characters.",document.getElementById("uniqueIdCheck-error").textContent=txt,!1)}REGX={nameREGX:/^[a-zA-Z]+(([',. -][a-zA-Z ])?[a-zA-Z]*)*$/,emailREGX:/^(([^<>()[\]\.,;:\s@\"]+(\.[^<>()[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$/i,phone_number:/^\+(91)[6-9]\d{9}$/g,description_check:/^.{100,}/,username:/^.{4,16}/,uniqueIdREGX:/^.{7,15}/};const actualBtn=_("actual-btn"),fileChosen=_("file-chosen");null!=actualBtn&&actualBtn.addEventListener("change",(function(){try{var e=25,t=_("actual-btn").files[0].size;if((t/=1048576)<=e&&(_("file-upload-label").textContent=this.files[0].name+" selected. Click again to change"),t>e)throw"Too big"}catch(t){alert("Sorry, file is too large. Please select one that is smaller than "+e+" Mb"),t.preventDefault(),_("file-upload-label").innerHTML='Upload File<span>            <i class="fa mx-2 fa-upload" aria-hidden="true"></i></span></label>'}}));const txa=document.getElementsByTagName("textarea");for(let e=0;e<txa.length;e++)try{txa[e].setAttribute("style","height:"+txa[e].scrollHeight+"px;overflow-y:hidden;"),txa[e].addEventListener("input",OnInput,!1)}catch(e){message="Not on that page."}