@loczer/storefront-sdk 0.176.0 → 0.178.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.js +1 -1
- 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/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.map +1 -1
- package/dist/pages/ContractSaleDocumentPage.js +25 -24
- package/dist/pages/HomePage.d.ts.map +1 -1
- package/dist/pages/HomePage.js +37 -37
- 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,69 +1,70 @@
|
|
|
1
|
-
import { jsxs as a, jsx as
|
|
2
|
-
import
|
|
1
|
+
import { jsxs as a, jsx as t, Fragment as te } from "react/jsx-runtime";
|
|
2
|
+
import o from "react";
|
|
3
3
|
import { Star as I } from "lucide-react";
|
|
4
4
|
import { useTranslation as z } from "react-i18next";
|
|
5
5
|
import { ROUTE as re, responseSchema as ne } from "../../lib/storefrontReviews.js";
|
|
6
|
+
import { getNameInitials as F, formatInitialsWithPeriods as se } from "../../lib/nameInitials.js";
|
|
6
7
|
import { cn as U } from "@rpcbase/ui";
|
|
7
|
-
import { useStorefront as
|
|
8
|
-
function
|
|
9
|
-
return /* @__PURE__ */
|
|
8
|
+
import { useStorefront as ae } from "../../StorefrontProvider.js";
|
|
9
|
+
function ie({ rating: e }) {
|
|
10
|
+
return /* @__PURE__ */ t("div", { className: "flex mb-2", children: [...Array(5)].map((r, s) => /* @__PURE__ */ t(
|
|
10
11
|
I,
|
|
11
12
|
{
|
|
12
13
|
className: U(
|
|
13
14
|
"w-4 h-4",
|
|
14
|
-
|
|
15
|
+
s < e ? "text-yellow-400 fill-yellow-400" : "text-slate-300"
|
|
15
16
|
)
|
|
16
17
|
},
|
|
17
|
-
|
|
18
|
+
s
|
|
18
19
|
)) });
|
|
19
20
|
}
|
|
20
|
-
const p = ({ className: e }) => /* @__PURE__ */
|
|
21
|
+
const p = ({ className: e }) => /* @__PURE__ */ t("div", { "aria-hidden": !0, className: U("animate-pulse rounded bg-slate-200", e) }), oe = () => /* @__PURE__ */ a(
|
|
21
22
|
"div",
|
|
22
23
|
{
|
|
23
24
|
"aria-hidden": !0,
|
|
24
25
|
className: "bg-white p-4 rounded-xl border border-slate-200 shadow-sm w-[320px] flex-shrink-0",
|
|
25
26
|
children: [
|
|
26
27
|
/* @__PURE__ */ a("div", { className: "flex items-center gap-3 mb-2", children: [
|
|
27
|
-
/* @__PURE__ */
|
|
28
|
+
/* @__PURE__ */ t("div", { className: "h-10 w-10 rounded-full bg-slate-200 animate-pulse" }),
|
|
28
29
|
/* @__PURE__ */ a("div", { className: "flex-1 space-y-2", children: [
|
|
29
|
-
/* @__PURE__ */
|
|
30
|
-
/* @__PURE__ */
|
|
30
|
+
/* @__PURE__ */ t(p, { className: "h-4 w-24" }),
|
|
31
|
+
/* @__PURE__ */ t(p, { className: "h-3 w-20" })
|
|
31
32
|
] })
|
|
32
33
|
] }),
|
|
33
|
-
/* @__PURE__ */
|
|
34
|
+
/* @__PURE__ */ t("div", { className: "mb-3 flex gap-1", children: Array.from({ length: 5 }).map((e, r) => /* @__PURE__ */ t("div", { className: "h-4 w-4 rounded bg-slate-200 animate-pulse" }, r)) }),
|
|
34
35
|
/* @__PURE__ */ a("div", { className: "space-y-2", children: [
|
|
35
|
-
/* @__PURE__ */
|
|
36
|
-
/* @__PURE__ */
|
|
37
|
-
/* @__PURE__ */
|
|
36
|
+
/* @__PURE__ */ t(p, { className: "h-3 w-full" }),
|
|
37
|
+
/* @__PURE__ */ t(p, { className: "h-3 w-full" }),
|
|
38
|
+
/* @__PURE__ */ t(p, { className: "h-3 w-5/6" })
|
|
38
39
|
] }),
|
|
39
|
-
/* @__PURE__ */
|
|
40
|
+
/* @__PURE__ */ t(p, { className: "mt-4 h-3 w-16" })
|
|
40
41
|
]
|
|
41
42
|
}
|
|
42
43
|
);
|
|
43
|
-
function
|
|
44
|
+
function H({
|
|
44
45
|
review: e,
|
|
45
|
-
enableExpand:
|
|
46
|
-
defaultOriginalUrl:
|
|
46
|
+
enableExpand: r = !0,
|
|
47
|
+
defaultOriginalUrl: s
|
|
47
48
|
}) {
|
|
48
|
-
const { t:
|
|
49
|
-
return
|
|
50
|
-
if (!
|
|
49
|
+
const { t: i } = z(), l = F(e.name), R = se(l), d = e.source === "tripadvisor" ? i("testimonials.tripadvisor_review") : e.source === "google" ? i("testimonials.google_review") : void 0, [u, T] = o.useState(!1), [b, L] = o.useState(!1), k = o.useRef(null), y = r && u ? 6 : 4, g = e.originalUrl || s, N = X(g), v = r && b, w = typeof N == "string" && N.length > 0;
|
|
50
|
+
return o.useEffect(() => {
|
|
51
|
+
if (!r) return;
|
|
51
52
|
const m = k.current;
|
|
52
53
|
if (!m) return;
|
|
53
54
|
const S = () => {
|
|
54
|
-
const
|
|
55
|
-
L(
|
|
55
|
+
const P = m.scrollHeight > m.clientHeight + 1, C = (e.text || "").trim().length > 240;
|
|
56
|
+
L(P || C);
|
|
56
57
|
};
|
|
57
58
|
return S(), window.addEventListener("resize", S), () => window.removeEventListener("resize", S);
|
|
58
|
-
}, [
|
|
59
|
+
}, [r, e.text]), /* @__PURE__ */ a("div", { className: "bg-white p-4 rounded-xl border border-slate-200 shadow-sm hover:shadow-md transition-shadow duration-300 w-[320px] flex-shrink-0", children: [
|
|
59
60
|
/* @__PURE__ */ a("div", { className: "flex items-center gap-3 mb-2", children: [
|
|
60
|
-
/* @__PURE__ */
|
|
61
|
+
/* @__PURE__ */ t(pe, { name: e.name, size: 40, colorSeed: e.colorSeed }),
|
|
61
62
|
/* @__PURE__ */ a("div", { children: [
|
|
62
|
-
/* @__PURE__ */
|
|
63
|
-
d && /* @__PURE__ */
|
|
63
|
+
/* @__PURE__ */ t("div", { className: "font-semibold leading-tight", children: R }),
|
|
64
|
+
d && /* @__PURE__ */ t("div", { className: "text-xs text-slate-500", children: d })
|
|
64
65
|
] })
|
|
65
66
|
] }),
|
|
66
|
-
/* @__PURE__ */
|
|
67
|
+
/* @__PURE__ */ t(ie, { rating: e.rating }),
|
|
67
68
|
/* @__PURE__ */ a("div", { className: "relative", children: [
|
|
68
69
|
/* @__PURE__ */ a(
|
|
69
70
|
"p",
|
|
@@ -77,13 +78,13 @@ function j({
|
|
|
77
78
|
overflow: "hidden"
|
|
78
79
|
},
|
|
79
80
|
children: [
|
|
80
|
-
/* @__PURE__ */
|
|
81
|
-
/* @__PURE__ */
|
|
82
|
-
/* @__PURE__ */
|
|
81
|
+
/* @__PURE__ */ t("span", { "aria-hidden": !0, children: "“" }),
|
|
82
|
+
/* @__PURE__ */ t("span", { children: e.text }),
|
|
83
|
+
/* @__PURE__ */ t("span", { "aria-hidden": !0, children: "”" })
|
|
83
84
|
]
|
|
84
85
|
}
|
|
85
86
|
),
|
|
86
|
-
!u && v && /* @__PURE__ */
|
|
87
|
+
!u && v && /* @__PURE__ */ t(
|
|
87
88
|
"div",
|
|
88
89
|
{
|
|
89
90
|
"aria-hidden": !0,
|
|
@@ -99,23 +100,23 @@ function j({
|
|
|
99
100
|
v && w ? "justify-between" : w ? "justify-end" : "justify-start"
|
|
100
101
|
),
|
|
101
102
|
children: [
|
|
102
|
-
v && /* @__PURE__ */
|
|
103
|
+
v && /* @__PURE__ */ t(
|
|
103
104
|
"button",
|
|
104
105
|
{
|
|
105
106
|
type: "button",
|
|
106
107
|
onClick: () => T((m) => !m),
|
|
107
108
|
className: "text-primary hover:underline text-xs cursor-pointer",
|
|
108
|
-
children:
|
|
109
|
+
children: i(u ? "testimonials.see_less" : "testimonials.see_more")
|
|
109
110
|
}
|
|
110
111
|
),
|
|
111
|
-
w && /* @__PURE__ */
|
|
112
|
+
w && /* @__PURE__ */ t(
|
|
112
113
|
"a",
|
|
113
114
|
{
|
|
114
115
|
className: "text-slate-500 hover:text-slate-600 hover:underline text-xs whitespace-nowrap cursor-pointer",
|
|
115
116
|
href: N,
|
|
116
117
|
target: "_blank",
|
|
117
118
|
rel: "noreferrer noopener",
|
|
118
|
-
children:
|
|
119
|
+
children: i("testimonials.view_original")
|
|
119
120
|
}
|
|
120
121
|
)
|
|
121
122
|
]
|
|
@@ -123,60 +124,60 @@ function j({
|
|
|
123
124
|
)
|
|
124
125
|
] });
|
|
125
126
|
}
|
|
126
|
-
const
|
|
127
|
-
const { t: e } = z(), { storeSlug:
|
|
128
|
-
|
|
129
|
-
let
|
|
127
|
+
const ke = () => {
|
|
128
|
+
const { t: e } = z(), { storeSlug: r, storefrontConfiguration: s } = ae(), i = s.modules?.reviews, l = i ? i.enabled && i.showRecentReviewsOnStorefront : !0, R = 180, d = o.useRef(null), u = o.useRef(!1), [T, b] = o.useState(!1), L = o.useRef(0), k = o.useRef(0), y = 64, [g, N] = o.useState([]), [v, w] = o.useState({}), [m, S] = o.useState(!1);
|
|
129
|
+
o.useEffect(() => {
|
|
130
|
+
let n = !1;
|
|
130
131
|
if (!l)
|
|
131
132
|
return N([]), w({}), S(!0), () => {
|
|
132
|
-
|
|
133
|
+
n = !0;
|
|
133
134
|
};
|
|
134
135
|
async function h() {
|
|
135
136
|
try {
|
|
136
|
-
if (!
|
|
137
|
+
if (!r) return;
|
|
137
138
|
const E = new URLSearchParams({
|
|
138
|
-
storeSlug:
|
|
139
|
+
storeSlug: r,
|
|
139
140
|
limit: "40"
|
|
140
141
|
}), B = await (await fetch(`${re}?${E.toString()}`)).json().catch(() => null);
|
|
141
|
-
if (
|
|
142
|
+
if (n) return;
|
|
142
143
|
const q = ne.safeParse(B);
|
|
143
144
|
if (!q.success || !q.data.success)
|
|
144
145
|
return;
|
|
145
|
-
const _ = q.data,
|
|
146
|
+
const _ = q.data, M = Array.isArray(_?.providers) ? _.providers : [], x = M.find((c) => c?.source === "google"), J = M[0], O = typeof x?.providerUrl == "string" ? x.providerUrl : s.shop.googleMapsLink || s.shop.googleRequestReviewsLink, j = Array.isArray(_?.reviews) ? _.reviews.map((c, ee) => ({
|
|
146
147
|
id: ee + 1,
|
|
147
148
|
name: c.authorMasked || e("testimonials.google_user"),
|
|
148
149
|
source: c.source,
|
|
149
150
|
text: c.comment || "",
|
|
150
151
|
rating: c.rating || 5,
|
|
151
152
|
colorSeed: typeof c.avatarSeed == "number" ? c.avatarSeed : void 0,
|
|
152
|
-
originalUrl: typeof c.providerUrl == "string" ? c.providerUrl :
|
|
153
|
-
})) : [], K =
|
|
153
|
+
originalUrl: typeof c.providerUrl == "string" ? c.providerUrl : O
|
|
154
|
+
})) : [], K = j.length > 0 ? j : [], Q = W(String(x?.fetchedAt || J?.fetchedAt || _?.reviews?.[0]?.createdAt || "mock")), Y = ce([...K], Q), Z = {
|
|
154
155
|
rating: typeof x?.rating == "number" ? x.rating : void 0,
|
|
155
156
|
total: typeof x?.totalReviewsCount == "number" ? x.totalReviewsCount : void 0,
|
|
156
|
-
url:
|
|
157
|
+
url: O
|
|
157
158
|
};
|
|
158
|
-
if (
|
|
159
|
+
if (n) return;
|
|
159
160
|
N(Y), w(Z);
|
|
160
161
|
} catch {
|
|
161
|
-
if (
|
|
162
|
+
if (n) return;
|
|
162
163
|
} finally {
|
|
163
|
-
|
|
164
|
+
n || S(!0);
|
|
164
165
|
}
|
|
165
166
|
}
|
|
166
167
|
return h(), () => {
|
|
167
|
-
|
|
168
|
+
n = !0;
|
|
168
169
|
};
|
|
169
|
-
}, [l,
|
|
170
|
+
}, [l, r, s.shop.googleMapsLink, s.shop.googleRequestReviewsLink]), o.useEffect(() => {
|
|
170
171
|
if (!m || g.length === 0) return;
|
|
171
|
-
const
|
|
172
|
-
|
|
172
|
+
const n = d.current;
|
|
173
|
+
n && n.scrollLeft === 0 && (n.scrollLeft = y);
|
|
173
174
|
}, [m, g.length, y]);
|
|
174
|
-
const
|
|
175
|
+
const P = v.rating, C = v.total, G = v.url, A = X(G);
|
|
175
176
|
if (!l)
|
|
176
177
|
return null;
|
|
177
|
-
const f = !m,
|
|
178
|
-
return !f && !
|
|
179
|
-
/* @__PURE__ */
|
|
178
|
+
const f = !m, V = g.length > 0;
|
|
179
|
+
return !f && !V ? null : /* @__PURE__ */ a("section", { id: "testimonials", className: "border-t border-slate-200 bg-slate-50/60", translate: "no", children: [
|
|
180
|
+
/* @__PURE__ */ t("style", { children: `
|
|
180
181
|
@keyframes testimonials-marquee { 0% { transform: translateX(0); } 100% { transform: translateX(-50%); } }
|
|
181
182
|
.t-marquee { animation: testimonials-marquee var(--t-marquee-duration, 40s) linear infinite; }
|
|
182
183
|
.t-marquee:hover { animation-play-state: paused; }
|
|
@@ -189,43 +190,43 @@ const Re = () => {
|
|
|
189
190
|
` }),
|
|
190
191
|
/* @__PURE__ */ a("div", { className: "mx-auto max-w-7xl px-4 py-10 sm:px-6", children: [
|
|
191
192
|
/* @__PURE__ */ a("div", { className: "text-center mb-8", children: [
|
|
192
|
-
/* @__PURE__ */
|
|
193
|
+
/* @__PURE__ */ t("h2", { className: "text-xl font-semibold tracking-tight text-slate-950", children: e("testimonials.title") }),
|
|
193
194
|
/* @__PURE__ */ a("div", { className: "mt-3 flex items-center justify-center gap-3 text-sm text-slate-700", children: [
|
|
194
195
|
/* @__PURE__ */ a("div", { className: "inline-flex items-center gap-1", children: [
|
|
195
|
-
/* @__PURE__ */
|
|
196
|
-
f ? /* @__PURE__ */
|
|
197
|
-
/* @__PURE__ */
|
|
198
|
-
/* @__PURE__ */
|
|
196
|
+
/* @__PURE__ */ t(I, { className: "w-5 h-5 text-yellow-400 fill-yellow-400" }),
|
|
197
|
+
f ? /* @__PURE__ */ t(p, { className: "inline-block h-5 w-12" }) : /* @__PURE__ */ a("span", { className: "font-medium", children: [
|
|
198
|
+
/* @__PURE__ */ t("span", { children: P?.toFixed(1) ?? "5.0" }),
|
|
199
|
+
/* @__PURE__ */ t("span", { children: "/5" })
|
|
199
200
|
] })
|
|
200
201
|
] }),
|
|
201
|
-
/* @__PURE__ */
|
|
202
|
-
f ? /* @__PURE__ */
|
|
203
|
-
|
|
202
|
+
/* @__PURE__ */ t("span", { "aria-hidden": !0, children: "•" }),
|
|
203
|
+
f ? /* @__PURE__ */ t(p, { className: "inline-block h-4 w-32" }) : /* @__PURE__ */ a("span", { children: [
|
|
204
|
+
C ?? g.length,
|
|
204
205
|
" ",
|
|
205
206
|
e("testimonials.reviews_label")
|
|
206
207
|
] }),
|
|
207
208
|
(f || A) && /* @__PURE__ */ a(te, { children: [
|
|
208
|
-
/* @__PURE__ */
|
|
209
|
-
f ? /* @__PURE__ */
|
|
209
|
+
/* @__PURE__ */ t("span", { "aria-hidden": !0, children: "•" }),
|
|
210
|
+
f ? /* @__PURE__ */ t(p, { className: "inline-block h-4 w-40" }) : A ? /* @__PURE__ */ t("a", { className: "text-primary hover:underline cursor-pointer", href: A, target: "_blank", rel: "noreferrer noopener", children: e("testimonials.view_on_google") }) : null
|
|
210
211
|
] })
|
|
211
212
|
] })
|
|
212
213
|
] }),
|
|
213
214
|
/* @__PURE__ */ a("div", { className: "relative", children: [
|
|
214
|
-
/* @__PURE__ */
|
|
215
|
+
/* @__PURE__ */ t(
|
|
215
216
|
"div",
|
|
216
217
|
{
|
|
217
218
|
className: "pointer-events-none absolute inset-y-0 left-0 bg-gradient-to-r from-slate-50 to-transparent z-10",
|
|
218
219
|
style: { width: y }
|
|
219
220
|
}
|
|
220
221
|
),
|
|
221
|
-
/* @__PURE__ */
|
|
222
|
+
/* @__PURE__ */ t(
|
|
222
223
|
"div",
|
|
223
224
|
{
|
|
224
225
|
className: "pointer-events-none absolute inset-y-0 right-0 bg-gradient-to-l from-slate-50 to-transparent z-10",
|
|
225
226
|
style: { width: y }
|
|
226
227
|
}
|
|
227
228
|
),
|
|
228
|
-
/* @__PURE__ */
|
|
229
|
+
/* @__PURE__ */ t(
|
|
229
230
|
"div",
|
|
230
231
|
{
|
|
231
232
|
ref: d,
|
|
@@ -234,22 +235,22 @@ const Re = () => {
|
|
|
234
235
|
f ? "cursor-default" : T ? "cursor-grabbing" : "cursor-grab"
|
|
235
236
|
),
|
|
236
237
|
style: { WebkitOverflowScrolling: "touch", touchAction: "pan-x" },
|
|
237
|
-
onPointerDown: (
|
|
238
|
+
onPointerDown: (n) => {
|
|
238
239
|
if (f) return;
|
|
239
240
|
const h = d.current;
|
|
240
241
|
if (h) {
|
|
241
|
-
u.current = !0, b(!0), L.current =
|
|
242
|
+
u.current = !0, b(!0), L.current = n.clientX, k.current = h.scrollLeft;
|
|
242
243
|
try {
|
|
243
|
-
|
|
244
|
+
n.target?.setPointerCapture?.(n.pointerId);
|
|
244
245
|
} catch {
|
|
245
246
|
}
|
|
246
247
|
}
|
|
247
248
|
},
|
|
248
|
-
onPointerMove: (
|
|
249
|
+
onPointerMove: (n) => {
|
|
249
250
|
if (f || !u.current) return;
|
|
250
251
|
const h = d.current;
|
|
251
252
|
if (!h) return;
|
|
252
|
-
const E =
|
|
253
|
+
const E = n.clientX - L.current;
|
|
253
254
|
h.scrollLeft = k.current - E;
|
|
254
255
|
},
|
|
255
256
|
onPointerUp: () => {
|
|
@@ -261,14 +262,14 @@ const Re = () => {
|
|
|
261
262
|
onPointerLeave: () => {
|
|
262
263
|
u.current = !1, b(!1);
|
|
263
264
|
},
|
|
264
|
-
children: f ? /* @__PURE__ */
|
|
265
|
+
children: f ? /* @__PURE__ */ t("div", { className: "inline-flex w-max gap-4", children: Array.from({ length: 6 }).map((n, h) => /* @__PURE__ */ t(oe, {}, `s-${h}`)) }) : /* @__PURE__ */ a(
|
|
265
266
|
"div",
|
|
266
267
|
{
|
|
267
268
|
className: "t-marquee inline-flex w-max gap-4",
|
|
268
269
|
style: { "--t-marquee-duration": `${R}s` },
|
|
269
270
|
children: [
|
|
270
|
-
/* @__PURE__ */
|
|
271
|
-
/* @__PURE__ */
|
|
271
|
+
/* @__PURE__ */ t("div", { className: "flex w-max gap-4", children: g.map((n) => /* @__PURE__ */ t(H, { review: n, defaultOriginalUrl: A }, `a-${n.id}`)) }),
|
|
272
|
+
/* @__PURE__ */ t("div", { className: "flex w-max gap-4", children: g.map((n) => /* @__PURE__ */ t(H, { review: n, defaultOriginalUrl: A }, `b-${n.id}`)) })
|
|
272
273
|
]
|
|
273
274
|
}
|
|
274
275
|
)
|
|
@@ -278,72 +279,62 @@ const Re = () => {
|
|
|
278
279
|
] })
|
|
279
280
|
] });
|
|
280
281
|
};
|
|
281
|
-
function F(e) {
|
|
282
|
-
if (!e) return "?";
|
|
283
|
-
const t = String(e).trim().split(/[\s-]+/).filter(Boolean);
|
|
284
|
-
if (t.length === 0) return "?";
|
|
285
|
-
const n = t[0]?.[0] || "", o = t.length > 1 ? t[t.length - 1]?.[0] : t[0]?.[1] || "";
|
|
286
|
-
return (n + o).toUpperCase();
|
|
287
|
-
}
|
|
288
|
-
function ie(e) {
|
|
289
|
-
return e ? e.length >= 2 ? `${e[0]}. ${e[1]}.` : `${e[0]}.` : "?";
|
|
290
|
-
}
|
|
291
282
|
function X(e) {
|
|
292
283
|
if (typeof e != "string") return;
|
|
293
|
-
const
|
|
294
|
-
if (
|
|
284
|
+
const r = e.trim();
|
|
285
|
+
if (r.length !== 0)
|
|
295
286
|
try {
|
|
296
|
-
const
|
|
297
|
-
return
|
|
287
|
+
const s = new URL(r);
|
|
288
|
+
return s.protocol !== "http:" && s.protocol !== "https:" ? void 0 : s.toString();
|
|
298
289
|
} catch {
|
|
299
290
|
return;
|
|
300
291
|
}
|
|
301
292
|
}
|
|
302
|
-
function
|
|
303
|
-
let
|
|
304
|
-
for (let
|
|
305
|
-
|
|
306
|
-
return
|
|
293
|
+
function W(e) {
|
|
294
|
+
let r = 2166136261;
|
|
295
|
+
for (let s = 0; s < e.length; s++)
|
|
296
|
+
r ^= e.charCodeAt(s), r = Math.imul(r, 16777619);
|
|
297
|
+
return r >>> 0;
|
|
307
298
|
}
|
|
308
299
|
function le(e) {
|
|
309
300
|
return function() {
|
|
310
|
-
let
|
|
311
|
-
return
|
|
301
|
+
let r = e += 1831565813;
|
|
302
|
+
return r = Math.imul(r ^ r >>> 15, r | 1), r ^= r + Math.imul(r ^ r >>> 7, r | 61), ((r ^ r >>> 14) >>> 0) / 4294967296;
|
|
312
303
|
};
|
|
313
304
|
}
|
|
314
|
-
function ce(e,
|
|
315
|
-
const
|
|
316
|
-
for (let
|
|
317
|
-
const l = Math.floor(
|
|
318
|
-
[e[
|
|
305
|
+
function ce(e, r) {
|
|
306
|
+
const s = le(r || 1);
|
|
307
|
+
for (let i = e.length - 1; i > 0; i--) {
|
|
308
|
+
const l = Math.floor(s() * (i + 1));
|
|
309
|
+
[e[i], e[l]] = [e[l], e[i]];
|
|
319
310
|
}
|
|
320
311
|
return e;
|
|
321
312
|
}
|
|
322
313
|
const de = 65, ue = 72, me = 20;
|
|
323
|
-
function
|
|
314
|
+
function D(e) {
|
|
324
315
|
return (e % 360 + 360) % 360;
|
|
325
316
|
}
|
|
326
|
-
function
|
|
327
|
-
return `hsl(${e} ${de}% ${
|
|
317
|
+
function $(e, r) {
|
|
318
|
+
return `hsl(${e} ${de}% ${r}%)`;
|
|
328
319
|
}
|
|
329
320
|
function fe(e) {
|
|
330
|
-
return
|
|
321
|
+
return D(W(e));
|
|
331
322
|
}
|
|
332
323
|
function he(e) {
|
|
333
324
|
if (typeof e == "number")
|
|
334
|
-
return
|
|
325
|
+
return D(e);
|
|
335
326
|
}
|
|
336
|
-
function pe({ name: e, size:
|
|
337
|
-
const
|
|
338
|
-
return /* @__PURE__ */
|
|
327
|
+
function pe({ name: e, size: r = 40, colorSeed: s }) {
|
|
328
|
+
const i = F(e), l = he(s) ?? fe(e), R = $(l, ue), d = $(l, me);
|
|
329
|
+
return /* @__PURE__ */ t("div", { className: "relative", style: { width: r, height: r }, "aria-hidden": !0, children: /* @__PURE__ */ t(
|
|
339
330
|
"div",
|
|
340
331
|
{
|
|
341
332
|
className: "w-full h-full rounded-full flex items-center justify-center font-semibold select-none",
|
|
342
333
|
style: { backgroundColor: R, color: d },
|
|
343
|
-
children:
|
|
334
|
+
children: i
|
|
344
335
|
}
|
|
345
336
|
) });
|
|
346
337
|
}
|
|
347
338
|
export {
|
|
348
|
-
|
|
339
|
+
ke as TestimonialsSection
|
|
349
340
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MollieCardFieldsForm.d.ts","sourceRoot":"","sources":["../../../src/components/payment/MollieCardFieldsForm.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MollieCardFieldsForm.d.ts","sourceRoot":"","sources":["../../../src/components/payment/MollieCardFieldsForm.tsx"],"names":[],"mappings":"AAyFA,KAAK,yBAAyB,GAAG;IAC/B,SAAS,EAAE,MAAM,CAAA;IACjB,QAAQ,EAAE,OAAO,CAAA;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,QAAQ,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;CAC/C,CAAA;AAED,wBAAgB,oBAAoB,CAAC,EACnC,SAAS,EACT,QAAQ,EACR,QAAgB,EAChB,WAAW,EACX,eAAe,EACf,QAAQ,GACT,EAAE,yBAAyB,2CAgK3B"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { jsxs as c, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { useState as N, useRef as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
2
|
+
import { useState as N, useRef as M, useEffect as R } from "react";
|
|
3
|
+
import { Spinner as H } from "../../chunks/ui/dist/Spinner/index-SbbUxcsT.js";
|
|
4
|
+
import { CreditCard as j } from "lucide-react";
|
|
5
|
+
import { useTranslation as z } from "react-i18next";
|
|
6
|
+
import { getMollieCardStyles as T } from "../../lib/mollieComponentStyles.js";
|
|
6
7
|
import { Button as I } from "../../ui/button.js";
|
|
7
8
|
import { Label as _ } from "../../ui/label.js";
|
|
8
9
|
const $ = "https://js.mollie.com/v1/mollie.js";
|
|
@@ -30,7 +31,7 @@ const P = async () => {
|
|
|
30
31
|
throw v = null, s;
|
|
31
32
|
})), v);
|
|
32
33
|
}, q = (o) => o.toLowerCase().startsWith("fr") ? "fr_FR" : "en_US";
|
|
33
|
-
function
|
|
34
|
+
function V({
|
|
34
35
|
profileId: o,
|
|
35
36
|
testmode: s,
|
|
36
37
|
disabled: d = !1,
|
|
@@ -38,12 +39,12 @@ function Q({
|
|
|
38
39
|
submittingLabel: p,
|
|
39
40
|
onSubmit: a
|
|
40
41
|
}) {
|
|
41
|
-
const { t: r, i18n:
|
|
42
|
+
const { t: r, i18n: w } = z(), [D, x] = N(!0), [b, C] = N(!1), [k, l] = N(null), t = M({
|
|
42
43
|
cardHolder: `mollie-card-holder-${Math.random().toString(36).slice(2, 10)}`,
|
|
43
44
|
cardNumber: `mollie-card-number-${Math.random().toString(36).slice(2, 10)}`,
|
|
44
45
|
expiryDate: `mollie-expiry-date-${Math.random().toString(36).slice(2, 10)}`,
|
|
45
46
|
verificationCode: `mollie-verification-code-${Math.random().toString(36).slice(2, 10)}`
|
|
46
|
-
}), m =
|
|
47
|
+
}), m = M(null), g = M([]);
|
|
47
48
|
return R(() => {
|
|
48
49
|
let u = !1;
|
|
49
50
|
return x(!0), l(null), m.current = null, (async () => {
|
|
@@ -51,22 +52,22 @@ function Q({
|
|
|
51
52
|
const n = await P();
|
|
52
53
|
if (u) return;
|
|
53
54
|
const i = n(o, {
|
|
54
|
-
locale: q(
|
|
55
|
+
locale: q(w.language),
|
|
55
56
|
testmode: s
|
|
56
|
-
}), h =
|
|
57
|
+
}), h = T(), y = "", S = i.createComponent("cardHolder", {
|
|
57
58
|
styles: h,
|
|
58
59
|
label: y
|
|
59
|
-
}),
|
|
60
|
+
}), E = i.createComponent("cardNumber", {
|
|
60
61
|
styles: h,
|
|
61
62
|
label: y
|
|
62
|
-
}),
|
|
63
|
+
}), F = i.createComponent("expiryDate", {
|
|
63
64
|
styles: h,
|
|
64
65
|
label: y
|
|
65
66
|
}), L = i.createComponent("verificationCode", {
|
|
66
67
|
styles: h,
|
|
67
68
|
label: y
|
|
68
69
|
});
|
|
69
|
-
|
|
70
|
+
S.mount(`#${t.current.cardHolder}`), E.mount(`#${t.current.cardNumber}`), F.mount(`#${t.current.expiryDate}`), L.mount(`#${t.current.verificationCode}`), m.current = i, g.current = [S, E, F, L];
|
|
70
71
|
} catch (n) {
|
|
71
72
|
if (u) return;
|
|
72
73
|
l(n instanceof Error ? n.message : r("secure_payment_link.errors.payment_failed"));
|
|
@@ -79,7 +80,7 @@ function Q({
|
|
|
79
80
|
n.unmount?.();
|
|
80
81
|
g.current = [], m.current = null;
|
|
81
82
|
};
|
|
82
|
-
}, [
|
|
83
|
+
}, [w.language, o, r, s]), /* @__PURE__ */ c("form", { onSubmit: async (u) => {
|
|
83
84
|
if (u.preventDefault(), !d) {
|
|
84
85
|
if (!m.current) {
|
|
85
86
|
l(r("secure_payment_link.errors.mollie_not_ready"));
|
|
@@ -125,11 +126,11 @@ function Q({
|
|
|
125
126
|
] }),
|
|
126
127
|
k ? /* @__PURE__ */ e("p", { className: "text-sm text-destructive", children: /* @__PURE__ */ e("span", { children: k }) }) : null,
|
|
127
128
|
/* @__PURE__ */ c(I, { type: "submit", disabled: d || b || D || !m.current, className: "h-11 gap-2", children: [
|
|
128
|
-
b ? /* @__PURE__ */ e(H, { className: "
|
|
129
|
+
b ? /* @__PURE__ */ e(H, { className: "size-4", "aria-hidden": "true" }) : /* @__PURE__ */ e(j, { className: "h-4 w-4", "aria-hidden": "true" }),
|
|
129
130
|
/* @__PURE__ */ e("span", { children: b ? p ?? r("secure_payment_link.form.submitting_button") : f ?? r("secure_payment_link.form.submit_button") })
|
|
130
131
|
] })
|
|
131
132
|
] });
|
|
132
133
|
}
|
|
133
134
|
export {
|
|
134
|
-
|
|
135
|
+
V as MollieCardFieldsForm
|
|
135
136
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StripeCardFieldsForm.d.ts","sourceRoot":"","sources":["../../../src/components/payment/StripeCardFieldsForm.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"StripeCardFieldsForm.d.ts","sourceRoot":"","sources":["../../../src/components/payment/StripeCardFieldsForm.tsx"],"names":[],"mappings":"AAWA,KAAK,iCAAiC,GAAG;IACvC,eAAe,EAAE,MAAM,CAAA;IACvB,cAAc,EAAE,MAAM,CAAA;IACtB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAED,KAAK,yBAAyB,GAAG;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,YAAY,CAAC,EAAE,OAAO,CAAA;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,QAAQ,EAAE,CAAC,OAAO,EAAE,iCAAiC,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;CACxE,CAAA;AAED,wBAAgB,oBAAoB,CAAC,EACnC,KAAU,EACV,YAAmB,EACnB,QAAgB,EAChB,WAAW,EACX,eAAe,EACf,QAAQ,GACT,EAAE,yBAAyB,2CA2H3B"}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { jsxs as t, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { useState as u } from "react";
|
|
3
|
-
import { useStripe as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
3
|
+
import { useStripe as S, useElements as M, CardNumberElement as g, CardExpiryElement as w, CardCvcElement as F } from "@stripe/react-stripe-js";
|
|
4
|
+
import { Spinner as z } from "../../chunks/ui/dist/Spinner/index-SbbUxcsT.js";
|
|
5
|
+
import { CreditCard as j } from "lucide-react";
|
|
6
|
+
import { useTranslation as q } from "react-i18next";
|
|
6
7
|
import { Button as I } from "../../ui/button.js";
|
|
7
|
-
import { Input as
|
|
8
|
+
import { Input as B } from "../../ui/input.js";
|
|
8
9
|
import { Label as m } from "../../ui/label.js";
|
|
9
|
-
function
|
|
10
|
+
function O({
|
|
10
11
|
email: N = "",
|
|
11
12
|
requireEmail: v = !0,
|
|
12
13
|
disabled: h = !1,
|
|
@@ -14,7 +15,7 @@ function K({
|
|
|
14
15
|
submittingLabel: x,
|
|
15
16
|
onSubmit: C
|
|
16
17
|
}) {
|
|
17
|
-
const { t: r } =
|
|
18
|
+
const { t: r } = q(), d = S(), l = M(), [_, E] = u(""), [n, s] = u(!1), [y, a] = u(null);
|
|
18
19
|
return /* @__PURE__ */ t("form", { onSubmit: async (c) => {
|
|
19
20
|
if (c.preventDefault(), !d || !l) {
|
|
20
21
|
a(r("secure_payment_link.errors.stripe_not_ready"));
|
|
@@ -62,7 +63,7 @@ function K({
|
|
|
62
63
|
/* @__PURE__ */ t("div", { className: "space-y-1", children: [
|
|
63
64
|
/* @__PURE__ */ e(m, { htmlFor: "payment-cardholder-name", children: /* @__PURE__ */ e("span", { children: r("secure_payment_link.form.cardholder_name_label") }) }),
|
|
64
65
|
/* @__PURE__ */ e(
|
|
65
|
-
|
|
66
|
+
B,
|
|
66
67
|
{
|
|
67
68
|
id: "payment-cardholder-name",
|
|
68
69
|
value: _,
|
|
@@ -81,7 +82,7 @@ function K({
|
|
|
81
82
|
/* @__PURE__ */ t("div", { className: "grid gap-3 sm:grid-cols-2", children: [
|
|
82
83
|
/* @__PURE__ */ t("div", { className: "space-y-1", children: [
|
|
83
84
|
/* @__PURE__ */ e(m, { htmlFor: "payment-card-expiry", children: /* @__PURE__ */ e("span", { children: r("secure_payment_link.form.card_expiry_label") }) }),
|
|
84
|
-
/* @__PURE__ */ e("div", { className: "rounded-md border border-slate-200 bg-white px-3 py-2", children: /* @__PURE__ */ e(
|
|
85
|
+
/* @__PURE__ */ e("div", { className: "rounded-md border border-slate-200 bg-white px-3 py-2", children: /* @__PURE__ */ e(w, { id: "payment-card-expiry" }) })
|
|
85
86
|
] }),
|
|
86
87
|
/* @__PURE__ */ t("div", { className: "space-y-1", children: [
|
|
87
88
|
/* @__PURE__ */ e(m, { htmlFor: "payment-card-cvc", children: /* @__PURE__ */ e("span", { children: r("secure_payment_link.form.card_cvc_label") }) }),
|
|
@@ -90,11 +91,11 @@ function K({
|
|
|
90
91
|
] }),
|
|
91
92
|
y ? /* @__PURE__ */ e("p", { className: "text-sm text-destructive", children: /* @__PURE__ */ e("span", { children: y }) }) : null,
|
|
92
93
|
/* @__PURE__ */ t(I, { type: "submit", disabled: h || n || !d || !l, className: "gap-2", children: [
|
|
93
|
-
n ? /* @__PURE__ */ e(
|
|
94
|
+
n ? /* @__PURE__ */ e(z, { className: "size-4", "aria-hidden": "true" }) : /* @__PURE__ */ e(j, { className: "h-4 w-4", "aria-hidden": "true" }),
|
|
94
95
|
/* @__PURE__ */ e("span", { children: n ? x ?? r("secure_payment_link.form.submitting_button") : k ?? r("secure_payment_link.form.submit_button") })
|
|
95
96
|
] })
|
|
96
97
|
] });
|
|
97
98
|
}
|
|
98
99
|
export {
|
|
99
|
-
|
|
100
|
+
O as StripeCardFieldsForm
|
|
100
101
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nameInitials.d.ts","sourceRoot":"","sources":["../../src/lib/nameInitials.ts"],"names":[],"mappings":"AAOA,wBAAgB,eAAe,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAYrD;AAED,wBAAgB,yBAAyB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAIlE"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { splitGraphemes as s } from "unicode-segmenter/grapheme";
|
|
2
|
+
function i(r) {
|
|
3
|
+
return Array.from(s(r));
|
|
4
|
+
}
|
|
5
|
+
function o(r) {
|
|
6
|
+
if (!r) return "?";
|
|
7
|
+
const t = r.trim().split(/[\s-]+/).filter(Boolean);
|
|
8
|
+
if (t.length === 0) return "?";
|
|
9
|
+
const e = i(t[0]), n = t.length > 1 ? i(t[t.length - 1])[0] : e[1];
|
|
10
|
+
return `${e[0] ?? ""}${n ?? ""}`.toUpperCase() || "?";
|
|
11
|
+
}
|
|
12
|
+
function p(r) {
|
|
13
|
+
const t = i(r.trim()).slice(0, 2);
|
|
14
|
+
return t.length === 0 ? "?" : t.map((e) => `${e}.`).join(" ");
|
|
15
|
+
}
|
|
16
|
+
export {
|
|
17
|
+
p as formatInitialsWithPeriods,
|
|
18
|
+
o as getNameInitials
|
|
19
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CheckoutPaymentPage.d.ts","sourceRoot":"","sources":["../../src/pages/CheckoutPaymentPage.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CheckoutPaymentPage.d.ts","sourceRoot":"","sources":["../../src/pages/CheckoutPaymentPage.tsx"],"names":[],"mappings":"AAmGA,MAAM,CAAC,OAAO,UAAU,mBAAmB,4CA0V1C"}
|