ublo-lib 1.47.8 → 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/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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tunnel.d.ts","sourceRoot":"","sources":["../../../../src/esf/components/espace-prive/tunnel.js"],"names":[],"mappings":"AAUA
|
|
1
|
+
{"version":3,"file":"tunnel.d.ts","sourceRoot":"","sources":["../../../../src/esf/components/espace-prive/tunnel.js"],"names":[],"mappings":"AAUA;;4CAmCC"}
|
|
@@ -7,7 +7,7 @@ import Loader from "dt-design-system/es/loader";
|
|
|
7
7
|
import Message from "./message";
|
|
8
8
|
import ClientLinks from "./admin/client-links";
|
|
9
9
|
import { useContext } from "./context";
|
|
10
|
-
export default function Tunnel() {
|
|
10
|
+
export default function Tunnel({ presets }) {
|
|
11
11
|
const { lang, config, cmsMode } = useUbloContext();
|
|
12
12
|
const { resort } = config;
|
|
13
13
|
const { intermediary, error, partnerID } = useContext();
|
|
@@ -22,5 +22,5 @@ export default function Tunnel() {
|
|
|
22
22
|
groundedTo: "#msem-esf",
|
|
23
23
|
intermediary,
|
|
24
24
|
facet: 0,
|
|
25
|
-
}, children: _jsx("div", { id: "msem-esf" }) })), cmsMode && _jsx(ClientLinks, {})] }));
|
|
25
|
+
}, presets: presets, children: _jsx("div", { id: "msem-esf" }) })), cmsMode && _jsx(ClientLinks, {})] }));
|
|
26
26
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-search.d.ts","sourceRoot":"","sources":["../../../../../src/esf/components/instant-search/hooks/use-search.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"use-search.d.ts","sourceRoot":"","sources":["../../../../../src/esf/components/instant-search/hooks/use-search.ts"],"names":[],"mappings":"AAQA,MAAM,MAAM,aAAa,GAAG;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,aAAkB;;;;EAgB1E"}
|
|
@@ -1,10 +1,17 @@
|
|
|
1
1
|
import getConfig from "next/config";
|
|
2
2
|
import useDebouncedSearch from "./use-debounced-search";
|
|
3
3
|
import * as API from "../services/api";
|
|
4
|
+
import { sendEvent } from "../../../../future/components/event-analytics/instant-search";
|
|
4
5
|
const { publicRuntimeConfig } = getConfig();
|
|
5
6
|
const { site } = publicRuntimeConfig;
|
|
6
7
|
export default function useSearch(lang, options = {}) {
|
|
7
8
|
return useDebouncedSearch(async (query) => {
|
|
8
|
-
return API.fetchResults(site, lang, query, options.queryBy, options.queryByWeights)
|
|
9
|
+
return API.fetchResults(site, lang, query, options.queryBy, options.queryByWeights).then((res) => {
|
|
10
|
+
sendEvent("esf", "search", {
|
|
11
|
+
query: query,
|
|
12
|
+
match_count: res?.result?.hits?.length,
|
|
13
|
+
});
|
|
14
|
+
return res;
|
|
15
|
+
});
|
|
9
16
|
});
|
|
10
17
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instant-search.d.ts","sourceRoot":"","sources":["../../../../src/esf/components/instant-search/instant-search.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAS/B,OAAgB,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AACpD,OAAkB,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"instant-search.d.ts","sourceRoot":"","sources":["../../../../src/esf/components/instant-search/instant-search.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAS/B,OAAgB,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AACpD,OAAkB,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAM9D,KAAK,KAAK,GAAG;IACX,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE;QACX,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,WAAW,GAAG,SAAS,GAAG,MAAM,CAAC;QAC1C,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACjC,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;IACF,WAAW,CAAC,EAAE;QACZ,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC;QACd,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC;KACf,CAAC;IACF,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,YAAY,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACtD,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,EACpC,IAAI,EACJ,WAAW,EACX,SAAS,EACT,WAAW,EACX,OAAY,EACZ,cAAc,EACd,YAAY,GACb,EAAE,KAAK,2CA8IP"}
|
|
@@ -11,6 +11,7 @@ import Results from "./results";
|
|
|
11
11
|
import useSearch from "./hooks/use-search";
|
|
12
12
|
import * as Plausible from "../../../future/components/plausible";
|
|
13
13
|
import css from "./instant-search.module.css";
|
|
14
|
+
import { sendEvent } from "../../../future/components/event-analytics/instant-search";
|
|
14
15
|
export default function InstantSearch({ lang, suggestions, className, ubloContext, options = {}, resultsOptions, productImage, }) {
|
|
15
16
|
const [opened, setOpened] = React.useState(false);
|
|
16
17
|
const [periodPickerOpened, setPeriodPickerOpened] = React.useState(false);
|
|
@@ -19,6 +20,7 @@ export default function InstantSearch({ lang, suggestions, className, ubloContex
|
|
|
19
20
|
const classes = classNames(css.search, className);
|
|
20
21
|
const openSearch = () => {
|
|
21
22
|
setOpened(true);
|
|
23
|
+
sendEvent("esf", "load");
|
|
22
24
|
};
|
|
23
25
|
const closeSearch = (skipEvent) => {
|
|
24
26
|
setOpened(false);
|
|
@@ -32,10 +34,23 @@ export default function InstantSearch({ lang, suggestions, className, ubloContex
|
|
|
32
34
|
Plausible.sendGoal(event, {
|
|
33
35
|
Terms: text,
|
|
34
36
|
});
|
|
37
|
+
sendEvent("esf", event === "Search failed" ? "fail" : "cancel", {
|
|
38
|
+
query: text,
|
|
39
|
+
match_count: search?.result?.hits?.length,
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
sendEvent("esf", "cancel");
|
|
35
44
|
}
|
|
36
45
|
}
|
|
37
46
|
};
|
|
38
|
-
const sendPlausibleGoal = (path) => () => {
|
|
47
|
+
const sendPlausibleGoal = (type) => (path) => () => {
|
|
48
|
+
sendEvent("esf", "success", {
|
|
49
|
+
query: text,
|
|
50
|
+
match_count: search?.result?.hits?.length,
|
|
51
|
+
path,
|
|
52
|
+
kind: type,
|
|
53
|
+
});
|
|
39
54
|
Plausible.sendGoal("Search", {
|
|
40
55
|
"Terms - Destination": `${text} - ${path}`,
|
|
41
56
|
});
|
|
@@ -9,7 +9,7 @@ type Props = {
|
|
|
9
9
|
icon: "FileText" | "Info" | "Question" | "User";
|
|
10
10
|
links: Hit[];
|
|
11
11
|
loading: boolean;
|
|
12
|
-
sendPlausibleGoal: (path: string) => void;
|
|
12
|
+
sendPlausibleGoal: (path: string) => () => void;
|
|
13
13
|
linkOptions?: LinkOptions;
|
|
14
14
|
};
|
|
15
15
|
export default function Links({ icon, linksTitle, links, loading, sendPlausibleGoal, linkOptions, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"links.d.ts","sourceRoot":"","sources":["../../../../src/esf/components/instant-search/links.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAGrC,MAAM,MAAM,WAAW,GAAG;IACxB,gBAAgB,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;IAClC,UAAU,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;CAC5B,CAAC;AAEF,KAAK,KAAK,GAAG;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,UAAU,GAAG,MAAM,GAAG,UAAU,GAAG,MAAM,CAAC;IAChD,KAAK,EAAE,GAAG,EAAE,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;IACjB,iBAAiB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"links.d.ts","sourceRoot":"","sources":["../../../../src/esf/components/instant-search/links.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAGrC,MAAM,MAAM,WAAW,GAAG;IACxB,gBAAgB,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;IAClC,UAAU,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;IAC5B,SAAS,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;CAC5B,CAAC;AAEF,KAAK,KAAK,GAAG;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,UAAU,GAAG,MAAM,GAAG,UAAU,GAAG,MAAM,CAAC;IAChD,KAAK,EAAE,GAAG,EAAE,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;IACjB,iBAAiB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,IAAI,CAAC;IAChD,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B,CAAC;AAMF,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,EAC5B,IAAI,EACJ,UAAU,EACV,KAAK,EACL,OAAO,EACP,iBAAiB,EACjB,WAAgB,GACjB,EAAE,KAAK,2CAuEP"}
|
|
@@ -29,6 +29,6 @@ export default function Links({ icon, linksTitle, links, loading, sendPlausibleG
|
|
|
29
29
|
const linkCategory = Utils.getValueFromHit(link, parentTitleField);
|
|
30
30
|
const linkTitle = Utils.getValueFromHit(link, titleField);
|
|
31
31
|
const linkText = Utils.getValueFromHit(link, textField);
|
|
32
|
-
return (_jsxs(Link, { href: decodedPath, className: css.link, onClick:
|
|
32
|
+
return (_jsxs(Link, { href: decodedPath, className: css.link, onClick: sendPlausibleGoal(decodedPath), onMouseDown: createRipple, children: [_jsx(Icon, { className: css.linkIcon }), _jsxs("div", { className: css.linkContent, children: [linkCategory && (_jsx("div", { className: css.linkParent, dangerouslySetInnerHTML: { __html: linkCategory } })), linkTitle && (_jsx("div", { className: css.linkTitle, dangerouslySetInnerHTML: { __html: linkTitle } })), linkText && (_jsx("div", { className: css.linkText, dangerouslySetInnerHTML: { __html: linkText } }))] })] }, id));
|
|
33
33
|
})] })] }));
|
|
34
34
|
}
|
|
@@ -12,7 +12,7 @@ type Props = {
|
|
|
12
12
|
products: Hit[];
|
|
13
13
|
weekNumber: number | null;
|
|
14
14
|
loading: boolean;
|
|
15
|
-
sendPlausibleGoal: (path: string) => void;
|
|
15
|
+
sendPlausibleGoal: (path: string) => () => void;
|
|
16
16
|
otherResultsRef: React.RefObject<HTMLDivElement>;
|
|
17
17
|
isOtherResultsEmpty: boolean;
|
|
18
18
|
productOptions?: ProductOptions;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"products.d.ts","sourceRoot":"","sources":["../../../../src/esf/components/instant-search/products.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAU/B,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAarC,MAAM,MAAM,cAAc,GAAG;IAC3B,aAAa,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;IAC/B,UAAU,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;IAC5B,aAAa,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;IAC/B,SAAS,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB,CAAC;AAEF,KAAK,KAAK,GAAG;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,GAAG,EAAE,CAAC;IAChB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,OAAO,EAAE,OAAO,CAAC;IACjB,iBAAiB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"products.d.ts","sourceRoot":"","sources":["../../../../src/esf/components/instant-search/products.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAU/B,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAarC,MAAM,MAAM,cAAc,GAAG;IAC3B,aAAa,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;IAC/B,UAAU,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;IAC5B,aAAa,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;IAC/B,SAAS,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB,CAAC;AAEF,KAAK,KAAK,GAAG;IACX,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,GAAG,EAAE,CAAC;IAChB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,OAAO,EAAE,OAAO,CAAC;IACjB,iBAAiB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,IAAI,CAAC;IAChD,eAAe,EAAE,KAAK,CAAC,SAAS,CAAC,cAAc,CAAC,CAAC;IACjD,mBAAmB,EAAE,OAAO,CAAC;IAC7B,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,YAAY,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACtD,CAAC;AAIF,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,EAC/B,IAAI,EACJ,QAAQ,EACR,UAAU,EACV,OAAO,EACP,iBAAiB,EACjB,eAAe,EACf,mBAAmB,EACnB,cAAmB,EACnB,YAAY,EAAE,YAAY,GAC3B,EAAE,KAAK,2CA6JP"}
|
|
@@ -41,7 +41,7 @@ export default function Products({ lang, products, weekNumber, loading, sendPlau
|
|
|
41
41
|
const textImage = product.document["imageAlt"];
|
|
42
42
|
const showPrice = price !== undefined && weekNumber !== null;
|
|
43
43
|
const imagePlaceholderStategy = imagePlaceholder ? "blur" : "empty";
|
|
44
|
-
return (_jsxs(Link, { className: css.product, href: decodedPath, onClick:
|
|
44
|
+
return (_jsxs(Link, { className: css.product, href: decodedPath, onClick: sendPlausibleGoal(decodedPath), onMouseDown: createRipple, children: [_jsx(RenderedImage, { textImage: textImage, ProductImage: ProductImage, image: image, title: title, imagePlaceholder: imagePlaceholder, imagePlaceholderStategy: imagePlaceholderStategy, product: product }), _jsxs("div", { className: css.productContent, children: [productCategory && (_jsx("div", { className: css.productParent, dangerouslySetInnerHTML: { __html: productCategory } })), productPageTitle && (_jsx("div", { className: css.productPageTitle, dangerouslySetInnerHTML: { __html: productPageTitle } })), productTitle && (_jsx("div", { className: css.productTitle, dangerouslySetInnerHTML: { __html: productTitle } })), _jsx("div", { className: css.productTags, children: tagFields.map((tagField) => {
|
|
45
45
|
const tagHtml = Utils.getValueFromHit(product, tagField);
|
|
46
46
|
const Icon = () => {
|
|
47
47
|
if (tagField === "time" ||
|
|
@@ -72,7 +72,7 @@ type Props = {
|
|
|
72
72
|
};
|
|
73
73
|
weekNumber: number | null;
|
|
74
74
|
openPeriodPicker: () => void;
|
|
75
|
-
sendPlausibleGoal: (path: string) => void;
|
|
75
|
+
sendPlausibleGoal: (type: string) => (path: string) => () => void;
|
|
76
76
|
loading: boolean;
|
|
77
77
|
resultsOptions?: ResultsOptions;
|
|
78
78
|
productImage?: React.ComponentType<{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"results.d.ts","sourceRoot":"","sources":["../../../../src/esf/components/instant-search/results.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,OAAc,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAiB,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAQtD,KAAK,QAAQ,GAAG;IACd,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAA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8 +34,8 @@ export default function Results({ lang, text, results, weekNumber, openPeriodPic
|
|
|
34
34
|
instructors.length ||
|
|
35
35
|
filteredFaqs.length ||
|
|
36
36
|
information.length);
|
|
37
|
-
return (_jsx("div", { className: css.results, children: (loading || text.length > 0) && (_jsxs("div", { className: css.inner, children: [_jsxs("div", { ref: ref, className: css.left, children: [_jsx(Links, { linksTitle: message(lang, "pages"), icon: "FileText", links: pages, loading: loading, sendPlausibleGoal: sendPlausibleGoal, linkOptions: resultsOptions.linkOptions }), _jsx(Links, { linksTitle: message(lang, "instructors"), icon: "User", links: instructors, loading: loading, sendPlausibleGoal: sendPlausibleGoal, linkOptions: resultsOptions.linkOptions }), _jsx(Links, { linksTitle: message(lang, "faqs"), icon: "Question", links: filteredFaqs, loading: loading, sendPlausibleGoal: sendPlausibleGoal, linkOptions: resultsOptions.linkOptions }), _jsx(Links, { linksTitle: message(lang, "information"), icon: "Info", links: information, loading: loading, sendPlausibleGoal: sendPlausibleGoal, linkOptions: {
|
|
37
|
+
return (_jsx("div", { className: css.results, children: (loading || text.length > 0) && (_jsxs("div", { className: css.inner, children: [_jsxs("div", { ref: ref, className: css.left, children: [_jsx(Links, { linksTitle: message(lang, "pages"), icon: "FileText", links: pages, loading: loading, sendPlausibleGoal: sendPlausibleGoal("pages"), linkOptions: resultsOptions.linkOptions }), _jsx(Links, { linksTitle: message(lang, "instructors"), icon: "User", links: instructors, loading: loading, sendPlausibleGoal: sendPlausibleGoal("instructors"), linkOptions: resultsOptions.linkOptions }), _jsx(Links, { linksTitle: message(lang, "faqs"), icon: "Question", links: filteredFaqs, loading: loading, sendPlausibleGoal: sendPlausibleGoal("faqs"), linkOptions: resultsOptions.linkOptions }), _jsx(Links, { linksTitle: message(lang, "information"), icon: "Info", links: information, loading: loading, sendPlausibleGoal: sendPlausibleGoal("information"), linkOptions: {
|
|
38
38
|
...resultsOptions.linkOptions,
|
|
39
39
|
titleField: "pageTitle",
|
|
40
|
-
} })] }), _jsxs("div", { className: css.right, children: [!loading && products.length > 0 && weekSystemEnabled && (_jsx(_Fragment, { children: showProductsTitle ? (_jsxs("div", { className: css.resultsWithWeekTitle, children: [message(lang, "productTitleWithWeek"), Dates.weekToLongDate(weekNumber, season.end, season.forceSeasonSwitch), _jsxs(Button, { onClick: openPeriodPicker, children: [_jsx(CalendarIcon, {}), message(lang, "updateWeek")] })] })) : (_jsxs("div", { className: css.resultsWithoutWeekTitle, children: [message(lang, "productTitleWithoutWeek"), _jsxs(Button, { onClick: openPeriodPicker, children: [_jsx(CalendarIcon, {}), message(lang, "chooseWeek")] })] })) })), _jsx(Products, { lang: lang, products: products, weekNumber: weekNumber, loading: loading, sendPlausibleGoal: sendPlausibleGoal, otherResultsRef: ref, isOtherResultsEmpty: isOtherResultsEmpty, productOptions: resultsOptions.productOptions, productImage: productImage })] })] })) }));
|
|
40
|
+
} })] }), _jsxs("div", { className: css.right, children: [!loading && products.length > 0 && weekSystemEnabled && (_jsx(_Fragment, { children: showProductsTitle ? (_jsxs("div", { className: css.resultsWithWeekTitle, children: [message(lang, "productTitleWithWeek"), Dates.weekToLongDate(weekNumber, season.end, season.forceSeasonSwitch), _jsxs(Button, { onClick: openPeriodPicker, children: [_jsx(CalendarIcon, {}), message(lang, "updateWeek")] })] })) : (_jsxs("div", { className: css.resultsWithoutWeekTitle, children: [message(lang, "productTitleWithoutWeek"), _jsxs(Button, { onClick: openPeriodPicker, children: [_jsx(CalendarIcon, {}), message(lang, "chooseWeek")] })] })) })), _jsx(Products, { lang: lang, products: products, weekNumber: weekNumber, loading: loading, sendPlausibleGoal: sendPlausibleGoal("product"), otherResultsRef: ref, isOtherResultsEmpty: isOtherResultsEmpty, productOptions: resultsOptions.productOptions, productImage: productImage })] })] })) }));
|
|
41
41
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sheet.d.ts","sourceRoot":"","sources":["../../../../src/esf/components/instructors-book/sheet.js"],"names":[],"mappings":"AAgBA;;;;;;
|
|
1
|
+
{"version":3,"file":"sheet.d.ts","sourceRoot":"","sources":["../../../../src/esf/components/instructors-book/sheet.js"],"names":[],"mappings":"AAgBA;;;;;;4CA8LC"}
|
|
@@ -19,6 +19,21 @@ export default function Sheet({ instructor, popup, formFields, formSendFunction,
|
|
|
19
19
|
const { lang, path } = useUbloContext();
|
|
20
20
|
const [loading, setLoading] = React.useState(true);
|
|
21
21
|
const [picture, setPicture] = React.useState(photo);
|
|
22
|
+
const mediaQueryPrint = typeof window !== "undefined" ? window.matchMedia("print") : undefined;
|
|
23
|
+
const [isPrinting, setIsPrinting] = React.useState(mediaQueryPrint?.matches);
|
|
24
|
+
React.useEffect(() => {
|
|
25
|
+
const listener = (e) => {
|
|
26
|
+
setIsPrinting(e.matches);
|
|
27
|
+
};
|
|
28
|
+
if (mediaQueryPrint) {
|
|
29
|
+
mediaQueryPrint?.addEventListener("change", listener);
|
|
30
|
+
}
|
|
31
|
+
return () => {
|
|
32
|
+
if (mediaQueryPrint) {
|
|
33
|
+
mediaQueryPrint.removeEventListener("change", listener);
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
}, [mediaQueryPrint]);
|
|
22
37
|
const prefixLang = lang === "fr" ? "fr" : "en";
|
|
23
38
|
const stopLoading = () => {
|
|
24
39
|
setLoading(false);
|
|
@@ -34,7 +49,7 @@ export default function Sheet({ instructor, popup, formFields, formSendFunction,
|
|
|
34
49
|
const formattedFirstname = Utils.formatNames(prenom);
|
|
35
50
|
const formattedLastname = Utils.formatNames(nom);
|
|
36
51
|
const key = `${lang}-${path}${prenom}-${nom}`;
|
|
37
|
-
return (_jsxs("div", { className: classes, children: [_jsxs("div", { className: css.content, children: [!popup && bookUrl && (_jsxs(Link, { href: bookUrl, className: classNames(buttonCss.button, buttonCss.link), children: [_jsx(ChevronLeftIcon, {}), message(lang, "go-back")] })), _jsxs("div", { className: css.header, children: [_jsx("div", { className: css.imageContainer, children: picture ? (_jsxs(_Fragment, { children: [loading && _jsx(LoaderIcon, { className: css.imageLoader }), _jsx(Image, { loading: "lazy", src: picture, className: css.image, alt: `${prenom} ${nom}`, onLoad: stopLoading, onError: setFallbackPicture, width: "200", height: "280" }, uri)] })) : (_jsx("div", { className: css.imagePlaceholder, children: _jsx(UserIcon, { className: css.imagePlaceholderIcon }) })) }), _jsxs("div", { className: css.information, children: [_jsxs("div", { className: css.name, children: [_jsxs("span", { className: css.firstName, children: [formattedFirstname, " "] }), _jsx("span", { className: css.lastName, children: formattedLastname })] }), disciplines && (_jsxs("div", { className: css.activities, children: [_jsx("div", { className: css.activitiesTitle, children: message(lang, "activities") }), _jsx("div", { className: css.activitiesList, children: disciplines.map((discipline, i) => {
|
|
52
|
+
return (_jsxs("div", { className: classes, children: [_jsxs("div", { className: css.content, children: [!popup && bookUrl && (_jsxs(Link, { href: bookUrl, className: classNames(buttonCss.button, buttonCss.link), children: [_jsx(ChevronLeftIcon, {}), message(lang, "go-back")] })), _jsxs("div", { className: css.header, children: [_jsx("div", { className: css.imageContainer, children: picture ? (_jsxs(_Fragment, { children: [loading && _jsx(LoaderIcon, { className: css.imageLoader }), _jsx(Image, { loading: "lazy", src: picture, className: css.image, alt: `${prenom} ${nom}`, onLoad: stopLoading, onError: setFallbackPicture, width: isPrinting ? "350" : "200", height: isPrinting ? "490" : "280" }, uri)] })) : (_jsx("div", { className: css.imagePlaceholder, children: _jsx(UserIcon, { className: css.imagePlaceholderIcon }) })) }), _jsxs("div", { className: css.information, children: [_jsxs("div", { className: css.name, children: [_jsxs("span", { className: css.firstName, children: [formattedFirstname, " "] }), _jsx("span", { className: css.lastName, children: formattedLastname })] }), disciplines && (_jsxs("div", { className: css.activities, children: [_jsx("div", { className: css.activitiesTitle, children: message(lang, "activities") }), _jsx("div", { className: css.activitiesList, children: disciplines.map((discipline, i) => {
|
|
38
53
|
const { code, label } = discipline;
|
|
39
54
|
const length = disciplines.length;
|
|
40
55
|
return (_jsxs("span", { className: css.activity, children: [_jsx("span", { children: label }), i < length - 2
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
export default EvaluateLevel;
|
|
2
|
-
declare function EvaluateLevel({ menu }: {
|
|
2
|
+
declare function EvaluateLevel({ menu, showEquivalences, equivalencesPath }: {
|
|
3
3
|
menu: any;
|
|
4
|
+
showEquivalences: any;
|
|
5
|
+
equivalencesPath: any;
|
|
4
6
|
}): import("react/jsx-runtime").JSX.Element;
|
|
5
7
|
//# sourceMappingURL=levels.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"levels.d.ts","sourceRoot":"","sources":["../../../../src/esf/components/levels/levels.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"levels.d.ts","sourceRoot":"","sources":["../../../../src/esf/components/levels/levels.js"],"names":[],"mappings":";AAuPA;;;;4CAuHC"}
|
|
@@ -3,7 +3,7 @@ import * as React from "react";
|
|
|
3
3
|
import classNames from "classnames";
|
|
4
4
|
import Detail from "./detail";
|
|
5
5
|
import { useUbloContext } from "ublo/with-ublo";
|
|
6
|
-
import { fetchMenus } from "ublo/fetcher";
|
|
6
|
+
import { fetchMenus, fetchZone } from "ublo/fetcher";
|
|
7
7
|
const LEVELS = {
|
|
8
8
|
pioupiou: "skialpin-clubpioupiou-pioupiou",
|
|
9
9
|
blanchot: "skialpin-clubpioupiou-blanchot",
|
|
@@ -39,6 +39,12 @@ const LEVELS = {
|
|
|
39
39
|
"2-snowboard": "snow-snowboardstyle-snowboard2",
|
|
40
40
|
"3-snowboard": "snow-snowboardstyle-snowboard3",
|
|
41
41
|
"snowboard-expert": "snow-snowboardstyle-snowboardexpert",
|
|
42
|
+
"clubpioupiou-snowboard-pioupiou": "snow-clubpioupiou-pioupiou",
|
|
43
|
+
"reve-snowboard-ourson": "snow-revedetoiles-ourson",
|
|
44
|
+
"reve-snowboard-flocon": "snow-revedetoiles-flocon",
|
|
45
|
+
"reve-snowboard-etoile-1": "snow-revedetoiles-etoile1",
|
|
46
|
+
"reve-snowboard-etoile-2": "snow-revedetoiles-etoile2",
|
|
47
|
+
"reve-snowboard-2": "snow-revedetoiles-snowboard2",
|
|
42
48
|
"x-boarder": "snow-clubesfsnow-xboarder",
|
|
43
49
|
"ptit-freestyler": "skialpin-teamrider-ptitfreestyler",
|
|
44
50
|
"freestyler-inter": "skialpin-teamrider-intermediaire",
|
|
@@ -149,7 +155,7 @@ const Activities = ({ activities, activityChanged, selectedActivity, selectedAge
|
|
|
149
155
|
return (_jsxs("div", { className: activityClasses, children: [_jsxs("div", { className: "evaluate-level__activity", onClick: clicked(activity), children: [_jsx("div", { className: "evaluate-level__radio-button" }), title] }), selected && !isFreestyle && (_jsx(AgeClasses, { ages: subs, selectedAge: selectedAge, ageChanged: ageChanged }))] }, name));
|
|
150
156
|
}) }));
|
|
151
157
|
};
|
|
152
|
-
const EvaluateLevel = ({ menu }) => {
|
|
158
|
+
const EvaluateLevel = ({ menu, showEquivalences, equivalencesPath }) => {
|
|
153
159
|
const { config, lang } = useUbloContext();
|
|
154
160
|
const { ubloApi, site } = config;
|
|
155
161
|
const levelRef = React.useRef(null);
|
|
@@ -158,6 +164,7 @@ const EvaluateLevel = ({ menu }) => {
|
|
|
158
164
|
const [detail, setDetail] = React.useState();
|
|
159
165
|
const [selectedActivity, setSelectedActivity] = React.useState({});
|
|
160
166
|
const [selectedAge, setSelectedAge] = React.useState({});
|
|
167
|
+
const [equivalences, setEquivalences] = React.useState();
|
|
161
168
|
const activityChanged = (activity) => {
|
|
162
169
|
const { name } = activity;
|
|
163
170
|
const isFreestyle = name === "levels-freestyle";
|
|
@@ -211,6 +218,20 @@ const EvaluateLevel = ({ menu }) => {
|
|
|
211
218
|
getLevels();
|
|
212
219
|
}
|
|
213
220
|
}, [lang, selectedAge, site, ubloApi]);
|
|
214
|
-
|
|
221
|
+
React.useEffect(() => {
|
|
222
|
+
if (!showEquivalences)
|
|
223
|
+
return;
|
|
224
|
+
async function getEquivalences(equivalencesPath) {
|
|
225
|
+
const content = await fetchZone(ubloApi, site, lang, equivalencesPath, "equivalences");
|
|
226
|
+
if (content) {
|
|
227
|
+
setEquivalences(content);
|
|
228
|
+
}
|
|
229
|
+
else {
|
|
230
|
+
setEquivalences(undefined);
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
getEquivalences(equivalencesPath);
|
|
234
|
+
}, [showEquivalences, lang]);
|
|
235
|
+
return (_jsxs("div", { className: "evaluate-level", children: [!menu && (_jsx(Activities, { activities: activities, selectedActivity: selectedActivity, activityChanged: activityChanged, selectedAge: selectedAge, ageChanged: ageChanged })), selectedAge.path && (_jsx(Levels, { levels: levels, selectedActivity: selectedActivity, selectedAge: selectedAge, detail: detail, setDetail: setDetail, levelRef: levelRef })), detail && _jsx(LevelDetail, { detail: detail }), equivalences && (_jsx("div", { dangerouslySetInnerHTML: { __html: equivalences } }))] }));
|
|
215
236
|
};
|
|
216
237
|
export default EvaluateLevel;
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
export default Booking;
|
|
2
|
-
declare function Booking({ stay, cartUrl, channel, values, maxCPDuration, setCurrentStep, msemWidgetHost, }: {
|
|
2
|
+
declare function Booking({ stay, cartUrl, channel, values, maxCPDuration, currentStep, setCurrentStep, msemWidgetHost, modal, }: {
|
|
3
3
|
stay: any;
|
|
4
4
|
cartUrl: any;
|
|
5
5
|
channel: any;
|
|
6
6
|
values: any;
|
|
7
7
|
maxCPDuration: any;
|
|
8
|
+
currentStep: any;
|
|
8
9
|
setCurrentStep: any;
|
|
9
10
|
msemWidgetHost: any;
|
|
11
|
+
modal: any;
|
|
10
12
|
}): import("react/jsx-runtime").JSX.Element;
|
|
11
13
|
//# sourceMappingURL=booking.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"booking.d.ts","sourceRoot":"","sources":["../../../../src/esf/components/magic-box/booking.js"],"names":[],"mappings":";AAUA
|
|
1
|
+
{"version":3,"file":"booking.d.ts","sourceRoot":"","sources":["../../../../src/esf/components/magic-box/booking.js"],"names":[],"mappings":";AAUA;;;;;;;;;;4CAwHC"}
|
|
@@ -7,7 +7,7 @@ import { message } from "./messages";
|
|
|
7
7
|
import { loadWidgetMseM } from "./services/widgets";
|
|
8
8
|
import * as Plausible from "../../../future/components/plausible";
|
|
9
9
|
import css from "./booking.module.css";
|
|
10
|
-
const Booking = ({ stay, cartUrl, channel, values, maxCPDuration, setCurrentStep, msemWidgetHost, }) => {
|
|
10
|
+
const Booking = ({ stay, cartUrl, channel, values, maxCPDuration, currentStep, setCurrentStep, msemWidgetHost, modal, }) => {
|
|
11
11
|
const { lang, cmsMode, config } = useUbloContext();
|
|
12
12
|
const { resort } = config;
|
|
13
13
|
const langPrefix = config.langPrefix.links ? `/${lang}` : "";
|
|
@@ -62,8 +62,8 @@ const Booking = ({ stay, cartUrl, channel, values, maxCPDuration, setCurrentStep
|
|
|
62
62
|
channel,
|
|
63
63
|
preview: !!cmsMode,
|
|
64
64
|
cartChanged: goToCart,
|
|
65
|
-
|
|
66
|
-
groundedTo: "#msem-magic-box",
|
|
65
|
+
fullwidth: !modal,
|
|
66
|
+
groundedTo: !modal ? "#msem-magic-box" : undefined,
|
|
67
67
|
analytics: Plausible.callback,
|
|
68
68
|
categoryCode,
|
|
69
69
|
};
|
|
@@ -74,6 +74,9 @@ const Booking = ({ stay, cartUrl, channel, values, maxCPDuration, setCurrentStep
|
|
|
74
74
|
...engagementPresets,
|
|
75
75
|
};
|
|
76
76
|
window.MseM.esf(options, presets);
|
|
77
|
+
if (modal && currentStep === 1) {
|
|
78
|
+
setCurrentStep(0);
|
|
79
|
+
}
|
|
77
80
|
});
|
|
78
81
|
};
|
|
79
82
|
init();
|
|
@@ -90,7 +93,13 @@ const Booking = ({ stay, cartUrl, channel, values, maxCPDuration, setCurrentStep
|
|
|
90
93
|
resort,
|
|
91
94
|
stay.from,
|
|
92
95
|
stay.to,
|
|
96
|
+
currentStep,
|
|
97
|
+
setCurrentStep,
|
|
98
|
+
modal,
|
|
93
99
|
]);
|
|
100
|
+
if (modal) {
|
|
101
|
+
return null;
|
|
102
|
+
}
|
|
94
103
|
return (_jsxs("div", { className: css.root, children: [_jsxs(Button, { onClick: goBack, children: [_jsx(ArrowLeftIcon, {}), message(lang, "go-back")] }), _jsx("div", { id: "msem-magic-box" })] }));
|
|
95
104
|
};
|
|
96
105
|
export default Booking;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filter.d.ts","sourceRoot":"","sources":["../../../../src/esf/components/magic-box/filter.js"],"names":[],"mappings":";AAOA;;;;;
|
|
1
|
+
{"version":3,"file":"filter.d.ts","sourceRoot":"","sources":["../../../../src/esf/components/magic-box/filter.js"],"names":[],"mappings":";AAOA;;;;;4CAsCC"}
|
|
@@ -11,17 +11,17 @@ const Filter = ({ code, filter, values, setValues }) => {
|
|
|
11
11
|
const newValues = { ...values, [code]: value };
|
|
12
12
|
setValues(newValues);
|
|
13
13
|
};
|
|
14
|
-
const
|
|
14
|
+
const showRestricted = code === "activities";
|
|
15
|
+
const formattedValues = filter.reduce((acc, { libelle, value, restricted }) => {
|
|
15
16
|
let label = libelle;
|
|
16
|
-
if (restricted) {
|
|
17
|
+
if (!showRestricted && restricted) {
|
|
18
|
+
return acc;
|
|
19
|
+
}
|
|
20
|
+
if (showRestricted && restricted) {
|
|
17
21
|
label = `${libelle} (${message(lang, "unavailable")})`;
|
|
18
22
|
}
|
|
19
|
-
return {
|
|
20
|
-
|
|
21
|
-
value,
|
|
22
|
-
disabled: restricted,
|
|
23
|
-
};
|
|
24
|
-
});
|
|
23
|
+
return [...acc, { label, value, disabled: restricted }];
|
|
24
|
+
}, []);
|
|
25
25
|
const options = values.length === 1 ? formattedValues : [""].concat(formattedValues);
|
|
26
26
|
const classes = classNames(css.filter, css[code]);
|
|
27
27
|
return (_jsxs("div", { className: classes, children: [_jsx("div", { className: css.filterLabel, children: message(lang, code) }), _jsx(Select, { options: options, value: values[code], onValueChange: updateFilter })] }));
|
|
@@ -26,8 +26,9 @@ type Props = {
|
|
|
26
26
|
destination: string;
|
|
27
27
|
forwardFieldValues: boolean;
|
|
28
28
|
};
|
|
29
|
+
modal?: boolean;
|
|
29
30
|
};
|
|
30
31
|
declare const _default: React.MemoExoticComponent<typeof MagicBox>;
|
|
31
32
|
export default _default;
|
|
32
|
-
declare function MagicBox({ stay, cartUrl, channel, className, alignContent, maxCPDuration, minDays, maxDays, allowedActivities, categories, msemWidgetHost, msemApiHost, msemAdminHost, customSubmit, children, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
33
|
+
declare function MagicBox({ stay, cartUrl, channel, className, alignContent, maxCPDuration, minDays, maxDays, allowedActivities, categories, msemWidgetHost, msemApiHost, msemAdminHost, customSubmit, modal, children, }: Props): import("react/jsx-runtime").JSX.Element;
|
|
33
34
|
//# sourceMappingURL=magic-box.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"magic-box.d.ts","sourceRoot":"","sources":["../../../../src/esf/components/magic-box/magic-box.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAiB/B,KAAK,IAAI,GAAG;IACV,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;CACZ,CAAC;AAEF,KAAK,cAAc,GACf,0BAA0B,GAC1B,sCAAsC,GACtC,8BAA8B,CAAC;AACnC,KAAK,WAAW,GACZ,oCAAoC,GACpC,gDAAgD,GAChD,wCAAwC,CAAC;AAC7C,KAAK,aAAa,GACd,oDAAoD,GACpD,gEAAgE,GAChE,wDAAwD,CAAC;AAE7D,KAAK,KAAK,GAAG;IACX,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,KAAK,GAAG,MAAM,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,CAAC;IAC3C,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,CAAC;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C;IAC7B,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,YAAY,CAAC,EAAE;QACb,KAAK,EAAE,MAAM,CAAC;QACd,WAAW,EAAE,MAAM,CAAC;QACpB,kBAAkB,EAAE,OAAO,CAAC;KAC7B,CAAC;IACF,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB,CAAC;;AAIF,wBAAoC;AAEpC,iBAAS,QAAQ,CAAC,EAChB,IAAI,EACJ,OAAO,EACP,OAAe,EACf,SAAS,EACT,YAAY,EACZ,aAAa,EACb,OAAW,EACX,OAAkB,EAClB,iBAAiB,EACjB,UAAU,EACV,cAA2C,EAC3C,WAAkD,EAClD,aAAoE,EACpE,YAAY,EACZ,KAAK,EACL,QAAQ,GACT,EAAE,KAAK,2CAgPP"}
|
|
@@ -15,7 +15,7 @@ import { message } from "./messages";
|
|
|
15
15
|
import * as API from "./services/api";
|
|
16
16
|
import css from "./magic-box.module.css";
|
|
17
17
|
export default React.memo(MagicBox);
|
|
18
|
-
function MagicBox({ stay, cartUrl, channel = "ESF", className, alignContent, maxCPDuration, minDays = 0, maxDays = Infinity, allowedActivities, categories, msemWidgetHost = "https://widget.msem.tech", msemApiHost = "https://services.msem.tech/api/esf", msemAdminHost = "https://admin.mon-sejour-en-montagne.com/api/gesco", customSubmit, children, }) {
|
|
18
|
+
function MagicBox({ stay, cartUrl, channel = "ESF", className, alignContent, maxCPDuration, minDays = 0, maxDays = Infinity, allowedActivities, categories, msemWidgetHost = "https://widget.msem.tech", msemApiHost = "https://services.msem.tech/api/esf", msemAdminHost = "https://admin.mon-sejour-en-montagne.com/api/gesco", customSubmit, modal, children, }) {
|
|
19
19
|
const [filters, setFilters] = React.useState();
|
|
20
20
|
const [values, setValues] = React.useState();
|
|
21
21
|
const [currentStep, setCurrentStep] = React.useState(0);
|
|
@@ -91,16 +91,14 @@ function MagicBox({ stay, cartUrl, channel = "ESF", className, alignContent, max
|
|
|
91
91
|
}
|
|
92
92
|
if (key === "activities") {
|
|
93
93
|
const mustFilterActivities = allowedActivities && allowedActivities.length > 0;
|
|
94
|
-
const activities =
|
|
95
|
-
|
|
94
|
+
const activities = mustFilterActivities
|
|
95
|
+
? filter.filter((item) => {
|
|
96
96
|
return allowedActivities.includes(item.value);
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
});
|
|
97
|
+
})
|
|
98
|
+
: filter;
|
|
100
99
|
return { ...acc, activities };
|
|
101
100
|
}
|
|
102
|
-
|
|
103
|
-
return { ...acc, [key]: filterWithoutRestricted };
|
|
101
|
+
return { ...acc, [key]: filter };
|
|
104
102
|
}, {});
|
|
105
103
|
const formattedCategories = categoryList?.map(({ code, label }) => {
|
|
106
104
|
return { value: code, libelle: label };
|
|
@@ -154,7 +152,7 @@ function MagicBox({ stay, cartUrl, channel = "ESF", className, alignContent, max
|
|
|
154
152
|
const showFilter = stay && filters && values;
|
|
155
153
|
const SubmitIcon = customSubmitChecked ? ArrowRightIcon : SearchIcon;
|
|
156
154
|
const classes = classNames(css.root, className);
|
|
157
|
-
return (_jsxs("div", { className: classes, "data-align": alignContent, children: [_jsxs("div", { className: css.top, children: [children, VELClosed && !jmoins && (_jsxs(Information, { type: "error", className: css.errorMessage, children: [message(lang, "vel-closed"), _jsx(Button, { className: css.contact, onClick: openContactDialog, children: message(lang, "contact-us") })] })), jmoins && (_jsxs(Information, { type: "warning", className: css.errorMessage, children: [message(lang, "booking-block-day-minus-start"), " ", jmoins, message(lang, "booking-block-day-minus-end")] })), !VELClosed && currentStep === 0 && (_jsxs(_Fragment, { children: [!filters && _jsx("div", { className: css.loader }), showFilter && (_jsx(Filters, { filters: filters, values: values, setValues: setValues, customSubmit: customSubmit, customSubmitChecked: customSubmitChecked, setCustomSubmitChecked: setCustomSubmitChecked }))
|
|
155
|
+
return (_jsxs("div", { className: classes, "data-align": alignContent, children: [_jsxs("div", { className: css.top, children: [children, VELClosed && !jmoins && (_jsxs(Information, { type: "error", className: css.errorMessage, children: [message(lang, "vel-closed"), _jsx(Button, { className: css.contact, onClick: openContactDialog, children: message(lang, "contact-us") })] })), jmoins && (_jsxs(Information, { type: "warning", className: css.errorMessage, children: [message(lang, "booking-block-day-minus-start"), " ", jmoins, message(lang, "booking-block-day-minus-end")] })), !VELClosed && (currentStep === 0 || modal) && (_jsxs(_Fragment, { children: [!filters && _jsx("div", { className: css.loader }), showFilter && (_jsx(Filters, { filters: filters, values: values, setValues: setValues, customSubmit: customSubmit, customSubmitChecked: customSubmitChecked, setCustomSubmitChecked: setCustomSubmitChecked })), _jsxs(Button, { className: css.confirm, onClick: submit, disabled: VELClosed || !isValid, children: [message(lang, customSubmitChecked ? "proceed" : "confirm"), _jsx(SubmitIcon, {})] })] })), currentStep === 1 && (_jsx(Booking, { stay: stay, cartUrl: cartUrl, channel: channel, values: values, maxCPDuration: maxCPDuration, currentStep: currentStep, setCurrentStep: setCurrentStep, msemWidgetHost: msemWidgetHost, modal: modal }))] }), _jsx(Dialog, { className: css.dialog, isOpened: contactDialogOpened, close: closeContactDialog, children: _jsx("div", { className: css.dialogInner, children: _jsx(GescoContactForm, { lang: lang, channel: channel, resort: resort, merchant: merchant }) }) })] }));
|
|
158
156
|
}
|
|
159
157
|
function getDefaultValues(filters) {
|
|
160
158
|
return Object.keys(filters || {}).reduce((acc, key) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../../../src/esf/components/magic-box/services/api.js"],"names":[],"mappings":"AAGA;;;;;;iBAOC;AAED;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../../../src/esf/components/magic-box/services/api.js"],"names":[],"mappings":"AAGA;;;;;;iBAOC;AAED;;;;;;;;;;iBAsBC;AAED,oIAeC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"period-picker.d.ts","sourceRoot":"","sources":["../../../../src/esf/components/period-picker/period-picker.js"],"names":[],"mappings":"AA2BA;;;;;;;
|
|
1
|
+
{"version":3,"file":"period-picker.d.ts","sourceRoot":"","sources":["../../../../src/esf/components/period-picker/period-picker.js"],"names":[],"mappings":"AA2BA;;;;;;;4CAwNC"}
|
|
@@ -129,7 +129,7 @@ button.button {
|
|
|
129
129
|
background-color: var(--ds-grey-500, #484848);
|
|
130
130
|
}
|
|
131
131
|
|
|
132
|
-
.selected button.button {
|
|
132
|
+
.weeks:not(.withPeriods) .selected button.button {
|
|
133
133
|
position: relative;
|
|
134
134
|
background-color: var(--ds-secondary, var(--ds-blue-400, #4177f6));
|
|
135
135
|
}
|
|
@@ -145,12 +145,16 @@ button.button::before {
|
|
|
145
145
|
background-color: var(--ds-secondary, var(--ds-blue-400, #4177f6));
|
|
146
146
|
opacity: 0;
|
|
147
147
|
transform: scaleX(0.8);
|
|
148
|
-
transition:
|
|
149
|
-
|
|
148
|
+
transition:
|
|
149
|
+
opacity 160ms var(--ds-transition-easing, cubic-bezier(0.4, 0, 0.2, 1)),
|
|
150
150
|
transform 160ms var(--ds-transition-easing, cubic-bezier(0.4, 0, 0.2, 1));
|
|
151
151
|
pointer-events: none;
|
|
152
152
|
}
|
|
153
153
|
|
|
154
|
+
.weeks.withPeriods button.button::before {
|
|
155
|
+
content: none;
|
|
156
|
+
}
|
|
157
|
+
|
|
154
158
|
.selected button.button::before {
|
|
155
159
|
opacity: 0.5;
|
|
156
160
|
transform: none;
|
|
@@ -158,8 +162,7 @@ button.button::before {
|
|
|
158
162
|
|
|
159
163
|
.weeks.withPeriods .selected button.button {
|
|
160
164
|
outline: 2px solid var(--ds-primary, var(--ds-blue-500, #002dcc));
|
|
161
|
-
outline-offset: -
|
|
162
|
-
border-radius: var(--ds-radius-100, 4px);
|
|
165
|
+
outline-offset: -2px;
|
|
163
166
|
}
|
|
164
167
|
|
|
165
168
|
.check {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-booking-links.d.ts","sourceRoot":"","sources":["../../../src/esf/hooks/use-booking-links.js"],"names":[],"mappings":"AAKA,
|
|
1
|
+
{"version":3,"file":"use-booking-links.d.ts","sourceRoot":"","sources":["../../../src/esf/hooks/use-booking-links.js"],"names":[],"mappings":"AAKA,uJAwDC"}
|
|
@@ -5,20 +5,26 @@ import * as Plausible from "../../future/components/plausible";
|
|
|
5
5
|
export default function useBookingLinks(cart, multipleVillages, setupCallback, channel = "ESF", cartChanged, skipRecap) {
|
|
6
6
|
const { breadcrumb, config, lang, path } = useUbloContext();
|
|
7
7
|
const hasLangPrefix = config.langPrefix.links;
|
|
8
|
-
const
|
|
8
|
+
const handleCartChange = React.useCallback((cart, kind, eventType) => {
|
|
9
|
+
cartChanged?.(cart, kind, eventType);
|
|
10
|
+
const event = new CustomEvent("msem-cart-changed", {
|
|
11
|
+
detail: { cart, kind, eventType },
|
|
12
|
+
});
|
|
13
|
+
window.dispatchEvent(event);
|
|
14
|
+
}, [cartChanged]);
|
|
9
15
|
React.useEffect(() => {
|
|
10
16
|
const run = async () => {
|
|
11
17
|
await loadJS("https://widget.vente-en-ligne-esf.com/boutique/boutique.js", "boutique-js");
|
|
12
|
-
setupConfig(
|
|
18
|
+
setupConfig(lang, breadcrumb, cart, multipleVillages, hasLangPrefix, channel, handleCartChange, skipRecap);
|
|
13
19
|
setupDialogCleanup();
|
|
14
20
|
setupCallback?.();
|
|
15
21
|
};
|
|
16
22
|
run();
|
|
17
23
|
}, [
|
|
18
|
-
|
|
24
|
+
lang,
|
|
19
25
|
breadcrumb,
|
|
20
26
|
cart,
|
|
21
|
-
|
|
27
|
+
handleCartChange,
|
|
22
28
|
channel,
|
|
23
29
|
hasLangPrefix,
|
|
24
30
|
multipleVillages,
|
|
@@ -30,9 +36,7 @@ export default function useBookingLinks(cart, multipleVillages, setupCallback, c
|
|
|
30
36
|
function setupConfig(lang, breadcrumb, cart = [], multipleVillages, hasLangPrefix, channel, cartChanged, skipRecap) {
|
|
31
37
|
const pageEsf = multipleVillages ? breadcrumb?.next?.path : breadcrumb?.path;
|
|
32
38
|
const langPrefix = hasLangPrefix ? `/${lang}` : "";
|
|
33
|
-
const pagePanier =
|
|
34
|
-
? undefined
|
|
35
|
-
: langPrefix.concat(cart[0] ? cart[0].path : "/panier");
|
|
39
|
+
const pagePanier = langPrefix.concat(cart[0] ? cart[0].path : "/panier");
|
|
36
40
|
window.pagePanier = pagePanier;
|
|
37
41
|
window.pageEsf = pageEsf;
|
|
38
42
|
window.currentLang = lang;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-gesco-referral.d.ts","sourceRoot":"","sources":["../../../src/esf/hooks/use-gesco-referral.js"],"names":[],"mappings":"AAMA,iDAcC"}
|