"use strict";!function(){const e=$(".select2"),a=$(".selectpicker"),i=document.querySelector("#wizard-validation");if(i,null!==i){const n=i.querySelector("#wizard-validation-form"),r=n.querySelector("#account-details-validation");var t=n.querySelector("#personal-info-validation"),o=n.querySelector("#social-links-validation");const s=[].slice.call(n.querySelectorAll(".btn-next")),l=[].slice.call(n.querySelectorAll(".btn-prev")),d=new Stepper(i,{linear:!0}),m=FormValidation.formValidation(r,{fields:{formValidationUsername:{validators:{notEmpty:{message:"The name is required"},stringLength:{min:6,max:30,message:"The name must be more than 6 and less than 30 characters long"},regexp:{regexp:/^[a-zA-Z0-9 ]+$/,message:"The name can only consist of alphabetical, number and space"}}},formValidationEmail:{validators:{notEmpty:{message:"The Email is required"},emailAddress:{message:"The value is not a valid email address"}}},formValidationPass:{validators:{notEmpty:{message:"The password is required"}}},formValidationConfirmPass:{validators:{notEmpty:{message:"The Confirm Password is required"},identical:{compare:function(){return r.querySelector('[name="formValidationPass"]').value},message:"The password and its confirm are not the same"}}}},plugins:{trigger:new FormValidation.plugins.Trigger,bootstrap5:new FormValidation.plugins.Bootstrap5({eleValidClass:"",rowSelector:".col-sm-6"}),autoFocus:new FormValidation.plugins.AutoFocus,submitButton:new FormValidation.plugins.SubmitButton},init:e=>{e.on("plugins.message.placed",function(e){e.element.parentElement.classList.contains("input-group")&&e.element.parentElement.insertAdjacentElement("afterend",e.messageElement)})}}).on("core.form.valid",function(){d.next()}),u=FormValidation.formValidation(t,{fields:{formValidationFirstName:{validators:{notEmpty:{message:"The first name is required"}}},formValidationLastName:{validators:{notEmpty:{message:"The last name is required"}}},formValidationCountry:{validators:{notEmpty:{message:"The Country is required"}}},formValidationLanguage:{validators:{notEmpty:{message:"The Languages is required"}}}},plugins:{trigger:new FormValidation.plugins.Trigger,bootstrap5:new FormValidation.plugins.Bootstrap5({eleValidClass:"",rowSelector:".col-sm-6"}),autoFocus:new FormValidation.plugins.AutoFocus,submitButton:new FormValidation.plugins.SubmitButton}}).on("core.form.valid",function(){d.next()}),c=(a.length&&a.each(function(){$(this).selectpicker().on("change",function(){u.revalidateField("formValidationLanguage")})}),e.length&&e.each(function(){var e=$(this);e.wrap('<div class="position-relative"></div>'),e.select2({placeholder:"Select an country",dropdownParent:e.parent()}).on("change.select2",function(){u.revalidateField("formValidationCountry")})}),FormValidation.formValidation(o,{fields:{formValidationTwitter:{validators:{notEmpty:{message:"The Twitter URL is required"},uri:{message:"The URL is not proper"}}},formValidationFacebook:{validators:{notEmpty:{message:"The Facebook URL is required"},uri:{message:"The URL is not proper"}}},formValidationGoogle:{validators:{notEmpty:{message:"The Google URL is required"},uri:{message:"The URL is not proper"}}},formValidationLinkedIn:{validators:{notEmpty:{message:"The LinkedIn URL is required"},uri:{message:"The URL is not proper"}}}},plugins:{trigger:new FormValidation.plugins.Trigger,bootstrap5:new FormValidation.plugins.Bootstrap5({eleValidClass:"",rowSelector:".col-sm-6"}),autoFocus:new FormValidation.plugins.AutoFocus,submitButton:new FormValidation.plugins.SubmitButton}}).on("core.form.valid",function(){alert("Submitted..!!")}));s.forEach(e=>{e.addEventListener("click",e=>{switch(d._currentIndex){case 0:m.validate();break;case 1:u.validate();break;case 2:c.validate()}})}),l.forEach(e=>{e.addEventListener("click",e=>{switch(d._currentIndex){case 2:case 1:d.previous()}})})}}();