@loczer/storefront-sdk 0.192.0 → 0.193.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/components/ContractSaleDocument/DocumentAcceptanceSection.d.ts +10 -0
- package/dist/components/ContractSaleDocument/DocumentAcceptanceSection.d.ts.map +1 -0
- package/dist/components/ContractSaleDocument/DocumentAcceptanceSection.js +104 -0
- package/dist/components/ContractSaleDocument/Invoice.d.ts +2 -2
- package/dist/components/ContractSaleDocument/Invoice.d.ts.map +1 -1
- package/dist/components/ContractSaleDocument/Invoice.js +182 -135
- package/dist/components/ContractSaleDocument/InvoiceDetails.d.ts.map +1 -1
- package/dist/components/ContractSaleDocument/InvoiceDetails.js +106 -138
- package/dist/components/ContractSaleDocument/TermsAndConditionsContent.d.ts +0 -2
- package/dist/components/ContractSaleDocument/TermsAndConditionsContent.d.ts.map +1 -1
- package/dist/components/ContractSaleDocument/TermsAndConditionsContent.js +32 -37
- package/dist/i18n/en.d.ts +4 -0
- package/dist/i18n/en.d.ts.map +1 -1
- package/dist/i18n/en.js +4 -0
- package/dist/i18n/fr.d.ts +4 -0
- package/dist/i18n/fr.d.ts.map +1 -1
- package/dist/i18n/fr.js +4 -0
- package/dist/index.d.ts +121 -9
- package/dist/index.js +5 -5
- package/dist/lib/contractSaleDocument.d.ts +44 -3
- package/dist/lib/contractSaleDocument.d.ts.map +1 -1
- package/dist/lib/contractSaleDocument.js +33 -17
- package/dist/lib/contractSaleDocumentApi.d.ts +54 -6
- package/dist/lib/contractSaleDocumentApi.d.ts.map +1 -1
- package/dist/lib/contractSaleDocumentApi.js +41 -37
- package/dist/pages/ContractSaleDocumentPage.d.ts +21 -9
- package/dist/pages/ContractSaleDocumentPage.d.ts.map +1 -1
- package/dist/storefront.css +1 -1
- package/package.json +1 -1
|
@@ -1,28 +1,40 @@
|
|
|
1
1
|
import { Button as e } from "../../ui/button.js";
|
|
2
2
|
import { AcceptanceModal as t } from "./AcceptanceModal.js";
|
|
3
3
|
import { formatContractSaleDocumentLabel as n, resolveContractSaleDocumentLanguage as r } from "./language.js";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
4
|
+
import { DocumentAcceptanceSection as i } from "./DocumentAcceptanceSection.js";
|
|
5
|
+
import { InvoiceDetails as a } from "./InvoiceDetails.js";
|
|
6
|
+
import { Page as o } from "./Page.js";
|
|
7
|
+
import { PageFooter as s } from "./PageFooter.js";
|
|
8
|
+
import { PageHeader as ee } from "./PageHeader.js";
|
|
9
|
+
import { SignatureModal as te } from "./SignatureModal.js";
|
|
10
|
+
import { TermsAndConditionsContent as ne } from "./TermsAndConditionsContent.js";
|
|
11
|
+
import { ThumbnailSidebar as re } from "./ThumbnailSidebar.js";
|
|
11
12
|
/* empty css */
|
|
12
|
-
import { useEffect as
|
|
13
|
-
import { Fragment as
|
|
14
|
-
import { useTranslation as
|
|
15
|
-
import { CheckCircle2 as
|
|
16
|
-
import * as
|
|
17
|
-
import { toString as
|
|
13
|
+
import { useEffect as c, useRef as l, useState as u } from "react";
|
|
14
|
+
import { Fragment as ie, jsx as d, jsxs as f } from "react/jsx-runtime";
|
|
15
|
+
import { useTranslation as ae } from "react-i18next";
|
|
16
|
+
import { CheckCircle2 as oe } from "lucide-react";
|
|
17
|
+
import * as se from "html-to-image";
|
|
18
|
+
import { toString as ce } from "qrcode";
|
|
18
19
|
//#region src/components/ContractSaleDocument/Invoice.tsx
|
|
19
|
-
|
|
20
|
+
async function le(e) {
|
|
21
|
+
e.complete || await new Promise((t) => {
|
|
22
|
+
let n = () => {
|
|
23
|
+
e.removeEventListener("load", n), e.removeEventListener("error", n), t();
|
|
24
|
+
};
|
|
25
|
+
e.addEventListener("load", n), e.addEventListener("error", n), e.complete && n();
|
|
26
|
+
});
|
|
27
|
+
try {
|
|
28
|
+
await e.decode();
|
|
29
|
+
} catch {}
|
|
30
|
+
}
|
|
31
|
+
var p = 22, m = 10, h = 14, g = 14, ue = 3, _ = 6, v = (e, t) => {
|
|
20
32
|
if (t <= 0) return [e];
|
|
21
33
|
let n = [];
|
|
22
34
|
for (let r = 0; r < e.length; r += t) n.push(e.slice(r, r + t));
|
|
23
35
|
return n;
|
|
24
|
-
},
|
|
25
|
-
if (e.length <=
|
|
36
|
+
}, de = (e) => {
|
|
37
|
+
if (e.length <= m) return [{
|
|
26
38
|
kind: "invoice",
|
|
27
39
|
key: "invoice-page-1",
|
|
28
40
|
items: e,
|
|
@@ -34,13 +46,13 @@ var m = 22, h = 10, g = 14, _ = 14, v = 3, ce = 6, y = (e, t) => {
|
|
|
34
46
|
let t = [{
|
|
35
47
|
kind: "invoice",
|
|
36
48
|
key: "invoice-page-1",
|
|
37
|
-
items: e.slice(0,
|
|
49
|
+
items: e.slice(0, m),
|
|
38
50
|
showInvoiceMeta: !0,
|
|
39
51
|
showTotalsSection: !1,
|
|
40
52
|
showNotesSection: !1,
|
|
41
53
|
showAcceptanceSection: !1
|
|
42
|
-
}], n = e.slice(
|
|
43
|
-
if (n.length <=
|
|
54
|
+
}], n = e.slice(m);
|
|
55
|
+
if (n.length <= g) return t.push({
|
|
44
56
|
kind: "invoice",
|
|
45
57
|
key: "invoice-page-final-1",
|
|
46
58
|
items: n,
|
|
@@ -49,9 +61,9 @@ var m = 22, h = 10, g = 14, _ = 14, v = 3, ce = 6, y = (e, t) => {
|
|
|
49
61
|
showNotesSection: !0,
|
|
50
62
|
showAcceptanceSection: !0
|
|
51
63
|
}), t;
|
|
52
|
-
let r = n.length %
|
|
53
|
-
r === 0 && (r = Math.min(
|
|
54
|
-
let i = Math.max(0, n.length - r), a = n.slice(0, i), o = n.slice(i), s =
|
|
64
|
+
let r = n.length % h;
|
|
65
|
+
r === 0 && (r = Math.min(g, h));
|
|
66
|
+
let i = Math.max(0, n.length - r), a = n.slice(0, i), o = n.slice(i), s = v(a, h);
|
|
55
67
|
return s.forEach((e, n) => {
|
|
56
68
|
t.push({
|
|
57
69
|
kind: "invoice",
|
|
@@ -71,24 +83,28 @@ var m = 22, h = 10, g = 14, _ = 14, v = 3, ce = 6, y = (e, t) => {
|
|
|
71
83
|
showNotesSection: !0,
|
|
72
84
|
showAcceptanceSection: !0
|
|
73
85
|
}), t;
|
|
74
|
-
},
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
+
}, fe = (e, t) => {
|
|
87
|
+
let n = t && e.articles.some((e) => !!(e.translationTitle || e.translationBody || e.translationBodyHtml)), r = n ? ue : _;
|
|
88
|
+
return v(e.articles, r).map((t, r) => ({
|
|
89
|
+
kind: "appendix",
|
|
90
|
+
key: `${e.id}-page-${r + 1}`,
|
|
91
|
+
title: e.title,
|
|
92
|
+
showTitle: r === 0,
|
|
93
|
+
articles: t,
|
|
94
|
+
withTranslation: n
|
|
95
|
+
}));
|
|
96
|
+
};
|
|
97
|
+
function y({ data: m, showAppendices: h = !0, withEnglishTranslation: g = !0, heightMode: ue = "viewport", renderMode: _ = "interactive", publicDocumentUrl: v, onAccept: y }) {
|
|
98
|
+
let { t: b, i18n: pe } = ae(), x = v?.trim() ?? "", S = _ === "pdf", [C, w] = u(m), [T, me] = u(!1), [E, D] = u(null), [he, O] = u(0), [k, A] = u([]), [ge, j] = u(!0), [_e, M] = u(0), [N, P] = u(""), [ve, F] = u(x.length === 0 && !S), [ye, I] = u(!S), L = l(null), R = l(null), z = l(null), B = l([]);
|
|
99
|
+
c(() => {
|
|
100
|
+
w(m);
|
|
101
|
+
}, [m]), c(() => {
|
|
86
102
|
if (!x) {
|
|
87
|
-
|
|
103
|
+
P(""), F(!S);
|
|
88
104
|
return;
|
|
89
105
|
}
|
|
90
106
|
let e = !1;
|
|
91
|
-
return
|
|
107
|
+
return P(""), F(!1), ce(x, {
|
|
92
108
|
type: "svg",
|
|
93
109
|
errorCorrectionLevel: "M",
|
|
94
110
|
margin: 1,
|
|
@@ -98,54 +114,80 @@ function b({ data: c, showTermsPage: h = !0, withEnglishTranslation: g = !0, hei
|
|
|
98
114
|
light: "#FFFFFF"
|
|
99
115
|
}
|
|
100
116
|
}).then((t) => {
|
|
101
|
-
e ||
|
|
117
|
+
e || P(`data:image/svg+xml;utf8,${encodeURIComponent(t)}`);
|
|
102
118
|
}).catch((t) => {
|
|
103
|
-
e || (console.error("Document QR code generation failed:", t),
|
|
119
|
+
e || (console.error("Document QR code generation failed:", t), P(""));
|
|
104
120
|
}).finally(() => {
|
|
105
|
-
e ||
|
|
121
|
+
e || F(!0);
|
|
106
122
|
}), () => {
|
|
107
123
|
e = !0;
|
|
108
124
|
};
|
|
109
125
|
}, [x, S]);
|
|
110
|
-
let
|
|
126
|
+
let V = r(C, pe.language), be = (e, t = {}) => n(b, V, e, t), H = C.kind === "credit_note" ? -1 : 1, U = C.items.reduce((e, t) => e + t.quantity * t.unitPrice, 0) * H, W = C.items.reduce((e, t) => e + t.quantity * t.unitPrice * H / (1 + (t.taxRate ?? C.taxRate ?? 0)), 0), xe = U - W, G = be(C.kind === "credit_note" ? "docs_contract_sale_credit_note_title" : C.kind === "quote" ? "docs_contract_sale_quote_title" : "docs_contract_sale_invoice_title"), Se = de(C.items), K = C.kind === "credit_note" || !h ? [] : C.appendices, q = K.flatMap((e) => fe(e, g)), J = [...Se, ...q], Y = J.length, X = [
|
|
111
127
|
C.id,
|
|
112
128
|
C.kind,
|
|
113
129
|
C.saleDocumentNumber,
|
|
114
130
|
C.items.map((e) => `${e.id}:${e.description}:${e.quantity}:${e.unitPrice}`).join(","),
|
|
115
|
-
|
|
116
|
-
h ? K.map((e) =>
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
131
|
+
C.rental ? `${C.rental.bookingNumber}:${C.rental.start.toISOString()}:${C.rental.end.toISOString()}:${C.rental.pickupAddress ?? ""}:${C.rental.returnAddress ?? ""}` : "",
|
|
132
|
+
h ? K.map((e) => [
|
|
133
|
+
e.id,
|
|
134
|
+
e.title,
|
|
135
|
+
e.articles.map((e) => `${e.id}:${e.title}:${e.body}:${e.bodyHtml ?? ""}:${e.translationTitle ?? ""}:${e.translationBody ?? ""}:${e.translationBodyHtml ?? ""}`).join(",")
|
|
136
|
+
].join(":")).join("|") : "",
|
|
137
|
+
g ? "translated" : "legal-only",
|
|
138
|
+
V.legal,
|
|
139
|
+
V.customer,
|
|
140
|
+
V.translation ?? "",
|
|
121
141
|
J.map((e) => e.key).join(",")
|
|
122
|
-
].join("|"),
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
142
|
+
].join("|"), Z = !S && (C.acceptanceLevel !== "none" || C.acceptance != null), Q = C.acceptance;
|
|
143
|
+
c(() => {
|
|
144
|
+
if (!S) {
|
|
145
|
+
I(!0);
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
let e = z.current;
|
|
149
|
+
if (!e) {
|
|
150
|
+
I(!1);
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
let t = !1;
|
|
154
|
+
I(!1);
|
|
155
|
+
let n = Array.from(e.querySelectorAll("img"));
|
|
156
|
+
return Promise.all(n.map(le)).then(() => {
|
|
157
|
+
t || I(!0);
|
|
158
|
+
}), () => {
|
|
159
|
+
t = !0;
|
|
160
|
+
};
|
|
161
|
+
}, [
|
|
162
|
+
N,
|
|
163
|
+
S,
|
|
164
|
+
X
|
|
165
|
+
]), B.current.length > Y && (B.current.length = Y), c(() => {
|
|
166
|
+
M((e) => Y === 0 ? 0 : Math.min(e, Y - 1));
|
|
167
|
+
}, [Y]), c(() => {
|
|
126
168
|
let e = L.current;
|
|
127
|
-
|
|
169
|
+
me(!1), M(0), e?.scrollTo({
|
|
128
170
|
top: 0,
|
|
129
171
|
left: 0,
|
|
130
172
|
behavior: "auto"
|
|
131
173
|
});
|
|
132
174
|
let t = () => {
|
|
133
|
-
e && e.scrollHeight - e.scrollTop <= e.clientHeight + 5 &&
|
|
175
|
+
e && e.scrollHeight - e.scrollTop <= e.clientHeight + 5 && me(!0);
|
|
134
176
|
};
|
|
135
177
|
return e?.addEventListener("scroll", t), t(), () => {
|
|
136
178
|
e?.removeEventListener("scroll", t);
|
|
137
179
|
};
|
|
138
|
-
}, [
|
|
180
|
+
}, [X]), c(() => {
|
|
139
181
|
let e = !1;
|
|
140
182
|
return (async () => {
|
|
141
183
|
if (S) {
|
|
142
|
-
|
|
184
|
+
A([]), j(!1);
|
|
143
185
|
return;
|
|
144
186
|
}
|
|
145
|
-
|
|
146
|
-
let t = [], n =
|
|
187
|
+
j(!0), await new Promise((e) => setTimeout(e, 0));
|
|
188
|
+
let t = [], n = B.current.slice(0, Y);
|
|
147
189
|
for (let e of n) if (e) try {
|
|
148
|
-
let n = await
|
|
190
|
+
let n = await se.toPng(e, {
|
|
149
191
|
quality: .7,
|
|
150
192
|
pixelRatio: 1,
|
|
151
193
|
style: {
|
|
@@ -158,26 +200,26 @@ function b({ data: c, showTermsPage: h = !0, withEnglishTranslation: g = !0, hei
|
|
|
158
200
|
} catch (e) {
|
|
159
201
|
console.error("Thumbnail generation failed:", e);
|
|
160
202
|
}
|
|
161
|
-
e || (
|
|
203
|
+
e || (A(t), j(!1));
|
|
162
204
|
})(), () => {
|
|
163
205
|
e = !0;
|
|
164
206
|
};
|
|
165
207
|
}, [
|
|
166
208
|
C,
|
|
167
209
|
h,
|
|
168
|
-
|
|
210
|
+
g,
|
|
169
211
|
Y,
|
|
170
212
|
S,
|
|
171
|
-
|
|
172
|
-
]),
|
|
173
|
-
if (S ||
|
|
174
|
-
let e =
|
|
213
|
+
N
|
|
214
|
+
]), c(() => {
|
|
215
|
+
if (S || k.length === 0) return;
|
|
216
|
+
let e = B.current.slice(0, Y).filter((e) => e != null);
|
|
175
217
|
if (e.length === 0) return;
|
|
176
218
|
let t = new IntersectionObserver((t) => {
|
|
177
219
|
for (let n of t) {
|
|
178
220
|
if (!n.isIntersecting) continue;
|
|
179
221
|
let t = e.findIndex((e) => e === n.target);
|
|
180
|
-
t !== -1 &&
|
|
222
|
+
t !== -1 && M(t);
|
|
181
223
|
}
|
|
182
224
|
}, {
|
|
183
225
|
root: L.current,
|
|
@@ -191,44 +233,44 @@ function b({ data: c, showTermsPage: h = !0, withEnglishTranslation: g = !0, hei
|
|
|
191
233
|
});
|
|
192
234
|
};
|
|
193
235
|
}, [
|
|
194
|
-
|
|
236
|
+
k,
|
|
195
237
|
Y,
|
|
196
238
|
S
|
|
197
|
-
]),
|
|
239
|
+
]), c(() => {
|
|
198
240
|
let e = R.current;
|
|
199
|
-
if (!
|
|
200
|
-
|
|
241
|
+
if (!Z || !e) {
|
|
242
|
+
O(0);
|
|
201
243
|
return;
|
|
202
244
|
}
|
|
203
245
|
let t = () => {
|
|
204
|
-
|
|
246
|
+
O(Math.ceil(e.getBoundingClientRect().height));
|
|
205
247
|
};
|
|
206
248
|
if (t(), typeof ResizeObserver > "u") return;
|
|
207
249
|
let n = new ResizeObserver(t);
|
|
208
250
|
return n.observe(e), () => {
|
|
209
251
|
n.disconnect();
|
|
210
252
|
};
|
|
211
|
-
}, [C.acceptance,
|
|
212
|
-
let
|
|
253
|
+
}, [C.acceptance, Z]);
|
|
254
|
+
let Ce = (e) => {
|
|
213
255
|
let t = e instanceof Date ? e : new Date(e);
|
|
214
256
|
return Number.isNaN(t.getTime()) ? null : t;
|
|
215
|
-
},
|
|
216
|
-
let t =
|
|
217
|
-
return t ? new Intl.DateTimeFormat(
|
|
257
|
+
}, we = (e) => {
|
|
258
|
+
let t = Ce(e);
|
|
259
|
+
return t ? new Intl.DateTimeFormat(V.legal, {
|
|
218
260
|
day: "2-digit",
|
|
219
261
|
month: "2-digit",
|
|
220
262
|
year: "numeric"
|
|
221
263
|
}).format(t) : "-";
|
|
222
|
-
},
|
|
223
|
-
let t =
|
|
224
|
-
return t ? new Intl.DateTimeFormat(
|
|
264
|
+
}, Te = (e) => {
|
|
265
|
+
let t = Ce(e);
|
|
266
|
+
return t ? new Intl.DateTimeFormat(V.legal, {
|
|
225
267
|
day: "2-digit",
|
|
226
268
|
month: "2-digit",
|
|
227
269
|
year: "numeric",
|
|
228
270
|
hour: "2-digit",
|
|
229
271
|
minute: "2-digit"
|
|
230
272
|
}).format(t) : "-";
|
|
231
|
-
},
|
|
273
|
+
}, Ee = async (e) => {
|
|
232
274
|
let t = y ? await y(e) : void 0;
|
|
233
275
|
if (t) {
|
|
234
276
|
w(t);
|
|
@@ -238,124 +280,129 @@ function b({ data: c, showTermsPage: h = !0, withEnglishTranslation: g = !0, hei
|
|
|
238
280
|
...t,
|
|
239
281
|
acceptance: e
|
|
240
282
|
}));
|
|
241
|
-
},
|
|
242
|
-
await
|
|
283
|
+
}, De = async () => {
|
|
284
|
+
await Ee({
|
|
243
285
|
mode: "acceptance",
|
|
244
286
|
date: /* @__PURE__ */ new Date()
|
|
245
287
|
});
|
|
246
|
-
},
|
|
247
|
-
await
|
|
248
|
-
},
|
|
249
|
-
|
|
288
|
+
}, Oe = async (e) => {
|
|
289
|
+
await Ee(e);
|
|
290
|
+
}, ke = (e) => {
|
|
291
|
+
M(e), B.current[e]?.scrollIntoView({
|
|
250
292
|
behavior: "smooth",
|
|
251
293
|
block: "start"
|
|
252
294
|
});
|
|
253
|
-
},
|
|
295
|
+
}, Ae = Z ? he + p : p, $ = ue === "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 = Q?.mode === "signature" ? b("docs_contract_sale_already_signed", { date: Te(Q.date) }) : Q?.mode === "acceptance" ? b("docs_contract_sale_already_accepted", { date: Te(Q.date) }) : null, Ne = (e, t) => /* @__PURE__ */ f(o, {
|
|
254
296
|
ref: (e) => {
|
|
255
|
-
|
|
297
|
+
B.current[t] = e;
|
|
256
298
|
},
|
|
257
299
|
className: S || t === Y - 1 ? "!mb-0" : void 0,
|
|
258
300
|
children: [
|
|
259
|
-
/* @__PURE__ */
|
|
260
|
-
documentTitle:
|
|
301
|
+
/* @__PURE__ */ d(ee, {
|
|
302
|
+
documentTitle: G,
|
|
261
303
|
saleDocumentNumber: C.saleDocumentNumber,
|
|
262
304
|
currentPage: t + 1,
|
|
263
305
|
totalPages: Y,
|
|
264
|
-
documentLanguage:
|
|
306
|
+
documentLanguage: V
|
|
265
307
|
}),
|
|
266
|
-
e.kind === "invoice" ? /* @__PURE__ */
|
|
308
|
+
e.kind === "invoice" ? /* @__PURE__ */ d(a, {
|
|
267
309
|
saleDocument: C,
|
|
268
310
|
items: e.items,
|
|
269
|
-
subtotal:
|
|
270
|
-
tax:
|
|
271
|
-
total:
|
|
272
|
-
formatDate:
|
|
311
|
+
subtotal: W,
|
|
312
|
+
tax: xe,
|
|
313
|
+
total: U,
|
|
314
|
+
formatDate: we,
|
|
273
315
|
showInvoiceMeta: e.showInvoiceMeta,
|
|
274
316
|
showTotalsSection: e.showTotalsSection,
|
|
275
317
|
showNotesSection: e.showNotesSection,
|
|
276
|
-
showAcceptanceSection: e.showAcceptanceSection,
|
|
277
|
-
documentQrCodeUrl: e.showInvoiceMeta ?
|
|
278
|
-
documentLanguage:
|
|
318
|
+
showAcceptanceSection: e.showAcceptanceSection && q.length === 0,
|
|
319
|
+
documentQrCodeUrl: e.showInvoiceMeta ? N : void 0,
|
|
320
|
+
documentLanguage: V
|
|
279
321
|
}) : /* @__PURE__ */ f("main", {
|
|
280
|
-
className: "flex-grow px-4 text-left md:px-8",
|
|
281
|
-
children: /* @__PURE__ */
|
|
322
|
+
className: "flex flex-grow flex-col px-4 text-left md:px-8",
|
|
323
|
+
children: [/* @__PURE__ */ d(ne, {
|
|
282
324
|
title: e.title,
|
|
283
325
|
articles: e.articles,
|
|
284
|
-
withEnglishTranslation:
|
|
326
|
+
withEnglishTranslation: e.withTranslation,
|
|
285
327
|
showTitle: e.showTitle
|
|
286
|
-
})
|
|
328
|
+
}), t === Y - 1 ? /* @__PURE__ */ d(i, {
|
|
329
|
+
saleDocument: C,
|
|
330
|
+
documentLanguage: V,
|
|
331
|
+
formatDate: we
|
|
332
|
+
}) : null]
|
|
287
333
|
}),
|
|
288
|
-
/* @__PURE__ */
|
|
289
|
-
documentTitle:
|
|
334
|
+
/* @__PURE__ */ d(s, {
|
|
335
|
+
documentTitle: G,
|
|
290
336
|
saleDocumentNumber: C.saleDocumentNumber,
|
|
291
337
|
currentPage: t + 1,
|
|
292
338
|
totalPages: Y,
|
|
293
|
-
documentLanguage:
|
|
339
|
+
documentLanguage: V
|
|
294
340
|
})
|
|
295
341
|
]
|
|
296
342
|
}, e.key);
|
|
297
|
-
return S ? /* @__PURE__ */
|
|
298
|
-
|
|
343
|
+
return S ? /* @__PURE__ */ d("div", {
|
|
344
|
+
ref: z,
|
|
345
|
+
"data-testid": ve && ye ? "contract-sale-document-pdf-ready" : void 0,
|
|
299
346
|
className: "contract-sale-document contract-sale-document-pdf bg-white text-foreground",
|
|
300
|
-
children: J.map(
|
|
301
|
-
}) : /* @__PURE__ */
|
|
347
|
+
children: J.map(Ne)
|
|
348
|
+
}) : /* @__PURE__ */ d(ie, { children: /* @__PURE__ */ f("div", {
|
|
302
349
|
className: `contract-sale-document ${$ ? "h-full" : "h-dvh"} min-h-0 md:flex`,
|
|
303
|
-
children: [/* @__PURE__ */
|
|
304
|
-
thumbnails:
|
|
305
|
-
activePage:
|
|
306
|
-
onThumbnailClick:
|
|
350
|
+
children: [/* @__PURE__ */ d(re, {
|
|
351
|
+
thumbnails: k,
|
|
352
|
+
activePage: _e,
|
|
353
|
+
onThumbnailClick: ke,
|
|
307
354
|
totalPages: Y,
|
|
308
355
|
heightClassName: $ ? "h-full" : "h-dvh",
|
|
309
356
|
contentClassName: $ ? "pt-16" : void 0,
|
|
310
|
-
isLoading:
|
|
311
|
-
}), /* @__PURE__ */
|
|
357
|
+
isLoading: ge
|
|
358
|
+
}), /* @__PURE__ */ f("div", {
|
|
312
359
|
ref: L,
|
|
313
360
|
"data-testid": "contract-sale-document-scroll-container",
|
|
314
361
|
className: `${$ ? "h-full" : "h-dvh"} min-h-0 flex-1 overflow-y-auto overscroll-y-contain bg-transparent`,
|
|
315
362
|
style: {
|
|
316
363
|
paddingTop: $ ? "3.5rem" : void 0,
|
|
317
364
|
scrollPaddingTop: $ ? "3.5rem" : void 0,
|
|
318
|
-
paddingBottom: `${
|
|
365
|
+
paddingBottom: `${Ae}px`
|
|
319
366
|
},
|
|
320
367
|
children: [
|
|
321
|
-
J.map(
|
|
322
|
-
/* @__PURE__ */
|
|
368
|
+
J.map(Ne),
|
|
369
|
+
/* @__PURE__ */ d("p", {
|
|
323
370
|
className: "px-4 text-center text-xs text-muted-foreground/75 md:px-8",
|
|
324
|
-
style: { paddingTop: `${
|
|
371
|
+
style: { paddingTop: `${p}px` },
|
|
325
372
|
children: b("docs_contract_sale_end")
|
|
326
373
|
}),
|
|
327
|
-
|
|
374
|
+
Z ? /* @__PURE__ */ d("div", {
|
|
328
375
|
ref: R,
|
|
329
376
|
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:
|
|
377
|
+
children: Me ? /* @__PURE__ */ f("div", {
|
|
331
378
|
className: "flex items-center gap-2 px-6 py-3 text-sm font-semibold text-success",
|
|
332
|
-
children: [/* @__PURE__ */
|
|
379
|
+
children: [/* @__PURE__ */ d(oe, {
|
|
333
380
|
className: "h-4 w-4 shrink-0",
|
|
334
381
|
"aria-hidden": "true"
|
|
335
|
-
}), /* @__PURE__ */
|
|
382
|
+
}), /* @__PURE__ */ d("p", {
|
|
336
383
|
className: "text-center",
|
|
337
|
-
children:
|
|
384
|
+
children: Me
|
|
338
385
|
})]
|
|
339
|
-
}) : /* @__PURE__ */
|
|
340
|
-
onClick: () =>
|
|
386
|
+
}) : /* @__PURE__ */ d(e, {
|
|
387
|
+
onClick: () => D(C.acceptanceLevel === "signature" ? "signature" : "acceptance"),
|
|
341
388
|
disabled: !T,
|
|
342
389
|
className: "px-6 py-3 text-sm font-semibold",
|
|
343
390
|
"data-testid": "contract-sale-document-action-button",
|
|
344
|
-
children:
|
|
391
|
+
children: je
|
|
345
392
|
})
|
|
346
393
|
}) : null,
|
|
347
|
-
/* @__PURE__ */
|
|
348
|
-
isOpen:
|
|
349
|
-
onClose: () =>
|
|
394
|
+
/* @__PURE__ */ d(t, {
|
|
395
|
+
isOpen: E === "acceptance",
|
|
396
|
+
onClose: () => D(null),
|
|
350
397
|
onAccept: async () => {
|
|
351
|
-
await
|
|
398
|
+
await De(), D(null);
|
|
352
399
|
}
|
|
353
400
|
}),
|
|
354
|
-
/* @__PURE__ */
|
|
355
|
-
isOpen:
|
|
356
|
-
onClose: () =>
|
|
401
|
+
/* @__PURE__ */ d(te, {
|
|
402
|
+
isOpen: E === "signature",
|
|
403
|
+
onClose: () => D(null),
|
|
357
404
|
onSave: async (e) => {
|
|
358
|
-
await
|
|
405
|
+
await Oe(e), D(null);
|
|
359
406
|
}
|
|
360
407
|
})
|
|
361
408
|
]
|
|
@@ -363,4 +410,4 @@ function b({ data: c, showTermsPage: h = !0, withEnglishTranslation: g = !0, hei
|
|
|
363
410
|
}) });
|
|
364
411
|
}
|
|
365
412
|
//#endregion
|
|
366
|
-
export {
|
|
413
|
+
export { y as ContractSaleDocument };
|
|
@@ -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;
|
|
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;AAKvC,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;AA0CD,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,2CAyOrB"}
|