const sendButton=document.getElementById("bSD"),username=document.getElementById("username"),password=document.getElementById("password"),div1=document.getElementById("div1"),div2=document.getElementById("div2"),labelUsername=document.getElementById("labelUsername"),labelPassword=document.getElementById("labelPassword"),messageError1=document.getElementById("messageError1"),messageError2=document.getElementById("messageError2"),formData=document.getElementById("fSD");let validationData=!1;formData.addEventListener("submit",function(e){!0===div1.classList.contains("success")&&!0===div2.classList.contains("success")&&(validationData=!0),!1===validationData&&e.preventDefault()}),sendButton.addEventListener("click",function(){var e=username.value.trim(),s=password.value.trim();""===e?(div1.classList.remove("success"),username.classList.add("error-input"),messageError1.classList.add("show-error-message")):e.length<3?(div1.classList.remove("success"),username.classList.add("error-input"),messageError1.classList.add("show-error-message")):e.length>=3&&(div1.classList.add("success"),username.classList.remove("error-input"),messageError1.classList.remove("show-error-message")),""===s?(div2.classList.remove("success"),password.classList.add("error-input"),messageError2.classList.add("show-error-message")):s.length<3?(div2.classList.remove("success"),password.classList.add("error-input"),messageError2.classList.add("show-error-message")):s.length>=3&&(div2.classList.add("success"),password.classList.remove("error-input"),messageError2.classList.remove("show-error-message"))}),username.addEventListener("input",()=>{var e;username.value.trim().length>=3&&(div1.classList.add("success"),username.classList.remove("error-input"),messageError1.classList.remove("show-error-message"))}),password.addEventListener("input",()=>{var e;password.value.trim().length>=3&&(div2.classList.add("success"),password.classList.remove("error-input"),messageError2.classList.remove("show-error-message"))});const select=document.querySelector(".custom-select"),trigger=select.querySelector(".select-trigger"),options=select.querySelectorAll(".select-options li"),selectedOption=select.querySelector(".selected-option"),hiddenInput=document.getElementById("document_type");trigger.addEventListener("click",()=>{select.classList.toggle("open")}),options.forEach(e=>{e.addEventListener("click",()=>{options.forEach(e=>{e.classList.remove("active"),e.innerHTML=e.textContent}),e.classList.add("active"),e.innerHTML=`${e.textContent} <i class="fa-solid fa-check"></i>`;let s=e.getAttribute("data-value");selectedOption.textContent=s,hiddenInput.value=s,select.classList.remove("open")})}),document.addEventListener("click",e=>{select.contains(e.target)||select.classList.remove("open")});