document.addEventListener("DOMContentLoaded",function(){let e=document.getElementById("documentType"),s=document.getElementById("inputUploadFileOne"),t=document.getElementById("inputUploadFileTwo"),i=document.getElementById("inputUploadFileThree"),o=document.getElementById("verificationOne"),a=document.getElementById("verificationTwo"),n=document.getElementById("verificationThree"),l=document.getElementById("labelVerificationOne"),r=document.getElementById("labelVerificationTwo"),d=document.getElementById("labelVerificationThree"),c=document.getElementById("bSD"),m=document.getElementById("fSD"),u=document.getElementById("messageError1"),v=document.getElementById("div1"),L=document.getElementById("documentType");function p(e,s,t){return 0===e.files.length?(s.innerHTML='<i class="fa-solid fa-triangle-exclamation"></i> Por favor, cargue el documento del archivo',!1):(s.innerHTML='<i class="fa-solid fa-check"></i> El archivo del documento se ha cargado correctamente.',!0)}e.addEventListener("change",function(){let e=this.value;s.classList.remove("show-option"),s.classList.add("hide-option"),t.classList.remove("show-option"),t.classList.add("hide-option"),i.classList.remove("show-option"),i.classList.add("hide-option"),o.value="",a.value="",n.value="",l.innerHTML='<i class="fa-solid fa-upload"></i> El anverso del documento *',r.innerHTML='<i class="fa-solid fa-upload"></i> El reverso del documento *',d.innerHTML='<i class="fa-solid fa-upload"></i> Subir el documento pasaporte *',v.classList.remove("success"),L.classList.remove("error-input"),u.classList.remove("show-error-message"),"state_identity_card"===e||"driving_license"===e?(s.classList.remove("hide-option"),s.classList.add("show-option"),t.classList.remove("hide-option"),t.classList.add("show-option")):"passport"===e&&(i.classList.remove("hide-option"),i.classList.add("show-option"))}),L.addEventListener("input",()=>{let e=L.value.trim();"0"!==e?(v.classList.add("success"),L.classList.remove("error-input"),u.classList.remove("show-error-message")):(v.classList.remove("success"),L.classList.add("error-input"),u.classList.add("show-error-message"))}),o.addEventListener("change",()=>{p(o,l,"El anverso del documento *")}),a.addEventListener("change",()=>{p(a,r,"El reverso del documento *")}),n.addEventListener("change",()=>{p(n,d,"Subir el documento pasaporte *")});let g=!1;m.addEventListener("submit",function(e){g||e.preventDefault()}),c.addEventListener("click",function(){let e=!0,s=L.value.trim();if("0"!==s?(v.classList.add("success"),L.classList.remove("error-input"),u.classList.remove("show-error-message")):(v.classList.remove("success"),L.classList.add("error-input"),u.classList.add("show-error-message"),e=!1),"state_identity_card"===s||"driving_license"===s){let t=p(o,l,"El anverso del documento *"),i=p(a,r,"El reverso del documento *");t&&i||(e=!1)}else if("passport"===s){let c=p(n,d,"Subir el documento pasaporte *");c||(e=!1)}g=e})});