{"version":3,"sources":["js/libraries/scroll-to-form-notification.js"],"names":["ScrollToFormNotification","constructor","formSelector","formNotification","document","querySelector","formInvalidItem","setTimeout","scrollToElement","bind","getItem","el","scrollIntoView","behavior","block"],"mappings":"aAAA,KAAMA,CAAAA,wBAAyB,CAC3BC,WAAW,CAACC,YAAD,CAAe,CACtB,KAAKC,gBAAL,CAAwBC,QAAQ,CAACC,aAAT,CAAuBH,YAAY,CAAG,sBAAtC,CAAxB,CACA,KAAKI,eAAL,CAAuBF,QAAQ,CAACC,aAAT,CAAuBH,YAAY,CAAG,cAAtC,CAAvB,CACAK,UAAU,CAAC,KAAKC,eAAL,CAAqBC,IAArB,CAA0B,IAA1B,CAAD,CAAkC,IAAlC,CACb,CAEDC,OAAO,EAAG,CACN,GAAI,KAAKP,gBAAT,CAA2B,CACvB,MAAO,MAAKA,gBACf,CACD,GAAI,KAAKG,eAAT,CAA0B,CACtB,MAAO,MAAKA,eACf,CACD,MAAO,KACV,CAEDE,eAAe,EAAG,CACd,KAAMG,CAAAA,EAAE,CAAG,KAAKD,OAAL,EAAX,CACAC,EAAE,EAAIA,EAAE,CAACC,cAAH,CAAkB,CAACC,QAAQ,CAAE,QAAX,CAAqBC,KAAK,CAAE,QAA5B,CAAlB,CACT,CApB0B","sourcesContent":["class ScrollToFormNotification {\n constructor(formSelector) {\n this.formNotification = document.querySelector(formSelector + ' [data-notification]');\n this.formInvalidItem = document.querySelector(formSelector + ' .is-invalid');\n setTimeout(this.scrollToElement.bind(this), 1000);\n }\n\n getItem() {\n if (this.formNotification) {\n return this.formNotification\n }\n if (this.formInvalidItem) {\n return this.formInvalidItem;\n }\n return null;\n }\n\n scrollToElement() {\n const el = this.getItem();\n el && el.scrollIntoView({behavior: 'smooth', block: 'center'});\n }\n}"],"file":"scroll-to-form-notification.min.js"}