ublo-lib 1.20.17 → 1.21.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 (117) hide show
  1. package/es/esf/components/loyal-customers/api.js +4 -4
  2. package/es/lbm/lumiplan/api.d.ts +8 -0
  3. package/es/lbm/lumiplan/api.d.ts.map +1 -0
  4. package/es/lbm/lumiplan/api.js +33 -0
  5. package/es/lbm/lumiplan/domain.d.ts +8 -0
  6. package/es/lbm/lumiplan/domain.d.ts.map +1 -0
  7. package/es/lbm/lumiplan/domain.js +30 -0
  8. package/es/lbm/lumiplan/domain.module.css +111 -0
  9. package/es/lbm/lumiplan/i18n/en.json +1 -0
  10. package/es/lbm/lumiplan/i18n/fr.json +255 -0
  11. package/es/lbm/lumiplan/i18n/translations.d.ts +7 -0
  12. package/es/lbm/lumiplan/i18n/translations.d.ts.map +1 -0
  13. package/es/lbm/lumiplan/i18n/translations.js +20 -0
  14. package/es/lbm/lumiplan/icons/alert.js +23 -0
  15. package/es/lbm/lumiplan/icons/avalanche-risk.js +16 -0
  16. package/es/lbm/lumiplan/icons/cabin.js +16 -0
  17. package/es/lbm/lumiplan/icons/check.js +18 -0
  18. package/es/lbm/lumiplan/icons/close.js +23 -0
  19. package/es/lbm/lumiplan/icons/cloud.js +18 -0
  20. package/es/lbm/lumiplan/icons/cloud.module.css +9 -0
  21. package/es/lbm/lumiplan/icons/dawn.js +21 -0
  22. package/es/lbm/lumiplan/icons/fog.js +37 -0
  23. package/es/lbm/lumiplan/icons/fog.module.css +34 -0
  24. package/es/lbm/lumiplan/icons/information.js +23 -0
  25. package/es/lbm/lumiplan/icons/isothermal.js +27 -0
  26. package/es/lbm/lumiplan/icons/lifts/index.js +5 -0
  27. package/es/lbm/lumiplan/icons/lifts/tapis-roulant.js +18 -0
  28. package/es/lbm/lumiplan/icons/lifts/telecabine.js +18 -0
  29. package/es/lbm/lumiplan/icons/lifts/telesiege-debrayable.js +29 -0
  30. package/es/lbm/lumiplan/icons/lifts/telesiege.js +18 -0
  31. package/es/lbm/lumiplan/icons/lifts/teleski.js +18 -0
  32. package/es/lbm/lumiplan/icons/night.js +16 -0
  33. package/es/lbm/lumiplan/icons/rain.js +27 -0
  34. package/es/lbm/lumiplan/icons/rain.module.css +27 -0
  35. package/es/lbm/lumiplan/icons/rainy.js +31 -0
  36. package/es/lbm/lumiplan/icons/rainy.module.css +33 -0
  37. package/es/lbm/lumiplan/icons/reload.js +32 -0
  38. package/es/lbm/lumiplan/icons/road-condition.js +30 -0
  39. package/es/lbm/lumiplan/icons/slopes.js +16 -0
  40. package/es/lbm/lumiplan/icons/snow-cover.js +18 -0
  41. package/es/lbm/lumiplan/icons/snow.js +33 -0
  42. package/es/lbm/lumiplan/icons/snow.module.css +28 -0
  43. package/es/lbm/lumiplan/icons/storm.js +27 -0
  44. package/es/lbm/lumiplan/icons/storm.module.css +25 -0
  45. package/es/lbm/lumiplan/icons/sun.js +23 -0
  46. package/es/lbm/lumiplan/icons/sun.module.css +14 -0
  47. package/es/lbm/lumiplan/icons/sunny.js +29 -0
  48. package/es/lbm/lumiplan/icons/sunny.module.css +11 -0
  49. package/es/lbm/lumiplan/icons/time.js +23 -0
  50. package/es/lbm/lumiplan/icons/trails/boarder-cross.js +22 -0
  51. package/es/lbm/lumiplan/icons/trails/champ-de-bosse.js +20 -0
  52. package/es/lbm/lumiplan/icons/trails/freeride.js +17 -0
  53. package/es/lbm/lumiplan/icons/trails/index.js +12 -0
  54. package/es/lbm/lumiplan/icons/trails/luge.js +17 -0
  55. package/es/lbm/lumiplan/icons/trails/pieton.js +17 -0
  56. package/es/lbm/lumiplan/icons/trails/piste-eclairee.js +20 -0
  57. package/es/lbm/lumiplan/icons/trails/raquette.js +66 -0
  58. package/es/lbm/lumiplan/icons/trails/ski-alpin.js +17 -0
  59. package/es/lbm/lumiplan/icons/trails/ski-fond.js +17 -0
  60. package/es/lbm/lumiplan/icons/trails/snowpark.js +17 -0
  61. package/es/lbm/lumiplan/icons/trails/vtt.js +20 -0
  62. package/es/lbm/lumiplan/icons/trails/zone-freeride.js +17 -0
  63. package/es/lbm/lumiplan/icons/warning.js +23 -0
  64. package/es/lbm/lumiplan/icons/wind.js +30 -0
  65. package/es/lbm/lumiplan/index.d.ts +3 -0
  66. package/es/lbm/lumiplan/index.d.ts.map +1 -0
  67. package/es/lbm/lumiplan/index.js +2 -0
  68. package/es/lbm/lumiplan/lumiplan.d.ts +2 -0
  69. package/es/lbm/lumiplan/lumiplan.d.ts.map +1 -0
  70. package/es/lbm/lumiplan/lumiplan.js +118 -0
  71. package/es/lbm/lumiplan/lumiplan.module.css +3 -0
  72. package/es/lbm/lumiplan/opening.d.ts +8 -0
  73. package/es/lbm/lumiplan/opening.d.ts.map +1 -0
  74. package/es/lbm/lumiplan/opening.js +33 -0
  75. package/es/lbm/lumiplan/opening.module.css +88 -0
  76. package/es/lbm/lumiplan/pois.d.ts +8 -0
  77. package/es/lbm/lumiplan/pois.d.ts.map +1 -0
  78. package/es/lbm/lumiplan/pois.js +150 -0
  79. package/es/lbm/lumiplan/pois.module.css +137 -0
  80. package/es/lbm/lumiplan/resort-selector.d.ts +12 -0
  81. package/es/lbm/lumiplan/resort-selector.d.ts.map +1 -0
  82. package/es/lbm/lumiplan/resort-selector.js +18 -0
  83. package/es/lbm/lumiplan/resort-selector.module.css +28 -0
  84. package/es/lbm/lumiplan/road-condition.d.ts +8 -0
  85. package/es/lbm/lumiplan/road-condition.d.ts.map +1 -0
  86. package/es/lbm/lumiplan/road-condition.js +26 -0
  87. package/es/lbm/lumiplan/road-condition.module.css +79 -0
  88. package/es/lbm/lumiplan/todays-tips.d.ts +8 -0
  89. package/es/lbm/lumiplan/todays-tips.d.ts.map +1 -0
  90. package/es/lbm/lumiplan/todays-tips.js +23 -0
  91. package/es/lbm/lumiplan/todays-tips.module.css +35 -0
  92. package/es/lbm/lumiplan/types.d.ts +281 -0
  93. package/es/lbm/lumiplan/types.d.ts.map +1 -0
  94. package/es/lbm/lumiplan/types.js +1 -0
  95. package/es/lbm/lumiplan/weather/avalanche-risk.d.ts +4 -0
  96. package/es/lbm/lumiplan/weather/avalanche-risk.d.ts.map +1 -0
  97. package/es/lbm/lumiplan/weather/avalanche-risk.js +12 -0
  98. package/es/lbm/lumiplan/weather/avalanche-risk.module.css +21 -0
  99. package/es/lbm/lumiplan/weather/index.d.ts +3 -0
  100. package/es/lbm/lumiplan/weather/index.d.ts.map +1 -0
  101. package/es/lbm/lumiplan/weather/index.js +2 -0
  102. package/es/lbm/lumiplan/weather/snow-data.d.ts +8 -0
  103. package/es/lbm/lumiplan/weather/snow-data.d.ts.map +1 -0
  104. package/es/lbm/lumiplan/weather/snow-data.js +8 -0
  105. package/es/lbm/lumiplan/weather/snow-data.module.css +41 -0
  106. package/es/lbm/lumiplan/weather/weather-data.d.ts +9 -0
  107. package/es/lbm/lumiplan/weather/weather-data.d.ts.map +1 -0
  108. package/es/lbm/lumiplan/weather/weather-data.js +8 -0
  109. package/es/lbm/lumiplan/weather/weather-data.module.css +61 -0
  110. package/es/lbm/lumiplan/weather/weather-icon.d.ts +23 -0
  111. package/es/lbm/lumiplan/weather/weather-icon.d.ts.map +1 -0
  112. package/es/lbm/lumiplan/weather/weather-icon.js +30 -0
  113. package/es/lbm/lumiplan/weather/weather.d.ts +8 -0
  114. package/es/lbm/lumiplan/weather/weather.d.ts.map +1 -0
  115. package/es/lbm/lumiplan/weather/weather.js +74 -0
  116. package/es/lbm/lumiplan/weather/weather.module.css +118 -0
  117. package/package.json +2 -1
@@ -0,0 +1,17 @@
1
+ import * as React from "react";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ export default function ZoneFreerideIcon({
4
+ width = 24,
5
+ height = 24
6
+ }) {
7
+ return _jsx("svg", {
8
+ height: height,
9
+ viewBox: "0 0 24 24",
10
+ width: width,
11
+ children: _jsx("path", {
12
+ fillRule: "evenodd",
13
+ clipRule: "evenodd",
14
+ d: "m23.64 21.93.36-.4a75.14 75.14 0 0 0-5.18-9.84c-1.98-3.17-4.07-6.3-6.14-9.5-.4-.4-.78-.05-.78-.05L8.23 7.42C7.13 6.64 6.84 5.03 5.18 5c-.73.94-1.5 1.85-2.13 2.83-1.04 1.62-2 3.31-2.99 4.98-.08.14-.04.34-.06.56.24.02.4.06.58.08l1.92-3.37.03-.04c2.03.96 2.77.92 3.57-.16-.28-.43-.62-.22-.96-.1-.77.26-1.4.06-2.03-.65l2.57-3.4 1.99 2.54c-.33.5-.55.88-.79 1.27A75.68 75.68 0 0 0 .86 20.88c-.16.36-.58.77-.18 1.23.6-.16.6-.18.87-.73l.02-.04c1-2.08 1.94-4.17 3-6.22.93-1.78 2.01-3.49 3.08-5.31 1.6 1.06 3.15.68 4.75.1-.04 1.28-.78 1.8-1.68 2.22-.73.34-1.5.63-2.17 1.09a5.72 5.72 0 0 0-1.4 8.1c.05.1.2.14.35.23l.37-.4-.24-.53c-1.55-2.55-.73-6.08 2.68-7.44.47-.18.95-.34 1.37-.58 1.12-.7 1.74-1.71 1.54-3.08a5.52 5.52 0 0 0-1.3-2.94c-.18.08-.34.16-.56.24l.82 1.96c-1.5 1.09-2.6 1.17-3.93.2 1.22-1.96 2.57-3.85 3.97-5.82 1.24 1.79 2.43 3.46 3.61 5.4l-1.22-.34-1.45-2.09-.36.08c0 .24-.1.53-.02.7.22.49.56.93.83 1.41.44.8.66 1.67.54 2.59a3.57 3.57 0 0 1-1.73 2.75c-.66.4-1.36.72-2.03 1.08-1.74.99-2.22 2.87-1.08 4.5.36.5.84.94 1.35 1.3 1.2.84 2.56 1.29 3.99 1.57.42.08.88.28 1.26-.14.02-.53-.36-.55-.72-.63-1.04-.3-2.13-.5-3.09-.92A5.2 5.2 0 0 1 10.17 19c-1.12-1.3-.76-2.81.77-3.6.54-.3 1.14-.52 1.68-.86a4.69 4.69 0 0 0 2.41-3.71c.04-.52-.04-1.04-.08-1.6a3.9 3.9 0 0 1 2.59 1.9 92.36 92.36 0 0 1 5.12 9.4c.18.4.38.8.6 1.2.06.08.22.12.38.2Z"
15
+ })
16
+ });
17
+ }
@@ -0,0 +1,23 @@
1
+ import * as React from "react";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { jsxs as _jsxs } from "react/jsx-runtime";
4
+ const WarningIcon = ({
5
+ width = 24,
6
+ height = 24
7
+ }) => {
8
+ return _jsxs("svg", {
9
+ height: height,
10
+ viewBox: "0 0 24 24",
11
+ width: width,
12
+ children: [_jsx("path", {
13
+ fillRule: "evenodd",
14
+ clipRule: "evenodd",
15
+ d: "M7.153 1.293A1 1 0 0 1 7.86 1h8.28a1 1 0 0 1 .707.293l5.86 5.86A1 1 0 0 1 23 7.86v8.28a1 1 0 0 1-.293.707l-5.86 5.86a1 1 0 0 1-.707.293H7.86a1 1 0 0 1-.707-.293l-5.86-5.86A1 1 0 0 1 1 16.14V7.86a1 1 0 0 1 .293-.707l5.86-5.86ZM8.274 3 3 8.274v7.452L8.274 21h7.452L21 15.726V8.274L15.726 3H8.274Z"
16
+ }), _jsx("path", {
17
+ fillRule: "evenodd",
18
+ clipRule: "evenodd",
19
+ d: "M11 16a1 1 0 0 1 1-1h.01a1 1 0 1 1 0 2H12a1 1 0 0 1-1-1ZM12 7a1 1 0 0 1 1 1v4a1 1 0 1 1-2 0V8a1 1 0 0 1 1-1Z"
20
+ })]
21
+ });
22
+ };
23
+ export default WarningIcon;
@@ -0,0 +1,30 @@
1
+ import * as React from "react";
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ const DIRECTIONS = {
4
+ NORTH: "rotate(-0.125turn)",
5
+ NORTH_EAST: "rotate(0turn)",
6
+ NORTH_WEST: "rotate(-0.25turn)",
7
+ EAST: "rotate(0.125turn)",
8
+ WEST: "rotate(-0.375turn)",
9
+ SOUTH: "rotate(0.375turn)",
10
+ SOUTH_EAST: "rotate(0.25turn)",
11
+ SOUTH_WEST: "rotate(0.5turn)"
12
+ };
13
+ const WindIcon = ({
14
+ direction,
15
+ width = 24,
16
+ height = 24
17
+ }) => {
18
+ return _jsx("svg", {
19
+ height: height,
20
+ style: {
21
+ transform: DIRECTIONS[direction]
22
+ },
23
+ viewBox: "0 0 24 24",
24
+ width: width,
25
+ children: _jsx("path", {
26
+ d: "M20.47 1.13c.7-.27 1.46-.11 1.99.41.52.53.68 1.3.4 1.99l-7.24 18.3a1.83 1.83 0 01-1.9 1.16 1.83 1.83 0 01-1.63-1.53l-1.28-7.64a.76.76 0 00-.62-.63l-2.96-.5a.55.55 0 01.18-1.06l2.96.5c.77.12 1.38.73 1.5 1.5l1.3 7.65c.06.42.38.6.66.63.28.03.63-.08.78-.47l7.25-18.31a.74.74 0 00-.17-.82.74.74 0 00-.82-.17L2.57 9.4c-.4.15-.5.5-.48.78.03.28.21.6.63.67l1.78.3a.54.54 0 01-.18 1.07l-1.78-.3-.14-.03A1.82 1.82 0 011 10.28c-.09-.83.38-1.6 1.16-1.9l18.3-7.25zm-3.49 5.12a.54.54 0 11.77.77l-4.22 4.22c-.1.1-.24.15-.38.15a.54.54 0 01-.39-.92l4.22-4.22z"
27
+ })
28
+ });
29
+ };
30
+ export default WindIcon;
@@ -0,0 +1,3 @@
1
+ import Lumiplan from "./lumiplan";
2
+ export default Lumiplan;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lbm/lumiplan/index.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,YAAY,CAAC;AAElC,eAAe,QAAQ,CAAC"}
@@ -0,0 +1,2 @@
1
+ import Lumiplan from "./lumiplan";
2
+ export default Lumiplan;
@@ -0,0 +1,2 @@
1
+ export default function Lumiplan(): import("react/jsx-runtime").JSX.Element;
2
+ //# sourceMappingURL=lumiplan.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lumiplan.d.ts","sourceRoot":"","sources":["../../../src/lbm/lumiplan/lumiplan.tsx"],"names":[],"mappings":"AAkBA,MAAM,CAAC,OAAO,UAAU,QAAQ,4CA+H/B"}
@@ -0,0 +1,118 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import * as React from "react";
3
+ import { useInView } from "framer-motion";
4
+ import getConfig from "next/config";
5
+ import TodaysTips from "./todays-tips";
6
+ import RoadCondition from "./road-condition";
7
+ import Weather from "./weather";
8
+ import Domain from "./domain";
9
+ import Pois from "./pois";
10
+ import * as API from "./api";
11
+ import css from "./lumiplan.module.css";
12
+ import Opening from "./opening";
13
+ import ResortSelector from "./resort-selector";
14
+ const { publicRuntimeConfig } = getConfig();
15
+ const { lumiplanResorts } = publicRuntimeConfig;
16
+ const IN_VIEW_CONFIG = { once: true };
17
+ export default function Lumiplan() {
18
+ const todaysTipsRef = React.useRef(null);
19
+ const weatherRef = React.useRef(null);
20
+ const roadConditionRef = React.useRef(null);
21
+ const domainRef = React.useRef(null);
22
+ const openingsRef = React.useRef(null);
23
+ const poisRef = React.useRef(null);
24
+ const isTodaysTipsInView = useInView(todaysTipsRef, IN_VIEW_CONFIG);
25
+ const isWeatherInView = useInView(weatherRef, IN_VIEW_CONFIG);
26
+ const isRoadConditionInView = useInView(roadConditionRef, IN_VIEW_CONFIG);
27
+ const isDomainInView = useInView(domainRef, IN_VIEW_CONFIG);
28
+ const isOpeningsInView = useInView(openingsRef, IN_VIEW_CONFIG);
29
+ const isPoisInView = useInView(poisRef, IN_VIEW_CONFIG);
30
+ const [currentResortId, setCurrentResortId] = React.useState(lumiplanResorts[0].id);
31
+ const [resortOpening, setResortOpening] = React.useState();
32
+ const [weather, setWeather] = React.useState();
33
+ const [resortAccess, setResortAccess] = React.useState();
34
+ const [domain, setDomain] = React.useState();
35
+ const [pois, setPois] = React.useState();
36
+ React.useEffect(() => {
37
+ setResortOpening(undefined);
38
+ if (isTodaysTipsInView || isOpeningsInView) {
39
+ const fetchData = async () => {
40
+ try {
41
+ const result = await API.getResortOpening(currentResortId);
42
+ setResortOpening(result);
43
+ }
44
+ catch (error) {
45
+ setResortOpening(null);
46
+ }
47
+ };
48
+ fetchData();
49
+ }
50
+ }, [currentResortId, isOpeningsInView, isTodaysTipsInView]);
51
+ React.useEffect(() => {
52
+ setWeather(undefined);
53
+ if (isWeatherInView) {
54
+ const fetchData = async () => {
55
+ try {
56
+ const [weather, snow] = await Promise.all([
57
+ API.getWeather(currentResortId),
58
+ API.getSnow(currentResortId),
59
+ ]);
60
+ setWeather({ weather, snow });
61
+ }
62
+ catch (error) {
63
+ setWeather(null);
64
+ }
65
+ };
66
+ fetchData();
67
+ }
68
+ }, [currentResortId, isWeatherInView]);
69
+ React.useEffect(() => {
70
+ setResortAccess(undefined);
71
+ if (isRoadConditionInView) {
72
+ const fetchData = async () => {
73
+ try {
74
+ const result = await API.getResortAccess(currentResortId);
75
+ setResortAccess(result);
76
+ }
77
+ catch (error) {
78
+ setResortAccess(null);
79
+ }
80
+ };
81
+ fetchData();
82
+ }
83
+ }, [currentResortId, isRoadConditionInView]);
84
+ React.useEffect(() => {
85
+ setDomain(undefined);
86
+ if (isDomainInView) {
87
+ const fetchData = async () => {
88
+ try {
89
+ const [slopes, lifts] = await Promise.all([
90
+ API.getSlopes(currentResortId),
91
+ API.getLifts(currentResortId),
92
+ ]);
93
+ setDomain({ slopes, lifts });
94
+ }
95
+ catch (error) {
96
+ setDomain(null);
97
+ }
98
+ };
99
+ fetchData();
100
+ }
101
+ }, [currentResortId, isDomainInView]);
102
+ React.useEffect(() => {
103
+ setPois(undefined);
104
+ if (isPoisInView) {
105
+ const fetchData = async () => {
106
+ try {
107
+ const result = await API.getPois(currentResortId);
108
+ setPois(result);
109
+ }
110
+ catch (error) {
111
+ setPois(null);
112
+ }
113
+ };
114
+ fetchData();
115
+ }
116
+ }, [currentResortId, isPoisInView]);
117
+ return (_jsxs("div", { className: css.lumiplan, children: [_jsx(ResortSelector, { resorts: lumiplanResorts, currentResortId: currentResortId, setCurrentResortId: setCurrentResortId }), _jsx(TodaysTips, { ref: todaysTipsRef, resortOpening: resortOpening }), _jsx(Weather, { ref: weatherRef, weather: weather }), _jsx(RoadCondition, { ref: roadConditionRef, resortAccess: resortAccess }), _jsx(Domain, { ref: domainRef, domain: domain }), _jsx(Pois, { ref: poisRef, pois: pois }), _jsx(Opening, { ref: openingsRef, resortOpening: resortOpening })] }));
118
+ }
@@ -0,0 +1,3 @@
1
+ .lumiplan {
2
+ padding: 64px 0;
3
+ }
@@ -0,0 +1,8 @@
1
+ import * as React from "react";
2
+ import type { ResortOpening } from "./types";
3
+ type Props = {
4
+ resortOpening?: ResortOpening | null;
5
+ };
6
+ declare const Opening: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLDivElement>>;
7
+ export default Opening;
8
+ //# sourceMappingURL=opening.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"opening.d.ts","sourceRoot":"","sources":["../../../src/lbm/lumiplan/opening.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAQ/B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAG7C,KAAK,KAAK,GAAG;IACX,aAAa,CAAC,EAAE,aAAa,GAAG,IAAI,CAAC;CACtC,CAAC;AAEF,QAAA,MAAM,OAAO,8EA2DZ,CAAC;AAwCF,eAAe,OAAO,CAAC"}
@@ -0,0 +1,33 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import * as React from "react";
3
+ import classNames from "classnames";
4
+ import { useUbloContext } from "ublo/with-ublo";
5
+ import Loader from "dt-design-system/es/loader";
6
+ import * as Icons from "dt-design-system/es/icons";
7
+ import NightIcon from "./icons/night";
8
+ import DawnIcon from "./icons/dawn";
9
+ import T, { t } from "./i18n/translations";
10
+ import css from "./opening.module.css";
11
+ const Opening = React.forwardRef(({ resortOpening }, ref) => {
12
+ const { lang } = useUbloContext();
13
+ if (resortOpening === undefined) {
14
+ return (_jsx("div", { ref: ref, className: css.loader, "data-tags": t(lang, "opening.navigation-title"), children: _jsx(Loader, { variant: "overlay" }) }));
15
+ }
16
+ if (!resortOpening?.availability) {
17
+ return null;
18
+ }
19
+ const { dawnSkiingDays, nightSkiingDays } = resortOpening.availability;
20
+ return (_jsxs("div", { ref: ref, className: css.opening, "data-tags": t(lang, "opening.navigation-title"), children: [_jsx("div", { className: css.title, dangerouslySetInnerHTML: { __html: t(lang, "opening.title") } }), _jsx("div", { className: css.tableOuter, children: _jsxs("table", { className: css.table, children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", {}), dawnSkiingDays.map((day) => (_jsx("th", { className: css.heading, children: _jsx("div", { className: css.headingInner, children: _jsx(T, { id: `opening.days.${day.dayType}` }) }) }, day.dayType)))] }) }), _jsxs("tbody", { children: [_jsx("tr", { children: _jsx(Rows, { kind: "dawn", rows: dawnSkiingDays }) }), _jsx("tr", { children: _jsx(Rows, { kind: "night", rows: nightSkiingDays }) })] })] }) })] }));
21
+ });
22
+ function Rows({ kind, rows }) {
23
+ const Icon = kind === "dawn" ? DawnIcon : NightIcon;
24
+ return (_jsxs(_Fragment, { children: [_jsx("td", { className: css.heading, children: _jsxs("span", { className: css.headingInner, children: [_jsx(Icon, {}), _jsx(T, { id: `opening.${kind}` })] }) }), rows.map(({ dayType, open }) => {
25
+ const code = open ? "opening.available" : "opening.unavailable";
26
+ const classes = classNames(css.cell, {
27
+ [css.cellAvailable]: open,
28
+ });
29
+ return (_jsx("td", { className: classes, children: _jsxs("span", { className: css.cellInner, children: [_jsx(T, { id: code }), !open && _jsx(Icons.Cross, {})] }) }, `${dayType}-${kind}`));
30
+ })] }));
31
+ }
32
+ Opening.displayName = "Opening";
33
+ export default Opening;
@@ -0,0 +1,88 @@
1
+ .loader {
2
+ position: relative;
3
+ width: 100%;
4
+ max-width: 1200px;
5
+ height: 300px;
6
+ margin: 30px auto;
7
+ border-radius: var(--radius-200);
8
+ overflow: hidden;
9
+ }
10
+
11
+ .opening {
12
+ width: 100%;
13
+ max-width: 1200px;
14
+ display: flex;
15
+ flex-direction: column;
16
+ gap: 40px;
17
+ margin: 36px auto;
18
+ padding: 0 10px;
19
+ }
20
+
21
+ .title {
22
+ text-align: center;
23
+ font-size: 38px;
24
+ font-weight: 700;
25
+ color: hsl(var(--primary));
26
+ }
27
+
28
+ .tableOuter {
29
+ padding: 40px;
30
+ border: 2px solid hsl(var(--primary));
31
+ border-radius: calc(var(--radius-400) * 2);
32
+ overflow: auto;
33
+ }
34
+
35
+ .table {
36
+ color: hsl(var(--primary));
37
+ }
38
+
39
+ .table thead .headingInner {
40
+ margin: 0 auto;
41
+ padding: 0 10px;
42
+ }
43
+
44
+ .headingInner {
45
+ width: fit-content;
46
+ display: flex;
47
+ align-items: flex-end;
48
+ margin-top: 40px;
49
+ height: 18px;
50
+ line-height: 1;
51
+ background-color: hsla(var(--secondary), 10%);
52
+ }
53
+
54
+ .headingInner > svg {
55
+ flex: 0 0 30px;
56
+ width: 30px;
57
+ height: 30px;
58
+ margin-right: 6%;
59
+ }
60
+
61
+ .table td {
62
+ text-align: center;
63
+ }
64
+
65
+ .cell {
66
+ text-transform: uppercase;
67
+ font-weight: 700;
68
+ font-size: 15px;
69
+ }
70
+
71
+ .cell svg {
72
+ width: 1.2em;
73
+ height: 1.2em;
74
+ fill: currentColor;
75
+ }
76
+
77
+ .cellInner {
78
+ margin-top: 40px;
79
+ padding: 0 10px;
80
+ display: flex;
81
+ align-items: center;
82
+ justify-content: center;
83
+ text-align: center;
84
+ }
85
+
86
+ .cellAvailable {
87
+ color: hsl(var(--secondary));
88
+ }
@@ -0,0 +1,8 @@
1
+ import * as React from "react";
2
+ import type { PoisInfo } from "./types";
3
+ type Props = {
4
+ pois?: PoisInfo | null;
5
+ };
6
+ declare const Pois: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLDivElement>>;
7
+ export default Pois;
8
+ //# sourceMappingURL=pois.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pois.d.ts","sourceRoot":"","sources":["../../../src/lbm/lumiplan/pois.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAY/B,OAAO,KAAK,EAAyB,QAAQ,EAAQ,MAAM,SAAS,CAAC;AAwDrE,KAAK,KAAK,GAAG;IACX,IAAI,CAAC,EAAE,QAAQ,GAAG,IAAI,CAAC;CACxB,CAAC;AASF,QAAA,MAAM,IAAI,8EAkMR,CAAC;AAIH,eAAe,IAAI,CAAC"}
@@ -0,0 +1,150 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import * as React from "react";
3
+ import getConfig from "next/config";
4
+ import Image from "next/image";
5
+ import classNames from "classnames";
6
+ import { useUbloContext } from "ublo/with-ublo";
7
+ import Button from "dt-design-system/es/button";
8
+ import Tooltip from "dt-design-system/es/tooltip";
9
+ import Loader from "dt-design-system/es/loader";
10
+ import * as Icons from "dt-design-system/es/icons";
11
+ import * as LiftsIcons from "./icons/lifts";
12
+ import * as TrailIcons from "./icons/trails";
13
+ import T, { t } from "./i18n/translations";
14
+ import css from "./pois.module.css";
15
+ const LIFT_ICONS = {
16
+ TRAIN: LiftsIcons.Teleski,
17
+ FUNICULAR: LiftsIcons.Teleski,
18
+ TRAM: LiftsIcons.Teleski,
19
+ CABRIOLET_GONDOLA: LiftsIcons.Telecabine,
20
+ GONDOLA: LiftsIcons.Telecabine,
21
+ COMBINED_CHAIR_GONDOLA_LIFT: LiftsIcons.Telecabine,
22
+ DETACHABLE_BUBBLE_CHAIRLIFT: LiftsIcons.Telecabine,
23
+ DETACHABLE_CHAIRLIFT: LiftsIcons.TelesiegeDebrayable,
24
+ CHAIRLIFT: LiftsIcons.Telesiege,
25
+ SURFACE_LIFT: LiftsIcons.Teleski,
26
+ MAGIC_CARPET: LiftsIcons.TapisRoulant,
27
+ ROPE_TOW: LiftsIcons.Teleski,
28
+ DEFAULT: LiftsIcons.Teleski,
29
+ };
30
+ const TRAIL_ICONS = {
31
+ BIKE_PARK: TrailIcons.VTT,
32
+ BOARDERCROSS: TrailIcons.BoarderCross,
33
+ BUMP_TRAIL: TrailIcons.ChampDeBosse,
34
+ CROSS_COUNTRY_MOUNTAIN_BIKING: TrailIcons.BoarderCross,
35
+ CROSS_COUNTRY_SKIING: TrailIcons.Freeride,
36
+ DOWNHILL_MOUNTAIN_BIKING: TrailIcons.VTT,
37
+ DOWNHILL_SKIING: TrailIcons.Freeride,
38
+ EBIKE: TrailIcons.VTT,
39
+ ENDURO: TrailIcons.VTT,
40
+ FREERIDE_AREA_OFF_PIST: TrailIcons.Freeride,
41
+ FREERIDE_SKI_ITINERARY: TrailIcons.Freeride,
42
+ FUN_ZONE: TrailIcons.SkiAlpin,
43
+ GATE: TrailIcons.SkiAlpin,
44
+ GLADES: TrailIcons.SkiAlpin,
45
+ ILLUMINATED_TRAIL: TrailIcons.PisteEclairee,
46
+ MULTI_USE_TRAIL: TrailIcons.SkiAlpin,
47
+ MTB_ENDURO: TrailIcons.VTT,
48
+ PATH: TrailIcons.Pieton,
49
+ PEDESTRIAN: TrailIcons.Pieton,
50
+ ROUTE_OF_CROSS_COUNTRY: TrailIcons.Freeride,
51
+ SKI_TOURING: TrailIcons.Luge,
52
+ SLEDDING_HILL: TrailIcons.Luge,
53
+ SNOWPARK: TrailIcons.Snowpark,
54
+ SNOWPARK_LINE: TrailIcons.Snowpark,
55
+ SNOWSHOE: TrailIcons.Raquette,
56
+ TERRAIN_PARK: TrailIcons.Snowpark,
57
+ TERRAIN_PARK_US: TrailIcons.Snowpark,
58
+ TRAIL_RUNNING: TrailIcons.Pieton,
59
+ VIDEO_ZONE: TrailIcons.SkiAlpin,
60
+ UNDEF: TrailIcons.SkiAlpin,
61
+ DEFAULT: TrailIcons.SkiAlpin,
62
+ };
63
+ const { publicRuntimeConfig } = getConfig();
64
+ const { lumiplanApiV2 } = publicRuntimeConfig;
65
+ const SPECIAL_TRAILS = {
66
+ "Labell'glisse": `${lumiplanApiV2}/pistes-ludiques/labell-glisse.png`,
67
+ Waouland: `${lumiplanApiV2}/pistes-ludiques/waouland.png`,
68
+ Opoualand: `${lumiplanApiV2}/pistes-ludiques/opoualand.png`,
69
+ "The Flying Donuts": `${lumiplanApiV2}/pistes-ludiques/flying-donuts.png`,
70
+ };
71
+ const Pois = React.forwardRef(({ pois }, ref) => {
72
+ const { lang } = useUbloContext();
73
+ const [expanded, setExpanded] = React.useState(false);
74
+ if (pois === undefined) {
75
+ return (_jsx("div", { ref: ref, className: css.loader, children: _jsx(Loader, { variant: "overlay" }) }));
76
+ }
77
+ if (!pois) {
78
+ return null;
79
+ }
80
+ const flattenedPois = pois.reduce((acc, zone) => {
81
+ const { name, lifts = [], trails = [] } = zone;
82
+ const liftsWithSectorName = lifts.map((lift) => ({
83
+ ...lift,
84
+ sectorName: name,
85
+ }));
86
+ const trailsWithSectorName = trails.map((trail) => ({
87
+ ...trail,
88
+ sectorName: name,
89
+ }));
90
+ return [...acc, ...liftsWithSectorName, ...trailsWithSectorName];
91
+ }, []);
92
+ if (!flattenedPois.length) {
93
+ return null;
94
+ }
95
+ const ExpandIcon = expanded ? Icons.MinusCircle : Icons.PlusCircle;
96
+ const toggleExpanded = () => {
97
+ setExpanded(!expanded);
98
+ };
99
+ const displayedPois = expanded ? flattenedPois : flattenedPois.slice(0, 15);
100
+ return (_jsx("div", { className: css.pois, children: _jsxs("div", { className: css.inner, children: [_jsx("div", { className: css.list, children: displayedPois.map(({ id, name, type, liftType, trailType, trailLevel, sectorName, messagePoi, openingStatus, snowQuality, groomingStatus, openingStatusCompl, }) => {
101
+ const isLift = type === "SKI_LIFT";
102
+ const translationCode = isLift
103
+ ? `pois.lifts.${liftType}`
104
+ : `pois.trails.${trailType}`;
105
+ const hasTrailLevel = trailLevel !== undefined && trailLevel !== "UNDEF";
106
+ const trailLevelLabel = hasTrailLevel
107
+ ? `(${t(lang, `pois.trailLevels.${trailLevel}`)})`
108
+ : null;
109
+ const specialTrail = Object.keys(SPECIAL_TRAILS).find((key) => name.includes(key));
110
+ // TMP
111
+ const isEven = Number(id) % 2 === 0;
112
+ const mockMessage = {
113
+ id: "mock",
114
+ type: "TEXT",
115
+ title: "messagePoi",
116
+ data: [
117
+ {
118
+ language: "fr_FR",
119
+ data: "Lorem ipsum dolor sit amet, consectetur adipiscing elit.",
120
+ },
121
+ ],
122
+ };
123
+ // TMP
124
+ const message = messagePoi?.data?.find(({ language }) => {
125
+ const _lang = lang === "fr" ? "fr_FR" : "en_US";
126
+ return language === _lang;
127
+ }) || isEven
128
+ ? mockMessage.data[0]
129
+ : undefined;
130
+ const hasGroomingStatus = groomingStatus !== undefined && groomingStatus !== "UNDEF";
131
+ const hasSnowQuality = snowQuality !== undefined && snowQuality !== "UNDEF";
132
+ const classes = classNames(css.poi, {
133
+ [css[trailLevel]]: hasTrailLevel,
134
+ });
135
+ let status = "OPEN";
136
+ if (openingStatus.includes("DELAYED")) {
137
+ status = "DELAYED";
138
+ }
139
+ else {
140
+ status = "CLOSED";
141
+ }
142
+ const statusCode = `pois.opening-statuses.${status}`;
143
+ const Icon = isLift
144
+ ? LIFT_ICONS[liftType] || LIFT_ICONS.DEFAULT
145
+ : TRAIL_ICONS[trailType] || TRAIL_ICONS.DEFAULT;
146
+ return (_jsxs("div", { className: classes, children: [_jsx("div", { className: css.poiIcon, children: specialTrail ? (_jsx(Image, { src: SPECIAL_TRAILS[specialTrail], width: 50, height: 50, alt: specialTrail })) : (_jsx(Icon, {})) }), _jsxs("div", { className: css.poiInfo, children: [_jsxs("div", { className: css.poiHeader, children: [_jsx("span", { className: css.poiName, children: name }), _jsx("span", { className: css.poiStatus, children: _jsx(T, { id: statusCode }) })] }), _jsxs("div", { className: css.poiDetail, children: [_jsxs("div", { className: css.poiDetailHeader, children: [sectorName, " | ", _jsx(T, { id: translationCode }), " ", trailLevelLabel] }), !isLift && (_jsxs("div", { className: css.poiTrailDetail, children: [hasGroomingStatus && (_jsx("div", { className: css.poiTrailDetailItem, children: _jsx(T, { id: `snow.grooming.states.${groomingStatus}` }) })), hasSnowQuality && (_jsxs("div", { className: css.poiTrailDetailItem, children: [_jsx(T, { id: "snow.snow-quality.title" }), " :", " ", _jsx(T, { id: `snow.snow-quality.states.${snowQuality}` })] }))] }))] })] }), _jsx("div", { className: css.poiMessage, children: message && (_jsx(Tooltip, { content: message.data, children: _jsx(Button, { variant: "transparent", children: _jsx(Icons.Info, {}) }) })) })] }, id));
147
+ }) }), _jsx(Tooltip, { content: t(lang, expanded ? "see-less" : "see-more"), children: _jsx(Button, { className: css.expandButton, variant: "transparent", onClick: toggleExpanded, children: _jsx(ExpandIcon, {}) }) })] }) }));
148
+ });
149
+ Pois.displayName = "Pois";
150
+ export default Pois;
@@ -0,0 +1,137 @@
1
+ .loader {
2
+ position: relative;
3
+ width: 100%;
4
+ height: 600px;
5
+ }
6
+
7
+ .pois {
8
+ width: 100%;
9
+ padding: 40px 10px;
10
+ background-color: hsla(var(--secondary), 10%);
11
+ }
12
+
13
+ .inner {
14
+ width: 100%;
15
+ max-width: 1000px;
16
+ display: flex;
17
+ flex-direction: column;
18
+ gap: 34px;
19
+ margin: 0 auto;
20
+ }
21
+
22
+ .list {
23
+ display: grid;
24
+ grid-template-columns: 1fr;
25
+ gap: 26px;
26
+ }
27
+
28
+ @media (min-width: 820px) {
29
+ .list {
30
+ grid-template-columns: repeat(2, 1fr);
31
+ }
32
+ }
33
+
34
+ /* @media (min-width: 1150px) {
35
+ .list {
36
+ grid-template-columns: repeat(3, 1fr);
37
+ }
38
+ } */
39
+
40
+ .expandButton {
41
+ margin: 0 auto;
42
+ }
43
+
44
+ .poi {
45
+ --color: hsl(var(--primary));
46
+
47
+ display: flex;
48
+ align-items: flex-start;
49
+ gap: 16px;
50
+ color: hsl(var(--primary));
51
+ }
52
+
53
+ .poi.GREEN {
54
+ --color: #00a52c;
55
+ }
56
+
57
+ .poi.BLUE {
58
+ --color: #0062ae;
59
+ }
60
+
61
+ .poi.RED {
62
+ --color: #f4000f;
63
+ }
64
+
65
+ .poi.BLACK {
66
+ --color: #000;
67
+ }
68
+
69
+ .poi.YELLOW {
70
+ --color: #f9d71c;
71
+ }
72
+
73
+ .poiIcon {
74
+ flex: 0 0 50px;
75
+ width: 50px;
76
+ height: 50px;
77
+ display: flex;
78
+ align-items: center;
79
+ justify-content: center;
80
+ }
81
+
82
+ .poiIcon svg {
83
+ width: 100%;
84
+ height: 100%;
85
+ fill: var(--color);
86
+ }
87
+
88
+ .poiInfo {
89
+ flex: 1 1 100%;
90
+ display: flex;
91
+ flex-direction: column;
92
+ }
93
+
94
+ .poiHeader {
95
+ display: flex;
96
+ align-items: center;
97
+ gap: 10px;
98
+ font-size: 17px;
99
+ font-weight: 700;
100
+ }
101
+
102
+ @media (min-width: 1150px) {
103
+ .poiHeader {
104
+ font-size: 19px;
105
+ }
106
+ }
107
+
108
+ .poiName {
109
+ flex: 1 1 auto;
110
+ }
111
+
112
+ .poiStatus {
113
+ margin-left: auto;
114
+ text-transform: uppercase;
115
+ font-size: 15px;
116
+ }
117
+
118
+ .poiDetail {
119
+ display: flex;
120
+ flex-direction: column;
121
+ }
122
+
123
+ .poiDetailHeader {
124
+ font-size: 13px;
125
+ font-weight: 700;
126
+ text-transform: uppercase;
127
+ }
128
+
129
+ .poiMessage {
130
+ flex: 0 0 33px;
131
+ margin-left: auto;
132
+ }
133
+
134
+ .poiMessage button {
135
+ cursor: help;
136
+ color: hsl(var(--secondary));
137
+ }
@@ -0,0 +1,12 @@
1
+ type Resort = {
2
+ id: number;
3
+ label: string;
4
+ };
5
+ type Props = {
6
+ resorts: Resort[];
7
+ currentResortId: number;
8
+ setCurrentResortId: (id: number) => void;
9
+ };
10
+ export default function ResortSelector({ resorts, currentResortId, setCurrentResortId, }: Props): import("react/jsx-runtime").JSX.Element | null;
11
+ export {};
12
+ //# sourceMappingURL=resort-selector.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resort-selector.d.ts","sourceRoot":"","sources":["../../../src/lbm/lumiplan/resort-selector.tsx"],"names":[],"mappings":"AAKA,KAAK,MAAM,GAAG;IACZ,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,KAAK,KAAK,GAAG;IACX,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;IACxB,kBAAkB,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;CAC1C,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,EACrC,OAAO,EACP,eAAe,EACf,kBAAkB,GACnB,EAAE,KAAK,kDAwBP"}