{"version":3,"sources":["webpack:///./source/application/contact-send-message.js","webpack:///./source/application/contact-send-message/contact-send-message.module.js","webpack:///./source/application/contact-send-message/contact-send-message.component.js"],"names":["angular","module","messagingService","vcRecaptcha","captchaService","component","ContactSendMessageComponent","name","bindings","onMessage","templateUrl","controller","$mdDialog","CommonConstants","$timeout","$rootScope","notificationService","this","emailRegex","numberRegex","model","showRecaptcha","globalNotification","changes","formError","isFirstChange","backendError","copy","cancel","agentMessageForm","captcha","$setValidity","vm","show","clickOutsideToClose","controllerAs","onComplete","captchaText","initCaptcha","hide","getCaptcha","then","response","captchaId","data","captchaImg","htmlFragment","error","window","ipEventBus","publish","message","sendGeneralMessage","catch","status","$setPristine","$setUntouched","showError"],"mappings":"gIAAA,Q,wGCAA,cACA,WAEA,WACA,WACA,S,mDAEA,I,EAEeA,UAAQC,OAFH,qBAEuB,CAACC,UAAkBC,UAAaC,YAAiBC,UAAU,qBAAsBC,+BAA6BC,K,0SCTlJ,IAAMD,EAA8B,CAC1CE,SAAU,CACTC,UAAW,KAEZC,YAAa,8BACbC,WAAU,WACT,WAAYC,EAAWC,EAAiBC,EAAUZ,EAAkBa,EAAYC,EAAqBZ,I,4FAAgB,SAEpHa,KAAKL,UAAYA,EACjBK,KAAKf,iBAAmBA,EACxBe,KAAKH,SAAWA,EAChBG,KAAKC,WAAa,yJAClBD,KAAKE,YAAc,QACnBF,KAAKG,MAAQ,GACbH,KAAKI,eAAgB,EACrBJ,KAAKJ,gBAAkBA,EACvBI,KAAKF,WAAaA,EAClBE,KAAKF,WAAWO,mBAAqB,GACrCL,KAAKD,oBAAsBA,EAC3BC,KAAKb,eAAiBA,E,UAdd,mI,EAAA,G,EAAA,kCAiBEmB,GACNA,EAAQC,YAAcD,EAAQC,UAAUC,kBAC3CR,KAAKS,aAAe1B,QAAQ2B,KAAKV,KAAKO,WACb,WAArBP,KAAKS,cACRT,KAAKL,UAAUgB,YArBT,0CA0BRX,KAAKY,iBAAiBC,QAAQC,aAAa,WAAW,EAAMd,KAAKY,oBA1BzD,wCA4BS,WACXG,EAAKf,KACXA,KAAKL,UAAUqB,KAAK,CACnBvB,YAAa,4BACbwB,qBAAqB,EACrBvB,WAAY,kBAAM,GAClBwB,aAAc,QACdC,WALmB,WAMlBJ,EAAGK,YAAc,KACjBL,EAAGM,mBArCG,yCA2CRrB,KAAKG,MAAQ,GACbH,KAAKL,UAAU2B,OACftB,KAAKF,WAAWO,mBAAqB,KA7C7B,oCAgDK,WACbL,KAAKb,eAAeoC,aAAaC,MAChC,SAAAC,GACC,EAAKC,UAAYD,EAASE,KAAKD,UAC/B,EAAKE,WAAaH,EAASE,KAAKE,gBAEjC,SAAAC,GACCC,OAAOC,WAAWC,QAAQ,aAAc,CACvCC,QAAS,wBAxDJ,6BA8DF,WACNlC,KAAKf,iBAAiBkD,mBAAmBnC,KAAKG,MAAO,CAACuB,UAAW1B,KAAK0B,UAAWN,YAAapB,KAAKoB,cAAcI,MAAK,SAACC,GACtH,EAAK3B,WAAWO,mBAAqB,CACpC6B,QAAS,+BAERE,OAAM,SAACN,GAAU,MACC,KAAhBA,EAAMO,QAAsC,YAArB,UAAAP,EAAMH,YAAN,eAAYG,QACtC,EAAKlB,iBAAiBC,QAAQC,aAAa,WAAW,EAAO,EAAKF,kBAClE,EAAKA,iBAAiBC,QAAQyB,eAC9B,EAAK1B,iBAAiBC,QAAQ0B,gBAC9B,EAAKnB,YAAc,KACnB,EAAKC,eAEL,EAAKtB,oBAAoByC,UAAU,CAClCN,QAAS,2B,2BA5EJ,M","file":"application/contact-send-message.bundle.js","sourcesContent":["import './contact-send-message/contact-send-message.module';\n","import angular from 'angular';\nimport vcRecaptcha from 'angular-recaptcha';\n\nimport messagingService from '../messaging/messaging.module';\nimport captchaService from '../captcha/captcha.module'\nimport { ContactSendMessageComponent } from './contact-send-message.component';\n\nconst MODULE_NAME = 'contactSendMessage';\n\nexport default angular.module(MODULE_NAME, [messagingService, vcRecaptcha, captchaService]).component('contactSendMessage', ContactSendMessageComponent).name;\n","export const ContactSendMessageComponent = {\n\tbindings: {\n\t\tonMessage: '&'\n\t},\n\ttemplateUrl: 'contact-message-button.html',\n\tcontroller: class ContactSendMessageComponent {\n\t\tconstructor($mdDialog, CommonConstants, $timeout, messagingService, $rootScope, notificationService, captchaService) {\n\t\t\t'ngInject';\n\t\t\tthis.$mdDialog = $mdDialog;\n\t\t\tthis.messagingService = messagingService;\n\t\t\tthis.$timeout = $timeout;\n\t\t\tthis.emailRegex = /^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/;\n\t\t\tthis.numberRegex = /^\\d+$/;\n\t\t\tthis.model = {};\n\t\t\tthis.showRecaptcha = true;\n\t\t\tthis.CommonConstants = CommonConstants;\n\t\t\tthis.$rootScope = $rootScope;\n\t\t\tthis.$rootScope.globalNotification = {};\n\t\t\tthis.notificationService = notificationService;\n\t\t\tthis.captchaService = captchaService;\n\t\t}\n\n\t\t$onChanges(changes) {\n\t\t\tif (changes.formError && !changes.formError.isFirstChange()) {\n\t\t\t\tthis.backendError = angular.copy(this.formError);\n\t\t\t\tif (this.backendError == 'success') {\n\t\t\t\t\tthis.$mdDialog.cancel();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tresetCaptchaError() {\n\t\t\tthis.agentMessageForm.captcha.$setValidity('invalid', true, this.agentMessageForm)\n\t\t}\n\t\topenMessageForm() {\n\t\t\tconst vm = this;\n\t\t\tthis.$mdDialog.show({\n\t\t\t\ttemplateUrl: 'general-message-form.html',\n\t\t\t\tclickOutsideToClose: true,\n\t\t\t\tcontroller: () => this,\n\t\t\t\tcontrollerAs: '$ctrl',\n\t\t\t\tonComplete() {\n\t\t\t\t\tvm.captchaText = null;\n\t\t\t\t\tvm.initCaptcha();\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t\tcloseMessageForm() {\n\t\t\tthis.model = {};\n\t\t\tthis.$mdDialog.hide();\n\t\t\tthis.$rootScope.globalNotification = {};\n\t\t}\n\n\t\tinitCaptcha() {\n\t\t\tthis.captchaService.getCaptcha().then(\n\t\t\t\tresponse => {\n\t\t\t\t\tthis.captchaId = response.data.captchaId;\n\t\t\t\t\tthis.captchaImg = response.data.htmlFragment;\n\t\t\t\t},\n\t\t\t\terror => {\n\t\t\t\t\twindow.ipEventBus.publish('show-error', {\n\t\t\t\t\t\tmessage: 'technicalError'\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t);\n\t\t}\n\n\t\tsend() {\n\t\t\tthis.messagingService.sendGeneralMessage(this.model, {captchaId: this.captchaId, captchaText: this.captchaText}).then((response) => {\n\t\t\t\tthis.$rootScope.globalNotification = {\n\t\t\t\t\tmessage: 'successShareNotification'\n\t\t\t\t};\n\t\t\t}).catch((error) => {\n\t\t\t\tif (error.status == 400 && error.data?.error == 'captcha') {\n\t\t\t\t\tthis.agentMessageForm.captcha.$setValidity('invalid', false, this.agentMessageForm)\n\t\t\t\t\tthis.agentMessageForm.captcha.$setPristine();\n\t\t\t\t\tthis.agentMessageForm.captcha.$setUntouched();\n\t\t\t\t\tthis.captchaText = null;\n\t\t\t\t\tthis.initCaptcha();\n\t\t\t\t} else {\n\t\t\t\t\tthis.notificationService.showError({\n\t\t\t\t\t\tmessage: 'technicalError'\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\n\t}\n};\n"],"sourceRoot":""}