ublo-lib 1.35.18 → 1.36.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 (124) hide show
  1. package/es/common/components/date-picker/calendar.d.ts.map +1 -1
  2. package/es/common/components/date-picker/calendar.js +8 -12
  3. package/es/common/components/date-picker/calendar.module.css +8 -0
  4. package/es/common/components/date-picker/date-picker.module.css +0 -44
  5. package/es/common/components/scrolling-carousel/scrolling-carousel.module.css +4 -0
  6. package/es/lbm/components/instant-search/facet-switch.d.ts +8 -0
  7. package/es/lbm/components/instant-search/facet-switch.d.ts.map +1 -0
  8. package/es/lbm/components/instant-search/facet-switch.js +15 -0
  9. package/es/lbm/components/instant-search/facet-switch.module.css +19 -0
  10. package/es/lbm/components/instant-search/faqs.d.ts +12 -0
  11. package/es/lbm/components/instant-search/faqs.d.ts.map +1 -0
  12. package/es/lbm/components/instant-search/faqs.js +44 -0
  13. package/es/lbm/components/instant-search/faqs.module.css +102 -0
  14. package/es/lbm/components/instant-search/hooks/use-constant.d.ts +2 -0
  15. package/es/lbm/components/instant-search/hooks/use-constant.d.ts.map +1 -0
  16. package/es/lbm/components/instant-search/hooks/use-constant.js +8 -0
  17. package/es/lbm/components/instant-search/hooks/use-debounced-search.d.ts +11 -0
  18. package/es/lbm/components/instant-search/hooks/use-debounced-search.d.ts.map +1 -0
  19. package/es/lbm/components/instant-search/hooks/use-debounced-search.js +12 -0
  20. package/es/lbm/components/instant-search/hooks/use-search.d.ts +17 -0
  21. package/es/lbm/components/instant-search/hooks/use-search.d.ts.map +1 -0
  22. package/es/lbm/components/instant-search/hooks/use-search.js +10 -0
  23. package/es/lbm/components/instant-search/i18n.json +32 -0
  24. package/es/lbm/components/instant-search/index.d.ts +3 -0
  25. package/es/lbm/components/instant-search/index.d.ts.map +1 -0
  26. package/es/lbm/components/instant-search/index.js +2 -0
  27. package/es/lbm/components/instant-search/instant-search.d.ts +19 -0
  28. package/es/lbm/components/instant-search/instant-search.d.ts.map +1 -0
  29. package/es/lbm/components/instant-search/instant-search.js +64 -0
  30. package/es/lbm/components/instant-search/instant-search.module.css +8 -0
  31. package/es/lbm/components/instant-search/links.d.ts +12 -0
  32. package/es/lbm/components/instant-search/links.d.ts.map +1 -0
  33. package/es/lbm/components/instant-search/links.js +30 -0
  34. package/es/lbm/components/instant-search/links.module.css +96 -0
  35. package/es/lbm/components/instant-search/no-product.d.ts +6 -0
  36. package/es/lbm/components/instant-search/no-product.d.ts.map +1 -0
  37. package/es/lbm/components/instant-search/no-product.js +4 -0
  38. package/es/lbm/components/instant-search/products.d.ts +14 -0
  39. package/es/lbm/components/instant-search/products.d.ts.map +1 -0
  40. package/es/lbm/components/instant-search/products.js +47 -0
  41. package/es/lbm/components/instant-search/products.module.css +163 -0
  42. package/es/lbm/components/instant-search/results.d.ts +79 -0
  43. package/es/lbm/components/instant-search/results.d.ts.map +1 -0
  44. package/es/lbm/components/instant-search/results.js +34 -0
  45. package/es/lbm/components/instant-search/results.module.css +85 -0
  46. package/es/lbm/components/instant-search/search-input.d.ts +15 -0
  47. package/es/lbm/components/instant-search/search-input.d.ts.map +1 -0
  48. package/es/lbm/components/instant-search/search-input.js +56 -0
  49. package/es/lbm/components/instant-search/search-input.module.css +88 -0
  50. package/es/lbm/components/instant-search/services/api.d.ts +2 -0
  51. package/es/lbm/components/instant-search/services/api.d.ts.map +1 -0
  52. package/es/lbm/components/instant-search/services/api.js +22 -0
  53. package/es/lbm/components/instant-search/services/lumiplan-api.d.ts +9 -0
  54. package/es/lbm/components/instant-search/services/lumiplan-api.d.ts.map +1 -0
  55. package/es/lbm/components/instant-search/services/lumiplan-api.js +37 -0
  56. package/es/lbm/components/instant-search/services/messages.d.ts +2 -0
  57. package/es/lbm/components/instant-search/services/messages.d.ts.map +1 -0
  58. package/es/lbm/components/instant-search/services/messages.js +5 -0
  59. package/es/lbm/components/instant-search/services/utils.d.ts +4 -0
  60. package/es/lbm/components/instant-search/services/utils.d.ts.map +1 -0
  61. package/es/lbm/components/instant-search/services/utils.js +28 -0
  62. package/es/lbm/components/instant-search/widgets/access.d.ts +8 -0
  63. package/es/lbm/components/instant-search/widgets/access.d.ts.map +1 -0
  64. package/es/lbm/components/instant-search/widgets/access.js +29 -0
  65. package/es/lbm/components/instant-search/widgets/activity.d.ts +8 -0
  66. package/es/lbm/components/instant-search/widgets/activity.d.ts.map +1 -0
  67. package/es/lbm/components/instant-search/widgets/activity.js +74 -0
  68. package/es/lbm/components/instant-search/widgets/activity.module.css +6 -0
  69. package/es/lbm/components/instant-search/widgets/components/card.d.ts +11 -0
  70. package/es/lbm/components/instant-search/widgets/components/card.d.ts.map +1 -0
  71. package/es/lbm/components/instant-search/widgets/components/card.js +15 -0
  72. package/es/lbm/components/instant-search/widgets/components/card.module.css +60 -0
  73. package/es/lbm/components/instant-search/widgets/components/metric.d.ts +8 -0
  74. package/es/lbm/components/instant-search/widgets/components/metric.d.ts.map +1 -0
  75. package/es/lbm/components/instant-search/widgets/components/metric.js +6 -0
  76. package/es/lbm/components/instant-search/widgets/components/metric.module.css +12 -0
  77. package/es/lbm/components/instant-search/widgets/components/status-with-icon.d.ts +9 -0
  78. package/es/lbm/components/instant-search/widgets/components/status-with-icon.d.ts.map +1 -0
  79. package/es/lbm/components/instant-search/widgets/components/status-with-icon.js +5 -0
  80. package/es/lbm/components/instant-search/widgets/components/status-with-icon.module.css +12 -0
  81. package/es/lbm/components/instant-search/widgets/dawn-nights-openings.d.ts +9 -0
  82. package/es/lbm/components/instant-search/widgets/dawn-nights-openings.d.ts.map +1 -0
  83. package/es/lbm/components/instant-search/widgets/dawn-nights-openings.js +37 -0
  84. package/es/lbm/components/instant-search/widgets/dawn-nights-openings.module.css +33 -0
  85. package/es/lbm/components/instant-search/widgets/lift.d.ts +8 -0
  86. package/es/lbm/components/instant-search/widgets/lift.d.ts.map +1 -0
  87. package/es/lbm/components/instant-search/widgets/lift.js +52 -0
  88. package/es/lbm/components/instant-search/widgets/lift.module.css +6 -0
  89. package/es/lbm/components/instant-search/widgets/lifts.d.ts +8 -0
  90. package/es/lbm/components/instant-search/widgets/lifts.d.ts.map +1 -0
  91. package/es/lbm/components/instant-search/widgets/lifts.js +26 -0
  92. package/es/lbm/components/instant-search/widgets/msem-widget.d.ts +8 -0
  93. package/es/lbm/components/instant-search/widgets/msem-widget.d.ts.map +1 -0
  94. package/es/lbm/components/instant-search/widgets/msem-widget.js +31 -0
  95. package/es/lbm/components/instant-search/widgets/msem-widget.module.css +51 -0
  96. package/es/lbm/components/instant-search/widgets/openings.d.ts +8 -0
  97. package/es/lbm/components/instant-search/widgets/openings.d.ts.map +1 -0
  98. package/es/lbm/components/instant-search/widgets/openings.js +32 -0
  99. package/es/lbm/components/instant-search/widgets/slope.d.ts +8 -0
  100. package/es/lbm/components/instant-search/widgets/slope.d.ts.map +1 -0
  101. package/es/lbm/components/instant-search/widgets/slope.js +73 -0
  102. package/es/lbm/components/instant-search/widgets/slope.module.css +26 -0
  103. package/es/lbm/components/instant-search/widgets/slopes.d.ts +8 -0
  104. package/es/lbm/components/instant-search/widgets/slopes.d.ts.map +1 -0
  105. package/es/lbm/components/instant-search/widgets/slopes.js +26 -0
  106. package/es/lbm/components/instant-search/widgets/snow.d.ts +9 -0
  107. package/es/lbm/components/instant-search/widgets/snow.d.ts.map +1 -0
  108. package/es/lbm/components/instant-search/widgets/snow.js +25 -0
  109. package/es/lbm/components/instant-search/widgets/types.d.ts +27 -0
  110. package/es/lbm/components/instant-search/widgets/types.d.ts.map +1 -0
  111. package/es/lbm/components/instant-search/widgets/types.js +1 -0
  112. package/es/lbm/components/instant-search/widgets/weather.d.ts +9 -0
  113. package/es/lbm/components/instant-search/widgets/weather.d.ts.map +1 -0
  114. package/es/lbm/components/instant-search/widgets/weather.js +36 -0
  115. package/es/lbm/components/instant-search/widgets/weather.module.css +32 -0
  116. package/es/lbm/components/instant-search/widgets/webcam.d.ts +8 -0
  117. package/es/lbm/components/instant-search/widgets/webcam.d.ts.map +1 -0
  118. package/es/lbm/components/instant-search/widgets/webcam.js +9 -0
  119. package/es/lbm/components/instant-search/widgets/webcam.module.css +13 -0
  120. package/es/lbm/components/instant-search/widgets.d.ts +11 -0
  121. package/es/lbm/components/instant-search/widgets.d.ts.map +1 -0
  122. package/es/lbm/components/instant-search/widgets.js +68 -0
  123. package/es/lbm/components/instant-search/widgets.module.css +14 -0
  124. package/package.json +3 -3
@@ -0,0 +1,88 @@
1
+ .container {
2
+ position: relative;
3
+ display: flex;
4
+ padding: 10px;
5
+ }
6
+
7
+ .input {
8
+ --ds-input-padding: 14px;
9
+ --ds-input-background: var(--ds-grey-000, #fff);
10
+
11
+ width: 100%;
12
+ border-radius: var(--ds-radius-200, 10px);
13
+ box-shadow: var(--ds-shadow-200, 0 5px 10px rgba(0, 0, 0, 0.12));
14
+ }
15
+
16
+ .inputLoading svg {
17
+ animation: search-loader-spinning 1280ms
18
+ var(--ds-transition-easing, cubic-bezier(0.4, 0.1, 0.2, 0.9)) infinite;
19
+ }
20
+
21
+ @keyframes search-loader-spinning {
22
+ 100% {
23
+ transform: rotate(1turn);
24
+ }
25
+ }
26
+
27
+ .suggestion {
28
+ position: absolute;
29
+ top: 50%;
30
+ left: 54px;
31
+ height: 21px;
32
+ display: flex;
33
+ align-items: center;
34
+ line-height: 1;
35
+ color: var(--ds-grey-500, #484848);
36
+ transform: translateY(-50%);
37
+ pointer-events: none;
38
+ }
39
+
40
+ .buttons {
41
+ position: relative;
42
+ height: inherit;
43
+ color: inherit;
44
+ }
45
+
46
+ .button {
47
+ position: absolute;
48
+ top: 0;
49
+ left: 0;
50
+ width: max-content;
51
+ height: 100%;
52
+ padding: 2px 5px 4px 5px;
53
+ color: inherit;
54
+ line-height: 1;
55
+ font-weight: 700;
56
+ cursor: pointer;
57
+ pointer-events: auto;
58
+ border-radius: var(--ds-radius-100, 6px);
59
+ transform: translateY(100%);
60
+ opacity: 0;
61
+ pointer-events: none;
62
+ transition: background-color 160ms
63
+ var(--ds-transition-easing, cubic-bezier(0.4, 0.1, 0.2, 0.9)),
64
+ opacity 320ms var(--ds-transition-easing, cubic-bezier(0.4, 0.1, 0.2, 0.9)),
65
+ transform 320ms
66
+ var(--ds-transition-easing, cubic-bezier(0.4, 0.1, 0.2, 0.9));
67
+ }
68
+
69
+ .buttonPrev {
70
+ transform: translateY(-100%);
71
+ }
72
+
73
+ .buttonCurrent {
74
+ opacity: 1;
75
+ transform: none;
76
+ pointer-events: auto;
77
+ }
78
+
79
+ .button:is(:hover, :focus) {
80
+ background-color: var(--ds-grey-100, #f5f5f5);
81
+ }
82
+
83
+ button.close {
84
+ position: absolute;
85
+ top: 17px;
86
+ right: 14px;
87
+ color: inherit;
88
+ }
@@ -0,0 +1,2 @@
1
+ export declare function fetchResults(site: string, lang: string, query: string, facet: number, groupLimit?: number, queryBy?: string, queryByWeights?: string): Promise<any>;
2
+ //# sourceMappingURL=api.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../../../src/lbm/components/instant-search/services/api.ts"],"names":[],"mappings":"AAeA,wBAAgB,YAAY,CAC1B,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,EACb,UAAU,GAAE,MAAW,EACvB,OAAO,GAAE,MAA8B,EACvC,cAAc,CAAC,EAAE,MAAM,gBAiBxB"}
@@ -0,0 +1,22 @@
1
+ import * as Fetcher from "../../../../common/utils/fetcher";
2
+ const api = "https://search.ublo.app/api";
3
+ const QUERY_ITEMS = [
4
+ "title",
5
+ "text",
6
+ "pageTitle",
7
+ "seoKeywords",
8
+ "parentTitle",
9
+ "seoTitle",
10
+ "imageAlt",
11
+ ];
12
+ export function fetchResults(site, lang, query, facet, groupLimit = 40, queryBy = QUERY_ITEMS.join(","), queryByWeights) {
13
+ const endpoint = `${api}/ublo-search/search/lbm`;
14
+ return Fetcher.post(endpoint, {
15
+ q: query,
16
+ query_by: queryBy,
17
+ query_by_weights: queryByWeights,
18
+ group_limit: groupLimit,
19
+ filter_by: `type:[widget,msem-widget,lodging,product,page,information,faq,document]&&facet:[${facet}]`,
20
+ per_page: 50,
21
+ }, { site, lang }, undefined, undefined);
22
+ }
@@ -0,0 +1,9 @@
1
+ export declare function fetchPois(): Promise<any>;
2
+ export declare function fetchResortOpening(): Promise<any>;
3
+ export declare function fetchWeather(): Promise<any>;
4
+ export declare function fetchSnow(): Promise<any>;
5
+ export declare function fetchResortAccess(): Promise<any>;
6
+ export declare function fetchSlopes(): Promise<any>;
7
+ export declare function fetchLifts(): Promise<any>;
8
+ export declare function fetchWebcams(): Promise<any>;
9
+ //# sourceMappingURL=lumiplan-api.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lumiplan-api.d.ts","sourceRoot":"","sources":["../../../../../src/lbm/components/instant-search/services/lumiplan-api.ts"],"names":[],"mappings":"AASA,wBAAsB,SAAS,iBAQ9B;AAED,wBAAsB,kBAAkB,iBAGvC;AAED,wBAAsB,YAAY,iBAGjC;AAED,wBAAsB,SAAS,iBAG9B;AAED,wBAAsB,iBAAiB,iBAGtC;AAED,wBAAsB,WAAW,iBAGhC;AAED,wBAAsB,UAAU,iBAG/B;AAED,wBAAsB,YAAY,iBAGjC"}
@@ -0,0 +1,37 @@
1
+ import * as Fetcher from "../../../../common/utils/fetcher";
2
+ import getConfig from "next/config";
3
+ const { publicRuntimeConfig } = getConfig();
4
+ const { lumiplanApi, lumiplanResorts } = publicRuntimeConfig;
5
+ const resort = lumiplanResorts[0].id;
6
+ export async function fetchPois() {
7
+ const endpoint = `${lumiplanApi}/pois`;
8
+ return Fetcher.get(endpoint, { resort, operating: "all" }, undefined, undefined);
9
+ }
10
+ export async function fetchResortOpening() {
11
+ const endpoint = `${lumiplanApi}/resort-opening`;
12
+ return Fetcher.get(endpoint, { resort }, undefined, undefined);
13
+ }
14
+ export async function fetchWeather() {
15
+ const endpoint = `${lumiplanApi}/weather`;
16
+ return Fetcher.get(endpoint, { resort }, undefined, undefined);
17
+ }
18
+ export async function fetchSnow() {
19
+ const endpoint = `${lumiplanApi}/snow`;
20
+ return Fetcher.get(endpoint, { resort }, undefined, undefined);
21
+ }
22
+ export async function fetchResortAccess() {
23
+ const endpoint = `${lumiplanApi}/resort-access`;
24
+ return Fetcher.get(endpoint, { resort }, undefined, undefined);
25
+ }
26
+ export async function fetchSlopes() {
27
+ const endpoint = `${lumiplanApi}/slopes`;
28
+ return Fetcher.get(endpoint, { resort }, undefined, undefined);
29
+ }
30
+ export async function fetchLifts() {
31
+ const endpoint = `${lumiplanApi}/lifts`;
32
+ return Fetcher.get(endpoint, { resort }, undefined, undefined);
33
+ }
34
+ export async function fetchWebcams() {
35
+ const endpoint = `${lumiplanApi}/resort-webcam`;
36
+ return Fetcher.get(endpoint, { resort }, undefined, undefined);
37
+ }
@@ -0,0 +1,2 @@
1
+ export default function message(lang: string, id: string): any;
2
+ //# sourceMappingURL=messages.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../../../../../src/lbm/components/instant-search/services/messages.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,OAGvD"}
@@ -0,0 +1,5 @@
1
+ import locales from "../i18n.json";
2
+ export default function message(lang, id) {
3
+ const messages = locales[lang] || locales.en;
4
+ return messages[id] || `??${id}??`;
5
+ }
@@ -0,0 +1,4 @@
1
+ import type { PurpleHighlight } from "../results";
2
+ export declare function getHighlight(property: string, highlight: PurpleHighlight, withExtractQuotes?: boolean): any;
3
+ export declare function wrapWithMark(text: string, matchedTokens: string[]): string;
4
+ //# sourceMappingURL=utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../src/lbm/components/instant-search/services/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD,wBAAgB,YAAY,CAC1B,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,eAAe,EAC1B,iBAAiB,GAAE,OAAe,OAoBnC;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,UAajE"}
@@ -0,0 +1,28 @@
1
+ export function getHighlight(property, highlight, withExtractQuotes = false) {
2
+ if (!highlight[property]?.snippet)
3
+ return;
4
+ let snippet = highlight[property].snippet;
5
+ if (!withExtractQuotes)
6
+ return snippet;
7
+ const startsWithMaj = /[A-Z]/.test(snippet);
8
+ const endsWithDot = snippet[snippet.length - 1] === ".";
9
+ if (!startsWithMaj) {
10
+ snippet = `...${snippet}`;
11
+ }
12
+ if (!endsWithDot) {
13
+ snippet = `${snippet}...`;
14
+ }
15
+ return snippet;
16
+ }
17
+ export function wrapWithMark(text, matchedTokens) {
18
+ if (!matchedTokens?.length)
19
+ return text;
20
+ let textWithMarks = text;
21
+ matchedTokens.forEach((token) => {
22
+ if (token.length < 2)
23
+ return;
24
+ textWithMarks = textWithMarks.replaceAll(token, `<mark>${token}</mark>`);
25
+ textWithMarks = textWithMarks.replaceAll(`<mark><mark>${token}</mark></mark>`, `<mark>${token}</mark>`);
26
+ });
27
+ return textWithMarks;
28
+ }
@@ -0,0 +1,8 @@
1
+ import type { Hit } from "../results";
2
+ type Props = {
3
+ doc: Hit;
4
+ sendPlausibleGoal: (path: string) => void;
5
+ };
6
+ declare const Access: ({ ...props }: Props) => import("react/jsx-runtime").JSX.Element;
7
+ export default Access;
8
+ //# sourceMappingURL=access.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"access.d.ts","sourceRoot":"","sources":["../../../../../src/lbm/components/instant-search/widgets/access.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAKtC,KAAK,KAAK,GAAG;IACX,GAAG,EAAE,GAAG,CAAC;IAET,iBAAiB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAC3C,CAAC;AACF,QAAA,MAAM,MAAM,iBAAkB,KAAK,4CAoClC,CAAC;AAEF,eAAe,MAAM,CAAC"}
@@ -0,0 +1,29 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import * as React from "react";
3
+ import * as LumiplanApi from "../services/lumiplan-api";
4
+ import Card from "./components/card";
5
+ import Loader from "dt-design-system/es/loader";
6
+ import Metric from "./components/metric";
7
+ const Access = ({ ...props }) => {
8
+ const [equipement, setEquipement] = React.useState("");
9
+ const [open, setOpen] = React.useState("");
10
+ const [surface, setSurface] = React.useState("");
11
+ const [loading, setLoading] = React.useState(true);
12
+ React.useEffect(() => {
13
+ const runEffect = async () => {
14
+ setLoading(true);
15
+ const { roadConditions } = await LumiplanApi.fetchResortAccess();
16
+ const { equipment, status, surface } = roadConditions[0];
17
+ setOpen(status);
18
+ setEquipement(equipment);
19
+ setSurface(surface);
20
+ setLoading(false);
21
+ };
22
+ runEffect();
23
+ }, []);
24
+ if (loading) {
25
+ return (_jsx(Card, { ...props, children: _jsx(Loader, { variant: "overlay" }) }));
26
+ }
27
+ return (_jsxs(Card, { ...props, children: [_jsx(Metric, { long: true, children: _jsx("b", { children: open ? "Route ouverte" : "Route fermée" }) }), equipement === "NORM" ? null : _jsxs("div", { children: ["Equipements : ", equipement] }), _jsxs("div", { children: ["Surface : ", _jsx("b", { children: surface })] })] }));
28
+ };
29
+ export default Access;
@@ -0,0 +1,8 @@
1
+ import type { Hit } from "../results";
2
+ type Props = {
3
+ doc: Hit;
4
+ sendPlausibleGoal: (path: string) => void;
5
+ };
6
+ declare const Activity: ({ doc, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
7
+ export default Activity;
8
+ //# sourceMappingURL=activity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"activity.d.ts","sourceRoot":"","sources":["../../../../../src/lbm/components/instant-search/widgets/activity.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AA8CtC,KAAK,KAAK,GAAG;IACX,GAAG,EAAE,GAAG,CAAC;IAET,iBAAiB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAC3C,CAAC;AACF,QAAA,MAAM,QAAQ,sBAAuB,KAAK,4CA2CzC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -0,0 +1,74 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import * as React from "react";
3
+ import * as TrailIcons from "../../lumiplan/icons/trails";
4
+ import * as LumiplanApi from "../services/lumiplan-api";
5
+ import Card from "./components/card";
6
+ import StatusWithIcon from "./components/status-with-icon";
7
+ import Loader from "dt-design-system/es/loader";
8
+ import css from "./activity.module.css";
9
+ const TRAIL_ICONS = {
10
+ BIKE_PARK: TrailIcons.VTT,
11
+ BOARDERCROSS: TrailIcons.BoarderCross,
12
+ BUMP_TRAIL: TrailIcons.ChampDeBosse,
13
+ COASTER: TrailIcons.LugeSurRail,
14
+ CROSS_COUNTRY_MOUNTAIN_BIKING: TrailIcons.BoarderCross,
15
+ CROSS_COUNTRY_SKIING: TrailIcons.SkiAlpin,
16
+ DOWNHILL_MOUNTAIN_BIKING: TrailIcons.VTT,
17
+ DOWNHILL_SKIING: TrailIcons.SkiAlpin,
18
+ EBIKE: TrailIcons.VTT,
19
+ ENDURO: TrailIcons.VTT,
20
+ FREERIDE_AREA_OFF_PIST: TrailIcons.SkiAlpin,
21
+ FREERIDE_SKI_ITINERARY: TrailIcons.SkiAlpin,
22
+ FUN_ZONE: TrailIcons.Freeride,
23
+ GATE: TrailIcons.Freeride,
24
+ GLADES: TrailIcons.Freeride,
25
+ ILLUMINATED_TRAIL: TrailIcons.PisteEclairee,
26
+ MULTI_USE_TRAIL: TrailIcons.Freeride,
27
+ MTB_ENDURO: TrailIcons.VTT,
28
+ PATH: TrailIcons.Pieton,
29
+ PEDESTRIAN: TrailIcons.Pieton,
30
+ ROUTE_OF_CROSS_COUNTRY: TrailIcons.SkiAlpin,
31
+ SKI_TOURING: TrailIcons.Freeride,
32
+ SLEDDING_HILL: TrailIcons.Luge,
33
+ SNOWPARK: TrailIcons.Snowpark,
34
+ SNOWPARK_LINE: TrailIcons.Snowpark,
35
+ SNOWSHOE: TrailIcons.Raquette,
36
+ SNOWTUBING: TrailIcons.Snowtubing,
37
+ TERRAIN_PARK: TrailIcons.Snowpark,
38
+ TERRAIN_PARK_US: TrailIcons.Snowpark,
39
+ TRAIL_RUNNING: TrailIcons.Pieton,
40
+ TREETOP_ADVENTURE_PARK: TrailIcons.Accrobranche,
41
+ TYROLEAN: TrailIcons.Tyrolienne,
42
+ VIDEO_ZONE: TrailIcons.Freeride,
43
+ UNDEF: TrailIcons.Freeride,
44
+ DEFAULT: TrailIcons.Freeride,
45
+ };
46
+ const Activity = ({ doc, ...props }) => {
47
+ const [pois, setPois] = React.useState([]);
48
+ const [loading, setLoading] = React.useState(true);
49
+ React.useEffect(() => {
50
+ const runEffect = async () => {
51
+ setLoading(true);
52
+ const data = await LumiplanApi.fetchPois();
53
+ setPois(data);
54
+ setLoading(false);
55
+ };
56
+ runEffect();
57
+ }, []);
58
+ if (loading) {
59
+ return (_jsx(Card, { doc: doc, ...props, children: _jsx(Loader, { variant: "overlay" }) }));
60
+ }
61
+ const activity = pois
62
+ .flatMap((poi) => poi.activities)
63
+ .filter((activity) => activity !== undefined)
64
+ .find((poi) => poi.name === doc.document.title);
65
+ if (!activity) {
66
+ return null;
67
+ }
68
+ const Icon = TRAIL_ICONS[activity.activityType] || TRAIL_ICONS.DEFAULT;
69
+ const open = activity.openingStatus && activity.openingStatus === "OPEN";
70
+ const label = open ? "Ouvert" : "Fermé";
71
+ return (_jsx(Card, { doc: doc, ...props, children: _jsxs(StatusWithIcon, { icon: Icon, children: [_jsx("b", { className: open ? css.green : css.red, children: label }), activity.openingTimesReal &&
72
+ activity.openingTimesReal.map((time, i) => (_jsxs("div", { children: [time.beginTime, " - ", time.endTime] }, i)))] }) }));
73
+ };
74
+ export default Activity;
@@ -0,0 +1,6 @@
1
+ .green {
2
+ color: hsl(var(--green));
3
+ }
4
+ .red {
5
+ color: hsl(var(--red));
6
+ }
@@ -0,0 +1,11 @@
1
+ import * as React from "react";
2
+ import { Hit } from "../../results";
3
+ type Props = {
4
+ doc: Hit;
5
+ overlayTitle?: boolean;
6
+ sendPlausibleGoal: (path: string) => void;
7
+ children: React.ReactNode;
8
+ };
9
+ export default function Card({ doc, overlayTitle, sendPlausibleGoal, children, }: Props): import("react/jsx-runtime").JSX.Element;
10
+ export {};
11
+ //# sourceMappingURL=card.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"card.d.ts","sourceRoot":"","sources":["../../../../../../src/lbm/components/instant-search/widgets/components/card.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,EAAE,GAAG,EAAE,MAAM,eAAe,CAAC;AAUpC,KAAK,KAAK,GAAG;IACX,GAAG,EAAE,GAAG,CAAC;IACT,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB,iBAAiB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC;AACF,MAAM,CAAC,OAAO,UAAU,IAAI,CAAC,EAC3B,GAAG,EACH,YAAY,EACZ,iBAAiB,EACjB,QAAQ,GACT,EAAE,KAAK,2CAqBP"}
@@ -0,0 +1,15 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import Link from "ublo/link";
3
+ import * as Ripple from "dt-design-system/es/ripple";
4
+ import * as Utils from "../../services/utils";
5
+ import css from "./card.module.css";
6
+ import classNames from "classnames";
7
+ const createRipple = (e) => {
8
+ Ripple.create(e);
9
+ };
10
+ export default function Card({ doc, overlayTitle, sendPlausibleGoal, children, }) {
11
+ const { document: { title: _title, target, path }, highlight, } = doc;
12
+ const decodedPath = decodeURIComponent(target || path);
13
+ const title = Utils.getHighlight("title", highlight) || _title;
14
+ return (_jsxs(Link, { className: css.card, href: decodedPath, onClick: sendPlausibleGoal(decodedPath), onMouseDown: createRipple, children: [_jsx("div", { dangerouslySetInnerHTML: { __html: title }, className: classNames(css.title, { [css.overlay]: overlayTitle }) }), children] }));
15
+ }
@@ -0,0 +1,60 @@
1
+ .card {
2
+ display: flex;
3
+ position: relative;
4
+ height: 75px;
5
+ flex-direction: column;
6
+ gap: 4px;
7
+ justify-content: space-between;
8
+ align-items: center;
9
+ overflow: hidden;
10
+ color: var(--ds-grey-500, #484848);
11
+ background-color: var(--ds-grey-000, #fff);
12
+ border-radius: var(--ds-input-radius, var(--ds-radius-200, 8px));
13
+ border: var(--ds-input-border, 1px solid var(--ds-grey-300, #d7d7d7));
14
+ font-size: 13px;
15
+ }
16
+
17
+ .card mark {
18
+ position: relative;
19
+ display: inline-block;
20
+ font-weight: 700;
21
+ color: var(--ds-secondary, var(--ds-blue-400, #4177f6));
22
+ background-color: transparent;
23
+ }
24
+
25
+ .card mark::before {
26
+ content: "";
27
+ position: absolute;
28
+ top: 0;
29
+ left: 0;
30
+ width: 100%;
31
+ height: 100%;
32
+ background-color: var(--ds-secondary, var(--ds-blue-400, #4177f6));
33
+ border-radius: calc(var(--ds-radius-100, 6px) / 3);
34
+ opacity: 0.15;
35
+ }
36
+
37
+ .title {
38
+ font-weight: 700;
39
+ font-size: 13px;
40
+ line-height: 1;
41
+ padding-top: 4px;
42
+ }
43
+ .overlay {
44
+ position: absolute;
45
+ bottom: 8px;
46
+ left: 0;
47
+ text-align: center;
48
+ width: 100%;
49
+ color: hsl(var(--grey-000));
50
+ text-shadow: var(--shadow-200);
51
+ z-index: 1;
52
+ font-size: 14px;
53
+ }
54
+ .overlay mark {
55
+ color: hsl(var(--blue-200));
56
+ }
57
+
58
+ .overlay mark::before {
59
+ background-color: hsl(var(--grey-000));
60
+ }
@@ -0,0 +1,8 @@
1
+ import * as React from "react";
2
+ type Props = {
3
+ children: React.ReactNode;
4
+ long?: boolean;
5
+ };
6
+ export default function Metric({ children, long }: Props): import("react/jsx-runtime").JSX.Element;
7
+ export {};
8
+ //# sourceMappingURL=metric.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"metric.d.ts","sourceRoot":"","sources":["../../../../../../src/lbm/components/instant-search/widgets/components/metric.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,KAAK,KAAK,GAAG;IACX,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB,CAAC;AACF,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,KAAK,2CAMvD"}
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import css from "./metric.module.css";
3
+ import classNames from "classnames";
4
+ export default function Metric({ children, long }) {
5
+ return (_jsx("div", { className: classNames(css.metric, { [css.longMetric]: long }), children: children }));
6
+ }
@@ -0,0 +1,12 @@
1
+ .metric {
2
+ flex-grow: 1;
3
+ display: flex;
4
+ align-items: center;
5
+ font-size: var(--h2);
6
+ }
7
+ .longMetric {
8
+ font-size: inherit;
9
+ display: flex;
10
+ flex-direction: column;
11
+ justify-content: center;
12
+ }
@@ -0,0 +1,9 @@
1
+ import React from "react";
2
+ type Props = {
3
+ icon: React.FC<React.SVGProps<SVGSVGElement>>;
4
+ iconClassName?: string;
5
+ children: React.ReactNode;
6
+ };
7
+ export default function StatusWithIcon({ icon: Icon, iconClassName, children, }: Props): import("react/jsx-runtime").JSX.Element;
8
+ export {};
9
+ //# sourceMappingURL=status-with-icon.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"status-with-icon.d.ts","sourceRoot":"","sources":["../../../../../../src/lbm/components/instant-search/widgets/components/status-with-icon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,KAAK,KAAK,GAAG;IACX,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,aAAa,CAAC,CAAC,CAAC;IAC9C,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC;AACF,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,EACrC,IAAI,EAAE,IAAI,EACV,aAAa,EACb,QAAQ,GACT,EAAE,KAAK,2CASP"}
@@ -0,0 +1,5 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import css from "./status-with-icon.module.css";
3
+ export default function StatusWithIcon({ icon: Icon, iconClassName, children, }) {
4
+ return (_jsxs("div", { className: css.statusWithIcon, children: [_jsx("div", { className: iconClassName, children: _jsx(Icon, {}) }), _jsx("div", { children: children })] }));
5
+ }
@@ -0,0 +1,12 @@
1
+ .statusWithIcon {
2
+ display: flex;
3
+ align-items: center;
4
+ gap: 4px;
5
+ flex-grow: 1;
6
+ fill: var(--blue-gradient-fill);
7
+ }
8
+ .statusWithIcon svg {
9
+ --size: 32px;
10
+ width: var(--size);
11
+ height: var(--size);
12
+ }
@@ -0,0 +1,9 @@
1
+ import type { Hit } from "../results";
2
+ type Props = {
3
+ doc: Hit;
4
+ dawn?: boolean;
5
+ sendPlausibleGoal: (path: string) => void;
6
+ };
7
+ declare const DawnNightOpenings: ({ dawn, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
8
+ export default DawnNightOpenings;
9
+ //# sourceMappingURL=dawn-nights-openings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dawn-nights-openings.d.ts","sourceRoot":"","sources":["../../../../../src/lbm/components/instant-search/widgets/dawn-nights-openings.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAStC,KAAK,KAAK,GAAG;IACX,GAAG,EAAE,GAAG,CAAC;IACT,IAAI,CAAC,EAAE,OAAO,CAAC;IAEf,iBAAiB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAC3C,CAAC;AACF,QAAA,MAAM,iBAAiB,uBAAwB,KAAK,4CAuDnD,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
@@ -0,0 +1,37 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import * as React from "react";
3
+ import * as LumiplanApi from "../services/lumiplan-api";
4
+ import classNames from "classnames";
5
+ import Card from "./components/card";
6
+ import css from "./dawn-nights-openings.module.css";
7
+ import Loader from "dt-design-system/es/loader";
8
+ const dateLayout = {
9
+ day: "numeric",
10
+ };
11
+ const DawnNightOpenings = ({ dawn, ...props }) => {
12
+ const [dawnSkiingDays, setDawnSkiingDays] = React.useState([]);
13
+ const [nightSkiingDays, setNightSkiingDays] = React.useState([]);
14
+ const [loading, setLoading] = React.useState(true);
15
+ React.useEffect(() => {
16
+ const runEffect = async () => {
17
+ setLoading(true);
18
+ const { availability } = await LumiplanApi.fetchResortOpening();
19
+ setDawnSkiingDays(availability.dawnSkiingDays);
20
+ setNightSkiingDays(availability.nightSkiingDays);
21
+ setLoading(false);
22
+ };
23
+ runEffect();
24
+ }, []);
25
+ if (loading) {
26
+ return (_jsx(Card, { ...props, children: _jsx(Loader, { variant: "overlay" }) }));
27
+ }
28
+ const days = dawn ? dawnSkiingDays : nightSkiingDays;
29
+ return (_jsxs(Card, { ...props, children: [_jsx("div", { className: css.days, children: days.map((day, i) => {
30
+ const weekDayDate = new Date();
31
+ weekDayDate.setDate(weekDayDate.getDate() - ((weekDayDate.getDay() + 6) % 7) + i);
32
+ return (_jsxs("div", { className: classNames(css.day, day.open
33
+ ? css.dayOpen
34
+ : css.dayClosed), children: [_jsx("div", { children: weekDayDate.toLocaleDateString("fr", dateLayout) }), _jsx("div", { children: day.dayType[0] })] }, i));
35
+ }) }), days.filter((day) => day.open).length === 0 && (_jsxs("div", { className: css.textCenter, children: ["Aucune ", dawn ? "aurore" : "nocturne", " propos\u00E9e cette semaine"] }))] }));
36
+ };
37
+ export default DawnNightOpenings;
@@ -0,0 +1,33 @@
1
+ .days {
2
+ display: flex;
3
+ flex-direction: row;
4
+ gap: 4px;
5
+ justify-content: center;
6
+ align-items: center;
7
+ font-size: var(--label);
8
+ }
9
+ .day {
10
+ display: flex;
11
+ flex-direction: column;
12
+ gap: 4px;
13
+ justify-content: center;
14
+ align-items: center;
15
+ padding: 4px 8px;
16
+ border-radius: 8px;
17
+ background-color: #f5f5f6;
18
+ }
19
+
20
+ .dayClosed {
21
+ color: #444;
22
+ }
23
+ .dayClosed > :nth-child(2) {
24
+ text-decoration: line-through 2px;
25
+ }
26
+ .dayOpen {
27
+ background-color: #aaf5aa;
28
+ font-weight: 700;
29
+ }
30
+
31
+ .textCenter {
32
+ text-align: center;
33
+ }
@@ -0,0 +1,8 @@
1
+ import type { Hit } from "../results";
2
+ type Props = {
3
+ doc: Hit;
4
+ sendPlausibleGoal: (path: string) => void;
5
+ };
6
+ declare const Lift: ({ doc, ...props }: Props) => import("react/jsx-runtime").JSX.Element;
7
+ export default Lift;
8
+ //# sourceMappingURL=lift.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lift.d.ts","sourceRoot":"","sources":["../../../../../src/lbm/components/instant-search/widgets/lift.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AAwBtC,KAAK,KAAK,GAAG;IACX,GAAG,EAAE,GAAG,CAAC;IAET,iBAAiB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAC3C,CAAC;AACF,QAAA,MAAM,IAAI,sBAAuB,KAAK,4CA4CrC,CAAC;AAEF,eAAe,IAAI,CAAC"}