1"use strict";(self.webpackChunk=self.webpackChunk||[]).push([[79140],{9140:(t,i,e)=>{e.r(i),e.d(i,{default:()=>r});var o=e(9568),s=e(9610),n=e(5965);class r extends o.Z{init(){if(!1===this._isFormElement(this.el)){console.error("[FormHandler]: Element is not of type <form>",this.el);return}this.form=this.el,this.formFields=this.form.querySelectorAll(this.options.formFieldSelector),this.submitButtons=this._getSubmitButtons(),this.submittButtonLoaders=[],!0===this.options.validation&&this._initFormValidation(),this._initFormEvents()}_initFormEvents(){this.form.addEventListener("submit",this._onFormSubmit.bind(this)),this.form.addEventListener("removeLoader",this.removeLoadingIndicator.bind(this))}_initFormValidation(){window.formValidation.setNoValidate(this.form),this.form.checkValidity=this._checkValidity.bind(this),this._initFieldValidationEvents()}_initFieldValidationEvents(){this.formFields.forEach(t=>{this._initFieldValidation(t)})}_initFieldValidation(t){let i=t.tagName.toLowerCase();t.addEventListener("select"===i?"change":"input",s.Z.debounce(window.formValidation.validateField.bind(window.formValidation,t),this.options.debounceTime))}_onFormSubmit(t){if(this.$emitter.publish("beforeSubmit"),!0===this.options.validateOnSubmit){this.formFields=this.form.querySelectorAll(this.options.formFieldSelector);let i=window.formValidation.validateForm(this.form,this.formFields);if(i.length>0){t.preventDefault(),this.$emitter.publish("validationFailed",{invalidFields:i}),!0===this.options.focusInvalidField&&i[0].focus();return}}this.$emitter.publish("validSubmit"),!0===this.options.loadingIndicator&&this.addLoadingIndicator()}addLoadingIndicator(){this.submitButtons.forEach(t=>{let i=new n.Z(t,this.options.loadingIndicatorPosition);this.submittButtonLoaders.push(i),i.create()})}removeLoadingIndicator(){this.submittButtonLoaders.forEach(t=>t.remove())}_checkValidity(){return this.formFields=this.form.querySelectorAll(this.options.formFieldSelector),0===window.formValidation.validateForm(this.form,this.formFields).length}_getSubmitButtons(){let t=Array.from(this.form.querySelectorAll("button[type=submit]")),i=this.form.id;if(i){let e=Array.from(document.querySelectorAll('button[type=submit][form="'.concat(i,'"]')));t.push(...e)}return t}_isFormElement(t){return"form"===t.tagName.toLowerCase()}}r.options={validation:!0,validateOnSubmit:!0,focusInvalidField:!0,debounceTime:"200",formFieldSelector:"input, textarea, select",loadingIndicator:!0,loadingIndicatorPosition:"before"}},5965:(t,i,e)=>{e.d(i,{Z:()=>s});var o=e(2363);class s extends o.Z{create(){super.create(),this._isButtonElement()?this.parent.disabled=!0:this._isAnchorElement()&&this.parent.classList.add("disabled")}remove(){super.remove(),this._isButtonElement()?this.parent.disabled=!1:this._isAnchorElement()&&this.parent.classList.remove("disabled")}_isButtonElement(){return"button"===this.parent.tagName.toLowerCase()}_isAnchorElement(){return"a"===this.parent.tagName.toLowerCase()}constructor(t,i="before"){if(super(t,i),!this._isButtonElement()&&!this._isAnchorElement())throw Error("Parent element is not of type <button> or <a>")}}},2363:(t,i,e)=>{e.d(i,{L:()=>n,Z:()=>r});var o=e(3266);let s="loader",n={BEFORE:"before",AFTER:"after",INNER:"inner"};class r{create(){if(!this.exists()){if(this.position===n.INNER){this.parent.innerHTML=r.getTemplate();return}this.parent.insertAdjacentHTML(this._getPosition(),r.getTemplate())}}remove(){let t=this.parent.querySelectorAll(".".concat(s));o.Z.iterate(t,t=>t.remove())}exists(){return this.parent.querySelectorAll(".".concat(s)).length>0}_getPosition(){return this.position===n.BEFORE?"afterbegin":"beforeend"}static getTemplate(){return'<div class="'.concat(s,'" role="status">\n <span class="').concat("visually-hidden",'">Loading...</span>\n </div>')}static SELECTOR_CLASS(){return s}constructor(t,i=n.BEFORE){this.parent=t instanceof Element?t:document.body.querySelector(t),this.position=i}}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.