ublo-lib 1.32.3 → 1.32.5
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/custom-contact-form/attachment.js +2 -2
- package/es/common/components/custom-contact-form/utils.js +2 -2
- package/es/common/components/date-picker/calendar.js +2 -2
- package/es/common/components/date-picker/date-item.js +5 -5
- package/es/common/components/editable-calendar/calendar-editor.js +3 -3
- package/es/common/components/editable-map/popup-data.js +2 -2
- package/es/common/components/msem-preset-editor/editors/lodgings.js +5 -5
- package/es/common/components/msem-preset-editor/editors/ski-passes.js +2 -2
- package/es/common/components/msem-preset-editor/editors/standard-products.js +2 -2
- package/es/common/components/msem-preset-editor/editors/vakario.js +8 -8
- package/es/common/components/msem-preset-editor/msem-preset-editor.js +3 -3
- package/es/common/components/msem-preset-editor/services/offers.js +2 -2
- package/es/common/components/msem-preset-linker/components/resort-selector.js +2 -2
- package/es/common/components/plausible/services/callback.d.ts.map +1 -1
- package/es/common/components/plausible/services/callback.js +31 -14
- package/es/common/hooks/use-injected-cms-markup.js +2 -2
- package/es/esf/components/booking-form/field.js +2 -2
- package/es/esf/components/instructors-book/filters.js +3 -3
- package/es/esf/components/loyal-customers/components/field.js +2 -2
- package/es/esf/components/loyal-customers/content.js +4 -4
- package/es/esf/components/magic-box/filter.js +2 -2
- package/es/esf/components/magic-box/magic-box.js +2 -2
- package/es/esf/components/period-picker/date-display.js +2 -2
- package/es/esf/components/period-picker/days.js +2 -2
- package/es/esf/components/period-picker/title.js +2 -2
- package/es/esf/components/period-picker/weeks.d.ts.map +1 -1
- package/es/esf/components/period-picker/weeks.js +8 -5
- package/es/esf/components/period-picker/weeks.module.css +6 -0
- package/es/esf/hooks/use-affiliation.d.ts.map +1 -1
- package/es/esf/hooks/use-affiliation.js +3 -2
- package/es/future/components/plausible/services/callback.d.ts.map +1 -1
- package/es/future/components/plausible/services/callback.js +31 -14
- package/es/lbm/components/lumiplan/weather/weather-days.js +2 -2
- package/package.json +1 -1
|
@@ -12,7 +12,7 @@ export default function Attachment({ lang, name, label, settings, data, setData,
|
|
|
12
12
|
const items = data?.attachment?.value || [];
|
|
13
13
|
const { attachmentAllowed, attachmentMaxSize, attachmentAuthorizedFormats, attachmentMaxFiles, } = settings;
|
|
14
14
|
const splittedFormats = attachmentAuthorizedFormats?.split(",");
|
|
15
|
-
const
|
|
15
|
+
const formattedAuthorizedFormats = splittedFormats?.map((format, i) => `${i > 0 ? "," : ""} ${getFormatName(format)}`);
|
|
16
16
|
const handleDrop = React.useCallback((files) => {
|
|
17
17
|
const authorizedSelectionFormats = files.every((file) => splittedFormats.includes(file.type));
|
|
18
18
|
if (!authorizedSelectionFormats) {
|
|
@@ -102,7 +102,7 @@ export default function Attachment({ lang, name, label, settings, data, setData,
|
|
|
102
102
|
});
|
|
103
103
|
if (!attachmentAllowed)
|
|
104
104
|
return null;
|
|
105
|
-
return (_jsxs("div", { className: attachmentcss, children: [_jsxs("label", { className: css.label, htmlFor: name, children: [label && _jsx("span", { children: label }), _jsxs("div", { ref: ref, className: css.input, children: [items.length ? (_jsx("div", { className: css.items, children: Array.from(items).map((item, i) => (_jsx(Item, { item: item, removeItem: removeItem }, i))) })) : (_jsxs("div", { className: css.placeholder, children: [_jsx(Icons.Upload, { className: css.placeholderIcon }), Messages.get(lang, "attachmentPlaceholder")] })), (error || dragging) && (_jsx("div", { className: overlaycss, children: overlayMessage }))] }), _jsx("input", { id: name, className: css.uploadInput, type: "file", accept: attachmentAuthorizedFormats, disabled: !attachmentAllowed, onChange: onChange, multiple: attachmentMaxFiles > 1 })] }), _jsxs("div", { className: css.helper, children: [_jsx("b", { children: attachmentMaxFiles }), " ", Messages.get(lang, "attachmentHelper1"), ".", " ", _jsx("b", { children: attachmentMaxSize }), Messages.get(lang, "attachmentHelper2"), ".", " ", Messages.get(lang, "attachmentHelper3"), " ", _jsx("b", { children:
|
|
105
|
+
return (_jsxs("div", { className: attachmentcss, children: [_jsxs("label", { className: css.label, htmlFor: name, children: [label && _jsx("span", { children: label }), _jsxs("div", { ref: ref, className: css.input, children: [items.length ? (_jsx("div", { className: css.items, children: Array.from(items).map((item, i) => (_jsx(Item, { item: item, removeItem: removeItem }, i))) })) : (_jsxs("div", { className: css.placeholder, children: [_jsx(Icons.Upload, { className: css.placeholderIcon }), Messages.get(lang, "attachmentPlaceholder")] })), (error || dragging) && (_jsx("div", { className: overlaycss, children: overlayMessage }))] }), _jsx("input", { id: name, className: css.uploadInput, type: "file", accept: attachmentAuthorizedFormats, disabled: !attachmentAllowed, onChange: onChange, multiple: attachmentMaxFiles > 1 })] }), _jsxs("div", { className: css.helper, children: [_jsx("b", { children: attachmentMaxFiles }), " ", Messages.get(lang, "attachmentHelper1"), ".", " ", _jsx("b", { children: attachmentMaxSize }), Messages.get(lang, "attachmentHelper2"), ".", " ", Messages.get(lang, "attachmentHelper3"), " ", _jsx("b", { children: formattedAuthorizedFormats }), "."] })] }));
|
|
106
106
|
}
|
|
107
107
|
function Item({ item, removeItem }) {
|
|
108
108
|
const { name } = item;
|
|
@@ -83,10 +83,10 @@ export const send = async ({ site, data, fields, subjectPrefix, subjectSuffix, k
|
|
|
83
83
|
}
|
|
84
84
|
else {
|
|
85
85
|
const { formatter } = fields[key];
|
|
86
|
-
const
|
|
86
|
+
const formattedValue = typeof formatter === "function"
|
|
87
87
|
? formatter(data[key].value)
|
|
88
88
|
: data[key].value;
|
|
89
|
-
formData.append(key,
|
|
89
|
+
formData.append(key, formattedValue);
|
|
90
90
|
}
|
|
91
91
|
});
|
|
92
92
|
if (subjectPrefix) {
|
|
@@ -98,10 +98,10 @@ export default function Calendar({ date, display, stayDates = [], min, max, onSu
|
|
|
98
98
|
try {
|
|
99
99
|
const { stays } = await fetcher({ ...rest, start, numberDays });
|
|
100
100
|
if (stays?.length) {
|
|
101
|
-
const
|
|
101
|
+
const formattedStays = stays.map((stay) => {
|
|
102
102
|
return { start: new Date(stay.start), end: new Date(stay.end) };
|
|
103
103
|
});
|
|
104
|
-
setStays(
|
|
104
|
+
setStays(formattedStays);
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
107
|
catch (e) {
|
|
@@ -26,11 +26,11 @@ export default function DateItem({ date, index, month, year, min, max, selectedD
|
|
|
26
26
|
const enableAvailability = Boolean(stays);
|
|
27
27
|
const isAvailable = stays?.some((stay) => {
|
|
28
28
|
const { start, end } = stay;
|
|
29
|
-
const
|
|
30
|
-
const
|
|
31
|
-
const
|
|
32
|
-
return (
|
|
33
|
-
(selecting &&
|
|
29
|
+
const formattedStart = Utils.formatDate(start);
|
|
30
|
+
const formattedEnd = Utils.formatDate(end);
|
|
31
|
+
const formattedDate = Utils.formatDate(_date);
|
|
32
|
+
return (formattedStart === formattedDate ||
|
|
33
|
+
(selecting && formattedEnd === formattedDate));
|
|
34
34
|
}) || false;
|
|
35
35
|
const shortestMatchingStaysLength = enableAvailability &&
|
|
36
36
|
matchingStays?.reduce((acc, stay) => {
|
|
@@ -6,11 +6,11 @@ import css from "./calendar-editor.module.css";
|
|
|
6
6
|
import * as Utils from "./utils";
|
|
7
7
|
export default function CalendarEditor({ presets, setPresets, hoveredDates, closeEditor, }) {
|
|
8
8
|
const { colors, dates = {} } = presets;
|
|
9
|
-
const
|
|
9
|
+
const formattedHoveredDates = hoveredDates.map((date) => {
|
|
10
10
|
return Utils.formatDate(date);
|
|
11
11
|
});
|
|
12
12
|
const updateDates = (colorIndex) => () => {
|
|
13
|
-
const newDates =
|
|
13
|
+
const newDates = formattedHoveredDates.reduce((acc, date) => {
|
|
14
14
|
if (!colorIndex)
|
|
15
15
|
return acc;
|
|
16
16
|
return { ...acc, [date]: colorIndex };
|
|
@@ -19,7 +19,7 @@ export default function CalendarEditor({ presets, setPresets, hoveredDates, clos
|
|
|
19
19
|
dates: { ...dates, ...newDates },
|
|
20
20
|
};
|
|
21
21
|
if (!colorIndex) {
|
|
22
|
-
for (const date of
|
|
22
|
+
for (const date of formattedHoveredDates) {
|
|
23
23
|
delete newPresets.dates[date];
|
|
24
24
|
}
|
|
25
25
|
}
|
|
@@ -7,6 +7,6 @@ export default function PopupData({ marker }) {
|
|
|
7
7
|
const isExternalUrl = /^((http|https):\/\/)/.test(url);
|
|
8
8
|
const target = isExternalUrl ? "_blank" : undefined;
|
|
9
9
|
const rel = isExternalUrl ? "noopener" : undefined;
|
|
10
|
-
const
|
|
11
|
-
return (_jsxs("div", { className: css.data, children: [_jsx("div", { className: css.title, children: title }),
|
|
10
|
+
const formattedDescription = description.replace(/\n/g, "<br />");
|
|
11
|
+
return (_jsxs("div", { className: css.data, children: [_jsx("div", { className: css.title, children: title }), formattedDescription && (_jsx("div", { className: css.description, dangerouslySetInnerHTML: { __html: formattedDescription } })), url?.trim() && (_jsx(Button, { tag: "a", href: url.trim(), className: css.link, target: target, rel: rel, children: label || "En savoir plus" }))] }));
|
|
12
12
|
}
|
|
@@ -44,11 +44,11 @@ export default function Lodgings({ preset, setPreset, setShowPresetDialog, testP
|
|
|
44
44
|
const updateFilter = (kind) => (newValue) => {
|
|
45
45
|
setData((data) => ({ ...data, [kind]: newValue.map((v) => v.value) }));
|
|
46
46
|
};
|
|
47
|
-
const
|
|
47
|
+
const formattedLodgings = lodgings.map((lodging) => ({
|
|
48
48
|
value: lodging.slug,
|
|
49
49
|
label: lodging.name,
|
|
50
50
|
}));
|
|
51
|
-
const
|
|
51
|
+
const formattedRooms = rooms.map((room) => ({
|
|
52
52
|
label: room.title,
|
|
53
53
|
value: room.type,
|
|
54
54
|
}));
|
|
@@ -67,7 +67,7 @@ export default function Lodgings({ preset, setPreset, setShowPresetDialog, testP
|
|
|
67
67
|
try {
|
|
68
68
|
setLoading(true);
|
|
69
69
|
const filters = await API.getLodgingFilters(channel, resort, facet);
|
|
70
|
-
const
|
|
70
|
+
const formattedFilters = Object.keys(filters).reduce((acc, key) => {
|
|
71
71
|
if (key === "accomodations")
|
|
72
72
|
return acc;
|
|
73
73
|
const filter = filters[key];
|
|
@@ -87,7 +87,7 @@ export default function Lodgings({ preset, setPreset, setShowPresetDialog, testP
|
|
|
87
87
|
}
|
|
88
88
|
}, {});
|
|
89
89
|
setLogings(filters.accomodations);
|
|
90
|
-
setFilters(
|
|
90
|
+
setFilters(formattedFilters);
|
|
91
91
|
setReady(true);
|
|
92
92
|
}
|
|
93
93
|
catch (e) {
|
|
@@ -170,7 +170,7 @@ export default function Lodgings({ preset, setPreset, setShowPresetDialog, testP
|
|
|
170
170
|
testPreset,
|
|
171
171
|
cancelPreset,
|
|
172
172
|
confirmPreset,
|
|
173
|
-
}, 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:
|
|
173
|
+
}, 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 }), showLodgingPageCheckbox && (_jsx(Checkbox, { label: "Ouvrir la page du site", checked: data.openPage, disabled: !showLodgingPageCheckbox, onCheckedChange: updateField("openPage") })), !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.roomType, options: formattedRooms, loading: loading, onValueChange: updateField("roomType") })), _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" }), kinds.length > 1 && (_jsx(Select, { label: "Type", placeholder: "S\u00E9lectionnez un type", options: kinds, value: data.type, onValueChange: updateField("type"), loading: loading })), filters?.options && filters?.options?.length > 1 && (_jsx(MultipleSelect, { placeholder: "Selectionnez une ou plusieurs options", label: "Options", options: filters.options, values: selectedOptions, onChange: updateFilter("options"), loading: loading })), filters?.districts && filters?.districts?.length > 1 && (_jsx(MultipleSelect, { placeholder: "Selectionnez une ou plusieurs options", label: "Quartiers", options: filters.districts, values: selectedDistricts, onChange: updateFilter("districts"), loading: loading }))] }))] }));
|
|
174
174
|
}
|
|
175
175
|
function getDefaultData(preset) {
|
|
176
176
|
if (!preset?.presets && !preset?.options)
|
|
@@ -45,7 +45,7 @@ export default function SkiPasses({ preset, setPreset, stay, setShowPresetDialog
|
|
|
45
45
|
const { tags } = domain;
|
|
46
46
|
if (!tags?.length)
|
|
47
47
|
return acc;
|
|
48
|
-
const
|
|
48
|
+
const formattedTags = tags
|
|
49
49
|
.filter((tag) => {
|
|
50
50
|
return (Object.keys(ACTIVITIES_LABELS).includes(tag) &&
|
|
51
51
|
!acc.some((item) => item.value === tag));
|
|
@@ -53,7 +53,7 @@ export default function SkiPasses({ preset, setPreset, stay, setShowPresetDialog
|
|
|
53
53
|
.map((tag) => {
|
|
54
54
|
return { value: tag, label: ACTIVITIES_LABELS[tag] || tag };
|
|
55
55
|
});
|
|
56
|
-
return [...acc, ...
|
|
56
|
+
return [...acc, ...formattedTags];
|
|
57
57
|
}, [])),
|
|
58
58
|
]
|
|
59
59
|
: []);
|
|
@@ -11,7 +11,7 @@ export default function StandardProducts({ preset, setPreset, facet, setShowPres
|
|
|
11
11
|
const [loading, setLoading] = React.useState(false);
|
|
12
12
|
const [productCategories, setProductCategories] = React.useState([]);
|
|
13
13
|
const [selectedProductCategory, setSelectedProductCategory] = React.useState(getDefaultData(preset));
|
|
14
|
-
const
|
|
14
|
+
const formattedCategories = productCategories.map(({ name, slug }) => {
|
|
15
15
|
return { label: name, value: slug };
|
|
16
16
|
});
|
|
17
17
|
const { merchant } = preset?.options || {};
|
|
@@ -55,7 +55,7 @@ export default function StandardProducts({ preset, setPreset, facet, setShowPres
|
|
|
55
55
|
testPreset,
|
|
56
56
|
cancelPreset,
|
|
57
57
|
confirmPreset: selectedProductCategory ? confirmPreset : undefined,
|
|
58
|
-
}, children: _jsx(Select, { label: "Cat\u00E9gorie de produit", placeholder: "S\u00E9lectionnez une cat\u00E9gorie", options:
|
|
58
|
+
}, children: _jsx(Select, { label: "Cat\u00E9gorie de produit", placeholder: "S\u00E9lectionnez une cat\u00E9gorie", options: formattedCategories, value: selectedProductCategory, onValueChange: setSelectedProductCategory, disabled: loading }) }));
|
|
59
59
|
}
|
|
60
60
|
function getDefaultData(preset) {
|
|
61
61
|
if (!preset?.presets)
|
|
@@ -50,11 +50,11 @@ export default function Vakario({ preset, setPreset, setShowPresetDialog, onChan
|
|
|
50
50
|
try {
|
|
51
51
|
setLoading(true);
|
|
52
52
|
const kinds = await API.getVakarioKinds(channel, merchant);
|
|
53
|
-
const
|
|
53
|
+
const formattedKinds = kinds.map(({ code, name }) => ({
|
|
54
54
|
label: name,
|
|
55
55
|
value: code,
|
|
56
56
|
}));
|
|
57
|
-
setKindCodes(
|
|
57
|
+
setKindCodes(formattedKinds);
|
|
58
58
|
setData((data) => ({
|
|
59
59
|
...data,
|
|
60
60
|
ageCodes: "",
|
|
@@ -77,11 +77,11 @@ export default function Vakario({ preset, setPreset, setShowPresetDialog, onChan
|
|
|
77
77
|
try {
|
|
78
78
|
setLoading(true);
|
|
79
79
|
const ages = await API.getVakarioAges(channel, merchant, data.kindCodes);
|
|
80
|
-
const
|
|
80
|
+
const formattedAges = ages.map(({ code, name }) => ({
|
|
81
81
|
label: name,
|
|
82
82
|
value: code,
|
|
83
83
|
}));
|
|
84
|
-
setAgeCodes(
|
|
84
|
+
setAgeCodes(formattedAges);
|
|
85
85
|
setData((data) => ({ ...data, categoryCodes: "", levelCodes: "" }));
|
|
86
86
|
}
|
|
87
87
|
catch (e) {
|
|
@@ -100,11 +100,11 @@ export default function Vakario({ preset, setPreset, setShowPresetDialog, onChan
|
|
|
100
100
|
try {
|
|
101
101
|
setLoading(true);
|
|
102
102
|
const categories = await API.getVakarioCategories(channel, merchant, data.kindCodes, data.ageCodes);
|
|
103
|
-
const
|
|
103
|
+
const formattedCategories = categories.map(({ code, name }) => ({
|
|
104
104
|
label: name,
|
|
105
105
|
value: code,
|
|
106
106
|
}));
|
|
107
|
-
setCategoryCodes(
|
|
107
|
+
setCategoryCodes(formattedCategories);
|
|
108
108
|
setData((data) => ({ ...data, levelCodes: "" }));
|
|
109
109
|
}
|
|
110
110
|
catch (e) {
|
|
@@ -123,11 +123,11 @@ export default function Vakario({ preset, setPreset, setShowPresetDialog, onChan
|
|
|
123
123
|
try {
|
|
124
124
|
setLoading(true);
|
|
125
125
|
const levels = await API.getVakarioLevels(channel, merchant, data.kindCodes, data.ageCodes, data.categoryCodes);
|
|
126
|
-
const
|
|
126
|
+
const formattedLevels = levels.map(({ code, name }) => ({
|
|
127
127
|
label: name,
|
|
128
128
|
value: code,
|
|
129
129
|
}));
|
|
130
|
-
setLevelCodes(
|
|
130
|
+
setLevelCodes(formattedLevels);
|
|
131
131
|
}
|
|
132
132
|
catch (e) {
|
|
133
133
|
console.error(e);
|
|
@@ -44,10 +44,10 @@ export default function MseMPresetEditor({ lang, options, urls, selectedPreset,
|
|
|
44
44
|
return;
|
|
45
45
|
}
|
|
46
46
|
if (subPreset) {
|
|
47
|
-
const
|
|
47
|
+
const formattedSubPreset = Preset.format(subPreset);
|
|
48
48
|
name = subPreset.name;
|
|
49
|
-
itemOptions =
|
|
50
|
-
itemPresets =
|
|
49
|
+
itemOptions = formattedSubPreset.options;
|
|
50
|
+
itemPresets = formattedSubPreset.presets;
|
|
51
51
|
}
|
|
52
52
|
if (stay?.from && stay?.to) {
|
|
53
53
|
itemPresets = { ...itemPresets, stay };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as API from "./api";
|
|
2
2
|
export async function get(lang, channel, resort, facet) {
|
|
3
3
|
const offers = (await API.getOffers(lang, channel, resort, facet));
|
|
4
|
-
const
|
|
4
|
+
const formattedOffers = await Promise.all(offers.map(async (offer) => {
|
|
5
5
|
const { widget, category, kind, options, preset } = offer;
|
|
6
6
|
const isSkiSchool = kind === "SKISCHOOL";
|
|
7
7
|
const hasCategoryGroup = !!options?.categoryGroup || isSkiSchool;
|
|
@@ -31,7 +31,7 @@ export async function get(lang, channel, resort, facet) {
|
|
|
31
31
|
}
|
|
32
32
|
return offer;
|
|
33
33
|
}));
|
|
34
|
-
return
|
|
34
|
+
return formattedOffers;
|
|
35
35
|
}
|
|
36
36
|
function mergeSkiPasses(offer) {
|
|
37
37
|
const { items = [], ...rest } = offer;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import Select from "dt-design-system/es/select";
|
|
3
3
|
export default function ResortSelector({ resorts, resort, setResort }) {
|
|
4
|
-
const
|
|
4
|
+
const formattedResorts = resorts.map((resort) => ({
|
|
5
5
|
label: resort.label,
|
|
6
6
|
value: String(resort.resort),
|
|
7
7
|
}));
|
|
8
8
|
return (_jsx(Select, { value: resort, onValueChange: setResort, label: "Destination", options: [
|
|
9
9
|
{ label: "Sélectionnez une destination pour continuer", value: "" },
|
|
10
|
-
...
|
|
10
|
+
...formattedResorts,
|
|
11
11
|
] }));
|
|
12
12
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"callback.d.ts","sourceRoot":"","sources":["../../../../../src/common/components/plausible/services/callback.ts"],"names":[],"mappings":"AAEA,KAAK,IAAI,GAAG;IACV,OAAO,EAAE;QACP,SAAS,EAAE,MAAM,CAAC;QAClB,UAAU,EAAE,MAAM,CAAC;QACnB,aAAa,EAAE,MAAM,CAAC;QACtB,cAAc,EAAE,MAAM,CAAC;QACvB,cAAc,EAAE,MAAM,CAAC;QACvB,YAAY,EAAE,MAAM,CAAC;QACrB,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC;CACH,CAAC;AAEF,KAAK,KAAK,GAAG;IACX,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAkBF,wBAAgB,IAAI,CAAC,EACnB,KAAK,EACL,YAAY,EAAE,WAAW,EACzB,QAAQ,EACR,KAAU,EACV,OAAO,EACP,MAAM,EACN,QAAgB,GACjB,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"callback.d.ts","sourceRoot":"","sources":["../../../../../src/common/components/plausible/services/callback.ts"],"names":[],"mappings":"AAEA,KAAK,IAAI,GAAG;IACV,OAAO,EAAE;QACP,SAAS,EAAE,MAAM,CAAC;QAClB,UAAU,EAAE,MAAM,CAAC;QACnB,aAAa,EAAE,MAAM,CAAC;QACtB,cAAc,EAAE,MAAM,CAAC;QACvB,cAAc,EAAE,MAAM,CAAC;QACvB,YAAY,EAAE,MAAM,CAAC;QACrB,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC;CACH,CAAC;AAEF,KAAK,KAAK,GAAG;IACX,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAkBF,wBAAgB,IAAI,CAAC,EACnB,KAAK,EACL,YAAY,EAAE,WAAW,EACzB,QAAQ,EACR,KAAU,EACV,OAAO,EACP,MAAM,EACN,QAAgB,GACjB,EAAE,KAAK,QA6HP"}
|
|
@@ -26,33 +26,49 @@ export function MseM({ event, payment_type: paymentType, execcode, items = [], o
|
|
|
26
26
|
};
|
|
27
27
|
switch (event) {
|
|
28
28
|
case "view_item": {
|
|
29
|
-
const
|
|
30
|
-
const rawData = JSON.stringify({
|
|
29
|
+
const formattedItems = formatPeekPerformancesItem(items);
|
|
30
|
+
const rawData = JSON.stringify({
|
|
31
|
+
products: formattedItems,
|
|
32
|
+
hoteId,
|
|
33
|
+
stay,
|
|
34
|
+
});
|
|
31
35
|
sendGoal(name, { ...firstProductProps, stayFrom: stay?.from, rawData });
|
|
32
36
|
break;
|
|
33
37
|
}
|
|
34
38
|
case "add_to_cart": {
|
|
35
|
-
const
|
|
36
|
-
const rawData = JSON.stringify({
|
|
39
|
+
const formattedItems = formatPeekPerformancesItem(items);
|
|
40
|
+
const rawData = JSON.stringify({
|
|
41
|
+
products: formattedItems,
|
|
42
|
+
hoteId,
|
|
43
|
+
stay,
|
|
44
|
+
});
|
|
37
45
|
sendGoal(name, { ...firstProductProps, stayFrom: stay?.from, rawData }, revenue);
|
|
38
46
|
break;
|
|
39
47
|
}
|
|
40
48
|
case "remove_from_cart": {
|
|
41
|
-
const
|
|
42
|
-
const rawData = JSON.stringify({
|
|
49
|
+
const formattedItems = formatPeekPerformancesItem(items);
|
|
50
|
+
const rawData = JSON.stringify({
|
|
51
|
+
products: formattedItems,
|
|
52
|
+
hoteId,
|
|
53
|
+
stay,
|
|
54
|
+
});
|
|
43
55
|
sendGoal(name, { ...firstProductProps, stayFrom: stay?.from, rawData }, revenue);
|
|
44
56
|
break;
|
|
45
57
|
}
|
|
46
58
|
case "checkout": {
|
|
47
|
-
const
|
|
48
|
-
const rawData = JSON.stringify({
|
|
59
|
+
const formattedItems = formatPeekPerformancesItem(items);
|
|
60
|
+
const rawData = JSON.stringify({
|
|
61
|
+
products: formattedItems,
|
|
62
|
+
hoteId,
|
|
63
|
+
stay,
|
|
64
|
+
});
|
|
49
65
|
sendGoal(name, { cartId, stayFrom: stay?.from, rawData }, revenue);
|
|
50
66
|
break;
|
|
51
67
|
}
|
|
52
68
|
case "add_payment_info": {
|
|
53
|
-
const
|
|
69
|
+
const formattedItems = formatPeekPerformancesItem(items);
|
|
54
70
|
const rawData = JSON.stringify({
|
|
55
|
-
products:
|
|
71
|
+
products: formattedItems,
|
|
56
72
|
hoteId,
|
|
57
73
|
stay,
|
|
58
74
|
paymentMethod: paymentType,
|
|
@@ -62,10 +78,10 @@ export function MseM({ event, payment_type: paymentType, execcode, items = [], o
|
|
|
62
78
|
}
|
|
63
79
|
case "purchase": {
|
|
64
80
|
const isFailure = execcode !== "0000";
|
|
65
|
-
const
|
|
81
|
+
const formattedItems = formatPeekPerformancesItem(items);
|
|
66
82
|
const attempts = (cartId && getPurchaseAttempts()[cartId]) || 0;
|
|
67
83
|
const rawData = JSON.stringify({
|
|
68
|
-
products:
|
|
84
|
+
products: formattedItems,
|
|
69
85
|
hoteId,
|
|
70
86
|
stay,
|
|
71
87
|
attempts,
|
|
@@ -122,8 +138,9 @@ function getBusinessProvider() {
|
|
|
122
138
|
const businessProvider = window.localStorage.getItem("businessProvider");
|
|
123
139
|
if (businessProvider) {
|
|
124
140
|
try {
|
|
125
|
-
const { id } = JSON.parse(businessProvider);
|
|
126
|
-
|
|
141
|
+
const { id, exp } = JSON.parse(businessProvider);
|
|
142
|
+
const isExpired = exp < Date.now();
|
|
143
|
+
if (!isExpired && id !== -1) {
|
|
127
144
|
return id;
|
|
128
145
|
}
|
|
129
146
|
}
|
|
@@ -22,11 +22,11 @@ const useInjectedCmsMarkup = (entries, isReady) => {
|
|
|
22
22
|
if (!target?.markup)
|
|
23
23
|
return;
|
|
24
24
|
if (isArray) {
|
|
25
|
-
const
|
|
25
|
+
const formattedRows = value.map((v) => {
|
|
26
26
|
return { name: v, markup: `<tr><td>${v}</td></tr>` };
|
|
27
27
|
});
|
|
28
28
|
const [anchor] = target.markup;
|
|
29
|
-
target.markup = anchor ? [anchor, ...
|
|
29
|
+
target.markup = anchor ? [anchor, ...formattedRows] : formattedRows;
|
|
30
30
|
}
|
|
31
31
|
else {
|
|
32
32
|
target.markup = value;
|
|
@@ -24,12 +24,12 @@ const getOptions = (lang, options) => {
|
|
|
24
24
|
value: "",
|
|
25
25
|
disabled: true,
|
|
26
26
|
};
|
|
27
|
-
const
|
|
27
|
+
const formattedOptions = options[lang].map((option) => {
|
|
28
28
|
const isTitle = option.startsWith("--");
|
|
29
29
|
const label = isTitle ? option.replace("--", "") : option;
|
|
30
30
|
return { label, value: option, disabled: isTitle };
|
|
31
31
|
});
|
|
32
|
-
return [emptyOption, ...
|
|
32
|
+
return [emptyOption, ...formattedOptions];
|
|
33
33
|
};
|
|
34
34
|
const Field = ({ lang, index, name, field, data, setData }) => {
|
|
35
35
|
const { type, icon, label, options, required, placeholder, fullWidth, hidden, } = field;
|
|
@@ -8,19 +8,19 @@ import { message } from "./messages";
|
|
|
8
8
|
export default function Filters({ context, search, activity, language, updateFilter, loading, }) {
|
|
9
9
|
const { lang } = useUbloContext();
|
|
10
10
|
const { disciplines: activities, langues: languages } = context;
|
|
11
|
-
const
|
|
11
|
+
const formattedActivities = [
|
|
12
12
|
"",
|
|
13
13
|
...activities.map(({ code, label }) => ({
|
|
14
14
|
label,
|
|
15
15
|
value: code,
|
|
16
16
|
})),
|
|
17
17
|
];
|
|
18
|
-
const
|
|
18
|
+
const formattedLanguages = [
|
|
19
19
|
"",
|
|
20
20
|
...languages.map(({ code, label }) => ({
|
|
21
21
|
label,
|
|
22
22
|
value: code,
|
|
23
23
|
})),
|
|
24
24
|
];
|
|
25
|
-
return (_jsxs("div", { className: css.container, children: [_jsx(Input, { icon: "Search", label: message(lang, "search-label"), placeholder: message(lang, "search-placeholder"), value: search, onValueChange: updateFilter("search") }), _jsx(Select, { icon: "Filter", label: message(lang, "activity-label"), value: activity, options:
|
|
25
|
+
return (_jsxs("div", { className: css.container, children: [_jsx(Input, { icon: "Search", label: message(lang, "search-label"), placeholder: message(lang, "search-placeholder"), value: search, onValueChange: updateFilter("search") }), _jsx(Select, { icon: "Filter", label: message(lang, "activity-label"), value: activity, options: formattedActivities, onValueChange: updateFilter("activity"), loading: loading }), _jsx(Select, { icon: "Globe", label: message(lang, "language-label"), value: language, options: formattedLanguages, onValueChange: updateFilter("language"), loading: loading })] }));
|
|
26
26
|
}
|
|
@@ -63,7 +63,7 @@ const renderField = (lang, label, classes, name, field, data, setData) => {
|
|
|
63
63
|
newData[name].validator = isValid;
|
|
64
64
|
}
|
|
65
65
|
};
|
|
66
|
-
const
|
|
66
|
+
const formattedOptions = type === "select"
|
|
67
67
|
? [{ label: Messages.get(lang, "select"), value: "" }].concat(optionsToDisplay.map((option) => {
|
|
68
68
|
return {
|
|
69
69
|
label: option.label?.[lang],
|
|
@@ -71,7 +71,7 @@ const renderField = (lang, label, classes, name, field, data, setData) => {
|
|
|
71
71
|
};
|
|
72
72
|
}))
|
|
73
73
|
: undefined;
|
|
74
|
-
return _jsx(Tag, { onValueChange: onChange, options:
|
|
74
|
+
return _jsx(Tag, { onValueChange: onChange, options: formattedOptions, ...props });
|
|
75
75
|
};
|
|
76
76
|
const Field = ({ lang, name, field, data, setData }) => {
|
|
77
77
|
const { label, required, hidden } = field;
|
|
@@ -15,15 +15,15 @@ export const getData = (product, selectors, levels, handleVariants, convertTable
|
|
|
15
15
|
? classList.reduce((acc, className) => Object.keys(levels).includes(className) ? className : acc, null)
|
|
16
16
|
: undefined;
|
|
17
17
|
const selectedOption = getSelectedOption(product, options, convertTableToSelect);
|
|
18
|
-
const
|
|
18
|
+
const formattedTitle = title
|
|
19
19
|
?.map((element) => element.textContent)
|
|
20
20
|
.join(" - ");
|
|
21
|
-
const
|
|
21
|
+
const formattedPrice = price
|
|
22
22
|
? parseInt(price.textContent.replace(/€/g, "").trim())
|
|
23
23
|
: 0;
|
|
24
24
|
return {
|
|
25
|
-
title:
|
|
26
|
-
price:
|
|
25
|
+
title: formattedTitle || "",
|
|
26
|
+
price: formattedPrice,
|
|
27
27
|
details: details?.innerText || "",
|
|
28
28
|
selectedOption,
|
|
29
29
|
productCategory,
|
|
@@ -11,11 +11,11 @@ const Filter = ({ code, filter, values, setValues }) => {
|
|
|
11
11
|
const newValues = { ...values, [code]: value };
|
|
12
12
|
setValues(newValues);
|
|
13
13
|
};
|
|
14
|
-
const
|
|
14
|
+
const formattedValues = filter.map(({ libelle, value }) => ({
|
|
15
15
|
label: libelle,
|
|
16
16
|
value,
|
|
17
17
|
}));
|
|
18
|
-
const options = values.length === 1 ?
|
|
18
|
+
const options = values.length === 1 ? formattedValues : [""].concat(formattedValues);
|
|
19
19
|
const classes = classNames(css.filter, css[code]);
|
|
20
20
|
return (_jsxs("div", { className: classes, children: [_jsx("div", { className: css.filterLabel, children: message(lang, code) }), _jsx(Select, { options: options, value: values[code], onValueChange: updateFilter })] }));
|
|
21
21
|
};
|
|
@@ -75,11 +75,11 @@ function MagicBox({ stay, cartUrl, channel = "ESF", className, alignContent, max
|
|
|
75
75
|
const filterWithoutRestricted = filter.filter((item) => !item.restricted);
|
|
76
76
|
return { ...acc, [key]: filterWithoutRestricted };
|
|
77
77
|
}, {});
|
|
78
|
-
const
|
|
78
|
+
const formattedCategories = categoryList?.map(({ code, label }) => {
|
|
79
79
|
return { value: code, libelle: label };
|
|
80
80
|
});
|
|
81
81
|
const allFilters = categories
|
|
82
|
-
? { ...newFilters, categories:
|
|
82
|
+
? { ...newFilters, categories: formattedCategories }
|
|
83
83
|
: newFilters;
|
|
84
84
|
setFilters(allFilters);
|
|
85
85
|
}
|
|
@@ -35,6 +35,6 @@ export default function DateDisplay({ className }) {
|
|
|
35
35
|
}, [getStoredStay, metadata?.disableWeekpicker, updateStay]);
|
|
36
36
|
if (!extend || !stay || metadata?.disableWeekpicker)
|
|
37
37
|
return null;
|
|
38
|
-
const
|
|
39
|
-
return (_jsxs("div", { className: classes, children: [Messages.get(lang, "offers"), " ", _jsx("span", { className: css.dates, children:
|
|
38
|
+
const formattedStay = Stay.formatStay(lang, stay);
|
|
39
|
+
return (_jsxs("div", { className: classes, children: [Messages.get(lang, "offers"), " ", _jsx("span", { className: css.dates, children: formattedStay.split(" ").map((word, index) => (_jsx(motion.span, { className: css.word, transition: { delayChildren: index * 0.05, staggerChildren: 0.05 }, initial: "hidden", animate: "visible", children: word.split("").map((letter, index) => (_jsx(motion.span, { className: css.letter, variants: Motions.character, children: letter }, `${letter}-${index}`))) }, `${word}-${index}`))) })] }));
|
|
40
40
|
}
|
|
@@ -55,7 +55,7 @@ function Day({ lang, index, day, fullStay, firstSelected, updateSelection }) {
|
|
|
55
55
|
const currMonth = day.getMonth();
|
|
56
56
|
const hasMonthChanged = prevMonth !== currMonth;
|
|
57
57
|
const showMonth = index === 0 || hasMonthChanged;
|
|
58
|
-
const
|
|
58
|
+
const formattedMonth = day.toLocaleString(locale, { month: "short" });
|
|
59
59
|
const classes = classNames(css.day, {
|
|
60
60
|
[css.firstSelected]: isFirstSelected,
|
|
61
61
|
[css.dayFirstInStay]: !firstSelected && isFirstDayOfStay,
|
|
@@ -63,5 +63,5 @@ function Day({ lang, index, day, fullStay, firstSelected, updateSelection }) {
|
|
|
63
63
|
[css.dayBoundary]: !firstSelected && (isFirstDayOfStay || isLastDayOfStay),
|
|
64
64
|
[css.dayInStay]: !firstSelected && isInStay,
|
|
65
65
|
});
|
|
66
|
-
return (_jsxs("div", { className: classes, children: [_jsx("div", { className: css.weekday, children: dayLabel }), _jsx("div", { className: css.dayBottom, children: _jsx("button", { className: css.dayNumber, onClick: updateSelection(day), children: _jsx("span", { className: css.dayNumberText, children: dayNumber }) }) }), showMonth && _jsx("span", { className: css.month, children:
|
|
66
|
+
return (_jsxs("div", { className: classes, children: [_jsx("div", { className: css.weekday, children: dayLabel }), _jsx("div", { className: css.dayBottom, children: _jsx("button", { className: css.dayNumber, onClick: updateSelection(day), children: _jsx("span", { className: css.dayNumberText, children: dayNumber }) }) }), showMonth && _jsx("span", { className: css.month, children: formattedMonth })] }));
|
|
67
67
|
}
|
|
@@ -7,6 +7,6 @@ export default function Title({ lang, stay }) {
|
|
|
7
7
|
if (!stay) {
|
|
8
8
|
return (_jsx("div", { className: css.title, dangerouslySetInnerHTML: { __html: Messages.get(lang, "title") } }));
|
|
9
9
|
}
|
|
10
|
-
const
|
|
11
|
-
return (_jsxs("div", { className: css.title, children: [Messages.get(lang, "selected-title"), " ", _jsx("b", { children:
|
|
10
|
+
const formattedStay = Stay.formatStay(lang, stay);
|
|
11
|
+
return (_jsxs("div", { className: css.title, children: [Messages.get(lang, "selected-title"), " ", _jsx("b", { children: formattedStay })] }));
|
|
12
12
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"weeks.d.ts","sourceRoot":"","sources":["../../../../src/esf/components/period-picker/weeks.js"],"names":[],"mappings":";AAaA,+
|
|
1
|
+
{"version":3,"file":"weeks.d.ts","sourceRoot":"","sources":["../../../../src/esf/components/period-picker/weeks.js"],"names":[],"mappings":";AAaA,+EA6CG;uBA1DoB,OAAO"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import * as React from "react";
|
|
3
3
|
import classNames from "classnames";
|
|
4
4
|
import getConfig from "next/config";
|
|
@@ -9,7 +9,7 @@ import * as Dates from "./services/dates";
|
|
|
9
9
|
import * as Messages from "./messages";
|
|
10
10
|
import css from "./weeks.module.css";
|
|
11
11
|
const { publicRuntimeConfig } = getConfig();
|
|
12
|
-
const { periods } = publicRuntimeConfig.season;
|
|
12
|
+
const { periods } = publicRuntimeConfig.season || {};
|
|
13
13
|
const Weeks = React.forwardRef(({ weeks, lang, ...props }, ref) => {
|
|
14
14
|
React.useEffect(() => {
|
|
15
15
|
const bar = ref.current;
|
|
@@ -21,7 +21,10 @@ const Weeks = React.forwardRef(({ weeks, lang, ...props }, ref) => {
|
|
|
21
21
|
const { clientWidth, offsetLeft } = selectedItem;
|
|
22
22
|
bar.scrollLeft = offsetLeft - clientWidth * 1.5;
|
|
23
23
|
}, [props.selected, ref]);
|
|
24
|
-
|
|
24
|
+
const classes = classNames(css.weeks, {
|
|
25
|
+
[css.withPeriods]: periods,
|
|
26
|
+
});
|
|
27
|
+
return (_jsxs(LayoutGroup, { children: [_jsx("div", { ref: ref, className: classes, children: weeks.map((week) => (_jsx(Week, { lang: lang, week: week, ...props }, week))) }), periods && (_jsxs("div", { className: css.nomenclature, children: [periods.high?.length > 0 && (_jsxs("div", { className: css.period, "data-period": "high", children: [_jsx("div", { className: css.pill }), Messages.get(lang, "high-period")] })), periods.medium?.length > 0 && (_jsxs("div", { className: css.period, "data-period": "medium", children: [_jsx("div", { className: css.pill }), Messages.get(lang, "medium-period")] })), periods.low?.length > 0 && (_jsxs("div", { className: css.period, "data-period": "low", children: [_jsx("div", { className: css.pill }), Messages.get(lang, "low-period")] }))] }))] }));
|
|
25
28
|
});
|
|
26
29
|
Weeks.displayName = "Weeks";
|
|
27
30
|
export default Weeks;
|
|
@@ -45,7 +48,7 @@ function Week({ lang, week, beginWeek, endWeek, selected, select, forceSeasonSwi
|
|
|
45
48
|
const hasMonthChanged = prevMonth !== currMonth;
|
|
46
49
|
const showMonth = isFirst || hasMonthChanged;
|
|
47
50
|
const locale = Dates.locales[lang] || Dates.locales.en;
|
|
48
|
-
const
|
|
51
|
+
const formattedMonth = currDate.toLocaleString(locale, { month: "short" });
|
|
49
52
|
const weekClasses = classNames(css.item, {
|
|
50
53
|
[css.selected]: isSelected,
|
|
51
54
|
[css.past]: isPast,
|
|
@@ -63,5 +66,5 @@ function Week({ lang, week, beginWeek, endWeek, selected, select, forceSeasonSwi
|
|
|
63
66
|
}, 1200));
|
|
64
67
|
};
|
|
65
68
|
const layoutId = isPopup ? "current-popup" : "current";
|
|
66
|
-
return (_jsxs("div", { className: weekClasses, children: [
|
|
69
|
+
return (_jsxs("div", { className: weekClasses, children: [_jsx(Button, { className: css.button, onClick: selectWeek, "aria-label": `${Dates.weekToLongDate(week)} - ${Dates.weekToLongDate(week + 1)}`, disabled: isPast, children: !periods && (_jsxs(_Fragment, { children: [isSelected && (_jsx(motion.div, { layoutId: layoutId, className: css.buttonFiller })), checkVisible && _jsx(Icons.CheckCircle, { className: css.check })] })) }), _jsxs("div", { className: css.date, children: [_jsx("div", { className: css.dateFrom, children: Dates.formatShort(currDate) }), isLast && (_jsx("div", { className: css.dateTo, children: Dates.formatShort(nextDate) }))] }), showMonth && (_jsxs("span", { className: css.month, children: [formattedMonth, " ", showYear && _jsx("b", { className: css.year, children: currYear })] }))] }));
|
|
67
70
|
}
|
|
@@ -107,6 +107,12 @@
|
|
|
107
107
|
z-index: 1;
|
|
108
108
|
}
|
|
109
109
|
|
|
110
|
+
.weeks.withPeriods .selected {
|
|
111
|
+
outline: 2px solid var(--ds-primary, var(--ds-blue-500, #002dcc));
|
|
112
|
+
outline-offset: -1px;
|
|
113
|
+
border-radius: var(--ds-radius-100, 4px);
|
|
114
|
+
}
|
|
115
|
+
|
|
110
116
|
button.button {
|
|
111
117
|
position: relative;
|
|
112
118
|
width: 100%;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-affiliation.d.ts","sourceRoot":"","sources":["../../../src/esf/hooks/use-affiliation.js"],"names":[],"mappings":"AAMA,+
|
|
1
|
+
{"version":3,"file":"use-affiliation.d.ts","sourceRoot":"","sources":["../../../src/esf/hooks/use-affiliation.js"],"names":[],"mappings":"AAMA,+CAcC"}
|
|
@@ -7,8 +7,9 @@ export default function useAffiliation() {
|
|
|
7
7
|
const storedChecker = window.sessionStorage.getItem(CHECKER_STORAGE_KEY);
|
|
8
8
|
const storedBusinessProvider = window.localStorage.getItem(STORAGE_KEY);
|
|
9
9
|
if (!storedChecker && storedBusinessProvider) {
|
|
10
|
-
const { id } = JSON.parse(storedBusinessProvider);
|
|
11
|
-
|
|
10
|
+
const { id, exp } = JSON.parse(storedBusinessProvider);
|
|
11
|
+
const isExpired = exp < Date.now();
|
|
12
|
+
if (!isExpired && id !== -1) {
|
|
12
13
|
Plausible.sendGoal("Affiliation", { id });
|
|
13
14
|
window.sessionStorage.setItem(CHECKER_STORAGE_KEY, "true");
|
|
14
15
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"callback.d.ts","sourceRoot":"","sources":["../../../../../src/future/components/plausible/services/callback.ts"],"names":[],"mappings":"AAEA,KAAK,IAAI,GAAG;IACV,OAAO,EAAE;QACP,SAAS,EAAE,MAAM,CAAC;QAClB,UAAU,EAAE,MAAM,CAAC;QACnB,aAAa,EAAE,MAAM,CAAC;QACtB,cAAc,EAAE,MAAM,CAAC;QACvB,cAAc,EAAE,MAAM,CAAC;QACvB,YAAY,EAAE,MAAM,CAAC;QACrB,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC;CACH,CAAC;AAEF,KAAK,KAAK,GAAG;IACX,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAkBF,wBAAgB,IAAI,CAAC,EACnB,KAAK,EACL,YAAY,EAAE,WAAW,EACzB,QAAQ,EACR,KAAU,EACV,OAAO,EACP,MAAM,EACN,QAAgB,GACjB,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"callback.d.ts","sourceRoot":"","sources":["../../../../../src/future/components/plausible/services/callback.ts"],"names":[],"mappings":"AAEA,KAAK,IAAI,GAAG;IACV,OAAO,EAAE;QACP,SAAS,EAAE,MAAM,CAAC;QAClB,UAAU,EAAE,MAAM,CAAC;QACnB,aAAa,EAAE,MAAM,CAAC;QACtB,cAAc,EAAE,MAAM,CAAC;QACvB,cAAc,EAAE,MAAM,CAAC;QACvB,YAAY,EAAE,MAAM,CAAC;QACrB,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC;CACH,CAAC;AAEF,KAAK,KAAK,GAAG;IACX,KAAK,EAAE,MAAM,CAAC;IACd,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,IAAI,EAAE,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAkBF,wBAAgB,IAAI,CAAC,EACnB,KAAK,EACL,YAAY,EAAE,WAAW,EACzB,QAAQ,EACR,KAAU,EACV,OAAO,EACP,MAAM,EACN,QAAgB,GACjB,EAAE,KAAK,QA6HP"}
|
|
@@ -26,33 +26,49 @@ export function MseM({ event, payment_type: paymentType, execcode, items = [], o
|
|
|
26
26
|
};
|
|
27
27
|
switch (event) {
|
|
28
28
|
case "view_item": {
|
|
29
|
-
const
|
|
30
|
-
const rawData = JSON.stringify({
|
|
29
|
+
const formattedItems = formatPeekPerformancesItem(items);
|
|
30
|
+
const rawData = JSON.stringify({
|
|
31
|
+
products: formattedItems,
|
|
32
|
+
hoteId,
|
|
33
|
+
stay,
|
|
34
|
+
});
|
|
31
35
|
sendGoal(name, { ...firstProductProps, stayFrom: stay?.from, rawData });
|
|
32
36
|
break;
|
|
33
37
|
}
|
|
34
38
|
case "add_to_cart": {
|
|
35
|
-
const
|
|
36
|
-
const rawData = JSON.stringify({
|
|
39
|
+
const formattedItems = formatPeekPerformancesItem(items);
|
|
40
|
+
const rawData = JSON.stringify({
|
|
41
|
+
products: formattedItems,
|
|
42
|
+
hoteId,
|
|
43
|
+
stay,
|
|
44
|
+
});
|
|
37
45
|
sendGoal(name, { ...firstProductProps, stayFrom: stay?.from, rawData }, revenue);
|
|
38
46
|
break;
|
|
39
47
|
}
|
|
40
48
|
case "remove_from_cart": {
|
|
41
|
-
const
|
|
42
|
-
const rawData = JSON.stringify({
|
|
49
|
+
const formattedItems = formatPeekPerformancesItem(items);
|
|
50
|
+
const rawData = JSON.stringify({
|
|
51
|
+
products: formattedItems,
|
|
52
|
+
hoteId,
|
|
53
|
+
stay,
|
|
54
|
+
});
|
|
43
55
|
sendGoal(name, { ...firstProductProps, stayFrom: stay?.from, rawData }, revenue);
|
|
44
56
|
break;
|
|
45
57
|
}
|
|
46
58
|
case "checkout": {
|
|
47
|
-
const
|
|
48
|
-
const rawData = JSON.stringify({
|
|
59
|
+
const formattedItems = formatPeekPerformancesItem(items);
|
|
60
|
+
const rawData = JSON.stringify({
|
|
61
|
+
products: formattedItems,
|
|
62
|
+
hoteId,
|
|
63
|
+
stay,
|
|
64
|
+
});
|
|
49
65
|
sendGoal(name, { cartId, stayFrom: stay?.from, rawData }, revenue);
|
|
50
66
|
break;
|
|
51
67
|
}
|
|
52
68
|
case "add_payment_info": {
|
|
53
|
-
const
|
|
69
|
+
const formattedItems = formatPeekPerformancesItem(items);
|
|
54
70
|
const rawData = JSON.stringify({
|
|
55
|
-
products:
|
|
71
|
+
products: formattedItems,
|
|
56
72
|
hoteId,
|
|
57
73
|
stay,
|
|
58
74
|
paymentMethod: paymentType,
|
|
@@ -62,10 +78,10 @@ export function MseM({ event, payment_type: paymentType, execcode, items = [], o
|
|
|
62
78
|
}
|
|
63
79
|
case "purchase": {
|
|
64
80
|
const isFailure = execcode !== "0000";
|
|
65
|
-
const
|
|
81
|
+
const formattedItems = formatPeekPerformancesItem(items);
|
|
66
82
|
const attempts = (cartId && getPurchaseAttempts()[cartId]) || 0;
|
|
67
83
|
const rawData = JSON.stringify({
|
|
68
|
-
products:
|
|
84
|
+
products: formattedItems,
|
|
69
85
|
hoteId,
|
|
70
86
|
stay,
|
|
71
87
|
attempts,
|
|
@@ -122,8 +138,9 @@ function getBusinessProvider() {
|
|
|
122
138
|
const businessProvider = window.localStorage.getItem("businessProvider");
|
|
123
139
|
if (businessProvider) {
|
|
124
140
|
try {
|
|
125
|
-
const { id } = JSON.parse(businessProvider);
|
|
126
|
-
|
|
141
|
+
const { id, exp } = JSON.parse(businessProvider);
|
|
142
|
+
const isExpired = exp < Date.now();
|
|
143
|
+
if (!isExpired && id !== -1) {
|
|
127
144
|
return id;
|
|
128
145
|
}
|
|
129
146
|
}
|
|
@@ -40,7 +40,7 @@ export default function Days({ days, currentDayIndex, setCurrentDayIndex, lang,
|
|
|
40
40
|
const today = new Date(date).toLocaleDateString(locale, {
|
|
41
41
|
weekday: "long",
|
|
42
42
|
});
|
|
43
|
-
const
|
|
43
|
+
const formattedDate = new Date(date).toLocaleDateString(locale, {
|
|
44
44
|
day: "2-digit",
|
|
45
45
|
month: "2-digit",
|
|
46
46
|
year: "numeric",
|
|
@@ -48,6 +48,6 @@ export default function Days({ days, currentDayIndex, setCurrentDayIndex, lang,
|
|
|
48
48
|
const classes = classNames(css.day, {
|
|
49
49
|
[css.daySelected]: isSelected,
|
|
50
50
|
});
|
|
51
|
-
return (_jsxs(Button, { className: classes, onClick: updateCurrentDay, children: [_jsx("b", { children: isToday ? _jsx(T, { id: "weather.today" }) : today }),
|
|
51
|
+
return (_jsxs(Button, { className: classes, onClick: updateCurrentDay, children: [_jsx("b", { children: isToday ? _jsx(T, { id: "weather.today" }) : today }), formattedDate] }, date));
|
|
52
52
|
}) }) }));
|
|
53
53
|
}
|