@loczer/storefront-sdk 0.185.0 → 0.186.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/index.d.ts +1 -0
- package/dist/lib/checkoutPaymentDecision.d.ts +4 -0
- package/dist/lib/checkoutPaymentDecision.d.ts.map +1 -1
- package/dist/lib/checkoutPaymentDecision.js +4 -3
- package/dist/lib/checkoutSubmit.d.ts +3 -0
- package/dist/lib/checkoutSubmit.d.ts.map +1 -1
- package/dist/lib/checkoutSubmit.js +32 -30
- package/dist/pages/CheckoutPage.d.ts.map +1 -1
- package/dist/pages/CheckoutPage.js +120 -120
- package/dist/pages/checkout/components/CheckoutPaymentSummaryCard.js +2 -2
- package/dist/storefront.css +1 -1
- package/package.json +1 -1
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
import { applyBookingParamsToSearch as e, getBookingDurationLabel as t, getBookingDurationMinutes as n, getBookingParamsFromSearch as r, resolveBookingSearchParamsFromSessionStorage as i, writeBookingSearchParamsToSessionStorage as ee } from "../lib/booking.js";
|
|
2
2
|
import { useStorefrontCart as te } from "../lib/cart.js";
|
|
3
3
|
import { buildStorefrontCartSummary as ne } from "../lib/cartSummary.js";
|
|
4
|
-
import { ROUTE as re, responseSchema as ie } from "../lib/
|
|
5
|
-
import { ROUTE as ae,
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { ROUTE as
|
|
13
|
-
import { CheckoutDetailsCard as
|
|
14
|
-
import { CheckoutPaymentSummaryCard as
|
|
15
|
-
import { CheckoutSummaryColumn as
|
|
16
|
-
import { checkoutFormSchema as
|
|
17
|
-
import { useEffect as
|
|
18
|
-
import { jsx as
|
|
19
|
-
import { toast as
|
|
20
|
-
import { Link as
|
|
21
|
-
import { useTranslation as
|
|
22
|
-
import { ArrowLeft as
|
|
23
|
-
import { useForm as
|
|
4
|
+
import { ROUTE as re, responseSchema as ie } from "../lib/checkoutPaymentDecision.js";
|
|
5
|
+
import { ROUTE as ae, responseSchema as oe } from "../lib/checkoutSubmit.js";
|
|
6
|
+
import { ROUTE as se, buildStorefrontAvailabilityKey as ce, getStorefrontAvailabilityIssue as le, getValidStorefrontAvailabilitySchedule as ue, responseSchema as de } from "../lib/storefrontAvailability.js";
|
|
7
|
+
import { Button as a } from "../ui/button.js";
|
|
8
|
+
import { BookingFlowSteps as fe } from "../components/BookingFlowSteps/index.js";
|
|
9
|
+
import { useStorefront as pe, useStorefrontProducts as me } from "../StorefrontProvider.js";
|
|
10
|
+
import { apiPost as o } from "../lib/apiCall.js";
|
|
11
|
+
import { FulfillmentSection as he } from "../components/FulfillmentSection/index.js";
|
|
12
|
+
import { ROUTE as ge, responseSchema as _e } from "../lib/checkoutVerifyCoupon.js";
|
|
13
|
+
import { CheckoutDetailsCard as ve } from "./checkout/components/CheckoutDetailsCard.js";
|
|
14
|
+
import { CheckoutPaymentSummaryCard as ye } from "./checkout/components/CheckoutPaymentSummaryCard.js";
|
|
15
|
+
import { CheckoutSummaryColumn as be } from "./checkout/components/CheckoutSummaryColumn.js";
|
|
16
|
+
import { checkoutFormSchema as xe } from "./checkout/types.js";
|
|
17
|
+
import { useEffect as s, useMemo as c, useState as l } from "react";
|
|
18
|
+
import { jsx as u, jsxs as d } from "react/jsx-runtime";
|
|
19
|
+
import { toast as f } from "@rpcbase/client";
|
|
20
|
+
import { Link as Se, useNavigate as Ce, useParams as we, useSearchParams as Te } from "@rpcbase/router";
|
|
21
|
+
import { useTranslation as Ee } from "react-i18next";
|
|
22
|
+
import { ArrowLeft as De } from "lucide-react";
|
|
23
|
+
import { useForm as Oe, zodResolver as ke } from "@rpcbase/form";
|
|
24
24
|
//#region src/pages/CheckoutPage.tsx
|
|
25
|
-
var
|
|
25
|
+
var Ae = .2, je = (e) => e <= 0 ? 1 : Math.max(1, Math.ceil(e / 1440)), p = (e, t, n) => {
|
|
26
26
|
try {
|
|
27
27
|
return new Intl.NumberFormat(n, {
|
|
28
28
|
style: "currency",
|
|
@@ -31,7 +31,7 @@ var je = .2, Me = (e) => e <= 0 ? 1 : Math.max(1, Math.ceil(e / 1440)), f = (e,
|
|
|
31
31
|
} catch {
|
|
32
32
|
return `${(e / 100).toFixed(2)} ${t.toUpperCase()}`;
|
|
33
33
|
}
|
|
34
|
-
},
|
|
34
|
+
}, Me = (e, t) => {
|
|
35
35
|
try {
|
|
36
36
|
return new Intl.NumberFormat(t, {
|
|
37
37
|
style: "percent",
|
|
@@ -41,7 +41,7 @@ var je = .2, Me = (e) => e <= 0 ? 1 : Math.max(1, Math.ceil(e / 1440)), f = (e,
|
|
|
41
41
|
} catch {
|
|
42
42
|
return `${Math.round(e * 100)}%`;
|
|
43
43
|
}
|
|
44
|
-
},
|
|
44
|
+
}, Ne = (e, t, n) => {
|
|
45
45
|
let r = {
|
|
46
46
|
dateStyle: "medium",
|
|
47
47
|
timeStyle: "short"
|
|
@@ -54,40 +54,40 @@ var je = .2, Me = (e) => e <= 0 ? 1 : Math.max(1, Math.ceil(e / 1440)), f = (e,
|
|
|
54
54
|
} catch {}
|
|
55
55
|
return new Intl.DateTimeFormat(t, r).format(e);
|
|
56
56
|
};
|
|
57
|
-
function
|
|
58
|
-
let { t:
|
|
57
|
+
function m() {
|
|
58
|
+
let { t: m, i18n: h } = Ee(), { storefrontConfiguration: g } = pe(), _ = g.workspace?.workspaceLanguage, { bikes: v, accessories: y } = me(), { storeSlug: b } = we(), [x, Pe] = Te(), Fe = Ce(), { items: Ie, itemCount: Le, setQuantity: Re, removeItem: ze, clear: Be } = te(), [S, Ve] = l(!1), [C, w] = l(null), [He, T] = l(!1), [Ue, E] = l(null), We = x.get("coupon") ?? x.get("code") ?? "", [D, O] = l(We), [Ge, Ke] = l(We.trim()), [k, A] = l(null), [qe, j] = l(null), [Je, M] = l(!1), [Ye, N] = l(null), [Xe, P] = l(null), [F, Ze] = l(!1), Qe = c(() => i(x, b), [x, b]), I = g.settings.fulfillmentModes.includes("delivery"), $e = g.settings.deliveryDisabledReason.trim(), et = I || $e.length > 0, tt = g.shop.address?.trim() ?? "", L = c(() => {
|
|
59
59
|
let e = r(Qe);
|
|
60
60
|
return e.fulfillment === "delivery" && !I ? {
|
|
61
61
|
...e,
|
|
62
62
|
fulfillment: "pickup"
|
|
63
63
|
} : e;
|
|
64
|
-
}, [Qe, I]), nt =
|
|
65
|
-
items:
|
|
66
|
-
language:
|
|
67
|
-
fallbackLanguage:
|
|
64
|
+
}, [Qe, I]), nt = c(() => t(L), [L]), rt = c(() => n(L), [L]), it = c(() => je(rt), [rt]), R = c(() => ne({
|
|
65
|
+
items: Ie,
|
|
66
|
+
language: h.language,
|
|
67
|
+
fallbackLanguage: _,
|
|
68
68
|
products: {
|
|
69
|
-
bikes:
|
|
70
|
-
accessories:
|
|
69
|
+
bikes: v,
|
|
70
|
+
accessories: y
|
|
71
71
|
},
|
|
72
72
|
estimatedDays: it
|
|
73
73
|
}), [
|
|
74
|
+
y,
|
|
74
75
|
v,
|
|
75
|
-
_,
|
|
76
76
|
it,
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
]), z =
|
|
77
|
+
h.language,
|
|
78
|
+
Ie,
|
|
79
|
+
_
|
|
80
|
+
]), z = c(() => R.lines.map((e) => ({
|
|
81
81
|
productId: e.checkoutProductId,
|
|
82
82
|
productVariantId: e.productVariantId,
|
|
83
83
|
quantity: e.quantity
|
|
84
|
-
})), [R.lines]), [at, B] =
|
|
85
|
-
|
|
86
|
-
if (!
|
|
84
|
+
})), [R.lines]), [at, B] = l([]), [V, H] = l(!1);
|
|
85
|
+
s(() => {
|
|
86
|
+
if (!b || z.length === 0) {
|
|
87
87
|
B([]), H(!1);
|
|
88
88
|
return;
|
|
89
89
|
}
|
|
90
|
-
let e =
|
|
90
|
+
let e = ue(L);
|
|
91
91
|
if (!e) {
|
|
92
92
|
H(!1);
|
|
93
93
|
return;
|
|
@@ -95,11 +95,11 @@ function p() {
|
|
|
95
95
|
let t = !1;
|
|
96
96
|
return H(!0), B([]), (async () => {
|
|
97
97
|
try {
|
|
98
|
-
let n = await
|
|
99
|
-
storeSlug:
|
|
98
|
+
let n = await o(se, {
|
|
99
|
+
storeSlug: b,
|
|
100
100
|
schedule: e,
|
|
101
101
|
products: z
|
|
102
|
-
}), r =
|
|
102
|
+
}), r = de.parse(n);
|
|
103
103
|
if (t) return;
|
|
104
104
|
B(r.success ? r.availability ?? [] : []);
|
|
105
105
|
} catch (e) {
|
|
@@ -117,12 +117,12 @@ function p() {
|
|
|
117
117
|
L.start_date,
|
|
118
118
|
L.start_time,
|
|
119
119
|
z,
|
|
120
|
-
|
|
120
|
+
b
|
|
121
121
|
]);
|
|
122
|
-
let ot =
|
|
122
|
+
let ot = c(() => new Map(at.map((e) => [ce(e.productId, e.productVariantId), e])), [at]), U = c(() => ({
|
|
123
123
|
...R,
|
|
124
124
|
lines: R.lines.map((e) => {
|
|
125
|
-
let t = ot.get(
|
|
125
|
+
let t = ot.get(ce(e.checkoutProductId, e.productVariantId)), n = t ? le(t) : e.availabilityStatus === "OUT_OF_STOCK" ? "unavailable" : void 0;
|
|
126
126
|
return {
|
|
127
127
|
...e,
|
|
128
128
|
insufficientCapacity: !V && n !== void 0,
|
|
@@ -133,13 +133,13 @@ function p() {
|
|
|
133
133
|
ot,
|
|
134
134
|
V,
|
|
135
135
|
R
|
|
136
|
-
]), W =
|
|
136
|
+
]), W = c(() => R.lines.map((e) => ({
|
|
137
137
|
kind: e.kind,
|
|
138
138
|
productId: e.checkoutProductId,
|
|
139
139
|
productVariantId: e.productVariantId,
|
|
140
140
|
quantity: e.quantity
|
|
141
|
-
})), [R.lines]), st = R.estimatedTotalMinor ?? R.totalPerDayMinor, G = qe?.totalMinor ?? st, K = k?.discountAmountMinor ?? 0, q = e(new URLSearchParams(), L).toString(), J = `/${
|
|
142
|
-
resolver:
|
|
141
|
+
})), [R.lines]), st = R.estimatedTotalMinor ?? R.totalPerDayMinor, G = qe?.totalMinor ?? st, K = k?.discountAmountMinor ?? 0, q = e(new URLSearchParams(), L).toString(), J = `/${b ?? ""}/booking${q ? `?${q}` : ""}`, ct = `/${b ?? ""}/checkout${q ? `?${q}` : ""}`, lt = Oe({
|
|
142
|
+
resolver: ke(xe),
|
|
143
143
|
defaultValues: {
|
|
144
144
|
full_name: "",
|
|
145
145
|
email: "",
|
|
@@ -147,26 +147,26 @@ function p() {
|
|
|
147
147
|
notes: ""
|
|
148
148
|
}
|
|
149
149
|
});
|
|
150
|
-
|
|
151
|
-
ee(
|
|
152
|
-
}, [L,
|
|
150
|
+
s(() => {
|
|
151
|
+
ee(b, L);
|
|
152
|
+
}, [L, b]);
|
|
153
153
|
let Y = (t) => {
|
|
154
154
|
let n = {
|
|
155
155
|
...L,
|
|
156
156
|
...t
|
|
157
|
-
}, r = e(
|
|
158
|
-
|
|
157
|
+
}, r = e(x, n);
|
|
158
|
+
Pe(r, { replace: !0 }), ee(b, r);
|
|
159
159
|
};
|
|
160
|
-
|
|
161
|
-
if (!
|
|
160
|
+
s(() => {
|
|
161
|
+
if (!b || W.length === 0) {
|
|
162
162
|
A(null), j(null), M(!1), N(null), P(null);
|
|
163
163
|
return;
|
|
164
164
|
}
|
|
165
165
|
let e = Ge.trim(), t = e.length === 0 && !F, n = !1;
|
|
166
166
|
return M(!0), P(null), N(null), (async () => {
|
|
167
167
|
try {
|
|
168
|
-
let r = await
|
|
169
|
-
storeSlug:
|
|
168
|
+
let r = await o(ge, {
|
|
169
|
+
storeSlug: b,
|
|
170
170
|
schedule: {
|
|
171
171
|
startDate: L.start_date,
|
|
172
172
|
endDate: L.end_date,
|
|
@@ -176,20 +176,20 @@ function p() {
|
|
|
176
176
|
items: W,
|
|
177
177
|
couponCode: e || void 0,
|
|
178
178
|
includeAutoApply: t
|
|
179
|
-
}), i =
|
|
179
|
+
}), i = _e.parse(r);
|
|
180
180
|
if (n) return;
|
|
181
181
|
if (j(typeof i.subtotalMinor == "number" && typeof i.totalMinor == "number" ? {
|
|
182
182
|
subtotalMinor: i.subtotalMinor,
|
|
183
183
|
totalMinor: i.totalMinor,
|
|
184
184
|
lateReturnSurchargeMinor: i.lateReturnSurchargeMinor
|
|
185
185
|
} : null), !i.success) {
|
|
186
|
-
A(null), P(i.message ||
|
|
186
|
+
A(null), P(i.message || m("checkout_coupon_invalid"));
|
|
187
187
|
return;
|
|
188
188
|
}
|
|
189
|
-
A(i.coupon ?? null), i.coupon && (i.coupon.autoApplied && e.length === 0 ? (O(i.coupon.code), N(
|
|
189
|
+
A(i.coupon ?? null), i.coupon && (i.coupon.autoApplied && e.length === 0 ? (O(i.coupon.code), N(m("checkout_coupon_auto_applied", { code: i.coupon.code }))) : N(m("checkout_coupon_manual_applied")));
|
|
190
190
|
} catch (e) {
|
|
191
191
|
if (n) return;
|
|
192
|
-
console.error("Failed to verify checkout coupon", e), A(null), j(null), P(
|
|
192
|
+
console.error("Failed to verify checkout coupon", e), A(null), j(null), P(m("checkout_coupon_error"));
|
|
193
193
|
} finally {
|
|
194
194
|
n || M(!1);
|
|
195
195
|
}
|
|
@@ -203,19 +203,19 @@ function p() {
|
|
|
203
203
|
L.start_date,
|
|
204
204
|
L.start_time,
|
|
205
205
|
W,
|
|
206
|
-
|
|
206
|
+
b,
|
|
207
207
|
Ge,
|
|
208
|
-
|
|
209
|
-
]),
|
|
210
|
-
if (!
|
|
208
|
+
m
|
|
209
|
+
]), s(() => {
|
|
210
|
+
if (!b || R.lines.length === 0) {
|
|
211
211
|
w(null), E(null), T(!1);
|
|
212
212
|
return;
|
|
213
213
|
}
|
|
214
214
|
let e = !1;
|
|
215
215
|
return T(!0), E(null), (async () => {
|
|
216
216
|
try {
|
|
217
|
-
let t = await
|
|
218
|
-
storeSlug:
|
|
217
|
+
let t = await o(re, {
|
|
218
|
+
storeSlug: b,
|
|
219
219
|
schedule: {
|
|
220
220
|
startDate: L.start_date,
|
|
221
221
|
endDate: L.end_date,
|
|
@@ -223,16 +223,16 @@ function p() {
|
|
|
223
223
|
endTime: L.end_time
|
|
224
224
|
},
|
|
225
225
|
estimatedTotalMinor: G
|
|
226
|
-
}), n =
|
|
226
|
+
}), n = ie.parse(t);
|
|
227
227
|
if (e) return;
|
|
228
228
|
if (!n.success || !n.decision) {
|
|
229
|
-
w(null), E(n.message ||
|
|
229
|
+
w(null), E(n.errorCode === "online_payment_provider_missing" ? m("checkout_payment_error") : n.message || m("checkout_payment_error"));
|
|
230
230
|
return;
|
|
231
231
|
}
|
|
232
232
|
w(n.decision);
|
|
233
233
|
} catch (t) {
|
|
234
234
|
if (e) return;
|
|
235
|
-
console.error("Failed to load checkout payment decision", t), w(null), E(
|
|
235
|
+
console.error("Failed to load checkout payment decision", t), w(null), E(m("checkout_payment_error"));
|
|
236
236
|
} finally {
|
|
237
237
|
e || T(!1);
|
|
238
238
|
}
|
|
@@ -246,32 +246,32 @@ function p() {
|
|
|
246
246
|
L.start_time,
|
|
247
247
|
G,
|
|
248
248
|
R.lines.length,
|
|
249
|
-
|
|
250
|
-
|
|
249
|
+
b,
|
|
250
|
+
m
|
|
251
251
|
]);
|
|
252
|
-
let X = C?.currency ?? "EUR", ut =
|
|
252
|
+
let X = C?.currency ?? "EUR", ut = p(G, X, h.language), dt = K > 0 ? `-${p(K, X, h.language)}` : null, ft = Math.round(G / 1.2), pt = Math.max(0, G - ft), mt = p(ft, X, h.language), ht = p(pt, X, h.language), gt = Me(Ae, h.language), Z = C?.amountToCollectMinor ?? 0, _t = p(Z, X, h.language), vt = C?.paymentMode === "deposit" && Z > 0 ? p(Z, X, h.language) : null, yt = C?.shouldCollectOnlinePayment === !0 && Z > 0, bt = g.shop.timeZone?.trim() || void 0, Q = c(() => C ? Me(Math.max(0, Math.min(1, C.bookingDepositPercentage)), h.language) : null, [h.language, C]), $ = c(() => {
|
|
253
253
|
if (!C?.depositRefundableUntilIso) return null;
|
|
254
254
|
let e = new Date(C.depositRefundableUntilIso);
|
|
255
|
-
return Number.isNaN(e.getTime()) ? null :
|
|
255
|
+
return Number.isNaN(e.getTime()) ? null : Ne(e, h.language, bt);
|
|
256
256
|
}, [
|
|
257
|
-
|
|
257
|
+
h.language,
|
|
258
258
|
C?.depositRefundableUntilIso,
|
|
259
259
|
bt
|
|
260
|
-
]), xt =
|
|
260
|
+
]), xt = c(() => C ? C.paymentMode === "deposit" && Z > 0 && Q ? $ ? m("checkout_payment_due_now_helper_deposit_refundable_until", {
|
|
261
261
|
percent: Q,
|
|
262
262
|
date: $
|
|
263
|
-
}) :
|
|
263
|
+
}) : m("checkout_payment_due_now_helper_deposit", { percent: Q }) : C.paymentMode === "none" || Z <= 0 ? m("checkout_payment_due_now_helper_none") : null : null, [
|
|
264
264
|
Z,
|
|
265
265
|
Q,
|
|
266
266
|
$,
|
|
267
267
|
C,
|
|
268
|
-
|
|
268
|
+
m
|
|
269
269
|
]), St = lt.handleSubmit(async (e) => {
|
|
270
|
-
if (!(!
|
|
270
|
+
if (!(!b || W.length === 0)) {
|
|
271
271
|
Ve(!0);
|
|
272
272
|
try {
|
|
273
|
-
let t = await
|
|
274
|
-
storeSlug:
|
|
273
|
+
let t = await o(ae, {
|
|
274
|
+
storeSlug: b,
|
|
275
275
|
schedule: {
|
|
276
276
|
startDate: L.start_date,
|
|
277
277
|
endDate: L.end_date,
|
|
@@ -290,78 +290,78 @@ function p() {
|
|
|
290
290
|
notes: e.notes
|
|
291
291
|
},
|
|
292
292
|
items: W
|
|
293
|
-
}), n =
|
|
293
|
+
}), n = oe.parse(t);
|
|
294
294
|
if (!n.success || !n.checkout) {
|
|
295
|
-
|
|
295
|
+
f.error(n.errorCode === "online_payment_provider_missing" ? m("checkout_payment_error") : n.message || m("checkout_payment_error"));
|
|
296
296
|
return;
|
|
297
297
|
}
|
|
298
|
-
n.checkout.requiresPayment ||
|
|
298
|
+
n.checkout.requiresPayment || f.success(m("checkout_success_toast")), await Fe(n.checkout.nextPath), Be();
|
|
299
299
|
} catch (e) {
|
|
300
|
-
console.error("Failed to submit storefront checkout", e),
|
|
300
|
+
console.error("Failed to submit storefront checkout", e), f.error(m("checkout_payment_error"));
|
|
301
301
|
} finally {
|
|
302
302
|
Ve(!1);
|
|
303
303
|
}
|
|
304
304
|
}
|
|
305
|
-
}), Ct =
|
|
306
|
-
return R.lines.length === 0 ? /* @__PURE__ */
|
|
305
|
+
}), Ct = m(yt ? "checkout_continue_to_payment" : "checkout_submit"), wt = L.fulfillment === "delivery" && L.start_address.trim().length === 0, Tt = !S && !He && !Ue && !Je && !Xe && !!C && !wt && W.length > 0;
|
|
306
|
+
return R.lines.length === 0 ? /* @__PURE__ */ u("div", {
|
|
307
307
|
className: "mx-auto max-w-3xl px-4 py-10 sm:px-6",
|
|
308
|
-
children: /* @__PURE__ */
|
|
308
|
+
children: /* @__PURE__ */ d("div", {
|
|
309
309
|
className: "rounded-xl border border-slate-200 bg-white p-4 shadow-sm",
|
|
310
310
|
children: [
|
|
311
|
-
/* @__PURE__ */
|
|
311
|
+
/* @__PURE__ */ u("h1", {
|
|
312
312
|
className: "text-xl font-semibold tracking-tight text-slate-950",
|
|
313
|
-
children: /* @__PURE__ */
|
|
313
|
+
children: /* @__PURE__ */ u("span", { children: m("cart_empty_title") })
|
|
314
314
|
}),
|
|
315
|
-
/* @__PURE__ */
|
|
315
|
+
/* @__PURE__ */ u("p", {
|
|
316
316
|
className: "mt-2 text-sm text-slate-600",
|
|
317
|
-
children: /* @__PURE__ */
|
|
317
|
+
children: /* @__PURE__ */ u("span", { children: m("cart_empty_description") })
|
|
318
318
|
}),
|
|
319
|
-
/* @__PURE__ */
|
|
319
|
+
/* @__PURE__ */ u("div", {
|
|
320
320
|
className: "mt-6",
|
|
321
|
-
children: /* @__PURE__ */
|
|
321
|
+
children: /* @__PURE__ */ u(Se, {
|
|
322
322
|
to: J,
|
|
323
|
-
children: /* @__PURE__ */
|
|
323
|
+
children: /* @__PURE__ */ d(a, {
|
|
324
324
|
className: "gap-2",
|
|
325
|
-
children: [/* @__PURE__ */
|
|
325
|
+
children: [/* @__PURE__ */ u(De, {
|
|
326
326
|
className: "h-4 w-4",
|
|
327
327
|
"aria-hidden": "true"
|
|
328
|
-
}), /* @__PURE__ */
|
|
328
|
+
}), /* @__PURE__ */ u("span", { children: m("back_to_booking") })]
|
|
329
329
|
})
|
|
330
330
|
})
|
|
331
331
|
})
|
|
332
332
|
]
|
|
333
333
|
})
|
|
334
|
-
}) : /* @__PURE__ */
|
|
334
|
+
}) : /* @__PURE__ */ u("div", {
|
|
335
335
|
className: "mx-auto max-w-7xl px-4 py-8 sm:px-6",
|
|
336
|
-
children: /* @__PURE__ */
|
|
336
|
+
children: /* @__PURE__ */ d("div", {
|
|
337
337
|
className: "flex flex-col gap-6",
|
|
338
338
|
children: [
|
|
339
|
-
/* @__PURE__ */
|
|
339
|
+
/* @__PURE__ */ u(fe, {
|
|
340
340
|
currentStep: "checkout",
|
|
341
341
|
bookingPath: J,
|
|
342
342
|
checkoutPath: ct
|
|
343
343
|
}),
|
|
344
|
-
/* @__PURE__ */
|
|
344
|
+
/* @__PURE__ */ d(Se, {
|
|
345
345
|
to: J,
|
|
346
346
|
className: "inline-flex items-center gap-2 text-sm font-medium text-slate-700 hover:text-slate-950",
|
|
347
|
-
children: [/* @__PURE__ */
|
|
347
|
+
children: [/* @__PURE__ */ u(De, {
|
|
348
348
|
className: "h-4 w-4",
|
|
349
349
|
"aria-hidden": "true"
|
|
350
|
-
}), /* @__PURE__ */
|
|
350
|
+
}), /* @__PURE__ */ u("span", { children: m("back_to_booking") })]
|
|
351
351
|
}),
|
|
352
|
-
/* @__PURE__ */
|
|
352
|
+
/* @__PURE__ */ d("div", {
|
|
353
353
|
className: "grid gap-6 lg:grid-cols-12",
|
|
354
|
-
children: [/* @__PURE__ */
|
|
354
|
+
children: [/* @__PURE__ */ d("div", {
|
|
355
355
|
className: "lg:col-span-7",
|
|
356
|
-
children: [/* @__PURE__ */
|
|
356
|
+
children: [/* @__PURE__ */ u("h1", {
|
|
357
357
|
className: "text-xl font-semibold tracking-tight text-slate-950",
|
|
358
|
-
children: /* @__PURE__ */
|
|
359
|
-
}), /* @__PURE__ */
|
|
358
|
+
children: /* @__PURE__ */ u("span", { children: m("checkout_title") })
|
|
359
|
+
}), /* @__PURE__ */ d("div", {
|
|
360
360
|
className: "mt-5 grid gap-4",
|
|
361
361
|
children: [
|
|
362
|
-
et ? /* @__PURE__ */
|
|
362
|
+
et ? /* @__PURE__ */ u("div", {
|
|
363
363
|
className: "rounded-xl border border-slate-200 bg-white p-3 shadow-sm",
|
|
364
|
-
children: /* @__PURE__ */
|
|
364
|
+
children: /* @__PURE__ */ u(he, {
|
|
365
365
|
value: L.fulfillment,
|
|
366
366
|
onValueChange: (e) => Y({ fulfillment: e }),
|
|
367
367
|
pickupAddress: tt,
|
|
@@ -375,8 +375,8 @@ function p() {
|
|
|
375
375
|
testIdPrefix: "storefront-checkout-fulfillment"
|
|
376
376
|
})
|
|
377
377
|
}) : null,
|
|
378
|
-
/* @__PURE__ */
|
|
379
|
-
/* @__PURE__ */
|
|
378
|
+
/* @__PURE__ */ u(ve, { form: lt }),
|
|
379
|
+
/* @__PURE__ */ u(ye, {
|
|
380
380
|
estimatedTotalLabel: ut,
|
|
381
381
|
couponCode: k?.code,
|
|
382
382
|
discountAmountLabel: dt,
|
|
@@ -395,7 +395,7 @@ function p() {
|
|
|
395
395
|
submitting: S,
|
|
396
396
|
onSelectPaymentMethod: () => {}
|
|
397
397
|
}),
|
|
398
|
-
/* @__PURE__ */
|
|
398
|
+
/* @__PURE__ */ u(a, {
|
|
399
399
|
type: "button",
|
|
400
400
|
size: "lg",
|
|
401
401
|
onClick: () => {
|
|
@@ -403,15 +403,15 @@ function p() {
|
|
|
403
403
|
},
|
|
404
404
|
disabled: !Tt,
|
|
405
405
|
className: "mt-4 w-fit",
|
|
406
|
-
children: /* @__PURE__ */
|
|
406
|
+
children: /* @__PURE__ */ u("span", { children: Ct })
|
|
407
407
|
}),
|
|
408
|
-
wt ? /* @__PURE__ */
|
|
408
|
+
wt ? /* @__PURE__ */ u("p", {
|
|
409
409
|
className: "text-sm text-slate-600",
|
|
410
|
-
children: /* @__PURE__ */
|
|
410
|
+
children: /* @__PURE__ */ u("span", { children: m("checkout_delivery_address_required") })
|
|
411
411
|
}) : null
|
|
412
412
|
]
|
|
413
413
|
})]
|
|
414
|
-
}), /* @__PURE__ */
|
|
414
|
+
}), /* @__PURE__ */ u(be, {
|
|
415
415
|
lines: U.lines,
|
|
416
416
|
itemCount: Le,
|
|
417
417
|
totalPerDayMinor: U.totalPerDayMinor,
|
|
@@ -427,7 +427,7 @@ function p() {
|
|
|
427
427
|
coupon: {
|
|
428
428
|
code: D,
|
|
429
429
|
appliedCode: k?.code,
|
|
430
|
-
discountLabel: k && K > 0 ?
|
|
430
|
+
discountLabel: k && K > 0 ? p(K, X, h.language) : null,
|
|
431
431
|
message: Ye,
|
|
432
432
|
error: Xe,
|
|
433
433
|
loading: Je,
|
|
@@ -449,4 +449,4 @@ function p() {
|
|
|
449
449
|
});
|
|
450
450
|
}
|
|
451
451
|
//#endregion
|
|
452
|
-
export {
|
|
452
|
+
export { m as default };
|
|
@@ -111,9 +111,9 @@ function s({ estimatedTotalLabel: s, couponCode: c, discountAmountLabel: l, tota
|
|
|
111
111
|
}), /* @__PURE__ */ r("span", { children: w("checkout_payment_loading") })]
|
|
112
112
|
}) : null,
|
|
113
113
|
v ? /* @__PURE__ */ r("div", {
|
|
114
|
-
className: "grid gap-3 rounded-
|
|
114
|
+
className: "grid gap-3 rounded-md bg-destructive p-3 text-destructive-foreground shadow-sm",
|
|
115
115
|
children: /* @__PURE__ */ i("div", {
|
|
116
|
-
className: "flex items-start gap-2 text-sm
|
|
116
|
+
className: "flex items-start gap-2 text-sm",
|
|
117
117
|
children: [/* @__PURE__ */ r(o, {
|
|
118
118
|
className: "mt-0.5 h-4 w-4",
|
|
119
119
|
"aria-hidden": "true"
|