{"version":3,"file":"Form.js","names":["Form","a","setters","Component","default","ajax","mix","Event","on","off","trigger","deepMerge","AnalyticsMixin","AccessibilityMixin","Registry","getRelativeSelector","scrollTo","CrossRequestStorage","execute","with","constructor","element","options","arguments","length","headers","errorMessages","captchaRequired","text","accessibility","processingStatusMessage","finishedStatusMessage","genericErrorMessage","classNames","formErrorMessage","onSubmitSuccessReload","showErrorAsSnackbar","showSuccessAsSnackbar","clearFormOnSuccess","onSubmitErrorReload","successModal","submitOnChange","closeModalOnSuccess","clearCustomMessageOnError","captcha","prependError","redirectUrl","events","customSuccess","customError","success","error","validateError","submit","executeSubmit","global","reloadData","section","id","scrollToFormOnSubmit","scrollToFirstErrorOnSubmit","stickyHeaderHeight","isRelativeLoader","disableValidation","keepDisabledSubmitAfterInit","trackFocusedElements","autoSubmit","crossRequestDelayedAction","crossRequestDelayedActionOnError","formUniqueKey","customValidation","customValidationSelector","keepLoaderUntilRedirected","initCache","classes","submitting","relativeLoader","errorMessage","reCaptcha","formCustomMessage","loadingClass","noValidate","selectors","buttons","querySelectorAll","url","getAttribute","method","createCSRFField","getCSRF","hasActiveCsrfProtection","metaCsrf","document","querySelector","formIdField","console","concat","metaCsrfContents","split","name","token","getComponentKey","_componentKey","parentElement","getSelectorForSubElement","data","input","createElement","setAttribute","appendChild","initState","state","isSubmitting","hasError","hasCaptcha","isCaptchaValid","isCaptchaInvisible","invisible","customValidationComplete","classList","add","afterInit","forEach","removeAttribute","remove","restoreLastFocusState","isAutosubmitRequired","Promise","all","Array","from","map","afterRegistered","then","bindEvents","bind","onAction","onReset","onFormReload","onValidate","onCaptchaSuccess","onCaptchaExpired","onSubmitOnChange","handleFieldStateDependencies","e","detail","dependentActions","entry","fieldName","fieldAction","fieldActionCondition","field","target","offsetParent","hasAttribute","action","masterField","type","handleButtonDependentAction","fieldComponent","closest","isRegistered","disabled","parentNode","preventDefault","value","skipAnalytics","_initEventAnalytics","checked","serializedForm","getSerializedForm","getBody","catch","resetFields","reload","bubbles","stopPropagation","clearFormErrors","beforeSubmit","clientValidate","validate","checkValidity","scrollIntoView","block","scrollToFirstError","reject","resolve","form","onExecuteSuccess","event","fieldsErrors","setFormError","onExecuteFail","setSubmitState","onValidationSuccess","onValidationFail","message","saveLastFocusState","emit","body","getHeaders","onSubmitSuccess","onSubmitError","customSubmit","getFieldValues","fieldValues","key","onSuccess","response","onError","Error","getComponent","resetFieldsErrors","cleanGroupsErrors","groupError","refreshForm","content","_replaceElement","reset","FormData","custom","sendFormAnalytics","customRedirect","continueUrl","successUrl","contentUrl","openModal","successMessage","resetCaptcha","emitEventsOnSuccess","setDelayedAction","stopRedirect","redirectInProgress","redirectPage","submissionAnalytics","sendAnalytics","getAnalytics","formObj","entries","emitEventsOnError","clearFormCustomMessage","hasFieldOrGroupError","groupsErrors","navigator","onLine","offlineErrorMessage","fieldGroup","group","groupErrorElement","innerHTML","insertBefore","nextSibling","fieldsValues","fieldError","errorField","errorKey","newValue","errorAnalytics","needReload","call","errorMsg","msg","errNode","prepend","loader","updateStatusMessage","window","location","href","delayedAction","getDelayedAction","removeDelayedAction","focusField","firstError","parent","focus","onComponentValidate","onValidated","isValid","destroy"],"sources":["components/global/Form.js"],"sourcesContent":["/* eslint complexity: off */\n/* eslint max-lines: off */\nimport Component from 'core/Component';\nimport { ajax } from 'toolbox/ajax';\nimport { mix } from 'core/mixwith';\nimport { Event } from 'services/EventEmitter';\nimport { on, off, trigger } from 'toolbox/event';\nimport { deepMerge } from 'toolbox/deepMerge';\nimport AnalyticsMixin from 'mixins/Analytics';\nimport AccessibilityMixin from 'mixins/Accessibility';\nimport Registry from 'core/ComponentRegistry';\nimport { getRelativeSelector } from 'toolbox/html';\nimport { scrollTo } from 'toolbox/scroll';\nimport CrossRequestStorage from 'services/CrossRequestStorage';\n\n/**\n * This is a description of the Form constructor function.\n * @class\n * @classdesc This is a description of the Form class.\n * @extends Component\n */\nexport default class Form extends mix(Component).with(AnalyticsMixin, AccessibilityMixin) {\n    /**\n     * Constructor of the class that mainly merge the options of the components\n     * @param {HTMLElement} element HTMLElement of the component\n     * @param {Object} options options that belongs to the component\n     */\n    constructor(element, options = {}) {\n        super(element, deepMerge({\n            headers: {},\n            errorMessages: {\n                captchaRequired: '',\n            },\n            text: {\n                accessibility: { processingStatusMessage: '', finishedStatusMessage: '' },\n                genericErrorMessage: '',\n            },\n            classNames: {\n                formErrorMessage: 'c-alert m-error',\n            },\n            onSubmitSuccessReload: false, // replace form content with content that came from server on success\n            showErrorAsSnackbar: false, // show error as a snackbar element\n            showSuccessAsSnackbar: false, // show success message as a snackbar element\n            clearFormOnSuccess: true, // clear form on success\n            onSubmitErrorReload: false, // replaces form content with content that came from server on error\n            successModal: null, // pass the same options as the ones in Modal.js\n            submitOnChange: false, // submit form on change\n            closeModalOnSuccess: false, // close Modal on form submit success (for case when form is rendered inside modal)\n            clearCustomMessageOnError: false, // remove custom message, if it was added during previous submit or rendered\n            captcha: null,\n            prependError: false, // change error message position (at the top or at the bottom of a form)\n            redirectUrl: null, // Redirect user if form submission is successful (self | string)\n            events: {\n                customSuccess: null,\n                customError: null,\n                success: 'form.submit.success',\n                error: 'form.submit.error',\n                validateError: 'form.validate.error',\n                submit: 'form.submit',\n                executeSubmit: 'form.execute.submit',\n                global: false, // emit global event with ajax response data\n            },\n            reloadData: {\n                section: 'common',\n                id: 'form',\n            },\n            scrollToFormOnSubmit: false, // Scrolls the parent container such that the component is visible to the user\n            scrollToFirstErrorOnSubmit: false, // Scrolls first form error into view\n            stickyHeaderHeight: 153, // Change it If you have a fixed header height\n            isRelativeLoader: false, // makes the form loader relative to the form (by default the loader is full screen)\n            disableValidation: false, // disable form validation on submit,\n            keepDisabledSubmitAfterInit: false, // disable the button's disabled attribute removal at afterInit\n            trackFocusedElements: true, // enable focused elements tracking\n            autoSubmit: false, // submit form after initialization\n            crossRequestDelayedAction: null, // this delayed action will be applied on form success submit\n            crossRequestDelayedActionOnError: null, // this delayed action will be applied on form submit error\n            formUniqueKey: null, // unique form key, use to identify form as target between different requests\n            customValidation: false,\n            customValidationSelector: null,\n            keepLoaderUntilRedirected: false, // keep Loader on form submit success until page redirected\n        }, options));\n    }\n\n    /**\n     * All selectors must be cached. Never cache elements that are out of the component scope\n     */\n    initCache() {\n        this.classes = {\n            submitting: this.options.isRelativeLoader ? ['c-loader'] : ['c-loader', 'm-fixed', 'm-icon-fixed'],\n            relativeLoader: 'm-relative-loader',\n            error: 'm-error',\n            errorMessage: 'c-field__error-message',\n            formErrorMessage: 'c-form__error-message',\n            reCaptcha: 'g-recaptcha',\n            formCustomMessage: 'c-form__custom-message',\n            loadingClass: 'm-loading',\n        };\n        this.element.noValidate = false;\n        this.selectors.buttons = this.element.querySelectorAll('button[name][type=submit]');\n        this.url = this.element.getAttribute('action');\n        this.method = this.element.getAttribute('method') || 'POST';\n        this.createCSRFField(this.getCSRF());\n    }\n\n    /**\n     * Get the CSRF token value generated in the <meta> tag.\n     * The same token can be used by any form.\n     *\n     * @returns {object} An object containing both the CSRF token name and value\n     */\n    getCSRF() {\n        const hasActiveCsrfProtection = this.element.getAttribute('data-has-active-csrf');\n        // CSRF is not needed for this form, abort, no alerting needed\n        if (hasActiveCsrfProtection !== 'true') {\n            return null;\n        }\n\n        const metaCsrf = document.querySelector('meta[name=\"csrf\"]');\n        if (!metaCsrf) {\n            const formIdField = this.element.querySelector('[name=\"form_id\"]');\n            if (!formIdField) {\n                return null;\n            }\n            console.error(`[Form.js] Failed to find the meta csrf HTML element for form \"${formIdField.getAttribute('value')}\"`);\n            return null;\n        }\n\n        const metaCsrfContents = metaCsrf.getAttribute('content').split('||');\n        return {\n            name: metaCsrfContents[0],\n            token: metaCsrfContents[1],\n        };\n    }\n\n    /**\n     * Returns component key\n     * @override Accessibility mixin method\n     * @returns {String} component key\n     */\n    getComponentKey() {\n        if (!this._componentKey) {\n            this._componentKey = getRelativeSelector(this.element);\n\n            if (this.element.parentElement) {\n                this._componentKey = getRelativeSelector(this.element, this.element.parentElement.parentElement);\n            }\n        }\n        return this._componentKey;\n    }\n\n    /**\n     * Return selector for child element\n     * @param {HTMLElement} element optional, custom focused state\n     * @returns {String} selector for child element\n     */\n    getSelectorForSubElement(element) {\n        return getRelativeSelector(element, element.parentElement) || true;\n    }\n\n    /**\n     * Create CSRF field\n     * @param { Object } data - CSRF object\n     */\n    createCSRFField(data) {\n        if (!data || !data.name || !data.token) {\n            return;\n        }\n\n        const input = document.createElement('input');\n        input.setAttribute('type', 'hidden');\n        input.setAttribute('name', data.name);\n        input.setAttribute('value', data.token);\n\n        this.element.appendChild(input);\n    }\n\n    /**\n     * Init the different state of the component\n     * It helps to avoid heavy DOM manipulation\n     */\n    initState() {\n        this.state = {\n            isSubmitting: false,\n            hasError: false,\n            hasCaptcha: !!this.options.captcha,\n        };\n\n        if (this.state.hasCaptcha) {\n            this.state.isCaptchaValid = false;\n            this.state.isCaptchaInvisible = !!this.options.captcha.invisible;\n        }\n\n        if (this.options.customValidation) {\n            this.state.customValidationComplete = false;\n        }\n\n        if (this.options.isRelativeLoader) {\n            this.element.classList.add(this.classes.relativeLoader);\n        }\n    }\n\n    /**\n     * Called after component initialization\n     */\n    afterInit() {\n        // remove disabled attribute and loading class for each submit button\n        if (!this.options.keepDisabledSubmitAfterInit && this.selectors.buttons && this.selectors.buttons.length) {\n            this.selectors.buttons.forEach((element) => {\n                element.removeAttribute('disabled');\n                element.classList.remove(this.classes.loadingClass);\n            });\n        }\n\n        if (this.options.trackFocusedElements) {\n            this.restoreLastFocusState();\n        }\n\n        if (this.isAutosubmitRequired()) {\n            Promise.all(Array.from(this.element.querySelectorAll('[data-js-field-component]')).map(element => Registry.afterRegistered(element, true)))\n                .then(() => {\n                    this.submit();\n                });\n        }\n    }\n\n    /**\n     * Should contain only event listeners and nothing else\n     * All the event handlers should be into a separated function. No usage of anonyous function\n     */\n    bindEvents() {\n        super.bindEvents();\n\n        on('submit', this.element, this.submit.bind(this));\n        on('click', this.selectors.buttons, this.onAction.bind(this));\n        on('reset', this.element, this.onReset.bind(this));\n        on('form.action', this.element, this.onAction.bind(this));\n        on('form.reload', this.element, this.onFormReload.bind(this));\n        on('form.validate', this.element, this.onValidate.bind(this));\n        if (this.state.hasCaptcha) {\n            on('form.captcha.success', this.element, this.onCaptchaSuccess.bind(this));\n            on('form.captcha.expired', this.element, this.onCaptchaExpired.bind(this));\n        }\n        if (this.options.submitOnChange) {\n            on('change.submit', this.element, this.onSubmitOnChange.bind(this));\n        }\n        on('field.dependency.state.changed', this.element, this.handleFieldStateDependencies.bind(this));\n    }\n\n    /**\n     * Handle fields state dependencies when master field (having dependent fields) state changes.\n     * We handle bubbled event at Form level to limit the scope of field dependencies to one form.\n     *\n     * @param {Event} e Event data\n     */\n    handleFieldStateDependencies(e) {\n        e.detail.dependentActions.forEach((entry) => {\n            const [fieldName, fieldAction, fieldActionCondition] = entry.split(':');\n            const field = this.element.querySelector(`[name=${fieldName}],[data-dependency-listener=${fieldName}]`);\n            if (!field) {\n                return;\n            }\n            // additional condition could require that master field should be visible\n            // in order to perform the dependent action\n            if (fieldActionCondition === 'ifmastervisible' && e.target.offsetParent === null) {\n                return;\n            }\n\n            if (field.hasAttribute('data-dependency-listener')) {\n                Registry.afterRegistered(field).then(() => {\n                    trigger('field.dependency.action', field, { action: fieldAction, masterField: e.detail.masterField, data: e.detail.data });\n                });\n            } else if ('type' in field && (field.type === 'button' || field.type === 'submit')) {\n                // buttons do not have own data-component so can not react to events\n                this.handleButtonDependentAction(field, fieldAction);\n            } else {\n                const fieldComponent = field.closest('[data-js-field-component]');\n                if (fieldComponent) {\n                    if (Registry.isRegistered(fieldComponent)) {\n                        trigger('field.dependency.action', field, { action: fieldAction, masterField: e.detail.masterField, data: e.detail.data });\n                        return;\n                    }\n                    Registry.afterRegistered(fieldComponent).then(() => {\n                        trigger('field.dependency.action', field, { action: fieldAction, masterField: e.detail.masterField, data: e.detail.data });\n                    });\n                }\n            }\n        });\n    }\n\n    /**\n     * Handle dependent action for button elements since they don't have own component\n     * so can not react on events.\n     *\n     * @param {HTMLElement} field button HTML element\n     * @param {String} fieldAction action to be performed\n     */\n    handleButtonDependentAction(field, fieldAction) {\n        switch (fieldAction) {\n        case 'enable':\n            field.disabled = false;\n            break;\n        case 'disable':\n            field.disabled = true;\n            break;\n        case 'show':\n            field.parentNode.classList.remove('h-hidden');\n            break;\n        case 'hide':\n            field.parentNode.classList.add('h-hidden');\n            break;\n\n        default:\n            break;\n        }\n    }\n\n    /**\n     * Handler for custom 'form.action' event which could be triggered by non-submit form elements\n     * or elements outside of the form.\n     *\n     * @param {Event} e Event data\n     */\n    onAction(e) {\n        e.preventDefault();\n\n        const name = (e.detail && e.detail.name) || e.target.name;\n        const value = (e.detail && e.detail.value) || e.target.value;\n        const target = (e.detail && e.detail.target) || e.target;\n\n        if (!e.detail || !e.detail.skipAnalytics) {\n            this._initEventAnalytics(target);\n        }\n        let action = null;\n\n        if (name && !(e.target.type === 'checkbox' && !e.target.checked)) {\n            const serializedForm = this.getSerializedForm(this.getBody());\n            // do not create duplicated filed with the same value\n            // TODO: review all the cases where duplicated fields were created and refactor\n            if (!(name in serializedForm) || serializedForm[name] !== value) {\n                action = document.createElement('input');\n                action.type = 'hidden';\n                action.name = name;\n                action.value = value;\n                this.element.appendChild(action);\n            }\n        }\n\n        this.submit().catch(() => {});\n\n        if (action) {\n            action.remove();\n        }\n    }\n\n    /**\n     * Form reset handler\n     */\n    onReset() {\n        this.resetFields();\n    }\n\n    /**\n     * Form reload handler\n     */\n    onFormReload() {\n        this.reload({\n            data: this.element.name,\n        });\n    }\n\n    /**\n     * Submit form on change\n     * @param {Object} e event\n     */\n    onSubmitOnChange(e) {\n        trigger('form.action', e.target, { bubbles: true });\n    }\n\n    /**\n     * Captcha validation callback\n     *\n     * @param {Event} e Event data\n     */\n    onCaptchaSuccess(e) {\n        e.stopPropagation();\n        this.state.isCaptchaValid = true;\n        this.clearFormErrors();\n    }\n\n    /**\n     * Captcha expired callback\n     *\n     * @param {Event} e Event data\n     */\n    onCaptchaExpired(e) {\n        e.stopPropagation();\n        this.state.isCaptchaValid = false;\n    }\n\n    /**\n     * Called before the submit happens\n     */\n    beforeSubmit() {\n        // Can be extended\n    }\n\n    /**\n     * Runs form client validation\n     * @returns {Boolean} true, if valid\n     */\n    clientValidate() {\n        // Do not validate the form if disableValidation option flag is set to true\n        if (this.options.disableValidation) {\n            return true;\n        }\n\n        this.validate();\n        if (!this.element.checkValidity()) {\n            trigger(this.options.events.validateError, this.element, { bubbles: true });\n            if (this.options.scrollToFormOnSubmit) {\n                this.element.scrollIntoView({ block: 'center' });\n            }\n\n            this.scrollToFirstError();\n            return false;\n        }\n        return true;\n    }\n\n    /**\n     * Submit callback\n     *\n     * @param {Event} e event data\n     * @returns {Boolean} submit result\n     */\n    submit(e) {\n        if (e) {\n            e.preventDefault();\n        }\n\n        this.clearFormErrors();\n\n        this.beforeSubmit();\n\n        // Submission already under process\n        if (this.state.isSubmitting && !this.state.customValidationComplete) {\n            return Promise.reject();\n        }\n\n        if (!this.clientValidate()) {\n            return Promise.reject();\n        }\n\n        if (this.state.hasCaptcha && !this.state.isCaptchaValid) {\n            // if captcha is invisible we need to execute captcha validation\n            // after validation is successful state.isCaptchaValid will be seted to true and form will be submited again\n            if (this.state.isCaptchaInvisible) {\n                return new Promise((resolve, reject) => {\n                    trigger('captcha.execute', this.element.querySelector(`.${this.classes.reCaptcha}`), {\n                        form: this.element,\n                        onExecuteSuccess: () => {\n                            // If recaptcha send a success then we resubmit the form\n                            this.submit().then(resolve).catch((event) => {\n                                if (!event.errorMessage && !event.fieldsErrors) {\n                                    this.setFormError(this.options.errorMessages.captchaRequired);\n                                }\n\n                                reject();\n                            });\n                        },\n                        onExecuteFail: reject,\n                    });\n                });\n            }\n\n            this.setFormError(this.options.errorMessages.captchaRequired);\n\n            return Promise.reject();\n        }\n\n        if (!this.state.isSubmitting) {\n            this.setSubmitState(true);\n        }\n\n        if (this.options.customValidation && !this.state.customValidationComplete) {\n            return new Promise((resolve, reject) => {\n                trigger('client.validate', this.element.querySelector(this.options.customValidationSelector), {\n                    onValidationSuccess: () => {\n                        this.state.customValidationComplete = true;\n                        this.submit().then(resolve);\n                    },\n                    onValidationFail: (error) => {\n                        this.state.customValidationComplete = true;\n                        this.setFormError(error.message);\n\n                        if (error.submit) {\n                            this.submit().then(resolve);\n                        } else {\n                            this.setSubmitState(false);\n                        }\n                        reject();\n                    },\n                });\n            });\n        }\n\n        if (this.hasError) {\n            this.resetFields();\n        }\n\n        if (this.options.trackFocusedElements) {\n            this.saveLastFocusState();\n        }\n\n        Event.emit(this.options.events.executeSubmit, { form: this.element });\n\n        if (this.url) {\n            return ajax(this.url, {\n                method: this.method,\n                body: this.getBody(),\n                headers: this.getHeaders(),\n            })\n                .then(this.onSubmitSuccess.bind(this))\n                .catch(this.onSubmitError.bind(this));\n        }\n        return this.customSubmit();\n    }\n\n    /**\n     * Returns an object with the form's values\n     *\n     * @returns {Object} form field values\n     */\n    getFieldValues() {\n        const fieldValues = {};\n        this.getBody().forEach((value, key) => {\n            fieldValues[key] = value;\n        });\n\n        return fieldValues;\n    }\n\n    /**\n     * Triggers custom form submit event using the form values as a prameter\n     * @returns {Promise} custom submit event promise\n     */\n    customSubmit() {\n        return new Promise((resolve, reject) => {\n            if (this.options.events.submit) {\n                Event.emit(this.options.events.submit, {\n                    form: this.getFieldValues(),\n                    onSuccess: (response) => {\n                        this.onSubmitSuccess(response);\n                        resolve();\n                    },\n                    onError: (response) => {\n                        this.onSubmitError(response);\n                        reject();\n                    },\n                });\n            } else {\n                const e = new Error('customSubmit event must be defined');\n                reject(e);\n            }\n        });\n    }\n\n    /**\n     * Performs native and custom form validations\n     */\n    validate() {\n        // native fields validation\n        this.element.checkValidity();\n        // field component validation\n        Array.from(this.element.querySelectorAll('[data-js-field-component]')).forEach((field) => {\n            if (Registry.isRegistered(field)) {\n                const fieldComponent = Registry.getComponent(field);\n                if (typeof fieldComponent.validate === 'function') {\n                    fieldComponent.validate();\n                }\n            }\n        });\n    }\n\n    /**\n     * Trigger reset event to each field in error of the form\n     */\n    resetFields() {\n        this.element.querySelectorAll('[data-js-field]').forEach(field => trigger('field.reset', field));\n    }\n\n    /**\n     * Trigger error reset event to each field in error of the form\n     */\n    resetFieldsErrors() {\n        this.element.querySelectorAll('[data-js-field]').forEach(field => trigger('error.reset', field));\n    }\n\n    /**\n     * Trigger error reset event to each field in error of the form\n     */\n    cleanGroupsErrors() {\n        this.element.querySelectorAll('.c-field__error-message.m-group').forEach(groupError => groupError.remove());\n    }\n\n    /**\n     * Replace form content with content that came from server or clear\n     * based on provided options\n     * @param {string} content - html content to be replaced\n     */\n    refreshForm(content) {\n        if (this.options.onSubmitSuccessReload) {\n            // replace from with provided content\n            this._replaceElement(content);\n        } else if (this.options.clearFormOnSuccess) {\n            // reset form inputs\n            this.element.reset();\n        }\n    }\n\n    /**\n     * Returns FormData interface to be used for ajax request\n     *\n     * @returns {FormData} form data\n     */\n    getBody() {\n        return new FormData(this.element);\n    }\n\n    /**\n     * By default, the options.headers is returned for simple form. This can be overloaded through options or in case of more\n     * complex use case, the method should be overloaded\n     * @returns {Object} headers object\n     */\n    getHeaders() {\n        return this.options.headers;\n    }\n\n    /**\n     * Submit success callback\n     *\n     * @param {Object} content successful submit response object\n     * @returns {Object} serialized form\n     */\n    onSubmitSuccess(content) {\n        // if there is a redirection to happen, then do not remove the loader\n        content = content || {};\n        const custom = content.custom || {};\n        this.sendFormAnalytics(content);\n        const customRedirect = custom.redirectUrl;\n        const redirectUrl = content.redirectUrl || content.continueUrl || customRedirect || this.options.redirectUrl;\n        if (redirectUrl && typeof content === 'object') {\n            content.redirectUrl = redirectUrl;\n        } else if (!redirectUrl && !this.options.keepLoaderUntilRedirected) {\n            this.setSubmitState(false);\n        }\n        trigger(this.options.events.success, this.element, { bubbles: true, content });\n\n        if ((this.options.successModal && typeof this.options.successModal === 'object') || custom.successModal) {\n            let successModal = this.options.successModal || {};\n            if (content.successUrl) {\n                successModal.contentUrl = content.successUrl;\n            }\n\n            // extra configuration for successModal (e.g. 'clickOutsideClose', ...)\n            if (custom.successModal) {\n                successModal = deepMerge(successModal, custom.successModal);\n            }\n\n            this.openModal(successModal);\n        } else if (this.options.showSuccessAsSnackbar && content.successMessage) {\n            Event.emit('snackbar.notify', { content: content.successMessage, type: 'success' });\n        }\n\n        this.resetCaptcha();\n\n        this.emitEventsOnSuccess(content);\n\n        if (this.options.crossRequestDelayedAction) {\n            CrossRequestStorage.setDelayedAction(this.options.crossRequestDelayedAction);\n        }\n\n        if (!content.stopRedirect && !content.redirectInProgress && this.redirectPage(redirectUrl)) {\n            return this.getSerializedForm(this.getBody());\n        }\n\n        this.refreshForm(content);\n\n        if (this.options.scrollToFormOnSubmit && content.success && content.message) {\n            this.element.scrollIntoView({ block: 'center' });\n        }\n\n        return this.getSerializedForm(this.getBody());\n    }\n\n    /**\n     * Send Analytics data\n     *\n     * @param {Object} data analytics data\n     */\n    sendFormAnalytics(data) {\n        if (!data) {\n            return;\n        }\n\n        if (typeof data === 'object' && data.submissionAnalytics) {\n            this.sendAnalytics(data.submissionAnalytics);\n            delete data.submissionAnalytics;\n        }\n\n        this.sendAnalytics(this.getAnalytics(data));\n    }\n\n    /**\n     * Transform FormData object into plain object\n     * @param {FormData} form FormData object\n     * @returns {Object}  test\n     */\n    getSerializedForm(form) {\n        const formObj = {};\n        // eslint-disable-next-line\n        for (const [key, value] of form.entries()) {\n            formObj[key] = value;\n        }\n\n        return formObj;\n    }\n\n    /**\n     * Emits events on success submit\n     * @param {string} content - ajax response\n     */\n    emitEventsOnSuccess(content) {\n        let events = [];\n        if (content.custom && content.custom.events) {\n            events = events.concat(content.custom.events);\n        }\n        if (this.options.events.customSuccess) {\n            events = events.concat(this.options.events.customSuccess);\n        }\n        events.forEach((event) => {\n            Event.emit(event, content);\n        });\n\n        if (this.options.closeModalOnSuccess) {\n            Event.emit('modal.close');\n        }\n    }\n\n    /**\n     * Emits events on failed submit\n     * @param {string} content - ajax response\n     */\n    emitEventsOnError(content) {\n        let events = [];\n\n        if (this.options.events.customError) {\n            events = events.concat(this.options.events.customError);\n        }\n        events.forEach((event) => {\n            Event.emit(event, content);\n        });\n    }\n\n    /**\n     * Open modal\n     *\n     * @param {Object} options Modal settings\n     */\n    openModal(options) {\n        Event.emit('modal.open', {\n            options,\n        });\n    }\n\n    /**\n     * Submit error callback\n     *\n     * @param {Object} error unsuccessful submit response object\n     * @returns {Object} error\n     */\n    onSubmitError(error) {\n        this.setSubmitState(false);\n        trigger(this.options.events.error, this.element, { bubbles: true, content: error });\n\n        /**\n         * In case if server responds with redirect url\n         */\n        if (error.data && error.data.redirectUrl) {\n            this.redirectPage(error.data.redirectUrl);\n        }\n\n        /**\n         * In case if server responds with form HTML\n         */\n        if (this.options.onSubmitErrorReload) {\n            this._replaceElement(error);\n        } else if (this.options.clearCustomMessageOnError) {\n            // remove custom message on error, if it was added during previous submit (e.g checking balance of gift certificate)\n            this.clearFormCustomMessage();\n        }\n\n        if (this.options.crossRequestDelayedActionOnError) {\n            CrossRequestStorage.setDelayedAction(this.options.crossRequestDelayedActionOnError);\n        }\n\n        // check if response has any error (field / group)\n        const hasFieldOrGroupError = error.data && ((error.data.fieldsErrors && error.data.fieldsErrors.length !== 0)\n            || (error.data.groupsErrors && error.data.groupsErrors.length !== 0));\n\n        /**\n         * In case if server responds with errors JSON\n         */\n        // show error as snackbar element if option is configured OR set form error\n        if (this.options.showErrorAsSnackbar && error && error.errorMessage) {\n            Event.emit('snackbar.notify', { content: error.errorMessage, type: 'error' });\n        } else if (error.errorMessage) {\n            this.setFormError(error.errorMessage);\n        } else if (!hasFieldOrGroupError) {\n            const errorMessage = !navigator.onLine ? this.options.text.offlineErrorMessage\n                : (this.options.text.genericErrorMessage || 'ERROR_UNDEFINED');\n            this.setFormError(errorMessage);\n        }\n        // set form group errors\n        const groupsErrors = (error.data && error.data.groupsErrors) || [];\n        if (groupsErrors.length) {\n            this.cleanGroupsErrors();\n            groupsErrors.forEach((groupError) => {\n                const fieldGroup = this.element.querySelector(`[data-js-group=\"${groupError.group}\"]`);\n                if (fieldGroup) {\n                    let groupErrorElement = null;\n                    groupErrorElement = document.createElement('div');\n                    groupErrorElement.classList.add('c-field__error-message', 'm-group');\n                    groupErrorElement.setAttribute('id', groupError.group);\n                    groupErrorElement.setAttribute('role', 'alert');\n                    groupErrorElement.innerHTML = groupError.errorMessage;\n                    fieldGroup.parentNode.insertBefore(groupErrorElement, fieldGroup.nextSibling);\n                }\n            });\n        }\n        // set form field errors\n        const fieldsErrors = (error.data && error.data.fieldsErrors) || [];\n        const fieldsValues = (error.data && error.data.fieldsValues) || {};\n        if (fieldsErrors.length) {\n            this.resetFieldsErrors();\n            fieldsErrors.forEach((fieldError) => {\n                const errorField = this.element.querySelector(`[name=\"${fieldError.field}\"]`);\n                if (errorField) {\n                    trigger('field.invalidate', errorField, {\n                        errorMessage: fieldError.errorMessage,\n                        errorKey: fieldError.errorKey,\n                        newValue: fieldsValues[fieldError.field],\n                    });\n                }\n            });\n            this.scrollToFirstError();\n        }\n        // fire error events\n        this.emitEventsOnError(error.data || error);\n        // fire error analytics\n        if (error.data && error.data.custom && error.data.custom.errorAnalytics) {\n            this.sendAnalytics(error.data.custom.errorAnalytics);\n        }\n        // reset captcha if it was checked\n        this.resetCaptcha();\n\n        if (error.data && error.data.needReload) {\n            this.redirectPage('self');\n        }\n\n        return Promise.reject(error.data || error);\n    }\n\n    /**\n     * Emit captcha.reset\n     */\n    resetCaptcha() {\n        if (this.state.isCaptchaValid) {\n            this.state.isCaptchaValid = false;\n            trigger('captcha.reset', this.element.querySelector(`.${this.classes.reCaptcha}`));\n        }\n    }\n\n    /**\n     * Clear form validation errors.\n     */\n    clearFormErrors() {\n        this.element.classList.remove(this.classes.error);\n        [].forEach.call(this.element.querySelectorAll(`.${this.classes.formErrorMessage}`), (errorMsg) => {\n            errorMsg.remove();\n        });\n        this.cleanGroupsErrors();\n    }\n\n    /**\n     * Clear form custom message.\n     */\n    clearFormCustomMessage() {\n        [].forEach.call(this.element.querySelectorAll(`.${this.classes.formCustomMessage}`), (msg) => {\n            msg.classList.add('h-hidden');\n        });\n    }\n\n    /**\n     * Set form state and add error message.\n     *\n     * @param {String} errorMessage message to set\n     */\n    setFormError(errorMessage) {\n        this.clearFormErrors();\n        this.element.classList.add(this.classes.error);\n        const errNode = document.createElement('p');\n        errNode.classList.add(this.classes.formErrorMessage);\n        if (this.options.classNames && this.options.classNames.formErrorMessage) {\n            errNode.classList.add(...this.options.classNames.formErrorMessage.split(' '));\n        }\n        errNode.setAttribute('role', 'alert');\n        errNode.innerHTML = errorMessage;\n        if (this.options.prependError) {\n            this.element.prepend(errNode);\n        } else {\n            this.element.appendChild(errNode);\n        }\n    }\n\n    /**\n     * Set flag isSubmitting to avoid duplicate call in case of multiple submit within short time.\n     *\n     * @param {Boolean} isSubmitting if true then set submiting state, clear state otherwise\n     */\n    setSubmitState(isSubmitting) {\n        if (isSubmitting) {\n            if (!this.loader) {\n                this.loader = document.createElement('div');\n                this.loader.classList.add(...this.classes.submitting);\n            }\n            this.element.appendChild(this.loader);\n            this.state.isSubmitting = true;\n            this.updateStatusMessage(this.options.text.accessibility.processingStatusMessage);\n        } else {\n            if (this.loader) {\n                this.loader.remove();\n            }\n            this.state.isSubmitting = false;\n            this.updateStatusMessage(this.options.text.accessibility.finishedStatusMessage);\n        }\n    }\n\n    /**\n     * Reload page or redirect to requested location\n     *\n     * @param {String} url URL to redirect to, default is this.options.redirectUrl\n     * @return {Boolean} true, if reload or redirect was initiated\n     */\n    redirectPage(url) {\n        const redirectUrl = url || this.options.redirectUrl;\n\n        if (redirectUrl) {\n            this.setSubmitState(true);\n\n            if (redirectUrl === 'self') {\n                window.location.reload();\n            } else {\n                window.location.href = redirectUrl;\n            }\n            return true;\n        }\n\n        return false;\n    }\n\n    /**\n     * Check if autosubmit is required\n     * @returns {Boolean} true, if required\n     */\n    isAutosubmitRequired() {\n        if (this.options.autoSubmit) {\n            return true;\n        }\n\n        if (this.options.formUniqueKey) {\n            const delayedAction = CrossRequestStorage.getDelayedAction();\n            if (delayedAction && delayedAction.type === 'submit' && this.options.formUniqueKey === delayedAction.value) {\n                CrossRequestStorage.removeDelayedAction();\n                return true;\n            }\n        }\n\n        return false;\n    }\n\n    /**\n     * Scroll to first error\n     */\n    scrollToFirstError() {\n        if (!this.options.scrollToFirstErrorOnSubmit) {\n            // focus field if an error occurs\n            this.focusField(this.element.querySelector('[data-js-field][aria-invalid=\"true\"]'));\n            return;\n        }\n\n        const firstError = this.element.querySelector(`.${this.classes.errorMessage}`) || this.element.querySelector(`.${this.classes.formErrorMessage}`);\n\n        if (!firstError) {\n            return;\n        }\n\n        const parent = firstError.parentNode;\n\n        scrollTo(parent, this.options.stickyHeaderHeight);\n    }\n\n    /**\n     * Focus field\n     * @param {Object} field field DOM element\n     * @return {Boolean} true, if filed focused\n     */\n    focusField(field) {\n        if (!field) {\n            return false;\n        }\n\n        field.focus();\n        return true;\n    }\n\n    /**\n     * This function hook is called whenever a validation of the component is requested\n     * @param {Event} event Event object\n     */\n    onComponentValidate(event) {\n        const { onValidated } = event.detail;\n        if (typeof onValidated === 'function') {\n            this.submit()\n                .then((data) => {\n                    onValidated({\n                        isValid: true,\n                        data,\n                    });\n                }).catch(() => {\n                    onValidated({\n                        isValid: false,\n                    });\n                });\n        }\n    }\n\n    /**\n     * Validate event handler\n     */\n    onValidate() {\n        this.validate();\n    }\n\n    /**\n     * Destroy is called automatically after the component is being removed from the DOM\n     * You must always destroy the listeners attached to an element to avoid any memory leaks\n     */\n    destroy() {\n        super.destroy();\n\n        off(this.element);\n        off('click', this.selectors.buttons);\n    }\n}\n"],"mappings":"qUAqBqBA,CAAI,QAAAC,CAAA,oBAAAC,OAAA,WAAAD,CAAA,EAnBlBE,CAAS,CAAAF,CAAA,CAAAG,OAAA,WAAAH,CAAA,EACPI,CAAI,CAAAJ,CAAA,CAAJI,IAAI,WAAAJ,CAAA,EACJK,CAAG,CAAAL,CAAA,CAAHK,GAAG,WAAAL,CAAA,EACHM,C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