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CP,EAAAA,cAACQ,EAAAA,EAAM,CAACL,IAAI,SAASM,aAAW,GAC9BT,EAAAA,cAACU,EAAAA,EAAiB,CAACP,IAAI,oBAAoBM,aAAW,KAExDT,EAAAA,cAACW,EAAAA,EAAY,CAACR,IAAI,eAAeS,eAAgBZ,EAAAA,cAACa,EAAAA,EAAqB,OACrEb,EAAAA,cAACc,EAAAA,EAA0B,OAE7Bd,EAAAA,cAACe,EAAAA,EAAqB,MACtBf,EAAAA,cAACgB,EAAAA,EAAI,CAACb,IAAI,OAAOc,kBAAgB,GAC/BjB,EAAAA,cAACkB,EAAAA,EAAe,CAACC,aAAcnB,EAAAA,cAACoB,EAAAA,GAAY,SAEzC,G","sources":["webpack://web-pwa/./src/routes/SEO/country.route.js","webpack://web-pwa/./src/domain/seo/country.page.jsx"],"sourcesContent":["import { ROUTE_SEO_COUNTRY } from '..'\nimport AddressNotFoundError from '../../domain/error/AddressNotFoundError'\nimport PermanentRedirectError from '../../domain/error/PermanentRedirectError'\nimport { bboxArrayToBboxArrays } from '../../domain/map/conversion'\nimport { generateFullRoute } from '../../domain/router/routeUtils'\nimport { renderPage } from '../../domain/seo/country.page'\nimport { searchArea } from '../../store/address/address.actions'\nimport { selectFirstAddress } from '../../store/address/address.selectors'\nimport { mapUpdated } from '../../store/map/mapSlice'\nimport { geocodeForwardCtx, searchServiceCtx } from '../../store/search/search.service.constants'\nimport { setSearchTerms } from '../../store/search/searchSlice'\nimport { searchCountryCities } from '../../store/seo/seo-address.actions'\nimport { slugify } from '../../utils/string'\nimport { technicalErrorCatcher } from '../routeErrors.utils'\nimport { handleRouteLoading } from '../routeService'\n\nexport const onRouteEnter = ({ params, store: { dispatch, getState } }, avoidRefetchingPageData) => {\n if (avoidRefetchingPageData) {\n return Promise.resolve()\n }\n\n const { countryCode, country } = params\n const location = `${countryCode}-${country}`\n\n return searchArea(location, geocodeForwardCtx.filter.country)(dispatch, getState)\n .then(() => {\n const firstAddress = selectFirstAddress(getState())\n\n if (firstAddress.geocode_level !== searchServiceCtx.geocodeLevel.country || !firstAddress.countryCode) {\n throw new AddressNotFoundError()\n }\n\n if (firstAddress.countryCode !== countryCode || slugify(firstAddress.countryLabel) !== country)\n throw new PermanentRedirectError(\n generateFullRoute(ROUTE_SEO_COUNTRY, {\n countryCode: firstAddress.countryCode,\n country: slugify(firstAddress.countryLabel)\n })\n )\n\n return Promise.all([\n dispatch(setSearchTerms(country)),\n __SERVER__ && searchCountryCities()(dispatch, getState),\n dispatch(mapUpdated({ bbox: bboxArrayToBboxArrays(firstAddress.bbox) }))\n ])\n })\n .catch(technicalErrorCatcher)\n}\n\nexport default handleRouteLoading({ onRouteEnter, renderPage })\n","import React from 'react'\nimport AddressSearchDialogContent from '../../routes/address/AddressSearchDialogContent'\nimport { PAGE_CLASSES } from '../../routes/pageClasses.constants'\nimport AddressHeaderForm from '../address/AddressHeaderForm'\nimport Page from '../genericComponents/Page'\nimport Header from '../header/Header'\nimport Main from '../main/Main'\nimport Map from '../map/Map'\nimport PushNotificationPopup from '../PushNotification/PushNotificationPopup'\nimport SearchDialog from '../search/SearchDialog'\nimport AddressSuggestContent from '../suggest/AddressSuggestContent'\nimport SeoZoneMapImage from './zones/SeoZoneMapImage'\nimport SeoZoneMetaManager from './zones/SeoZoneMetaManager'\nimport { CountryTitle } from './zones/ZoneContent'\nimport ZoneMainContent from './zones/ZoneMainContent'\n\nexport const renderPage = () => {\n const { AddressPage, withToaster } = PAGE_CLASSES\n\n return (\n <Page cssClasses={[AddressPage, withToaster]} key=\"Page\">\n <SeoZoneMetaManager />\n <Map key=\"Map\" staticMap={<SeoZoneMapImage />} />\n <Header key=\"Header\" transparent>\n <AddressHeaderForm key=\"AddressHeaderForm\" transparent />\n </Header>\n <SearchDialog key=\"SearchDialog\" suggestContent={<AddressSuggestContent />}>\n <AddressSearchDialogContent />\n </SearchDialog>\n <PushNotificationPopup />\n <Main key=\"Main\" withoutSubHeader>\n <ZoneMainContent titleContent={<CountryTitle />} />\n </Main>\n </Page>\n )\n}\n"],"names":["onRouteEnter","_ref","avoidRefetchingPageData","params","store","dispatch","getState","Promise","resolve","countryCode","country","location","searchArea","geocodeForwardCtx","filter","then","firstAddress","selectFirstAddress","geocode_level","searchServiceCtx","geocodeLevel","AddressNotFoundError","slugify","countryLabel","PermanentRedirectError","generateFullRoute","ROUTE_SEO_COUNTRY","all","setSearchTerms","__SERVER__","mapUpdated","bbox","bboxArrayToBboxArrays","catch","technicalErrorCatcher","handleRouteLoading","renderPage","AddressPage","withToaster","PAGE_CLASSES","React","Page","cssClasses","key","SeoZoneMetaManager","Map","staticMap","SeoZoneMapImage","Header","transparent","AddressHeaderForm","SearchDialog","suggestContent","AddressSuggestContent","AddressSearchDialogContent","PushNotificationPopup","Main","withoutSubHeader","ZoneMainContent","titleContent","CountryTitle"],"sourceRoot":""}