@loczer/storefront-sdk 0.238.0 → 0.240.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 +54 -0
- package/dist/StorefrontContext.d.ts.map +1 -1
- package/dist/StorefrontProvider.d.ts +27 -0
- package/dist/StorefrontProvider.d.ts.map +1 -1
- package/dist/chunks/pkg/booking-engine/dist/models/{LocalizedString-D_TRgAdr.js → LocalizedString-JmOX62C3.js} +1 -1
- package/dist/chunks/pkg/booking-engine/dist/models/{Product.shared-CWP_qule.js → Product.shared-C_HehlKK.js} +3 -3
- package/dist/chunks/pkg/booking-engine/dist/models/types-ynW5hdp8.js +8 -0
- package/dist/chunks/pkg/booking-engine/dist/schemas/{base-asset-BhIOL2rP.js → base-asset-CFAxfmRW.js} +3 -3
- package/dist/chunks/pkg/booking-engine/dist/schemas/{base-booking-BJXFzDM5.js → base-booking-CZOR9kya.js} +13 -12
- package/dist/chunks/pkg/booking-engine/dist/schemas/base-product-QYQBl0fQ.js +4 -0
- package/dist/chunks/pkg/booking-engine/dist/schemas/{booking-engine-configuration-LnrhShqm.js → booking-engine-configuration-CxKlxKCo.js} +1 -1
- package/dist/chunks/pkg/booking-engine/dist/schemas/booking-reference-DLKcpIa4.js +13 -0
- package/dist/chunks/pkg/booking-engine/dist/schemas/{cart-inputs-3lBblkB0.js → cart-inputs-D1KobIdr.js} +4 -4
- package/dist/chunks/pkg/booking-engine/dist/schemas/{insurance-DXc34Bzy.js → insurance-B-Vmdlxo.js} +3 -3
- package/dist/chunks/pkg/booking-engine/dist/schemas/{product-id--yyUTH1Y.js → product-id-ChdStzgp.js} +1 -1
- package/dist/chunks/pkg/booking-engine/dist/schemas/{public-booking-engine-configuration-CEM9mexX.js → public-booking-engine-configuration-BwWn9aK0.js} +1 -1
- package/dist/chunks/pkg/booking-engine/dist/schemas-lb2iTDMd.js +17 -0
- package/dist/components/ContractSaleDocument/InvoiceDetails.js +1 -1
- package/dist/components/ContractSaleDocument/SignatureModal.d.ts.map +1 -1
- package/dist/components/ContractSaleDocument/SignatureModal.js +79 -54
- package/dist/components/FaqSection/index.d.ts.map +1 -1
- package/dist/components/FaqSection/index.js +44 -26
- package/dist/components/Footer/businessHoursStatus.js +1 -1
- package/dist/components/SignatureInput/index.js +2 -1
- package/dist/components/SignatureInput.d.ts.map +1 -1
- package/dist/components/StorefrontInformationDocument/index.d.ts +4 -0
- package/dist/components/StorefrontInformationDocument/index.d.ts.map +1 -1
- package/dist/components/StorefrontInformationDocument/index.js +20 -11
- package/dist/i18n/en.js +1 -1
- package/dist/i18n/fr.js +1 -1
- package/dist/index.d.ts +193 -0
- package/dist/index.js +87 -86
- package/dist/lib/booking-period.js +1 -1
- package/dist/lib/booking.js +2 -2
- package/dist/lib/checkoutSubmit.d.ts.map +1 -1
- package/dist/lib/checkoutSubmit.js +45 -44
- package/dist/pages/CheckoutPage.d.ts.map +1 -1
- package/dist/pages/CheckoutPage.js +152 -151
- package/dist/pages/InsuranceTermsPage.d.ts.map +1 -1
- package/dist/pages/InsuranceTermsPage.js +18 -16
- package/dist/pages/checkout/components/CheckoutDetailsCard.d.ts +2 -1
- package/dist/pages/checkout/components/CheckoutDetailsCard.d.ts.map +1 -1
- package/dist/pages/checkout/components/CheckoutDetailsCard.js +17 -14
- package/dist/storefront.css +1 -1
- package/dist/storefrontSchemas.d.ts +89 -0
- package/dist/storefrontSchemas.d.ts.map +1 -1
- package/dist/storefrontSchemas.js +21 -17
- package/package.json +1 -1
- package/dist/chunks/pkg/booking-engine/dist/models/types-rIp4ReXN.js +0 -8
- package/dist/chunks/pkg/booking-engine/dist/schemas/base-product-Bde9lJQD.js +0 -4
- package/dist/chunks/pkg/booking-engine/dist/schemas-JjiUWFIv.js +0 -16
|
@@ -47,16 +47,16 @@ var Le = .2, f = (e, t, n) => {
|
|
|
47
47
|
}
|
|
48
48
|
};
|
|
49
49
|
function p() {
|
|
50
|
-
let { t: p, i18n: m } = Me(), { storefrontConfiguration: h } = fe(), ze = h.workspace?.workspaceLanguage, { bikes: g, accessories: Be } = pe(), { storeSlug: _ } = Ae(), [v, Ve] = je(), He = ke(), { items: Ue, itemCount: We, isReady: Ge, setQuantity: Ke, removeItem: qe, beginCheckoutSubmission: Je, confirmCheckoutPaymentSession: Ye, clearCheckoutSession: Xe, clear: Ze } = ee(), [
|
|
51
|
-
let e = t(
|
|
50
|
+
let { t: p, i18n: m } = Me(), { storefrontConfiguration: h } = fe(), ze = h.workspace?.workspaceLanguage, { bikes: g, accessories: Be } = pe(), { storeSlug: _ } = Ae(), [v, Ve] = je(), He = ke(), { items: Ue, itemCount: We, isReady: Ge, setQuantity: Ke, removeItem: qe, beginCheckoutSubmission: Je, confirmCheckoutPaymentSession: Ye, clearCheckoutSession: Xe, clear: Ze } = ee(), [Qe, $e] = l(!1), et = De(!1), [y, b] = l(null), [tt, x] = l(!1), [S, C] = l(null), nt = v.get("coupon") ?? v.get("code") ?? "", [rt, w] = l(nt), [it, at] = l(nt.trim()), [T, E] = l(null), [D, O] = l(null), [k, A] = l(!1), [ot, j] = l(null), [st, M] = l(null), [N, ct] = l(!1), [P, lt] = l(!1), ut = n(v).toString(), dt = c(() => r(new URLSearchParams(ut), _), [ut, _]), F = h.settings.fulfillmentModes.includes("delivery"), ft = h.settings.deliveryDisabledReason.trim(), pt = F || ft.length > 0, mt = h.shop.address?.trim() ?? "", I = c(() => {
|
|
51
|
+
let e = t(dt, {
|
|
52
52
|
startTime: "",
|
|
53
53
|
endTime: ""
|
|
54
54
|
});
|
|
55
|
-
return e.fulfillment === "delivery" && !
|
|
55
|
+
return e.fulfillment === "delivery" && !F ? {
|
|
56
56
|
...e,
|
|
57
57
|
fulfillment: "pickup"
|
|
58
58
|
} : e;
|
|
59
|
-
}, [
|
|
59
|
+
}, [dt, F]), L = c(() => le(I), [I]), R = h.bookingEngine.pricing, ht = te(I, R, h.bookingEngine.shop.timeZone), gt = ne(R.baseUnit, p), _t = ht?.billableUnitCount, z = c(() => re({
|
|
60
60
|
items: Ue,
|
|
61
61
|
language: m.language,
|
|
62
62
|
fallbackLanguage: ze,
|
|
@@ -64,85 +64,85 @@ function p() {
|
|
|
64
64
|
bikes: g,
|
|
65
65
|
accessories: Be
|
|
66
66
|
},
|
|
67
|
-
priceUnit:
|
|
68
|
-
billableUnitCount:
|
|
67
|
+
priceUnit: R.baseUnit,
|
|
68
|
+
billableUnitCount: _t
|
|
69
69
|
}), [
|
|
70
70
|
Be,
|
|
71
71
|
g,
|
|
72
|
-
|
|
72
|
+
_t,
|
|
73
73
|
m.language,
|
|
74
74
|
Ue,
|
|
75
|
-
|
|
75
|
+
R.baseUnit,
|
|
76
76
|
ze
|
|
77
|
-
]),
|
|
77
|
+
]), B = c(() => z.lines.map((e) => ({
|
|
78
78
|
productId: e.checkoutProductId,
|
|
79
79
|
productVariantId: e.productVariantId,
|
|
80
80
|
quantity: e.quantity
|
|
81
|
-
})), [
|
|
81
|
+
})), [z.lines]), [vt, V] = l([]), [H, U] = l(!1);
|
|
82
82
|
s(() => {
|
|
83
|
-
if (!_ ||
|
|
84
|
-
|
|
83
|
+
if (!_ || B.length === 0) {
|
|
84
|
+
V([]), U(!1);
|
|
85
85
|
return;
|
|
86
86
|
}
|
|
87
|
-
if (!
|
|
88
|
-
|
|
87
|
+
if (!L) {
|
|
88
|
+
V([]), U(!1);
|
|
89
89
|
return;
|
|
90
90
|
}
|
|
91
91
|
let e = !1;
|
|
92
|
-
return
|
|
92
|
+
return U(!0), V([]), (async () => {
|
|
93
93
|
try {
|
|
94
94
|
let t = await o(oe, {
|
|
95
95
|
storeSlug: _,
|
|
96
|
-
schedule:
|
|
97
|
-
products:
|
|
96
|
+
schedule: L,
|
|
97
|
+
products: B
|
|
98
98
|
}), n = ue.parse(t);
|
|
99
99
|
if (e) return;
|
|
100
|
-
|
|
100
|
+
V(n.success ? n.availability ?? [] : []);
|
|
101
101
|
} catch (t) {
|
|
102
102
|
if (e) return;
|
|
103
|
-
console.error("Failed to load checkout cart availability", t),
|
|
103
|
+
console.error("Failed to load checkout cart availability", t), V([]);
|
|
104
104
|
} finally {
|
|
105
|
-
e ||
|
|
105
|
+
e || U(!1);
|
|
106
106
|
}
|
|
107
107
|
})(), () => {
|
|
108
108
|
e = !0;
|
|
109
109
|
};
|
|
110
110
|
}, [
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
111
|
+
I.endDate,
|
|
112
|
+
I.endTime,
|
|
113
|
+
I.startDate,
|
|
114
|
+
I.startTime,
|
|
115
|
+
L,
|
|
116
|
+
B,
|
|
117
117
|
_
|
|
118
118
|
]);
|
|
119
|
-
let
|
|
120
|
-
...
|
|
121
|
-
lines:
|
|
122
|
-
let t =
|
|
119
|
+
let yt = c(() => new Map(vt.map((e) => [se(e.productId, e.productVariantId), e])), [vt]), bt = c(() => ({
|
|
120
|
+
...z,
|
|
121
|
+
lines: z.lines.map((e) => {
|
|
122
|
+
let t = yt.get(se(e.checkoutProductId, e.productVariantId)), n = t ? ce(t) : e.availabilityStatus === "OUT_OF_STOCK" ? "unavailable" : void 0;
|
|
123
123
|
return {
|
|
124
124
|
...e,
|
|
125
|
-
insufficientCapacity: !
|
|
126
|
-
availabilityIssue:
|
|
125
|
+
insufficientCapacity: !H && n !== void 0,
|
|
126
|
+
availabilityIssue: H ? void 0 : n
|
|
127
127
|
};
|
|
128
128
|
})
|
|
129
129
|
}), [
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
]),
|
|
130
|
+
yt,
|
|
131
|
+
H,
|
|
132
|
+
z
|
|
133
|
+
]), W = c(() => z.lines.map((e) => ({
|
|
134
134
|
kind: e.kind,
|
|
135
135
|
productId: e.checkoutProductId,
|
|
136
136
|
productVariantId: e.productVariantId,
|
|
137
137
|
quantity: e.quantity
|
|
138
|
-
})), [
|
|
139
|
-
let t =
|
|
138
|
+
})), [z.lines]), xt = new Map(g.map((e) => [e.checkoutProductId?.trim() || e.id, e])), G = z.lines.flatMap((e) => {
|
|
139
|
+
let t = xt.get(e.checkoutProductId);
|
|
140
140
|
return t?.insurance?.enabled ? [{
|
|
141
141
|
quantity: e.quantity,
|
|
142
142
|
pricePerDayMinor: t.insurance.pricePerDayMinor,
|
|
143
143
|
deductibleAmountMinor: t.insurance.deductibleAmountMinor
|
|
144
144
|
}] : [];
|
|
145
|
-
}),
|
|
145
|
+
}), K = h.modules?.insurance?.enabled === !0 && G.length > 0, q = K && P, St = G.reduce((e, t) => e + t.pricePerDayMinor * t.quantity, 0), Ct = G.reduce((e, t) => Math.max(e, t.deductibleAmountMinor), 0), wt = z.totalMinor ?? 0, J = D?.totalMinor ?? wt, Y = D?.insuranceSubtotalMinor ?? 0, Tt = T?.discountAmountMinor ?? 0, X = e(new URLSearchParams(), I).toString(), Z = `/${_ ?? ""}/booking${X ? `?${X}` : ""}`, Et = `/${_ ?? ""}/checkout${X ? `?${X}` : ""}`, Dt = Fe({
|
|
146
146
|
resolver: Ie(Ee),
|
|
147
147
|
defaultValues: {
|
|
148
148
|
fullName: "",
|
|
@@ -152,130 +152,130 @@ function p() {
|
|
|
152
152
|
}
|
|
153
153
|
});
|
|
154
154
|
s(() => {
|
|
155
|
-
i(_,
|
|
156
|
-
}, [
|
|
157
|
-
!
|
|
158
|
-
}, [
|
|
159
|
-
let
|
|
155
|
+
i(_, I);
|
|
156
|
+
}, [I, _]), s(() => {
|
|
157
|
+
!K && P && lt(!1);
|
|
158
|
+
}, [P, K]);
|
|
159
|
+
let Q = (t) => {
|
|
160
160
|
let n = {
|
|
161
|
-
...
|
|
161
|
+
...I,
|
|
162
162
|
...t
|
|
163
163
|
}, r = e(v, n);
|
|
164
164
|
r.toString() !== v.toString() && (Ve(r, { replace: !0 }), i(_, r));
|
|
165
165
|
};
|
|
166
166
|
s(() => {
|
|
167
|
-
if (!_ ||
|
|
168
|
-
|
|
167
|
+
if (!_ || W.length === 0 || !L) {
|
|
168
|
+
E(null), O(null), A(!1), j(null), M(null);
|
|
169
169
|
return;
|
|
170
170
|
}
|
|
171
|
-
let e =
|
|
172
|
-
return
|
|
171
|
+
let e = it.trim(), t = e.length === 0 && !N, n = !1;
|
|
172
|
+
return A(!0), M(null), j(null), (async () => {
|
|
173
173
|
try {
|
|
174
174
|
let r = await o(ye, {
|
|
175
175
|
storeSlug: _,
|
|
176
|
-
schedule:
|
|
177
|
-
items:
|
|
176
|
+
schedule: L,
|
|
177
|
+
items: W,
|
|
178
178
|
couponCode: e || void 0,
|
|
179
179
|
includeAutoApply: t,
|
|
180
|
-
insuranceAccepted:
|
|
180
|
+
insuranceAccepted: q
|
|
181
181
|
}), i = be.parse(r);
|
|
182
182
|
if (n) return;
|
|
183
|
-
if (
|
|
183
|
+
if (O(typeof i.subtotalMinor == "number" && typeof i.totalMinor == "number" ? {
|
|
184
184
|
subtotalMinor: i.subtotalMinor,
|
|
185
185
|
totalMinor: i.totalMinor,
|
|
186
186
|
lateReturnSurchargeMinor: i.lateReturnSurchargeMinor,
|
|
187
187
|
insuranceSubtotalMinor: i.insuranceSubtotalMinor,
|
|
188
188
|
insuranceBillableDays: i.insuranceBillableDays
|
|
189
189
|
} : null), !i.success) {
|
|
190
|
-
|
|
190
|
+
E(null), M(i.message || p("checkout_coupon_invalid"));
|
|
191
191
|
return;
|
|
192
192
|
}
|
|
193
|
-
|
|
193
|
+
E(i.coupon ?? null), i.coupon && (i.coupon.autoApplied && e.length === 0 ? (w(i.coupon.code), j(p("checkout_coupon_auto_applied", { code: i.coupon.code }))) : j(p("checkout_coupon_manual_applied")));
|
|
194
194
|
} catch (e) {
|
|
195
195
|
if (n) return;
|
|
196
|
-
console.error("Failed to verify checkout coupon", e),
|
|
196
|
+
console.error("Failed to verify checkout coupon", e), E(null), O(null), M(p("checkout_coupon_error"));
|
|
197
197
|
} finally {
|
|
198
|
-
n ||
|
|
198
|
+
n || A(!1);
|
|
199
199
|
}
|
|
200
200
|
})(), () => {
|
|
201
201
|
n = !0;
|
|
202
202
|
};
|
|
203
203
|
}, [
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
204
|
+
N,
|
|
205
|
+
I.endDate,
|
|
206
|
+
I.endTime,
|
|
207
|
+
I.startDate,
|
|
208
|
+
I.startTime,
|
|
209
|
+
L,
|
|
210
|
+
W,
|
|
211
|
+
q,
|
|
212
212
|
_,
|
|
213
|
-
|
|
213
|
+
it,
|
|
214
214
|
p
|
|
215
215
|
]), s(() => {
|
|
216
|
-
if (!_ ||
|
|
217
|
-
|
|
216
|
+
if (!_ || z.lines.length === 0 || !L) {
|
|
217
|
+
b(null), C(null), x(!1);
|
|
218
218
|
return;
|
|
219
219
|
}
|
|
220
220
|
let e = !1;
|
|
221
|
-
return
|
|
221
|
+
return x(!0), C(null), (async () => {
|
|
222
222
|
try {
|
|
223
223
|
let t = await o(_e, {
|
|
224
224
|
storeSlug: _,
|
|
225
|
-
schedule:
|
|
226
|
-
estimatedTotalMinor:
|
|
227
|
-
insuranceAmountMinor:
|
|
225
|
+
schedule: L,
|
|
226
|
+
estimatedTotalMinor: J,
|
|
227
|
+
insuranceAmountMinor: Y
|
|
228
228
|
}), n = ve.parse(t);
|
|
229
229
|
if (e) return;
|
|
230
230
|
if (!n.success || !n.decision) {
|
|
231
|
-
|
|
231
|
+
b(null), C(n.message || p("checkout_payment_error"));
|
|
232
232
|
return;
|
|
233
233
|
}
|
|
234
|
-
|
|
234
|
+
b(n.decision);
|
|
235
235
|
} catch (t) {
|
|
236
236
|
if (e) return;
|
|
237
|
-
console.error("Failed to load checkout payment decision", t),
|
|
237
|
+
console.error("Failed to load checkout payment decision", t), b(null), C(p("checkout_payment_error"));
|
|
238
238
|
} finally {
|
|
239
|
-
e ||
|
|
239
|
+
e || x(!1);
|
|
240
240
|
}
|
|
241
241
|
})(), () => {
|
|
242
242
|
e = !0;
|
|
243
243
|
};
|
|
244
244
|
}, [
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
245
|
+
I.endDate,
|
|
246
|
+
I.endTime,
|
|
247
|
+
I.startDate,
|
|
248
|
+
I.startTime,
|
|
249
|
+
L,
|
|
250
|
+
J,
|
|
251
|
+
z.lines.length,
|
|
250
252
|
Y,
|
|
251
|
-
B.lines.length,
|
|
252
|
-
X,
|
|
253
253
|
_,
|
|
254
254
|
p
|
|
255
255
|
]);
|
|
256
|
-
let $ =
|
|
257
|
-
if (!_ ||
|
|
258
|
-
|
|
256
|
+
let $ = y?.currency ?? "EUR", Ot = f(J, $, m.language), kt = Math.max(0, J - Y), At = Math.round(kt / 1.2), jt = At + Y, Mt = Math.max(0, kt - At), Nt = f(jt, $, m.language), Pt = f(Mt, $, m.language), Ft = Re(Le, m.language), It = Y > 0 ? f(Y, $, m.language) : void 0, Lt = y?.amountToCollectMinor ?? 0, Rt = y?.shouldCollectOnlinePayment === !0 && Lt > 0, zt = Dt.handleSubmit(async (e) => {
|
|
257
|
+
if (!_ || W.length === 0 || !L || et.current) return;
|
|
258
|
+
$e(!0), et.current = !0;
|
|
259
259
|
let t = Je();
|
|
260
260
|
try {
|
|
261
261
|
let n = await o(ie, {
|
|
262
262
|
storeSlug: _,
|
|
263
263
|
checkoutSessionId: t.checkoutSessionId,
|
|
264
264
|
replacesCheckoutSessionId: t.replacesCheckoutSessionId,
|
|
265
|
-
schedule:
|
|
266
|
-
fulfillment:
|
|
267
|
-
startAddress:
|
|
268
|
-
endAddress:
|
|
269
|
-
couponCode:
|
|
270
|
-
couponAutoApplied: !
|
|
271
|
-
insuranceAccepted:
|
|
265
|
+
schedule: L,
|
|
266
|
+
fulfillment: I.fulfillment,
|
|
267
|
+
startAddress: I.fulfillment === "delivery" ? I.startAddress : void 0,
|
|
268
|
+
endAddress: I.fulfillment === "delivery" ? I.endAddress : void 0,
|
|
269
|
+
couponCode: T?.code,
|
|
270
|
+
couponAutoApplied: !N && T?.autoApplied,
|
|
271
|
+
insuranceAccepted: q,
|
|
272
272
|
customer: {
|
|
273
273
|
name: e.fullName,
|
|
274
274
|
email: e.email,
|
|
275
275
|
phone: e.phone,
|
|
276
276
|
notes: e.notes
|
|
277
277
|
},
|
|
278
|
-
items:
|
|
278
|
+
items: W
|
|
279
279
|
}), r = ae.parse(n);
|
|
280
280
|
if (!r.success || !r.checkout) {
|
|
281
281
|
Xe(), a.error(r.message || p("checkout_payment_error"));
|
|
@@ -285,48 +285,50 @@ function p() {
|
|
|
285
285
|
} catch (e) {
|
|
286
286
|
console.error("Failed to submit storefront checkout", e), a.error(p("checkout_payment_error"));
|
|
287
287
|
} finally {
|
|
288
|
-
|
|
288
|
+
et.current = !1, $e(!1);
|
|
289
289
|
}
|
|
290
|
-
}), Bt = p(Rt ? "checkout_continue_to_payment" : "checkout_submit"), Vt = p(Rt ? "checkout_mobile_continue_to_payment" : "checkout_mobile_submit"), Ht =
|
|
290
|
+
}), Bt = p(Rt ? "checkout_continue_to_payment" : "checkout_submit"), Vt = p(Rt ? "checkout_mobile_continue_to_payment" : "checkout_mobile_submit"), Ht = I.fulfillment === "delivery" && I.startAddress.trim().length === 0, Ut = !Qe && !tt && !S && !H && !k && !st && !!y && !!L && !Ht && W.length > 0, Wt = () => {
|
|
291
|
+
Ut && zt();
|
|
292
|
+
}, Gt = ({ className: e, presentation: t, stickyTopClassName: n } = {}) => /* @__PURE__ */ u(Te, {
|
|
291
293
|
className: e,
|
|
292
|
-
lines:
|
|
294
|
+
lines: bt.lines,
|
|
293
295
|
itemCount: We,
|
|
294
|
-
baseUnitLabel:
|
|
296
|
+
baseUnitLabel: gt,
|
|
295
297
|
bookingSubtotalLabel: Nt,
|
|
296
298
|
vatAmountLabel: Pt,
|
|
297
299
|
vatRateLabel: Ft,
|
|
298
300
|
bookingTotalLabel: Ot,
|
|
299
|
-
bookingPeriod:
|
|
300
|
-
bookingPath:
|
|
301
|
-
startDate:
|
|
302
|
-
startTime:
|
|
303
|
-
endDate:
|
|
304
|
-
endTime:
|
|
301
|
+
bookingPeriod: L ? {
|
|
302
|
+
bookingPath: Z,
|
|
303
|
+
startDate: L.startDate,
|
|
304
|
+
startTime: L.startTime,
|
|
305
|
+
endDate: L.endDate,
|
|
306
|
+
endTime: L.endTime
|
|
305
307
|
} : void 0,
|
|
306
308
|
presentation: t,
|
|
307
309
|
stickyTopClassName: n,
|
|
308
310
|
onQuantityChange: Ke,
|
|
309
311
|
onRemove: qe,
|
|
310
312
|
coupon: {
|
|
311
|
-
code:
|
|
312
|
-
appliedCode:
|
|
313
|
-
discountLabel:
|
|
314
|
-
message:
|
|
315
|
-
error:
|
|
316
|
-
loading:
|
|
317
|
-
disabled:
|
|
313
|
+
code: rt,
|
|
314
|
+
appliedCode: T?.code,
|
|
315
|
+
discountLabel: T && Tt > 0 ? f(Tt, $, m.language) : null,
|
|
316
|
+
message: ot,
|
|
317
|
+
error: st,
|
|
318
|
+
loading: k,
|
|
319
|
+
disabled: Qe,
|
|
318
320
|
onCodeChange: (e) => {
|
|
319
|
-
|
|
321
|
+
w(e), M(null), j(null);
|
|
320
322
|
},
|
|
321
323
|
onApply: () => {
|
|
322
|
-
|
|
324
|
+
ct(!1), at(rt.trim());
|
|
323
325
|
},
|
|
324
326
|
onRemove: () => {
|
|
325
|
-
|
|
327
|
+
w(""), at(""), E(null), O(null), M(null), j(null), ct(!0);
|
|
326
328
|
}
|
|
327
329
|
}
|
|
328
330
|
});
|
|
329
|
-
return Ge ?
|
|
331
|
+
return Ge ? z.lines.length === 0 ? /* @__PURE__ */ u("div", {
|
|
330
332
|
className: "mx-auto max-w-3xl px-4 py-10 sm:px-6",
|
|
331
333
|
children: /* @__PURE__ */ d("div", {
|
|
332
334
|
className: "rounded-xl border border-slate-200 bg-white p-4 shadow-sm",
|
|
@@ -342,7 +344,7 @@ function p() {
|
|
|
342
344
|
/* @__PURE__ */ u("div", {
|
|
343
345
|
className: "mt-6",
|
|
344
346
|
children: /* @__PURE__ */ u(Oe, {
|
|
345
|
-
to:
|
|
347
|
+
to: Z,
|
|
346
348
|
children: /* @__PURE__ */ d(de, {
|
|
347
349
|
className: "gap-2",
|
|
348
350
|
children: [/* @__PURE__ */ u(Pe, {
|
|
@@ -356,9 +358,9 @@ function p() {
|
|
|
356
358
|
})
|
|
357
359
|
}) : /* @__PURE__ */ d(he, {
|
|
358
360
|
currentStep: "checkout",
|
|
359
|
-
bookingPath:
|
|
360
|
-
checkoutPath:
|
|
361
|
-
backPath:
|
|
361
|
+
bookingPath: Z,
|
|
362
|
+
checkoutPath: Et,
|
|
363
|
+
backPath: Z,
|
|
362
364
|
backLabel: p("back_to_booking"),
|
|
363
365
|
children: [/* @__PURE__ */ d("div", {
|
|
364
366
|
className: "grid gap-6 pb-24 lg:grid-cols-12 lg:pb-0",
|
|
@@ -369,7 +371,7 @@ function p() {
|
|
|
369
371
|
className: "text-xl font-semibold tracking-tight text-slate-950",
|
|
370
372
|
children: /* @__PURE__ */ u("span", { children: p("checkout_title") })
|
|
371
373
|
}),
|
|
372
|
-
|
|
374
|
+
L ? null : /* @__PURE__ */ u("p", {
|
|
373
375
|
role: "alert",
|
|
374
376
|
className: "mt-3 text-sm text-destructive",
|
|
375
377
|
children: /* @__PURE__ */ u("span", { children: p("booking_time_slots_required") })
|
|
@@ -377,33 +379,36 @@ function p() {
|
|
|
377
379
|
/* @__PURE__ */ d("div", {
|
|
378
380
|
className: "mt-5 grid gap-4",
|
|
379
381
|
children: [
|
|
380
|
-
|
|
382
|
+
pt ? /* @__PURE__ */ u("div", {
|
|
381
383
|
className: "rounded-xl border border-slate-200 bg-white p-3 shadow-sm",
|
|
382
384
|
children: /* @__PURE__ */ u(me, {
|
|
383
|
-
value:
|
|
384
|
-
onValueChange: (e) =>
|
|
385
|
-
pickupAddress:
|
|
386
|
-
deliveryEnabled:
|
|
387
|
-
deliveryDisabledReason:
|
|
388
|
-
startAddress:
|
|
389
|
-
onStartAddressChange: (e) =>
|
|
390
|
-
endAddress:
|
|
391
|
-
onEndAddressChange: (e) =>
|
|
385
|
+
value: I.fulfillment,
|
|
386
|
+
onValueChange: (e) => Q({ fulfillment: e }),
|
|
387
|
+
pickupAddress: mt,
|
|
388
|
+
deliveryEnabled: F,
|
|
389
|
+
deliveryDisabledReason: ft,
|
|
390
|
+
startAddress: I.startAddress,
|
|
391
|
+
onStartAddressChange: (e) => Q({ startAddress: e }),
|
|
392
|
+
endAddress: I.endAddress,
|
|
393
|
+
onEndAddressChange: (e) => Q({ endAddress: e }),
|
|
392
394
|
showPickupAddressWhenPickupOnly: !1,
|
|
393
395
|
testIdPrefix: "storefront-checkout-fulfillment"
|
|
394
396
|
})
|
|
395
397
|
}) : null,
|
|
396
|
-
/* @__PURE__ */ u(xe, {
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
398
|
+
/* @__PURE__ */ u(xe, {
|
|
399
|
+
form: Dt,
|
|
400
|
+
onSubmit: Wt
|
|
401
|
+
}),
|
|
402
|
+
K ? /* @__PURE__ */ u(Se, {
|
|
403
|
+
accepted: q,
|
|
404
|
+
disabled: Qe || k,
|
|
405
|
+
dailyAmountLabel: f(St, $, m.language),
|
|
401
406
|
totalAmountLabel: It,
|
|
402
|
-
billableDays:
|
|
403
|
-
deductibleLabel:
|
|
404
|
-
onAcceptedChange:
|
|
407
|
+
billableDays: D?.insuranceBillableDays,
|
|
408
|
+
deductibleLabel: Ct > 0 ? f(Ct, $, m.language) : void 0,
|
|
409
|
+
onAcceptedChange: lt
|
|
405
410
|
}) : null,
|
|
406
|
-
|
|
411
|
+
tt ? /* @__PURE__ */ d("div", {
|
|
407
412
|
className: "flex items-center gap-2 text-sm text-slate-600",
|
|
408
413
|
role: "status",
|
|
409
414
|
children: [/* @__PURE__ */ u(ge, {
|
|
@@ -411,20 +416,18 @@ function p() {
|
|
|
411
416
|
"aria-hidden": "true"
|
|
412
417
|
}), /* @__PURE__ */ u("span", { children: p("checkout_payment_loading") })]
|
|
413
418
|
}) : null,
|
|
414
|
-
|
|
419
|
+
S ? /* @__PURE__ */ d("div", {
|
|
415
420
|
className: "flex items-start gap-2 rounded-md bg-destructive p-3 text-sm text-destructive-foreground shadow-sm",
|
|
416
421
|
role: "alert",
|
|
417
422
|
children: [/* @__PURE__ */ u(Ne, {
|
|
418
423
|
className: "mt-0.5 h-4 w-4",
|
|
419
424
|
"aria-hidden": "true"
|
|
420
|
-
}), /* @__PURE__ */ u("span", { children:
|
|
425
|
+
}), /* @__PURE__ */ u("span", { children: S })]
|
|
421
426
|
}) : null,
|
|
422
427
|
/* @__PURE__ */ u(de, {
|
|
423
428
|
type: "button",
|
|
424
429
|
size: "lg",
|
|
425
|
-
onClick:
|
|
426
|
-
zt();
|
|
427
|
-
},
|
|
430
|
+
onClick: Wt,
|
|
428
431
|
disabled: !Ut,
|
|
429
432
|
className: "mt-4 hidden w-fit lg:inline-flex",
|
|
430
433
|
children: /* @__PURE__ */ u("span", { children: Bt })
|
|
@@ -436,21 +439,19 @@ function p() {
|
|
|
436
439
|
]
|
|
437
440
|
})
|
|
438
441
|
]
|
|
439
|
-
}),
|
|
442
|
+
}), Gt({ className: "hidden lg:block" })]
|
|
440
443
|
}), /* @__PURE__ */ u(we, {
|
|
441
444
|
canSubmit: Ut,
|
|
442
445
|
compactSubmitLabel: Vt,
|
|
443
446
|
itemCount: We,
|
|
444
447
|
submitLabel: Bt,
|
|
445
448
|
totalLabel: Ot,
|
|
446
|
-
onSubmit:
|
|
447
|
-
|
|
448
|
-
},
|
|
449
|
-
children: Wt({ presentation: "flat" })
|
|
449
|
+
onSubmit: Wt,
|
|
450
|
+
children: Gt({ presentation: "flat" })
|
|
450
451
|
})]
|
|
451
452
|
}) : /* @__PURE__ */ u(Ce, {
|
|
452
|
-
bookingPath:
|
|
453
|
-
checkoutPath:
|
|
453
|
+
bookingPath: Z,
|
|
454
|
+
checkoutPath: Et
|
|
454
455
|
});
|
|
455
456
|
}
|
|
456
457
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InsuranceTermsPage.d.ts","sourceRoot":"","sources":["../../src/pages/InsuranceTermsPage.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"InsuranceTermsPage.d.ts","sourceRoot":"","sources":["../../src/pages/InsuranceTermsPage.tsx"],"names":[],"mappings":"AAOA,MAAM,CAAC,OAAO,UAAU,kBAAkB,4CAoBzC"}
|
|
@@ -1,22 +1,24 @@
|
|
|
1
1
|
import { useStorefront as e } from "../StorefrontContext.js";
|
|
2
2
|
import { hasStorefrontRichTextContent as t } from "../lib/richText.js";
|
|
3
|
-
import {
|
|
4
|
-
import { jsx as
|
|
5
|
-
import { useTranslation as
|
|
3
|
+
import { StorefrontInformationDocumentBody as n } from "../components/StorefrontInformationDocument/index.js";
|
|
4
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
5
|
+
import { useTranslation as i } from "react-i18next";
|
|
6
6
|
//#region src/pages/InsuranceTermsPage.tsx
|
|
7
|
-
function
|
|
8
|
-
let { t:
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
7
|
+
function a() {
|
|
8
|
+
let { t: a } = i(), { storefrontConfiguration: o } = e(), s = o.information?.insuranceTerms;
|
|
9
|
+
return /* @__PURE__ */ r("section", {
|
|
10
|
+
className: "min-h-[70vh] bg-white",
|
|
11
|
+
children: /* @__PURE__ */ r("div", {
|
|
12
|
+
className: "mx-auto max-w-7xl px-4 sm:px-6",
|
|
13
|
+
children: /* @__PURE__ */ r("article", {
|
|
14
|
+
className: "mx-auto max-w-3xl py-10 sm:py-14",
|
|
15
|
+
children: /* @__PURE__ */ r(n, {
|
|
16
|
+
contentHtml: t(s) ? s?.html.trim() ?? "" : "",
|
|
17
|
+
unavailableLabel: a("insurance_terms_unavailable", { shop_name: o.shop.name })
|
|
18
|
+
})
|
|
19
|
+
})
|
|
20
|
+
})
|
|
19
21
|
});
|
|
20
22
|
}
|
|
21
23
|
//#endregion
|
|
22
|
-
export {
|
|
24
|
+
export { a as default };
|
|
@@ -3,7 +3,8 @@ import { CheckoutFormValues } from '../types';
|
|
|
3
3
|
type CheckoutForm = ReturnType<typeof useForm<CheckoutFormValues>>;
|
|
4
4
|
type CheckoutDetailsCardProps = {
|
|
5
5
|
form: CheckoutForm;
|
|
6
|
+
onSubmit: () => void;
|
|
6
7
|
};
|
|
7
|
-
export declare function CheckoutDetailsCard({ form }: CheckoutDetailsCardProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export declare function CheckoutDetailsCard({ form, onSubmit }: CheckoutDetailsCardProps): import("react/jsx-runtime").JSX.Element;
|
|
8
9
|
export {};
|
|
9
10
|
//# sourceMappingURL=CheckoutDetailsCard.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckoutDetailsCard.d.ts","sourceRoot":"","sources":["../../../../src/pages/checkout/components/CheckoutDetailsCard.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,eAAe,CAAA;AAK5C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAA;AAOlD,KAAK,YAAY,GAAG,UAAU,CAAC,OAAO,OAAO,CAAC,kBAAkB,CAAC,CAAC,CAAA;AAElE,KAAK,wBAAwB,GAAG;IAC9B,IAAI,EAAE,YAAY,CAAA;
|
|
1
|
+
{"version":3,"file":"CheckoutDetailsCard.d.ts","sourceRoot":"","sources":["../../../../src/pages/checkout/components/CheckoutDetailsCard.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,eAAe,CAAA;AAK5C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAA;AAOlD,KAAK,YAAY,GAAG,UAAU,CAAC,OAAO,OAAO,CAAC,kBAAkB,CAAC,CAAC,CAAA;AAElE,KAAK,wBAAwB,GAAG;IAC9B,IAAI,EAAE,YAAY,CAAA;IAClB,QAAQ,EAAE,MAAM,IAAI,CAAA;CACrB,CAAA;AAOD,wBAAgB,mBAAmB,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,wBAAwB,2CAgH/E"}
|