{"ast":null,"code":"import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { Fragment as _Fragment } from \"react/jsx-runtime\";\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport cn from 'classnames';\nimport { Arrow, ArrowDownButton } from 'components/gui/Arrow';\nimport BoxButton from 'components/gui/BoxButton';\nimport Button from 'components/gui/Button';\nimport VideoLoop from 'components/VideoLoop/VideoLoop';\nimport { languages } from 'global/globalData';\nimport { useIsDesktop } from 'hooks/useIsDevice';\nimport HTMLReactParser from 'html-react-parser';\nimport { getCities, getHomePage } from 'lib/api';\nimport MapSlice from 'slices/MapSlice/MapSlice';\nimport NewsListSlice from 'slices/NewsListSlice/NewsListSlice';\nimport SliceIntro from 'slices/SliceIntro/SliceIntro';\nimport TextImageSlice from 'slices/TextSlideshowSlice/TextImageSlice';\nimport styles from './Home.module.scss';\n\nconst Home = ({\n  lang,\n  introTitle,\n  introButton,\n  videos,\n  slices,\n  cities,\n  mapIntro,\n  listTab,\n  mapTab,\n  searchPlaceholderShort,\n  searchPlaceholderLong,\n  loadMoreCities,\n  newsIntro\n}) => {\n  const news = [{\n    _id: 'a',\n    title: `Un appartement se libère dans l’habitation VERNE à Nantes.`\n  }, {\n    _id: 'b',\n    title: 'Explorez votre nouvelle ville entre habitants en toute simplicité ce week-end !'\n  }, {\n    _id: 'c',\n    title: 'Le potager partagé de Cinq prend forme à Bordeaux.'\n  }, {\n    _id: 'd',\n    title: 'Cinq ouvre très prochainement à Bordeaux ! 11 logements sont disponibles.'\n  }, {\n    _id: 'aa',\n    title: `Un appartement se libère dans l’habitation VERNE à Nantes.`\n  }, {\n    _id: 'bb',\n    title: 'Explorez votre nouvelle ville entre habitants en toute simplicité ce week-end !'\n  }, {\n    _id: 'cc',\n    title: 'Le potager partagé de Cinq prend forme à Bordeaux.'\n  }, {\n    _id: 'dd',\n    title: 'Cinq ouvre très prochainement à Bordeaux ! 11 logements sont disponibles.'\n  }];\n  const isDesktop = useIsDesktop();\n  const mapIntroStr = isDesktop ? mapIntro : mapIntro ? mapIntro.replace(':', '').trim() : '';\n  const newsIntroStr = isDesktop ? newsIntro : newsIntro ? newsIntro.replace(':', '').trim() : '';\n  const searchPlaceholder = isDesktop ? searchPlaceholderLong : searchPlaceholderShort;\n  const introAnchor = 'intro'; //lang == 'fr' ? 'intro' : 'intro'\n\n  const mapAnchor = lang == 'fr' ? 'nos-villes' : 'our-cities';\n  return /*#__PURE__*/_jsxs(_Fragment, {\n    children: [/*#__PURE__*/_jsxs(\"section\", {\n      className: cn(styles.firstSlice),\n      style: {//backgroundImage: backgroundImageURL ? `url(${backgroundImageURL})` : undefined,\n      },\n      children: [/*#__PURE__*/_jsx(VideoLoop, {\n        videos: videos\n      }), /*#__PURE__*/_jsxs(\"div\", {\n        className: styles.firstSliceContent,\n        children: [/*#__PURE__*/_jsx(\"h1\", {\n          className: cn('h--1'),\n          children: HTMLReactParser(introTitle ? introTitle.split('\\n').join('<br/>') : '')\n        }), /*#__PURE__*/_jsx(BoxButton, {\n          className: cn(styles.button),\n          label: introButton,\n          href: '#' + mapAnchor,\n          white: true,\n          fullWidth: !isDesktop,\n          icon: \"right\"\n        })]\n      }), /*#__PURE__*/_jsx(ArrowDownButton, {\n        htmlText: 'Découvrir <strong>compose</strong>',\n        className: cn(styles.arrowDownCont),\n        href: '#' + introAnchor,\n        color: 'white'\n      })]\n    }), slices && /*#__PURE__*/_jsx(TextImageSlice, {\n      slides: slices,\n      id: introAnchor\n    }), /*#__PURE__*/_jsx(MapSlice, {\n      introText: mapIntroStr,\n      cities: cities,\n      searchPlaceholder: searchPlaceholder,\n      loadMoreCities: loadMoreCities,\n      listTab: listTab,\n      mapTab: mapTab,\n      id: mapAnchor\n    }), /*#__PURE__*/_jsx(NewsListSlice, {\n      introText: newsIntroStr,\n      news: news\n    }), isDesktop && /*#__PURE__*/_jsx(SliceIntro, {\n      mobileColor: \"blue\"\n    })]\n  });\n};\n\nexport async function getStaticProps({\n  params,\n  preview = false\n}) {\n  const props = await getHomePage(params.lang, preview); //const props = getStaticData(params.lang, 'home')\n  //console.log('index.js::121 props', props)\n\n  const cities = await getCities(params.lang);\n  return {\n    props: _objectSpread(_objectSpread({}, props), {}, {\n      cities,\n      lang: params.lang,\n      preview\n    })\n  };\n}\nexport async function getStaticPaths() {\n  return {\n    paths: languages.map(lang => ({\n      params: {\n        lang\n      }\n    })),\n    fallback: false\n  };\n}\nexport default Home;","map":null,"metadata":{},"sourceType":"module"}