@loczer/storefront-sdk 0.239.0 → 0.241.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.
Files changed (42) hide show
  1. package/dist/StorefrontContext.d.ts +54 -0
  2. package/dist/StorefrontContext.d.ts.map +1 -1
  3. package/dist/StorefrontProvider.d.ts +27 -0
  4. package/dist/StorefrontProvider.d.ts.map +1 -1
  5. package/dist/chunks/pkg/booking-engine/dist/models/{Product.shared-C_HehlKK.js → Product.shared-VisFafx-.js} +6 -1
  6. package/dist/chunks/pkg/booking-engine/dist/schemas/{base-asset-CFAxfmRW.js → base-asset-BuqI-BM_.js} +2 -1
  7. package/dist/chunks/pkg/booking-engine/dist/schemas/{base-booking-CZOR9kya.js → base-booking-gCY-ZP5p.js} +2 -2
  8. package/dist/chunks/pkg/booking-engine/dist/schemas/{base-product-QYQBl0fQ.js → base-product-r04ZJglB.js} +1 -1
  9. package/dist/chunks/pkg/booking-engine/dist/schemas/{cart-inputs-D1KobIdr.js → cart-inputs-ps94yuAR.js} +1 -1
  10. package/dist/chunks/pkg/booking-engine/dist/schemas/{insurance-B-Vmdlxo.js → insurance-XwIj1m3Z.js} +1 -1
  11. package/dist/chunks/pkg/booking-engine/dist/{schemas-lb2iTDMd.js → schemas-7yx45S2o.js} +6 -6
  12. package/dist/components/ContractSaleDocument/InvoiceDetails.js +1 -1
  13. package/dist/components/ContractSaleDocument/SignatureModal.d.ts.map +1 -1
  14. package/dist/components/ContractSaleDocument/SignatureModal.js +79 -54
  15. package/dist/components/FaqSection/index.d.ts.map +1 -1
  16. package/dist/components/FaqSection/index.js +44 -26
  17. package/dist/components/Footer/businessHoursStatus.js +1 -1
  18. package/dist/components/SignatureInput/index.js +2 -1
  19. package/dist/components/SignatureInput.d.ts.map +1 -1
  20. package/dist/components/StorefrontInformationDocument/index.d.ts +4 -0
  21. package/dist/components/StorefrontInformationDocument/index.d.ts.map +1 -1
  22. package/dist/components/StorefrontInformationDocument/index.js +20 -11
  23. package/dist/i18n/en.js +1 -1
  24. package/dist/i18n/fr.js +1 -1
  25. package/dist/index.d.ts +185 -6
  26. package/dist/index.js +79 -79
  27. package/dist/lib/booking-period.d.ts.map +1 -1
  28. package/dist/lib/booking-period.js +12 -12
  29. package/dist/lib/booking.js +2 -2
  30. package/dist/lib/checkoutSubmit.js +3 -3
  31. package/dist/pages/CheckoutPage.d.ts.map +1 -1
  32. package/dist/pages/CheckoutPage.js +152 -151
  33. package/dist/pages/InsuranceTermsPage.d.ts.map +1 -1
  34. package/dist/pages/InsuranceTermsPage.js +18 -16
  35. package/dist/pages/checkout/components/CheckoutDetailsCard.d.ts +2 -1
  36. package/dist/pages/checkout/components/CheckoutDetailsCard.d.ts.map +1 -1
  37. package/dist/pages/checkout/components/CheckoutDetailsCard.js +17 -14
  38. package/dist/storefront.css +1 -1
  39. package/dist/storefrontSchemas.d.ts +89 -0
  40. package/dist/storefrontSchemas.d.ts.map +1 -1
  41. package/dist/storefrontSchemas.js +20 -16
  42. package/package.json +1 -1
@@ -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(), [y, Qe] = l(!1), b = De(!1), [x, S] = l(null), [$e, et] = l(!1), [C, w] = l(null), tt = v.get("coupon") ?? v.get("code") ?? "", [nt, T] = l(tt), [rt, it] = l(tt.trim()), [E, D] = l(null), [O, k] = l(null), [A, j] = l(!1), [at, M] = l(null), [ot, N] = l(null), [P, st] = l(!1), [F, ct] = l(!1), lt = n(v).toString(), ut = c(() => r(new URLSearchParams(lt), _), [lt, _]), I = h.settings.fulfillmentModes.includes("delivery"), dt = h.settings.deliveryDisabledReason.trim(), ft = I || dt.length > 0, pt = h.shop.address?.trim() ?? "", L = c(() => {
51
- let e = t(ut, {
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" && !I ? {
55
+ return e.fulfillment === "delivery" && !F ? {
56
56
  ...e,
57
57
  fulfillment: "pickup"
58
58
  } : e;
59
- }, [ut, I]), R = c(() => le(L), [L]), z = h.bookingEngine.pricing, mt = te(L, z, h.bookingEngine.shop.timeZone), ht = ne(z.baseUnit, p), gt = mt?.billableUnitCount, B = c(() => re({
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: z.baseUnit,
68
- billableUnitCount: gt
67
+ priceUnit: R.baseUnit,
68
+ billableUnitCount: _t
69
69
  }), [
70
70
  Be,
71
71
  g,
72
- gt,
72
+ _t,
73
73
  m.language,
74
74
  Ue,
75
- z.baseUnit,
75
+ R.baseUnit,
76
76
  ze
77
- ]), V = c(() => B.lines.map((e) => ({
77
+ ]), B = c(() => z.lines.map((e) => ({
78
78
  productId: e.checkoutProductId,
79
79
  productVariantId: e.productVariantId,
80
80
  quantity: e.quantity
81
- })), [B.lines]), [_t, H] = l([]), [U, W] = l(!1);
81
+ })), [z.lines]), [vt, V] = l([]), [H, U] = l(!1);
82
82
  s(() => {
83
- if (!_ || V.length === 0) {
84
- H([]), W(!1);
83
+ if (!_ || B.length === 0) {
84
+ V([]), U(!1);
85
85
  return;
86
86
  }
87
- if (!R) {
88
- H([]), W(!1);
87
+ if (!L) {
88
+ V([]), U(!1);
89
89
  return;
90
90
  }
91
91
  let e = !1;
92
- return W(!0), H([]), (async () => {
92
+ return U(!0), V([]), (async () => {
93
93
  try {
94
94
  let t = await o(oe, {
95
95
  storeSlug: _,
96
- schedule: R,
97
- products: V
96
+ schedule: L,
97
+ products: B
98
98
  }), n = ue.parse(t);
99
99
  if (e) return;
100
- H(n.success ? n.availability ?? [] : []);
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), H([]);
103
+ console.error("Failed to load checkout cart availability", t), V([]);
104
104
  } finally {
105
- e || W(!1);
105
+ e || U(!1);
106
106
  }
107
107
  })(), () => {
108
108
  e = !0;
109
109
  };
110
110
  }, [
111
- L.endDate,
112
- L.endTime,
113
- L.startDate,
114
- L.startTime,
115
- R,
116
- V,
111
+ I.endDate,
112
+ I.endTime,
113
+ I.startDate,
114
+ I.startTime,
115
+ L,
116
+ B,
117
117
  _
118
118
  ]);
119
- let vt = c(() => new Map(_t.map((e) => [se(e.productId, e.productVariantId), e])), [_t]), yt = c(() => ({
120
- ...B,
121
- lines: B.lines.map((e) => {
122
- let t = vt.get(se(e.checkoutProductId, e.productVariantId)), n = t ? ce(t) : e.availabilityStatus === "OUT_OF_STOCK" ? "unavailable" : void 0;
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: !U && n !== void 0,
126
- availabilityIssue: U ? void 0 : n
125
+ insufficientCapacity: !H && n !== void 0,
126
+ availabilityIssue: H ? void 0 : n
127
127
  };
128
128
  })
129
129
  }), [
130
- vt,
131
- U,
132
- B
133
- ]), G = c(() => B.lines.map((e) => ({
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
- })), [B.lines]), bt = new Map(g.map((e) => [e.checkoutProductId?.trim() || e.id, e])), K = B.lines.flatMap((e) => {
139
- let t = bt.get(e.checkoutProductId);
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
- }), q = h.modules?.insurance?.enabled === !0 && K.length > 0, J = q && F, xt = K.reduce((e, t) => e + t.pricePerDayMinor * t.quantity, 0), St = K.reduce((e, t) => Math.max(e, t.deductibleAmountMinor), 0), Ct = B.totalMinor ?? 0, Y = O?.totalMinor ?? Ct, X = O?.insuranceSubtotalMinor ?? 0, wt = E?.discountAmountMinor ?? 0, Z = e(new URLSearchParams(), L).toString(), Q = `/${_ ?? ""}/booking${Z ? `?${Z}` : ""}`, Tt = `/${_ ?? ""}/checkout${Z ? `?${Z}` : ""}`, Et = Fe({
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(_, L);
156
- }, [L, _]), s(() => {
157
- !q && F && ct(!1);
158
- }, [F, q]);
159
- let Dt = (t) => {
155
+ i(_, I);
156
+ }, [I, _]), s(() => {
157
+ !K && P && lt(!1);
158
+ }, [P, K]);
159
+ let Q = (t) => {
160
160
  let n = {
161
- ...L,
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 (!_ || G.length === 0 || !R) {
168
- D(null), k(null), j(!1), M(null), N(null);
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 = rt.trim(), t = e.length === 0 && !P, n = !1;
172
- return j(!0), N(null), M(null), (async () => {
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: R,
177
- items: G,
176
+ schedule: L,
177
+ items: W,
178
178
  couponCode: e || void 0,
179
179
  includeAutoApply: t,
180
- insuranceAccepted: J
180
+ insuranceAccepted: q
181
181
  }), i = be.parse(r);
182
182
  if (n) return;
183
- if (k(typeof i.subtotalMinor == "number" && typeof i.totalMinor == "number" ? {
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
- D(null), N(i.message || p("checkout_coupon_invalid"));
190
+ E(null), M(i.message || p("checkout_coupon_invalid"));
191
191
  return;
192
192
  }
193
- D(i.coupon ?? null), i.coupon && (i.coupon.autoApplied && e.length === 0 ? (T(i.coupon.code), M(p("checkout_coupon_auto_applied", { code: i.coupon.code }))) : M(p("checkout_coupon_manual_applied")));
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), D(null), k(null), N(p("checkout_coupon_error"));
196
+ console.error("Failed to verify checkout coupon", e), E(null), O(null), M(p("checkout_coupon_error"));
197
197
  } finally {
198
- n || j(!1);
198
+ n || A(!1);
199
199
  }
200
200
  })(), () => {
201
201
  n = !0;
202
202
  };
203
203
  }, [
204
- P,
205
- L.endDate,
206
- L.endTime,
207
- L.startDate,
208
- L.startTime,
209
- R,
210
- G,
211
- J,
204
+ N,
205
+ I.endDate,
206
+ I.endTime,
207
+ I.startDate,
208
+ I.startTime,
209
+ L,
210
+ W,
211
+ q,
212
212
  _,
213
- rt,
213
+ it,
214
214
  p
215
215
  ]), s(() => {
216
- if (!_ || B.lines.length === 0 || !R) {
217
- S(null), w(null), et(!1);
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 et(!0), w(null), (async () => {
221
+ return x(!0), C(null), (async () => {
222
222
  try {
223
223
  let t = await o(_e, {
224
224
  storeSlug: _,
225
- schedule: R,
226
- estimatedTotalMinor: Y,
227
- insuranceAmountMinor: X
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
- S(null), w(n.message || p("checkout_payment_error"));
231
+ b(null), C(n.message || p("checkout_payment_error"));
232
232
  return;
233
233
  }
234
- S(n.decision);
234
+ b(n.decision);
235
235
  } catch (t) {
236
236
  if (e) return;
237
- console.error("Failed to load checkout payment decision", t), S(null), w(p("checkout_payment_error"));
237
+ console.error("Failed to load checkout payment decision", t), b(null), C(p("checkout_payment_error"));
238
238
  } finally {
239
- e || et(!1);
239
+ e || x(!1);
240
240
  }
241
241
  })(), () => {
242
242
  e = !0;
243
243
  };
244
244
  }, [
245
- L.endDate,
246
- L.endTime,
247
- L.startDate,
248
- L.startTime,
249
- R,
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 $ = x?.currency ?? "EUR", Ot = f(Y, $, m.language), kt = Math.max(0, Y - X), At = Math.round(kt / 1.2), jt = At + X, Mt = Math.max(0, kt - At), Nt = f(jt, $, m.language), Pt = f(Mt, $, m.language), Ft = Re(Le, m.language), It = X > 0 ? f(X, $, m.language) : void 0, Lt = x?.amountToCollectMinor ?? 0, Rt = x?.shouldCollectOnlinePayment === !0 && Lt > 0, zt = Et.handleSubmit(async (e) => {
257
- if (!_ || G.length === 0 || !R || b.current) return;
258
- Qe(!0), b.current = !0;
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: R,
266
- fulfillment: L.fulfillment,
267
- startAddress: L.fulfillment === "delivery" ? L.startAddress : void 0,
268
- endAddress: L.fulfillment === "delivery" ? L.endAddress : void 0,
269
- couponCode: E?.code,
270
- couponAutoApplied: !P && E?.autoApplied,
271
- insuranceAccepted: J,
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: G
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
- b.current = !1, Qe(!1);
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 = L.fulfillment === "delivery" && L.startAddress.trim().length === 0, Ut = !y && !$e && !C && !U && !A && !ot && !!x && !!R && !Ht && G.length > 0, Wt = ({ className: e, presentation: t, stickyTopClassName: n } = {}) => /* @__PURE__ */ u(Te, {
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: yt.lines,
294
+ lines: bt.lines,
293
295
  itemCount: We,
294
- baseUnitLabel: ht,
296
+ baseUnitLabel: gt,
295
297
  bookingSubtotalLabel: Nt,
296
298
  vatAmountLabel: Pt,
297
299
  vatRateLabel: Ft,
298
300
  bookingTotalLabel: Ot,
299
- bookingPeriod: R ? {
300
- bookingPath: Q,
301
- startDate: R.startDate,
302
- startTime: R.startTime,
303
- endDate: R.endDate,
304
- endTime: R.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: nt,
312
- appliedCode: E?.code,
313
- discountLabel: E && wt > 0 ? f(wt, $, m.language) : null,
314
- message: at,
315
- error: ot,
316
- loading: A,
317
- disabled: y,
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
- T(e), N(null), M(null);
321
+ w(e), M(null), j(null);
320
322
  },
321
323
  onApply: () => {
322
- st(!1), it(nt.trim());
324
+ ct(!1), at(rt.trim());
323
325
  },
324
326
  onRemove: () => {
325
- T(""), it(""), D(null), k(null), N(null), M(null), st(!0);
327
+ w(""), at(""), E(null), O(null), M(null), j(null), ct(!0);
326
328
  }
327
329
  }
328
330
  });
329
- return Ge ? B.lines.length === 0 ? /* @__PURE__ */ u("div", {
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: Q,
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: Q,
360
- checkoutPath: Tt,
361
- backPath: Q,
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
- R ? null : /* @__PURE__ */ u("p", {
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
- ft ? /* @__PURE__ */ u("div", {
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: L.fulfillment,
384
- onValueChange: (e) => Dt({ fulfillment: e }),
385
- pickupAddress: pt,
386
- deliveryEnabled: I,
387
- deliveryDisabledReason: dt,
388
- startAddress: L.startAddress,
389
- onStartAddressChange: (e) => Dt({ startAddress: e }),
390
- endAddress: L.endAddress,
391
- onEndAddressChange: (e) => Dt({ endAddress: 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, { form: Et }),
397
- q ? /* @__PURE__ */ u(Se, {
398
- accepted: J,
399
- disabled: y || A,
400
- dailyAmountLabel: f(xt, $, m.language),
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: O?.insuranceBillableDays,
403
- deductibleLabel: St > 0 ? f(St, $, m.language) : void 0,
404
- onAcceptedChange: ct
407
+ billableDays: D?.insuranceBillableDays,
408
+ deductibleLabel: Ct > 0 ? f(Ct, $, m.language) : void 0,
409
+ onAcceptedChange: lt
405
410
  }) : null,
406
- $e ? /* @__PURE__ */ d("div", {
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
- C ? /* @__PURE__ */ d("div", {
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: C })]
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
- }), Wt({ className: "hidden lg:block" })]
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
- zt();
448
- },
449
- children: Wt({ presentation: "flat" })
449
+ onSubmit: Wt,
450
+ children: Gt({ presentation: "flat" })
450
451
  })]
451
452
  }) : /* @__PURE__ */ u(Ce, {
452
- bookingPath: Q,
453
- checkoutPath: Tt
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":"AAUA,MAAM,CAAC,OAAO,UAAU,kBAAkB,4CAsBzC"}
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 { StorefrontInformationDocument as n, formatStorefrontInformationDocumentDate as r } from "../components/StorefrontInformationDocument/index.js";
4
- import { jsx as i } from "react/jsx-runtime";
5
- import { useTranslation as a } from "react-i18next";
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 o() {
8
- let { t: o, i18n: s } = a(), { storefrontConfiguration: c } = e(), l = c.information?.insuranceTerms, u = t(l) ? l?.html.trim() ?? "" : "", d = r({
9
- language: s.resolvedLanguage || s.language || "en",
10
- timeZone: c.shop.timeZone,
11
- value: c.information?.insuranceTermsUpdatedAt
12
- });
13
- return /* @__PURE__ */ i(n, {
14
- title: o("insurance_terms_title"),
15
- description: o("insurance_terms_description", { shop_name: c.shop.name }),
16
- effectiveDateLabel: d ? o("insurance_terms_effective_date", { date: d }) : void 0,
17
- contentHtml: u,
18
- unavailableLabel: o("insurance_terms_unavailable")
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 { o as default };
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;CACnB,CAAA;AAOD,wBAAgB,mBAAmB,CAAC,EAAE,IAAI,EAAE,EAAE,wBAAwB,2CAwGrE"}
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"}