{"version":3,"sources":["webpack:///./webpack/js/components/agency-search/AgencySearch.vue?5ec7","webpack:///webpack/js/components/agency-search/AgencySearch.vue","webpack:///./webpack/js/components/agency-search/AgencySearch.vue?4138","webpack:///./webpack/js/components/agency-search/AgencySearch.vue","webpack:///./webpack/js/store/agency-search/agency-search.store.js","webpack:///./webpack/js/components/agency-search/agency-search.js","webpack:///./webpack/js/components/form/select/O2Select.vue","webpack:///./webpack/js/components/frame-outside/FrameOutside.vue?280b","webpack:///webpack/js/components/frame-outside/FrameOutside.vue","webpack:///./webpack/js/components/form/select/O2Select.vue?bdd7","webpack:///webpack/js/components/form/select/O2Select.vue","webpack:///./webpack/js/components/frame-outside/FrameOutside.vue","webpack:///./webpack/js/components/form/select/O2Select.vue?0afe","webpack:///./webpack/js/store/form/select-service/mutations.js","webpack:///./webpack/js/store/form/select-service/select-service-part.store.js","webpack:///./webpack/js/store/form/select-service/state.js","webpack:///./webpack/js/store/form/select-service/getters.js","webpack:///./webpack/js/store/form/select-service/actions.js","webpack:///./webpack/js/components/form/fields/SelectService.vue","webpack:///./webpack/js/components/form/fields/SelectService.vue?b044","webpack:///webpack/js/components/form/fields/SelectService.vue","webpack:///./webpack/js/components/form/fields/SelectService.vue?4d0e"],"names":["components","AddressAutoComplete","Alert","SelectService","CityZipAutoComplete","CoverageAreaNotFound","CookieServiceUtil","data","idForm","notFoundComponent","isErrorShown","isValidForm","methods","checkSubmit","event","validate","withBootstrapValidation","form","getForm","getCityById","cityId","CityService","response","doSearch","doSearchCoverageAreaByCityZip","window","$","doSearchCoverageAreaByAddress","processCoverageAreaNotFound","showRouteWhenCreate","Liferay","store","Vue","i18n","router","$mount","document","behavior","redirectToNotFound","Constants","cityFound","catch","getServiceTypeLabels","sendGTMEvent","dataLayer","preLoadAddress","cookiePloc","sendGTMEventVpv","sendGTMEventNotCoverage","sendGTMEventCoverage","changeCity","applyErrorMessageClass","applyValidForm","isValid","computed","created","urlParams","paramService","paramCity","paramZip","cityData","_vm","this","_c","_self","staticClass","attrs","on","errorMessage","_e","_v","_s","$t","needAddress","class","domProps","merge","require","all","ErrorMessagePartStore","LoadingPartStore","ServicePartStore","SelectServicePartStore","CoverageAreaPartStore","CoverageAreaNotFoundPartStore","AgencySearchApp","init","element","ApiService","use","Vuex","initStore","initDefaultValues","initApp","zip","getAttribute","cityName","CityServiceUtil","getCityByNameAndZip","city","commit","Mutation","UPDATE_CITY","UPDATE_ZIP","UPDATE_SHOW_NOT_FOUND_STATE","JSON","parse","selectedService","UPDATE_SELECTED_SERVICE","toUpperCase","Store","AgencySearchStore","util","extend","AgencySearch","name","mounted","render","FrameOutside","props","values","type","default","labels","selectedValue","label","placeholder","isRequired","takeAllWidth","isDateInput","lp","isOpen","mutableValue","mutableLabel","selectedIdx","hoverIndex","invalid","toggle","select","idx","isItemSelected","moveUp","moveDown","selectFromKeyboard","handleBlur","initializeValue","watch","handler","deep","$event","ref","_uid","indexOf","_k","keyCode","key","apply","arguments","stopPropagation","preventDefault","length","_l","itLabel","mutations","state","service","UPDATE_DEFAULT_SERVICE","defaultService","getters","actions","O2Select","mutableService","getServiceTypeValues","component"],"mappings":"6QAAwM,ECuGxM,CACAA,YACAC,wBACAC,UACAC,kBACAC,wBACAC,yBACAC,uBAEAC,KATA,WAUA,OACAC,YACAC,uBACAC,gBACAC,iBAGAC,SAEAC,YAFA,SAEAC,GACAA,mBACAA,oBACA,mBACA,8BACA,iBAKAC,SAZA,SAYAC,GACA,qGACA,GACA,eACAC,+BAGA,UAEAC,QArBA,WAsBA,mCAEAC,YAxBA,SAwBAC,GAAA,yHACAC,mBADA,cACAC,EADA,yBAEAA,QAFA,8CAIAC,SA5BA,WA4BA,iHAEA,iBACA,iEACAjB,4DACA,cALA,gCAMA,kCANA,+CAQA,kCARA,+CAYAkB,8BAxCA,WAwCA,8HACA,gEADA,UAEA,8DAFA,gBAKA,yBAEAC,uEAPA,2BAQA,aARA,kCASA,gCATA,QAWA,eACAC,6CAZA,+CAeAC,8BAvDA,WAu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AAQ,wBAAwB,SAASA,GAAQxF,EAAI8G,eAAetB,QAElX,IGSpB,EACA,KACA,KACA,MAIa,IAAAwB,E","file":"11.js?id=669f07363d355e8d0011","sourcesContent":["import mod from \"-!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./AgencySearch.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./AgencySearch.vue?vue&type=script&lang=js&\"","<template>\n\n    <form\n            :id=\"idForm\"\n            v-on:submit=\"checkSubmit\"\n            class=\"form-agency-search row needs-validation\"\n            novalidate\n            action=\"#\"\n            method=\"post\"\n            autocomplete=\"off\"\n    >\n        <div class=\"container\">\n\n            <div class=\"row\" v-if=\"errorMessage\">\n                <div class=\"col-12 mb-2\">\n                    <Alert :message=\"errorMessage\" :messageDescription=\"errorMessage + '_desc'\" type=\"danger\" />\n                </div>\n            </div>\n\n            <div class=\"row\">\n                <div class=\"col-lg-4\">\n                    <SelectService />\n                </div>\n\n                <div class=\"col-lg-5\">\n                    <div class=\"row\">\n                        <div class=\"col-2 text-center text-small label-in\">\n                            <span>{{ $t('in') }}</span>\n                        </div>\n                        <div class=\"col-10\">\n                            <CityZipAutoComplete v-on:change=\"changeCity\" />\n                        </div>\n                    </div>\n                </div>\n\n                <div v-if=\"!needAddress\" class=\"col-lg-3\">\n                    <button\n                            :aria-label=\"$t('search')\"\n                            :disabled=\"!validate(false)\"\n                            type=\"submit\"\n                            class=\"btn btn-secondary with-icon justify-content-center font-weight-bold\"\n                            role=\"button\"\n                    >\n                        <span aria-hidden=\"true\" class=\"o2icon o2icon-search\"></span>\n                        <span class=\"d-block d-lg-none d-xl-none\">{{ $t('search') }}</span>\n                    </button>\n                </div>\n\n            </div>\n\n            <transition name=\"fade\">\n\n            <div v-if=\"needAddress\" class=\"row my-2\">\n\n                <div class=\"col-lg-5 pr-lg-1 pl-0\">\n                    <p class=\"text-tiny text-multi-coverage-area\" :class=\"[isErrorShown && isValidForm ? 'mt-4 mb-n4 mr-4' : '']\" v-html=\"$t('address_multi_agency')\"></p>\n                </div>\n\n                <div class=\"col-lg-4\">\n                    <div class=\"row\">\n                        <div class=\"col-lg-12 pl-lg-1\">\n                            <AddressAutoComplete />\n                        </div>\n                    </div>\n                </div>\n\n                <div class=\"col-lg-3\">\n                    <button\n                            :aria-label=\"$t('search')\"\n                            :disabled=\"!validate(false)\"\n                            type=\"submit\"\n                            class=\"btn btn-secondary with-icon justify-content-center font-weight-bold\"\n                            role=\"button\"\n                    >\n                        <span aria-hidden=\"true\" class=\"o2icon o2icon-search\"></span>\n                        <span class=\"d-block d-lg-none d-xl-none\">{{ $t('search') }}</span>\n                    </button>\n                </div>\n            </div>\n\n            </transition>\n\n        </div>\n    </form>\n\n</template>\n\n<script>\n    import CityZipAutoComplete from '../form/fields/CityZipAutoComplete';\n    import AddressAutoComplete from '../form/fields/AddressAutoComplete';\n    import SelectService from \"../form/fields/SelectService\";\n    import Alert from \"../alert/Alert\";\n    import {CityService} from \"../../services/api/api.service\";\n    import {Constants} from \"../../constants/constants\";\n    import Vue from \"vue\";\n    import Vuex from 'vuex';\n    import {i18n} from \"../../content/i18n\";\n    import {Mutation} from \"../../constants/store/mutation\";\n    import VueRouter from \"vue-router\";\n    import {Action} from \"../../constants/store/action\";\n    import CoverageAreaNotFound from \"../coverage-area-not-found/CoverageAreaNotFound\";\n    import {CookieServiceUtil} from \"../../services/util/cookie.service.util\";\n    import {CityServiceUtil} from \"../../services/util/city.service.util\";\n    export default {\n        components: {\n            AddressAutoComplete,\n            Alert,\n            SelectService,\n            CityZipAutoComplete,\n            CoverageAreaNotFound,\n            CookieServiceUtil\n        },\n        data() {\n            return {\n                idForm: null,\n                notFoundComponent: null,\n                isErrorShown: false,\n                isValidForm: false,\n            }\n        },\n        methods: {\n\n            checkSubmit(event) {\n                event.preventDefault();\n                event.stopPropagation();\n                if (this.validate(true)) {\n                    if(CityServiceUtil.redirectToDROM(this.zip)) {\n                    this.doSearch();\n                    }\n\n                }\n            },\n            validate(withBootstrapValidation) {\n                let isValidate = this.city && this.zip && this.selectedService && (!this.needAddress || (this.needAddress && this.address));\n                if (withBootstrapValidation) {\n                    let form = this.getForm();\n                    form.classList.add('was-validated');\n\n                }\n                return isValidate;\n            },\n            getForm() {\n                return jQuery('#' + this.idForm)[0];\n            },\n            async getCityById(cityId) {\n                const response = await CityService.getCityById(cityId);\n                return response.data;\n            },\n            async doSearch() {\n\n             this.sendGTMEvent();\n                this.$store.commit(`${[Mutation.UPDATE_SHOW_NOT_FOUND_STATE]}`, false);\n                CookieServiceUtil.O2Ploc_update(this.city, this.zip, this.address, this.selectedService);\n                if (!this.needAddress) {\n                    await this.doSearchCoverageAreaByCityZip();\n                } else {\n                    await this.doSearchCoverageAreaByAddress();\n                }\n\n            },\n            async doSearchCoverageAreaByCityZip() {\n                await this.$store.dispatch(`${Action.GET_COVERAGE_AREA_BY_CITY_ZIP}`);\n                if (this.coverageArea.nbAgencies === 1 && !this.coverageArea.partialCoverage) {\n\n                  // GTM event\n                  this.sendGTMEventCoverage();\n\n                    window.location.href = this.coverageArea.pageUrl + \"?\" + Constants.PARAM_AGENCY_FOUND;\n                } else if (this.notCovered) {\n                    await this.processCoverageAreaNotFound();\n                }\n                if (this.needAddress) {\n                    $('#'+ this.idForm).removeClass('was-validated');\n                }\n            },\n            async doSearchCoverageAreaByAddress() {\n                await this.$store.dispatch(`${Action.GET_COVERAGE_AREA_BY_ADDRESS}`);\n                if (this.coverageArea.nbAgencies === 1) {\n\n                  this.sendGTMEventCoverage();\n\n                    window.location.href = this.coverageArea.pageUrl + \"?\" + Constants.PARAM_AGENCY_FOUND;\n                } else if (this.notCovered)  {\n                    await this.processCoverageAreaNotFound();\n                }\n            },\n            async processCoverageAreaNotFound(showRouteWhenCreate = true) {\n\n                this.$store.commit(`${[Mutation.UPDATE_SHOW_NOT_FOUND_STATE]}`, true);\n                this.$store.commit(`${[Mutation.UPDATE_SHOW_ROUTE_WHEN_CREATED]}`, showRouteWhenCreate);\n\n                this.$store.commit(`${[Mutation.UPDATE_SERVICES_NOT_COVERED]}`, [this.selectedService]);\n                this.$store.commit(`${[Mutation.UPDATE_CITY_NOT_COVERED]}`, this.city);\n                this.$store.commit(`${[Mutation.UPDATE_ZIP_NOT_COVERED]}`, this.zip);\n                this.$store.commit(`${[Mutation.UPDATE_ADDRESS_NOT_COVERED]}`, this.address);\n\n                if (Liferay.currentURL.startsWith(Constants.AGENCIES_PAGE_URL)) {\n                    if (this.notFoundComponent == null) {\n                        if (this.selectedService && this.city && this.zip) {\n\n                            const store = this.$store;\n                            Vue.use(VueRouter);\n                            Vue.use(Vuex);\n                            this.sendGTMEventVpv();\n                            this.sendGTMEventNotCoverage();\n\n                            this.notFoundComponent = new Vue(Vue.util.extend({\n                                i18n,\n                                router: new VueRouter(),\n                                store\n                            }, CoverageAreaNotFound)).$mount(document.getElementById('coverage-area-not-found'));\n                        }\n                    } else {\n                      this.sendGTMEventVpv();\n                      this.sendGTMEventNotCoverage();\n                    }\n                    document.getElementById('coverage-area-not-found').scrollIntoView({\n                        behavior: 'smooth'\n                    });\n                } else {\n                    await this.redirectToNotFound();\n                }\n            },\n            async redirectToNotFound() {\n                await CityService.getCityByInseeAndName(this.city.code, this.city.name).then((resp) => {\n                    let cityFound = resp.data;\n                    window.location.href =\n                        `${Constants.NO_COVERAGE_AREA_URL}?${Constants.PARAM_SERVICE}=${this.selectedService.toLowerCase()}&${Constants.PARAM_CITY}=${cityFound.id}&${Constants.PARAM_ZIP}=${this.zip}`;\n                }).catch((error) => {\n                    if (!error.response || error.response && typeof error.response.headers['exception'] === 'undefined') {\n                        this.$store.commit(`${[Mutation.UPDATE_ERROR_MESSAGE]}`, 'o2_error_server_side_exception');\n                    } else {\n                        this.$store.commit(`${[Mutation.UPDATE_ERROR_MESSAGE]}`, error.response.headers['exception']);\n                    }\n                });\n            },\n          getServiceTypeLabels() {\n            return this.$t(this.selectedService.toLowerCase());\n          },\n            sendGTMEvent() {\n                if (this.selectedService && this.city && this.zip) {\n                    window.dataLayer = window.dataLayer || [];\n                    dataLayer.push(\n                        {\n                            \"event\": \"recherche_agence\",\n                            \"search_service\": this.getServiceTypeLabels(this.selectedService),\n                            \"search_zip\": this.zip,\n                            \"search_city\": this.city.name\n                        }\n                    );\n                }\n            },\n\t\t\tpreLoadAddress(){\n\t\t\t\tlet cookiePloc = CookieServiceUtil.O2Ploc_get();\n\t\t\t\tif (cookiePloc.city!==null && cookiePloc.city!==''\n\t\t\t\t\t&& cookiePloc.zip!==null && cookiePloc.zip!==''\n\t\t\t\t\t&& cookiePloc.address!==null && cookiePloc.address!=='') {\n\t\t\t\t\tthis.$store.commit(`${[Mutation.UPDATE_NEED_ADDRESS_STATE]}`, true);\n\t\t\t\t}\n\t\t\t},\n          sendGTMEventVpv() {\n            if (this.selectedService && this.city && this.zip) {\n              window.dataLayer = window.dataLayer || [];\n              dataLayer.push(\n                  {\n                    \"event\": \"vpv\",\n                    \"virtualURL\": encodeURI('/agences' + Constants.NO_COVERAGE_AREA_ROUTE_PATH + '?service=' + this.selectedService + '&city=' + this.city.name + '&zip=' + this.zip),\n                    \"virtualTitle\": this.$i18n.t('agency_search_route_title')\n                  }\n              );\n            }\n          },\n          sendGTMEventNotCoverage() {\n            if (this.selectedService && this.city && this.zip) {\n              window.dataLayer = window.dataLayer || [];\n              dataLayer.push(\n                  {\n                    \"event\": \"affichage_resultat_agence\",\n                    \"search_result\": \"non_couvert\",\n                    \"search_zip\": this.zip,\n                    \"search_city\":this.city.name,\n                    \"search_service\": this.getServiceTypeLabels(this.selectedService)\n                  }\n              );\n            }\n          },\n          sendGTMEventCoverage() {\n            if (this.selectedService && this.city && this.zip) {\n              window.dataLayer = window.dataLayer || [];\n              dataLayer.push(\n                  {\n                    \"event\": \"affichage_resultat_agence\",\n                    \"search_result\": \"couvert\",\n                    \"search_zip\": this.zip,\n                    \"search_city\":this.city.name,\n                    \"search_service\": this.getServiceTypeLabels(this.selectedService)\n\n                  }\n              );\n            }\n          },\n            changeCity() {\n            \tthis.$store.commit(`${[Mutation.UPDATE_NEED_ADDRESS_STATE]}`, false);\n            },\n          applyErrorMessageClass() {\n              this.isErrorShown = true;\n          },\n          applyValidForm(isValid) {\n              this.isValidForm = isValid;\n          }\n        },\n        computed: Vuex.mapState([\n            'errorMessage',\n            'loading',\n            'services',\n            'showNotFound',\n            'selectedService',\n            'city',\n            'zip',\n            'address',\n            'needAddress',\n            'notCovered',\n            'coverageArea'\n        ]),\n        async created() {\n          this.idForm = 'form_' + this._uid;\n          this.$root.$on('alert-created', this.applyErrorMessageClass());\n          this.$root.$on('invalid-o2-multi-selection', (isValid) => {\n            this.applyValidForm(isValid);\n          });\n\n          // Restaurer les données depuis l'URL si on arrive en mode \"not found\"\n          if (this.showNotFound) {\n            const urlParams = new URLSearchParams(window.location.search);\n            const paramService = urlParams.get('p_r_p_service');\n            const paramCity = urlParams.get('p_r_p_city');\n            const paramZip = urlParams.get('p_r_p_zip');\n\n            if (paramService && paramCity && paramZip) {\n              this.$store.commit(`${[Mutation.UPDATE_SELECTED_SERVICE]}`, paramService.toUpperCase());\n              try {\n                const cityData = await this.getCityById(paramCity);\n                this.$store.commit(`${[Mutation.UPDATE_CITY]}`, cityData);\n              } catch (e) {\n                // En cas d'erreur, continuer sans les données de ville\n              }\n              this.$store.commit(`${[Mutation.UPDATE_ZIP]}`, paramZip);\n            }\n\n            await this.processCoverageAreaNotFound(false);\n          }\n        \tthis.preLoadAddress();\n        }\n    };\n</script>\n","import { render, staticRenderFns } from \"./AgencySearch.vue?vue&type=template&id=71157fff&\"\nimport script from \"./AgencySearch.vue?vue&type=script&lang=js&\"\nexport * from \"./AgencySearch.vue?vue&type=script&lang=js&\"\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 render(){var _vm=this,_c=_vm._self._c;return _c('form',{staticClass:\"form-agency-search row needs-validation\",attrs:{\"id\":_vm.idForm,\"novalidate\":\"\",\"action\":\"#\",\"method\":\"post\",\"autocomplete\":\"off\"},on:{\"submit\":_vm.checkSubmit}},[_c('div',{staticClass:\"container\"},[(_vm.errorMessage)?_c('div',{staticClass:\"row\"},[_c('div',{staticClass:\"col-12 mb-2\"},[_c('Alert',{attrs:{\"message\":_vm.errorMessage,\"messageDescription\":_vm.errorMessage + '_desc',\"type\":\"danger\"}})],1)]):_vm._e(),_vm._v(\" \"),_c('div',{staticClass:\"row\"},[_c('div',{staticClass:\"col-lg-4\"},[_c('SelectService')],1),_vm._v(\" \"),_c('div',{staticClass:\"col-lg-5\"},[_c('div',{staticClass:\"row\"},[_c('div',{staticClass:\"col-2 text-center text-small label-in\"},[_c('span',[_vm._v(_vm._s(_vm.$t('in')))])]),_vm._v(\" \"),_c('div',{staticClass:\"col-10\"},[_c('CityZipAutoComplete',{on:{\"change\":_vm.changeCity}})],1)])]),_vm._v(\" \"),(!_vm.needAddress)?_c('div',{staticClass:\"col-lg-3\"},[_c('button',{staticClass:\"btn btn-secondary with-icon justify-content-center font-weight-bold\",attrs:{\"aria-label\":_vm.$t('search'),\"disabled\":!_vm.validate(false),\"type\":\"submit\",\"role\":\"button\"}},[_c('span',{staticClass:\"o2icon o2icon-search\",attrs:{\"aria-hidden\":\"true\"}}),_vm._v(\" \"),_c('span',{staticClass:\"d-block d-lg-none d-xl-none\"},[_vm._v(_vm._s(_vm.$t('search')))])])]):_vm._e()]),_vm._v(\" \"),_c('transition',{attrs:{\"name\":\"fade\"}},[(_vm.needAddress)?_c('div',{staticClass:\"row my-2\"},[_c('div',{staticClass:\"col-lg-5 pr-lg-1 pl-0\"},[_c('p',{staticClass:\"text-tiny text-multi-coverage-area\",class:[_vm.isErrorShown && _vm.isValidForm ? 'mt-4 mb-n4 mr-4' : ''],domProps:{\"innerHTML\":_vm._s(_vm.$t('address_multi_agency'))}})]),_vm._v(\" \"),_c('div',{staticClass:\"col-lg-4\"},[_c('div',{staticClass:\"row\"},[_c('div',{staticClass:\"col-lg-12 pl-lg-1\"},[_c('AddressAutoComplete')],1)])]),_vm._v(\" \"),_c('div',{staticClass:\"col-lg-3\"},[_c('button',{staticClass:\"btn btn-secondary with-icon justify-content-center font-weight-bold\",attrs:{\"aria-label\":_vm.$t('search'),\"disabled\":!_vm.validate(false),\"type\":\"submit\",\"role\":\"button\"}},[_c('span',{staticClass:\"o2icon o2icon-search\",attrs:{\"aria-hidden\":\"true\"}}),_vm._v(\" \"),_c('span',{staticClass:\"d-block d-lg-none d-xl-none\"},[_vm._v(_vm._s(_vm.$t('search')))])])])]):_vm._e()])],1)])\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import CoverageAreaPartStore from \"../coverage-area/coverage-area-part.store\";\nimport CoverageAreaNotFoundPartStore from \"../coverage-area-not-found/coverage-area-part.store\";\nimport ServicePartStore from \"../service/service-part.store\";\nimport SelectServicePartStore from \"../form/select-service/select-service-part.store\";\nimport ErrorMessagePartStore from '../../store/error-message/error-message-part.store';\nimport LoadingPartStore from '../../store/loading/loading-part.store';\n\nconst merge = require('deepmerge');\n\nexport default merge.all(\n    [\n        ErrorMessagePartStore,\n        LoadingPartStore,\n        ServicePartStore,\n        SelectServicePartStore,\n        CoverageAreaPartStore,\n        CoverageAreaNotFoundPartStore\n    ]\n)\n","// The Vue build version to load with the `import` command\n// (runtime-only or standalone) has been set in webpack.base.conf with an alias.\nimport Vue from 'vue';\nimport {i18n} from '../../content/i18n';\nimport AgencySearch from './AgencySearch';\nimport ApiService from '../../services/api/api.service';\nimport Vuex from 'vuex';\nimport AgencySearchStore from '../../store/agency-search/agency-search.store';\nimport {Mutation} from '../../constants/store/mutation';\nimport {CityServiceUtil} from '../../services/util/city.service.util';\n\nconst AgencySearchApp = {\n\n    async init(element) {\n\n        ApiService.init();\n\n        Vue.use(Vuex);\n\n        let store = AgencySearchApp.initStore();\n        await AgencySearchApp.initDefaultValues(element, store);\n        AgencySearchApp.initApp(element, store);\n    },\n\n    async initDefaultValues(element, store) {\n        let zip = null;\n        if (element.getAttribute('data-zip')) {\n            zip = element.getAttribute('data-zip');\n        }\n        if (element.getAttribute('data-city-name')) {\n             let cityName = element.getAttribute('data-city-name');\n             if (cityName && zip) {\n                 let city = await CityServiceUtil.getCityByNameAndZip(cityName, zip);\n                 if (city) {\n                     store.commit(`${[Mutation.UPDATE_CITY]}`, city);\n                     store.commit(`${[Mutation.UPDATE_ZIP]}`, zip);\n                 }\n             }\n        }\n        if (element.getAttribute('data-show-not-found')) {\n            store.commit(`${[Mutation.UPDATE_SHOW_NOT_FOUND_STATE]}`, JSON.parse(element.getAttribute('data-show-not-found')));\n        }\n        let selectedService = element.getAttribute('data-service');\n        if (selectedService) {\n            store.commit(`${[Mutation.UPDATE_SELECTED_SERVICE]}`, selectedService.toUpperCase());\n        }\n    },\n\n    initStore() {\n        const store = new Vuex.Store(\n            AgencySearchStore\n        );\n        return store;\n    },\n\n    initApp(element, store) {\n        new Vue(Vue.util.extend({\n            i18n,\n            store\n        }, AgencySearch)).$mount(element);\n    }\n};\nexport default AgencySearchApp.init;\n","var render = function render(){var _vm=this,_c=_vm._self._c;return _c('FrameOutside',{on:{\"click\":function($event){_vm.isOpen = false},\"focus\":function($event){_vm.isOpen = false}}},[_c('div',{ref:\"selectElement\",staticClass:\"vue-select form-group\",class:[_vm.isRequired ? 'required' : ''],attrs:{\"aria-owns\":'lbox_' + this._uid,\"aria-autocomplete\":\"none\",\"aria-label\":_vm.placeholder,\"aria-required\":_vm.isRequired,\"role\":\"combobox\",\"tabindex\":\"0\"},on:{\"blur\":_vm.handleBlur,\"click\":_vm.toggle,\"keyup\":[function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,\"space\",32,$event.key,[\" \",\"Spacebar\"]))return null;return _vm.toggle.apply(null, arguments)},function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,\"up\",38,$event.key,[\"Up\",\"ArrowUp\"]))return null;return _vm.moveUp.apply(null, arguments)},function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,\"down\",40,$event.key,[\"Down\",\"ArrowDown\"]))return null;return _vm.moveDown.apply(null, arguments)},function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,\"enter\",13,$event.key,\"Enter\"))return null;return _vm.selectFromKeyboard.apply(null, arguments)}],\"keydown\":[function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,\"up\",38,$event.key,[\"Up\",\"ArrowUp\"]))return null;$event.stopPropagation();$event.preventDefault();},function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,\"down\",40,$event.key,[\"Down\",\"ArrowDown\"]))return null;$event.stopPropagation();$event.preventDefault();}]}},[_c('label',{staticClass:\"text-primary text-small font-italic\",class:_vm.label == null ? 'sr-only' : '',attrs:{\"id\":'o2-vue-select_' + this._uid}},[_vm._v(_vm._s(_vm.label != null ? _vm.label : _vm.placeholder))]),_vm._v(\" \"),_c('div',{staticClass:\"position-relative align-middle d-flex-column\",class:[_vm.isDateInput && !_vm.takeAllWidth && _vm.lp ? 'date-input-field' : '']},[_c('div',{staticClass:\"form-control select-styled w-100 d-block\",class:[_vm.isRequired && _vm.selectedValue == null ? 'invalid' : '', _vm.isOpen ? 'active' : '', _vm.isDateInput && !_vm.takeAllWidth && _vm.lp ? 'form-date-lead' : '',   !_vm.isDateInput && !_vm.takeAllWidth && _vm.lp  ? 'form-slots-lead' : ''],attrs:{\"role\":\"button\"}},[_vm._v(\"\\n                \"+_vm._s(_vm.mutableLabel)+\"\\n            \")]),_vm._v(\" \"),_c('ul',{staticClass:\"select-options list-unstyled\",class:[_vm.isOpen ? 'show' : ''],attrs:{\"role\":\"listbox\",\"aria-expanded\":[_vm.isOpen ? 'true' : 'false'],\"aria-labelledby\":'o2-vue-select_' + this._uid}},[(!_vm.values || (_vm.values && _vm.values.length == 0))?_c('li',[_vm._v(\"\\n                    \"+_vm._s(_vm.$t('no_result'))+\"\\n                \")]):_vm._e(),_vm._v(\" \"),_vm._l((_vm.labels),function(itLabel,idx){return _c('li',{key:idx,class:['select_option', _vm.isItemSelected(idx) ? 'select_option-selected': '', _vm.hoverIndex === idx ? 'select_option-hover': ''],attrs:{\"aria-selected\":[_vm.isItemSelected(idx) ? 'true' : 'false'],\"role\":\"option\"},on:{\"mousedown\":function($event){$event.preventDefault();},\"click\":function($event){$event.stopPropagation();return _vm.select(idx)},\"keyup\":function($event){if(!$event.type.indexOf('key')&&_vm._k($event.keyCode,\"enter\",13,$event.key,\"Enter\"))return null;return _vm.select(idx)}}},[_vm._v(_vm._s(itLabel))])})],2),_vm._v(\" \"),(_vm.isRequired)?_c('div',{ref:\"invalidFeedbackElement\",staticClass:\"invalid-feedback position-static\",class:{ 'show mb-3' : this.invalid },attrs:{\"role\":\"alert\",\"aria-hidden\":\"true\"}},[_c('span',{staticClass:\"o2icon o2icon-action-warning\",attrs:{\"aria-hidden\":\"true\"}}),_vm._v(_vm._s(_vm.$t('required_field'))+\"\\n            \")]):_vm._e()])])])\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import mod from \"-!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./FrameOutside.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../node_modules/babel-loader/lib/index.js!../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./FrameOutside.vue?vue&type=script&lang=js&\"","<script>\n    export default {\n        name: \"FrameOutside\",\n        mounted() {\n            const listener = e => {\n                if (e.target === this.$el || this.$el.contains(e.target)) {\n                    return;\n                }\n                this.$emit(e.type, e);\n            };\n\n            document.addEventListener(`click`, listener);\n            document.addEventListener(`focus`, listener, true);\n            this.$once(`hook:beforeDestroy`, () => {\n                document.removeEventListener(`click`, listener);\n                document.removeEventListener(`focus`, listener, true);\n            });\n        },\n        render() {\n            return this.$slots.default[0];\n        }\n    };\n</script>\n","import mod from \"-!../../../../../node_modules/babel-loader/lib/index.js!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./O2Select.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../../node_modules/babel-loader/lib/index.js!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./O2Select.vue?vue&type=script&lang=js&\"","<template>\n    <FrameOutside @click=\"isOpen = false\" @focus=\"isOpen = false\">\n        <div class=\"vue-select form-group\"\n             :class=\"[isRequired ? 'required' : '']\"\n             :aria-owns=\"'lbox_' + this._uid\"\n             @blur=\"handleBlur\"\n             @click=\"toggle\"\n             @keyup.space=\"toggle\"\n             @keyup.up=\"moveUp\"\n             @keyup.down=\"moveDown\"\n             @keyup.enter=\"selectFromKeyboard\"\n             @keydown.up.stop.prevent\n             @keydown.down.stop.prevent\n             aria-autocomplete=\"none\"\n             :aria-label=\"placeholder\"\n             :aria-required=\"isRequired\"\n             role=\"combobox\"\n             ref=\"selectElement\"\n             tabindex=\"0\"\n        >\n            <label :id=\"'o2-vue-select_' + this._uid\" class=\"text-primary text-small font-italic\" :class=\"label == null ? 'sr-only' : '' \">{{label != null ? label : placeholder}}</label>\n            <div class=\" position-relative align-middle d-flex-column\"\n                 :class=\"[isDateInput && !takeAllWidth && lp ? 'date-input-field' : '']\"\n            >\n                <div class=\"form-control select-styled w-100 d-block\" role=\"button\"\n                     :class=\"[isRequired && selectedValue == null ? 'invalid' : '', isOpen ? 'active' : '', isDateInput && !takeAllWidth && lp ? 'form-date-lead' : '',   !isDateInput && !takeAllWidth && lp  ? 'form-slots-lead' : '']\"\n                >\n                    {{ mutableLabel }}\n                </div>\n                <ul\n                    class=\"select-options list-unstyled\"\n                    :class=\"[isOpen ? 'show' : '']\"\n                    role=\"listbox\"\n                    :aria-expanded=\"[isOpen ? 'true' : 'false']\"\n                    :aria-labelledby=\"'o2-vue-select_' + this._uid\"\n                >\n                    <li v-if=\"!values || (values && values.length == 0)\">\n                        {{ $t('no_result') }}\n                    </li>\n                    <li\n                            v-for=\"(itLabel, idx) in labels\"\n                            :aria-selected=\"[isItemSelected(idx) ? 'true' : 'false']\"\n                            :class=\"['select_option', isItemSelected(idx) ? 'select_option-selected': '', hoverIndex === idx ? 'select_option-hover': '']\"\n                            :key=\"idx\"\n                            role=\"option\"\n                            @mousedown.prevent\n                            @click.stop=\"select(idx)\"\n                            @keyup.enter=\"select(idx)\">{{ itLabel }}</li>\n                </ul>\n                <div v-if=\"isRequired\"\n                     class=\"invalid-feedback position-static\"\n                     :class=\"{ 'show mb-3' : this.invalid }\"\n                     role=\"alert\"\n                     ref=\"invalidFeedbackElement\"\n                     aria-hidden=\"true\"\n                >\n                    <span aria-hidden=\"true\" class=\"o2icon o2icon-action-warning\"></span>{{ $t('required_field') }}\n                </div>\n            </div>\n        </div>\n    </FrameOutside>\n</template>\n\n<script>\n    import FrameOutside from \"../../frame-outside/FrameOutside\";\n\n    export default {\n        name: \"O2Select\",\n        components: { FrameOutside },\n        props: {\n            values: { type: Array, default: () => [] },\n            labels: { type: Array, default: () => [] },\n            selectedValue: { type: String, default: null },\n            label: { type: String, default: null },\n            placeholder: { type: String, default: null },\n            isRequired: { type: Boolean, default: false },\n            takeAllWidth:{ type: Boolean, default: false },\n            isDateInput:{ type: Boolean, default: false },\n            lp:{ type: Boolean, default: false }\n        },\n        data() {\n            return {\n                isOpen: false,\n                mutableValue: null,\n                mutableLabel: null,\n                selectedIdx: -1,\n                hoverIndex: -1,\n                invalid: false\n            }\n        },\n        methods: {\n            toggle() {\n                this.isOpen = !this.isOpen;\n                if (this.isOpen) {\n                    this.hoverIndex = this.selectedIdx;\n                }\n            },\n            select(idx) {\n                this.selectedIdx = idx;\n                this.mutableValue = this.values[idx];\n                this.mutableLabel = this.labels[idx];\n                this.$emit('input', this.mutableValue);\n                this.$emit('update:selectedValue', this.mutableValue);\n                this.isOpen = false;\n            },\n            isItemSelected(idx) {\n                return this.selectedIdx === idx;\n            },\n            moveUp() {\n                this.hoverIndex = this.hoverIndex === 0 ? (this.values.length - 1) : (this.hoverIndex - 1);\n            },\n            moveDown() {\n                this.hoverIndex = ((this.hoverIndex + 1) % this.values.length);\n            },\n            selectFromKeyboard() {\n                if(this.isOpen && this.hoverIndex !== -1) {\n                    this.select(this.hoverIndex);\n                } else {\n                    this.toggle();\n                }\n            },\n            handleBlur() {\n                if (this.isOpen) {\n                    this.isOpen = false;\n                }\n            },\n            initializeValue() {\n                let idx = this.values.indexOf(this.selectedValue);\n\n                if (idx === -1 && this.mutableValue) {\n                    const localIdx = this.values.indexOf(this.mutableValue);\n                    if (localIdx !== -1) {\n                        idx = localIdx; // On garde la sélection locale, c'est la bonne !\n                    }\n                }\n\n                this.selectedIdx = idx;\n\n                if (this.selectedIdx !== -1) {\n                    this.mutableValue = this.values[this.selectedIdx];\n                    this.mutableLabel = this.labels[this.selectedIdx];\n                } else {\n                    this.mutableValue = null;\n                    this.mutableLabel = this.placeholder;\n                }\n            }\n        },\n        watch: {\n            // On surveille les deux props avec une seule logique robuste\n            selectedValue: 'initializeValue',\n            values: {\n                handler: 'initializeValue',\n                deep: true\n            },\n\n            invalid() {\n              this.$root.$emit('invalid-o2-multi-selection', this.invalid);\n                if (this.invalid) {\n                    this.$refs.selectElement.setAttribute(\"aria-invalid\", \"true\");\n                    this.$refs.invalidFeedbackElement.removeAttribute(\"aria-hidden\");\n                } else {\n                    this.$refs.selectElement.removeAttribute(\"aria-invalid\");\n                    this.$refs.invalidFeedbackElement.setAttribute(\"aria-hidden\", \"true\");\n                }\n            },\n            isOpen(){\n                if (!this.isOpen) {\n                    this.invalid = this.isRequired && (this.mutableValue == null && this.selectedValue == null);\n                }\n            }\n        },\n        mounted() {\n            this.initializeValue();\n        }\n    }\n</script>","var render, staticRenderFns\nimport script from \"./FrameOutside.vue?vue&type=script&lang=js&\"\nexport * from \"./FrameOutside.vue?vue&type=script&lang=js&\"\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 { render, staticRenderFns } from \"./O2Select.vue?vue&type=template&id=1aaffb28&\"\nimport script from \"./O2Select.vue?vue&type=script&lang=js&\"\nexport * from \"./O2Select.vue?vue&type=script&lang=js&\"\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 {Mutation} from \"../../../constants/store/mutation\";\n\nexport const mutations = {\n\n    [Mutation.UPDATE_SELECTED_SERVICE](state, service) {\n        state.selectedService = service;\n    },\n\n    [Mutation.UPDATE_DEFAULT_SERVICE](state, defaultService) {\n        state.defaultService = defaultService;\n    }\n\n};\n","import {mutations} from './mutations';\nimport {getters} from './getters';\nimport {state} from './state';\nimport {actions} from './actions';\n\nexport default {\n    state,\n    getters,\n    mutations,\n    actions\n}\n","export const state = {\n    selectedService: null,\n    defaultService: null\n};\n","export const getters = {\n    selectedService: state => state.selectedService,\n    defaultService: state => state.defaultService\n};\n","export const actions = {\n};\n","var render = function render(){var _vm=this,_c=_vm._self._c;return _c('O2Select',{attrs:{\"labels\":_vm.getServiceTypeLabels(),\"values\":_vm.getServiceTypeValues(),\"selected-value\":_vm.mutableService,\"placeholder\":_vm.$t('service_input_label'),\"is-required\":true},on:{\"update:selectedValue\":function($event){_vm.mutableService=$event},\"update:selected-value\":function($event){_vm.mutableService=$event}}})\n}\nvar staticRenderFns = []\n\nexport { render, staticRenderFns }","import mod from \"-!../../../../../node_modules/babel-loader/lib/index.js!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./SelectService.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../../node_modules/babel-loader/lib/index.js!../../../../../node_modules/vue-loader/lib/index.js??vue-loader-options!./SelectService.vue?vue&type=script&lang=js&\"","<template>\n\n    <O2Select\n            :labels=\"getServiceTypeLabels()\"\n            :values=\"getServiceTypeValues()\"\n            :selected-value.sync=\"mutableService\"\n            :placeholder=\"$t('service_input_label')\"\n            :is-required=\"true\"\n    />\n\n</template>\n\n<script>\n\n    import O2Select from \"../select/O2Select\";\n    import Vuex from \"vuex\";\n    import {Action} from \"../../../constants/store/action\";\n    import {Mutation} from \"../../../constants/store/mutation\";\n\n    export default {\n        name: 'SelectService',\n        components: {O2Select},\n        data() {\n            return {\n                mutableService: null\n            }\n        },\n        methods: {\n            getServiceTypeLabels() {\n                let labels = [];\n                this.services.forEach(\n                    itService =>  labels.push(this.$t(itService.shortname.toLowerCase()))\n                );\n                return labels;\n            },\n            getServiceTypeValues() {\n                let values = [];\n                this.services.forEach(\n                    itService =>  values.push(itService.shortname)\n                );\n                return values;\n            }\n        },\n        watch: {\n            mutableService() {\n                this.$store.commit(`${[Mutation.UPDATE_SELECTED_SERVICE]}`, this.mutableService);\n            },\n            selectedService() {\n                this.mutableService = this.selectedService;\n            }\n        },\n        computed: Vuex.mapState([\n            'services',\n            'selectedService'\n        ]),\n        async mounted() {\n            await this.$store.dispatch(`${Action.LOAD_SERVICES}`);\n            this.mutableService=this.selectedService;\n        }\n    }\n\n</script>\n","import { render, staticRenderFns } from \"./SelectService.vue?vue&type=template&id=6d981d6c&\"\nimport script from \"./SelectService.vue?vue&type=script&lang=js&\"\nexport * from \"./SelectService.vue?vue&type=script&lang=js&\"\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":""}