@anywayseo/tools 4.2.1 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/dist/components/base/index.d.ts +1 -0
  2. package/dist/components/base/link/index.d.ts +2 -0
  3. package/dist/components/base/link/utils.d.ts +1 -0
  4. package/dist/components/game-info/utils.d.ts +2 -2
  5. package/dist/components/index.cjs +3 -1
  6. package/dist/components/index.mjs +3 -1
  7. package/dist/components/layout/header/locale-switcher/icons/earth/index.d.ts +2 -0
  8. package/dist/components/layout/header/locale-switcher/icons/france/index.d.ts +2 -0
  9. package/dist/components/layout/header/locale-switcher/icons/germany/index.d.ts +2 -0
  10. package/dist/components/layout/header/locale-switcher/icons/globe/index.d.ts +2 -0
  11. package/dist/components/layout/header/locale-switcher/icons/index.d.ts +6 -0
  12. package/dist/components/layout/header/locale-switcher/icons/italy/index.d.ts +2 -0
  13. package/dist/components/layout/header/locale-switcher/icons/russia/index.d.ts +2 -0
  14. package/dist/components/layout/header/locale-switcher/index.d.ts +8 -0
  15. package/dist/components/layout/header/locale-switcher/utils.d.ts +2 -0
  16. package/dist/components/layout/header/navigation/desktop/index.d.ts +1 -1
  17. package/dist/components/layout/header/navigation/index.d.ts +1 -1
  18. package/dist/components/layout/header/navigation/mobile/index.d.ts +1 -1
  19. package/dist/components/seo/index.d.ts +2 -3
  20. package/dist/hooks/index.cjs +4 -2
  21. package/dist/hooks/index.d.ts +1 -0
  22. package/dist/hooks/index.mjs +4 -2
  23. package/dist/hooks/use-localization/index.d.ts +6 -0
  24. package/dist/i18n/index.cjs +11 -5
  25. package/dist/i18n/index.d.ts +3 -2
  26. package/dist/i18n/index.mjs +11 -5
  27. package/dist/i18n/resources/fr/index.d.ts +112 -0
  28. package/dist/{index-BrOQF5EQ.js → index-3nQCWHPU.js} +220 -86
  29. package/dist/index-At00w6EN.js +9 -0
  30. package/dist/{index-BPLxhZG_.js → index-BHfpWNqh.js} +183 -73
  31. package/dist/{index-MpNfBHkQ.mjs → index-BJRvnR8Q.mjs} +1 -5
  32. package/dist/index-BRVKhbs6.mjs +6 -0
  33. package/dist/index-BmaWfWLV.mjs +10 -0
  34. package/dist/{index-BV0hDmYP.js → index-BnmGE5_x.js} +3 -2
  35. package/dist/{index-DPO0aIC3.mjs → index-Bu4S7kG8.mjs} +7 -10
  36. package/dist/{index-DVcQxWMZ.js → index-C6MG_f24.js} +0 -4
  37. package/dist/{index-BE9gNdXx.mjs → index-CACDltm3.mjs} +183 -73
  38. package/dist/index-CYr1ct1t.js +93 -0
  39. package/dist/index-CbuiYkSg.js +5 -0
  40. package/dist/index-Cc85xj4h.mjs +27 -0
  41. package/dist/index-D1bJmcpz.js +49 -0
  42. package/dist/{index-DuQjQMNN.js → index-D34TfBTR.js} +7 -10
  43. package/dist/{index-CcsbqDXL.mjs → index-DVAydNYV.mjs} +7 -3
  44. package/dist/index-DnvTeCy9.mjs +50 -0
  45. package/dist/index-DqGO34ef.js +26 -0
  46. package/dist/{index-DF_u_tzx.js → index-Dur8aLpm.js} +7 -3
  47. package/dist/{index-CkTgVjZS.mjs → index-QazOxABc.mjs} +3 -2
  48. package/dist/{index-CaIyg0au.mjs → index-X2ihbchG.mjs} +201 -67
  49. package/dist/index-cQqALZIW.mjs +94 -0
  50. package/dist/index.cjs +41 -31
  51. package/dist/index.mjs +30 -20
  52. package/dist/providers/index.cjs +2 -2
  53. package/dist/providers/index.mjs +2 -2
  54. package/dist/providers/site-provider/index.d.ts +11 -5
  55. package/dist/types/api/index.d.ts +2 -2
  56. package/dist/types/components/icon/index.d.ts +2 -0
  57. package/dist/types/components/index.d.ts +2 -0
  58. package/dist/types/components/locale-switcher/index.d.ts +5 -0
  59. package/dist/types/components/navigation/index.d.ts +9 -10
  60. package/dist/types/i18n/index.d.ts +7 -1
  61. package/dist/types/site/index.d.ts +15 -13
  62. package/dist/utils/api/index.d.ts +5 -0
  63. package/dist/utils/date/index.d.ts +4 -3
  64. package/dist/utils/index.cjs +23 -16
  65. package/dist/utils/index.d.ts +1 -0
  66. package/dist/utils/index.mjs +16 -9
  67. package/dist/utils/navigation/index.d.ts +2 -2
  68. package/dist/utils/numbers/index.d.ts +3 -3
  69. package/package.json +1 -1
  70. package/dist/components/layout/header/navigation/types.d.ts +0 -4
  71. package/dist/index-BClxYYix.js +0 -40
  72. package/dist/index-BNb-P8a6.mjs +0 -17
  73. package/dist/index-BhsXlbd8.js +0 -16
  74. package/dist/index-Ca_M-II5.mjs +0 -41
@@ -1,7 +1,12 @@
1
1
  import { jsx } from "react/jsx-runtime";
2
2
  import { Text, UnorderedList, OrderedList, Heading, Link } from "@chakra-ui/react";
3
3
  import { MDXProvider } from "@mdx-js/react";
4
- import { Link as Link$1 } from "gatsby";
4
+ import "react";
5
+ import "react-i18next";
6
+ import { L as Link$1 } from "./index-DnvTeCy9.mjs";
7
+ import "./index-BJRvnR8Q.mjs";
8
+ import "./index-CACDltm3.mjs";
9
+ import { i as isRelativePath } from "./index-BmaWfWLV.mjs";
5
10
  function omitProps(props, omittedKeys) {
6
11
  const result = { ...props };
7
12
  omittedKeys.forEach((key) => {
@@ -19,8 +24,7 @@ function renderLink({
19
24
  href,
20
25
  ...props
21
26
  }) {
22
- const isInternalLink = href == null ? void 0 : href.startsWith("/");
23
- return isInternalLink ? /* @__PURE__ */ jsx(Link, { as: Link$1, to: href, color: "brand.400", ...props }) : /* @__PURE__ */ jsx(
27
+ return isRelativePath(href) ? /* @__PURE__ */ jsx(Link, { as: Link$1, to: href, color: "brand.400", ...props }) : /* @__PURE__ */ jsx(
24
28
  Link,
25
29
  {
26
30
  href,
@@ -0,0 +1,50 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { createContext, useContext, useMemo, forwardRef } from "react";
3
+ import { Link as Link$1 } from "gatsby";
4
+ import "@chakra-ui/react";
5
+ import "@mdx-js/react";
6
+ import "react-i18next";
7
+ import "./index-BJRvnR8Q.mjs";
8
+ import "./index-CACDltm3.mjs";
9
+ import { u as useLocalization } from "./index-Cc85xj4h.mjs";
10
+ import { i as isRelativePath } from "./index-BmaWfWLV.mjs";
11
+ const SiteContext = createContext(null);
12
+ const SiteProvider = ({ children, ...context }) => {
13
+ const { currentLocale } = useLocalization(context.localization);
14
+ const value = useMemo(() => {
15
+ return { ...context, localization: { ...context.localization, currentLocale } };
16
+ }, [currentLocale]);
17
+ return /* @__PURE__ */ jsx(SiteContext.Provider, { value, children });
18
+ };
19
+ function useSiteContext() {
20
+ const context = useContext(SiteContext);
21
+ if (!context) {
22
+ throw new Error("useSiteContext must be used within SiteProvider");
23
+ }
24
+ return context;
25
+ }
26
+ function normalizePath(path = "") {
27
+ return path.replace(/^\/+|\/+$/g, "").replace(/\/+/g, "/");
28
+ }
29
+ function getLocalizedPath(path, currentLocaleCode, defaultLocaleCode) {
30
+ const localePrefix = currentLocaleCode === defaultLocaleCode ? "/" : `/${currentLocaleCode}/`;
31
+ if (path === "/") {
32
+ return localePrefix;
33
+ }
34
+ if (isRelativePath(path)) {
35
+ const maybeLocaleCode = path.split("/")[1];
36
+ return maybeLocaleCode === defaultLocaleCode ? "/" : path;
37
+ }
38
+ return `${localePrefix}${normalizePath(path)}`;
39
+ }
40
+ const Link = forwardRef(({ to, ...props }, ref) => {
41
+ const { localization } = useSiteContext();
42
+ const { currentLocale, defaultLocale } = localization;
43
+ const path = getLocalizedPath(to, currentLocale.code, defaultLocale.code);
44
+ return /* @__PURE__ */ jsx(Link$1, { ref, to: path, ...props });
45
+ });
46
+ export {
47
+ Link as L,
48
+ SiteProvider as S,
49
+ useSiteContext as u
50
+ };
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ const react = require("react");
3
+ const reactI18next = require("react-i18next");
4
+ function useLocalization({ defaultLocale, locales }) {
5
+ var _a;
6
+ const [currentLocale, setCurrentLocale] = react.useState(defaultLocale);
7
+ const { i18n } = reactI18next.useTranslation();
8
+ const path = ((_a = window == null ? void 0 : window.location) == null ? void 0 : _a.pathname) ?? "";
9
+ react.useEffect(() => {
10
+ if (typeof window === "undefined") {
11
+ return;
12
+ }
13
+ const cleanPath = path.replace(/^\/+|\/+$/g, "");
14
+ const maybeLocaleCode = cleanPath.split("/")[0];
15
+ const maybeLocale = locales.find(({ code }) => code === maybeLocaleCode);
16
+ const locale = maybeLocale ? maybeLocale : defaultLocale;
17
+ if (locale.code !== currentLocale.code) {
18
+ setCurrentLocale(locale);
19
+ }
20
+ if (i18n.language !== locale.code) {
21
+ i18n.changeLanguage(locale.code);
22
+ }
23
+ }, [path]);
24
+ return { currentLocale };
25
+ }
26
+ exports.useLocalization = useLocalization;
@@ -2,7 +2,12 @@
2
2
  const jsxRuntime = require("react/jsx-runtime");
3
3
  const react$1 = require("@chakra-ui/react");
4
4
  const react = require("@mdx-js/react");
5
- const gatsby = require("gatsby");
5
+ require("react");
6
+ require("react-i18next");
7
+ const index$1 = require("./index-D1bJmcpz.js");
8
+ require("./index-C6MG_f24.js");
9
+ require("./index-BHfpWNqh.js");
10
+ const index = require("./index-At00w6EN.js");
6
11
  function omitProps(props, omittedKeys) {
7
12
  const result = { ...props };
8
13
  omittedKeys.forEach((key) => {
@@ -20,8 +25,7 @@ function renderLink({
20
25
  href,
21
26
  ...props
22
27
  }) {
23
- const isInternalLink = href == null ? void 0 : href.startsWith("/");
24
- return isInternalLink ? /* @__PURE__ */ jsxRuntime.jsx(react$1.Link, { as: gatsby.Link, to: href, color: "brand.400", ...props }) : /* @__PURE__ */ jsxRuntime.jsx(
28
+ return index.isRelativePath(href) ? /* @__PURE__ */ jsxRuntime.jsx(react$1.Link, { as: index$1.Link, to: href, color: "brand.400", ...props }) : /* @__PURE__ */ jsxRuntime.jsx(
25
29
  react$1.Link,
26
30
  {
27
31
  href,
@@ -1,6 +1,7 @@
1
1
  import { useColorModeValue } from "@chakra-ui/react";
2
- import { L as LIGHT_THEME_COLOR, D as DARK_THEME_COLOR } from "./index-MpNfBHkQ.mjs";
3
- import "./index-BE9gNdXx.mjs";
2
+ import "./index-BJRvnR8Q.mjs";
3
+ import "./index-CACDltm3.mjs";
4
+ import { L as LIGHT_THEME_COLOR, D as DARK_THEME_COLOR } from "./index-BRVKhbs6.mjs";
4
5
  function usePrimaryColors() {
5
6
  const color = useColorModeValue(LIGHT_THEME_COLOR, DARK_THEME_COLOR);
6
7
  const bgColor = useColorModeValue("brand.500", "brand.200");
@@ -1,15 +1,15 @@
1
1
  import { jsxs, jsx, Fragment } from "react/jsx-runtime";
2
- import { Box, Collapse, Text, Button, Flex, Stack, Image, Center as Center$1, SimpleGrid, Link as Link$1, Card, CardHeader, Heading, CardBody, Popover, PopoverTrigger, Portal, PopoverContent, PopoverBody, CardFooter, useToast, useColorModeValue, VStack, FormControl, FormLabel, InputGroup, InputLeftElement, Input, Textarea, Accordion, AccordionItem, AccordionButton, AccordionIcon, AccordionPanel, LinkBox, LinkOverlay, IconButton, AbsoluteCenter, Spinner, useDisclosure, Divider, Circle, Container as Container$1, List as List$1, ListItem, Icon, ListIcon, TableContainer, Table as Table$1, Thead, Tr, Th, Tbody, Td, TableCaption, Tabs as Tabs$1, TabList, Tab, TabPanels, TabPanel } from "@chakra-ui/react";
2
+ import { Box, Collapse, Text, Button, Flex, Stack, Image, Center as Center$1, SimpleGrid, Link as Link$1, Card, CardHeader, Heading, CardBody, Popover, PopoverTrigger, Portal, PopoverContent, PopoverBody, CardFooter, useToast, useColorModeValue, VStack, FormControl, FormLabel, InputGroup, InputLeftElement, Input, Textarea, Accordion, AccordionItem, AccordionButton, AccordionIcon, AccordionPanel, LinkBox, LinkOverlay, IconButton, AbsoluteCenter, Spinner, useDisclosure, Divider, Circle, Container as Container$1, Menu, MenuButton, HStack, Icon, MenuList, MenuItem, List as List$1, ListItem, ListIcon, TableContainer, Table as Table$1, Thead, Tr, Th, Tbody, Td, TableCaption, Tabs as Tabs$1, TabList, Tab, TabPanels, TabPanel } from "@chakra-ui/react";
3
3
  import { useTranslation } from "react-i18next";
4
- import { Link } from "gatsby";
5
- import { A as Animation } from "./index-MpNfBHkQ.mjs";
6
- import { a as GameCharacteristic } from "./index-BE9gNdXx.mjs";
4
+ import { u as useSiteContext, L as Link } from "./index-DnvTeCy9.mjs";
5
+ import { useRef, useState, useLayoutEffect, Fragment as Fragment$1, useMemo, forwardRef, useEffect } from "react";
6
+ import { A as Animation } from "./index-BJRvnR8Q.mjs";
7
+ import { a as GameCharacteristic } from "./index-CACDltm3.mjs";
7
8
  import { useMDXComponents } from "@mdx-js/react";
8
- import { u as useSiteContext } from "./index-BNb-P8a6.mjs";
9
- import { useRef, useState, useLayoutEffect, Fragment as Fragment$1, forwardRef, useEffect, useMemo } from "react";
10
- import { EmailIcon, StarIcon, CloseIcon, ViewOffIcon, ViewIcon, ChevronRightIcon, ChevronDownIcon, HamburgerIcon, ChevronUpIcon, WarningIcon, CheckCircleIcon } from "@chakra-ui/icons";
11
- import { e as getSeededRandomComparator, d as randomComparator, b as formatNumber, c as getCurrencySymbol, f as formatDate, g as getCurrentYear, a as getCurrentMonth } from "./index-DPO0aIC3.mjs";
12
- import { u as usePrimaryColors } from "./index-CkTgVjZS.mjs";
9
+ import { EmailIcon, StarIcon, CloseIcon, ViewOffIcon, ViewIcon, ChevronDownIcon, ChevronRightIcon, HamburgerIcon, ChevronUpIcon, WarningIcon, CheckCircleIcon } from "@chakra-ui/icons";
10
+ import { e as getSeededRandomComparator, d as randomComparator, b as formatNumber, c as getCurrencySymbol, f as formatDate, g as getCurrentYear, a as getCurrentMonth } from "./index-Bu4S7kG8.mjs";
11
+ import { i as isRelativePath, b as buildPath } from "./index-BmaWfWLV.mjs";
12
+ import { u as usePrimaryColors } from "./index-QazOxABc.mjs";
13
13
  import { t } from "i18next";
14
14
  import Markdown from "react-markdown";
15
15
  const ONE_LINE_HEIGHT = 24;
@@ -80,10 +80,10 @@ const LinkButton = ({
80
80
  ...boxProps
81
81
  }) => {
82
82
  var _a;
83
- const { configs } = useSiteContext();
83
+ const { config } = useSiteContext();
84
84
  const { color, invertedColor } = usePrimaryColors();
85
- const isInvertedColor = (_a = configs == null ? void 0 : configs.theme) == null ? void 0 : _a.isInvertedColor;
86
- const isInternalLink = linkType === "redirect" || (href == null ? void 0 : href.startsWith("/"));
85
+ const isInvertedColor = (_a = config == null ? void 0 : config.theme) == null ? void 0 : _a.isInvertedColor;
86
+ const isInternalLink = linkType === "redirect" || isRelativePath(href);
87
87
  const LinkComponent = isInternalLink ? Link : Link$1;
88
88
  const hrefKey = isInternalLink ? "to" : "href";
89
89
  const hrefValue = linkType === "redirect" ? `/follow?to=${href}` : href;
@@ -450,6 +450,7 @@ const GameDemo = ({ name, src, href, previewImage, previewImageFit, ...boxProps
450
450
  setIsLoaded(true);
451
451
  }
452
452
  function handleExit() {
453
+ document.body.style.overflowY = "auto";
453
454
  onClose();
454
455
  setIsRunning(false);
455
456
  }
@@ -514,7 +515,7 @@ function stringifyArray(array) {
514
515
  function stringifyLanguageArray(languages) {
515
516
  return languages.length > VISIBLE_LANGUAGE_NUMBER ? `${stringifyArray(languages.slice(0, VISIBLE_LANGUAGE_NUMBER))}, +${languages.length - VISIBLE_LANGUAGE_NUMBER}` : stringifyArray(languages);
516
517
  }
517
- function getGameInfoItemValue(key, value, currency) {
518
+ function getGameInfoItemValue(key, value, locale, currency) {
518
519
  let formattedValue = "";
519
520
  if (typeof value !== "string") {
520
521
  if (key === GameCharacteristic.Rtp) {
@@ -524,7 +525,7 @@ function getGameInfoItemValue(key, value, currency) {
524
525
  if (Array.isArray(currency)) {
525
526
  const [primary, ...secondaries] = currency || ["USD"];
526
527
  const primaryValue = formatNumber(value, { currency: primary });
527
- formattedValue = secondaries.length ? `${primaryValue} (${secondaries.map((currency2) => getCurrencySymbol(currency2)).join(", ")})` : primaryValue;
528
+ formattedValue = secondaries.length ? `${primaryValue} (${secondaries.map((currency2) => getCurrencySymbol(currency2, locale)).join(", ")})` : primaryValue;
528
529
  } else {
529
530
  formattedValue = formatNumber(value, { currency });
530
531
  }
@@ -540,7 +541,7 @@ function getGameInfoItemValue(key, value, currency) {
540
541
  }
541
542
  }
542
543
  if (key === GameCharacteristic.ReleaseDate) {
543
- formattedValue = formatDate({ value, options: { year: "numeric", month: "long" } });
544
+ formattedValue = formatDate({ value, locale, options: { year: "numeric", month: "long" } });
544
545
  }
545
546
  if (key === GameCharacteristic.Volatility) {
546
547
  formattedValue = stringifyVolatility(value);
@@ -551,9 +552,10 @@ function getGameInfoItemValue(key, value, currency) {
551
552
  return formattedValue;
552
553
  }
553
554
  const GameInfo = ({ info }) => {
554
- const { metadata } = useSiteContext();
555
- const { currency } = metadata;
556
555
  const { t: t2 } = useTranslation("gameInfo");
556
+ const { localization } = useSiteContext();
557
+ const locale = localization.currentLocale.code;
558
+ const currency = localization.currency;
557
559
  return /* @__PURE__ */ jsx(
558
560
  Box,
559
561
  {
@@ -572,7 +574,7 @@ const GameInfo = ({ info }) => {
572
574
  return null;
573
575
  }
574
576
  const feature = itemKey;
575
- const value = getGameInfoItemValue(feature, itemValue, currency);
577
+ const value = getGameInfoItemValue(feature, itemValue, locale, currency);
576
578
  return /* @__PURE__ */ jsx(GameInfoItem, { title: t2(`feature.${feature}`), value }, itemKey);
577
579
  })
578
580
  ] }, group)) })
@@ -610,14 +612,15 @@ const Brand$1 = ({ brand }) => {
610
612
  };
611
613
  const Copyright = () => {
612
614
  const { metadata } = useSiteContext();
613
- const { name: siteName } = metadata;
614
615
  const { t: t2 } = useTranslation("footer");
615
- return /* @__PURE__ */ jsx(Text, { as: "small", colorScheme: "gray", display: "flex", align: "center", justifyContent: "center", children: t2("copyright", { year: getCurrentYear(), siteName }) });
616
+ const siteName = metadata.name;
617
+ const lang = metadata.lang;
618
+ return /* @__PURE__ */ jsx(Text, { as: "small", colorScheme: "gray", display: "flex", align: "center", justifyContent: "center", children: t2("copyright", { year: getCurrentYear(lang), siteName }) });
616
619
  };
617
620
  const Disclaimer = () => {
618
621
  const { metadata } = useSiteContext();
619
- const { name: siteName } = metadata;
620
622
  const { t: t2 } = useTranslation("footer");
623
+ const siteName = metadata.name;
621
624
  return /* @__PURE__ */ jsxs(Text, { as: "small", colorScheme: "gray", fontSize: "sm", children: [
622
625
  /* @__PURE__ */ jsx(Text, { as: "span", fontWeight: "bold", color: "red.600", children: t2("disclaimer.title") }),
623
626
  t2("disclaimer.description", { siteName })
@@ -638,29 +641,29 @@ const Navigation$1 = ({ menu }) => {
638
641
  spacing: 4,
639
642
  justifyItems: { base: "flex-start", md: "center" },
640
643
  justifyContent: "space-between",
641
- children: menu.map(({ path, label }, index) => /* @__PURE__ */ jsx(Flex, { as: "li", children: /* @__PURE__ */ jsx(
644
+ children: menu.map(({ slug, label }, index) => /* @__PURE__ */ jsx(Flex, { as: "li", children: /* @__PURE__ */ jsx(
642
645
  Text,
643
646
  {
644
647
  as: Link,
645
- to: path,
648
+ to: slug,
646
649
  fontSize: "md",
647
650
  fontWeight: "semibold",
648
651
  colorScheme: "gray",
649
652
  _hover: { textDecoration: "none", color: "brand.400" },
650
653
  children: label
651
- },
652
- path
654
+ }
653
655
  ) }, index))
654
656
  }
655
657
  );
656
658
  };
657
659
  const Footer = () => {
658
- var _a, _b, _c;
659
- const { configs } = useSiteContext();
660
- const navigation = ((_a = configs == null ? void 0 : configs.footer) == null ? void 0 : _a.navigation) ?? [];
661
- const extra = (_b = configs == null ? void 0 : configs.footer) == null ? void 0 : _b.extra;
662
- const showDisclaimer = ((_c = configs == null ? void 0 : configs.footer) == null ? void 0 : _c.showDisclaimer) ?? true;
663
- const hasNavigation = !!navigation.length;
660
+ var _a, _b;
661
+ const { navigation, localization, config } = useSiteContext();
662
+ const currentLocale = localization.currentLocale;
663
+ const menu = navigation.footer[currentLocale.code] ?? [];
664
+ const extra = (_a = config == null ? void 0 : config.footer) == null ? void 0 : _a.extra;
665
+ const showDisclaimer = ((_b = config == null ? void 0 : config.footer) == null ? void 0 : _b.showDisclaimer) ?? true;
666
+ const hasNavigation = !!menu.length;
664
667
  const hasExtra = !!extra;
665
668
  return /* @__PURE__ */ jsx(
666
669
  Box,
@@ -670,7 +673,7 @@ const Footer = () => {
670
673
  color: useColorModeValue("gray.700", "gray.200"),
671
674
  py: 4,
672
675
  children: /* @__PURE__ */ jsxs(Container, { children: [
673
- hasNavigation && /* @__PURE__ */ jsx(Navigation$1, { menu: navigation }),
676
+ hasNavigation && /* @__PURE__ */ jsx(Navigation$1, { menu }),
674
677
  hasExtra && /* @__PURE__ */ jsx(Extra, { children: extra }),
675
678
  showDisclaimer && /* @__PURE__ */ jsx(Disclaimer, {}),
676
679
  /* @__PURE__ */ jsx(Brand$1, { brand: /* @__PURE__ */ jsx(Logo, {}) }),
@@ -682,13 +685,109 @@ const Footer = () => {
682
685
  const Brand = ({ brand }) => {
683
686
  return /* @__PURE__ */ jsx(Link, { to: "/", children: brand });
684
687
  };
685
- const NavLink = forwardRef(({ path, label }, ref) => {
688
+ const FranceIcon = (props) => {
689
+ return /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512", width: "1em", height: "1em", ...props, children: [
690
+ /* @__PURE__ */ jsx("mask", { id: "circleFlagsFr0", children: /* @__PURE__ */ jsx("circle", { cx: "256", cy: "256", r: "256", fill: "#fff" }) }),
691
+ /* @__PURE__ */ jsxs("g", { mask: "url(#circleFlagsFr0)", children: [
692
+ /* @__PURE__ */ jsx("path", { fill: "#eee", d: "M167 0h178l25.9 252.3L345 512H167l-29.8-253.4z" }),
693
+ /* @__PURE__ */ jsx("path", { fill: "#0052b4", d: "M0 0h167v512H0z" }),
694
+ /* @__PURE__ */ jsx("path", { fill: "#d80027", d: "M345 0h167v512H345z" })
695
+ ] })
696
+ ] });
697
+ };
698
+ const GermanyIcon = (props) => {
699
+ return /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512", width: "1em", height: "1em", ...props, children: [
700
+ /* @__PURE__ */ jsx("mask", { id: "circleFlagsDe0", children: /* @__PURE__ */ jsx("circle", { cx: "256", cy: "256", r: "256", fill: "#fff" }) }),
701
+ /* @__PURE__ */ jsxs("g", { mask: "url(#circleFlagsDe0)", children: [
702
+ /* @__PURE__ */ jsx("path", { fill: "#ffda44", d: "m0 345l256.7-25.5L512 345v167H0z" }),
703
+ /* @__PURE__ */ jsx("path", { fill: "#d80027", d: "m0 167l255-23l257 23v178H0z" }),
704
+ /* @__PURE__ */ jsx("path", { fill: "#333", d: "M0 0h512v167H0z" })
705
+ ] })
706
+ ] });
707
+ };
708
+ const GlobeIcon = (props) => {
709
+ return /* @__PURE__ */ jsx("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 496", width: "1em", height: "1em", ...props, children: /* @__PURE__ */ jsx(
710
+ "path",
711
+ {
712
+ fill: "currentColor",
713
+ d: "M336.5 160C322 70.7 287.8 8 248 8s-74 62.7-88.5 152zM152 256c0 22.2 1.2 43.5 3.3 64h185.3c2.1-20.5 3.3-41.8 3.3-64s-1.2-43.5-3.3-64H155.3c-2.1 20.5-3.3 41.8-3.3 64m324.7-96c-28.6-67.9-86.5-120.4-158-141.6c24.4 33.8 41.2 84.7 50 141.6zM177.2 18.4C105.8 39.6 47.8 92.1 19.3 160h108c8.7-56.9 25.5-107.8 49.9-141.6M487.4 192H372.7c2.1 21 3.3 42.5 3.3 64s-1.2 43-3.3 64h114.6c5.5-20.5 8.6-41.8 8.6-64s-3.1-43.5-8.5-64M120 256c0-21.5 1.2-43 3.3-64H8.6C3.2 212.5 0 233.8 0 256s3.2 43.5 8.6 64h114.6c-2-21-3.2-42.5-3.2-64m39.5 96c14.5 89.3 48.7 152 88.5 152s74-62.7 88.5-152zm159.3 141.6c71.4-21.2 129.4-73.7 158-141.6h-108c-8.8 56.9-25.6 107.8-50 141.6M19.3 352c28.6 67.9 86.5 120.4 158 141.6c-24.4-33.8-41.2-84.7-50-141.6z"
714
+ }
715
+ ) });
716
+ };
717
+ const ItalyIcon = (props) => {
718
+ return /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512", width: "1em", height: "1em", ...props, children: [
719
+ /* @__PURE__ */ jsx("mask", { id: "circleFlagsIt0", children: /* @__PURE__ */ jsx("circle", { cx: "256", cy: "256", r: "256", fill: "#fff" }) }),
720
+ /* @__PURE__ */ jsxs("g", { mask: "url(#circleFlagsIt0)", children: [
721
+ /* @__PURE__ */ jsx("path", { fill: "#eee", d: "M167 0h178l25.9 252.3L345 512H167l-29.8-253.4z" }),
722
+ /* @__PURE__ */ jsx("path", { fill: "#6da544", d: "M0 0h167v512H0z" }),
723
+ /* @__PURE__ */ jsx("path", { fill: "#d80027", d: "M345 0h167v512H345z" })
724
+ ] })
725
+ ] });
726
+ };
727
+ const RussiaIcon = (props) => {
728
+ return /* @__PURE__ */ jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 512 512", width: "1em", height: "1em", ...props, children: [
729
+ /* @__PURE__ */ jsx("mask", { id: "circleFlagsRu0", children: /* @__PURE__ */ jsx("circle", { cx: "256", cy: "256", r: "256", fill: "#fff" }) }),
730
+ /* @__PURE__ */ jsxs("g", { mask: "url(#circleFlagsRu0)", children: [
731
+ /* @__PURE__ */ jsx("path", { fill: "#0052b4", d: "M512 170v172l-256 32L0 342V170l256-32z" }),
732
+ /* @__PURE__ */ jsx("path", { fill: "#eee", d: "M512 0v170H0V0Z" }),
733
+ /* @__PURE__ */ jsx("path", { fill: "#d80027", d: "M512 342v170H0V342Z" })
734
+ ] })
735
+ ] });
736
+ };
737
+ function getMappedIcon(code) {
738
+ let icon = GlobeIcon;
739
+ switch (code) {
740
+ case "de":
741
+ icon = GermanyIcon;
742
+ break;
743
+ case "it":
744
+ icon = ItalyIcon;
745
+ break;
746
+ case "ru":
747
+ icon = RussiaIcon;
748
+ break;
749
+ case "fr":
750
+ icon = FranceIcon;
751
+ break;
752
+ case "en":
753
+ default:
754
+ icon = GlobeIcon;
755
+ break;
756
+ }
757
+ return icon;
758
+ }
759
+ const LocaleSwitcher = ({ currentLocale, locales }) => {
760
+ const localeCode = currentLocale.code;
761
+ const localeIcon = getMappedIcon(localeCode);
762
+ const localeMenuItems = useMemo(
763
+ () => locales.map((locale) => ({ ...locale, icon: getMappedIcon(locale.code) })),
764
+ [locales]
765
+ );
766
+ return /* @__PURE__ */ jsxs(Menu, { placement: "bottom-end", children: [
767
+ /* @__PURE__ */ jsx(
768
+ MenuButton,
769
+ {
770
+ as: Button,
771
+ rightIcon: /* @__PURE__ */ jsx(ChevronDownIcon, {}),
772
+ w: { base: 20, md: "28" },
773
+ px: { base: 1, md: 4 },
774
+ size: { base: "sm", md: "lg" },
775
+ children: /* @__PURE__ */ jsxs(HStack, { children: [
776
+ /* @__PURE__ */ jsx(Icon, { as: localeIcon }),
777
+ /* @__PURE__ */ jsx("span", { children: localeCode.toUpperCase() })
778
+ ] })
779
+ }
780
+ ),
781
+ /* @__PURE__ */ jsx(MenuList, { minW: "fit-content", children: localeMenuItems.map(({ code, name, icon }) => /* @__PURE__ */ jsx(MenuItem, { as: Link, to: `/${code}`, icon: /* @__PURE__ */ jsx(Icon, { as: icon, w: 4, h: 4 }), children: name }, code)) })
782
+ ] });
783
+ };
784
+ const NavLink = forwardRef(({ slug, label }, ref) => {
686
785
  return /* @__PURE__ */ jsx(
687
786
  Text,
688
787
  {
689
788
  ref,
690
789
  as: Link,
691
- to: path,
790
+ to: slug,
692
791
  p: 2,
693
792
  fontWeight: "semibold",
694
793
  _hover: { textDecoration: "none", color: "brand.400" },
@@ -697,7 +796,7 @@ const NavLink = forwardRef(({ path, label }, ref) => {
697
796
  );
698
797
  });
699
798
  NavLink.displayName = "NavLink";
700
- const NavList$1 = ({ path, label, children }) => {
799
+ const NavList$1 = ({ slug, label, children }) => {
701
800
  const background = useColorModeValue("white", "gray.800");
702
801
  const backgroundHover = useColorModeValue("brand.50", "gray.900");
703
802
  return /* @__PURE__ */ jsxs(Popover, { trigger: "hover", placement: "bottom-start", children: [
@@ -712,22 +811,37 @@ const NavList$1 = ({ path, label, children }) => {
712
811
  children: label
713
812
  }
714
813
  ) }),
715
- /* @__PURE__ */ jsx(PopoverContent, { p: 2, border: 0, minW: "sm", rounded: "xl", boxShadow: "xl", bg: background, children: /* @__PURE__ */ jsx(List$1, { spacing: 2, p: 0, children: children == null ? void 0 : children.map((child, index) => /* @__PURE__ */ jsx(ListItem, { rounded: "md", _hover: { bg: backgroundHover }, children: /* @__PURE__ */ jsxs(Flex, { as: Link, to: `${path}${child.path}`, p: 2, role: "group", children: [
716
- /* @__PURE__ */ jsx(Text, { fontWeight: 500, transition: "all .3s ease", _groupHover: { color: "brand.400" }, children: child.label }),
717
- /* @__PURE__ */ jsx(
718
- Flex,
719
- {
720
- flex: 1,
721
- justify: "flex-end",
722
- align: "center",
723
- opacity: 0,
724
- transition: "all .3s ease",
725
- transform: "translateX(-10px)",
726
- _groupHover: { opacity: 1, transform: "translateX(0)" },
727
- children: /* @__PURE__ */ jsx(Icon, { as: ChevronRightIcon, color: "brand.400", w: 5, h: 5 })
728
- }
729
- )
730
- ] }) }, index)) }) })
814
+ /* @__PURE__ */ jsx(
815
+ PopoverContent,
816
+ {
817
+ p: 2,
818
+ border: 0,
819
+ minW: "sm",
820
+ maxH: 300,
821
+ overflowY: "auto",
822
+ rounded: "xl",
823
+ boxShadow: "xl",
824
+ bg: background,
825
+ children: /* @__PURE__ */ jsx(List$1, { spacing: 2, p: 0, children: children == null ? void 0 : children.map((child, index) => {
826
+ return /* @__PURE__ */ jsx(ListItem, { rounded: "md", _hover: { bg: backgroundHover }, children: /* @__PURE__ */ jsxs(Flex, { as: Link, to: buildPath(child.slug, slug), p: 2, role: "group", children: [
827
+ /* @__PURE__ */ jsx(Text, { fontWeight: 500, transition: "all .3s ease", _groupHover: { color: "brand.400" }, children: child.label }),
828
+ /* @__PURE__ */ jsx(
829
+ Flex,
830
+ {
831
+ flex: 1,
832
+ justify: "flex-end",
833
+ align: "center",
834
+ opacity: 0,
835
+ transition: "all .3s ease",
836
+ transform: "translateX(-10px)",
837
+ _groupHover: { opacity: 1, transform: "translateX(0)" },
838
+ children: /* @__PURE__ */ jsx(Icon, { as: ChevronRightIcon, color: "brand.400", w: 5, h: 5 })
839
+ }
840
+ )
841
+ ] }) }, index);
842
+ }) })
843
+ }
844
+ )
731
845
  ] });
732
846
  };
733
847
  const DesktopNavigation = ({ menu }) => {
@@ -737,7 +851,7 @@ const DesktopNavigation = ({ menu }) => {
737
851
  }) });
738
852
  };
739
853
  const CHEVRON_DOWN_ICON_SIZE = "1.5rem";
740
- const NavList = ({ path, label, children, isExpanded, onExpand }) => {
854
+ const NavList = ({ slug, label, children, isExpanded, onExpand }) => {
741
855
  return /* @__PURE__ */ jsxs(Stack, { flex: 1, children: [
742
856
  /* @__PURE__ */ jsxs(
743
857
  Flex,
@@ -763,7 +877,19 @@ const NavList = ({ path, label, children, isExpanded, onExpand }) => {
763
877
  ]
764
878
  }
765
879
  ),
766
- /* @__PURE__ */ jsx(Collapse, { in: isExpanded, transition: { enter: { ease: "easeIn" }, exit: { duration: 0.2 } }, children: /* @__PURE__ */ jsx(List$1, { ml: 2, pl: 0, borderLeft: 1, borderStyle: "solid", borderColor: useColorModeValue("gray.200", "gray.700"), children: children == null ? void 0 : children.map((child, index) => /* @__PURE__ */ jsx(Flex, { as: "li", role: "listitem", children: /* @__PURE__ */ jsx(Text, { as: Link, to: `${path}${child.path}`, p: 2, fontSize: "sm", children: child.label }) }, index)) }) })
880
+ /* @__PURE__ */ jsx(Collapse, { in: isExpanded, transition: { enter: { ease: "easeIn" }, exit: { duration: 0.2 } }, children: /* @__PURE__ */ jsx(
881
+ List$1,
882
+ {
883
+ ml: 2,
884
+ pl: 0,
885
+ maxH: 300,
886
+ overflowY: "auto",
887
+ borderLeft: 1,
888
+ borderStyle: "solid",
889
+ borderColor: useColorModeValue("gray.200", "gray.700"),
890
+ children: children == null ? void 0 : children.map((child, index) => /* @__PURE__ */ jsx(Flex, { as: "li", role: "listitem", children: /* @__PURE__ */ jsx(Text, { as: Link, to: buildPath(child.slug, slug), p: 2, fontSize: "sm", children: child.label }) }, index))
891
+ }
892
+ ) })
767
893
  ] });
768
894
  };
769
895
  const CLOSE_ICON_SIZE = "0.75rem";
@@ -818,12 +944,15 @@ const Navigation = ({ menu }) => {
818
944
  ] });
819
945
  };
820
946
  const Header = () => {
821
- var _a, _b;
822
- const { configs } = useSiteContext();
823
- const navigation = ((_a = configs == null ? void 0 : configs.header) == null ? void 0 : _a.navigation) ?? [];
824
- const toolbar = (_b = configs == null ? void 0 : configs.header) == null ? void 0 : _b.toolbar;
825
- const hasToolbar = !!toolbar;
826
- const hasNavigation = !!navigation.length;
947
+ var _a;
948
+ const { navigation, localization, config } = useSiteContext();
949
+ const locales = localization.locales;
950
+ const currentLocale = localization.currentLocale;
951
+ const menu = navigation.header[currentLocale.code] ?? [];
952
+ const toolbar = (_a = config == null ? void 0 : config.header) == null ? void 0 : _a.toolbar;
953
+ const isMultiLanguage = locales.length > 1;
954
+ const hasNavigation = !!menu.length;
955
+ const hasToolbar = !!toolbar || isMultiLanguage;
827
956
  return /* @__PURE__ */ jsx(
828
957
  Box,
829
958
  {
@@ -846,8 +975,11 @@ const Header = () => {
846
975
  align: "center",
847
976
  gap: 2,
848
977
  children: [
849
- hasNavigation && /* @__PURE__ */ jsx(Flex, { flex: { base: 0, md: 1 }, children: /* @__PURE__ */ jsx(Navigation, { menu: navigation }) }),
850
- hasToolbar && /* @__PURE__ */ jsx(Flex, { gap: 2, flex: { base: 1, md: 0 }, justifyContent: "flex-end", children: toolbar })
978
+ hasNavigation && /* @__PURE__ */ jsx(Flex, { flex: { base: 0, md: 1 }, children: /* @__PURE__ */ jsx(Navigation, { menu }) }),
979
+ hasToolbar && /* @__PURE__ */ jsxs(Flex, { gap: 2, flex: { base: 1, md: 0 }, justifyContent: "flex-end", children: [
980
+ !!toolbar && toolbar,
981
+ isMultiLanguage && /* @__PURE__ */ jsx(LocaleSwitcher, { currentLocale, locales })
982
+ ] })
851
983
  ]
852
984
  }
853
985
  )
@@ -1026,19 +1158,21 @@ function replacePlaceholders(text, placeholders) {
1026
1158
  });
1027
1159
  return text;
1028
1160
  }
1029
- const Seo = ({ children, siteMetadata, title, description, lang }) => {
1030
- const { name: siteName, lang: defaultLang, seo } = siteMetadata;
1161
+ const Seo = ({ children, title, description, lang }) => {
1162
+ const { metadata } = useSiteContext();
1163
+ const { name: siteName, lang: defaultLang, seo } = metadata;
1031
1164
  const { title: defaultTitle, description: defaultDescription } = seo;
1165
+ const siteLang = lang || defaultLang;
1032
1166
  const placeholders = useMemo(
1033
1167
  () => ({
1034
1168
  siteName,
1035
- currentYear: getCurrentYear(),
1036
- currentMonth: getCurrentMonth()
1169
+ currentYear: getCurrentYear(siteLang),
1170
+ currentMonth: getCurrentMonth(siteLang)
1037
1171
  }),
1038
- [siteName]
1172
+ [siteName, siteLang]
1039
1173
  );
1040
1174
  return /* @__PURE__ */ jsxs(Fragment, { children: [
1041
- /* @__PURE__ */ jsx("html", { lang: lang ?? defaultLang }),
1175
+ /* @__PURE__ */ jsx("html", { lang: siteLang }),
1042
1176
  /* @__PURE__ */ jsx("title", { children: title ? typeof title === "string" ? replacePlaceholders(title, placeholders) : title(placeholders) : defaultTitle }),
1043
1177
  /* @__PURE__ */ jsx(
1044
1178
  "meta",