{"version":3,"sources":["webpack:///./src/project/modals/Modal.vue","webpack:///./src/project/modals/Modal.vue?4482","webpack:///./src/project/modals/Modal.vue?1301","webpack:///./src/project/site/SitePickerOverlay.vue?5da7","webpack:///./src/project/site/SitePickerOverlay.vue","webpack:///./src/project/site/SitePickerOverlay.vue?7a89","webpack:///./src/project/site/SitePickerOverlay.vue?ef6d","webpack:///./src/core/messages/WebApiMessage.vue?4cfb","webpack:///./src/core/messages/WebApiMessage.vue","webpack:///./src/core/messages/WebApiMessage.vue?5af9","webpack:///./src/core/messages/WebApiMessage.vue?0b74"],"names":["data","ModalState","hideModal","this","modal","id","type","Object","required","render","staticRenderFns","component","_vm","_h","$createElement","_c","_self","staticClass","_v","_s","$dictionary","get","headerLabel","_l","site","key","attrs","url","languageNameByLanguageCode","languageCode","countryCode","_e","scopedSlots","_u","fn","ref","handleSubmit","on","$event","preventDefault","submit","model","value","callback","$$v","selectedCountryOption","expression","countryOption","countryIndex","domProps","countryLabel","languageCanBeChanged","selectedSite","siteIndex","updatingServer","Modal","basketChangeWarning","uaIsBot","getCountryOptions","newOptions","preFillInSelections","sortedOptions","siteOptions","countries","map","country","push","countryNameByCountryCode","sites","sort","a","b","localeCompare","countryCodeAllowedList","languageCodeDisallowedList","countryOptions","flatMap","filter","includes","toLowerCase","isLoggedIn","preFillInSiteSelection","length","countryCanBeChanged","closeOverlay","siteId","find","be","getCountryCode","s","getSiteId","immediate","components","WebApiMessage","messages","_t","message","ix","getMessage","errorId","deleteMessageAtIndex","bus","onMessages","index","splice","validationErrorEvent","messagesId","handled","msgOrLabel","exists","off"],"mappings":"wJAKA,IAAqB,EAArB,cAAmC,OAI/B,aAAaA,GACTC,EAAA,KAAWC,UAAUC,KAAKC,MAAMC,GAAIL,KAHxC,gBADC,eAAK,CAAEM,KAAMC,OAAQC,UAAU,K,4BADf,EAAK,gBADzB,QACoB,OCLjBC,EAAQC,EDKS,IEL6X,I,YDO9YC,EAAY,eACd,EACAF,EACAC,GACA,EACA,K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AAkBvF,IAAIuF,GAE1BA,EAGX,YACIP,EAAA,KAAIS,IAAI,OAAyB3G,KAAKmG,cA1B1C,gBAHC,eAAK,CACF9F,UAAU,K,yBAJG,EAAa,gBADjC,QACoB,WCzBqY,I,YCOtZG,EAAY,eACd,EACAF,EACAC,GACA,EACA,KACA,KACA,MAIa,OAAAC,E","file":"js/chunk-33021848.f80d11e2.js","sourcesContent":["\r\nimport { Vue, Component, Prop } from 'vue-property-decorator';\r\nimport { IModal, ModalState } from '@/core/modals/ModalState';\r\n\r\n@Component\r\nexport default class Modal extends Vue {\r\n @Prop({ type: Object, required: true })\r\n modal!: IModal;\r\n\r\n closeOverlay(data?: any) {\r\n ModalState.hideModal(this.modal.id, data);\r\n }\r\n}\r\n","var render, staticRenderFns\nimport script from \"./Modal.vue?vue&type=script&lang=ts&\"\nexport * from \"./Modal.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/cache-loader/dist/cjs.js??ref--15-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--15-3!../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Modal.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--15-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--15-3!../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./Modal.vue?vue&type=script&lang=ts&\"","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('article',{staticClass:\"site-picker-overlay relative\"},[_c('h1',{staticClass:\"mb-20\"},[_vm._v(\" \"+_vm._s(_vm.$dictionary.get(_vm.headerLabel))+\" \")]),(_vm.uaIsBot)?_c('ul',_vm._l((_vm.indexableSites),function(site){return _c('li',{key:site.id},[_c('a',{attrs:{\"href\":site.url}},[_vm._v(\" \"+_vm._s(_vm.$dictionary.languageNameByLanguageCode(site.languageCode))+\" (\"+_vm._s(site.countryCode)+\" - \"+_vm._s(site.languageCode)+\") \")])])}),0):_vm._e(),_c('ValidationObserver',{staticClass:\"mt-15\",attrs:{\"tag\":\"div\"},scopedSlots:_vm._u([{key:\"default\",fn:function(ref){\nvar handleSubmit = ref.handleSubmit;\nreturn [_c('form',{staticClass:\"bg-white\",on:{\"submit\":function($event){$event.preventDefault();return handleSubmit(_vm.submit)}}},[(_vm.countryCanBeChanged)?_c('section',[_c('h2',{staticClass:\"text-14 font-bold mb-10\"},[_vm._v(\" \"+_vm._s(_vm.$dictionary.get('SitePicker.PleaseChooseCountry'))+\" \")]),_c('InputSelect',{attrs:{\"rules\":\"required\",\"name\":\"bu-select\"},model:{value:(_vm.selectedCountryOption),callback:function ($$v) {_vm.selectedCountryOption=$$v},expression:\"selectedCountryOption\"}},_vm._l((_vm.countryOptions),function(countryOption,countryIndex){return _c('option',{key:((countryOption.id) + \"-\" + countryIndex),domProps:{\"value\":countryOption}},[_vm._v(\" \"+_vm._s(countryOption.countryLabel)+\" \")])}),0)],1):_vm._e(),_c('section',{staticClass:\"mt-20\"},[_c('h2',{staticClass:\"text-14 font-bold mb-10\"},[_vm._v(\" \"+_vm._s(_vm.$dictionary.get('SitePicker.PleaseChooseLanguage'))+\" \")]),_c('InputSelect',{attrs:{\"rules\":\"required\",\"name\":\"lang-select\",\"disabled\":!_vm.languageCanBeChanged},model:{value:(_vm.selectedSite),callback:function ($$v) {_vm.selectedSite=$$v},expression:\"selectedSite\"}},_vm._l((_vm.sites),function(site,siteIndex){return _c('option',{key:((site.siteId) + \"-\" + siteIndex),domProps:{\"value\":site}},[_vm._v(\" \"+_vm._s(_vm.$dictionary.languageNameByLanguageCode(site.languageCode))+\" \")])}),0)],1),_c('web-api-message',{attrs:{\"id\":\"switch-site\"}}),(_vm.basketChangeWarning)?_c('p',{staticClass:\"mt-20\"},[_vm._v(\" \"+_vm._s(_vm.$dictionary.get('SitePicker.BasketChangeWarning'))+\" \")]):_vm._e(),_c('call-to-action',{staticClass:\"mt-20\",attrs:{\"disabled\":_vm.updatingServer,\"text\":_vm.$dictionary.get('SitePicker.ChangeBtn'),\"type\":\"submit\"}})],1)]}}])})],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\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\r\nimport Modal from '@/project/modals/Modal.vue';\r\nimport { Component, Watch } from 'vue-property-decorator';\r\nimport WebApiMessage from '@/core/messages/WebApiMessage.vue';\r\nimport { CountryOptionsViewModel, CountryOptionViewObject, SiteViewObject } from '@/types/apiServerContract';\r\nimport authService from '@/core/auth/auth.service';\r\nimport siteService from '@/project/site/site.service';\r\nimport botService from '@/project/site/bot.service';\r\n\r\ninterface ICountryOptionViewExtended extends CountryOptionViewObject {\r\n countryLabel: string;\r\n}\r\n\r\n@Component({\r\n components: { WebApiMessage }\r\n})\r\nexport default class SitePickerOverlay extends Modal {\r\n updatingServer = false;\r\n selectedCountryOption: CountryOptionViewObject | null = null;\r\n selectedSite: SiteViewObject | null = null;\r\n basketChangeWarning = false;\r\n\r\n get siteOptions(): CountryOptionsViewModel | null {\r\n return siteService.getCountryOptions();\r\n }\r\n\r\n @Watch('siteOptions', { immediate: true })\r\n onSiteOptionsChange(newOptions) {\r\n if (newOptions) {\r\n this.preFillInSelections();\r\n }\r\n }\r\n\r\n get countryOptions(): ICountryOptionViewExtended[] {\r\n const sortedOptions: ICountryOptionViewExtended[] = [];\r\n if (this.siteOptions) {\r\n this.siteOptions.countries.map((country) => {\r\n sortedOptions.push({ countryLabel: this.$dictionary.countryNameByCountryCode(country.countryCode), countryCode: country.countryCode, id: country.id, sites: country.sites });\r\n });\r\n }\r\n return sortedOptions.sort((a, b) => a.countryLabel.localeCompare(b.countryLabel));\r\n }\r\n\r\n get sites(): SiteViewObject[] {\r\n return this.selectedCountryOption?.sites ?? [];\r\n }\r\n\r\n get indexableSites() {\r\n const countryCodeAllowedList = ['en', 'gb', 'ie'];\r\n const languageCodeDisallowedList = ['en'];\r\n return this.countryOptions\r\n .flatMap(country => country.sites)\r\n .filter(sites => countryCodeAllowedList.includes(sites.countryCode.toLowerCase()) ||\r\n !languageCodeDisallowedList.includes(sites.languageCode.toLowerCase()));\r\n }\r\n\r\n uaIsBot: boolean = botService.uaIsBot();\r\n\r\n @Watch('selectedCountryOption')\r\n onSelectedCountryOptionChanged() {\r\n if (authService.isLoggedIn()) {\r\n this.basketChangeWarning = true;\r\n }\r\n\r\n this.preFillInSiteSelection();\r\n }\r\n\r\n get countryCanBeChanged(): boolean {\r\n return this.countryOptions.length > 1;\r\n }\r\n\r\n get languageCanBeChanged(): boolean {\r\n return this.sites.length > 1;\r\n }\r\n\r\n get headerLabel(): string {\r\n return this.countryCanBeChanged ? 'SitePicker.Header' : 'SitePicker.HeaderOnlyLanguage';\r\n }\r\n\r\n async submit() {\r\n this.closeOverlay({ siteId: this.selectedSite!.siteId });\r\n }\r\n\r\n preFillInSelections(): void {\r\n // Country\r\n this.selectedCountryOption = this.countryOptions.find(be => be.countryCode.toLowerCase() === siteService.getCountryCode()?.toLowerCase()) ?? null;\r\n\r\n // Lang\r\n this.preFillInSiteSelection();\r\n }\r\n\r\n preFillInSiteSelection(): void {\r\n this.selectedSite = this.sites.find(s => s.siteId === siteService.getSiteId()) ?? this.sites[0];\r\n }\r\n}\r\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--15-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--15-3!../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./SitePickerOverlay.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--15-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--15-3!../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./SitePickerOverlay.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./SitePickerOverlay.vue?vue&type=template&id=0672e4c1&\"\nimport script from \"./SitePickerOverlay.vue?vue&type=script&lang=ts&\"\nexport * from \"./SitePickerOverlay.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","var render = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return (_vm.messages.length > 0)?_c('div',[_vm._t(\"default\",function(){return [_c('ul',{staticClass:\"text-red-500 text-12 font-medium list-reset\"},_vm._l((_vm.messages),function(message,ix){return _c('li',{key:ix,staticClass:\"mt-15\"},[_vm._v(\" \"+_vm._s(_vm.getMessage(message.message))+\" \"),(_vm.errorId)?[_vm._v(\" [ \"+_vm._s(_vm.errorId)+\"] \")]:_vm._e()],2)}),0)]},{\"messages\":_vm.messages,\"deleteMessage\":_vm.deleteMessageAtIndex})],2):_vm._e()}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\r\n\r\nimport Vue from 'vue';\r\nimport Component from 'vue-class-component';\r\nimport { Prop } from 'vue-property-decorator';\r\nimport bus from '@/core/bus';\r\nimport { ClientMessage, ValidationErrorEvent, ValidationErrorEventKey } from '@/core/messages/types';\r\nimport dictionaryService from '@/core/translation/dictionary.service';\r\n\r\n@Component\r\nexport default class WebApiMessage extends Vue {\r\n messages: ClientMessage[] = [];\r\n errorId: string = '';\r\n @Prop({\r\n required: true\r\n })\r\n id!: string;\r\n\r\n created() {\r\n bus.on(ValidationErrorEventKey, this.onMessages);\r\n }\r\n\r\n deleteMessageAtIndex(index: number) {\r\n this.messages.splice(index, 1);\r\n }\r\n\r\n onMessages(validationErrorEvent: ValidationErrorEvent) {\r\n if (validationErrorEvent.messagesId === this.id) {\r\n this.messages = validationErrorEvent.messages;\r\n this.errorId = validationErrorEvent.errorId;\r\n validationErrorEvent.handled();\r\n }\r\n }\r\n\r\n getMessage(msgOrLabel: string): string {\r\n if (dictionaryService.exists(msgOrLabel)) {\r\n return dictionaryService.get(msgOrLabel);\r\n }\r\n return msgOrLabel;\r\n }\r\n\r\n destroyed() {\r\n bus.off(ValidationErrorEventKey, this.onMessages);\r\n }\r\n}\r\n","import mod from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--15-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--15-3!../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./WebApiMessage.vue?vue&type=script&lang=ts&\"; export default mod; export * from \"-!../../../node_modules/cache-loader/dist/cjs.js??ref--15-0!../../../node_modules/thread-loader/dist/cjs.js!../../../node_modules/babel-loader/lib/index.js!../../../node_modules/ts-loader/index.js??ref--15-3!../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./WebApiMessage.vue?vue&type=script&lang=ts&\"","import { render, staticRenderFns } from \"./WebApiMessage.vue?vue&type=template&id=b56bf54e&\"\nimport script from \"./WebApiMessage.vue?vue&type=script&lang=ts&\"\nexport * from \"./WebApiMessage.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":""}