{"version":3,"file":"emailInput-Py1jIj3D.js","sources":["../../src/scripts/modules/emailInput.ts"],"sourcesContent":["import { Component } from '@verndale/core';\n\nclass EmailInput extends Component {\n currentMessage: string;\n\n constructor(el: HTMLElement) {\n super(el);\n this.currentMessage =\n this.el.querySelector('.Form__Element__ValidationError')?.textContent || '';\n }\n\n setupDefaults() {\n this.dom = {\n input: this.el.querySelector('input'),\n errorWrapper: this.el.querySelector('.Form__Element__ValidationError'),\n button: document.querySelector('.reset-email-form__submit-button')\n };\n }\n\n addListeners() {\n (this.dom.input as HTMLInputElement)?.addEventListener('input', this.onInput.bind(this));\n }\n\n onInput() {\n const email = (this.dom.input as HTMLInputElement)?.value;\n const isCreateAccount = this.el.dataset.isCreateAccount === 'true';\n\n if (this.validateEmail(email)) {\n this.el?.classList.remove('ValidationFail');\n (this.dom.errorWrapper as HTMLElement).textContent = this.currentMessage;\n (this.dom.button as HTMLButtonElement)?.classList.remove('btn--disabled');\n\n if (isCreateAccount && this.isRedlandsEmail(email)) {\n this.el?.classList.add('ValidationFail');\n (this.dom.errorWrapper as HTMLElement).textContent =\n this.el.dataset.redlandsEmailError || '';\n (this.dom.button as HTMLButtonElement)?.classList.add('btn--disabled');\n } else {\n this.el?.classList.remove('ValidationFail');\n (this.dom.errorWrapper as HTMLElement).textContent = this.currentMessage;\n (this.dom.button as HTMLButtonElement)?.classList.remove('btn--disabled');\n }\n } else {\n this.el?.classList.add('ValidationFail');\n (this.dom.errorWrapper as HTMLElement).textContent = this.el.dataset.errorMessage || '';\n (this.dom.button as HTMLButtonElement)?.classList.add('btn--disabled');\n }\n }\n\n validateEmail(email: string) {\n const emailPattern = /^[^\\s@]+@[^\\s@]+\\.[^\\s@]+$/;\n return emailPattern.test(email);\n }\n\n isRedlandsEmail(email: string) {\n const redlandsEmailPattern = /redlands.edu$/;\n return redlandsEmailPattern.test(email);\n }\n}\n\nexport default EmailInput;\n"],"names":["EmailInput","Component","el","__publicField","_a","email","isCreateAccount","_b","_c","_d","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AI,SAAT,MAAAA,EAAuC,UAAU,IAAI,iBACxD,CAGF,cAAcT,EAAe,CAEpB,MADc,6BACD,KAAKA,CAAK,CAAA,CAGhC,gBAAgBA,EAAe,CAEtB,MADsB,gBACD,KAAKA,CAAK,CAAA,CAE1C"}
驾驶员考试网科目四
太阳城
皇冠体育
廊坊热线
佳创科技
太阳城网址
博彩平台
梦想盈行
皇冠体育投注
Sports-platform-marketing@swissabc.net
KK唱响
esball-service@hongjiuchina.com
Euro-2024-media@w-catering.com
皇冠体育app
太阳城
265G热血海贼王官网
足球博彩
European-Cup-competition-admin@w-catering.com
巴士跑跑卡丁车官网合作站
体育博彩平台
赣榆信息
迅雷看看音乐频道
首都航空官方网站
宣城新闻网新闻中心
卤中仙品牌
汽车大世界越野车大全
中国骑友网
大姨妈
东北彩票网
携手健康网
站点地图
DOS之家
测聘网
海岸城
河南重型