@loczer/storefront-sdk 0.191.0 → 0.192.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 (57) hide show
  1. package/dist/StorefrontProvider.d.ts +9 -0
  2. package/dist/StorefrontProvider.d.ts.map +1 -1
  3. package/dist/chunks/pkg/booking-engine/dist/models/{Product.shared-IYOeC3N7.js → Product.shared-cjcvMCMa.js} +4 -2
  4. package/dist/chunks/pkg/booking-engine/dist/schemas/{base-asset-zsUj5_3O.js → base-asset-CsOe0vXi.js} +1 -1
  5. package/dist/chunks/pkg/booking-engine/dist/schemas/{base-booking-TzCge_mR.js → base-booking-Sjsqh31e.js} +28 -23
  6. package/dist/chunks/pkg/booking-engine/dist/schemas/{base-product-DvFFzAcg.js → base-product-C_ATjuc6.js} +1 -1
  7. package/dist/chunks/pkg/booking-engine/dist/schemas/{cart-inputs-B0HpcFe5.js → cart-inputs-D1_Wmkca.js} +11 -0
  8. package/dist/chunks/pkg/booking-engine/dist/schemas/insurance-B01h642r.js +67 -0
  9. package/dist/chunks/pkg/booking-engine/dist/schemas-D_yUBLa0.js +14 -0
  10. package/dist/components/ContractSaleDocument/Invoice.d.ts.map +1 -1
  11. package/dist/components/ContractSaleDocument/Invoice.js +106 -106
  12. package/dist/components/ContractSaleDocument/InvoiceDetails.d.ts.map +1 -1
  13. package/dist/components/ContractSaleDocument/InvoiceDetails.js +33 -24
  14. package/dist/i18n/en.d.ts +11 -0
  15. package/dist/i18n/en.d.ts.map +1 -1
  16. package/dist/i18n/en.js +11 -0
  17. package/dist/i18n/fr.d.ts +11 -0
  18. package/dist/i18n/fr.d.ts.map +1 -1
  19. package/dist/i18n/fr.js +11 -0
  20. package/dist/index.d.ts +193 -3
  21. package/dist/index.js +66 -65
  22. package/dist/lib/booking.js +2 -2
  23. package/dist/lib/checkoutSubmit.d.ts +8 -2
  24. package/dist/lib/checkoutSubmit.d.ts.map +1 -1
  25. package/dist/lib/checkoutSubmit.js +13 -4
  26. package/dist/lib/checkoutVerifyCoupon.d.ts +3 -0
  27. package/dist/lib/checkoutVerifyCoupon.d.ts.map +1 -1
  28. package/dist/lib/checkoutVerifyCoupon.js +4 -1
  29. package/dist/lib/contractSaleDocument.d.ts +4 -0
  30. package/dist/lib/contractSaleDocument.d.ts.map +1 -1
  31. package/dist/lib/contractSaleDocument.js +3 -1
  32. package/dist/lib/contractSaleDocumentApi.d.ts +6 -0
  33. package/dist/lib/contractSaleDocumentApi.d.ts.map +1 -1
  34. package/dist/lib/storefrontProducts.d.ts +3 -0
  35. package/dist/lib/storefrontProducts.d.ts.map +1 -1
  36. package/dist/lib/storefrontProducts.js +2 -1
  37. package/dist/pages/CheckoutPage.d.ts.map +1 -1
  38. package/dist/pages/CheckoutPage.js +264 -237
  39. package/dist/pages/ContractSaleDocumentPage.d.ts +2 -0
  40. package/dist/pages/ContractSaleDocumentPage.d.ts.map +1 -1
  41. package/dist/pages/checkout/components/CheckoutDetailsCard.d.ts.map +1 -1
  42. package/dist/pages/checkout/components/CheckoutDetailsCard.js +17 -3
  43. package/dist/pages/checkout/components/CheckoutInsuranceCard.d.ts +12 -0
  44. package/dist/pages/checkout/components/CheckoutInsuranceCard.d.ts.map +1 -0
  45. package/dist/pages/checkout/components/CheckoutInsuranceCard.js +53 -0
  46. package/dist/pages/checkout/components/CheckoutPaymentSummaryCard.d.ts +2 -1
  47. package/dist/pages/checkout/components/CheckoutPaymentSummaryCard.d.ts.map +1 -1
  48. package/dist/pages/checkout/components/CheckoutPaymentSummaryCard.js +47 -30
  49. package/dist/pages/checkout/types.d.ts +2 -1
  50. package/dist/pages/checkout/types.d.ts.map +1 -1
  51. package/dist/pages/checkout/types.js +2 -1
  52. package/dist/storefront.css +1 -1
  53. package/dist/storefrontSchemas.d.ts +6 -0
  54. package/dist/storefrontSchemas.d.ts.map +1 -1
  55. package/dist/storefrontSchemas.js +5 -2
  56. package/package.json +1 -1
  57. package/dist/chunks/pkg/booking-engine/dist/schemas-BNUzqsci.js +0 -13
@@ -3,26 +3,26 @@ import { AcceptanceModal as t } from "./AcceptanceModal.js";
3
3
  import { formatContractSaleDocumentLabel as n, resolveContractSaleDocumentLanguage as r } from "./language.js";
4
4
  import { InvoiceDetails as i } from "./InvoiceDetails.js";
5
5
  import { Page as a } from "./Page.js";
6
- import { PageFooter as ee } from "./PageFooter.js";
7
- import { PageHeader as o } from "./PageHeader.js";
8
- import { SignatureModal as te } from "./SignatureModal.js";
9
- import { DEFAULT_TERMS_ARTICLES as s, TermsAndConditionsContent as ne } from "./TermsAndConditionsContent.js";
10
- import { ThumbnailSidebar as re } from "./ThumbnailSidebar.js";
6
+ import { PageFooter as o } from "./PageFooter.js";
7
+ import { PageHeader as s } from "./PageHeader.js";
8
+ import { SignatureModal as ee } from "./SignatureModal.js";
9
+ import { DEFAULT_TERMS_ARTICLES as c, TermsAndConditionsContent as te } from "./TermsAndConditionsContent.js";
10
+ import { ThumbnailSidebar as ne } from "./ThumbnailSidebar.js";
11
11
  /* empty css */
12
- import { useEffect as c, useRef as l, useState as u } from "react";
13
- import { Fragment as ie, jsx as d, jsxs as f } from "react/jsx-runtime";
14
- import { useTranslation as ae } from "react-i18next";
15
- import { CheckCircle2 as oe } from "lucide-react";
16
- import * as se from "html-to-image";
17
- import { toString as ce } from "qrcode";
12
+ import { useEffect as l, useRef as u, useState as d } from "react";
13
+ import { Fragment as re, jsx as f, jsxs as p } from "react/jsx-runtime";
14
+ import { useTranslation as ie } from "react-i18next";
15
+ import { CheckCircle2 as ae } from "lucide-react";
16
+ import * as oe from "html-to-image";
17
+ import { toString as se } from "qrcode";
18
18
  //#region src/components/ContractSaleDocument/Invoice.tsx
19
- var p = 22, m = 10, h = 14, g = 14, _ = 3, v = 6, y = (e, t) => {
19
+ var m = 22, h = 10, g = 14, _ = 14, v = 3, ce = 6, y = (e, t) => {
20
20
  if (t <= 0) return [e];
21
21
  let n = [];
22
22
  for (let r = 0; r < e.length; r += t) n.push(e.slice(r, r + t));
23
23
  return n;
24
24
  }, le = (e) => {
25
- if (e.length <= m) return [{
25
+ if (e.length <= h) return [{
26
26
  kind: "invoice",
27
27
  key: "invoice-page-1",
28
28
  items: e,
@@ -34,13 +34,13 @@ var p = 22, m = 10, h = 14, g = 14, _ = 3, v = 6, y = (e, t) => {
34
34
  let t = [{
35
35
  kind: "invoice",
36
36
  key: "invoice-page-1",
37
- items: e.slice(0, m),
37
+ items: e.slice(0, h),
38
38
  showInvoiceMeta: !0,
39
39
  showTotalsSection: !1,
40
40
  showNotesSection: !1,
41
41
  showAcceptanceSection: !1
42
- }], n = e.slice(m);
43
- if (n.length <= g) return t.push({
42
+ }], n = e.slice(h);
43
+ if (n.length <= _) return t.push({
44
44
  kind: "invoice",
45
45
  key: "invoice-page-final-1",
46
46
  items: n,
@@ -49,10 +49,10 @@ var p = 22, m = 10, h = 14, g = 14, _ = 3, v = 6, y = (e, t) => {
49
49
  showNotesSection: !0,
50
50
  showAcceptanceSection: !0
51
51
  }), t;
52
- let r = n.length % h;
53
- r === 0 && (r = Math.min(g, h));
54
- let i = Math.max(0, n.length - r), a = n.slice(0, i), ee = n.slice(i), o = y(a, h);
55
- return o.forEach((e, n) => {
52
+ let r = n.length % g;
53
+ r === 0 && (r = Math.min(_, g));
54
+ let i = Math.max(0, n.length - r), a = n.slice(0, i), o = n.slice(i), s = y(a, g);
55
+ return s.forEach((e, n) => {
56
56
  t.push({
57
57
  kind: "invoice",
58
58
  key: `invoice-page-continuation-${n + 1}`,
@@ -64,31 +64,31 @@ var p = 22, m = 10, h = 14, g = 14, _ = 3, v = 6, y = (e, t) => {
64
64
  });
65
65
  }), t.push({
66
66
  kind: "invoice",
67
- key: `invoice-page-final-${o.length + 1}`,
68
- items: ee,
67
+ key: `invoice-page-final-${s.length + 1}`,
68
+ items: o,
69
69
  showInvoiceMeta: !1,
70
70
  showTotalsSection: !0,
71
71
  showNotesSection: !0,
72
72
  showAcceptanceSection: !0
73
73
  }), t;
74
- }, ue = (e, t, n) => y(e, n ? _ : v).map((e, n) => ({
74
+ }, ue = (e, t, n) => y(e, n ? v : ce).map((e, n) => ({
75
75
  kind: "terms",
76
76
  key: `terms-page-${n + 1}`,
77
77
  title: t,
78
78
  showTitle: n === 0,
79
79
  articles: e
80
- })), de = (e) => e.kind === "credit_note" ? [] : !e.terms || e.terms.articles.length === 0 ? s : e.terms.articles, fe = (e) => e.terms?.title ?? "Conditions Generales de Vente";
81
- function b({ data: s, showTermsPage: m = !0, withEnglishTranslation: h = !0, heightMode: g = "viewport", renderMode: _ = "interactive", publicDocumentUrl: v, onAccept: y }) {
82
- let { t: b, i18n: pe } = ae(), x = v?.trim() ?? "", S = _ === "pdf", [C, w] = u(s), [T, E] = u(!1), [D, O] = u(null), [me, k] = u(0), [A, j] = u([]), [he, M] = u(!0), [ge, N] = u(0), [P, F] = u(""), [_e, I] = u(x.length === 0 && !S), L = l(null), R = l(null), z = l([]);
83
- c(() => {
84
- w(s);
85
- }, [s]), c(() => {
80
+ })), de = (e) => e.kind === "credit_note" ? [] : !e.terms || e.terms.articles.length === 0 ? c : e.terms.articles, fe = (e) => e.terms?.title ?? "Conditions Generales de Vente";
81
+ function b({ data: c, showTermsPage: h = !0, withEnglishTranslation: g = !0, heightMode: _ = "viewport", renderMode: v = "interactive", publicDocumentUrl: ce, onAccept: y }) {
82
+ let { t: b, i18n: pe } = ie(), x = ce?.trim() ?? "", S = v === "pdf", [C, w] = d(c), [T, E] = d(!1), [D, O] = d(null), [me, k] = d(0), [A, j] = d([]), [he, M] = d(!0), [ge, N] = d(0), [P, F] = d(""), [_e, I] = d(x.length === 0 && !S), L = u(null), R = u(null), z = u([]);
83
+ l(() => {
84
+ w(c);
85
+ }, [c]), l(() => {
86
86
  if (!x) {
87
87
  F(""), I(!S);
88
88
  return;
89
89
  }
90
90
  let e = !1;
91
- return F(""), I(!1), ce(x, {
91
+ return F(""), I(!1), se(x, {
92
92
  type: "svg",
93
93
  errorCorrectionLevel: "M",
94
94
  margin: 1,
@@ -107,22 +107,22 @@ function b({ data: s, showTermsPage: m = !0, withEnglishTranslation: h = !0, hei
107
107
  e = !0;
108
108
  };
109
109
  }, [x, S]);
110
- let B = r(C, pe.language), ve = (e, t = {}) => n(b, B, e, t), ye = C.kind === "credit_note" ? -1 : 1, V = C.items.reduce((e, t) => e + t.quantity * t.unitPrice, 0) * ye, H = C.taxRate == null ? V : V / (1 + C.taxRate), be = C.taxRate == null ? 0 : V - H, U = ve(C.kind === "credit_note" ? "docs_contract_sale_credit_note_title" : C.kind === "quote" ? "docs_contract_sale_quote_title" : "docs_contract_sale_invoice_title"), W = fe(C), G = de(C), xe = le(C.items), K = h, Se = m ? ue(G, W, K) : [], q = [...xe, ...Se], J = q.length, Ce = [
110
+ let B = r(C, pe.language), ve = (e, t = {}) => n(b, B, e, t), V = C.kind === "credit_note" ? -1 : 1, H = C.items.reduce((e, t) => e + t.quantity * t.unitPrice, 0) * V, U = C.items.reduce((e, t) => e + t.quantity * t.unitPrice * V / (1 + (t.taxRate ?? C.taxRate ?? 0)), 0), ye = H - U, W = ve(C.kind === "credit_note" ? "docs_contract_sale_credit_note_title" : C.kind === "quote" ? "docs_contract_sale_quote_title" : "docs_contract_sale_invoice_title"), G = fe(C), K = de(C), be = le(C.items), q = g, xe = h ? ue(K, G, q) : [], J = [...be, ...xe], Y = J.length, Se = [
111
111
  C.id,
112
112
  C.kind,
113
113
  C.saleDocumentNumber,
114
114
  C.items.map((e) => `${e.id}:${e.description}:${e.quantity}:${e.unitPrice}`).join(","),
115
- m ? W : "",
116
- m ? G.map((e) => `${e.id}:${e.title}:${e.body}:${e.translationTitle ?? ""}:${e.translationBody ?? ""}`).join(",") : "",
117
- K ? "translated" : "legal-only",
115
+ h ? G : "",
116
+ h ? K.map((e) => `${e.id}:${e.title}:${e.body}:${e.translationTitle ?? ""}:${e.translationBody ?? ""}`).join(",") : "",
117
+ q ? "translated" : "legal-only",
118
118
  B.legal,
119
119
  B.customer,
120
120
  B.translation ?? "",
121
- q.map((e) => e.key).join(",")
122
- ].join("|"), Y = !S && (C.acceptanceLevel !== "none" || C.acceptance != null), X = C.acceptance;
123
- z.current.length > J && (z.current.length = J), c(() => {
124
- N((e) => J === 0 ? 0 : Math.min(e, J - 1));
125
- }, [J]), c(() => {
121
+ J.map((e) => e.key).join(",")
122
+ ].join("|"), X = !S && (C.acceptanceLevel !== "none" || C.acceptance != null), Z = C.acceptance;
123
+ z.current.length > Y && (z.current.length = Y), l(() => {
124
+ N((e) => Y === 0 ? 0 : Math.min(e, Y - 1));
125
+ }, [Y]), l(() => {
126
126
  let e = L.current;
127
127
  E(!1), N(0), e?.scrollTo({
128
128
  top: 0,
@@ -135,7 +135,7 @@ function b({ data: s, showTermsPage: m = !0, withEnglishTranslation: h = !0, hei
135
135
  return e?.addEventListener("scroll", t), t(), () => {
136
136
  e?.removeEventListener("scroll", t);
137
137
  };
138
- }, [Ce]), c(() => {
138
+ }, [Se]), l(() => {
139
139
  let e = !1;
140
140
  return (async () => {
141
141
  if (S) {
@@ -143,9 +143,9 @@ function b({ data: s, showTermsPage: m = !0, withEnglishTranslation: h = !0, hei
143
143
  return;
144
144
  }
145
145
  M(!0), await new Promise((e) => setTimeout(e, 0));
146
- let t = [], n = z.current.slice(0, J);
146
+ let t = [], n = z.current.slice(0, Y);
147
147
  for (let e of n) if (e) try {
148
- let n = await se.toPng(e, {
148
+ let n = await oe.toPng(e, {
149
149
  quality: .7,
150
150
  pixelRatio: 1,
151
151
  style: {
@@ -164,14 +164,14 @@ function b({ data: s, showTermsPage: m = !0, withEnglishTranslation: h = !0, hei
164
164
  };
165
165
  }, [
166
166
  C,
167
- m,
168
- K,
169
- J,
167
+ h,
168
+ q,
169
+ Y,
170
170
  S,
171
171
  P
172
- ]), c(() => {
172
+ ]), l(() => {
173
173
  if (S || A.length === 0) return;
174
- let e = z.current.slice(0, J).filter((e) => e != null);
174
+ let e = z.current.slice(0, Y).filter((e) => e != null);
175
175
  if (e.length === 0) return;
176
176
  let t = new IntersectionObserver((t) => {
177
177
  for (let n of t) {
@@ -192,11 +192,11 @@ function b({ data: s, showTermsPage: m = !0, withEnglishTranslation: h = !0, hei
192
192
  };
193
193
  }, [
194
194
  A,
195
- J,
195
+ Y,
196
196
  S
197
- ]), c(() => {
197
+ ]), l(() => {
198
198
  let e = R.current;
199
- if (!Y || !e) {
199
+ if (!X || !e) {
200
200
  k(0);
201
201
  return;
202
202
  }
@@ -208,19 +208,19 @@ function b({ data: s, showTermsPage: m = !0, withEnglishTranslation: h = !0, hei
208
208
  return n.observe(e), () => {
209
209
  n.disconnect();
210
210
  };
211
- }, [C.acceptance, Y]);
212
- let Z = (e) => {
211
+ }, [C.acceptance, X]);
212
+ let Q = (e) => {
213
213
  let t = e instanceof Date ? e : new Date(e);
214
214
  return Number.isNaN(t.getTime()) ? null : t;
215
- }, we = (e) => {
216
- let t = Z(e);
215
+ }, Ce = (e) => {
216
+ let t = Q(e);
217
217
  return t ? new Intl.DateTimeFormat(B.legal, {
218
218
  day: "2-digit",
219
219
  month: "2-digit",
220
220
  year: "numeric"
221
221
  }).format(t) : "-";
222
- }, Te = (e) => {
223
- let t = Z(e);
222
+ }, we = (e) => {
223
+ let t = Q(e);
224
224
  return t ? new Intl.DateTimeFormat(B.legal, {
225
225
  day: "2-digit",
226
226
  month: "2-digit",
@@ -228,7 +228,7 @@ function b({ data: s, showTermsPage: m = !0, withEnglishTranslation: h = !0, hei
228
228
  hour: "2-digit",
229
229
  minute: "2-digit"
230
230
  }).format(t) : "-";
231
- }, Ee = async (e) => {
231
+ }, Te = async (e) => {
232
232
  let t = y ? await y(e) : void 0;
233
233
  if (t) {
234
234
  w(t);
@@ -238,124 +238,124 @@ function b({ data: s, showTermsPage: m = !0, withEnglishTranslation: h = !0, hei
238
238
  ...t,
239
239
  acceptance: e
240
240
  }));
241
- }, De = async () => {
242
- await Ee({
241
+ }, Ee = async () => {
242
+ await Te({
243
243
  mode: "acceptance",
244
244
  date: /* @__PURE__ */ new Date()
245
245
  });
246
- }, Oe = async (e) => {
247
- await Ee(e);
248
- }, ke = (e) => {
246
+ }, De = async (e) => {
247
+ await Te(e);
248
+ }, Oe = (e) => {
249
249
  N(e), z.current[e]?.scrollIntoView({
250
250
  behavior: "smooth",
251
251
  block: "start"
252
252
  });
253
- }, Ae = Y ? me + p : p, Q = g === "parent", je = C.acceptanceLevel === "signature" ? b(T ? "docs_contract_sale_action_signature_ready" : "docs_contract_sale_action_signature_locked") : b(T ? "docs_contract_sale_action_acceptance_ready" : "docs_contract_sale_action_acceptance_locked"), Me = X?.mode === "signature" ? b("docs_contract_sale_already_signed", { date: Te(X.date) }) : X?.mode === "acceptance" ? b("docs_contract_sale_already_accepted", { date: Te(X.date) }) : null, $ = (e, t) => /* @__PURE__ */ f(a, {
253
+ }, ke = X ? me + m : m, $ = _ === "parent", Ae = C.acceptanceLevel === "signature" ? b(T ? "docs_contract_sale_action_signature_ready" : "docs_contract_sale_action_signature_locked") : b(T ? "docs_contract_sale_action_acceptance_ready" : "docs_contract_sale_action_acceptance_locked"), je = Z?.mode === "signature" ? b("docs_contract_sale_already_signed", { date: we(Z.date) }) : Z?.mode === "acceptance" ? b("docs_contract_sale_already_accepted", { date: we(Z.date) }) : null, Me = (e, t) => /* @__PURE__ */ p(a, {
254
254
  ref: (e) => {
255
255
  z.current[t] = e;
256
256
  },
257
- className: S || t === J - 1 ? "!mb-0" : void 0,
257
+ className: S || t === Y - 1 ? "!mb-0" : void 0,
258
258
  children: [
259
- /* @__PURE__ */ d(o, {
260
- documentTitle: U,
259
+ /* @__PURE__ */ f(s, {
260
+ documentTitle: W,
261
261
  saleDocumentNumber: C.saleDocumentNumber,
262
262
  currentPage: t + 1,
263
- totalPages: J,
263
+ totalPages: Y,
264
264
  documentLanguage: B
265
265
  }),
266
- e.kind === "invoice" ? /* @__PURE__ */ d(i, {
266
+ e.kind === "invoice" ? /* @__PURE__ */ f(i, {
267
267
  saleDocument: C,
268
268
  items: e.items,
269
- subtotal: H,
270
- tax: be,
271
- total: V,
272
- formatDate: we,
269
+ subtotal: U,
270
+ tax: ye,
271
+ total: H,
272
+ formatDate: Ce,
273
273
  showInvoiceMeta: e.showInvoiceMeta,
274
274
  showTotalsSection: e.showTotalsSection,
275
275
  showNotesSection: e.showNotesSection,
276
276
  showAcceptanceSection: e.showAcceptanceSection,
277
277
  documentQrCodeUrl: e.showInvoiceMeta ? P : void 0,
278
278
  documentLanguage: B
279
- }) : /* @__PURE__ */ d("main", {
279
+ }) : /* @__PURE__ */ f("main", {
280
280
  className: "flex-grow px-4 text-left md:px-8",
281
- children: /* @__PURE__ */ d(ne, {
281
+ children: /* @__PURE__ */ f(te, {
282
282
  title: e.title,
283
283
  articles: e.articles,
284
- withEnglishTranslation: K,
284
+ withEnglishTranslation: q,
285
285
  showTitle: e.showTitle
286
286
  })
287
287
  }),
288
- /* @__PURE__ */ d(ee, {
289
- documentTitle: U,
288
+ /* @__PURE__ */ f(o, {
289
+ documentTitle: W,
290
290
  saleDocumentNumber: C.saleDocumentNumber,
291
291
  currentPage: t + 1,
292
- totalPages: J,
292
+ totalPages: Y,
293
293
  documentLanguage: B
294
294
  })
295
295
  ]
296
296
  }, e.key);
297
- return S ? /* @__PURE__ */ d("div", {
297
+ return S ? /* @__PURE__ */ f("div", {
298
298
  "data-testid": _e ? "contract-sale-document-pdf-ready" : void 0,
299
299
  className: "contract-sale-document contract-sale-document-pdf bg-white text-foreground",
300
- children: q.map($)
301
- }) : /* @__PURE__ */ d(ie, { children: /* @__PURE__ */ f("div", {
302
- className: `contract-sale-document ${Q ? "h-full" : "h-dvh"} min-h-0 md:flex`,
303
- children: [/* @__PURE__ */ d(re, {
300
+ children: J.map(Me)
301
+ }) : /* @__PURE__ */ f(re, { children: /* @__PURE__ */ p("div", {
302
+ className: `contract-sale-document ${$ ? "h-full" : "h-dvh"} min-h-0 md:flex`,
303
+ children: [/* @__PURE__ */ f(ne, {
304
304
  thumbnails: A,
305
305
  activePage: ge,
306
- onThumbnailClick: ke,
307
- totalPages: J,
308
- heightClassName: Q ? "h-full" : "h-dvh",
309
- contentClassName: Q ? "pt-16" : void 0,
306
+ onThumbnailClick: Oe,
307
+ totalPages: Y,
308
+ heightClassName: $ ? "h-full" : "h-dvh",
309
+ contentClassName: $ ? "pt-16" : void 0,
310
310
  isLoading: he
311
- }), /* @__PURE__ */ f("div", {
311
+ }), /* @__PURE__ */ p("div", {
312
312
  ref: L,
313
313
  "data-testid": "contract-sale-document-scroll-container",
314
- className: `${Q ? "h-full" : "h-dvh"} min-h-0 flex-1 overflow-y-auto overscroll-y-contain bg-transparent`,
314
+ className: `${$ ? "h-full" : "h-dvh"} min-h-0 flex-1 overflow-y-auto overscroll-y-contain bg-transparent`,
315
315
  style: {
316
- paddingTop: Q ? "3.5rem" : void 0,
317
- scrollPaddingTop: Q ? "3.5rem" : void 0,
318
- paddingBottom: `${Ae}px`
316
+ paddingTop: $ ? "3.5rem" : void 0,
317
+ scrollPaddingTop: $ ? "3.5rem" : void 0,
318
+ paddingBottom: `${ke}px`
319
319
  },
320
320
  children: [
321
- q.map($),
322
- /* @__PURE__ */ d("p", {
321
+ J.map(Me),
322
+ /* @__PURE__ */ f("p", {
323
323
  className: "px-4 text-center text-xs text-muted-foreground/75 md:px-8",
324
- style: { paddingTop: `${p}px` },
324
+ style: { paddingTop: `${m}px` },
325
325
  children: b("docs_contract_sale_end")
326
326
  }),
327
- Y ? /* @__PURE__ */ d("div", {
327
+ X ? /* @__PURE__ */ f("div", {
328
328
  ref: R,
329
329
  className: "fixed bottom-0 left-0 right-0 z-30 flex items-center justify-center border-t border-border bg-background/70 p-4 backdrop-blur-xl backdrop-saturate-125 supports-[backdrop-filter]:bg-background/55",
330
- children: Me ? /* @__PURE__ */ f("div", {
330
+ children: je ? /* @__PURE__ */ p("div", {
331
331
  className: "flex items-center gap-2 px-6 py-3 text-sm font-semibold text-success",
332
- children: [/* @__PURE__ */ d(oe, {
332
+ children: [/* @__PURE__ */ f(ae, {
333
333
  className: "h-4 w-4 shrink-0",
334
334
  "aria-hidden": "true"
335
- }), /* @__PURE__ */ d("p", {
335
+ }), /* @__PURE__ */ f("p", {
336
336
  className: "text-center",
337
- children: Me
337
+ children: je
338
338
  })]
339
- }) : /* @__PURE__ */ d(e, {
339
+ }) : /* @__PURE__ */ f(e, {
340
340
  onClick: () => O(C.acceptanceLevel === "signature" ? "signature" : "acceptance"),
341
341
  disabled: !T,
342
342
  className: "px-6 py-3 text-sm font-semibold",
343
343
  "data-testid": "contract-sale-document-action-button",
344
- children: je
344
+ children: Ae
345
345
  })
346
346
  }) : null,
347
- /* @__PURE__ */ d(t, {
347
+ /* @__PURE__ */ f(t, {
348
348
  isOpen: D === "acceptance",
349
349
  onClose: () => O(null),
350
350
  onAccept: async () => {
351
- await De(), O(null);
351
+ await Ee(), O(null);
352
352
  }
353
353
  }),
354
- /* @__PURE__ */ d(te, {
354
+ /* @__PURE__ */ f(ee, {
355
355
  isOpen: D === "signature",
356
356
  onClose: () => O(null),
357
357
  onSave: async (e) => {
358
- await Oe(e), O(null);
358
+ await De(e), O(null);
359
359
  }
360
360
  })
361
361
  ]
@@ -1 +1 @@
1
- {"version":3,"file":"InvoiceDetails.d.ts","sourceRoot":"","sources":["../../../src/components/ContractSaleDocument/InvoiceDetails.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,oBAAoB,EACpB,4BAA4B,EAC5B,4BAA4B,EAC7B,MAAM,gCAAgC,CAAA;AAIvC,KAAK,mBAAmB,GAAG;IACzB,YAAY,EAAE,oBAAoB,CAAA;IAClC,KAAK,EAAE,4BAA4B,EAAE,CAAA;IACrC,QAAQ,EAAE,MAAM,CAAA;IAChB,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;IACb,UAAU,EAAE,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,KAAK,MAAM,CAAA;IACpD,gBAAgB,EAAE,4BAA4B,CAAA;IAC9C,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,qBAAqB,CAAC,EAAE,OAAO,CAAA;IAC/B,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAC3B,CAAA;AAoBD,wBAAgB,cAAc,CAAC,EAC7B,YAAY,EACZ,KAAK,EACL,QAAQ,EACR,GAAG,EACH,KAAK,EACL,UAAU,EACV,gBAAgB,EAChB,eAAsB,EACtB,iBAAwB,EACxB,gBAAuB,EACvB,qBAA4B,EAC5B,iBAAiB,GAClB,EAAE,mBAAmB,2CA2OrB"}
1
+ {"version":3,"file":"InvoiceDetails.d.ts","sourceRoot":"","sources":["../../../src/components/ContractSaleDocument/InvoiceDetails.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,oBAAoB,EACpB,4BAA4B,EAC5B,4BAA4B,EAC7B,MAAM,gCAAgC,CAAA;AAIvC,KAAK,mBAAmB,GAAG;IACzB,YAAY,EAAE,oBAAoB,CAAA;IAClC,KAAK,EAAE,4BAA4B,EAAE,CAAA;IACrC,QAAQ,EAAE,MAAM,CAAA;IAChB,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;IACb,UAAU,EAAE,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,GAAG,MAAM,KAAK,MAAM,CAAA;IACpD,gBAAgB,EAAE,4BAA4B,CAAA;IAC9C,eAAe,CAAC,EAAE,OAAO,CAAA;IACzB,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B,qBAAqB,CAAC,EAAE,OAAO,CAAA;IAC/B,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAC3B,CAAA;AAoBD,wBAAgB,cAAc,CAAC,EAC7B,YAAY,EACZ,KAAK,EACL,QAAQ,EACR,GAAG,EACH,KAAK,EACL,UAAU,EACV,gBAAgB,EAChB,eAAsB,EACtB,iBAAwB,EACxB,gBAAuB,EACvB,qBAA4B,EAC5B,iBAAiB,GAClB,EAAE,mBAAmB,2CAoPrB"}
@@ -27,7 +27,7 @@ function c({ saleDocument: c, items: l, subtotal: u, tax: d, total: f, formatDat
27
27
  children: n.slice(a + 3)
28
28
  })]
29
29
  });
30
- }, w = !g && !_ && !v, T = o(c.issuer.address), E = o(c.recipient.address), D = c.recipient.email?.trim() ?? "", O = c.acceptance?.mode === "signature" ? c.acceptance : null, k = c.acceptance?.mode === "acceptance" ? c.acceptance : null, A = c.acceptanceLevel === "signature" || O !== null, j = c.kind === "credit_note", M = x(j ? "docs_contract_sale_credit_note_title" : c.kind === "quote" ? "docs_contract_sale_quote_title" : "docs_contract_sale_invoice_title"), N = x(j ? "docs_contract_sale_credit_note_date_label" : c.kind === "quote" ? "docs_contract_sale_quote_date_label" : "docs_contract_sale_invoice_date_label"), P = x(j ? "docs_contract_sale_credit_note_recipient_label" : "docs_contract_sale_invoice_recipient_label"), F = j ? -1 : 1, I = c.taxRate == null ? 1 : 1 + c.taxRate;
30
+ }, w = !g && !_ && !v, T = o(c.issuer.address), E = o(c.recipient.address), D = c.recipient.email?.trim() ?? "", O = c.acceptance?.mode === "signature" ? c.acceptance : null, k = c.acceptance?.mode === "acceptance" ? c.acceptance : null, A = c.acceptanceLevel === "signature" || O !== null, j = c.kind === "credit_note", M = x(j ? "docs_contract_sale_credit_note_title" : c.kind === "quote" ? "docs_contract_sale_quote_title" : "docs_contract_sale_invoice_title"), N = x(j ? "docs_contract_sale_credit_note_date_label" : c.kind === "quote" ? "docs_contract_sale_quote_date_label" : "docs_contract_sale_invoice_date_label"), P = x(j ? "docs_contract_sale_credit_note_recipient_label" : "docs_contract_sale_invoice_recipient_label"), F = j ? -1 : 1;
31
31
  return /* @__PURE__ */ i("main", {
32
32
  className: "flex flex-grow flex-col px-4 md:px-8",
33
33
  children: [
@@ -120,27 +120,36 @@ function c({ saleDocument: c, items: l, subtotal: u, tax: d, total: f, formatDat
120
120
  ]
121
121
  }), /* @__PURE__ */ r("div", {
122
122
  className: w ? "flex flex-1 flex-col" : "flex flex-col",
123
- children: l.map((e) => /* @__PURE__ */ i("div", {
124
- className: "flex items-center border-b border-border p-2 text-sm md:p-3 md:text-base",
125
- children: [
126
- /* @__PURE__ */ r("div", {
127
- className: "w-5/12 pr-2 md:w-1/2",
128
- children: /* @__PURE__ */ r("span", { children: e.description })
129
- }),
130
- /* @__PURE__ */ r("div", {
131
- className: "w-1/6 text-center",
132
- children: /* @__PURE__ */ r("span", { children: e.quantity })
133
- }),
134
- /* @__PURE__ */ r("div", {
135
- className: "w-3/12 text-right md:w-1/6",
136
- children: /* @__PURE__ */ r("span", { children: s(e.unitPrice / I * F, c.currency, m.customer) })
137
- }),
138
- /* @__PURE__ */ r("div", {
139
- className: "w-1/6 text-right",
140
- children: /* @__PURE__ */ r("span", { children: s(e.quantity * e.unitPrice / I * F, c.currency, m.customer) })
141
- })
142
- ]
143
- }, e.id))
123
+ children: l.map((e) => {
124
+ let t = 1 + (e.taxRate ?? c.taxRate ?? 0);
125
+ return /* @__PURE__ */ i("div", {
126
+ className: "flex items-center border-b border-border p-2 text-sm md:p-3 md:text-base",
127
+ children: [
128
+ /* @__PURE__ */ r("div", {
129
+ className: "w-5/12 pr-2 md:w-1/2",
130
+ children: /* @__PURE__ */ i("span", {
131
+ className: "grid gap-0.5",
132
+ children: [/* @__PURE__ */ r("span", { children: e.description }), e.taxExemptionReason ? /* @__PURE__ */ r("span", {
133
+ className: "text-[10px] leading-tight text-muted-foreground",
134
+ children: e.taxExemptionReason
135
+ }) : null]
136
+ })
137
+ }),
138
+ /* @__PURE__ */ r("div", {
139
+ className: "w-1/6 text-center",
140
+ children: /* @__PURE__ */ r("span", { children: e.quantity })
141
+ }),
142
+ /* @__PURE__ */ r("div", {
143
+ className: "w-3/12 text-right md:w-1/6",
144
+ children: /* @__PURE__ */ r("span", { children: s(e.unitPrice / t * F, c.currency, m.customer) })
145
+ }),
146
+ /* @__PURE__ */ r("div", {
147
+ className: "w-1/6 text-right",
148
+ children: /* @__PURE__ */ r("span", { children: s(e.quantity * e.unitPrice / t * F, c.currency, m.customer) })
149
+ })
150
+ ]
151
+ }, e.id);
152
+ })
144
153
  })]
145
154
  }),
146
155
  g && /* @__PURE__ */ r("section", {
@@ -158,11 +167,11 @@ function c({ saleDocument: c, items: l, subtotal: u, tax: d, total: f, formatDat
158
167
  children: s(u, c.currency, m.customer)
159
168
  })]
160
169
  }),
161
- c.taxRate != null && /* @__PURE__ */ i("div", {
170
+ d !== 0 && /* @__PURE__ */ i("div", {
162
171
  className: "mb-2 flex items-start justify-between gap-4",
163
172
  children: [/* @__PURE__ */ r("span", {
164
173
  className: "text-muted-foreground",
165
- children: C("docs_contract_sale_tax_label", { rate: (c.taxRate * 100).toFixed(0) })
174
+ children: C("docs_contract_sale_tax_label", { rate: ((c.taxRate ?? 0) * 100).toFixed(0) })
166
175
  }), /* @__PURE__ */ r("span", {
167
176
  className: "shrink-0 text-right font-semibold",
168
177
  children: s(d, c.currency, m.customer)
package/dist/i18n/en.d.ts CHANGED
@@ -157,6 +157,10 @@ export declare const storefront: {
157
157
  checkout_estimated_total: string;
158
158
  checkout_form_title: string;
159
159
  checkout_form_description: string;
160
+ checkout_first_name_label: string;
161
+ checkout_first_name_placeholder: string;
162
+ checkout_last_name_label: string;
163
+ checkout_last_name_placeholder: string;
160
164
  checkout_full_name_label: string;
161
165
  checkout_full_name_placeholder: string;
162
166
  checkout_email_label: string;
@@ -178,6 +182,13 @@ export declare const storefront: {
178
182
  checkout_payment_total_excluding_tax: string;
179
183
  checkout_payment_vat: string;
180
184
  checkout_payment_deposit_amount: string;
185
+ checkout_insurance_title: string;
186
+ checkout_insurance_description: string;
187
+ checkout_insurance_deductible: string;
188
+ checkout_insurance_total_one: string;
189
+ checkout_insurance_total_other: string;
190
+ checkout_insurance_exempt_line: string;
191
+ checkout_insurance_tax_notice: string;
181
192
  checkout_coupon_title: string;
182
193
  checkout_coupon_label: string;
183
194
  checkout_coupon_placeholder: string;
@@ -1 +1 @@
1
- {"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../src/i18n/en.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAwbtB,CAAA"}
1
+ {"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../src/i18n/en.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmctB,CAAA"}
package/dist/i18n/en.js CHANGED
@@ -158,6 +158,10 @@ var e = {
158
158
  checkout_estimated_total: "Booking total",
159
159
  checkout_form_title: "Your details",
160
160
  checkout_form_description: "Enter your details for this booking, and add any useful information in the notes.",
161
+ checkout_first_name_label: "First name",
162
+ checkout_first_name_placeholder: "Jane",
163
+ checkout_last_name_label: "Last name",
164
+ checkout_last_name_placeholder: "Doe",
161
165
  checkout_full_name_label: "Full name",
162
166
  checkout_full_name_placeholder: "Jane Doe",
163
167
  checkout_email_label: "Email",
@@ -179,6 +183,13 @@ var e = {
179
183
  checkout_payment_total_excluding_tax: "Subtotal (excl. tax)",
180
184
  checkout_payment_vat: "VAT ({{rate}})",
181
185
  checkout_payment_deposit_amount: "Deposit amount",
186
+ checkout_insurance_title: "Insure all eligible bikes",
187
+ checkout_insurance_description: "Optional cover at {{amount}} per day. Discounts do not apply to insurance.",
188
+ checkout_insurance_deductible: "Maximum deductible: {{amount}}",
189
+ checkout_insurance_total_one: "Insurance: {{amount}} for {{count}} day",
190
+ checkout_insurance_total_other: "Insurance: {{amount}} for {{count}} days",
191
+ checkout_insurance_exempt_line: "Insurance (VAT exempt)",
192
+ checkout_insurance_tax_notice: "Assurance exonérée de TVA – article 261 C, 2° du CGI",
182
193
  checkout_coupon_title: "Coupon",
183
194
  checkout_coupon_label: "Coupon code",
184
195
  checkout_coupon_placeholder: "Coupon code",
package/dist/i18n/fr.d.ts CHANGED
@@ -158,6 +158,10 @@ export declare const storefront: {
158
158
  checkout_estimated_total: string;
159
159
  checkout_form_title: string;
160
160
  checkout_form_description: string;
161
+ checkout_first_name_label: string;
162
+ checkout_first_name_placeholder: string;
163
+ checkout_last_name_label: string;
164
+ checkout_last_name_placeholder: string;
161
165
  checkout_full_name_label: string;
162
166
  checkout_full_name_placeholder: string;
163
167
  checkout_email_label: string;
@@ -179,6 +183,13 @@ export declare const storefront: {
179
183
  checkout_payment_total_excluding_tax: string;
180
184
  checkout_payment_vat: string;
181
185
  checkout_payment_deposit_amount: string;
186
+ checkout_insurance_title: string;
187
+ checkout_insurance_description: string;
188
+ checkout_insurance_deductible: string;
189
+ checkout_insurance_total_one: string;
190
+ checkout_insurance_total_other: string;
191
+ checkout_insurance_exempt_line: string;
192
+ checkout_insurance_tax_notice: string;
182
193
  checkout_coupon_title: string;
183
194
  checkout_coupon_label: string;
184
195
  checkout_coupon_placeholder: string;
@@ -1 +1 @@
1
- {"version":3,"file":"fr.d.ts","sourceRoot":"","sources":["../../src/i18n/fr.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAybtB,CAAA"}
1
+ {"version":3,"file":"fr.d.ts","sourceRoot":"","sources":["../../src/i18n/fr.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAoctB,CAAA"}
package/dist/i18n/fr.js CHANGED
@@ -159,6 +159,10 @@ var e = {
159
159
  checkout_estimated_total: "Total de la réservation",
160
160
  checkout_form_title: "Vos informations",
161
161
  checkout_form_description: "Renseignez vos coordonnées pour votre réservation. N'hésitez pas à ajouter toute information utile dans les notes.",
162
+ checkout_first_name_label: "Prénom",
163
+ checkout_first_name_placeholder: "Jean",
164
+ checkout_last_name_label: "Nom",
165
+ checkout_last_name_placeholder: "Dupont",
162
166
  checkout_full_name_label: "Nom complet",
163
167
  checkout_full_name_placeholder: "Jean Dupont",
164
168
  checkout_email_label: "Email",
@@ -180,6 +184,13 @@ var e = {
180
184
  checkout_payment_total_excluding_tax: "Total HT",
181
185
  checkout_payment_vat: "TVA ({{rate}})",
182
186
  checkout_payment_deposit_amount: "Montant de l'acompte",
187
+ checkout_insurance_title: "Assurer tous les vélos éligibles",
188
+ checkout_insurance_description: "Option facultative à {{amount}} par jour. La remise ne s’applique pas à l’assurance.",
189
+ checkout_insurance_deductible: "Franchise maximale : {{amount}}",
190
+ checkout_insurance_total_one: "Assurance : {{amount}} pour {{count}} jour",
191
+ checkout_insurance_total_other: "Assurance : {{amount}} pour {{count}} jours",
192
+ checkout_insurance_exempt_line: "Assurance (exonérée de TVA)",
193
+ checkout_insurance_tax_notice: "Assurance exonérée de TVA – article 261 C, 2° du CGI",
183
194
  checkout_coupon_title: "Coupon",
184
195
  checkout_coupon_label: "Code coupon",
185
196
  checkout_coupon_placeholder: "Code coupon",