{"version":3,"sources":["vueAskAQuestionModal.js"],"names":["vueAskAQuestionModal","Vue","name","el","data","showAskAQuestionModal","companyName","email","question","productId","GLOBAL","PRODUCT","ID","response","success","failed","mixins","requestServiceMixin","contactServiceMixin","customValidationMixin","modalsMixin","generalMixin","validations","required","methods","open","this","show","close","askAQuestionModal","hide","reset","vm","$v","$reset","submitAskAQuestion","async","generalError","$touch","$invalid","submitError","askAQuestion","then","content","errors"],"mappings":"aAAA,MAAMA,qBAAuB,IAAIC,IAAI,CACpCC,KAAM,uBADPC,GAAA,wBAGCC,KAFI,CACJD,uBAAI,EACJC,SAAM,CAGJF,KAFDG,GAGCC,YAFS,GAGTC,MAFI,GAGJC,SAFAF,GAGAG,UAFOC,OAAEC,QAAAC,IAIVC,SAFCJ,CAGAK,SAFA,EAGAC,QAFDF,IAKDG,OAFC,CAAAC,oBAAAC,oBAAAC,sBAAAC,YAAAC,cAGDC,YAFC,CACDN,SAASC,CACTK,KAAAA,CACCd,mBAICD,MAFCgB,CAGAA,kBACAhB,aAEDC,SAFCD,CAGAgB,qBAIHC,QAFC,CACDC,KAAC,WACQC,KACRD,oBAAkBE,QAIlBC,MAFIC,WACHH,KACDE,oBAAOE,OADNJ,KAEAK,SAIDA,MAFIA,WAGH,MAFAC,EAAAN,KAIAM,EAFAxB,SAAW,CAGVN,KADEM,GAEFF,YADQ,GAERC,MADAD,GAEAE,SADK,GAELC,UADAD,OAAYG,QAAAC,IAIboB,EAAAA,SAAW,CACVlB,SAAAA,EACAC,QAAAA,GAGDiB,EACAC,GAAAC,UACDC,mBACgBC,iBAAf,MACGH,EAAGC,KAANF,EACAA,GAAGK,SAAHL,EACAA,aAAc,GAAdA,EAEAC,GAAAK,SAAIN,EAGHC,GAAAM,SAFAP,EAGDQ,cAEAR,EAAGS,aAME5B,EAASE,UAAS2B,MAAI,SAAA7B,GAL1B,IAMCA,EAAM,OAIT,OAFEA,EAAAT,KAAAuC,QAEFC,OACDZ,EAAAnB,SAAAE,QAAA,EAJIiB,EAAGnB,SAASC,SAAU","file":"../vueAskAQuestionModal.js","sourcesContent":["const vueAskAQuestionModal = new Vue({\r\n\tname: 'vueAskAQuestionModal',\r\n\tel: '#vueAskAQuestionModal',\r\n\tdata: {\r\n\t\tshowAskAQuestionModal: false,\r\n\t\tquestion: {\r\n\t\t\tname: '',\r\n\t\t\tcompanyName: '',\r\n\t\t\temail: '',\r\n\t\t\tquestion: '',\r\n\t\t\tproductId: GLOBAL.PRODUCT.ID,\r\n\t\t},\r\n\t\tresponse: {\r\n\t\t\tsuccess: false,\r\n\t\t\tfailed: false,\r\n\t\t},\r\n\t},\r\n\tmixins: [requestServiceMixin, contactServiceMixin, customValidationMixin, modalsMixin, generalMixin],\r\n\tvalidations: {\r\n\t\tquestion: {\r\n\t\t\tname: {\r\n\t\t\t\trequired,\r\n\t\t\t},\r\n\t\t\temail: {\r\n\t\t\t\trequired,\r\n\t\t\t\temail,\r\n\t\t\t},\r\n\t\t\tquestion: {\r\n\t\t\t\trequired,\r\n\t\t\t},\r\n\t\t},\r\n\t},\r\n\tmethods: {\r\n\t\topen: function () {\r\n\t\t\tconst vm = this;\r\n\t\t\tvm.askAQuestionModal().show();\r\n\t\t},\r\n\t\tclose: function () {\r\n\t\t\tconst vm = this;\r\n\t\t\tvm.askAQuestionModal().hide();\r\n\t\t\tvm.reset();\r\n\t\t},\r\n\t\treset: function () {\r\n\t\t\tconst vm = this;\r\n\r\n\t\t\tvm.question = {\r\n\t\t\t\tname: '',\r\n\t\t\t\tcompanyName: '',\r\n\t\t\t\temail: '',\r\n\t\t\t\tquestion: '',\r\n\t\t\t\tproductId: GLOBAL.PRODUCT.ID,\r\n\t\t\t};\r\n\r\n\t\t\tvm.response = {\r\n\t\t\t\tsuccess: false,\r\n\t\t\t\tfailed: false,\r\n\t\t\t};\r\n\r\n\t\t\tvm.$v.$reset();\r\n\t\t},\r\n\t\tsubmitAskAQuestion: async function () {\r\n\t\t\tconst vm = this;\r\n\t\t\tvm.$v.$reset();\r\n\t\t\tvm.generalError = '';\r\n\t\t\tvm.$v.$touch();\r\n\r\n\t\t\tif (vm.$v.$invalid) {\r\n\t\t\t\tvm.submitError();\r\n\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\r\n\t\t\tvm.askAQuestion(vm.question).then(function (response) {\r\n\t\t\t\tif (!response) return;\r\n\r\n\t\t\t\tconst content = response.data.content;\r\n\r\n\t\t\t\tif (content.errors !== null) {\r\n\t\t\t\t\tvm.response.failed = true;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tvm.response.success = true;\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t},\r\n\t},\r\n});\r\n"]}