@loczer/storefront-sdk 0.208.0 → 0.210.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/StorefrontContext.d.ts +89 -0
- package/dist/StorefrontContext.d.ts.map +1 -1
- package/dist/StorefrontContext.js +8 -1
- package/dist/StorefrontProvider.d.ts +84 -0
- package/dist/StorefrontProvider.d.ts.map +1 -1
- package/dist/StorefrontProvider.js +55 -41
- package/dist/chunks/pkg/booking-engine/dist/node_modules/@date-fns/tz/date/index-DAbcklF5.js +1 -0
- package/dist/chunks/pkg/booking-engine/dist/node_modules/@date-fns/tz/date/mini-CSEBo1ZP.js +60 -0
- package/dist/chunks/pkg/booking-engine/dist/node_modules/@date-fns/tz/index--u3Qf-qy.js +4 -0
- package/dist/chunks/pkg/booking-engine/dist/node_modules/@date-fns/tz/tz/index-CEcibV-H.js +1 -0
- package/dist/chunks/pkg/booking-engine/dist/node_modules/@date-fns/tz/tzOffset/index-COlDDdap.js +22 -0
- package/dist/chunks/pkg/booking-engine/dist/pricing-BJaynUu_.js +3 -0
- package/dist/chunks/pkg/booking-engine/dist/utils/schedule-ssRov9xe.js +39 -0
- package/dist/chunks/pkg/booking-engine/dist/utils/timezone-B6XIbBPz.js +79 -0
- package/dist/chunks/pkg/ui/dist/Map/{MapContent-CDeWtwKa.js → MapContent-TzYCv8ji.js} +109 -108
- package/dist/chunks/pkg/ui/dist/Map/constants-dF2KdJZy.js +8 -0
- package/dist/chunks/pkg/ui/dist/{Map-Cs7wgtH9.js → Map-ZM-ZOU9P.js} +1 -1
- package/dist/components/BookingBikeVariantDialog/index.js +15 -15
- package/dist/components/ContactSection/index.js +9 -9
- package/dist/components/Header/index.d.ts.map +1 -1
- package/dist/components/Header/index.js +72 -66
- package/dist/components/Itineraries/ItinerariesSection.d.ts +2 -0
- package/dist/components/Itineraries/ItinerariesSection.d.ts.map +1 -0
- package/dist/components/Itineraries/ItinerariesSection.js +81 -0
- package/dist/components/Itineraries/ItineraryListItem.d.ts +9 -0
- package/dist/components/Itineraries/ItineraryListItem.d.ts.map +1 -0
- package/dist/components/Itineraries/ItineraryListItem.js +100 -0
- package/dist/components/Itineraries/ItineraryRouteMap.d.ts +10 -0
- package/dist/components/Itineraries/ItineraryRouteMap.d.ts.map +1 -0
- package/dist/components/Itineraries/ItineraryRouteMap.js +67 -0
- package/dist/components/Itineraries/index.d.ts +4 -0
- package/dist/components/Itineraries/index.d.ts.map +1 -0
- package/dist/components/Itineraries/index.js +4 -0
- package/dist/components/Map/index.d.ts +12 -0
- package/dist/components/Map/index.d.ts.map +1 -1
- package/dist/components/Map/index.js +1 -1
- package/dist/components/ProductPriceBadge/index.d.ts.map +1 -1
- package/dist/components/ProductPriceBadge/index.js +86 -80
- package/dist/components/StorefrontCartPanel/index.d.ts +4 -4
- package/dist/components/StorefrontCartPanel/index.d.ts.map +1 -1
- package/dist/components/StorefrontCartPanel/index.js +10 -9
- package/dist/i18n/en.d.ts +42 -6
- package/dist/i18n/en.d.ts.map +1 -1
- package/dist/i18n/en.js +44 -8
- package/dist/i18n/fr.d.ts +42 -6
- package/dist/i18n/fr.d.ts.map +1 -1
- package/dist/i18n/fr.js +44 -8
- package/dist/index.d.ts +817 -36
- package/dist/index.js +67 -60
- package/dist/lib/booking.d.ts +0 -6
- package/dist/lib/booking.d.ts.map +1 -1
- package/dist/lib/booking.js +51 -65
- package/dist/lib/cartSummary.d.ts +5 -3
- package/dist/lib/cartSummary.d.ts.map +1 -1
- package/dist/lib/cartSummary.js +7 -7
- package/dist/lib/itineraryPresentation.d.ts +14 -0
- package/dist/lib/itineraryPresentation.d.ts.map +1 -0
- package/dist/lib/itineraryPresentation.js +26 -0
- package/dist/lib/pricing.d.ts +18 -6
- package/dist/lib/pricing.d.ts.map +1 -1
- package/dist/lib/pricing.js +45 -29
- package/dist/lib/storefrontItineraries.d.ts +418 -0
- package/dist/lib/storefrontItineraries.d.ts.map +1 -0
- package/dist/lib/storefrontItineraries.js +81 -0
- package/dist/pages/BookingPage.d.ts.map +1 -1
- package/dist/pages/BookingPage.js +205 -201
- package/dist/pages/CheckoutPage.d.ts.map +1 -1
- package/dist/pages/CheckoutPage.js +276 -273
- package/dist/pages/HomePage.d.ts.map +1 -1
- package/dist/pages/HomePage.js +111 -108
- package/dist/pages/ItinerariesPage.d.ts +2 -0
- package/dist/pages/ItinerariesPage.d.ts.map +1 -0
- package/dist/pages/ItinerariesPage.js +76 -0
- package/dist/pages/ItineraryDetailsPage.d.ts +66 -0
- package/dist/pages/ItineraryDetailsPage.d.ts.map +1 -0
- package/dist/pages/ItineraryDetailsPage.js +223 -0
- package/dist/pages/ProductPage.js +6 -6
- package/dist/pages/checkout/components/CheckoutSummaryColumn.d.ts +2 -2
- package/dist/pages/checkout/components/CheckoutSummaryColumn.d.ts.map +1 -1
- package/dist/pages/checkout/components/CheckoutSummaryColumn.js +4 -4
- package/dist/pages/itineraries/ElevationProfile.d.ts +5 -0
- package/dist/pages/itineraries/ElevationProfile.d.ts.map +1 -0
- package/dist/pages/itineraries/ElevationProfile.js +59 -0
- package/dist/routes.d.ts.map +1 -1
- package/dist/routes.js +18 -10
- package/dist/storefront.css +1 -1
- package/package.json +1 -1
- package/dist/chunks/pkg/ui/dist/Map/constants-BNmiJXfg.js +0 -4
|
@@ -1,133 +1,133 @@
|
|
|
1
1
|
import { __toESM as e } from "../../../../_virtual/_rolldown/runtime-CkxIErRK.js";
|
|
2
2
|
import { cn as t } from "../lib/utils-DXB19bzk.js";
|
|
3
|
-
import {
|
|
4
|
-
import { DEFAULT_MAP_CENTER as
|
|
5
|
-
import { classifyMapboxError as
|
|
6
|
-
import { Component as
|
|
7
|
-
import { jsx as
|
|
3
|
+
import { DEFAULT_MAP_ROUTE_COLOR as n, DEFAULT_MAP_SKELETON_COLOR as r, createMapRoutePaint as i } from "./constants-dF2KdJZy.js";
|
|
4
|
+
import { DEFAULT_MAP_CENTER as a } from "../static/strings-1T2w7LqX.js";
|
|
5
|
+
import { classifyMapboxError as o, toSanitizedMapboxError as s } from "./mapboxError-oRn0l3EE.js";
|
|
6
|
+
import { Component as c, useEffect as l, useRef as u, useState as d } from "react";
|
|
7
|
+
import { jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
8
8
|
//#region ../ui/dist/Map/MapContent.js
|
|
9
|
-
var
|
|
10
|
-
throw
|
|
11
|
-
}),
|
|
12
|
-
let
|
|
13
|
-
return
|
|
14
|
-
if (!
|
|
15
|
-
let t = !1, n = null, r = 0,
|
|
9
|
+
var m = 2, h = 750, g = null, _ = async () => (g ||= Promise.all([import("../../../../node_modules/mapbox-gl/dist/mapbox-gl-C3ih7CyM.js").then((t) => /* @__PURE__ */ e(t.default, 1)), Promise.resolve({ })]).then(([e]) => e.default ?? e).catch((e) => {
|
|
10
|
+
throw g = null, e;
|
|
11
|
+
}), g), v = ({ mapboxToken: e, initialCenter: c = a, initialZoom: g = 11, markers: v = [], routeGeoJson: y, routeColor: x = n, routeWidth: S = 5, polygonGeoJson: C, routeEndpointsToFetch: w, className: T, style: E, interactive: D = !0, showNavigationControl: O = !0, cooperativeGestures: k = !0, mapStyle: A = "mapbox://styles/pr37capital/cmajla29i003901s9ex09hiw4", onMapLoad: j, onMapMoveOrZoom: M, skeletonColor: N = r }) => {
|
|
12
|
+
let P = u(null), F = u(null), [I, L] = d(null), R = u([]), z = u(g), [B, V] = d(null), [H, U] = d(!1), W = u(!1), G = t("relative overflow-clip w-full h-full", T);
|
|
13
|
+
return l(() => {
|
|
14
|
+
if (!P.current || I) return;
|
|
15
|
+
let t = !1, n = null, r = 0, i = null, a = !1;
|
|
16
16
|
return (async () => {
|
|
17
17
|
if (!e) {
|
|
18
|
-
|
|
18
|
+
V("Configuration carte manquante (token).");
|
|
19
19
|
return;
|
|
20
20
|
}
|
|
21
21
|
try {
|
|
22
|
-
let n = await
|
|
22
|
+
let n = await _();
|
|
23
23
|
if (t) return;
|
|
24
|
-
if (
|
|
25
|
-
|
|
24
|
+
if (F.current = n, n.accessToken = e, !(typeof n.supported != "function" || n.supported({ failIfMajorPerformanceCaveat: !0 }))) {
|
|
25
|
+
V("La carte n'est pas supportée sur cet appareil.");
|
|
26
26
|
return;
|
|
27
27
|
}
|
|
28
28
|
} catch (e) {
|
|
29
|
-
t || (console.error("Failed to load Mapbox GL:", e),
|
|
29
|
+
t || (console.error("Failed to load Mapbox GL:", e), V("La carte n'est pas supportée sur cet appareil."));
|
|
30
30
|
return;
|
|
31
31
|
}
|
|
32
|
-
if (t || !
|
|
33
|
-
|
|
32
|
+
if (t || !F.current || !P.current) return;
|
|
33
|
+
P.current.hasChildNodes() && P.current.replaceChildren();
|
|
34
34
|
try {
|
|
35
|
-
n = new
|
|
36
|
-
container:
|
|
37
|
-
style:
|
|
38
|
-
center:
|
|
39
|
-
zoom:
|
|
35
|
+
n = new F.current.Map({
|
|
36
|
+
container: P.current,
|
|
37
|
+
style: A,
|
|
38
|
+
center: c,
|
|
39
|
+
zoom: g,
|
|
40
40
|
attributionControl: !1,
|
|
41
|
-
interactive:
|
|
42
|
-
cooperativeGestures:
|
|
41
|
+
interactive: D,
|
|
42
|
+
cooperativeGestures: k,
|
|
43
43
|
pitchWithRotate: !1,
|
|
44
44
|
dragRotate: !1,
|
|
45
45
|
touchPitch: !1,
|
|
46
46
|
performanceMetricsCollection: !1
|
|
47
47
|
});
|
|
48
48
|
} catch (e) {
|
|
49
|
-
console.error("Failed to initialize Mapbox map:", e),
|
|
49
|
+
console.error("Failed to initialize Mapbox map:", e), V("Erreur lors du chargement de la carte.");
|
|
50
50
|
return;
|
|
51
51
|
}
|
|
52
52
|
let l = n, u = () => {
|
|
53
|
-
|
|
53
|
+
i !== null && (window.clearTimeout(i), i = null);
|
|
54
54
|
}, d = (e) => {
|
|
55
|
-
if (!(t ||
|
|
56
|
-
|
|
55
|
+
if (!(t || a)) {
|
|
56
|
+
a = !0, u(), console.error("Fatal Mapbox map error:", e);
|
|
57
57
|
try {
|
|
58
58
|
l.remove();
|
|
59
59
|
} catch (e) {
|
|
60
60
|
console.warn("Failed to remove unusable Mapbox map instance:", e);
|
|
61
61
|
}
|
|
62
|
-
n = null,
|
|
62
|
+
n = null, L(null), V("Erreur lors du chargement de la carte.");
|
|
63
63
|
}
|
|
64
64
|
};
|
|
65
65
|
if (l.on("error", (e) => {
|
|
66
|
-
if (t ||
|
|
67
|
-
let n =
|
|
66
|
+
if (t || a) return;
|
|
67
|
+
let n = o(e), c = s(e);
|
|
68
68
|
if (n === "recoverable") {
|
|
69
|
-
console.warn("Recoverable Mapbox resource error; keeping the map mounted:",
|
|
69
|
+
console.warn("Recoverable Mapbox resource error; keeping the map mounted:", c);
|
|
70
70
|
return;
|
|
71
71
|
}
|
|
72
72
|
if (n === "fatal") {
|
|
73
|
-
d(
|
|
73
|
+
d(c);
|
|
74
74
|
return;
|
|
75
75
|
}
|
|
76
|
-
if (
|
|
77
|
-
if (r >=
|
|
78
|
-
d(/* @__PURE__ */ Error(`Mapbox style failed after ${
|
|
76
|
+
if (i !== null) return;
|
|
77
|
+
if (r >= m) {
|
|
78
|
+
d(/* @__PURE__ */ Error(`Mapbox style failed after ${m} retries: ${c.message}`));
|
|
79
79
|
return;
|
|
80
80
|
}
|
|
81
81
|
r += 1;
|
|
82
|
-
let u =
|
|
83
|
-
console.warn(`Transient Mapbox style error; retrying in ${u}ms:`,
|
|
84
|
-
if (
|
|
85
|
-
l.setStyle(
|
|
82
|
+
let u = h * 2 ** (r - 1);
|
|
83
|
+
console.warn(`Transient Mapbox style error; retrying in ${u}ms:`, c), i = window.setTimeout(() => {
|
|
84
|
+
if (i = null, !(t || a)) try {
|
|
85
|
+
l.setStyle(A);
|
|
86
86
|
} catch (e) {
|
|
87
|
-
d(
|
|
87
|
+
d(s(e));
|
|
88
88
|
}
|
|
89
89
|
}, u);
|
|
90
90
|
}), l.on("style.load", () => {
|
|
91
91
|
r = 0, u();
|
|
92
|
-
}), l.touchZoomRotate?.disableRotation?.(),
|
|
93
|
-
let e = new
|
|
92
|
+
}), l.touchZoomRotate?.disableRotation?.(), O) {
|
|
93
|
+
let e = new b({ showCompass: !1 });
|
|
94
94
|
l.addControl(e, "bottom-right");
|
|
95
95
|
}
|
|
96
|
-
let
|
|
97
|
-
|
|
96
|
+
let f = () => {
|
|
97
|
+
W.current || (W.current = !0, U(!0));
|
|
98
98
|
};
|
|
99
99
|
l.on("load", () => {
|
|
100
|
-
t ||
|
|
100
|
+
t || a || (L(l), j && j(l), typeof l.areTilesLoaded == "function" && l.areTilesLoaded() ? f() : l.once("idle", f));
|
|
101
101
|
});
|
|
102
102
|
})(), () => {
|
|
103
|
-
t = !0,
|
|
103
|
+
t = !0, i !== null && window.clearTimeout(i);
|
|
104
104
|
try {
|
|
105
105
|
n?.remove();
|
|
106
106
|
} catch (e) {
|
|
107
107
|
console.error("Error removing map instance on unmount:", e);
|
|
108
108
|
}
|
|
109
109
|
};
|
|
110
|
-
}, []),
|
|
111
|
-
|
|
112
|
-
}, [
|
|
113
|
-
if (!
|
|
114
|
-
let e = () =>
|
|
115
|
-
return
|
|
116
|
-
|
|
110
|
+
}, []), l(() => {
|
|
111
|
+
I || (U(!1), W.current = !1);
|
|
112
|
+
}, [I]), l(() => {
|
|
113
|
+
if (!I || !M) return;
|
|
114
|
+
let e = () => M(I);
|
|
115
|
+
return I.on("moveend", e), I.on("zoomend", e), () => {
|
|
116
|
+
I.off("moveend", e), I.off("zoomend", e);
|
|
117
117
|
};
|
|
118
|
-
}, [
|
|
119
|
-
|
|
120
|
-
}, [
|
|
121
|
-
let e =
|
|
122
|
-
!
|
|
118
|
+
}, [I, M]), l(() => {
|
|
119
|
+
I && g !== z.current && (I.setZoom(g), z.current = g);
|
|
120
|
+
}, [g, I]), l(() => {
|
|
121
|
+
let e = F.current;
|
|
122
|
+
!I || !e || (R.current.forEach((e) => e.remove()), R.current = [], v.forEach((t) => {
|
|
123
123
|
let n = {};
|
|
124
124
|
t.element ? n.element = t.element : n.color = t.color || "#3FB1CE", t.offset && (n.offset = t.offset);
|
|
125
|
-
let r = new e.Marker(n).setLngLat(t.coords).addTo(
|
|
125
|
+
let r = new e.Marker(n).setLngLat(t.coords).addTo(I);
|
|
126
126
|
if (t.popupHTML) {
|
|
127
127
|
let n = { offset: 25 };
|
|
128
128
|
t.popupCloseButton === !1 && (n.closeButton = !1);
|
|
129
129
|
let i = new e.Popup(n).setHTML(t.popupHTML), a, o = () => {
|
|
130
|
-
clearTimeout(a), i.isOpen() || i.setLngLat(t.coords).addTo(
|
|
130
|
+
clearTimeout(a), i.isOpen() || i.setLngLat(t.coords).addTo(I);
|
|
131
131
|
}, s = () => {
|
|
132
132
|
a = setTimeout(() => {
|
|
133
133
|
i.remove();
|
|
@@ -138,15 +138,15 @@ var f = 2, p = 750, m = null, h = async () => (m ||= Promise.all([import("../../
|
|
|
138
138
|
e && (e.addEventListener("mouseenter", o), e.addEventListener("mouseleave", s));
|
|
139
139
|
});
|
|
140
140
|
}
|
|
141
|
-
|
|
141
|
+
R.current.push(r);
|
|
142
142
|
}));
|
|
143
|
-
}, [
|
|
144
|
-
if (!
|
|
143
|
+
}, [I, v]), l(() => {
|
|
144
|
+
if (!I || !I.isStyleLoaded()) return;
|
|
145
145
|
let e = "route-geojson-direct", t = "route-layer-direct";
|
|
146
|
-
|
|
146
|
+
I.getLayer(t) && I.removeLayer(t), I.getSource(e) && I.removeSource(e), y && (I.addSource(e, {
|
|
147
147
|
type: "geojson",
|
|
148
|
-
data:
|
|
149
|
-
}),
|
|
148
|
+
data: y
|
|
149
|
+
}), I.addLayer({
|
|
150
150
|
id: t,
|
|
151
151
|
type: "line",
|
|
152
152
|
source: e,
|
|
@@ -154,19 +154,20 @@ var f = 2, p = 750, m = null, h = async () => (m ||= Promise.all([import("../../
|
|
|
154
154
|
"line-join": "round",
|
|
155
155
|
"line-cap": "round"
|
|
156
156
|
},
|
|
157
|
-
paint:
|
|
158
|
-
"line-color": "#DB2777",
|
|
159
|
-
"line-width": 5,
|
|
160
|
-
"line-opacity": .75
|
|
161
|
-
}
|
|
157
|
+
paint: i(x, S)
|
|
162
158
|
}));
|
|
163
|
-
}, [
|
|
164
|
-
|
|
159
|
+
}, [
|
|
160
|
+
I,
|
|
161
|
+
x,
|
|
162
|
+
y,
|
|
163
|
+
S
|
|
164
|
+
]), l(() => {
|
|
165
|
+
if (!I || !I.isStyleLoaded()) return;
|
|
165
166
|
let e = "polygon-data", t = "polygon-fill-layer", n = "polygon-line-layer";
|
|
166
|
-
|
|
167
|
+
I.getLayer(t) && I.removeLayer(t), I.getLayer(n) && I.removeLayer(n), I.getSource(e) && I.removeSource(e), C && (I.addSource(e, {
|
|
167
168
|
type: "geojson",
|
|
168
|
-
data:
|
|
169
|
-
}),
|
|
169
|
+
data: C
|
|
170
|
+
}), I.addLayer({
|
|
170
171
|
id: t,
|
|
171
172
|
type: "fill",
|
|
172
173
|
source: e,
|
|
@@ -182,7 +183,7 @@ var f = 2, p = 750, m = null, h = async () => (m ||= Promise.all([import("../../
|
|
|
182
183
|
.2
|
|
183
184
|
]
|
|
184
185
|
}
|
|
185
|
-
}),
|
|
186
|
+
}), I.addLayer({
|
|
186
187
|
id: n,
|
|
187
188
|
type: "line",
|
|
188
189
|
source: e,
|
|
@@ -199,9 +200,9 @@ var f = 2, p = 750, m = null, h = async () => (m ||= Promise.all([import("../../
|
|
|
199
200
|
]
|
|
200
201
|
}
|
|
201
202
|
}));
|
|
202
|
-
}, [
|
|
203
|
-
if (!
|
|
204
|
-
let { profile: t = "cycling", coordinates: n } =
|
|
203
|
+
}, [I, C]), l(() => {
|
|
204
|
+
if (!I || !I.isStyleLoaded() || !w || w.coordinates.length < 2) return;
|
|
205
|
+
let { profile: t = "cycling", coordinates: n } = w, r = "route-fetched", i = "route-layer-fetched";
|
|
205
206
|
return (async () => {
|
|
206
207
|
if (!e) return;
|
|
207
208
|
let a = n.map((e) => {
|
|
@@ -219,10 +220,10 @@ var f = 2, p = 750, m = null, h = async () => (m ||= Promise.all([import("../../
|
|
|
219
220
|
let t = await e.json();
|
|
220
221
|
if (t.routes && t.routes.length > 0) {
|
|
221
222
|
let e = t.routes[0].geometry;
|
|
222
|
-
|
|
223
|
+
I.getLayer(i) && I.removeLayer(i), I.getSource(r) && I.removeSource(r), I.addSource(r, {
|
|
223
224
|
type: "geojson",
|
|
224
225
|
data: e
|
|
225
|
-
}),
|
|
226
|
+
}), I.addLayer({
|
|
226
227
|
id: i,
|
|
227
228
|
type: "line",
|
|
228
229
|
source: r,
|
|
@@ -241,31 +242,31 @@ var f = 2, p = 750, m = null, h = async () => (m ||= Promise.all([import("../../
|
|
|
241
242
|
console.error("Failed to fetch route from Mapbox:", e);
|
|
242
243
|
}
|
|
243
244
|
})(), () => {
|
|
244
|
-
|
|
245
|
+
I && I.isStyleLoaded() && (I.getLayer(i) && I.removeLayer(i), I.getSource(r) && I.removeSource(r));
|
|
245
246
|
};
|
|
246
|
-
}, [
|
|
247
|
-
className:
|
|
248
|
-
style:
|
|
249
|
-
children: /* @__PURE__ */
|
|
247
|
+
}, [I, w]), B ? /* @__PURE__ */ f("div", {
|
|
248
|
+
className: G,
|
|
249
|
+
style: E,
|
|
250
|
+
children: /* @__PURE__ */ f("div", {
|
|
250
251
|
className: t("flex h-full w-full items-center justify-center text-center text-sm text-gray-500"),
|
|
251
|
-
children:
|
|
252
|
+
children: B
|
|
252
253
|
})
|
|
253
|
-
}) : /* @__PURE__ */
|
|
254
|
-
className:
|
|
255
|
-
style:
|
|
256
|
-
children: [/* @__PURE__ */
|
|
254
|
+
}) : /* @__PURE__ */ p("div", {
|
|
255
|
+
className: G,
|
|
256
|
+
style: E,
|
|
257
|
+
children: [/* @__PURE__ */ f("div", {
|
|
257
258
|
"aria-hidden": "true",
|
|
258
|
-
className: t("absolute inset-0 transition-opacity duration-500 ease-out",
|
|
259
|
-
children: /* @__PURE__ */
|
|
259
|
+
className: t("absolute inset-0 transition-opacity duration-500 ease-out", H ? "pointer-events-none opacity-0" : "opacity-100"),
|
|
260
|
+
children: /* @__PURE__ */ f("div", {
|
|
260
261
|
className: "h-full w-full",
|
|
261
|
-
style: { backgroundColor:
|
|
262
|
+
style: { backgroundColor: N }
|
|
262
263
|
})
|
|
263
|
-
}), /* @__PURE__ */
|
|
264
|
-
ref:
|
|
265
|
-
className: t("h-full w-full transition-opacity duration-500 ease-out",
|
|
264
|
+
}), /* @__PURE__ */ f("div", {
|
|
265
|
+
ref: P,
|
|
266
|
+
className: t("h-full w-full transition-opacity duration-500 ease-out", H ? "opacity-100" : "pointer-events-none opacity-0")
|
|
266
267
|
})]
|
|
267
268
|
});
|
|
268
|
-
},
|
|
269
|
+
}, y = class extends c {
|
|
269
270
|
constructor(e) {
|
|
270
271
|
super(e), this.state = { hasError: !1 };
|
|
271
272
|
}
|
|
@@ -277,16 +278,16 @@ var f = 2, p = 750, m = null, h = async () => (m ||= Promise.all([import("../../
|
|
|
277
278
|
}
|
|
278
279
|
render() {
|
|
279
280
|
let e = t("overflow-clip w-full h-full", this.props.className);
|
|
280
|
-
return this.state.hasError ? /* @__PURE__ */
|
|
281
|
+
return this.state.hasError ? /* @__PURE__ */ f("div", {
|
|
281
282
|
className: e,
|
|
282
283
|
style: this.props.style,
|
|
283
|
-
children: /* @__PURE__ */
|
|
284
|
+
children: /* @__PURE__ */ f("div", {
|
|
284
285
|
className: t("flex h-full w-full items-center justify-center text-center text-sm text-gray-500"),
|
|
285
286
|
children: "Erreur lors du chargement de la carte."
|
|
286
287
|
})
|
|
287
288
|
}) : this.props.children;
|
|
288
289
|
}
|
|
289
|
-
},
|
|
290
|
+
}, b = class {
|
|
290
291
|
options;
|
|
291
292
|
container = null;
|
|
292
293
|
map = null;
|
|
@@ -330,10 +331,10 @@ var f = 2, p = 750, m = null, h = async () => (m ||= Promise.all([import("../../
|
|
|
330
331
|
let n = Math.abs(e) < .01 && Math.abs(t) < .01;
|
|
331
332
|
this.compassButton.classList.toggle("opacity-60", n);
|
|
332
333
|
};
|
|
333
|
-
},
|
|
334
|
+
}, x = (e) => /* @__PURE__ */ f(y, {
|
|
334
335
|
className: e.className,
|
|
335
336
|
style: e.style,
|
|
336
|
-
children: /* @__PURE__ */
|
|
337
|
+
children: /* @__PURE__ */ f(v, { ...e })
|
|
337
338
|
});
|
|
338
339
|
//#endregion
|
|
339
|
-
export {
|
|
340
|
+
export { x as default };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
//#region ../ui/dist/Map/constants.js
|
|
2
|
+
var e = "rgb(201 221 176)", t = "#DB2777", n = (e, t) => ({
|
|
3
|
+
"line-color": e,
|
|
4
|
+
"line-width": t,
|
|
5
|
+
"line-opacity": .75
|
|
6
|
+
});
|
|
7
|
+
//#endregion
|
|
8
|
+
export { t as DEFAULT_MAP_ROUTE_COLOR, e as DEFAULT_MAP_SKELETON_COLOR, n as createMapRoutePaint };
|
|
@@ -14,7 +14,7 @@ var l = ({ className: t, style: n, color: r }) => /* @__PURE__ */ c("div", {
|
|
|
14
14
|
style: { backgroundColor: r ?? "rgb(201 221 176)" }
|
|
15
15
|
})
|
|
16
16
|
}), /* @__PURE__ */ s("div", { className: "h-full w-full transition-opacity duration-500 ease-out pointer-events-none opacity-0" })]
|
|
17
|
-
}), u = r(() => import("./Map/MapContent-
|
|
17
|
+
}), u = r(() => import("./Map/MapContent-TzYCv8ji.js")), d = (e) => {
|
|
18
18
|
let r = a(null), [c, d] = o(!1);
|
|
19
19
|
i(() => {
|
|
20
20
|
if (t()) return;
|
|
@@ -3,9 +3,9 @@ import { getLocalizedValue as r } from "../../localization.js";
|
|
|
3
3
|
import { getAvailabilityVariant as i } from "../../lib/utils.js";
|
|
4
4
|
import { Badge as a } from "../../ui/badge.js";
|
|
5
5
|
import { Button as o } from "../../ui/button.js";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
6
|
+
import { useStorefrontWorkspaceLanguage as s } from "../../StorefrontContext.js";
|
|
7
|
+
import { RESPONSIVE_DIALOG_MOBILE_MEDIA_QUERY as c, ResponsiveDialog as l, ResponsiveDialogContent as u, ResponsiveDialogDescription as d, ResponsiveDialogFooter as f, ResponsiveDialogHeader as p, ResponsiveDialogTitle as m } from "../../chunks/pkg/ui/dist/ResponsiveDialog-BVwhTZQo.js";
|
|
8
|
+
import { Input as h } from "../../ui/input.js";
|
|
9
9
|
import { ProductWarningNotice as g } from "../ProductWarningNotice/index.js";
|
|
10
10
|
import { ProductPriceBadge as _ } from "../ProductPriceBadge/index.js";
|
|
11
11
|
import { resolveProductImageContainerStyle as v } from "../../lib/productImageStyles.js";
|
|
@@ -20,21 +20,21 @@ var A = (e) => {
|
|
|
20
20
|
let t = Number.parseInt(e, 10);
|
|
21
21
|
return !Number.isFinite(t) || t < 1 ? 1 : t;
|
|
22
22
|
};
|
|
23
|
-
function j({ open:
|
|
24
|
-
let { t: R, i18n: z } = w(), B = C(
|
|
23
|
+
function j({ open: h, product: j, onOpenChange: N, getVariantAvailabilityLabel: P, isVariantOutOfCapacity: F, addDisabled: I = !1, onAddVariant: L }) {
|
|
24
|
+
let { t: R, i18n: z } = w(), B = C(c), V = s(), [H, U] = b({});
|
|
25
25
|
if (y(() => {
|
|
26
|
-
!j || !
|
|
27
|
-
}, [
|
|
26
|
+
!j || !h || U((j.productVariants ?? []).reduce((e, t) => (e[t.id] = "1", e), {}));
|
|
27
|
+
}, [h, j]), !j) return null;
|
|
28
28
|
let W = (e, t) => {
|
|
29
29
|
U((n) => ({
|
|
30
30
|
...n,
|
|
31
31
|
[e]: t
|
|
32
32
|
}));
|
|
33
33
|
}, G = r(j.name, z.language, V), K = r(j.description, z.language, V), q = r(j.warning, z.language, V), J = typeof j.images?.[0] == "string" ? j.images[0].trim() : "", Y = v(j.primaryImageStyle), X = i(j.availabilityStatus), Z = j.features?.slice(0, 4) ?? [], Q = j.productVariants ?? [], $ = Q.some((t) => !!e(t, "size")) ? R("product_size_label") : R("product_variant_label");
|
|
34
|
-
return /* @__PURE__ */ x(
|
|
35
|
-
open:
|
|
34
|
+
return /* @__PURE__ */ x(l, {
|
|
35
|
+
open: h,
|
|
36
36
|
onOpenChange: N,
|
|
37
|
-
children: /* @__PURE__ */ x(
|
|
37
|
+
children: /* @__PURE__ */ x(u, {
|
|
38
38
|
"data-testid": "storefront-booking-bike-dialog-content",
|
|
39
39
|
className: "overflow-hidden border-slate-200 bg-white p-0",
|
|
40
40
|
desktopClassName: "max-w-4xl gap-0",
|
|
@@ -43,12 +43,12 @@ function j({ open: m, product: j, onOpenChange: N, getVariantAvailabilityLabel:
|
|
|
43
43
|
"data-testid": "storefront-booking-bike-dialog",
|
|
44
44
|
className: "flex max-h-[92dvh] flex-col",
|
|
45
45
|
children: [
|
|
46
|
-
/* @__PURE__ */ S(
|
|
46
|
+
/* @__PURE__ */ S(p, {
|
|
47
47
|
className: "border-b border-slate-200 px-5 py-4 text-left sm:px-6",
|
|
48
|
-
children: [/* @__PURE__ */ x(
|
|
48
|
+
children: [/* @__PURE__ */ x(m, {
|
|
49
49
|
className: "text-left text-lg font-semibold text-slate-950",
|
|
50
50
|
children: /* @__PURE__ */ x("span", { children: G })
|
|
51
|
-
}), /* @__PURE__ */ x(
|
|
51
|
+
}), /* @__PURE__ */ x(d, {
|
|
52
52
|
className: "line-clamp-2 text-left text-sm text-slate-600",
|
|
53
53
|
children: /* @__PURE__ */ x("span", { children: K })
|
|
54
54
|
})]
|
|
@@ -208,7 +208,7 @@ function j({ open: m, product: j, onOpenChange: N, getVariantAvailabilityLabel:
|
|
|
208
208
|
})]
|
|
209
209
|
})
|
|
210
210
|
}),
|
|
211
|
-
/* @__PURE__ */ x(
|
|
211
|
+
/* @__PURE__ */ x(f, {
|
|
212
212
|
className: "border-t border-slate-200 px-5 py-4 sm:px-6",
|
|
213
213
|
children: /* @__PURE__ */ x(o, {
|
|
214
214
|
type: "button",
|
|
@@ -226,7 +226,7 @@ function j({ open: m, product: j, onOpenChange: N, getVariantAvailabilityLabel:
|
|
|
226
226
|
function M({ ariaLabel: e, onQuantityChange: t, quantity: n, testIdPrefix: r }) {
|
|
227
227
|
return /* @__PURE__ */ x("div", {
|
|
228
228
|
className: "flex items-center",
|
|
229
|
-
children: /* @__PURE__ */ x(
|
|
229
|
+
children: /* @__PURE__ */ x(h, {
|
|
230
230
|
type: "text",
|
|
231
231
|
inputMode: "numeric",
|
|
232
232
|
pattern: "[0-9]*",
|
|
@@ -4,9 +4,9 @@ import { resolveStorefrontWhatsAppContact as i } from "../../lib/whatsapp.js";
|
|
|
4
4
|
import a from "../../chunks/assets/whatsapp-m5e0vjnZ.js";
|
|
5
5
|
import { MISSING_SHOP_ADDRESS as o, MISSING_SHOP_EMAIL as s, MISSING_SHOP_PHONE_NUMBER as c, UNCONFIGURED_SHOP_MAP_CENTER as l } from "../../lib/storefrontMissingValues.js";
|
|
6
6
|
import { Button as u } from "../../ui/button.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
7
|
+
import { useStorefront as d } from "../../StorefrontContext.js";
|
|
8
|
+
import { toast as f } from "../../lib/toast.js";
|
|
9
|
+
import { Input as p } from "../../ui/input.js";
|
|
10
10
|
import { Form as m, FormControl as h, FormField as g, FormItem as _, FormLabel as v, FormMessage as y } from "../../ui/form.js";
|
|
11
11
|
import { Textarea as ee } from "../../ui/textarea.js";
|
|
12
12
|
import { createMarkerElement as b } from "../Map/createMarkerElement.js";
|
|
@@ -21,7 +21,7 @@ import { useForm as M, zodResolver as N } from "@rpcbase/form";
|
|
|
21
21
|
//#region src/components/ContactSection/index.tsx
|
|
22
22
|
var P = (e) => e.startsWith("fr") ? "FR" : "US", F = "text-sm font-normal text-current decoration-current underline-offset-4 group-hover:underline", I = "group flex items-start gap-3 text-slate-600 transition-colors hover:text-slate-800";
|
|
23
23
|
function L({ storeSlug: L }) {
|
|
24
|
-
let { t: R, i18n: z } = E(), { storefrontConfiguration: B, mapboxToken: V } =
|
|
24
|
+
let { t: R, i18n: z } = E(), { storefrontConfiguration: B, mapboxToken: V } = d(), { shop: H } = B, U = r(H), W = H.emailAddress?.trim() ?? "", G = H.address?.trim() ?? "", K = n(H), q = i({
|
|
25
25
|
storefrontConfiguration: B,
|
|
26
26
|
language: z.language
|
|
27
27
|
}), J = q?.href, Y = M({
|
|
@@ -61,13 +61,13 @@ function L({ storeSlug: L }) {
|
|
|
61
61
|
})
|
|
62
62
|
}), i = await r.json().then((e) => t.safeParse(e)).catch(() => ({ success: !1 }));
|
|
63
63
|
if (r.ok && "success" in i && i.success && i.data.success) {
|
|
64
|
-
|
|
64
|
+
f.success(R("contact_form_success_toast")), Y.reset();
|
|
65
65
|
return;
|
|
66
66
|
}
|
|
67
67
|
let a = "success" in i && i.success && i.data.error ? i.data.error : R("contact_form_error_toast");
|
|
68
|
-
|
|
68
|
+
f.error(a);
|
|
69
69
|
} catch (e) {
|
|
70
|
-
console.warn("Storefront contact form request failed", e),
|
|
70
|
+
console.warn("Storefront contact form request failed", e), f.error(R("contact_form_error_toast"));
|
|
71
71
|
}
|
|
72
72
|
});
|
|
73
73
|
return /* @__PURE__ */ w("section", {
|
|
@@ -277,7 +277,7 @@ function L({ storeSlug: L }) {
|
|
|
277
277
|
name: "name",
|
|
278
278
|
render: ({ field: e }) => /* @__PURE__ */ T(_, { children: [
|
|
279
279
|
/* @__PURE__ */ w(v, { children: R("contact_form_name_label") }),
|
|
280
|
-
/* @__PURE__ */ w(h, { children: /* @__PURE__ */ w(
|
|
280
|
+
/* @__PURE__ */ w(h, { children: /* @__PURE__ */ w(p, {
|
|
281
281
|
...e,
|
|
282
282
|
placeholder: R("contact_form_name_placeholder"),
|
|
283
283
|
className: "h-11"
|
|
@@ -290,7 +290,7 @@ function L({ storeSlug: L }) {
|
|
|
290
290
|
name: "emailAddress",
|
|
291
291
|
render: ({ field: e }) => /* @__PURE__ */ T(_, { children: [
|
|
292
292
|
/* @__PURE__ */ w(v, { children: R("contact_form_email_label") }),
|
|
293
|
-
/* @__PURE__ */ w(h, { children: /* @__PURE__ */ w(
|
|
293
|
+
/* @__PURE__ */ w(h, { children: /* @__PURE__ */ w(p, {
|
|
294
294
|
...e,
|
|
295
295
|
type: "email",
|
|
296
296
|
placeholder: R("contact_form_email_placeholder"),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Header/index.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Header/index.tsx"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAA;AAMtE,KAAK,WAAW,GAAG;IACjB,uBAAuB,CAAC,EAAE,uBAAuB,CAAA;IACjD,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,oBAAoB,CAAC,EAAE,MAAM,CAAA;CAC9B,CAAA;AAQD,wBAAgB,MAAM,CAAC,EAAE,uBAAuB,EAAE,YAAY,EAAE,oBAAoB,EAAE,EAAE,WAAW,2CAmLlG"}
|