@loczer/storefront-sdk 0.177.0 → 0.179.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/chunks/ui/dist/Map/{MapContent-BqCzk6pD.js → MapContent-DUHBHUBa.js} +7 -7
- package/dist/chunks/ui/dist/Map/constants-DlJEohkl.js +4 -0
- package/dist/chunks/ui/dist/{Map-Cqn7INdm.js → Map-_kbTiMe4.js} +7 -7
- package/dist/chunks/ui/dist/Spinner/index-SbbUxcsT.js +48 -0
- package/dist/components/BookingBikeVariantDialog/index.js +12 -12
- package/dist/components/ContractSaleDocument/Invoice.d.ts.map +1 -1
- package/dist/components/ContractSaleDocument/Invoice.js +10 -10
- package/dist/components/ContractSaleDocument/InvoiceDetails.d.ts.map +1 -1
- package/dist/components/ContractSaleDocument/InvoiceDetails.js +57 -57
- package/dist/components/Map/index.js +1 -1
- package/dist/components/StorefrontCancellationPolicyNotice/index.js +11 -11
- package/dist/components/StorefrontCartPanel/index.js +7 -7
- package/dist/components/TestimonialsSection/index.d.ts.map +1 -1
- package/dist/components/TestimonialsSection/index.js +108 -117
- package/dist/components/payment/MollieCardFieldsForm.d.ts.map +1 -1
- package/dist/components/payment/MollieCardFieldsForm.js +16 -15
- package/dist/components/payment/StripeCardFieldsForm.d.ts.map +1 -1
- package/dist/components/payment/StripeCardFieldsForm.js +11 -10
- package/dist/i18n/en.d.ts +2 -0
- package/dist/i18n/en.d.ts.map +1 -1
- package/dist/i18n/en.js +2 -0
- package/dist/i18n/fr.d.ts +2 -0
- package/dist/i18n/fr.d.ts.map +1 -1
- package/dist/i18n/fr.js +2 -0
- package/dist/index.d.ts +9 -0
- package/dist/lib/contractSaleDocument.d.ts +2 -0
- package/dist/lib/contractSaleDocument.d.ts.map +1 -1
- package/dist/lib/contractSaleDocument.js +1 -1
- package/dist/lib/contractSaleDocumentApi.d.ts +3 -0
- package/dist/lib/contractSaleDocumentApi.d.ts.map +1 -1
- package/dist/lib/nameInitials.d.ts +3 -0
- package/dist/lib/nameInitials.d.ts.map +1 -0
- package/dist/lib/nameInitials.js +19 -0
- package/dist/pages/CheckoutPaymentPage.d.ts.map +1 -1
- package/dist/pages/CheckoutPaymentPage.js +42 -41
- package/dist/pages/CheckoutSuccessPage.js +11 -11
- package/dist/pages/ContractSaleDocumentPage.d.ts +1 -1
- package/dist/pages/ContractSaleDocumentPage.d.ts.map +1 -1
- package/dist/pages/ContractSaleDocumentPage.js +29 -28
- package/dist/pages/HomePage.js +36 -36
- package/dist/pages/PaymentLinkPage.d.ts.map +1 -1
- package/dist/pages/PaymentLinkPage.js +44 -43
- package/dist/pages/PaymentLinkSuccessPage.d.ts.map +1 -1
- package/dist/pages/PaymentLinkSuccessPage.js +15 -14
- package/dist/pages/ProductPage.js +1 -1
- package/dist/pages/checkout/components/CheckoutCouponCard.d.ts.map +1 -1
- package/dist/pages/checkout/components/CheckoutCouponCard.js +36 -35
- package/dist/pages/checkout/components/CheckoutPaymentCard.d.ts.map +1 -1
- package/dist/pages/checkout/components/CheckoutPaymentSummaryCard.d.ts.map +1 -1
- package/dist/pages/checkout/components/CheckoutPaymentSummaryCard.js +10 -9
- package/dist/storefront.css +1 -1
- package/package.json +3 -2
- package/dist/chunks/ui/dist/Map/constants-AiBwXZf6.js +0 -4
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as y, jsxs as _ } from "react/jsx-runtime";
|
|
2
|
-
import { Component as J, useRef as
|
|
2
|
+
import { Component as J, useRef as C, useState as B, useEffect as g } from "react";
|
|
3
3
|
import { COORDS as q } from "../static/strings-lR4Uv4ze.js";
|
|
4
4
|
import { cn as L } from "../lib/utils-B6zhukbw.js";
|
|
5
|
-
import { DEFAULT_MAP_SKELETON_COLOR as K } from "./constants-
|
|
5
|
+
import { DEFAULT_MAP_SKELETON_COLOR as K } from "./constants-DlJEohkl.js";
|
|
6
6
|
let M = null;
|
|
7
7
|
const U = async () => (M || (M = Promise.all([
|
|
8
8
|
// import("mapbox-gl/dist/esm-min/mapbox-gl.js"),
|
|
@@ -17,7 +17,7 @@ const U = async () => (M || (M = Promise.all([
|
|
|
17
17
|
markers: c = [],
|
|
18
18
|
routeGeoJson: s,
|
|
19
19
|
polygonGeoJson: m,
|
|
20
|
-
routeEndpointsToFetch:
|
|
20
|
+
routeEndpointsToFetch: E,
|
|
21
21
|
className: F,
|
|
22
22
|
style: k,
|
|
23
23
|
interactive: I = !0,
|
|
@@ -28,7 +28,7 @@ const U = async () => (M || (M = Promise.all([
|
|
|
28
28
|
onMapMoveOrZoom: S,
|
|
29
29
|
skeletonColor: H = K
|
|
30
30
|
}) => {
|
|
31
|
-
const v =
|
|
31
|
+
const v = C(null), w = C(null), [e, R] = B(null), j = C([]), A = C(n), [z, x] = B(null), [D, O] = B(!1), N = C(!1), P = L("relative overflow-clip w-full h-full", F);
|
|
32
32
|
return g(() => {
|
|
33
33
|
if (!v.current || e) return;
|
|
34
34
|
let o = !1, r = null;
|
|
@@ -167,9 +167,9 @@ const U = async () => (M || (M = Promise.all([
|
|
|
167
167
|
}
|
|
168
168
|
}));
|
|
169
169
|
}, [e, m]), g(() => {
|
|
170
|
-
if (!e || !e.isStyleLoaded() || !
|
|
170
|
+
if (!e || !e.isStyleLoaded() || !E || E.coordinates.length < 2)
|
|
171
171
|
return;
|
|
172
|
-
const { profile: o = "cycling", coordinates: r } =
|
|
172
|
+
const { profile: o = "cycling", coordinates: r } = E, t = "route-fetched", d = "route-layer-fetched";
|
|
173
173
|
return (async () => {
|
|
174
174
|
if (!i) return;
|
|
175
175
|
const a = r.map((p) => {
|
|
@@ -203,7 +203,7 @@ const U = async () => (M || (M = Promise.all([
|
|
|
203
203
|
})(), () => {
|
|
204
204
|
e && e.isStyleLoaded() && (e.getLayer(d) && e.removeLayer(d), e.getSource(t) && e.removeSource(t));
|
|
205
205
|
};
|
|
206
|
-
}, [e,
|
|
206
|
+
}, [e, E]), z ? /* @__PURE__ */ y("div", { className: P, style: k, children: /* @__PURE__ */ y("div", { className: L("flex h-full w-full items-center justify-center text-center text-sm text-gray-500"), children: z }) }) : /* @__PURE__ */ _("div", { className: P, style: k, children: [
|
|
207
207
|
/* @__PURE__ */ y(
|
|
208
208
|
"div",
|
|
209
209
|
{
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as e, jsxs as y } from "react/jsx-runtime";
|
|
2
2
|
import { lazy as b, useRef as N, useState as h, useEffect as k, Suspense as C } from "react";
|
|
3
|
-
import { cn as
|
|
4
|
-
import { isAutomationRuntime as
|
|
5
|
-
import { DEFAULT_MAP_SKELETON_COLOR as f } from "./Map/constants-
|
|
6
|
-
const
|
|
3
|
+
import { cn as I } from "./lib/utils-B6zhukbw.js";
|
|
4
|
+
import { isAutomationRuntime as x } from "./lib/isAutomationRuntime-Cu2aNI6_.js";
|
|
5
|
+
import { DEFAULT_MAP_SKELETON_COLOR as f } from "./Map/constants-DlJEohkl.js";
|
|
6
|
+
const E = ({ className: t, style: n, color: o }) => /* @__PURE__ */ y("div", { className: I("relative overflow-clip w-full h-full", t), style: n, children: [
|
|
7
7
|
/* @__PURE__ */ e(
|
|
8
8
|
"div",
|
|
9
9
|
{
|
|
@@ -13,10 +13,10 @@ const x = ({ className: t, style: n, color: o }) => /* @__PURE__ */ y("div", { c
|
|
|
13
13
|
}
|
|
14
14
|
),
|
|
15
15
|
/* @__PURE__ */ e("div", { className: "h-full w-full transition-opacity duration-500 ease-out pointer-events-none opacity-0" })
|
|
16
|
-
] }), O = b(() => import("./Map/MapContent-
|
|
16
|
+
] }), O = b(() => import("./Map/MapContent-DUHBHUBa.js")), A = (t) => {
|
|
17
17
|
const n = N(null), [o, p] = h(!1);
|
|
18
18
|
k(() => {
|
|
19
|
-
if (
|
|
19
|
+
if (x())
|
|
20
20
|
return;
|
|
21
21
|
let u = !1, s = null, r = null, i = null;
|
|
22
22
|
const a = () => {
|
|
@@ -36,7 +36,7 @@ const x = ({ className: t, style: n, color: o }) => /* @__PURE__ */ y("div", { c
|
|
|
36
36
|
};
|
|
37
37
|
}, [o]);
|
|
38
38
|
const c = /* @__PURE__ */ e(
|
|
39
|
-
|
|
39
|
+
E,
|
|
40
40
|
{
|
|
41
41
|
className: t.className,
|
|
42
42
|
style: t.style,
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { jsx as e, jsxs as n } from "react/jsx-runtime";
|
|
2
|
+
import { cn as s } from "../lib/utils-B6zhukbw.js";
|
|
3
|
+
function o({ className: r, ...a }) {
|
|
4
|
+
return /* @__PURE__ */ e(
|
|
5
|
+
"span",
|
|
6
|
+
{
|
|
7
|
+
className: s("relative inline-flex size-4 shrink-0 items-center justify-center", r),
|
|
8
|
+
"data-slot": "spinner",
|
|
9
|
+
...a,
|
|
10
|
+
children: /* @__PURE__ */ n(
|
|
11
|
+
"svg",
|
|
12
|
+
{
|
|
13
|
+
"aria-hidden": "true",
|
|
14
|
+
className: "size-full animate-spin",
|
|
15
|
+
fill: "none",
|
|
16
|
+
viewBox: "0 0 24 24",
|
|
17
|
+
children: [
|
|
18
|
+
/* @__PURE__ */ e(
|
|
19
|
+
"circle",
|
|
20
|
+
{
|
|
21
|
+
className: "opacity-20",
|
|
22
|
+
cx: "12",
|
|
23
|
+
cy: "12",
|
|
24
|
+
"data-spinner-layer": "track",
|
|
25
|
+
r: "9",
|
|
26
|
+
stroke: "currentColor",
|
|
27
|
+
strokeWidth: "2.5"
|
|
28
|
+
}
|
|
29
|
+
),
|
|
30
|
+
/* @__PURE__ */ e(
|
|
31
|
+
"path",
|
|
32
|
+
{
|
|
33
|
+
d: "M12 3a9 9 0 0 1 9 9",
|
|
34
|
+
"data-spinner-layer": "arc",
|
|
35
|
+
stroke: "currentColor",
|
|
36
|
+
strokeLinecap: "round",
|
|
37
|
+
strokeWidth: "2.5"
|
|
38
|
+
}
|
|
39
|
+
)
|
|
40
|
+
]
|
|
41
|
+
}
|
|
42
|
+
)
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
export {
|
|
47
|
+
o as Spinner
|
|
48
|
+
};
|
|
@@ -20,10 +20,10 @@ function ke({
|
|
|
20
20
|
product: a,
|
|
21
21
|
onOpenChange: p,
|
|
22
22
|
getVariantAvailabilityLabel: u,
|
|
23
|
-
isVariantOutOfCapacity:
|
|
23
|
+
isVariantOutOfCapacity: c,
|
|
24
24
|
onAddVariant: g
|
|
25
25
|
}) {
|
|
26
|
-
const { t: s, i18n: n } = Z(), r = K(T),
|
|
26
|
+
const { t: s, i18n: n } = Z(), r = K(T), d = ie(), [P, v] = O({});
|
|
27
27
|
if (q(() => {
|
|
28
28
|
!a || !o || v(
|
|
29
29
|
(a.productVariants ?? []).reduce((t, l) => (t[l.id] = 1, t), {})
|
|
@@ -35,7 +35,7 @@ function ke({
|
|
|
35
35
|
...b,
|
|
36
36
|
[t]: Math.max(1, Math.floor(l))
|
|
37
37
|
}));
|
|
38
|
-
}, y = m(a.name, n.language,
|
|
38
|
+
}, y = m(a.name, n.language, d), z = m(a.description, n.language, d), w = m(a.warning, n.language, d), k = typeof a.images?.[0] == "string" ? a.images[0].trim() : "", _ = ae(a.primaryImageStyle), h = te(a.availabilityStatus), f = a.features?.slice(0, 4) ?? [], C = a.productVariants ?? [], A = C.some((t) => !!J(t, "size")), M = s(A ? "product_size_label" : "product_variant_label");
|
|
39
39
|
return /* @__PURE__ */ e(G, { open: o, onOpenChange: p, children: /* @__PURE__ */ e(
|
|
40
40
|
W,
|
|
41
41
|
{
|
|
@@ -73,8 +73,8 @@ function ke({
|
|
|
73
73
|
!r && f.length > 0 ? /* @__PURE__ */ i("div", { className: "grid gap-2", children: [
|
|
74
74
|
/* @__PURE__ */ e("p", { className: "text-sm font-semibold text-slate-950", children: /* @__PURE__ */ e("span", { children: s("product_features_title") }) }),
|
|
75
75
|
/* @__PURE__ */ e("ul", { className: "grid gap-1.5 text-sm text-slate-700", children: f.map((t, l) => /* @__PURE__ */ i("li", { className: "inline-flex items-start gap-2", children: [
|
|
76
|
-
/* @__PURE__ */ e(I, { className: "mt-0.5 h-4 w-4 text-
|
|
77
|
-
/* @__PURE__ */ e("span", { children: m(t, n.language,
|
|
76
|
+
/* @__PURE__ */ e(I, { className: "mt-0.5 h-4 w-4 text-success", "aria-hidden": "true" }),
|
|
77
|
+
/* @__PURE__ */ e("span", { children: m(t, n.language, d) })
|
|
78
78
|
] }, `${a.id}-${l}`)) })
|
|
79
79
|
] }) : null,
|
|
80
80
|
r ? null : /* @__PURE__ */ e(B, { warning: w })
|
|
@@ -90,14 +90,14 @@ function ke({
|
|
|
90
90
|
/* @__PURE__ */ e(V, { className: "h-4 w-4 shrink-0 transition-transform group-open:rotate-45", "aria-hidden": "true" })
|
|
91
91
|
] }),
|
|
92
92
|
/* @__PURE__ */ e("div", { className: "border-t border-slate-200 px-3 py-3", children: /* @__PURE__ */ e("ul", { className: "grid gap-1.5 text-sm text-slate-700", children: f.map((t, l) => /* @__PURE__ */ i("li", { className: "inline-flex items-start gap-2", children: [
|
|
93
|
-
/* @__PURE__ */ e(I, { className: "mt-0.5 h-4 w-4 text-
|
|
94
|
-
/* @__PURE__ */ e("span", { children: m(t, n.language,
|
|
93
|
+
/* @__PURE__ */ e(I, { className: "mt-0.5 h-4 w-4 text-success", "aria-hidden": "true" }),
|
|
94
|
+
/* @__PURE__ */ e("span", { children: m(t, n.language, d) })
|
|
95
95
|
] }, `${a.id}-mobile-${l}`)) }) })
|
|
96
96
|
] }) : null,
|
|
97
97
|
r ? /* @__PURE__ */ e(B, { warning: w }) : null,
|
|
98
98
|
/* @__PURE__ */ e("p", { className: "text-2xs font-medium uppercase tracking-[0.18em] text-slate-500", children: /* @__PURE__ */ e("span", { children: M }) }),
|
|
99
99
|
/* @__PURE__ */ e("div", { className: "grid gap-2", children: C.map((t) => {
|
|
100
|
-
const l = `storefront-booking-bike-dialog-variant-option-${a.id}-${t.id}`.toLowerCase(), { label: b, description: $ } = ee(t), D = P[t.id] ?? 1, Q =
|
|
100
|
+
const l = `storefront-booking-bike-dialog-variant-option-${a.id}-${t.id}`.toLowerCase(), { label: b, description: $ } = ee(t), D = P[t.id] ?? 1, Q = c?.(t.id) === !0, L = u?.(t.id) ?? null;
|
|
101
101
|
return /* @__PURE__ */ i(
|
|
102
102
|
"div",
|
|
103
103
|
{
|
|
@@ -165,7 +165,7 @@ function le({
|
|
|
165
165
|
increaseAriaLabel: a,
|
|
166
166
|
onQuantityChange: p,
|
|
167
167
|
quantity: u,
|
|
168
|
-
testIdPrefix:
|
|
168
|
+
testIdPrefix: c
|
|
169
169
|
}) {
|
|
170
170
|
const g = (s, n) => {
|
|
171
171
|
const r = n?.metaKey || n?.ctrlKey ? 10 : 1;
|
|
@@ -180,7 +180,7 @@ function le({
|
|
|
180
180
|
size: "icon",
|
|
181
181
|
className: "h-9 w-9 font-semibold",
|
|
182
182
|
"aria-label": o,
|
|
183
|
-
"data-testid": `${
|
|
183
|
+
"data-testid": `${c}-decrement`,
|
|
184
184
|
onClick: (s) => g(-1, s),
|
|
185
185
|
children: /* @__PURE__ */ e("span", { children: "-" })
|
|
186
186
|
}
|
|
@@ -193,7 +193,7 @@ function le({
|
|
|
193
193
|
value: u,
|
|
194
194
|
className: "h-9 w-12 text-center",
|
|
195
195
|
"aria-live": "polite",
|
|
196
|
-
"data-testid": `${
|
|
196
|
+
"data-testid": `${c}-value`
|
|
197
197
|
}
|
|
198
198
|
),
|
|
199
199
|
/* @__PURE__ */ e(
|
|
@@ -204,7 +204,7 @@ function le({
|
|
|
204
204
|
size: "icon",
|
|
205
205
|
className: "h-9 w-9 font-semibold",
|
|
206
206
|
"aria-label": a,
|
|
207
|
-
"data-testid": `${
|
|
207
|
+
"data-testid": `${c}-increment`,
|
|
208
208
|
onClick: (s) => g(1, s),
|
|
209
209
|
children: /* @__PURE__ */ e("span", { children: "+" })
|
|
210
210
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Invoice.d.ts","sourceRoot":"","sources":["../../../src/components/ContractSaleDocument/Invoice.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,oBAAoB,IAAI,wBAAwB,EAChD,oCAAoC,EAIrC,MAAM,gCAAgC,CAAA;AAWvC,OAAO,eAAe,CAAA;AAGtB,KAAK,yBAAyB,GAAG;IAC/B,IAAI,EAAE,wBAAwB,CAAA;IAC9B,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,sBAAsB,CAAC,EAAE,OAAO,CAAA;IAChC,UAAU,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAA;IAClC,UAAU,CAAC,EAAE,aAAa,GAAG,KAAK,CAAA;IAClC,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,EAAE,CACT,UAAU,EAAE,oCAAoC,KAC7C,OAAO,CAAC,wBAAwB,GAAG,IAAI,CAAC,GAAG,wBAAwB,GAAG,IAAI,CAAA;CAChF,CAAA;AAwJD,wBAAgB,oBAAoB,CAAC,EACnC,IAAI,EAAE,WAAW,EACjB,aAAoB,EACpB,sBAA6B,EAC7B,UAAuB,EACvB,UAA0B,EAC1B,iBAAiB,EACjB,QAAQ,GACT,EAAE,yBAAyB,
|
|
1
|
+
{"version":3,"file":"Invoice.d.ts","sourceRoot":"","sources":["../../../src/components/ContractSaleDocument/Invoice.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EACV,oBAAoB,IAAI,wBAAwB,EAChD,oCAAoC,EAIrC,MAAM,gCAAgC,CAAA;AAWvC,OAAO,eAAe,CAAA;AAGtB,KAAK,yBAAyB,GAAG;IAC/B,IAAI,EAAE,wBAAwB,CAAA;IAC9B,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,sBAAsB,CAAC,EAAE,OAAO,CAAA;IAChC,UAAU,CAAC,EAAE,QAAQ,GAAG,UAAU,CAAA;IAClC,UAAU,CAAC,EAAE,aAAa,GAAG,KAAK,CAAA;IAClC,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,EAAE,CACT,UAAU,EAAE,oCAAoC,KAC7C,OAAO,CAAC,wBAAwB,GAAG,IAAI,CAAC,GAAG,wBAAwB,GAAG,IAAI,CAAA;CAChF,CAAA;AAwJD,wBAAgB,oBAAoB,CAAC,EACnC,IAAI,EAAE,WAAW,EACjB,aAAoB,EACpB,sBAA6B,EAC7B,UAAuB,EACvB,UAA0B,EAC1B,iBAAiB,EACjB,QAAQ,GACT,EAAE,yBAAyB,2CAqe3B;AAED,YAAY,EAAE,yBAAyB,EAAE,CAAA"}
|
|
@@ -84,7 +84,7 @@ const U = 22, G = 10, j = 14, re = 14, Ge = 3, je = 6, ae = (o, r) => {
|
|
|
84
84
|
title: r,
|
|
85
85
|
showTitle: f === 0,
|
|
86
86
|
articles: S
|
|
87
|
-
})),
|
|
87
|
+
})), qe = (o) => o.kind === "credit_note" ? [] : !o.terms || o.terms.articles.length === 0 ? Oe : o.terms.articles, Ve = (o) => o.terms?.title ?? $e;
|
|
88
88
|
function ut({
|
|
89
89
|
data: o,
|
|
90
90
|
showTermsPage: r = !0,
|
|
@@ -94,7 +94,7 @@ function ut({
|
|
|
94
94
|
publicDocumentUrl: S,
|
|
95
95
|
onAccept: f
|
|
96
96
|
}) {
|
|
97
|
-
const { t: u, i18n: M } = xe(), _ = S?.trim() ?? "", d = b === "pdf", [n, D] = h(o), [L, z] = h(!1), [Q, w] = h(null), [se,
|
|
97
|
+
const { t: u, i18n: M } = xe(), _ = S?.trim() ?? "", d = b === "pdf", [n, D] = h(o), [L, z] = h(!1), [Q, w] = h(null), [se, q] = h(0), [$, V] = h([]), [ie, O] = h(!0), [le, I] = h(0), [X, A] = h(""), [ue, B] = h(
|
|
98
98
|
_.length === 0 && !d
|
|
99
99
|
), F = H(null), W = H(null), v = H([]);
|
|
100
100
|
p(() => {
|
|
@@ -121,7 +121,7 @@ function ut({
|
|
|
121
121
|
e = !0;
|
|
122
122
|
};
|
|
123
123
|
}, [_, d]);
|
|
124
|
-
const m = He(n, M.language), de = (e, t = {}) => Ue(u, m, e, t), me = n.kind === "credit_note" ? -1 : 1, N = n.items.reduce((e, t) => e + t.quantity * t.unitPrice, 0) * me, K = n.taxRate != null ? N / (1 + n.taxRate) : N, he = n.taxRate != null ? N - K : 0, fe = n.kind === "credit_note" ? "docs_contract_sale_credit_note_title" : "docs_contract_sale_invoice_title", J = de(fe), Y =
|
|
124
|
+
const m = He(n, M.language), de = (e, t = {}) => Ue(u, m, e, t), me = n.kind === "credit_note" ? -1 : 1, N = n.items.reduce((e, t) => e + t.quantity * t.unitPrice, 0) * me, K = n.taxRate != null ? N / (1 + n.taxRate) : N, he = n.taxRate != null ? N - K : 0, fe = n.kind === "credit_note" ? "docs_contract_sale_credit_note_title" : n.kind === "quote" ? "docs_contract_sale_quote_title" : "docs_contract_sale_invoice_title", J = de(fe), Y = Ve(n), Z = qe(n), ge = ze(n.items), k = s, pe = r ? Qe(Z, Y, k) : [], x = [...ge, ...pe], i = x.length, _e = [
|
|
125
125
|
n.id,
|
|
126
126
|
n.kind,
|
|
127
127
|
n.saleDocumentNumber,
|
|
@@ -151,7 +151,7 @@ function ut({
|
|
|
151
151
|
let e = !1;
|
|
152
152
|
return (async () => {
|
|
153
153
|
if (d) {
|
|
154
|
-
|
|
154
|
+
V([]), O(!1);
|
|
155
155
|
return;
|
|
156
156
|
}
|
|
157
157
|
O(!0), await new Promise((g) => setTimeout(g, 0));
|
|
@@ -172,11 +172,11 @@ function ut({
|
|
|
172
172
|
} catch (y) {
|
|
173
173
|
console.error("Thumbnail generation failed:", y);
|
|
174
174
|
}
|
|
175
|
-
e || (
|
|
175
|
+
e || (V(c), O(!1));
|
|
176
176
|
})(), () => {
|
|
177
177
|
e = !0;
|
|
178
178
|
};
|
|
179
|
-
}, [n, r, k, i, d,
|
|
179
|
+
}, [n, r, k, i, d, X]), p(() => {
|
|
180
180
|
if (d || $.length === 0)
|
|
181
181
|
return;
|
|
182
182
|
const e = v.current.slice(0, i).filter((c) => c != null);
|
|
@@ -203,11 +203,11 @@ function ut({
|
|
|
203
203
|
}, [$, i, d]), p(() => {
|
|
204
204
|
const e = W.current;
|
|
205
205
|
if (!C || !e) {
|
|
206
|
-
|
|
206
|
+
q(0);
|
|
207
207
|
return;
|
|
208
208
|
}
|
|
209
209
|
const t = () => {
|
|
210
|
-
|
|
210
|
+
q(Math.ceil(e.getBoundingClientRect().height));
|
|
211
211
|
};
|
|
212
212
|
if (t(), typeof ResizeObserver > "u")
|
|
213
213
|
return;
|
|
@@ -285,7 +285,7 @@ function ut({
|
|
|
285
285
|
showTotalsSection: e.showTotalsSection,
|
|
286
286
|
showNotesSection: e.showNotesSection,
|
|
287
287
|
showAcceptanceSection: e.showAcceptanceSection,
|
|
288
|
-
documentQrCodeUrl: e.showInvoiceMeta ?
|
|
288
|
+
documentQrCodeUrl: e.showInvoiceMeta ? X : void 0,
|
|
289
289
|
documentLanguage: m
|
|
290
290
|
}
|
|
291
291
|
) : /* @__PURE__ */ a("main", { className: "flex-grow px-4 text-left md:px-8", children: /* @__PURE__ */ a(
|
|
@@ -357,7 +357,7 @@ function ut({
|
|
|
357
357
|
{
|
|
358
358
|
ref: W,
|
|
359
359
|
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",
|
|
360
|
-
children: oe ? /* @__PURE__ */ R("div", { className: "flex items-center gap-2 px-6 py-3 text-sm font-semibold text-
|
|
360
|
+
children: oe ? /* @__PURE__ */ R("div", { className: "flex items-center gap-2 px-6 py-3 text-sm font-semibold text-success", children: [
|
|
361
361
|
/* @__PURE__ */ a(Ne, { className: "h-4 w-4 shrink-0", "aria-hidden": "true" }),
|
|
362
362
|
/* @__PURE__ */ a("p", { className: "text-center", children: oe })
|
|
363
363
|
] }) : /* @__PURE__ */ a(
|
|
@@ -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,
|
|
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,23 +1,23 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as c, jsx as e, Fragment as E } from "react/jsx-runtime";
|
|
2
2
|
import { useTranslation as T } from "react-i18next";
|
|
3
3
|
import { formatContractSaleDocumentLabel as B, formatContractSaleDocumentLegalLabel as G } from "./language.js";
|
|
4
|
-
function I(
|
|
5
|
-
const l =
|
|
4
|
+
function I(t) {
|
|
5
|
+
const l = t?.trim() ?? "";
|
|
6
6
|
return !l || l === "-" ? "" : l;
|
|
7
7
|
}
|
|
8
|
-
function i(
|
|
8
|
+
function i(t, l, p) {
|
|
9
9
|
const o = l.trim().toUpperCase();
|
|
10
10
|
try {
|
|
11
11
|
return new Intl.NumberFormat(p, {
|
|
12
12
|
style: "currency",
|
|
13
13
|
currency: o
|
|
14
|
-
}).format(
|
|
14
|
+
}).format(t);
|
|
15
15
|
} catch {
|
|
16
|
-
return `${
|
|
16
|
+
return `${t.toFixed(2)} ${o}`;
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
function M({
|
|
20
|
-
saleDocument:
|
|
20
|
+
saleDocument: t,
|
|
21
21
|
items: l,
|
|
22
22
|
subtotal: p,
|
|
23
23
|
tax: o,
|
|
@@ -32,26 +32,26 @@ function M({
|
|
|
32
32
|
}) {
|
|
33
33
|
const { t: x } = T(), r = (a, d = {}) => B(x, s, a, d), m = (a, d = {}) => G(x, s, a, d), f = (a, d = {}) => {
|
|
34
34
|
const h = r(a, d), C = " / ", g = h.indexOf(C);
|
|
35
|
-
return g === -1 ? /* @__PURE__ */ e("span", { children: h }) : /* @__PURE__ */
|
|
35
|
+
return g === -1 ? /* @__PURE__ */ e("span", { children: h }) : /* @__PURE__ */ c("span", { className: "inline-flex flex-col text-left leading-snug", children: [
|
|
36
36
|
/* @__PURE__ */ e("span", { children: h.slice(0, g) }),
|
|
37
37
|
/* @__PURE__ */ e("span", { className: "text-[0.9em] font-normal", children: h.slice(g + C.length) })
|
|
38
38
|
] });
|
|
39
|
-
},
|
|
40
|
-
u ? "docs_contract_sale_credit_note_title" : "docs_contract_sale_invoice_title"
|
|
39
|
+
}, q = !N && !v && !w, k = I(t.issuer.address), j = I(t.recipient.address), L = t.recipient.email?.trim() ?? "", n = t.acceptance?.mode === "signature" ? t.acceptance : null, b = t.acceptance?.mode === "acceptance" ? t.acceptance : null, z = t.acceptanceLevel === "signature" || n !== null, u = t.kind === "credit_note", O = r(
|
|
40
|
+
u ? "docs_contract_sale_credit_note_title" : t.kind === "quote" ? "docs_contract_sale_quote_title" : "docs_contract_sale_invoice_title"
|
|
41
41
|
), S = r(
|
|
42
|
-
u ? "docs_contract_sale_credit_note_date_label" : "docs_contract_sale_invoice_date_label"
|
|
42
|
+
u ? "docs_contract_sale_credit_note_date_label" : t.kind === "quote" ? "docs_contract_sale_quote_date_label" : "docs_contract_sale_invoice_date_label"
|
|
43
43
|
), $ = r(
|
|
44
44
|
u ? "docs_contract_sale_credit_note_recipient_label" : "docs_contract_sale_invoice_recipient_label"
|
|
45
|
-
), A = u ? -1 : 1, F =
|
|
46
|
-
return /* @__PURE__ */
|
|
47
|
-
P && /* @__PURE__ */
|
|
48
|
-
/* @__PURE__ */
|
|
49
|
-
/* @__PURE__ */
|
|
50
|
-
/* @__PURE__ */
|
|
45
|
+
), A = u ? -1 : 1, F = t.taxRate != null ? 1 + t.taxRate : 1;
|
|
46
|
+
return /* @__PURE__ */ c("main", { className: "flex flex-grow flex-col px-4 md:px-8", children: [
|
|
47
|
+
P && /* @__PURE__ */ c("header", { className: "mb-8 grid gap-6", children: [
|
|
48
|
+
/* @__PURE__ */ c("div", { className: "grid gap-6 md:grid-cols-2 md:gap-8", children: [
|
|
49
|
+
/* @__PURE__ */ c("div", { children: [
|
|
50
|
+
/* @__PURE__ */ c("h1", { className: "flex flex-wrap items-baseline gap-x-2 gap-y-1 text-xl font-semibold text-foreground", children: [
|
|
51
51
|
/* @__PURE__ */ e("span", { children: O }),
|
|
52
|
-
/* @__PURE__ */
|
|
52
|
+
/* @__PURE__ */ c("span", { className: "font-normal text-muted-foreground", children: [
|
|
53
53
|
"#",
|
|
54
|
-
|
|
54
|
+
t.saleDocumentNumber
|
|
55
55
|
] })
|
|
56
56
|
] }),
|
|
57
57
|
y ? /* @__PURE__ */ e(
|
|
@@ -64,76 +64,76 @@ function M({
|
|
|
64
64
|
}
|
|
65
65
|
) : null
|
|
66
66
|
] }),
|
|
67
|
-
/* @__PURE__ */
|
|
68
|
-
/* @__PURE__ */
|
|
67
|
+
/* @__PURE__ */ c("div", { className: "md:text-right", children: [
|
|
68
|
+
/* @__PURE__ */ c("div", { className: "mb-2", children: [
|
|
69
69
|
/* @__PURE__ */ e("p", { className: "font-semibold text-foreground", children: S }),
|
|
70
|
-
/* @__PURE__ */ e("p", { className: "text-muted-foreground", children: _(
|
|
70
|
+
/* @__PURE__ */ e("p", { className: "text-muted-foreground", children: _(t.date) })
|
|
71
71
|
] }),
|
|
72
|
-
/* @__PURE__ */
|
|
72
|
+
/* @__PURE__ */ c("div", { children: [
|
|
73
73
|
/* @__PURE__ */ e("p", { className: "font-semibold text-foreground", children: r("docs_contract_sale_due_date_label") }),
|
|
74
|
-
/* @__PURE__ */ e("p", { className: "text-muted-foreground", children: _(
|
|
74
|
+
/* @__PURE__ */ e("p", { className: "text-muted-foreground", children: _(t.dueDate) })
|
|
75
75
|
] })
|
|
76
76
|
] })
|
|
77
77
|
] }),
|
|
78
|
-
/* @__PURE__ */
|
|
79
|
-
/* @__PURE__ */
|
|
80
|
-
/* @__PURE__ */ e("h2", { className: "text-xl font-semibold text-primary", children:
|
|
78
|
+
/* @__PURE__ */ c("div", { className: "grid gap-6 md:grid-cols-2 md:gap-8", children: [
|
|
79
|
+
/* @__PURE__ */ c("div", { children: [
|
|
80
|
+
/* @__PURE__ */ e("h2", { className: "text-xl font-semibold text-primary", children: t.issuer.name }),
|
|
81
81
|
k ? /* @__PURE__ */ e("p", { className: "text-muted-foreground whitespace-pre-line", children: k }) : null
|
|
82
82
|
] }),
|
|
83
|
-
/* @__PURE__ */
|
|
83
|
+
/* @__PURE__ */ c("div", { className: "md:text-right", children: [
|
|
84
84
|
/* @__PURE__ */ e("h3", { className: "mb-2 font-semibold text-foreground", children: $ }),
|
|
85
|
-
/* @__PURE__ */ e("p", { className: "font-bold text-foreground", children:
|
|
86
|
-
|
|
85
|
+
/* @__PURE__ */ e("p", { className: "font-bold text-foreground", children: t.recipient.name }),
|
|
86
|
+
j ? /* @__PURE__ */ e("p", { className: "text-muted-foreground whitespace-pre-line", children: j }) : null,
|
|
87
87
|
L ? /* @__PURE__ */ e("p", { className: "text-muted-foreground", children: L }) : null
|
|
88
88
|
] })
|
|
89
89
|
] })
|
|
90
90
|
] }),
|
|
91
|
-
/* @__PURE__ */
|
|
92
|
-
/* @__PURE__ */
|
|
91
|
+
/* @__PURE__ */ c("section", { className: q ? "mb-0 flex flex-grow flex-col" : "mb-8", children: [
|
|
92
|
+
/* @__PURE__ */ c("div", { className: "flex bg-muted p-2 text-xs font-semibold text-muted-foreground md:p-3 md:text-base", children: [
|
|
93
93
|
/* @__PURE__ */ e("div", { className: "w-5/12 pr-2 md:w-1/2", children: /* @__PURE__ */ e("span", { children: m("docs_contract_sale_description_label") }) }),
|
|
94
94
|
/* @__PURE__ */ e("div", { className: "w-1/6 text-center", children: /* @__PURE__ */ e("span", { children: m("docs_contract_sale_quantity_label") }) }),
|
|
95
95
|
/* @__PURE__ */ e("div", { className: "w-3/12 text-right md:w-1/6", children: /* @__PURE__ */ e("span", { children: m("docs_contract_sale_unit_price_label") }) }),
|
|
96
96
|
/* @__PURE__ */ e("div", { className: "w-1/6 text-right", children: /* @__PURE__ */ e("span", { children: m("docs_contract_sale_line_total_label") }) })
|
|
97
97
|
] }),
|
|
98
|
-
/* @__PURE__ */ e("div", { className:
|
|
98
|
+
/* @__PURE__ */ e("div", { className: q ? "flex flex-1 flex-col" : "flex flex-col", children: l.map((a) => /* @__PURE__ */ c("div", { className: "flex items-center border-b border-border p-2 text-sm md:p-3 md:text-base", children: [
|
|
99
99
|
/* @__PURE__ */ e("div", { className: "w-5/12 pr-2 md:w-1/2", children: /* @__PURE__ */ e("span", { children: a.description }) }),
|
|
100
100
|
/* @__PURE__ */ e("div", { className: "w-1/6 text-center", children: /* @__PURE__ */ e("span", { children: a.quantity }) }),
|
|
101
|
-
/* @__PURE__ */ e("div", { className: "w-3/12 text-right md:w-1/6", children: /* @__PURE__ */ e("span", { children: i(a.unitPrice / F * A,
|
|
102
|
-
/* @__PURE__ */ e("div", { className: "w-1/6 text-right", children: /* @__PURE__ */ e("span", { children: i(a.quantity * a.unitPrice / F * A,
|
|
101
|
+
/* @__PURE__ */ e("div", { className: "w-3/12 text-right md:w-1/6", children: /* @__PURE__ */ e("span", { children: i(a.unitPrice / F * A, t.currency, s.customer) }) }),
|
|
102
|
+
/* @__PURE__ */ e("div", { className: "w-1/6 text-right", children: /* @__PURE__ */ e("span", { children: i(a.quantity * a.unitPrice / F * A, t.currency, s.customer) }) })
|
|
103
103
|
] }, a.id)) })
|
|
104
104
|
] }),
|
|
105
|
-
N && /* @__PURE__ */ e("section", { className: "mb-16 flex justify-end", children: /* @__PURE__ */
|
|
106
|
-
/* @__PURE__ */
|
|
105
|
+
N && /* @__PURE__ */ e("section", { className: "mb-16 flex justify-end", children: /* @__PURE__ */ c("div", { className: "w-full md:w-1/3", children: [
|
|
106
|
+
/* @__PURE__ */ c("div", { className: "mb-2 flex items-start justify-between gap-4", children: [
|
|
107
107
|
/* @__PURE__ */ e("span", { className: "text-muted-foreground", children: f("docs_contract_sale_subtotal_label") }),
|
|
108
|
-
/* @__PURE__ */ e("span", { className: "shrink-0 text-right font-semibold", children: i(p,
|
|
108
|
+
/* @__PURE__ */ e("span", { className: "shrink-0 text-right font-semibold", children: i(p, t.currency, s.customer) })
|
|
109
109
|
] }),
|
|
110
|
-
|
|
111
|
-
/* @__PURE__ */ e("span", { className: "text-muted-foreground", children: f("docs_contract_sale_tax_label", { rate: (
|
|
112
|
-
/* @__PURE__ */ e("span", { className: "shrink-0 text-right font-semibold", children: i(o,
|
|
110
|
+
t.taxRate != null && /* @__PURE__ */ c("div", { className: "mb-2 flex items-start justify-between gap-4", children: [
|
|
111
|
+
/* @__PURE__ */ e("span", { className: "text-muted-foreground", children: f("docs_contract_sale_tax_label", { rate: (t.taxRate * 100).toFixed(0) }) }),
|
|
112
|
+
/* @__PURE__ */ e("span", { className: "shrink-0 text-right font-semibold", children: i(o, t.currency, s.customer) })
|
|
113
113
|
] }),
|
|
114
|
-
/* @__PURE__ */
|
|
114
|
+
/* @__PURE__ */ c("div", { className: "mt-2 flex items-start justify-between gap-4 border-t border-border pt-2", children: [
|
|
115
115
|
/* @__PURE__ */ e("span", { className: "text-xl font-bold", children: f("docs_contract_sale_total_label") }),
|
|
116
|
-
/* @__PURE__ */ e("span", { className: "shrink-0 text-right text-xl font-bold", children: i(R,
|
|
116
|
+
/* @__PURE__ */ e("span", { className: "shrink-0 text-right text-xl font-bold", children: i(R, t.currency, s.customer) })
|
|
117
117
|
] })
|
|
118
118
|
] }) }),
|
|
119
|
-
v &&
|
|
119
|
+
v && t.notes && /* @__PURE__ */ c("section", { className: "mb-16", children: [
|
|
120
120
|
/* @__PURE__ */ e("h3", { className: "mb-4 border-b border-border pb-2 font-semibold text-foreground", children: r("docs_contract_sale_notes_title") }),
|
|
121
|
-
/* @__PURE__ */ e("div", { className: "gap-8 text-sm text-muted-foreground md:columns-2", children: /* @__PURE__ */ e("p", { children:
|
|
121
|
+
/* @__PURE__ */ e("div", { className: "gap-8 text-sm text-muted-foreground md:columns-2", children: /* @__PURE__ */ e("p", { children: t.notes }) })
|
|
122
122
|
] }),
|
|
123
|
-
w && (
|
|
123
|
+
w && (t.acceptanceLevel !== "none" || t.acceptance) ? /* @__PURE__ */ e("section", { className: "mt-auto border-t border-border pt-8", children: z ? /* @__PURE__ */ c(E, { children: [
|
|
124
124
|
/* @__PURE__ */ e("p", { className: "mb-12 text-center text-sm text-muted-foreground", children: /* @__PURE__ */ e("span", { children: r("docs_contract_sale_signature_acknowledgement") }) }),
|
|
125
|
-
n ? /* @__PURE__ */
|
|
126
|
-
/* @__PURE__ */
|
|
125
|
+
n ? /* @__PURE__ */ c("div", { className: "flex flex-col justify-between md:flex-row", children: [
|
|
126
|
+
/* @__PURE__ */ c("div", { className: "mb-8 w-full md:mb-0 md:w-2/5", children: [
|
|
127
127
|
/* @__PURE__ */ e("p", { className: "font-semibold text-foreground", children: r("docs_contract_sale_signature_issuer_label") }),
|
|
128
|
-
/* @__PURE__ */ e("p", { className: "mb-2 mt-2 text-sm text-muted-foreground", children: /* @__PURE__ */
|
|
128
|
+
/* @__PURE__ */ e("p", { className: "mb-2 mt-2 text-sm text-muted-foreground", children: /* @__PURE__ */ c("span", { children: [
|
|
129
129
|
r("docs_contract_sale_signature_date_label"),
|
|
130
130
|
": ___________________"
|
|
131
131
|
] }) }),
|
|
132
132
|
/* @__PURE__ */ e("div", { className: "h-24 rounded-lg bg-muted/40" })
|
|
133
133
|
] }),
|
|
134
|
-
/* @__PURE__ */
|
|
134
|
+
/* @__PURE__ */ c("div", { className: "w-full text-left md:w-2/5", children: [
|
|
135
135
|
/* @__PURE__ */ e("p", { className: "font-semibold text-foreground", children: r("docs_contract_sale_signature_customer_label") }),
|
|
136
|
-
/* @__PURE__ */ e("p", { className: "mb-2 mt-2 text-sm text-muted-foreground", children: /* @__PURE__ */
|
|
136
|
+
/* @__PURE__ */ e("p", { className: "mb-2 mt-2 text-sm text-muted-foreground", children: /* @__PURE__ */ c("span", { children: [
|
|
137
137
|
r("docs_contract_sale_signature_date_label"),
|
|
138
138
|
": ",
|
|
139
139
|
_(n.date)
|
|
@@ -149,25 +149,25 @@ function M({
|
|
|
149
149
|
/* @__PURE__ */ e("p", { className: "mt-2 text-sm text-foreground", children: n.name }),
|
|
150
150
|
/* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: n.phone })
|
|
151
151
|
] })
|
|
152
|
-
] }) : /* @__PURE__ */
|
|
153
|
-
/* @__PURE__ */
|
|
152
|
+
] }) : /* @__PURE__ */ c("div", { className: "flex flex-col justify-between md:flex-row", children: [
|
|
153
|
+
/* @__PURE__ */ c("div", { className: "mb-8 w-full md:mb-0 md:w-2/5", children: [
|
|
154
154
|
/* @__PURE__ */ e("p", { className: "font-semibold text-foreground", children: r("docs_contract_sale_signature_issuer_label") }),
|
|
155
|
-
/* @__PURE__ */ e("p", { className: "mb-2 mt-2 text-sm text-muted-foreground", children: /* @__PURE__ */
|
|
155
|
+
/* @__PURE__ */ e("p", { className: "mb-2 mt-2 text-sm text-muted-foreground", children: /* @__PURE__ */ c("span", { children: [
|
|
156
156
|
r("docs_contract_sale_signature_date_label"),
|
|
157
157
|
": ___________________"
|
|
158
158
|
] }) }),
|
|
159
159
|
/* @__PURE__ */ e("div", { className: "h-24 rounded-lg bg-muted/40" })
|
|
160
160
|
] }),
|
|
161
|
-
/* @__PURE__ */
|
|
161
|
+
/* @__PURE__ */ c("div", { className: "w-full md:w-2/5", children: [
|
|
162
162
|
/* @__PURE__ */ e("p", { className: "font-semibold text-foreground", children: r("docs_contract_sale_signature_customer_label") }),
|
|
163
|
-
/* @__PURE__ */ e("p", { className: "mb-2 mt-2 text-sm text-muted-foreground", children: /* @__PURE__ */
|
|
163
|
+
/* @__PURE__ */ e("p", { className: "mb-2 mt-2 text-sm text-muted-foreground", children: /* @__PURE__ */ c("span", { children: [
|
|
164
164
|
r("docs_contract_sale_signature_date_label"),
|
|
165
165
|
": ___________________"
|
|
166
166
|
] }) }),
|
|
167
167
|
/* @__PURE__ */ e("div", { className: "h-24 rounded-lg bg-muted/40" })
|
|
168
168
|
] })
|
|
169
169
|
] })
|
|
170
|
-
] }) : /* @__PURE__ */
|
|
170
|
+
] }) : /* @__PURE__ */ c("div", { className: "rounded-lg border border-border bg-muted/30 p-4", children: [
|
|
171
171
|
/* @__PURE__ */ e("p", { className: "text-sm font-medium text-foreground", children: r(b ? "docs_contract_sale_acceptance_section_accepted_title" : "docs_contract_sale_acceptance_section_required_title") }),
|
|
172
172
|
/* @__PURE__ */ e("p", { className: "mt-1 text-sm text-muted-foreground", children: b ? r("docs_contract_sale_acceptance_section_accepted_date", {
|
|
173
173
|
date: _(b.date)
|
|
@@ -5,9 +5,9 @@ import { cn as v } from "@rpcbase/ui";
|
|
|
5
5
|
import { CheckCircle2 as w, Info as d } from "lucide-react";
|
|
6
6
|
import { useTranslation as T } from "react-i18next";
|
|
7
7
|
import { Button as D } from "../../ui/button.js";
|
|
8
|
-
const C = 0.95, m = (a) => a.tiers.length === 0 ? [] : [...a.tiers].sort((
|
|
8
|
+
const C = 0.95, m = (a) => a.tiers.length === 0 ? [] : [...a.tiers].sort((s, t) => s.upToHours - t.upToHours), H = (a) => m(a).find((t) => t.refundPercentage >= C) ?? null, R = (a, s) => {
|
|
9
9
|
try {
|
|
10
|
-
return new Intl.NumberFormat(
|
|
10
|
+
return new Intl.NumberFormat(s, {
|
|
11
11
|
style: "percent",
|
|
12
12
|
maximumFractionDigits: 2
|
|
13
13
|
}).format(a);
|
|
@@ -17,17 +17,17 @@ const C = 0.95, m = (a) => a.tiers.length === 0 ? [] : [...a.tiers].sort((l, t)
|
|
|
17
17
|
};
|
|
18
18
|
function O({
|
|
19
19
|
policy: a,
|
|
20
|
-
className:
|
|
20
|
+
className: s
|
|
21
21
|
}) {
|
|
22
22
|
const { t, i18n: p } = T(), [u, r] = f(!1), h = m(a), o = H(a);
|
|
23
23
|
if (!o)
|
|
24
24
|
return null;
|
|
25
|
-
const c = (
|
|
26
|
-
const i = Math.max(1, Math.round(
|
|
25
|
+
const c = (l) => {
|
|
26
|
+
const i = Math.max(1, Math.round(l));
|
|
27
27
|
return i >= 72 && i % 24 === 0 ? t("cancellation_policy_duration_days", { count: i / 24 }) : t("cancellation_policy_duration_hours", { count: i });
|
|
28
28
|
};
|
|
29
|
-
return /* @__PURE__ */ n("li", { className: v("flex items-start gap-3",
|
|
30
|
-
/* @__PURE__ */ e(w, { className: "mt-0.5 h-5 w-5 shrink-0 text-
|
|
29
|
+
return /* @__PURE__ */ n("li", { className: v("flex items-start gap-3", s), "data-testid": "storefront-cancellation-policy-notice", children: [
|
|
30
|
+
/* @__PURE__ */ e(w, { className: "mt-0.5 h-5 w-5 shrink-0 text-success", "aria-hidden": "true" }),
|
|
31
31
|
/* @__PURE__ */ n("div", { className: "min-w-0 flex-1", children: [
|
|
32
32
|
/* @__PURE__ */ n("div", { className: "flex min-w-0 items-start gap-1.5", children: [
|
|
33
33
|
/* @__PURE__ */ e("p", { className: "min-w-0 text-sm font-medium text-slate-950", children: /* @__PURE__ */ e("span", { children: t("cancellation_policy_teaser", { duration: c(o.upToHours) }) }) }),
|
|
@@ -59,18 +59,18 @@ function O({
|
|
|
59
59
|
/* @__PURE__ */ e(b, { className: "text-left text-sm text-slate-600", children: /* @__PURE__ */ e("span", { children: t("cancellation_policy_modal_description") }) })
|
|
60
60
|
] })
|
|
61
61
|
] }) }),
|
|
62
|
-
/* @__PURE__ */ e("div", { className: "overflow-y-auto px-5 py-5 sm:px-6", children: /* @__PURE__ */ e("dl", { className: "grid gap-3", children: h.map((
|
|
62
|
+
/* @__PURE__ */ e("div", { className: "overflow-y-auto px-5 py-5 sm:px-6", children: /* @__PURE__ */ e("dl", { className: "grid gap-3", children: h.map((l) => /* @__PURE__ */ n(
|
|
63
63
|
"div",
|
|
64
64
|
{
|
|
65
65
|
className: "rounded-lg border border-slate-200 bg-slate-50 px-4 py-3",
|
|
66
66
|
children: [
|
|
67
|
-
/* @__PURE__ */ e("dt", { className: "text-sm font-medium text-slate-950", children: /* @__PURE__ */ e("span", { children: t("cancellation_policy_modal_tier_deadline", { duration: c(
|
|
67
|
+
/* @__PURE__ */ e("dt", { className: "text-sm font-medium text-slate-950", children: /* @__PURE__ */ e("span", { children: t("cancellation_policy_modal_tier_deadline", { duration: c(l.upToHours) }) }) }),
|
|
68
68
|
/* @__PURE__ */ e("dd", { className: "mt-1 text-sm text-slate-600", children: /* @__PURE__ */ e("span", { children: t("cancellation_policy_modal_tier_refund", {
|
|
69
|
-
percentage: R(
|
|
69
|
+
percentage: R(l.refundPercentage, p.language)
|
|
70
70
|
}) }) })
|
|
71
71
|
]
|
|
72
72
|
},
|
|
73
|
-
`${
|
|
73
|
+
`${l.upToHours}-${l.refundPercentage}`
|
|
74
74
|
)) }) }),
|
|
75
75
|
/* @__PURE__ */ e(y, { className: "border-t border-slate-200 px-5 py-4 sm:px-6", children: /* @__PURE__ */ e(
|
|
76
76
|
D,
|