{"version":3,"sources":["webpack:///./src/views/customer/PreCustomerDashboard.vue?e31c","webpack:///./src/views/customer/PreCustomerDashboard.vue","webpack:///./src/views/customer/PreCustomerDashboard.vue?0d6e","webpack:///./src/views/customer/PreCustomerDashboard.vue?5ae4"],"names":["render","_vm","this","_h","$createElement","_c","_self","ref","attrs","$t","on","closeModal","scopedSlots","_u","key","fn","staticClass","_v","_s","associateMedia","proxy","staticRenderFns","$store","getters","GetMediaStatusToAssociate","media","customerId","mediaStatus","$router","push","name","Customer","hasCustomer","showModal","$spinner","showSpinner","$bvModal","hide","associateMediaCustomer","hash","then","dispatch","SetMediaStatusToAssociate","GetMedias","medias","length","GetMerchantConfig","GetMerchantId","finally","removeSpinner","show","goToCustomer","components","CustomerDashboard","Footer","Header","HeaderBackground","component"],"mappings":"uHAAA,IAAIA,EAAS,WAAa,IAAIC,EAAIC,KAASC,EAAGF,EAAIG,eAAmBC,EAAGJ,EAAIK,MAAMD,IAAIF,EAAG,OAAOE,EAAG,MAAM,CAACA,EAAG,wBAAwBA,EAAG,aAAaA,EAAG,yBAAyBA,EAAG,aAAaA,EAAG,UAAU,CAACE,IAAI,WAAWC,MAAM,CAAC,GAAK,UAAU,SAAW,GAAG,uBAAuB,GAAG,kBAAkB,GAAG,MAAQP,EAAIQ,GAAG,8BAA8BC,GAAG,CAAC,MAAQT,EAAIU,YAAYC,YAAYX,EAAIY,GAAG,CAAC,CAACC,IAAI,eAAeC,GAAG,WAAW,MAAO,CAACV,EAAG,SAAS,CAACW,YAAY,mCAAmCR,MAAM,CAAC,KAAO,UAAUE,GAAG,CAAC,MAAQT,EAAIU,aAAa,CAACV,EAAIgB,GAAG,IAAIhB,EAAIiB,GAAGjB,EAAIQ,GAAG,UAAU,OAAOJ,EAAG,SAAS,CAACW,YAAY,iCAAiCR,MAAM,CAAC,KAAO,UAAUE,GAAG,CAAC,MAAQT,EAAIkB,iBAAiB,CAAClB,EAAIgB,GAAG,IAAIhB,EAAIiB,GAAGjB,EAAIQ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ACzB,YAAaC,EAAA,KACb,YAAaC,EAAA,KACb,uBAAwBC,EAAA,SAGP,WCxD4Y,I,YCO7ZC,EAAY,eACd,EACAzD,EACAqB,GACA,EACA,KACA,KACA,MAIa,aAAAoC,E","file":"js/chunk-2d20e786.e3297c5e.js","sourcesContent":["var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('div',[_c('ck-header-background'),_c('ck-header'),_c('ck-customer-dashboard'),_c('ck-footer'),_c('b-modal',{ref:\"modal-qr\",attrs:{\"id\":\"modalQr\",\"centered\":\"\",\"no-close-on-backdrop\":\"\",\"no-close-on-esc\":\"\",\"title\":_vm.$t('dashboard.delete-question')},on:{\"close\":_vm.closeModal},scopedSlots:_vm._u([{key:\"modal-footer\",fn:function(){return [_c('button',{staticClass:\"btn btn-secondary text-uppercase\",attrs:{\"type\":\"button\"},on:{\"click\":_vm.closeModal}},[_vm._v(\" \"+_vm._s(_vm.$t('close'))+\" \")]),_c('button',{staticClass:\"btn btn-success text-uppercase\",attrs:{\"type\":\"button\"},on:{\"click\":_vm.associateMedia}},[_vm._v(\" \"+_vm._s(_vm.$t('confirm'))+\" \")])]},proxy:true}])},[_c('p',[_vm._v(_vm._s(_vm.$t('dashboard.delete-key-description')))])])],1)}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nimport { MediaStatus } from '@/models/medias/mediaStatus';\nimport { Routes } from '@/router/routes';\nimport { mediaService } from '@/services/medias/media.service';\nimport { MediasActions, MediasGetters } from '@/store/modules/medias/enums';\nimport { MerchantConfigActions } from '@/store/modules/merchant-config/enums';\nimport { Component, Vue } from 'vue-property-decorator';\nimport CustomerDashboard from '@/views/customer/CustomerDashboard.vue';\nimport Footer from '@/components/layout/Footer.vue';\nimport Header from '@/components/layout/Header.vue';\nimport HeaderBackground from '@/components/layout/HeaderBackground.vue';\n\n@Component({\n components: {\n 'ck-customer-dashboard': CustomerDashboard,\n 'ck-footer': Footer,\n 'ck-header': Header,\n 'ck-header-background': HeaderBackground,\n },\n})\nexport default class PreCustomerDashboard extends Vue {\n public get mediaStatus(): MediaStatus {\n return this.$store.getters[\n MediasGetters.GetMediaStatusToAssociate\n ] as MediaStatus;\n }\n\n public get hasCustomer(): boolean {\n const media = this.$store.getters[\n MediasGetters.GetMediaStatusToAssociate\n ] as MediaStatus;\n if (media == null) {\n return false;\n }\n return !!media.customerId;\n }\n\n public async mounted(): Promise {\n if (!this.mediaStatus) {\n this.$router.push({ name: Routes.Customer });\n }\n if (this.hasCustomer) {\n this.showModal();\n } else {\n await this.associateMedia();\n }\n }\n\n public async associateMedia(): Promise {\n this.$spinner.showSpinner();\n this.$bvModal.hide('modalQr');\n mediaService\n .associateMediaCustomer(this.mediaStatus.hash)\n .then(() => {\n this.$store.dispatch(MediasActions.SetMediaStatusToAssociate, null);\n this.$store.dispatch(MediasActions.GetMedias, true).then((medias) => {\n if (medias.length > 0) {\n this.$store.dispatch(\n MerchantConfigActions.GetMerchantConfig,\n this.$store.getters[MediasGetters.GetMerchantId],\n );\n }\n this.$router.push({ name: Routes.Customer });\n });\n })\n .finally(() => {\n this.$spinner.removeSpinner();\n });\n }\n\n public showModal(): void {\n //const modal = this.$refs['modal-qr'] as any;\n //modal.show();\n this.$bvModal.show('modalQr');\n }\n\n public async closeModal(): Promise {\n //const modal = this.$refs['modal-qr'] as any;\n //modal.hide();\n this.$store.dispatch(MediasActions.SetMediaStatusToAssociate, null);\n this.$bvModal.hide('modalQr');\n await this.goToCustomer();\n }\n\n public async goToCustomer(): Promise {\n this.$store.dispatch(MediasActions.SetMediaStatusToAssociate, null);\n this.$router.push({ name: Routes.Customer });\n }\n}\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--14-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./PreCustomerDashboard.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--14-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--14-3!../../../node_modules/cache-loader/dist/cjs.js??ref--0-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./PreCustomerDashboard.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./PreCustomerDashboard.vue?vue&type=template&id=4a8aa072&\"\nimport script from \"./PreCustomerDashboard.vue?vue&type=script&lang=ts&\"\nexport * from \"./PreCustomerDashboard.vue?vue&type=script&lang=ts&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports"],"sourceRoot":""}