ublo-lib 1.47.7 → 1.47.9-1.rc0
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.
- package/es/common/components/admin-links/admin-links.d.ts +7 -1
- package/es/common/components/admin-links/admin-links.d.ts.map +1 -1
- package/es/common/components/admin-links/admin-links.js +14 -8
- package/es/common/components/cart-dialog/cart-dialog-inner.d.ts +2 -1
- package/es/common/components/cart-dialog/cart-dialog-inner.d.ts.map +1 -1
- package/es/common/components/cart-dialog/cart-dialog-inner.js +13 -2
- package/es/common/components/cart-dialog/cart-dialog.d.ts +2 -1
- package/es/common/components/cart-dialog/cart-dialog.d.ts.map +1 -1
- package/es/common/components/cart-dialog/cart-dialog.js +2 -2
- package/es/common/components/cart-dialog/default.d.ts +2 -1
- package/es/common/components/cart-dialog/default.d.ts.map +1 -1
- package/es/common/components/cart-dialog/default.js +2 -2
- package/es/common/components/cart-dialog/esf-custom.d.ts +2 -1
- package/es/common/components/cart-dialog/esf-custom.d.ts.map +1 -1
- package/es/common/components/cart-dialog/esf-custom.js +2 -2
- package/es/common/components/cart-dialog/esf.d.ts +2 -1
- package/es/common/components/cart-dialog/esf.d.ts.map +1 -1
- package/es/common/components/cart-dialog/esf.js +2 -2
- package/es/common/components/cart-dialog/lodging.d.ts +2 -1
- package/es/common/components/cart-dialog/lodging.d.ts.map +1 -1
- package/es/common/components/cart-dialog/lodging.js +2 -2
- package/es/common/components/cart-dialog/ski-passes.d.ts +2 -1
- package/es/common/components/cart-dialog/ski-passes.d.ts.map +1 -1
- package/es/common/components/cart-dialog/ski-passes.js +2 -2
- package/es/common/components/cart-dialog/ski-rental.d.ts +2 -1
- package/es/common/components/cart-dialog/ski-rental.d.ts.map +1 -1
- package/es/common/components/cart-dialog/ski-rental.js +2 -2
- package/es/common/components/cart-dialog/vakario.d.ts +2 -1
- package/es/common/components/cart-dialog/vakario.d.ts.map +1 -1
- package/es/common/components/cart-dialog/vakario.js +2 -2
- package/es/common/components/cart-preview/cart-pill.d.ts +3 -1
- package/es/common/components/cart-preview/cart-pill.d.ts.map +1 -1
- package/es/common/components/cart-preview/cart-pill.js +5 -3
- package/es/common/components/cart-preview/cart-preview.d.ts +4 -1
- package/es/common/components/cart-preview/cart-preview.d.ts.map +1 -1
- package/es/common/components/cart-preview/cart-preview.js +19 -6
- package/es/common/components/cart-preview/utils.d.ts.map +1 -1
- package/es/common/components/cart-preview/utils.js +8 -1
- package/es/common/components/collapsible/collapsible.module.css +1 -1
- package/es/common/components/cookie-consent/cookie-consent.d.ts.map +1 -1
- package/es/common/components/cookie-consent/cookie-consent.js +10 -1
- package/es/common/components/cross-selling-editor/services/utils.d.ts.map +1 -1
- package/es/common/components/cross-selling-editor/services/utils.js +6 -5
- package/es/common/components/custom-contact-form/attachment.js +2 -2
- package/es/common/components/custom-contact-form/custom-contact-form.js +8 -3
- package/es/common/components/date-picker/calendar.d.ts +2 -1
- package/es/common/components/date-picker/calendar.d.ts.map +1 -1
- package/es/common/components/date-picker/calendar.js +2 -4
- package/es/common/components/date-picker/context-lang.d.ts +6 -0
- package/es/common/components/date-picker/context-lang.d.ts.map +1 -0
- package/es/common/components/date-picker/context-lang.js +9 -0
- package/es/common/components/date-picker/date-item.d.ts +2 -1
- package/es/common/components/date-picker/date-item.d.ts.map +1 -1
- package/es/common/components/date-picker/date-item.js +1 -3
- package/es/common/components/date-picker/date-item.module.css +1 -1
- package/es/common/components/date-picker/date-picker.d.ts +2 -1
- package/es/common/components/date-picker/date-picker.d.ts.map +1 -1
- package/es/common/components/date-picker/date-picker.js +6 -3
- package/es/common/components/date-picker/month.d.ts +2 -1
- package/es/common/components/date-picker/month.d.ts.map +1 -1
- package/es/common/components/date-picker/month.js +2 -4
- package/es/common/components/gesco-contact-form/services/messages.js +1 -1
- package/es/common/components/infinite-carousel/index.d.ts +3 -0
- package/es/common/components/infinite-carousel/index.d.ts.map +1 -0
- package/es/common/components/infinite-carousel/index.js +2 -0
- package/es/common/components/infinite-carousel/infinite-carousel.d.ts +20 -0
- package/es/common/components/infinite-carousel/infinite-carousel.d.ts.map +1 -0
- package/es/common/components/infinite-carousel/infinite-carousel.js +196 -0
- package/es/common/components/infinite-carousel/infinite-carousel.module.css +175 -0
- package/es/common/components/information/i18n.json +6 -0
- package/es/common/components/information/information.d.ts.map +1 -1
- package/es/common/components/information/information.js +4 -2
- package/es/common/components/information/information.module.css +1 -2
- package/es/common/components/information/use-season-choice.d.ts +2 -0
- package/es/common/components/information/use-season-choice.d.ts.map +1 -0
- package/es/common/components/information/use-season-choice.js +47 -0
- package/es/common/components/search-bar/search-bar.d.ts +2 -1
- package/es/common/components/search-bar/search-bar.d.ts.map +1 -1
- package/es/common/components/search-bar/search-bar.js +19 -6
- package/es/common/components/season-switch/index.d.ts +6 -0
- package/es/common/components/season-switch/index.d.ts.map +1 -0
- package/es/common/components/season-switch/index.js +42 -0
- package/es/common/components/season-switch/index.module.css +24 -0
- package/es/common/components/season-switch/use-choose-winter.d.ts +2 -0
- package/es/common/components/season-switch/use-choose-winter.d.ts.map +1 -0
- package/es/common/components/season-switch/use-choose-winter.js +47 -0
- package/es/common/components/week-selector/services/weeks.d.ts +1 -1
- package/es/common/components/week-selector/services/weeks.d.ts.map +1 -1
- package/es/common/components/week-selector/services/weeks.js +4 -2
- package/es/common/components/week-selector/week-selector.d.ts +1 -1
- package/es/common/components/week-selector/week-selector.d.ts.map +1 -1
- package/es/common/components/week-selector/week-selector.js +6 -2
- package/es/common/hooks/use-packages.js +1 -1
- package/es/esf/components/espace-prive/index.d.ts +2 -1
- package/es/esf/components/espace-prive/index.d.ts.map +1 -1
- package/es/esf/components/espace-prive/index.js +2 -2
- package/es/esf/components/espace-prive/partenaire.d.ts +2 -1
- package/es/esf/components/espace-prive/partenaire.d.ts.map +1 -1
- package/es/esf/components/espace-prive/partenaire.js +2 -2
- package/es/esf/components/espace-prive/tunnel.d.ts +3 -1
- package/es/esf/components/espace-prive/tunnel.d.ts.map +1 -1
- package/es/esf/components/espace-prive/tunnel.js +2 -2
- package/es/esf/components/instant-search/hooks/use-search.d.ts.map +1 -1
- package/es/esf/components/instant-search/hooks/use-search.js +8 -1
- package/es/esf/components/instant-search/instant-search.d.ts.map +1 -1
- package/es/esf/components/instant-search/instant-search.js +16 -1
- package/es/esf/components/instant-search/links.d.ts +1 -1
- package/es/esf/components/instant-search/links.d.ts.map +1 -1
- package/es/esf/components/instant-search/links.js +1 -1
- package/es/esf/components/instant-search/products.d.ts +1 -1
- package/es/esf/components/instant-search/products.d.ts.map +1 -1
- package/es/esf/components/instant-search/products.js +1 -1
- package/es/esf/components/instant-search/results.d.ts +1 -1
- package/es/esf/components/instant-search/results.d.ts.map +1 -1
- package/es/esf/components/instant-search/results.js +2 -2
- package/es/esf/components/instructors-book/sheet.d.ts.map +1 -1
- package/es/esf/components/instructors-book/sheet.js +16 -1
- package/es/esf/components/levels/levels.d.ts +3 -1
- package/es/esf/components/levels/levels.d.ts.map +1 -1
- package/es/esf/components/levels/levels.js +24 -3
- package/es/esf/components/magic-box/booking.d.ts +3 -1
- package/es/esf/components/magic-box/booking.d.ts.map +1 -1
- package/es/esf/components/magic-box/booking.js +12 -3
- package/es/esf/components/magic-box/filter.d.ts.map +1 -1
- package/es/esf/components/magic-box/filter.js +8 -8
- package/es/esf/components/magic-box/magic-box.d.ts +2 -1
- package/es/esf/components/magic-box/magic-box.d.ts.map +1 -1
- package/es/esf/components/magic-box/magic-box.js +7 -9
- package/es/esf/components/magic-box/services/api.d.ts.map +1 -1
- package/es/esf/components/magic-box/services/api.js +1 -0
- package/es/esf/components/period-picker/period-picker.d.ts.map +1 -1
- package/es/esf/components/period-picker/period-picker.js +1 -1
- package/es/esf/components/period-picker/weeks.module.css +8 -5
- package/es/esf/hooks/use-booking-links.d.ts.map +1 -1
- package/es/esf/hooks/use-booking-links.js +11 -7
- package/es/esf/hooks/use-gesco-referral.d.ts +2 -0
- package/es/esf/hooks/use-gesco-referral.d.ts.map +1 -0
- package/es/esf/hooks/use-gesco-referral.js +18 -0
- package/es/future/components/event-analytics/instant-search.d.ts +10 -0
- package/es/future/components/event-analytics/instant-search.d.ts.map +1 -0
- package/es/future/components/event-analytics/instant-search.js +41 -0
- package/es/future/components/msem/index.d.ts +2 -1
- package/es/future/components/msem/index.d.ts.map +1 -1
- package/es/future/components/msem/index.js +2 -1
- package/es/future/components/msem/tunnel-new.d.ts +32 -0
- package/es/future/components/msem/tunnel-new.d.ts.map +1 -0
- package/es/future/components/msem/tunnel-new.js +27 -0
- package/es/future/components/msem/tunnel.d.ts +1 -1
- package/es/future/components/msem/tunnel.d.ts.map +1 -1
- package/es/future/components/msem/tunnel.js +8 -0
- package/es/future/components/msem/types.d.ts +1 -0
- package/es/future/components/msem/types.d.ts.map +1 -1
- package/es/future/components/msem/utils.d.ts +1 -1
- package/es/future/components/msem/utils.d.ts.map +1 -1
- package/es/future/components/msem-preset-editor/components/widget-list-item.d.ts.map +1 -1
- package/es/future/components/msem-preset-editor/components/widget-list-item.js +1 -2
- package/es/future/components/msem-preset-editor/editors/lodgings.d.ts.map +1 -1
- package/es/future/components/msem-preset-editor/editors/lodgings.js +48 -48
- package/es/future/components/msem-preset-editor/editors/lodgings.module.css +24 -0
- package/es/future/components/msem-preset-editor/editors/ski-passes.d.ts.map +1 -1
- package/es/future/components/msem-preset-editor/editors/ski-passes.js +23 -24
- package/es/future/components/msem-preset-editor/editors/ski-rental.d.ts +1 -1
- package/es/future/components/msem-preset-editor/editors/ski-rental.d.ts.map +1 -1
- package/es/future/components/msem-preset-editor/editors/ski-rental.js +161 -17
- package/es/future/components/msem-preset-editor/msem-preset-editor.d.ts.map +1 -1
- package/es/future/components/msem-preset-editor/msem-preset-editor.js +3 -1
- package/es/future/components/msem-preset-editor/services/api.d.ts +2 -0
- package/es/future/components/msem-preset-editor/services/api.d.ts.map +1 -1
- package/es/future/components/msem-preset-editor/services/api.js +8 -0
- package/es/future/components/plausible/services/callback.d.ts +2 -1
- package/es/future/components/plausible/services/callback.d.ts.map +1 -1
- package/es/future/components/plausible/services/callback.js +102 -6
- package/es/lbm/components/instant-search/faqs.d.ts +1 -1
- package/es/lbm/components/instant-search/faqs.d.ts.map +1 -1
- package/es/lbm/components/instant-search/faqs.js +1 -1
- package/es/lbm/components/instant-search/google-results.d.ts +1 -1
- package/es/lbm/components/instant-search/google-results.d.ts.map +1 -1
- package/es/lbm/components/instant-search/links.d.ts +1 -1
- package/es/lbm/components/instant-search/links.d.ts.map +1 -1
- package/es/lbm/components/instant-search/links.js +1 -1
- package/es/lbm/components/instant-search/products.d.ts +1 -1
- package/es/lbm/components/instant-search/products.d.ts.map +1 -1
- package/es/lbm/components/instant-search/products.js +1 -1
- package/es/lbm/components/instant-search/results.d.ts +1 -1
- package/es/lbm/components/instant-search/results.d.ts.map +1 -1
- package/es/lbm/components/instant-search/widgets/access.d.ts +1 -1
- package/es/lbm/components/instant-search/widgets/access.d.ts.map +1 -1
- package/es/lbm/components/instant-search/widgets/activity.d.ts +1 -1
- package/es/lbm/components/instant-search/widgets/activity.d.ts.map +1 -1
- package/es/lbm/components/instant-search/widgets/components/card.d.ts +1 -1
- package/es/lbm/components/instant-search/widgets/components/card.d.ts.map +1 -1
- package/es/lbm/components/instant-search/widgets/components/card.js +1 -1
- package/es/lbm/components/instant-search/widgets/dawn-nights-openings.d.ts +1 -1
- package/es/lbm/components/instant-search/widgets/dawn-nights-openings.d.ts.map +1 -1
- package/es/lbm/components/instant-search/widgets/lift.d.ts +1 -1
- package/es/lbm/components/instant-search/widgets/lift.d.ts.map +1 -1
- package/es/lbm/components/instant-search/widgets/lifts.d.ts +1 -1
- package/es/lbm/components/instant-search/widgets/lifts.d.ts.map +1 -1
- package/es/lbm/components/instant-search/widgets/msem-widget.d.ts +1 -1
- package/es/lbm/components/instant-search/widgets/msem-widget.d.ts.map +1 -1
- package/es/lbm/components/instant-search/widgets/openings.d.ts +1 -1
- package/es/lbm/components/instant-search/widgets/openings.d.ts.map +1 -1
- package/es/lbm/components/instant-search/widgets/slope.d.ts +1 -1
- package/es/lbm/components/instant-search/widgets/slope.d.ts.map +1 -1
- package/es/lbm/components/instant-search/widgets/slopes.d.ts +1 -1
- package/es/lbm/components/instant-search/widgets/slopes.d.ts.map +1 -1
- package/es/lbm/components/instant-search/widgets/snow.d.ts +1 -1
- package/es/lbm/components/instant-search/widgets/snow.d.ts.map +1 -1
- package/es/lbm/components/instant-search/widgets/weather.d.ts +1 -1
- package/es/lbm/components/instant-search/widgets/weather.d.ts.map +1 -1
- package/es/lbm/components/instant-search/widgets/webcam.d.ts +1 -1
- package/es/lbm/components/instant-search/widgets/webcam.d.ts.map +1 -1
- package/es/lbm/components/instant-search/widgets.d.ts +1 -1
- package/es/lbm/components/instant-search/widgets.d.ts.map +1 -1
- package/es/lbm/components/lumiplan/pois.d.ts.map +1 -1
- package/es/lbm/components/lumiplan/pois.js +6 -2
- package/es/market-place/components/instant-search/google-results.d.ts +1 -1
- package/es/market-place/components/instant-search/google-results.d.ts.map +1 -1
- package/es/market-place/components/instant-search/links.d.ts +1 -1
- package/es/market-place/components/instant-search/links.d.ts.map +1 -1
- package/es/market-place/components/instant-search/links.js +1 -1
- package/es/market-place/components/instant-search/products.d.ts +1 -1
- package/es/market-place/components/instant-search/products.d.ts.map +1 -1
- package/es/market-place/components/instant-search/products.js +1 -1
- package/es/market-place/components/instant-search/results.d.ts +1 -1
- package/es/market-place/components/instant-search/results.d.ts.map +1 -1
- package/package.json +2 -2
- package/es/common/utils/file-manager.d.ts +0 -8
- package/es/common/utils/file-manager.d.ts.map +0 -1
- package/es/common/utils/file-manager.js +0 -12
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as Plausible from "../../future/components/plausible";
|
|
3
|
+
const STORAGE_KEY = "gescoReferral";
|
|
4
|
+
const CHECKER_STORAGE_KEY = "gescoReferralChecked";
|
|
5
|
+
export default function useGescoReferral() {
|
|
6
|
+
React.useEffect(() => {
|
|
7
|
+
const storedChecker = window.sessionStorage.getItem(CHECKER_STORAGE_KEY);
|
|
8
|
+
const storedGescoReferral = window.localStorage.getItem(STORAGE_KEY);
|
|
9
|
+
if (!storedChecker && storedGescoReferral) {
|
|
10
|
+
const { type, exp } = JSON.parse(storedGescoReferral);
|
|
11
|
+
const isExpired = exp < Date.now();
|
|
12
|
+
if (!isExpired && type !== -1) {
|
|
13
|
+
Plausible.sendGoal("MseM: Payment link", { GescoReferral: type });
|
|
14
|
+
window.sessionStorage.setItem(CHECKER_STORAGE_KEY, "true");
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}, []);
|
|
18
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
type EventType = "load" | "search" | "success" | "fail" | "cancel";
|
|
2
|
+
export declare const sendEvent: (client: string, event: EventType, details?: {
|
|
3
|
+
query?: string;
|
|
4
|
+
match_count?: number;
|
|
5
|
+
path?: string;
|
|
6
|
+
kind?: string;
|
|
7
|
+
searchType?: string;
|
|
8
|
+
}) => void;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=instant-search.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"instant-search.d.ts","sourceRoot":"","sources":["../../../../src/future/components/event-analytics/instant-search.ts"],"names":[],"mappings":"AAGA,KAAK,SAAS,GAAG,MAAM,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,GAAG,QAAQ,CAAC;AAEnE,eAAO,MAAM,SAAS,WACZ,MAAM,SACP,SAAS,YACP;IACP,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,SA6CF,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
const searchApi = "https://search.ublo.app/api";
|
|
2
|
+
const logApiUrl = `${searchApi}ublo-search/events/instant-search`;
|
|
3
|
+
let sessionIdGlobal = null;
|
|
4
|
+
export const sendEvent = (client, event, details = {}) => {
|
|
5
|
+
try {
|
|
6
|
+
if (event === "load") {
|
|
7
|
+
let dt = new Date().getTime();
|
|
8
|
+
const uuid = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, (c) => {
|
|
9
|
+
const r = (dt + Math.random() * 16) % 16 | 0;
|
|
10
|
+
dt = Math.floor(dt / 16);
|
|
11
|
+
return (c === "x" ? r : (r & 0x3) | 0x8).toString(16);
|
|
12
|
+
});
|
|
13
|
+
sessionIdGlobal = uuid;
|
|
14
|
+
}
|
|
15
|
+
if (sessionIdGlobal === null) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
fetch(logApiUrl, {
|
|
19
|
+
method: "POST",
|
|
20
|
+
headers: {
|
|
21
|
+
"Content-Type": "application/json",
|
|
22
|
+
},
|
|
23
|
+
body: JSON.stringify({
|
|
24
|
+
session: sessionIdGlobal,
|
|
25
|
+
client,
|
|
26
|
+
event,
|
|
27
|
+
...details,
|
|
28
|
+
searchType: details.searchType || "instant-search",
|
|
29
|
+
mobile: typeof navigator !== "undefined"
|
|
30
|
+
? navigator.userAgent.match(/Mobi/) !== null
|
|
31
|
+
: false,
|
|
32
|
+
hostname: typeof window !== "undefined" ? window.location.hostname : "server",
|
|
33
|
+
url: typeof window !== "undefined" ? window.location.href : "server",
|
|
34
|
+
userAgent: typeof navigator !== "undefined" ? navigator.userAgent : "server",
|
|
35
|
+
timestamp: new Date().toISOString(),
|
|
36
|
+
}),
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
catch (e) {
|
|
40
|
+
}
|
|
41
|
+
};
|
|
@@ -8,7 +8,8 @@ import Vakario from "./vakario";
|
|
|
8
8
|
import Elloha from "./elloha";
|
|
9
9
|
import OtherProducts from "./other-products";
|
|
10
10
|
import Tunnel from "./tunnel";
|
|
11
|
+
import TunnelNew from "./tunnel-new";
|
|
11
12
|
import Account from "./account";
|
|
12
13
|
import { loadWidget } from "./utils";
|
|
13
|
-
export { Script, loadWidget, Lodging, SkiRental, SkiPass, LiftJb, Esf, Vakario, Elloha, OtherProducts, Tunnel, Account, };
|
|
14
|
+
export { Script, loadWidget, Lodging, SkiRental, SkiPass, LiftJb, Esf, Vakario, Elloha, OtherProducts, Tunnel, TunnelNew, Account, };
|
|
14
15
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/future/components/msem/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,OAAO,MAAM,WAAW,CAAC;AAChC,OAAO,SAAS,MAAM,cAAc,CAAC;AACrC,OAAO,OAAO,MAAM,YAAY,CAAC;AACjC,OAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,OAAO,GAAG,MAAM,OAAO,CAAC;AACxB,OAAO,OAAO,MAAM,WAAW,CAAC;AAChC,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,aAAa,MAAM,kBAAkB,CAAC;AAC7C,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,OAAO,MAAM,WAAW,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,OAAO,EACL,MAAM,EACN,UAAU,EACV,OAAO,EACP,SAAS,EACT,OAAO,EACP,MAAM,EACN,GAAG,EACH,OAAO,EACP,MAAM,EACN,aAAa,EACb,MAAM,EACN,OAAO,GACR,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/future/components/msem/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,OAAO,MAAM,WAAW,CAAC;AAChC,OAAO,SAAS,MAAM,cAAc,CAAC;AACrC,OAAO,OAAO,MAAM,YAAY,CAAC;AACjC,OAAO,MAAM,MAAM,WAAW,CAAC;AAC/B,OAAO,GAAG,MAAM,OAAO,CAAC;AACxB,OAAO,OAAO,MAAM,WAAW,CAAC;AAChC,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,aAAa,MAAM,kBAAkB,CAAC;AAC7C,OAAO,MAAM,MAAM,UAAU,CAAC;AAC9B,OAAO,SAAS,MAAM,cAAc,CAAC;AACrC,OAAO,OAAO,MAAM,WAAW,CAAC;AAChC,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAErC,OAAO,EACL,MAAM,EACN,UAAU,EACV,OAAO,EACP,SAAS,EACT,OAAO,EACP,MAAM,EACN,GAAG,EACH,OAAO,EACP,MAAM,EACN,aAAa,EACb,MAAM,EACN,SAAS,EACT,OAAO,GACR,CAAC"}
|
|
@@ -8,6 +8,7 @@ import Vakario from "./vakario";
|
|
|
8
8
|
import Elloha from "./elloha";
|
|
9
9
|
import OtherProducts from "./other-products";
|
|
10
10
|
import Tunnel from "./tunnel";
|
|
11
|
+
import TunnelNew from "./tunnel-new";
|
|
11
12
|
import Account from "./account";
|
|
12
13
|
import { loadWidget } from "./utils";
|
|
13
|
-
export { Script, loadWidget, Lodging, SkiRental, SkiPass, LiftJb, Esf, Vakario, Elloha, OtherProducts, Tunnel, Account, };
|
|
14
|
+
export { Script, loadWidget, Lodging, SkiRental, SkiPass, LiftJb, Esf, Vakario, Elloha, OtherProducts, Tunnel, TunnelNew, Account, };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import type { GlobalOptions, GlobalPresets } from "./types";
|
|
3
|
+
type Show = "cart" | "offers" | "stay";
|
|
4
|
+
type Options = GlobalOptions & {
|
|
5
|
+
esfUrl?: string;
|
|
6
|
+
skiPassUrl?: string;
|
|
7
|
+
lodgingUrl?: string;
|
|
8
|
+
activitiesUrl?: string;
|
|
9
|
+
wellnessUrl?: string;
|
|
10
|
+
skiRentalUrl?: string;
|
|
11
|
+
privateTransferUrl?: string;
|
|
12
|
+
shuttleUrl?: string;
|
|
13
|
+
excursionUrl?: string;
|
|
14
|
+
parkingUrl?: string;
|
|
15
|
+
textileUrl?: string;
|
|
16
|
+
daycareUrl?: string;
|
|
17
|
+
skiSchoolUrl?: string;
|
|
18
|
+
customOffers?: string;
|
|
19
|
+
cartExpanded?: boolean;
|
|
20
|
+
cartChanged?: (cart?: any, kind?: string, eventType?: string) => void;
|
|
21
|
+
show?: Show[];
|
|
22
|
+
};
|
|
23
|
+
type Presets = GlobalPresets & {};
|
|
24
|
+
type Props = {
|
|
25
|
+
options?: Options;
|
|
26
|
+
presets?: Presets;
|
|
27
|
+
children?: React.ReactNode;
|
|
28
|
+
};
|
|
29
|
+
declare const _default: React.MemoExoticComponent<typeof TunnelNew>;
|
|
30
|
+
export default _default;
|
|
31
|
+
declare function TunnelNew({ options, presets, children }: Props): React.ReactNode;
|
|
32
|
+
//# sourceMappingURL=tunnel-new.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tunnel-new.d.ts","sourceRoot":"","sources":["../../../../src/future/components/msem/tunnel-new.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE5D,KAAK,IAAI,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,CAAC;AAEvC,KAAK,OAAO,GAAG,aAAa,GAAG;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,WAAW,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACtE,IAAI,CAAC,EAAE,IAAI,EAAE,CAAC;CACf,CAAC;AAEF,KAAK,OAAO,GAAG,aAAa,GAAG,EAAE,CAAC;AAElC,KAAK,KAAK,GAAG;IACX,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B,CAAC;;AAEF,wBAAqC;AAErC,iBAAS,SAAS,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,KAAK,mBA6BvD"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as Utils from "./utils";
|
|
3
|
+
import * as Plausible from "../../../future/components/plausible";
|
|
4
|
+
export default React.memo(TunnelNew);
|
|
5
|
+
function TunnelNew({ options, presets, children }) {
|
|
6
|
+
React.useEffect(() => {
|
|
7
|
+
const categoryCode = window.sessionStorage.getItem("categoryCode") || undefined;
|
|
8
|
+
const handleCartChange = (cart, kind, eventType) => {
|
|
9
|
+
options?.cartChanged?.(cart, kind, eventType);
|
|
10
|
+
const event = new CustomEvent("msem-cart-changed", {
|
|
11
|
+
detail: { cart, kind, eventType },
|
|
12
|
+
});
|
|
13
|
+
window.dispatchEvent(event);
|
|
14
|
+
};
|
|
15
|
+
const patchedOptions = {
|
|
16
|
+
categoryCode,
|
|
17
|
+
...options,
|
|
18
|
+
cartChanged: handleCartChange,
|
|
19
|
+
analytics: (...args) => {
|
|
20
|
+
options?.analytics?.apply(null, args);
|
|
21
|
+
Plausible.callback.apply(null, args);
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
Utils.loadWidget("tunnelNew", patchedOptions, presets);
|
|
25
|
+
}, [options, presets]);
|
|
26
|
+
return children;
|
|
27
|
+
}
|
|
@@ -17,7 +17,7 @@ type Options = GlobalOptions & {
|
|
|
17
17
|
skiSchoolUrl?: string;
|
|
18
18
|
customOffers?: string;
|
|
19
19
|
cartExpanded?: boolean;
|
|
20
|
-
cartChanged?: (cart
|
|
20
|
+
cartChanged?: (cart?: any, kind?: string, eventType?: string) => void;
|
|
21
21
|
show?: Show[];
|
|
22
22
|
};
|
|
23
23
|
type Presets = GlobalPresets & {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tunnel.d.ts","sourceRoot":"","sources":["../../../../src/future/components/msem/tunnel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE5D,KAAK,IAAI,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,CAAC;AAEvC,KAAK,OAAO,GAAG,aAAa,GAAG;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,WAAW,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,KAAK,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"tunnel.d.ts","sourceRoot":"","sources":["../../../../src/future/components/msem/tunnel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE5D,KAAK,IAAI,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,CAAC;AAEvC,KAAK,OAAO,GAAG,aAAa,GAAG;IAC7B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,WAAW,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,KAAK,IAAI,CAAC;IACtE,IAAI,CAAC,EAAE,IAAI,EAAE,CAAC;CACf,CAAC;AAEF,KAAK,OAAO,GAAG,aAAa,GAAG,EAAE,CAAC;AAElC,KAAK,KAAK,GAAG;IACX,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;CAC5B,CAAC;;AAEF,wBAAkC;AAElC,iBAAS,MAAM,CAAC,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,KAAK,mBA6BpD"}
|
|
@@ -5,9 +5,17 @@ export default React.memo(Tunnel);
|
|
|
5
5
|
function Tunnel({ options, presets, children }) {
|
|
6
6
|
React.useEffect(() => {
|
|
7
7
|
const categoryCode = window.sessionStorage.getItem("categoryCode") || undefined;
|
|
8
|
+
const handleCartChange = (cart, kind, eventType) => {
|
|
9
|
+
options?.cartChanged?.(cart, kind, eventType);
|
|
10
|
+
const event = new CustomEvent("msem-cart-changed", {
|
|
11
|
+
detail: { cart, kind, eventType },
|
|
12
|
+
});
|
|
13
|
+
window.dispatchEvent(event);
|
|
14
|
+
};
|
|
8
15
|
const patchedOptions = {
|
|
9
16
|
categoryCode,
|
|
10
17
|
...options,
|
|
18
|
+
cartChanged: handleCartChange,
|
|
11
19
|
analytics: (...args) => {
|
|
12
20
|
options?.analytics?.apply(null, args);
|
|
13
21
|
Plausible.callback.apply(null, args);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/future/components/msem/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAG;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;IACd,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,UAAU,CAAC,EAAE,IAAI,CAAC;IAClB,WAAW,CAAC,EAAE,IAAI,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,CAAC,EAAE;QACL,IAAI,EAAE,MAAM,CAAC;QACb,EAAE,EAAE,MAAM,CAAC;KACZ,CAAC;IACF,OAAO,CAAC,EAAE;QACR,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAC3B,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;IACF,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC"}
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/future/components/msem/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,aAAa,GAAG;IAC1B,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC;IACd,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,SAAS,CAAC,EAAE,IAAI,CAAC;IACjB,UAAU,CAAC,EAAE,IAAI,CAAC;IAClB,WAAW,CAAC,EAAE,IAAI,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,CAAC,EAAE;QACL,IAAI,EAAE,MAAM,CAAC;QACb,EAAE,EAAE,MAAM,CAAC;KACZ,CAAC;IACF,OAAO,CAAC,EAAE;QACR,IAAI,EAAE,MAAM,CAAC;QACb,QAAQ,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAC3B,OAAO,EAAE,MAAM,CAAC;KACjB,CAAC;IACF,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;CACjB,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
type Widget = "tunnel" | "lodging" | "esf" | "skiRental" | "skiPass" | "liftJb" | "transfer" | "shuttle" | "excursion" | "otherProducts" | "genericLine" | "esfCustom" | "vakario" | "elloha" | "widgetPackage" | "customerAccount";
|
|
1
|
+
type Widget = "tunnel" | "tunnelNew" | "lodging" | "esf" | "skiRental" | "skiPass" | "liftJb" | "transfer" | "shuttle" | "excursion" | "otherProducts" | "genericLine" | "esfCustom" | "vakario" | "elloha" | "widgetPackage" | "customerAccount";
|
|
2
2
|
export declare function loadWidget(widget: Widget, options?: {}, presets?: {}): void;
|
|
3
3
|
export {};
|
|
4
4
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/future/components/msem/utils.ts"],"names":[],"mappings":"AAAA,KAAK,MAAM,GACP,QAAQ,GACR,SAAS,GACT,KAAK,GACL,WAAW,GACX,SAAS,GACT,QAAQ,GACR,UAAU,GACV,SAAS,GACT,WAAW,GACX,eAAe,GACf,aAAa,GACb,WAAW,GACX,SAAS,GACT,QAAQ,GACR,eAAe,GACf,iBAAiB,CAAC;AAEtB,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,KAAK,EAAE,OAAO,KAAK,QAgBpE"}
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/future/components/msem/utils.ts"],"names":[],"mappings":"AAAA,KAAK,MAAM,GACP,QAAQ,GACR,WAAW,GACX,SAAS,GACT,KAAK,GACL,WAAW,GACX,SAAS,GACT,QAAQ,GACR,UAAU,GACV,SAAS,GACT,WAAW,GACX,eAAe,GACf,aAAa,GACb,WAAW,GACX,SAAS,GACT,QAAQ,GACR,eAAe,GACf,iBAAiB,CAAC;AAEtB,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,KAAK,EAAE,OAAO,KAAK,QAgBpE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"widget-list-item.d.ts","sourceRoot":"","sources":["../../../../../src/future/components/msem-preset-editor/components/widget-list-item.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAS/B,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAGhD,KAAK,KAAK,GAAG;IACX,IAAI,EAAE,KAAK,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC;IACnC,YAAY,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,SAAS,CAAC,EAAE,KAAK,KAAK,IAAI,CAAC;IACvD,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,mBAAmB,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;CACpE,CAAC;AAYF,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,EACrC,IAAI,EACJ,MAAM,EACN,YAAY,EACZ,YAAY,EACZ,mBAAmB,GACpB,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"widget-list-item.d.ts","sourceRoot":"","sources":["../../../../../src/future/components/msem-preset-editor/components/widget-list-item.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAS/B,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAGhD,KAAK,KAAK,GAAG;IACX,IAAI,EAAE,KAAK,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC;IACnC,YAAY,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,SAAS,CAAC,EAAE,KAAK,KAAK,IAAI,CAAC;IACvD,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,mBAAmB,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;CACpE,CAAC;AAYF,MAAM,CAAC,OAAO,UAAU,cAAc,CAAC,EACrC,IAAI,EACJ,MAAM,EACN,YAAY,EACZ,YAAY,EACZ,mBAAmB,GACpB,EAAE,KAAK,2CAwKP"}
|
|
@@ -52,8 +52,7 @@ export default function WidgetListItem({ item, preset, updatePreset, removePrese
|
|
|
52
52
|
"otherProducts",
|
|
53
53
|
...ALLOW_PRESETS_ON_WIDGETS,
|
|
54
54
|
];
|
|
55
|
-
const
|
|
56
|
-
const allowAdvancedPresets = !isSkiRental && allowedWidgets.includes(sub.widget);
|
|
55
|
+
const allowAdvancedPresets = allowedWidgets.includes(sub.widget);
|
|
57
56
|
const showEditButton = isSelected && allowAdvancedPresets;
|
|
58
57
|
const showButtons = showEditButton || isSelected;
|
|
59
58
|
const classes = classNames(css.sub, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lodgings.d.ts","sourceRoot":"","sources":["../../../../../src/future/components/msem-preset-editor/editors/lodgings.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAS/B,KAAK,KAAK,GAAG;IACX,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;IACxB,IAAI,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC;IACnC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC;IACnC,SAAS,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC;IAC5E,mBAAmB,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;IACnE,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,KAAK,IAAI,CAAC;IACxD,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;
|
|
1
|
+
{"version":3,"file":"lodgings.d.ts","sourceRoot":"","sources":["../../../../../src/future/components/msem-preset-editor/editors/lodgings.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAS/B,KAAK,KAAK,GAAG;IACX,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;IACxB,IAAI,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC;IACnC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC;IACnC,SAAS,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC;IAC5E,mBAAmB,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;IACnE,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,KAAK,IAAI,CAAC;IACxD,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AA2EF,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,EAC/B,IAAI,EACJ,eAAe,EACf,MAAM,EACN,SAAS,EACT,mBAAmB,EACnB,UAAU,EACV,QAAQ,EACR,WAAW,GACZ,EAAE,KAAK,2CA+UP"}
|
|
@@ -13,46 +13,40 @@ const DEFAULT_DATA = {
|
|
|
13
13
|
lodging: "",
|
|
14
14
|
merchants: [],
|
|
15
15
|
options: [],
|
|
16
|
-
|
|
16
|
+
sectors: [],
|
|
17
17
|
nbRooms: [],
|
|
18
|
-
|
|
18
|
+
roomId: "",
|
|
19
19
|
type: "",
|
|
20
20
|
meubleType: [],
|
|
21
21
|
filter: "",
|
|
22
|
+
hide: [],
|
|
22
23
|
};
|
|
23
24
|
const MEUBLE_TYPES = [
|
|
25
|
+
{ label: "Appartement", value: "APT" },
|
|
26
|
+
{ label: "Appartement dans maison", value: "APT-IN-HOUSE" },
|
|
27
|
+
{ label: "Appartement dans un chalet", value: "APT-IN-CHALET" },
|
|
28
|
+
{ label: "Chalet", value: "CHALET" },
|
|
29
|
+
{ label: "Gîte rural", value: "GITE-RURAL" },
|
|
30
|
+
{ label: "Maison", value: "HOUSE" },
|
|
31
|
+
{ label: "Clévacances", value: "CLEVACANCES" },
|
|
32
|
+
{ label: "Gîte de France", value: "GITE-FRANCE" },
|
|
33
|
+
];
|
|
34
|
+
const HIDE_OPTIONS = [
|
|
35
|
+
{ label: "Filtres", value: "filters" },
|
|
36
|
+
{ label: "Liste des hébergements", value: "lodgingListOffers" },
|
|
37
|
+
{ label: "Carte des hébergements", value: "lodgingListMap" },
|
|
38
|
+
{ label: "Fiche hébergement - Photos", value: "lodgingCarousel" },
|
|
39
|
+
{ label: "Fiche hébergement - Description", value: "lodgingDescription" },
|
|
40
|
+
{ label: "Fiche hébergement - Carte", value: "lodgingMap" },
|
|
41
|
+
{ label: "Fiche hébergement - Offres", value: "lodgingOffers" },
|
|
42
|
+
{ label: "Fiche hébergement - Langues parlées", value: "lodgingLanguages" },
|
|
43
|
+
{ label: "Fiche hébergement - Équipements", value: "lodgingOptions" },
|
|
44
|
+
{ label: "Fiche hébergement - Capacité", value: "lodgingCapacity" },
|
|
24
45
|
{
|
|
25
|
-
label: "
|
|
26
|
-
value: "
|
|
27
|
-
},
|
|
28
|
-
{
|
|
29
|
-
label: "Appartement dans maison",
|
|
30
|
-
value: "APT-IN-HOUSE",
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
label: "Appartement dans un chalet",
|
|
34
|
-
value: "APT-IN-CHALET",
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
label: "Chalet",
|
|
38
|
-
value: "CHALET",
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
label: "Gîte rural",
|
|
42
|
-
value: "GITE-RURAL",
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
label: "Maison",
|
|
46
|
-
value: "HOUSE",
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
label: "Clévacances",
|
|
50
|
-
value: "CLEVACANCES",
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
label: "Gîte de France",
|
|
54
|
-
value: "GITE-FRANCE",
|
|
46
|
+
label: "Fiche hébergement - Informations additionnelles",
|
|
47
|
+
value: "lodgingInfos",
|
|
55
48
|
},
|
|
49
|
+
{ label: "Fiche hébergement - Suggestions similaires", value: "upsales" },
|
|
56
50
|
];
|
|
57
51
|
export default function Lodgings({ lang, msemServicesUrl, preset, setPreset, setShowPresetDialog, testPreset, onChange, urlOverride, }) {
|
|
58
52
|
const savedPreset = React.useRef(preset);
|
|
@@ -60,7 +54,7 @@ export default function Lodgings({ lang, msemServicesUrl, preset, setPreset, set
|
|
|
60
54
|
const [lodgings, setLodgings] = React.useState([]);
|
|
61
55
|
const [filters, setFilters] = React.useState({
|
|
62
56
|
options: [],
|
|
63
|
-
|
|
57
|
+
sectors: [],
|
|
64
58
|
});
|
|
65
59
|
const [rooms, setRooms] = React.useState([]);
|
|
66
60
|
const [loading, setLoading] = React.useState(true);
|
|
@@ -90,9 +84,12 @@ export default function Lodgings({ lang, msemServicesUrl, preset, setPreset, set
|
|
|
90
84
|
label: room.title,
|
|
91
85
|
value: room.type,
|
|
92
86
|
}));
|
|
87
|
+
const selectedHideOptions = data.hide.map((hide) => {
|
|
88
|
+
return HIDE_OPTIONS.find((option) => option.value === hide);
|
|
89
|
+
});
|
|
93
90
|
const selectedMerchants = data.merchants?.map((merchant) => formattedMerchants.find((d) => d.value === merchant));
|
|
94
91
|
const selectedOptions = data.options?.map((option) => filters?.options?.find((d) => d.value === option));
|
|
95
|
-
const
|
|
92
|
+
const selectedSectors = data.sectors?.map((sector) => filters?.sectors?.find((d) => d.value === sector));
|
|
96
93
|
const selectedMeubleTypes = data.meubleType?.map((meubleType) => MEUBLE_TYPES.find((d) => d.value === meubleType));
|
|
97
94
|
const cancelPreset = () => {
|
|
98
95
|
setPreset(savedPreset.current);
|
|
@@ -111,7 +108,7 @@ export default function Lodgings({ lang, msemServicesUrl, preset, setPreset, set
|
|
|
111
108
|
if (key === "accomodations")
|
|
112
109
|
return acc;
|
|
113
110
|
const filter = filters[key];
|
|
114
|
-
if (key === "
|
|
111
|
+
if (key === "sectors") {
|
|
115
112
|
const entries = filter.map((entry) => ({
|
|
116
113
|
value: entry.id,
|
|
117
114
|
label: entry.name,
|
|
@@ -142,7 +139,7 @@ export default function Lodgings({ lang, msemServicesUrl, preset, setPreset, set
|
|
|
142
139
|
}, [channel, facet, lang, msemServicesUrl, ready, resort]);
|
|
143
140
|
React.useEffect(() => {
|
|
144
141
|
if (ready && data.lodging) {
|
|
145
|
-
const
|
|
142
|
+
const getRoomIds = async () => {
|
|
146
143
|
try {
|
|
147
144
|
setLoading(true);
|
|
148
145
|
const id = lodgings.find((lodging) => lodging.slug === data.lodging)?.id;
|
|
@@ -155,7 +152,7 @@ export default function Lodgings({ lang, msemServicesUrl, preset, setPreset, set
|
|
|
155
152
|
setData((data) => ({
|
|
156
153
|
...data,
|
|
157
154
|
options: DEFAULT_DATA.options,
|
|
158
|
-
|
|
155
|
+
sectors: DEFAULT_DATA.sectors,
|
|
159
156
|
type: DEFAULT_DATA.type,
|
|
160
157
|
meubleType: DEFAULT_DATA.meubleType,
|
|
161
158
|
}));
|
|
@@ -167,7 +164,7 @@ export default function Lodgings({ lang, msemServicesUrl, preset, setPreset, set
|
|
|
167
164
|
setLoading(false);
|
|
168
165
|
}
|
|
169
166
|
};
|
|
170
|
-
|
|
167
|
+
getRoomIds();
|
|
171
168
|
}
|
|
172
169
|
}, [data.lodging, facet, lang, lodgings, msemServicesUrl, ready, resort]);
|
|
173
170
|
React.useEffect(() => {
|
|
@@ -178,21 +175,22 @@ export default function Lodgings({ lang, msemServicesUrl, preset, setPreset, set
|
|
|
178
175
|
const agesChildren = [...new Array(children)].map(() => 12);
|
|
179
176
|
const paxPlan = adults ? { adults, children, agesChildren } : undefined;
|
|
180
177
|
const merchants = data.merchants?.length ? data.merchants : undefined;
|
|
178
|
+
const hide = data.hide?.length ? data.hide : undefined;
|
|
181
179
|
const options = data.options?.length ? data.options : undefined;
|
|
182
|
-
const
|
|
180
|
+
const sectors = data.sectors?.length ? data.sectors : undefined;
|
|
183
181
|
const type = data.type || undefined;
|
|
184
182
|
const meubleType = data.meubleType?.length
|
|
185
183
|
? data.meubleType.join(",")
|
|
186
184
|
: undefined;
|
|
187
|
-
const
|
|
185
|
+
const roomId = data.roomId || undefined;
|
|
188
186
|
const nbRooms = data.nbRooms[0] > 0 ? data.nbRooms : undefined;
|
|
189
187
|
const filter = data.filter || undefined;
|
|
190
|
-
const previewDetails = { paxPlan,
|
|
188
|
+
const previewDetails = { paxPlan, roomId };
|
|
191
189
|
const presets = {
|
|
192
190
|
merchants,
|
|
193
191
|
accomodation,
|
|
194
192
|
options,
|
|
195
|
-
|
|
193
|
+
sectors,
|
|
196
194
|
nbRooms,
|
|
197
195
|
type,
|
|
198
196
|
meubleType,
|
|
@@ -200,7 +198,7 @@ export default function Lodgings({ lang, msemServicesUrl, preset, setPreset, set
|
|
|
200
198
|
};
|
|
201
199
|
const newPreset = {
|
|
202
200
|
...current,
|
|
203
|
-
options: { ...(current?.options || {}), previewDetails },
|
|
201
|
+
options: { ...(current?.options || {}), previewDetails, hide },
|
|
204
202
|
presets: { ...(current?.presets || {}), ...presets },
|
|
205
203
|
url: urlOverride || undefined,
|
|
206
204
|
};
|
|
@@ -208,24 +206,26 @@ export default function Lodgings({ lang, msemServicesUrl, preset, setPreset, set
|
|
|
208
206
|
return newPreset;
|
|
209
207
|
});
|
|
210
208
|
}, [data, onChange, urlOverride, setPreset]);
|
|
211
|
-
return (_jsxs(Form, { title: "Presets h\u00E9bergements", width: 580, preset: preset, buttonsActions: { testPreset, cancelPreset, confirmPreset }, children: [_jsx("div", { className: css.label, children: "Nombre de personnes" }), _jsxs("div", { className: css.row, children: [_jsx(NumberPicker, { className: css.peopleInput, label: "Adultes", min: 0, max: 20, value: data.adults, onChange: updateField("adults"), withInput: true }), _jsx(NumberPicker, { className: css.peopleInput, label: "Enfants", min: 0, max: 9, value: data.children, onChange: updateField("children"), withInput: true })] }), _jsx("div", { className: css.label, children: "H\u00E9bergement" }), _jsx(Select, { placeholder: "S\u00E9lectionnez un h\u00E9bergement", options: formattedLodgings, value: data.lodging, onValueChange: updateField("lodging"), loading: loading }), !showFilters && (_jsxs(_Fragment, { children: [_jsx("div", { className: css.label, children: "Chambres" }), (formattedRooms?.length > 0 || loading) && (_jsx(Select, { label: "Type de bien", placeholder: "S\u00E9lectionnez un type de bien", value: data.
|
|
209
|
+
return (_jsxs(Form, { title: "Presets h\u00E9bergements", width: 580, preset: preset, buttonsActions: { testPreset, cancelPreset, confirmPreset }, children: [_jsx("div", { className: css.title, children: "Options d'affichage" }), _jsx(MultipleSelect, { label: "Cacher", placeholder: "Selectionnez une ou plusieurs options", options: HIDE_OPTIONS, values: selectedHideOptions, onChange: updateFilter("hide") }), _jsx("div", { className: css.title2, children: "Preset" }), _jsx("div", { className: css.label, children: "Nombre de personnes" }), _jsxs("div", { className: css.row, children: [_jsx(NumberPicker, { className: css.peopleInput, label: "Adultes", min: 0, max: 20, value: data.adults, onChange: updateField("adults"), withInput: true }), _jsx(NumberPicker, { className: css.peopleInput, label: "Enfants", min: 0, max: 9, value: data.children, onChange: updateField("children"), withInput: true })] }), _jsx("div", { className: css.label, children: "H\u00E9bergement" }), _jsx(Select, { placeholder: "S\u00E9lectionnez un h\u00E9bergement", options: formattedLodgings, value: data.lodging, onValueChange: updateField("lodging"), loading: loading }), !showFilters && (_jsxs(_Fragment, { children: [_jsx("div", { className: css.label, children: "Chambres" }), (formattedRooms?.length > 0 || loading) && (_jsx(Select, { label: "Type de bien", placeholder: "S\u00E9lectionnez un type de bien", value: data.roomId, options: formattedRooms, onValueChange: updateField("roomId"), loading: loading })), _jsx(NumberPicker, { label: "Nombre de chambres", min: 0, max: 20, value: data.nbRooms?.[0] || 0, onChange: updateRoomNb, withInput: true })] })), showFilters && (_jsxs(_Fragment, { children: [_jsx("div", { className: css.label, children: "Filtres" }), lodgings?.length > 0 && (_jsx(MultipleSelect, { label: "Liste de marchands", options: formattedMerchants, values: selectedMerchants, onChange: updateFilter("merchants"), loading: loading, withSearch: true })), (loading || kinds.length > 1) && (_jsx(Select, { label: "Type", placeholder: "S\u00E9lectionnez un type", options: kinds, value: data.type, onValueChange: updateField("type"), loading: loading })), showMeubleType && (_jsx(MultipleSelect, { placeholder: "Selectionnez une ou plusieurs options", label: "Type de meubl\u00E9", options: MEUBLE_TYPES, values: selectedMeubleTypes, onChange: updateFilter("meubleType"), loading: loading })), (loading || filters.options.length >= 1) && (_jsx(MultipleSelect, { placeholder: "Selectionnez une ou plusieurs options", label: "Options", options: filters.options, values: selectedOptions, onChange: updateFilter("options"), loading: loading, withSearch: true })), (loading || filters.sectors.length >= 1) && (_jsx(MultipleSelect, { placeholder: "Selectionnez une ou plusieurs options", label: "Quartiers", options: filters.sectors, values: selectedSectors, onChange: updateFilter("sectors"), loading: loading, withSearch: true })), _jsx("div", { className: css.label, children: "Avanc\u00E9" }), _jsx(Input, { className: css.input, label: "Filtre", value: data.filter, placeholder: "('10', '22') in options", onValueChange: updateField("filter") })] }))] }));
|
|
212
210
|
}
|
|
213
211
|
function getDefaultData(preset) {
|
|
214
212
|
if (!preset?.presets && !preset?.options)
|
|
215
213
|
return DEFAULT_DATA;
|
|
216
|
-
const { merchants, accomodation, nbRooms, options,
|
|
217
|
-
const {
|
|
214
|
+
const { merchants, accomodation, nbRooms, options, sectors, type, meubleType, filter, } = preset?.presets || {};
|
|
215
|
+
const { hide, previewDetails } = preset.options || {};
|
|
216
|
+
const { paxPlan, roomId } = previewDetails || {};
|
|
218
217
|
return {
|
|
219
218
|
adults: paxPlan?.adults || DEFAULT_DATA.adults,
|
|
220
219
|
children: paxPlan?.children || DEFAULT_DATA.children,
|
|
221
220
|
lodging: accomodation || DEFAULT_DATA.lodging,
|
|
222
221
|
merchants: merchants || DEFAULT_DATA.merchants,
|
|
223
222
|
nbRooms: nbRooms || DEFAULT_DATA.nbRooms,
|
|
224
|
-
|
|
223
|
+
roomId: roomId || DEFAULT_DATA.roomId,
|
|
225
224
|
options: options || DEFAULT_DATA.options,
|
|
226
|
-
|
|
225
|
+
sectors: sectors || DEFAULT_DATA.sectors,
|
|
227
226
|
type: type || DEFAULT_DATA.type,
|
|
228
227
|
meubleType: meubleType?.split(",") || DEFAULT_DATA.meubleType,
|
|
229
228
|
filter: filter || DEFAULT_DATA.filter,
|
|
229
|
+
hide: hide || DEFAULT_DATA.hide,
|
|
230
230
|
};
|
|
231
231
|
}
|
|
@@ -14,6 +14,30 @@
|
|
|
14
14
|
flex: 0 0 auto;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
+
.title,
|
|
18
|
+
.title2 {
|
|
19
|
+
margin-bottom: 4px;
|
|
20
|
+
font-weight: 700;
|
|
21
|
+
display: flex;
|
|
22
|
+
align-items: center;
|
|
23
|
+
gap: 8px;
|
|
24
|
+
font-size: 14px;
|
|
25
|
+
white-space: nowrap;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.title::after,
|
|
29
|
+
.title2::after {
|
|
30
|
+
content: "";
|
|
31
|
+
flex: 1 1 100%;
|
|
32
|
+
height: 1px;
|
|
33
|
+
margin-top: 2px;
|
|
34
|
+
background-color: var(--ds-grey-200, #ededed);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.title2 {
|
|
38
|
+
margin-top: 12px;
|
|
39
|
+
}
|
|
40
|
+
|
|
17
41
|
.label {
|
|
18
42
|
font-size: 12px;
|
|
19
43
|
user-select: none;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ski-passes.d.ts","sourceRoot":"","sources":["../../../../../src/future/components/msem-preset-editor/editors/ski-passes.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAW/B,KAAK,KAAK,GAAG;IACX,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;IACxB,IAAI,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC;IACnC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC;IACnC,SAAS,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC;IAC5E,mBAAmB,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;IACnE,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,KAAK,IAAI,CAAC;IACxD,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;
|
|
1
|
+
{"version":3,"file":"ski-passes.d.ts","sourceRoot":"","sources":["../../../../../src/future/components/msem-preset-editor/editors/ski-passes.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAW/B,KAAK,KAAK,GAAG;IACX,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;IACxB,IAAI,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC;IACnC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC;IACnC,SAAS,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC;IAC5E,mBAAmB,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;IACnE,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,KAAK,IAAI,CAAC;IACxD,UAAU,EAAE,MAAM,IAAI,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAsEF,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,EAChC,eAAe,EACf,MAAM,EACN,SAAS,EACT,IAAI,EACJ,mBAAmB,EACnB,QAAQ,EACR,UAAU,EACV,WAAW,GACZ,EAAE,KAAK,2CAkXP"}
|
|
@@ -32,22 +32,9 @@ const ACTIVITIES_LABELS = {
|
|
|
32
32
|
luge: "Luge sur rails",
|
|
33
33
|
};
|
|
34
34
|
const HIDE_OPTIONS = [
|
|
35
|
-
{
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
label: "Sélecteur d'hébergement",
|
|
41
|
-
value: "lodging",
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
label: "Filtres",
|
|
45
|
-
value: "filters",
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
label: "Catalogue",
|
|
49
|
-
value: "catalog",
|
|
50
|
-
},
|
|
35
|
+
{ label: "Sélecteur d'hébergement", value: "lodging" },
|
|
36
|
+
{ label: "Filtres", value: "filters" },
|
|
37
|
+
{ label: "Catalogue", value: "catalog" },
|
|
51
38
|
];
|
|
52
39
|
export default function SkiPasses({ msemServicesUrl, preset, setPreset, stay, setShowPresetDialog, onChange, testPreset, urlOverride, }) {
|
|
53
40
|
const savedPreset = React.useRef(preset);
|
|
@@ -80,12 +67,14 @@ export default function SkiPasses({ msemServicesUrl, preset, setPreset, stay, se
|
|
|
80
67
|
}, [])),
|
|
81
68
|
]
|
|
82
69
|
: []);
|
|
83
|
-
const selectedHideOptions = data.hide.
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
70
|
+
const selectedHideOptions = data.hide.reduce((acc, hide) => {
|
|
71
|
+
const foundOption = HIDE_OPTIONS.find((option) => option.value === hide);
|
|
72
|
+
return foundOption ? [...acc, foundOption] : acc;
|
|
73
|
+
}, []);
|
|
74
|
+
const selectedActivities = data.activities.reduce((acc, activity) => {
|
|
75
|
+
const foundActivity = activities.find((a) => a.value === activity);
|
|
76
|
+
return foundActivity ? [...acc, foundActivity] : acc;
|
|
77
|
+
}, []);
|
|
89
78
|
const selectedActivitiesCodes = activities.reduce((acc, activity) => {
|
|
90
79
|
const { value } = activity;
|
|
91
80
|
return data.activities?.includes(value)
|
|
@@ -176,7 +165,6 @@ export default function SkiPasses({ msemServicesUrl, preset, setPreset, stay, se
|
|
|
176
165
|
const initFilters = async () => {
|
|
177
166
|
setLoading(true);
|
|
178
167
|
const filters = await API.getSkiPassesFilters(msemServicesUrl, merchant, catalog);
|
|
179
|
-
4;
|
|
180
168
|
const filteredFilters = Object.keys(filters).reduce((acc, key) => {
|
|
181
169
|
const filter = filters[key];
|
|
182
170
|
return ALLOWED_FILTERS.includes(key)
|
|
@@ -235,7 +223,18 @@ export default function SkiPasses({ msemServicesUrl, preset, setPreset, stay, se
|
|
|
235
223
|
testPreset,
|
|
236
224
|
cancelPreset,
|
|
237
225
|
confirmPreset: hasCatalog ? confirmPreset : undefined,
|
|
238
|
-
}, children: [_jsx("div", { className: css.title, children: "Options d'affichage" }), _jsx(MultipleSelect, { label: "Cacher", placeholder: "Selectionnez une ou plusieurs options", options: HIDE_OPTIONS, values: selectedHideOptions, onChange: updateField("hide") }), _jsx(Checkbox, { label: "Ecran de forfaits minimaliste", checked: data.minimalistLiftScreen, onCheckedChange: updateMinimalistLiftScreen }), _jsx(Checkbox, { label: "Cacher le code promotionnel", checked: data.couponDisabled, onCheckedChange: updateCouponDisabled }), _jsx("div", { className: css.title, children: "Preset" }), _jsx(Select, { label: "Catalogue", value: catalog, options: catalogs ? ["", ...catalogs] : [], onValueChange:
|
|
226
|
+
}, children: [_jsx("div", { className: css.title, children: "Options d'affichage" }), _jsx(MultipleSelect, { label: "Cacher", placeholder: "Selectionnez une ou plusieurs options", options: HIDE_OPTIONS, values: selectedHideOptions, onChange: updateField("hide") }), _jsx(Checkbox, { label: "Ecran de forfaits minimaliste", checked: data.minimalistLiftScreen, onCheckedChange: updateMinimalistLiftScreen }), _jsx(Checkbox, { label: "Cacher le code promotionnel", checked: data.couponDisabled, onCheckedChange: updateCouponDisabled }), _jsx("div", { className: css.title, children: "Preset" }), _jsx(Select, { label: "Catalogue", value: catalog, options: catalogs ? ["", ...catalogs] : [], onValueChange: (value) => {
|
|
227
|
+
setCatalog(value);
|
|
228
|
+
setData({
|
|
229
|
+
...data,
|
|
230
|
+
firstSkiDate: DEFAULT_DATA.firstSkiDate,
|
|
231
|
+
skiers: DEFAULT_DATA.skiers,
|
|
232
|
+
paxLocked: DEFAULT_DATA.paxLocked,
|
|
233
|
+
activities: DEFAULT_DATA.activities,
|
|
234
|
+
domains: DEFAULT_DATA.domains,
|
|
235
|
+
durations: DEFAULT_DATA.durations,
|
|
236
|
+
});
|
|
237
|
+
}, loading: !isReady }), loading && _jsx(Loader, { className: css.loader }), hasCatalog && (_jsxs(_Fragment, { children: [_jsx(Input, { type: "date", label: "1er jour", value: data.firstSkiDate, onValueChange: updateFirstSkiDate, defaultMonth: firstSkiDateDefaultMonth, min: stay?.from || undefined, max: stay?.to || undefined }), filters?.pax && filters?.pax?.length > 1 && (_jsxs(_Fragment, { children: [_jsxs("div", { className: css.skiers, children: [_jsx("div", { className: css.label, children: "Skieurs" }), filters.pax.map((skier) => {
|
|
239
238
|
const { code, label, ageMin, ageMax } = skier;
|
|
240
239
|
const title = `${label} (de ${ageMin} à ${ageMax} ans)`;
|
|
241
240
|
const value = data.skiers?.filter((skier) => skier === code)
|
|
@@ -13,6 +13,6 @@ type Props = {
|
|
|
13
13
|
onChange?: (preset: Record<string, any> | null) => void;
|
|
14
14
|
testPreset: () => void;
|
|
15
15
|
};
|
|
16
|
-
export default function SkiRental({ msemServicesUrl, preset, setPreset, setShowPresetDialog, onChange, testPreset, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export default function SkiRental({ msemServicesUrl, preset, setPreset, facet, setShowPresetDialog, onChange, testPreset, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
17
17
|
export {};
|
|
18
18
|
//# sourceMappingURL=ski-rental.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ski-rental.d.ts","sourceRoot":"","sources":["../../../../../src/future/components/msem-preset-editor/editors/ski-rental.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ski-rental.d.ts","sourceRoot":"","sources":["../../../../../src/future/components/msem-preset-editor/editors/ski-rental.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAQ/B,KAAK,KAAK,GAAG;IACX,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC;IAClB,eAAe,EAAE,MAAM,CAAC;IACxB,IAAI,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,EAAE,EAAE,MAAM,CAAA;KAAE,CAAC;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC;IACnC,SAAS,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC;IAC5E,mBAAmB,EAAE,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC,CAAC;IACnE,QAAQ,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,GAAG,IAAI,KAAK,IAAI,CAAC;IACxD,UAAU,EAAE,MAAM,IAAI,CAAC;CACxB,CAAC;AA2BF,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,EAChC,eAAe,EACf,MAAM,EACN,SAAS,EACT,KAAK,EACL,mBAAmB,EACnB,QAAQ,EACR,UAAU,GACX,EAAE,KAAK,2CAgUP"}
|