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AAAA,EAAAA,IAAA,EAH3CK,EAAAA,EAAAA,IAAU,CACPC,KAAM,6BAEWnB,G,UCTqd,I,eCOteoB,GAAY,OACd,EACArC,EACAgB,GACA,EACA,KACA,KACA,MAIF,QAAeqB,EAAiB,O","sources":["webpack://website-js/./src/models/Customer.ts","webpack://website-js/./src/services/CustomerService.ts","webpack://website-js/./src/components/customer-profile/CustomerProfileSelector.vue","webpack://website-js/./src/components/customer-profile/CustomerProfileSelector.vue?d6bd","webpack://website-js/./src/components/customer-profile/CustomerProfileSelector.vue?51e5","webpack://website-js/./src/components/customer-profile/CustomerProfileSelector.vue?c17c"],"sourcesContent":["export interface Customer {\n id: string;\n name: string;\n}\n\nexport enum CustomerProfile {\n UNSET,\n B2C,\n B2B,\n}\n\nexport interface AssociatedMember {\n email: string;\n name: string;\n}","import axios, { AxiosResponse } from 'axios';\nimport { AssociatedMember, Customer, CustomerProfile } from '@/models/Customer';\n\nexport default class CustomerService {\n\n private profileId: string = (window as any).CbxApiContextKey;\n private endpoint: string;\n\n constructor(args: any = {}) {\n if (args.profileId)\n this.profileId = args.profileId;\n this.endpoint = `/contextapi/${this.profileId}/v1/customer`;\n }\n\n public async getCustomer(): Promise<Customer> {\n try {\n const res: AxiosResponse<any> = await axios.get(`${this.endpoint}`);\n return res.data;\n } catch (e) {\n console.log(e);\n }\n }\n\n public async search(query: string, limit: number = 15, offset: number = 0): Promise<Customer[]> {\n try {\n const res: AxiosResponse<any> = await axios.get(`${this.endpoint}/search/?query=${query}&limit=${limit}&offset=${offset}`);\n return res.data;\n } catch (e) {\n console.log(e);\n }\n } \n\n public async changeCustomer(selectedcustomer: string): Promise<Customer> {\n try {\n const res: AxiosResponse<any> = await axios.post(`${this.endpoint}/change/?selectedcustomer=${selectedcustomer}`);\n return res.data;\n } catch (e) {\n console.log(e);\n }\n } \n\n public async changeCustomerProfile(customerprofile: CustomerProfile): Promise<any> {\n try {\n const res: AxiosResponse<any> = await axios.get(`${this.endpoint}/changeprofile/?customerprofile=${customerprofile}`);\n return res.data;\n } catch (e) {\n console.log(e);\n }\n }\n\n public async getAssociatedMembers(customerid: string): Promise<AssociatedMember[]> {\n try {\n const res: AxiosResponse<any> = await axios.get(`${this.endpoint}/getmembersbyid/?customerid=${customerid}`);\n return res.data;\n } catch (e) {\n console.log(e);\n }\n }\n}\n","var render = function render(){var _vm=this,_c=_vm._self._c,_setup=_vm._self._setupProxy;return _c('div',{staticClass:\"customer-profile-selector uk-button-group uk-preserve\"},[_c('button',{staticClass:\"uk-button\",class:{ 'uk-button-primary': _vm.isCustomerB2C, 'uk-button-default': _vm.isCustomerB2B },on:{\"click\":function($event){return _vm.toggleCustomerProfile(1)}}},[_vm._v(\" \"+_vm._s(_vm.b2cText)+\" \")]),_c('button',{staticClass:\"uk-button\",class:{ 'uk-button-primary': _vm.isCustomerB2B, 'uk-button-default': _vm.isCustomerB2C },on:{\"click\":function($event){return _vm.toggleCustomerProfile(2)}}},[_vm._v(\" \"+_vm._s(_vm.b2bText)+\" \")])])\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\nimport { CbxVariablesModule } from '@/store/modules/CbxVariablesModule';\nimport { Component, Prop, Vue } from 'vue-property-decorator';\nimport CustomerService from '../../services/CustomerService';\nimport { CustomerProfile } from '../../models/Customer';\n\n@Component({\n name: 'CustomerProfileSelector',\n})\nexport default class CustomerProfileSelector extends Vue {\n @Prop({ type: String, required: true }) private b2bText: string;\n @Prop({ type: String, required: true }) private b2cText: string;\n\n private cs: CustomerService = new CustomerService();\n\n get selectedCustomerProfile(): CustomerProfile {\n return CbxVariablesModule.VARIABLES.customerProfile;\n }\n\n get isCustomerB2B(): boolean {\n return this.selectedCustomerProfile == CustomerProfile.B2B;\n }\n\n get isCustomerB2C(): boolean {\n return (\n this.selectedCustomerProfile == CustomerProfile.B2C || this.selectedCustomerProfile == CustomerProfile.UNSET\n );\n }\n\n private async toggleCustomerProfile(customerProfile: CustomerProfile) {\n if (this.selectedCustomerProfile != customerProfile) {\n await this.cs.changeCustomerProfile(customerProfile);\n window.location.reload();\n }\n }\n}\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??clonedRuleSet-41.use[0]!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??clonedRuleSet-41.use[3]!../../../node_modules/cache-loader/dist/cjs.js??ruleSet[0].use[0]!../../../node_modules/@vue/cli-service/lib/config/vue-loader-v15-resolve-compat/vue-loader.js??vue-loader-options!./CustomerProfileSelector.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??clonedRuleSet-41.use[0]!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??clonedRuleSet-41.use[3]!../../../node_modules/cache-loader/dist/cjs.js??ruleSet[0].use[0]!../../../node_modules/@vue/cli-service/lib/config/vue-loader-v15-resolve-compat/vue-loader.js??vue-loader-options!./CustomerProfileSelector.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./CustomerProfileSelector.vue?vue&type=template&id=47e15845&\"\nimport script from \"./CustomerProfileSelector.vue?vue&type=script&lang=ts&\"\nexport * from \"./CustomerProfileSelector.vue?vue&type=script&lang=ts&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../node_modules/@vue/cli-service/node_modules/@vue/vue-loader-v15/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"],"names":["CustomerProfile","CustomerService","constructor","args","_defineProperty","window","CbxApiContextKey","profileId","this","endpoint","async","res","axios","data","e","console","log","query","limit","offset","selectedcustomer","customerprofile","customerid","render","_vm","_c","_self","_setupProxy","staticClass","class","isCustomerB2C","isCustomerB2B","on","$event","toggleCustomerProfile","_v","_s","b2cText","b2bText","staticRenderFns","CustomerProfileSelector","Vue","selectedCustomerProfile","CbxVariablesModule","VARIABLES","customerProfile","B2B","B2C","UNSET","cs","changeCustomerProfile","location","reload","__decorate","Prop","type","String","required","Component","name","component"],"sourceRoot":""}