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AAA,EAH3CC,EAAAA,EAAAA,IAAU,CACPC,KAAM,6BAEWlB,G,UCT6d,I,wBCQ9emB,GAAY,OACd,EACArC,EACAiB,GACA,EACA,KACA,KACA,MAIF,QAAeoB,EAAiB,O,kBChBhC,IAAIC,EAAU,EAAQ,OACnBA,EAAQC,aAAYD,EAAUA,EAAQE,SACnB,kBAAZF,IAAsBA,EAAU,CAAC,CAAC9D,EAAOC,GAAI6D,EAAS,MAC7DA,EAAQG,SAAQjE,EAAOkE,QAAUJ,EAAQG,QAE5C,IAAIE,EAAM,WACGA,EAAI,WAAYL,GAAS,EAAM,CAAC,WAAY,EAAM,YAAa,G","sources":["webpack://website-js/./src/components/customer-profile/TeknidanCustomerProfileSelector.vue?9adb","webpack://website-js/./src/models/Customer.ts","webpack://website-js/./src/services/CustomerService.ts","webpack://website-js/./src/components/customer-profile/TeknidanCustomerProfileSelector.vue","webpack://website-js/./src/components/customer-profile/TeknidanCustomerProfileSelector.vue?3ea6","webpack://website-js/./src/components/customer-profile/TeknidanCustomerProfileSelector.vue?468f","webpack://website-js/./src/components/customer-profile/TeknidanCustomerProfileSelector.vue?93ab","webpack://website-js/./src/components/customer-profile/TeknidanCustomerProfileSelector.vue?60a0"],"sourcesContent":["// Imports\nimport ___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___ from \"../../../node_modules/@vue/cli-service/node_modules/css-loader/dist/runtime/noSourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../../../node_modules/@vue/cli-service/node_modules/css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_NO_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, `.teknidan-customer-profile-selector{padding:5px;width:-moz-fit-content;width:fit-content;display:flex;flex-direction:row;color:#fff}.teknidan-customer-profile-selector-toggle{border:none;height:30px;margin:0}.teknidan-customer-profile-selector p{padding:5px;margin:auto}.teknidan-customer-profile-selector .selected{background-color:#fbb03b;border-radius:5px}.teknidan-customer-profile-selector .select{cursor:pointer}`, \"\"]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","export interface Customer {\r\n id: string;\r\n name: string;\r\n}\r\n\r\nexport enum CustomerProfile {\r\n UNSET,\r\n B2C,\r\n B2B,\r\n}\r\n","import axios, { AxiosResponse } from 'axios';\r\nimport { Customer, CustomerProfile } from '@/models/Customer';\r\n\r\nexport default class CustomerService {\r\n\r\n private profileId: string = (window as any).CbxApiContextKey;\r\n private endpoint: string;\r\n\r\n constructor(args: any = {}) {\r\n if (args.profileId)\r\n this.profileId = args.profileId;\r\n this.endpoint = `/contextapi/${this.profileId}/v1/customer`;\r\n }\r\n\r\n public async getCustomer(): Promise {\r\n try {\r\n const res: AxiosResponse = await axios.get(`${this.endpoint}`);\r\n return res.data;\r\n } catch (e) {\r\n console.log(e);\r\n }\r\n }\r\n\r\n public async search(query: string, limit: number = 15, offset: number = 0): Promise {\r\n try {\r\n const res: AxiosResponse = await axios.get(`${this.endpoint}/search/?query=${query}&limit=${limit}&offset=${offset}`);\r\n return res.data;\r\n } catch (e) {\r\n console.log(e);\r\n }\r\n } \r\n\r\n public async changeCustomer(selectedcustomer: string): Promise {\r\n try {\r\n const res: AxiosResponse = await axios.post(`${this.endpoint}/change/?selectedcustomer=${selectedcustomer}`);\r\n return res.data;\r\n } catch (e) {\r\n console.log(e);\r\n }\r\n } \r\n\r\n public async hasMinimumAmount(): Promise {\r\n try {\r\n const res: AxiosResponse = await axios.get(`${this.endpoint}/hasmimimumamount`);\r\n return res.data;\r\n } catch (e) {\r\n console.log(e);\r\n }\r\n }\r\n \r\n public async changeCustomerProfile(customerprofile: CustomerProfile): Promise {\r\n try {\r\n const res: AxiosResponse = await axios.get(`${this.endpoint}/changeprofile/?customerprofile=${customerprofile}`);\r\n return res.data;\r\n } catch (e) {\r\n console.log(e);\r\n }\r\n }\r\n}\r\n","var render = function render(){var _vm=this,_c=_vm._self._c,_setup=_vm._self._setupProxy;return (_vm.translationsReady)?_c('div',{staticClass:\"teknidan-customer-profile-selector\"},[_c('div',{staticClass:\"teknidan-customer-profile-selector-toggle\",class:{'selected': _vm.isCustomerB2C, 'select': _vm.isCustomerB2B},on:{\"click\":function($event){return _vm.toggleCustomerProfile(1)}}},[_c('p',[_vm._v(\" \"+_vm._s(_vm.$t(\"customer-profile.b2c\", [\"Private\"]))+\" \")])]),_c('div',{staticClass:\"teknidan-customer-profile-selector-toggle\",class:{'selected': _vm.isCustomerB2B, 'select': _vm.isCustomerB2C},on:{\"click\":function($event){return _vm.toggleCustomerProfile(2)}}},[_c('p',[_vm._v(\" \"+_vm._s(_vm.$t(\"customer-profile.b2b\", [\"Business\"]))+\" \")])])]):_vm._e()\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\r\nimport { CbxVariablesModule } from '@/store/modules/CbxVariablesModule';\r\nimport { Component, Prop, Vue } from 'vue-property-decorator';\r\nimport CustomerService from '../../services/CustomerService';\r\nimport { CustomerProfile } from '../../models/Customer';\r\n\r\n@Component({\r\n name: 'CustomerProfileSelector',\r\n})\r\nexport default class CustomerProfileSelector extends Vue {\r\n private cs: CustomerService = new CustomerService();\r\n\r\n get translationsReady(): boolean {\r\n return this.$root.$data.translationsLoaded === true;\r\n }\r\n\r\n get selectedCustomerProfile(): CustomerProfile {\r\n return CbxVariablesModule.VARIABLES.customerProfile;\r\n }\r\n\r\n get isCustomerB2B(): boolean {\r\n return this.selectedCustomerProfile == CustomerProfile.B2B;\r\n }\r\n\r\n get isCustomerB2C(): boolean {\r\n return (\r\n this.selectedCustomerProfile == CustomerProfile.B2C || this.selectedCustomerProfile == CustomerProfile.UNSET\r\n );\r\n }\r\n\r\n private async toggleCustomerProfile(customerProfile: CustomerProfile) {\r\n if (this.selectedCustomerProfile != customerProfile) {\r\n await this.cs.changeCustomerProfile(customerProfile);\r\n window.location.reload();\r\n }\r\n }\r\n}\r\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!./TeknidanCustomerProfileSelector.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!./TeknidanCustomerProfileSelector.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./TeknidanCustomerProfileSelector.vue?vue&type=template&id=3b191daa&\"\nimport script from \"./TeknidanCustomerProfileSelector.vue?vue&type=script&lang=ts&\"\nexport * from \"./TeknidanCustomerProfileSelector.vue?vue&type=script&lang=ts&\"\nimport style0 from \"./TeknidanCustomerProfileSelector.vue?vue&type=style&index=0&id=3b191daa&prod&lang=scss&\"\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","// style-loader: Adds some css to the DOM by adding a