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,oBACnDlB,OAAO6C,iBAAiB,OAAQzC,KAAKL,wBACvC,GAzEA,IAAC,IAAA+C,Q,2DACD,IAAC,IAAAA,Q,oDACD,IAAC,IAAAA,Q,qDACD,IAAC,IAAAA,Q,kDACD,IAAC,IAAAA,Q,0DACD,IAAC,IAAAA,Q,wDACD,IAAC,IAAAA,MAAK,CAACC,SAAS,I,kEAXH,MAJd,IAAAC,WAAU,CACTC,KAAM,+BACNC,YAAY,eAAmBC,mB,sMCYjC,SAXgB,E,QAAA,GACd,UACA,IACA,KACA,EACA,KACA,KACA,MAI8B,O,iJClB+M,QAAe,G,uDCA9P,IAAIC,EAAS,SAASA,SAAS,IAAIC,EAAIjD,KAAKkD,EAAGD,EAAIE,MAAMD,GAAUD,EAAIE,MAAMC,YAAY,OAAOF,EAAG,MAAM,CAAED,EAAa,UAAEA,EAAII,GAAG,UAAUJ,EAAIK,KAAKL,EAAIM,GAAG,KAAMN,EAAmB,gBAAEC,EAAG,MAAM,CAACA,EAAG,uBAAuB,CAACM,MAAM,CAAC,cAAcP,EAAIpB,eAAe,GAAGoB,EAAIK,MAAM,EAChR,EACIG,EAAkB,E","sources":["webpack:///./vendor/happy-horizon/tweakwise-guided-selling/resources/resources/assets/js/components/GuidedSellingCategoryView.vue?2f12","webpack:///./vendor/happy-horizon/tweakwise-guided-selling/resources/resources/assets/js/components/GuidedSellingCategoryView.vue","webpack:///./vendor/happy-horizon/tweakwise-guided-selling/resources/resources/assets/js/components/GuidedSellingCategoryView.vue?8a46","webpack:///./vendor/happy-horizon/tweakwise-guided-selling/resources/resources/assets/js/components/GuidedSellingCategoryView.vue?9523"],"sourcesContent":["\nimport {Component, Vue, Prop} from 'vue-property-decorator';\nimport ServiceContainer from '@flashpointbv/solar-service-container';\n\n@Component({\n name: 'guided-selling-category-view',\n components: ServiceContainer().getComponents(),\n})\nexport default class extends Vue {\n catalogIsActive: boolean = false;\n categoryId: number | null;\n isLoading: boolean = false;\n\n @Prop() readonly instanceKey: string;\n @Prop() readonly code: string;\n @Prop() readonly theme: object;\n @Prop() readonly ui: object;\n @Prop() readonly dataSource: string;\n @Prop() readonly language: string;\n @Prop({default: false}) readonly redirectsOnResult: boolean;\n\n private initializeGuidedSelling(): void {\n window.tweakwiseGuidedSelling({\n output: '#tweakwise-guided-selling',\n instancekey: this.instanceKey,\n code: this.code,\n lang: this.language,\n theme: this.theme,\n ui: this.ui,\n results: {\n handle(event) {\n const results = event.data;\n\n window.dispatchEvent(new CustomEvent('enableSolarCatalog', {detail: results['navigationurl']}));\n }\n }\n });\n }\n\n private async enableSolarCatalog(event): Promise {\n this.isLoading = true;\n const body = event.detail;\n\n if (this.redirectsOnResult) {\n const redirectResponse = await this.$solarClient.post(\n `/api/tweakwise/guided-selling/redirect`,\n body\n );\n\n if(redirectResponse.data.url) {\n window.location.href = redirectResponse.data.url;\n return;\n }\n }\n\n const parameterResponse = await this.$solarClient.post(\n `/api/tweakwise/guided-selling/parameters`,\n body\n );\n const parameters = parameterResponse.data;\n\n this.categoryId = parameters.category;\n const apiUrl = `/api/catalog/category/${this.categoryId}/product/list`;\n\n this.$store.commit(`${this.dataSource}/SET_CATEGORY_ID`, this.categoryId);\n this.$solarClient.get(\n apiUrl, {\n params: parameters.filters,\n }).then(({data}) => {\n this.$store.commit(`${this.dataSource}/SET_API_RESPONSE`, data);\n }).finally(() => {\n this.isLoading = false;\n this.catalogIsActive = true;\n\n let content = document.getElementById('solar-guided-selling-content');\n if (content) {\n content.style.display = 'block';\n }\n\n document.getElementById('tweakwise-guided-selling-content').style.display = 'none';\n });\n }\n\n private mounted(): void {\n window.addEventListener('enableSolarCatalog', this.enableSolarCatalog);\n window.addEventListener(\"load\", this.initializeGuidedSelling);\n }\n}\n","import { render, staticRenderFns } from \"./GuidedSellingCategoryView.vue?vue&type=template&id=bb23c8ac&\"\nimport script from \"./GuidedSellingCategoryView.vue?vue&type=script&lang=ts&\"\nexport * from \"./GuidedSellingCategoryView.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","import mod from \"-!../../../../../../../../node_modules/ts-loader/index.js??clonedRuleSet-6.use[0]!../../../../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./GuidedSellingCategoryView.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../../../../../../node_modules/ts-loader/index.js??clonedRuleSet-6.use[0]!../../../../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./GuidedSellingCategoryView.vue?vue&type=script&lang=ts&\"","var render = function render(){var _vm=this,_c=_vm._self._c,_setup=_vm._self._setupProxy;return _c('div',[(_vm.isLoading)?_vm._t(\"loader\"):_vm._e(),_vm._v(\" \"),(_vm.catalogIsActive)?_c('div',[_c('catalog-product-list',{attrs:{\"data-source\":_vm.dataSource}})],1):_vm._e()],2)\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }"],"names":["Vue","catalogIsActive","isLoading","initializeGuidedSelling","window","tweakwiseGuidedSelling","output","instancekey","this","instanceKey","code","lang","language","theme","ui","results","handle","event","data","dispatchEvent","CustomEvent","detail","enableSolarCatalog","body","redirectsOnResult","redirectResponse","$solarClient","post","url","location","href","parameters","categoryId","category","apiUrl","$store","commit","dataSource","get","params","filters","then","finally","content","document","getElementById","style","display","mounted","addEventListener","Prop","default","Component","name","components","getComponents","render","_vm","_c","_self","_setupProxy","_t","_e","_v","attrs","staticRenderFns"],"sourceRoot":""}