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,OAAO,CAAC5B,EAAIM,GAAGN,EAAI6B,GAAG7B,EAAI8B,GAAG,0BAA0B9B,EAAIM,GAAG,KAAKN,EAAI+B,GAAI/B,EAAa,WAAE,SAASvB,GAAO,OAAOwB,EAAG,SAAS,CAAC2B,SAAS,CAAC,MAAQnD,EAAU,KAAI,CAACuB,EAAIM,GAAGN,EAAI6B,GAAGpD,EAAY,QAAK,KAAI,GAAGuB,EAAIM,GAAG,KAAKL,EAAG,SAAS,CAACG,YAAY,WAAWY,MAAM,CAAC,SAAWhB,EAAItC,YAAesC,EAAIxC,kBAAqBwC,EAAIvC,kBAAkB,CAACuC,EAAIM,GAAGN,EAAI6B,GAAG7B,EAAI8B,GAAG,iBAC9hE,EACIE,EAAkB,E","sources":["webpack:///./resources/area/web/default/js/components/page-builder/StoreLocator.vue?9e07","webpack:///./resources/area/web/default/js/components/page-builder/StoreLocator.vue","webpack:///./resources/area/web/default/js/components/page-builder/StoreLocator.vue?0f16","webpack:///./resources/area/web/default/js/components/page-builder/StoreLocator.vue?eb38"],"sourcesContent":["\nimport {Component, Prop, Vue} from 'vue-property-decorator';\n\n@Component({\n name: 'page-builder-store-locator',\n})\n\nexport default class extends Vue {\n @Prop({default: () => []}) private args!: Array;\n @Prop({default: null}) private route!: string;\n\n private brandList: Array = [];\n private countryList: Array = [];\n\n private selectedBrandId: null | number = null;\n private selectedCountry: null | string = null;\n\n private isLoading: boolean = false;\n\n private get locale(): string {\n return window.Locale;\n }\n\n private async getBrandList(): Promise {\n try {\n this.isLoading = true;\n const {data} = await this.$solarClient.get(`api/physical-store/fetch/brands-by-country?country=${this.selectedCountry}`, {\n timeout: 30000,\n });\n this.brandList = data;\n\n const selectedCountryObject = this.countryList.find((country: object) => country['code'] === this.selectedCountry);\n if (selectedCountryObject) {\n this.$eventBus.$emit('country-selected', selectedCountryObject['name']);\n }\n\n //Check if current brand is in the list\n if (this.selectedBrandId && ! this.brandList.find((brand: any) => brand['id'] === this.selectedBrandId)) {\n this.selectedBrandId = null;\n }\n } catch (error) {\n console.error(error);\n } finally {\n this.isLoading = false;\n }\n }\n\n private async getCountryList(): Promise {\n try {\n this.isLoading = true;\n const {data} = await this.$solarClient.get(`api/physical-store/fetch/countries?locale=${this.locale}`);\n this.countryList = data;\n } catch (error) {\n console.error(error);\n } finally {\n this.isLoading = false;\n this.selectedBrandId = null;\n }\n }\n\n private get sluggedBrandName(): string {\n return this.selectedBrandId\n ? this.brandList.find((brand: any) => brand['id'] === this.selectedBrandId)['name'].replace(/\\s+/g, '-').toLowerCase()\n : '';\n }\n\n private submitForm(): void {\n const url = this.route || window.location.href;\n\n this.isLoading = true;\n\n window.location.href = `${url}/${this.selectedCountry.toLowerCase()}/${this.sluggedBrandName}`;\n }\n\n private async created(): Promise {\n await this.getCountryList().then(() => {\n if (this.args.length > 0) {\n this.selectedCountry = this.args[0] ? this.args[0].toUpperCase() : null;\n\n const selectedCountryObject = this.countryList.find((country: object) => country['code'] === this.selectedCountry);\n if (selectedCountryObject) {\n this.$eventBus.$emit('country-selected', selectedCountryObject['name']);\n }\n\n this.getBrandList().then(() => {\n this.selectedBrandId = this.brandList.find((brand: object) => brand['name'].replace(/\\s+/g, '-').toLowerCase() === this.args[1])['id'];\n });\n }\n });\n }\n}\n","import { render, staticRenderFns } from \"./StoreLocator.vue?vue&type=template&id=1ce439a1&\"\nimport script from \"./StoreLocator.vue?vue&type=script&lang=ts&\"\nexport * from \"./StoreLocator.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-26.use[0]!../../../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./StoreLocator.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../../../../../node_modules/ts-loader/index.js??clonedRuleSet-26.use[0]!../../../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./StoreLocator.vue?vue&type=script&lang=ts&\"","var render = function render(){var _vm=this,_c=_vm._self._c,_setup=_vm._self._setupProxy;return _c('div',{staticClass:\"store-locator__container\"},[(_vm.isLoading)?_c('div',{staticClass:\"--loading\"},[_c('span')]):_vm._e(),_vm._v(\" \"),_c('h4',[_vm._t(\"title\")],2),_vm._v(\" \"),_c('form',{on:{\"submit\":function($event){$event.preventDefault();$event.stopPropagation();return _vm.submitForm()}}},[_c('select',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.selectedCountry),expression:\"selectedCountry\"}],attrs:{\"name\":\"country\",\"disabled\":_vm.isLoading || ! _vm.countryList.length},on:{\"change\":[function($event){var $$selectedVal = Array.prototype.filter.call($event.target.options,function(o){return o.selected}).map(function(o){var val = \"_value\" in o ? o._value : o.value;return val}); _vm.selectedCountry=$event.target.multiple ? $$selectedVal : $$selectedVal[0]},function($event){return _vm.getBrandList()}]}},[_c('option',{attrs:{\"disabled\":\"\"},domProps:{\"value\":null}},[_vm._v(_vm._s(_vm.$t('storelocator-country')))]),_vm._v(\" \"),_vm._l((_vm.countryList),function(country){return _c('option',{domProps:{\"value\":country['code']}},[_vm._v(_vm._s(country['name']))])})],2),_vm._v(\" \"),_c('select',{directives:[{name:\"model\",rawName:\"v-model\",value:(_vm.selectedBrandId),expression:\"selectedBrandId\"}],attrs:{\"name\":\"brand\",\"disabled\":_vm.isLoading || ! _vm.brandList.length},on:{\"change\":function($event){var $$selectedVal = Array.prototype.filter.call($event.target.options,function(o){return o.selected}).map(function(o){var val = \"_value\" in o ? o._value : o.value;return val}); _vm.selectedBrandId=$event.target.multiple ? $$selectedVal : $$selectedVal[0]}}},[_c('option',{attrs:{\"disabled\":\"\"},domProps:{\"value\":null}},[_vm._v(_vm._s(_vm.$t('storelocator-brand')))]),_vm._v(\" \"),_vm._l((_vm.brandList),function(brand){return _c('option',{domProps:{\"value\":brand['id']}},[_vm._v(_vm._s(brand['name']))])})],2),_vm._v(\" \"),_c('button',{staticClass:\"--button\",attrs:{\"disabled\":_vm.isLoading || ! _vm.selectedBrandId || ! _vm.selectedCountry}},[_vm._v(_vm._s(_vm.$t('search')))])])])\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }"],"names":["Vue","brandList","countryList","selectedBrandId","selectedCountry","isLoading","locale","window","Locale","getBrandList","this","data","$solarClient","get","timeout","selectedCountryObject","find","country","$eventBus","$emit","brand","error","console","getCountryList","sluggedBrandName","replace","toLowerCase","submitForm","url","route","location","href","created","then","args","length","toUpperCase","Prop","default","Array","Component","name","render","_vm","_c","_self","_setupProxy","staticClass","_e","_v","_t","on","$event","preventDefault","stopPropagation","directives","rawName","value","expression","attrs","$$selectedVal","prototype","filter","call","target","options","o","selected","map","_value","multiple","domProps","_s","$t","_l","staticRenderFns"],"sourceRoot":""}