@loczer/storefront-sdk 0.196.0 → 0.198.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/chunks/pkg/ui/dist/{MorphingModalWizard-j1CgFGLe.js → MorphingModalWizard-DOH1GYVR.js} +1 -0
- package/dist/components/BikeProductCard/index.d.ts +2 -1
- package/dist/components/BikeProductCard/index.d.ts.map +1 -1
- package/dist/components/BikeProductCard/index.js +23 -23
- package/dist/components/BookingBikeQuickAddCard/index.d.ts +19 -0
- package/dist/components/BookingBikeQuickAddCard/index.d.ts.map +1 -0
- package/dist/components/BookingBikeQuickAddCard/index.js +174 -0
- package/dist/components/BookingBikeVariantDialog/index.d.ts +5 -2
- package/dist/components/BookingBikeVariantDialog/index.d.ts.map +1 -1
- package/dist/components/BookingBikeVariantDialog/index.js +76 -90
- package/dist/components/BookingPeriodSelector/components/BookingEndDateField.js +1 -1
- package/dist/components/BookingPeriodSelector/components/BookingEndTimeField.js +3 -3
- package/dist/components/BookingPeriodSelector/components/BookingStartDateField.js +1 -1
- package/dist/components/BookingPeriodSelector/components/BookingStartTimeField.js +3 -3
- package/dist/components/BookingPeriodSelector/components/BookingTimeSlotsStatus.d.ts.map +1 -1
- package/dist/components/BookingPeriodSelector/components/BookingTimeSlotsStatus.js +4 -4
- package/dist/components/BookingPeriodSelector/components/internal/BookingHourPickerField.d.ts +1 -1
- package/dist/components/BookingPeriodSelector/components/internal/BookingHourPickerField.d.ts.map +1 -1
- package/dist/components/BookingPeriodSelector/components/internal/BookingHourPickerField.js +6 -20
- package/dist/components/BookingPeriodSelector/components/internal/StorefrontHourPickerField.d.ts +0 -2
- package/dist/components/BookingPeriodSelector/components/internal/StorefrontHourPickerField.d.ts.map +1 -1
- package/dist/components/BookingPeriodSelector/components/internal/StorefrontHourPickerField.js +163 -179
- package/dist/components/PlatformFooter/index.js +1 -1
- package/dist/i18n/en.d.ts +2 -0
- package/dist/i18n/en.d.ts.map +1 -1
- package/dist/i18n/en.js +2 -0
- package/dist/i18n/fr.d.ts +2 -0
- package/dist/i18n/fr.d.ts.map +1 -1
- package/dist/i18n/fr.js +2 -0
- package/dist/index.d.ts +4 -2
- package/dist/pages/BookingPage.d.ts.map +1 -1
- package/dist/pages/BookingPage.js +310 -388
- package/dist/pages/ErrorPage.d.ts.map +1 -1
- package/dist/pages/ErrorPage.js +13 -13
- package/dist/pages/NotFoundPage.js +1 -1
- package/dist/pages/checkout/components/CheckoutPaymentSummaryCard.js +1 -1
- package/dist/storefront.css +1 -1
- package/dist/ui/button.js +3 -3
- package/package.json +2 -1
|
@@ -1,211 +1,146 @@
|
|
|
1
1
|
import { applyBookingParamsToSearch as e, createBookingPeriodConfigFromStorefrontConfiguration as t, getBookingParamsFromSearch as n, getDefaultBookingParamsForStorefrontConfiguration as r, resolveBookingSearchParamsFromSessionStorage as i, writeBookingSearchParamsToSessionStorage as a } from "../lib/booking.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import { cn as E } from "@rpcbase/ui";
|
|
30
|
-
import { ArrowLeft as Ce, ArrowRight as we, Bike as Te, ShoppingCart as Ee } from "lucide-react";
|
|
2
|
+
import { getStorefrontCheckoutProductId as o } from "../lib/products.js";
|
|
3
|
+
import { useStorefrontCart as ee } from "../lib/cart.js";
|
|
4
|
+
import { getLocalizedValue as te } from "../localization.js";
|
|
5
|
+
import { buildStorefrontCartSummary as ne } from "../lib/cartSummary.js";
|
|
6
|
+
import { ROUTE as s, buildStorefrontAvailabilityKey as c, getStorefrontAvailabilityIssue as re, getStorefrontAvailabilityStatus as l, getValidStorefrontAvailabilitySchedule as u, isStorefrontAvailabilityInsufficient as ie, responseSchema as ae } from "../lib/storefrontAvailability.js";
|
|
7
|
+
import { Badge as oe } from "../ui/badge.js";
|
|
8
|
+
import { Button as se } from "../ui/button.js";
|
|
9
|
+
import { BookingPeriodSelector as ce } from "../components/BookingPeriodSelector/index.js";
|
|
10
|
+
import { BookingFlowSteps as le } from "../components/BookingFlowSteps/index.js";
|
|
11
|
+
import { useStorefront as ue, useStorefrontBookingProducts as de, useStorefrontProducts as fe } from "../StorefrontProvider.js";
|
|
12
|
+
import { StepSectionTitle as d } from "../components/StepSectionTitle/index.js";
|
|
13
|
+
import { Card as pe } from "../ui/card.js";
|
|
14
|
+
import { ProductWarningNotice as me } from "../components/ProductWarningNotice/index.js";
|
|
15
|
+
import { StorefrontCartPanel as he } from "../components/StorefrontCartPanel/index.js";
|
|
16
|
+
import { ProductPriceBadge as ge } from "../components/ProductPriceBadge/index.js";
|
|
17
|
+
import { resolveProductImageContainerStyle as _e } from "../lib/productImageStyles.js";
|
|
18
|
+
import { apiPost as ve } from "../lib/apiCall.js";
|
|
19
|
+
import { createStorefrontTimeSlotsFetcher as ye } from "../lib/fetchStorefrontTimeSlots.js";
|
|
20
|
+
import { FulfillmentSection as be } from "../components/FulfillmentSection/index.js";
|
|
21
|
+
import { BookingBikeQuickAddCard as xe } from "../components/BookingBikeQuickAddCard/index.js";
|
|
22
|
+
import { BookingBikeVariantDialog as Se } from "../components/BookingBikeVariantDialog/index.js";
|
|
23
|
+
import { useEffect as f, useLayoutEffect as Ce, useMemo as p, useRef as we, useState as m } from "react";
|
|
24
|
+
import { jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
25
|
+
import { Link as _, useLocation as Te, useParams as Ee, useSearchParams as De } from "@rpcbase/router";
|
|
26
|
+
import { useTranslation as Oe } from "react-i18next";
|
|
27
|
+
import { cn as ke } from "@rpcbase/ui";
|
|
28
|
+
import { ArrowLeft as Ae, ArrowRight as je, Bike as Me, ShoppingCart as Ne } from "lucide-react";
|
|
31
29
|
//#region src/pages/BookingPage.tsx
|
|
32
|
-
var
|
|
30
|
+
var v = (e) => String(e).padStart(2, "0"), y = "product_modal", Pe = (e, t) => {
|
|
31
|
+
let n = t - e;
|
|
32
|
+
return e >= 0 && (n === 1 || n === 2) ? n : null;
|
|
33
|
+
}, Fe = (e) => `${e.getFullYear()}-${v(e.getMonth() + 1)}-${v(e.getDate())}`, b = (e) => {
|
|
33
34
|
if (!e) return;
|
|
34
35
|
let t = e.match(/^(\d{4})-(\d{2})-(\d{2})$/);
|
|
35
36
|
if (!t) return;
|
|
36
37
|
let n = Number(t[1]), r = Number(t[2]), i = Number(t[3]), a = new Date(n, r - 1, i);
|
|
37
38
|
if (!(Number.isNaN(a.getTime()) || a.getFullYear() !== n || a.getMonth() !== r - 1 || a.getDate() !== i)) return a;
|
|
38
|
-
},
|
|
39
|
+
}, Ie = (e, t) => e.fulfillment === t.fulfillment && e.start_date === t.start_date && e.start_time === t.start_time && e.end_date === t.end_date && e.end_time === t.end_time && e.start_address === t.start_address && e.end_address === t.end_address, x = (e, t = () => !0) => {
|
|
39
40
|
if (e.representedVariantId?.trim()) return e.representedVariantId.trim();
|
|
40
41
|
let n = e.productVariants ?? [], r = n.find((e) => t(e.id))?.id ?? n[0]?.id;
|
|
41
42
|
return typeof r == "string" && r.trim().length > 0 ? r : null;
|
|
42
|
-
},
|
|
43
|
+
}, Le = (e, t) => e.fulfillment === "delivery" && !t ? {
|
|
43
44
|
...e,
|
|
44
45
|
fulfillment: "pickup"
|
|
45
|
-
} : e,
|
|
46
|
-
let n =
|
|
46
|
+
} : e, Re = (e, t) => {
|
|
47
|
+
let n = o(e), r = e.representedVariantId?.trim();
|
|
47
48
|
if (r) {
|
|
48
|
-
let e = t.get(
|
|
49
|
+
let e = t.get(c(n, r));
|
|
49
50
|
if (e) return e;
|
|
50
51
|
}
|
|
51
|
-
return t.get(
|
|
52
|
-
},
|
|
53
|
-
let r =
|
|
52
|
+
return t.get(c(n));
|
|
53
|
+
}, ze = (e, t, n) => n.get(c(o(e), t)), Be = (e, t, n) => {
|
|
54
|
+
let r = re(t);
|
|
54
55
|
return r === "quantity_unavailable" ? e("availability_quantity_unavailable") : r === "unavailable" || n === "OUT_OF_STOCK" ? e("availability_out_of_stock") : t?.remaining === void 0 ? t?.fewRemaining || n === "LOW_STOCK" ? e("availability_low_stock") : e("availability_in_stock") : e("availability_remaining_count", { count: t.remaining });
|
|
55
|
-
},
|
|
56
|
+
}, Ve = (e) => {
|
|
56
57
|
let t = /* @__PURE__ */ new Map();
|
|
57
58
|
for (let n of e) {
|
|
58
|
-
let e =
|
|
59
|
-
t.set(
|
|
60
|
-
for (let r of n.productVariants ?? []) t.set(
|
|
59
|
+
let e = o(n);
|
|
60
|
+
t.set(c(e), { productId: e });
|
|
61
|
+
for (let r of n.productVariants ?? []) t.set(c(e, r.id), {
|
|
61
62
|
productId: e,
|
|
62
63
|
productVariantId: r.id
|
|
63
64
|
});
|
|
64
65
|
let r = n.representedVariantId?.trim();
|
|
65
|
-
r && t.set(
|
|
66
|
+
r && t.set(c(e, r), {
|
|
66
67
|
productId: e,
|
|
67
68
|
productVariantId: r
|
|
68
69
|
});
|
|
69
70
|
}
|
|
70
71
|
return Array.from(t.values());
|
|
71
72
|
};
|
|
72
|
-
function
|
|
73
|
-
let { t:
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
children: d.map((n) => {
|
|
86
|
-
let r = `booking-variant-${e.id}-${n.id}`.toLowerCase(), i = `storefront-booking-variant-option-${e.id}-${n.id}`.toLowerCase(), { label: o, description: l } = s(n), u = c(n.id), d = a(n.id);
|
|
87
|
-
return /* @__PURE__ */ w("label", {
|
|
88
|
-
htmlFor: r,
|
|
89
|
-
"data-testid": i,
|
|
90
|
-
className: E("flex items-start gap-3 rounded-xl border p-3 transition", t === n.id ? "border-slate-900 bg-white" : "border-slate-200 bg-white"),
|
|
91
|
-
children: [/* @__PURE__ */ C(y, {
|
|
92
|
-
id: r,
|
|
93
|
-
value: n.id,
|
|
94
|
-
className: "mt-1"
|
|
95
|
-
}), /* @__PURE__ */ w("span", {
|
|
96
|
-
className: "flex flex-1 flex-col gap-0.5",
|
|
97
|
-
children: [
|
|
98
|
-
/* @__PURE__ */ C("span", {
|
|
99
|
-
className: "text-sm font-medium text-slate-950",
|
|
100
|
-
children: o
|
|
101
|
-
}),
|
|
102
|
-
l ? /* @__PURE__ */ C("span", {
|
|
103
|
-
className: "text-xs text-slate-600",
|
|
104
|
-
children: l
|
|
105
|
-
}) : null,
|
|
106
|
-
d ? /* @__PURE__ */ C("span", {
|
|
107
|
-
className: "pt-1",
|
|
108
|
-
children: /* @__PURE__ */ C(re, {
|
|
109
|
-
variant: u ? "destructive" : "outline",
|
|
110
|
-
children: /* @__PURE__ */ C("span", { children: d })
|
|
111
|
-
})
|
|
112
|
-
}) : null
|
|
113
|
-
]
|
|
114
|
-
})]
|
|
115
|
-
}, n.id);
|
|
116
|
-
})
|
|
117
|
-
}),
|
|
118
|
-
/* @__PURE__ */ w("div", {
|
|
119
|
-
className: "flex flex-wrap items-center gap-2",
|
|
120
|
-
children: [/* @__PURE__ */ w(g, {
|
|
121
|
-
type: "button",
|
|
122
|
-
size: "sm",
|
|
123
|
-
className: "rounded-full gap-2",
|
|
124
|
-
disabled: l,
|
|
125
|
-
onClick: r,
|
|
126
|
-
children: [/* @__PURE__ */ C("span", { children: u("add_to_cart") }), /* @__PURE__ */ C(we, {
|
|
127
|
-
className: "h-4 w-4",
|
|
128
|
-
"aria-hidden": "true"
|
|
129
|
-
})]
|
|
130
|
-
}), /* @__PURE__ */ C(g, {
|
|
131
|
-
type: "button",
|
|
132
|
-
size: "sm",
|
|
133
|
-
variant: "outline",
|
|
134
|
-
className: "rounded-full",
|
|
135
|
-
onClick: i,
|
|
136
|
-
children: /* @__PURE__ */ C("span", { children: u("booking_select_variant_cancel") })
|
|
137
|
-
})]
|
|
138
|
-
})
|
|
139
|
-
]
|
|
140
|
-
});
|
|
141
|
-
}
|
|
142
|
-
function A() {
|
|
143
|
-
let { t: o, i18n: s } = Se(), { storeSlug: v } = be(), y = ye(), { storefrontConfiguration: D } = oe(), A = D.workspace?.workspaceLanguage, { bikes: Ie, accessories: Le } = ce(), { bikes: j, accessories: M } = se(), [N, P] = xe(), { items: Re, itemCount: F, addItem: ze, clear: Be, removeItem: Ve, setQuantity: He } = l(), Ue = x(() => t(D), [D]), I = x(() => r(D), [D]), L = D.settings.fulfillmentModes.includes("delivery"), We = D.settings.deliveryDisabledReason.trim(), Ge = D.shop.address?.trim() ?? "", R = x(() => i(N, v), [N, v]), [z, Ke] = S(() => Ae(n(R, I), L)), [qe, Je] = S(void 0), Ye = [
|
|
144
|
-
z.start_date,
|
|
145
|
-
z.start_time,
|
|
146
|
-
z.end_date,
|
|
147
|
-
z.end_time
|
|
148
|
-
].join(":"), B = qe === Ye, V = B ? z.start_time : "", H = B ? z.end_time : "", Xe = !B && N.get("start_date") === z.start_date && N.get("start_time") === z.start_time && N.get("end_date") === z.end_date && N.get("end_time") === z.end_time;
|
|
149
|
-
b(() => {
|
|
150
|
-
Ke((e) => {
|
|
73
|
+
function S() {
|
|
74
|
+
let { t: v, i18n: S } = Oe(), { storeSlug: C } = Ee(), w = Te(), He = we(null), { storefrontConfiguration: T } = ue(), E = T.workspace?.workspaceLanguage, { bikes: Ue, accessories: We } = fe(), { bikes: D, accessories: O } = de(), [k, A] = De(), { items: Ge, itemCount: j, addItem: Ke, clear: qe, removeItem: Je, setQuantity: Ye } = ee();
|
|
75
|
+
Ce(() => {
|
|
76
|
+
w.hash === "#booking-products" && He.current?.scrollIntoView({ block: "start" });
|
|
77
|
+
}, [w.hash]);
|
|
78
|
+
let Xe = p(() => t(T), [T]), M = p(() => r(T), [T]), N = T.settings.fulfillmentModes.includes("delivery"), Ze = T.settings.deliveryDisabledReason.trim(), Qe = T.shop.address?.trim() ?? "", P = p(() => i(k, C), [k, C]), [F, $e] = m(() => Le(n(P, M), N)), [et, tt] = m(void 0), nt = [
|
|
79
|
+
F.start_date,
|
|
80
|
+
F.start_time,
|
|
81
|
+
F.end_date,
|
|
82
|
+
F.end_time
|
|
83
|
+
].join(":"), I = et === nt, L = I ? F.start_time : "", R = I ? F.end_time : "", rt = !I && k.get("start_date") === F.start_date && k.get("start_time") === F.start_time && k.get("end_date") === F.end_date && k.get("end_time") === F.end_time;
|
|
84
|
+
f(() => {
|
|
85
|
+
$e((e) => {
|
|
151
86
|
let t = {
|
|
152
|
-
...
|
|
87
|
+
...M,
|
|
153
88
|
...e
|
|
154
|
-
}, r =
|
|
155
|
-
return
|
|
89
|
+
}, r = Le(n(P, t), N);
|
|
90
|
+
return Ie(e, r) ? e : r;
|
|
156
91
|
});
|
|
157
92
|
}, [
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
]),
|
|
162
|
-
if (
|
|
163
|
-
let t = e(
|
|
164
|
-
...
|
|
165
|
-
start_time:
|
|
166
|
-
end_time:
|
|
93
|
+
P,
|
|
94
|
+
M,
|
|
95
|
+
N
|
|
96
|
+
]), f(() => {
|
|
97
|
+
if (rt) return;
|
|
98
|
+
let t = e(k, {
|
|
99
|
+
...F,
|
|
100
|
+
start_time: L,
|
|
101
|
+
end_time: R
|
|
167
102
|
});
|
|
168
|
-
t.toString() !==
|
|
103
|
+
t.toString() !== k.toString() && A(t, { replace: !0 });
|
|
169
104
|
}, [
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
]),
|
|
177
|
-
a(
|
|
178
|
-
...
|
|
179
|
-
start_time:
|
|
180
|
-
end_time:
|
|
105
|
+
F,
|
|
106
|
+
rt,
|
|
107
|
+
R,
|
|
108
|
+
L,
|
|
109
|
+
k,
|
|
110
|
+
A
|
|
111
|
+
]), f(() => {
|
|
112
|
+
a(C, {
|
|
113
|
+
...F,
|
|
114
|
+
start_time: L,
|
|
115
|
+
end_time: R
|
|
181
116
|
});
|
|
182
117
|
}, [
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
118
|
+
F,
|
|
119
|
+
R,
|
|
120
|
+
L,
|
|
121
|
+
C
|
|
187
122
|
]);
|
|
188
|
-
let
|
|
189
|
-
|
|
190
|
-
if (!
|
|
191
|
-
|
|
123
|
+
let z = p(() => Ve([...D, ...O]), [O, D]), [it, B] = m([]);
|
|
124
|
+
f(() => {
|
|
125
|
+
if (!C || z.length === 0) {
|
|
126
|
+
B([]);
|
|
192
127
|
return;
|
|
193
128
|
}
|
|
194
|
-
let e =
|
|
129
|
+
let e = I ? u(F) : null;
|
|
195
130
|
if (!e) {
|
|
196
|
-
|
|
131
|
+
B([]);
|
|
197
132
|
return;
|
|
198
133
|
}
|
|
199
134
|
let t = !1;
|
|
200
135
|
return (async () => {
|
|
201
136
|
try {
|
|
202
|
-
let n = await
|
|
203
|
-
storeSlug:
|
|
137
|
+
let n = await ve(s, {
|
|
138
|
+
storeSlug: C,
|
|
204
139
|
schedule: e,
|
|
205
|
-
products:
|
|
206
|
-
}), r =
|
|
140
|
+
products: z
|
|
141
|
+
}), r = ae.parse(n);
|
|
207
142
|
if (t) return;
|
|
208
|
-
|
|
143
|
+
B(r.success ? r.availability ?? [] : []);
|
|
209
144
|
} catch (e) {
|
|
210
145
|
if (t) return;
|
|
211
146
|
console.error("Failed to load storefront availability", e);
|
|
@@ -214,105 +149,111 @@ function A() {
|
|
|
214
149
|
t = !0;
|
|
215
150
|
};
|
|
216
151
|
}, [
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
152
|
+
z,
|
|
153
|
+
F.end_date,
|
|
154
|
+
F.end_time,
|
|
155
|
+
F.start_date,
|
|
156
|
+
F.start_time,
|
|
157
|
+
I,
|
|
158
|
+
C
|
|
224
159
|
]);
|
|
225
|
-
let
|
|
226
|
-
let t =
|
|
160
|
+
let V = p(() => new Map(it.map((e) => [c(e.productId, e.productVariantId), e])), [it]), H = p(() => D.map((e) => {
|
|
161
|
+
let t = Re(e, V);
|
|
227
162
|
return {
|
|
228
163
|
...e,
|
|
229
|
-
availabilityStatus: t ?
|
|
164
|
+
availabilityStatus: t ? l(t) : e.availabilityStatus ?? "AVAILABLE"
|
|
230
165
|
};
|
|
231
|
-
}), [
|
|
232
|
-
let
|
|
233
|
-
return
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
},
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
166
|
+
}), [V, D]), at = p(() => O.map((e) => {
|
|
167
|
+
let t = Re(e, V);
|
|
168
|
+
return {
|
|
169
|
+
...e,
|
|
170
|
+
availabilityStatus: t ? l(t) : "AVAILABLE"
|
|
171
|
+
};
|
|
172
|
+
}), [O, V]), ot = (e, t) => {
|
|
173
|
+
let n = ze(e, t, V);
|
|
174
|
+
return n ? ie(n) : e.availabilityStatus === "OUT_OF_STOCK";
|
|
175
|
+
}, st = (e) => (e.productVariants ?? []).length > 0, ct = (e, t) => {
|
|
176
|
+
let n = ze(e, t, V);
|
|
177
|
+
return n ? Be(v, n, l(n)) : e.availabilityStatus === "OUT_OF_STOCK" ? v("availability_out_of_stock") : null;
|
|
178
|
+
}, lt = ye(C), ut = p(() => ({
|
|
179
|
+
startDate: v("booking_start_date"),
|
|
180
|
+
pickStartDate: v("booking_start_date"),
|
|
181
|
+
startTime: v("booking_start_time"),
|
|
182
|
+
endDate: v("booking_end_date"),
|
|
183
|
+
pickEndDate: v("booking_end_date"),
|
|
184
|
+
endTime: v("booking_end_time"),
|
|
185
|
+
selectedDaysTooltip: ({ count: e }) => v("booking_selected_days_tooltip", { count: e }),
|
|
186
|
+
timeSlotsLoading: v("booking_time_slots_loading"),
|
|
187
|
+
timeSlotsUnavailable: v("booking_time_slots_unavailable"),
|
|
188
|
+
timeSlotsLoadError: v("booking_time_slots_load_error"),
|
|
189
|
+
retryTimeSlots: v("booking_time_slots_retry")
|
|
190
|
+
}), [S.language, v]), U = (e) => {
|
|
191
|
+
$e((t) => {
|
|
251
192
|
let n = {
|
|
252
193
|
...t,
|
|
253
194
|
...e
|
|
254
195
|
};
|
|
255
|
-
return
|
|
196
|
+
return Ie(t, n) ? t : n;
|
|
256
197
|
});
|
|
257
|
-
},
|
|
258
|
-
startDate:
|
|
198
|
+
}, dt = {
|
|
199
|
+
startDate: b(F.start_date),
|
|
259
200
|
onStartDateChange: (e) => {
|
|
260
|
-
e &&
|
|
201
|
+
e && U({ start_date: Fe(e) });
|
|
261
202
|
},
|
|
262
|
-
startTime:
|
|
263
|
-
onStartTimeChange: (e) =>
|
|
264
|
-
endDate:
|
|
203
|
+
startTime: F.start_time,
|
|
204
|
+
onStartTimeChange: (e) => U({ start_time: e }),
|
|
205
|
+
endDate: b(F.end_date) ?? b(F.start_date),
|
|
265
206
|
onEndDateChange: (e) => {
|
|
266
|
-
e &&
|
|
207
|
+
e && U({ end_date: Fe(e) });
|
|
267
208
|
},
|
|
268
|
-
endTime:
|
|
269
|
-
onEndTimeChange: (e) =>
|
|
270
|
-
bookingPeriodConfig:
|
|
271
|
-
fetchTimeSlots:
|
|
209
|
+
endTime: F.end_time,
|
|
210
|
+
onEndTimeChange: (e) => U({ end_time: e }),
|
|
211
|
+
bookingPeriodConfig: Xe,
|
|
212
|
+
fetchTimeSlots: lt,
|
|
272
213
|
onTimeSlotsConfirmationChange: (e) => {
|
|
273
|
-
|
|
214
|
+
tt(e ? nt : void 0);
|
|
274
215
|
},
|
|
275
|
-
labels:
|
|
276
|
-
localeCode:
|
|
277
|
-
},
|
|
278
|
-
items:
|
|
279
|
-
language:
|
|
280
|
-
fallbackLanguage:
|
|
216
|
+
labels: ut,
|
|
217
|
+
localeCode: S.language
|
|
218
|
+
}, W = p(() => ne({
|
|
219
|
+
items: Ge,
|
|
220
|
+
language: S.language,
|
|
221
|
+
fallbackLanguage: E,
|
|
281
222
|
products: {
|
|
282
|
-
bikes:
|
|
283
|
-
accessories:
|
|
223
|
+
bikes: Ue,
|
|
224
|
+
accessories: We
|
|
284
225
|
}
|
|
285
226
|
}), [
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
]),
|
|
227
|
+
We,
|
|
228
|
+
Ue,
|
|
229
|
+
S.language,
|
|
230
|
+
Ge,
|
|
231
|
+
E
|
|
232
|
+
]), G = p(() => W.lines.map((e) => ({
|
|
292
233
|
productId: e.checkoutProductId,
|
|
293
234
|
productVariantId: e.productVariantId,
|
|
294
235
|
quantity: e.quantity
|
|
295
|
-
})), [
|
|
296
|
-
|
|
297
|
-
if (!
|
|
298
|
-
|
|
236
|
+
})), [W.lines]), [ft, K] = m([]);
|
|
237
|
+
f(() => {
|
|
238
|
+
if (!C || G.length === 0) {
|
|
239
|
+
K([]);
|
|
299
240
|
return;
|
|
300
241
|
}
|
|
301
|
-
let e =
|
|
242
|
+
let e = I ? u(F) : null;
|
|
302
243
|
if (!e) {
|
|
303
|
-
|
|
244
|
+
K([]);
|
|
304
245
|
return;
|
|
305
246
|
}
|
|
306
247
|
let t = !1;
|
|
307
248
|
return (async () => {
|
|
308
249
|
try {
|
|
309
|
-
let n = await
|
|
310
|
-
storeSlug:
|
|
250
|
+
let n = await ve(s, {
|
|
251
|
+
storeSlug: C,
|
|
311
252
|
schedule: e,
|
|
312
|
-
products:
|
|
313
|
-
}), r =
|
|
253
|
+
products: G
|
|
254
|
+
}), r = ae.parse(n);
|
|
314
255
|
if (t) return;
|
|
315
|
-
|
|
256
|
+
K(r.success ? r.availability ?? [] : []);
|
|
316
257
|
} catch (e) {
|
|
317
258
|
if (t) return;
|
|
318
259
|
console.error("Failed to load storefront cart availability", e);
|
|
@@ -321,253 +262,234 @@ function A() {
|
|
|
321
262
|
t = !0;
|
|
322
263
|
};
|
|
323
264
|
}, [
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
265
|
+
F.end_date,
|
|
266
|
+
F.end_time,
|
|
267
|
+
F.start_date,
|
|
268
|
+
F.start_time,
|
|
269
|
+
I,
|
|
270
|
+
G,
|
|
271
|
+
C
|
|
331
272
|
]);
|
|
332
|
-
let
|
|
333
|
-
...
|
|
334
|
-
lines:
|
|
335
|
-
let t =
|
|
273
|
+
let pt = p(() => new Map(ft.map((e) => [c(e.productId, e.productVariantId), e])), [ft]), mt = p(() => ({
|
|
274
|
+
...W,
|
|
275
|
+
lines: W.lines.map((e) => {
|
|
276
|
+
let t = pt.get(c(e.checkoutProductId, e.productVariantId)), n = t ? re(t) : e.availabilityStatus === "OUT_OF_STOCK" ? "unavailable" : void 0;
|
|
336
277
|
return {
|
|
337
278
|
...e,
|
|
338
279
|
insufficientCapacity: n !== void 0,
|
|
339
280
|
availabilityIssue: n
|
|
340
281
|
};
|
|
341
282
|
})
|
|
342
|
-
}), [
|
|
343
|
-
...
|
|
344
|
-
start_time:
|
|
345
|
-
end_time:
|
|
346
|
-
}).toString(),
|
|
347
|
-
let t =
|
|
348
|
-
|
|
349
|
-
},
|
|
350
|
-
|
|
351
|
-
e?.trim() ? t.set(O, e) : t.delete(O), P(t, { replace: !0 });
|
|
352
|
-
}, yt = (e) => {
|
|
353
|
-
let t = k(e);
|
|
354
|
-
t && (ht((n) => n[e.id] ? n : {
|
|
355
|
-
...n,
|
|
356
|
-
[e.id]: t
|
|
357
|
-
}), Z(e.id));
|
|
358
|
-
}, bt = (e) => {
|
|
359
|
-
k(e) && (Z(null), vt(e.id));
|
|
283
|
+
}), [pt, W]), q = e(new URLSearchParams(), {
|
|
284
|
+
...F,
|
|
285
|
+
start_time: L,
|
|
286
|
+
end_time: R
|
|
287
|
+
}).toString(), J = I && u(F) !== null, ht = `/${C ?? ""}${q ? `?${q}` : ""}`, gt = `/${C ?? ""}/booking${q ? `?${q}` : ""}`, Y = `/${C ?? ""}/checkout${q ? `?${q}` : ""}`, _t = { backTo: `${w.pathname}${w.search}${w.hash}` }, [vt, yt] = m(null), bt = H.findIndex((e) => e.id === vt), X = k.get(y)?.trim() ?? "", Z = X ? H.find((e) => e.id === X) ?? at.find((e) => e.id === X) ?? null : null, Q = (e) => {
|
|
288
|
+
let t = new URLSearchParams(k);
|
|
289
|
+
e?.trim() ? t.set(y, e) : t.delete(y), A(t, { replace: !0 });
|
|
290
|
+
}, xt = (e) => {
|
|
291
|
+
x(e) && Q(e.id);
|
|
360
292
|
}, $ = (e, t, n = 1) => {
|
|
361
|
-
|
|
293
|
+
J && Ke({
|
|
362
294
|
kind: e.kind,
|
|
363
|
-
productId:
|
|
295
|
+
productId: o(e),
|
|
364
296
|
...t ? { productVariantId: t } : {},
|
|
365
297
|
quantity: n
|
|
366
298
|
});
|
|
367
|
-
},
|
|
368
|
-
let t =
|
|
299
|
+
}, St = (e) => {
|
|
300
|
+
let t = x(e), n = e.productVariants ?? [];
|
|
369
301
|
if (t && n.length <= 1) {
|
|
370
302
|
$(e, t);
|
|
371
303
|
return;
|
|
372
304
|
}
|
|
373
|
-
|
|
374
|
-
},
|
|
375
|
-
let t = e.productVariants ?? [], n =
|
|
305
|
+
xt(e);
|
|
306
|
+
}, Ct = (e) => {
|
|
307
|
+
let t = e.productVariants ?? [], n = x(e);
|
|
376
308
|
if (n) {
|
|
377
309
|
if (t.length > 1) {
|
|
378
|
-
|
|
310
|
+
xt(e);
|
|
379
311
|
return;
|
|
380
312
|
}
|
|
381
313
|
$(e, n);
|
|
382
314
|
}
|
|
383
|
-
}, Ct = (e) => {
|
|
384
|
-
let t = gt(e);
|
|
385
|
-
t && ($(e, t), Z((t) => t === e.id ? null : t));
|
|
386
315
|
};
|
|
387
|
-
return /* @__PURE__ */
|
|
316
|
+
return /* @__PURE__ */ g("div", {
|
|
388
317
|
className: "mx-auto max-w-7xl px-4 py-8 sm:px-6",
|
|
389
|
-
children: [/* @__PURE__ */
|
|
318
|
+
children: [/* @__PURE__ */ g("div", {
|
|
390
319
|
className: "flex flex-col gap-4",
|
|
391
320
|
children: [
|
|
392
|
-
/* @__PURE__ */
|
|
321
|
+
/* @__PURE__ */ h(le, {
|
|
393
322
|
currentStep: "booking",
|
|
394
|
-
bookingPath:
|
|
395
|
-
checkoutPath:
|
|
396
|
-
checkoutEnabled:
|
|
323
|
+
bookingPath: gt,
|
|
324
|
+
checkoutPath: Y,
|
|
325
|
+
checkoutEnabled: j > 0 && J
|
|
397
326
|
}),
|
|
398
|
-
/* @__PURE__ */
|
|
327
|
+
/* @__PURE__ */ g("div", {
|
|
399
328
|
className: "flex items-center justify-between gap-3",
|
|
400
|
-
children: [/* @__PURE__ */
|
|
401
|
-
to:
|
|
329
|
+
children: [/* @__PURE__ */ g(_, {
|
|
330
|
+
to: ht,
|
|
402
331
|
className: "inline-flex items-center gap-2 text-sm font-medium text-slate-700 hover:text-slate-950",
|
|
403
|
-
children: [/* @__PURE__ */
|
|
332
|
+
children: [/* @__PURE__ */ h(Ae, {
|
|
404
333
|
className: "h-4 w-4",
|
|
405
334
|
"aria-hidden": "true"
|
|
406
|
-
}), /* @__PURE__ */
|
|
407
|
-
}), /* @__PURE__ */
|
|
408
|
-
to:
|
|
409
|
-
className:
|
|
410
|
-
children: /* @__PURE__ */
|
|
335
|
+
}), /* @__PURE__ */ h("span", { children: v("back_to_home") })]
|
|
336
|
+
}), /* @__PURE__ */ h(_, {
|
|
337
|
+
to: Y,
|
|
338
|
+
className: ke(j > 0 && J ? "inline-flex" : "hidden"),
|
|
339
|
+
children: /* @__PURE__ */ g(se, {
|
|
411
340
|
size: "sm",
|
|
412
341
|
className: "gap-2",
|
|
413
|
-
children: [/* @__PURE__ */
|
|
342
|
+
children: [/* @__PURE__ */ h(Ne, {
|
|
414
343
|
className: "h-4 w-4",
|
|
415
344
|
"aria-hidden": "true"
|
|
416
|
-
}), /* @__PURE__ */
|
|
345
|
+
}), /* @__PURE__ */ h("span", { children: v("checkout_button") })]
|
|
417
346
|
})
|
|
418
347
|
})]
|
|
419
348
|
}),
|
|
420
|
-
/* @__PURE__ */
|
|
349
|
+
/* @__PURE__ */ g("div", {
|
|
421
350
|
className: "grid gap-6 lg:grid-cols-12",
|
|
422
|
-
children: [/* @__PURE__ */
|
|
351
|
+
children: [/* @__PURE__ */ h("div", {
|
|
423
352
|
className: "lg:col-span-8",
|
|
424
|
-
children: /* @__PURE__ */
|
|
353
|
+
children: /* @__PURE__ */ g("div", {
|
|
425
354
|
className: "space-y-6",
|
|
426
355
|
children: [
|
|
427
|
-
/* @__PURE__ */
|
|
356
|
+
/* @__PURE__ */ g("div", {
|
|
428
357
|
className: "space-y-3",
|
|
429
358
|
children: [
|
|
430
|
-
/* @__PURE__ */
|
|
359
|
+
/* @__PURE__ */ h(d, {
|
|
431
360
|
stepNumber: 1,
|
|
432
|
-
title:
|
|
361
|
+
title: v("booking_summary_title")
|
|
433
362
|
}),
|
|
434
|
-
/* @__PURE__ */
|
|
435
|
-
...
|
|
363
|
+
/* @__PURE__ */ h(ce, {
|
|
364
|
+
...dt,
|
|
436
365
|
className: "gap-3",
|
|
437
366
|
labelClassName: "text-xs font-medium text-slate-700",
|
|
438
367
|
inputClassName: "h-10"
|
|
439
368
|
}),
|
|
440
|
-
/* @__PURE__ */
|
|
441
|
-
value:
|
|
442
|
-
onValueChange: (e) =>
|
|
443
|
-
pickupAddress:
|
|
444
|
-
deliveryEnabled:
|
|
445
|
-
deliveryDisabledReason:
|
|
446
|
-
startAddress:
|
|
447
|
-
onStartAddressChange: (e) =>
|
|
448
|
-
endAddress:
|
|
449
|
-
onEndAddressChange: (e) =>
|
|
369
|
+
/* @__PURE__ */ h(be, {
|
|
370
|
+
value: F.fulfillment,
|
|
371
|
+
onValueChange: (e) => U({ fulfillment: e }),
|
|
372
|
+
pickupAddress: Qe,
|
|
373
|
+
deliveryEnabled: N,
|
|
374
|
+
deliveryDisabledReason: Ze,
|
|
375
|
+
startAddress: F.start_address,
|
|
376
|
+
onStartAddressChange: (e) => U({ start_address: e }),
|
|
377
|
+
endAddress: F.end_address,
|
|
378
|
+
onEndAddressChange: (e) => U({ end_address: e }),
|
|
450
379
|
testIdPrefix: "storefront-booking-fulfillment"
|
|
451
380
|
})
|
|
452
381
|
]
|
|
453
382
|
}),
|
|
454
|
-
/* @__PURE__ */
|
|
383
|
+
/* @__PURE__ */ g("div", {
|
|
384
|
+
ref: He,
|
|
455
385
|
id: "booking-products",
|
|
456
386
|
className: "space-y-2 scroll-mt-32",
|
|
457
|
-
children: [/* @__PURE__ */
|
|
387
|
+
children: [/* @__PURE__ */ h(d, {
|
|
458
388
|
stepNumber: 2,
|
|
459
|
-
title:
|
|
460
|
-
}), /* @__PURE__ */
|
|
389
|
+
title: v("products_title")
|
|
390
|
+
}), /* @__PURE__ */ h("p", {
|
|
461
391
|
className: "text-sm text-slate-600",
|
|
462
|
-
children: /* @__PURE__ */
|
|
392
|
+
children: /* @__PURE__ */ h("span", { children: v("products_description") })
|
|
463
393
|
})]
|
|
464
394
|
}),
|
|
465
|
-
/* @__PURE__ */
|
|
395
|
+
/* @__PURE__ */ h("div", {
|
|
466
396
|
className: "grid gap-4 md:grid-cols-2",
|
|
467
|
-
children:
|
|
468
|
-
let
|
|
469
|
-
return /* @__PURE__ */
|
|
397
|
+
children: H.map((e, t) => {
|
|
398
|
+
let n = `/${C ?? ""}/products/${e.slug}`, r = !!x(e) || st(e);
|
|
399
|
+
return /* @__PURE__ */ h(xe, {
|
|
470
400
|
bike: e,
|
|
471
|
-
detailsPath:
|
|
472
|
-
productDetailsLinkState:
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
401
|
+
detailsPath: n,
|
|
402
|
+
productDetailsLinkState: _t,
|
|
403
|
+
onAction: () => St(e),
|
|
404
|
+
actionDisabled: !r || !J,
|
|
405
|
+
fallbackLanguage: E,
|
|
406
|
+
dimOnColumnCount: Pe(bt, t),
|
|
407
|
+
onQuickAdd: (t, n) => $(e, t, n),
|
|
408
|
+
onHoverStart: () => yt(e.id),
|
|
409
|
+
onHoverEnd: () => {
|
|
410
|
+
yt((t) => t === e.id ? null : t);
|
|
411
|
+
},
|
|
478
412
|
testId: `storefront-booking-bike-card-${e.id}`.toLowerCase()
|
|
479
413
|
}, e.id);
|
|
480
414
|
})
|
|
481
415
|
}),
|
|
482
|
-
/* @__PURE__ */
|
|
416
|
+
/* @__PURE__ */ g("div", {
|
|
483
417
|
className: "space-y-2 pt-4",
|
|
484
|
-
children: [/* @__PURE__ */
|
|
418
|
+
children: [/* @__PURE__ */ h(d, {
|
|
485
419
|
stepNumber: 3,
|
|
486
|
-
title:
|
|
487
|
-
}), /* @__PURE__ */
|
|
420
|
+
title: v("accessories_title")
|
|
421
|
+
}), /* @__PURE__ */ h("p", {
|
|
488
422
|
className: "text-sm text-slate-600",
|
|
489
|
-
children: /* @__PURE__ */
|
|
423
|
+
children: /* @__PURE__ */ h("span", { children: v("accessories_description") })
|
|
490
424
|
})]
|
|
491
425
|
}),
|
|
492
|
-
/* @__PURE__ */
|
|
426
|
+
/* @__PURE__ */ h("div", {
|
|
493
427
|
className: "grid gap-4 sm:grid-cols-2 lg:grid-cols-3",
|
|
494
|
-
children:
|
|
495
|
-
let t =
|
|
496
|
-
return /* @__PURE__ */
|
|
497
|
-
|
|
498
|
-
|
|
428
|
+
children: at.map((e) => {
|
|
429
|
+
let t = te(e.name, S.language, E), n = te(e.description, S.language, E), r = te(e.warning, S.language, E), i = typeof e.images?.[0] == "string" ? e.images[0].trim() : "", a = _e(e.primaryImageStyle), o = `/${C ?? ""}/products/${e.slug}`, ee = x(e), ne = e.availabilityStatus === "OUT_OF_STOCK", s = !!ee || st(e);
|
|
430
|
+
return /* @__PURE__ */ h(pe, {
|
|
431
|
+
"data-testid": `storefront-booking-accessory-card-${e.id}`.toLowerCase(),
|
|
432
|
+
className: "h-full border-slate-200 bg-white shadow-sm transition-[border-color,box-shadow] duration-200 hover:border-primary/20 hover:shadow-md",
|
|
433
|
+
children: /* @__PURE__ */ g("div", {
|
|
499
434
|
className: "flex h-full flex-col gap-2 p-3",
|
|
500
435
|
children: [
|
|
501
|
-
/* @__PURE__ */
|
|
502
|
-
className:
|
|
436
|
+
/* @__PURE__ */ g("div", {
|
|
437
|
+
className: ke("relative aspect-[1618/1000] overflow-hidden rounded-xl", a.className),
|
|
503
438
|
style: a.style,
|
|
504
|
-
children: [i ? /* @__PURE__ */
|
|
439
|
+
children: [i ? /* @__PURE__ */ h("img", {
|
|
505
440
|
src: i,
|
|
506
441
|
alt: t,
|
|
507
442
|
className: "absolute inset-0 h-full w-full object-contain p-1",
|
|
508
443
|
loading: "lazy"
|
|
509
|
-
}) : /* @__PURE__ */
|
|
444
|
+
}) : /* @__PURE__ */ h("div", {
|
|
510
445
|
className: "absolute inset-0 flex items-center justify-center text-slate-400",
|
|
511
|
-
children: /* @__PURE__ */
|
|
446
|
+
children: /* @__PURE__ */ h(Me, {
|
|
512
447
|
className: "h-8 w-8",
|
|
513
448
|
"aria-hidden": "true"
|
|
514
449
|
})
|
|
515
|
-
}),
|
|
450
|
+
}), ne ? /* @__PURE__ */ h(oe, {
|
|
516
451
|
variant: "destructive",
|
|
517
452
|
className: "pointer-events-none absolute right-2 top-2 shadow-sm",
|
|
518
|
-
children: /* @__PURE__ */
|
|
453
|
+
children: /* @__PURE__ */ h("span", { children: v("availability_out_of_stock") })
|
|
519
454
|
}) : null]
|
|
520
455
|
}),
|
|
521
|
-
/* @__PURE__ */
|
|
456
|
+
/* @__PURE__ */ g("div", {
|
|
522
457
|
className: "flex flex-1 flex-col gap-1",
|
|
523
458
|
children: [
|
|
524
|
-
/* @__PURE__ */
|
|
459
|
+
/* @__PURE__ */ g("div", {
|
|
525
460
|
className: "flex items-start justify-between gap-2",
|
|
526
|
-
children: [/* @__PURE__ */
|
|
461
|
+
children: [/* @__PURE__ */ h("p", {
|
|
527
462
|
className: "min-w-0 text-sm font-semibold text-slate-950",
|
|
528
|
-
children: /* @__PURE__ */
|
|
529
|
-
}), /* @__PURE__ */
|
|
463
|
+
children: /* @__PURE__ */ h("span", { children: t })
|
|
464
|
+
}), /* @__PURE__ */ h(ge, {
|
|
530
465
|
prices: e.prices,
|
|
531
466
|
className: "shrink-0"
|
|
532
467
|
})]
|
|
533
468
|
}),
|
|
534
|
-
/* @__PURE__ */
|
|
469
|
+
/* @__PURE__ */ h("p", {
|
|
535
470
|
className: "line-clamp-2 text-xs text-slate-600",
|
|
536
|
-
children: /* @__PURE__ */
|
|
471
|
+
children: /* @__PURE__ */ h("span", { children: n })
|
|
537
472
|
}),
|
|
538
|
-
/* @__PURE__ */
|
|
473
|
+
/* @__PURE__ */ h(me, {
|
|
539
474
|
warning: r,
|
|
540
475
|
className: "mt-1"
|
|
541
476
|
})
|
|
542
477
|
]
|
|
543
478
|
}),
|
|
544
|
-
|
|
545
|
-
product: e,
|
|
546
|
-
selectedVariantId: d,
|
|
547
|
-
onSelect: (t) => ht((n) => ({
|
|
548
|
-
...n,
|
|
549
|
-
[e.id]: t
|
|
550
|
-
})),
|
|
551
|
-
onConfirm: () => Ct(e),
|
|
552
|
-
onCancel: () => Z((t) => t === e.id ? null : t),
|
|
553
|
-
getVariantAvailabilityLabel: (t) => tt(e, t),
|
|
554
|
-
isVariantOutOfCapacity: (t) => $e(e, t),
|
|
555
|
-
confirmDisabled: !X
|
|
556
|
-
}) : null,
|
|
557
|
-
/* @__PURE__ */ w("div", {
|
|
479
|
+
/* @__PURE__ */ g("div", {
|
|
558
480
|
className: "mt-auto flex items-center gap-2",
|
|
559
|
-
children: [/* @__PURE__ */
|
|
560
|
-
to:
|
|
561
|
-
state:
|
|
481
|
+
children: [/* @__PURE__ */ h(_, {
|
|
482
|
+
to: o,
|
|
483
|
+
state: _t,
|
|
562
484
|
className: "text-xs font-medium text-slate-700 hover:text-slate-950",
|
|
563
|
-
children: /* @__PURE__ */
|
|
564
|
-
}), /* @__PURE__ */
|
|
485
|
+
children: /* @__PURE__ */ h("span", { children: v("product_details_link") })
|
|
486
|
+
}), /* @__PURE__ */ g(se, {
|
|
565
487
|
type: "button",
|
|
566
488
|
size: "sm",
|
|
567
|
-
className: "ml-auto rounded-
|
|
568
|
-
onClick: () =>
|
|
569
|
-
disabled: !
|
|
570
|
-
children: [/* @__PURE__ */
|
|
489
|
+
className: "ml-auto rounded-xl gap-2",
|
|
490
|
+
onClick: () => Ct(e),
|
|
491
|
+
disabled: !s || !J,
|
|
492
|
+
children: [/* @__PURE__ */ h("span", { children: v("add_to_cart") }), /* @__PURE__ */ h(je, {
|
|
571
493
|
className: "h-4 w-4",
|
|
572
494
|
"aria-hidden": "true"
|
|
573
495
|
})]
|
|
@@ -580,38 +502,38 @@ function A() {
|
|
|
580
502
|
})
|
|
581
503
|
]
|
|
582
504
|
})
|
|
583
|
-
}), /* @__PURE__ */
|
|
505
|
+
}), /* @__PURE__ */ h("div", {
|
|
584
506
|
className: "lg:col-span-4",
|
|
585
|
-
children: /* @__PURE__ */
|
|
586
|
-
lines:
|
|
587
|
-
itemCount:
|
|
588
|
-
totalPerDayMinor:
|
|
589
|
-
checkoutPath:
|
|
590
|
-
showCheckoutAction:
|
|
507
|
+
children: /* @__PURE__ */ h(he, {
|
|
508
|
+
lines: mt.lines,
|
|
509
|
+
itemCount: j,
|
|
510
|
+
totalPerDayMinor: mt.totalPerDayMinor,
|
|
511
|
+
checkoutPath: Y,
|
|
512
|
+
showCheckoutAction: J,
|
|
591
513
|
showClearAction: !0,
|
|
592
514
|
editable: !0,
|
|
593
515
|
stickyTopClassName: "top-32",
|
|
594
|
-
onQuantityChange:
|
|
595
|
-
onRemove:
|
|
596
|
-
onClear:
|
|
516
|
+
onQuantityChange: Ye,
|
|
517
|
+
onRemove: Je,
|
|
518
|
+
onClear: qe
|
|
597
519
|
})
|
|
598
520
|
})]
|
|
599
521
|
})
|
|
600
522
|
]
|
|
601
|
-
}), /* @__PURE__ */
|
|
602
|
-
open: !!
|
|
603
|
-
product:
|
|
523
|
+
}), /* @__PURE__ */ h(Se, {
|
|
524
|
+
open: !!Z,
|
|
525
|
+
product: Z,
|
|
604
526
|
onOpenChange: (e) => {
|
|
605
|
-
e ||
|
|
527
|
+
e || Q(null);
|
|
606
528
|
},
|
|
607
|
-
getVariantAvailabilityLabel: (e) =>
|
|
608
|
-
isVariantOutOfCapacity: (e) =>
|
|
609
|
-
addDisabled: !
|
|
529
|
+
getVariantAvailabilityLabel: (e) => Z ? ct(Z, e) : null,
|
|
530
|
+
isVariantOutOfCapacity: (e) => Z ? ot(Z, e) : !1,
|
|
531
|
+
addDisabled: !J,
|
|
610
532
|
onAddVariant: (e, t) => {
|
|
611
|
-
|
|
533
|
+
Z && ($(Z, e, t), Q(null));
|
|
612
534
|
}
|
|
613
535
|
})]
|
|
614
536
|
});
|
|
615
537
|
}
|
|
616
538
|
//#endregion
|
|
617
|
-
export {
|
|
539
|
+
export { S as default };
|