@odus/checkout 0.10.0 → 0.11.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/checkout.d.ts +16 -8
- package/dist/checkout.es.js +321 -316
- package/dist/package.json +1 -1
- package/package.json +1 -1
- package/dist/checkout.umd.js +0 -18
package/dist/checkout.es.js
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
const N = () => "http://localhost:3000";
|
|
1
|
+
const N = (o) => o === "test" ? "https://sandbox-api.odus.com" : o === "live" ? "https://api.odus.com" : "http://localhost:3000";
|
|
2
2
|
class H {
|
|
3
3
|
apiKey;
|
|
4
4
|
baseUrl;
|
|
5
5
|
browserInfo;
|
|
6
|
-
constructor(e, t,
|
|
7
|
-
this.apiKey = e, this.baseUrl = N(), this.browserInfo =
|
|
6
|
+
constructor(e, t, i) {
|
|
7
|
+
this.apiKey = e, this.baseUrl = N(t), this.browserInfo = i || { userAgent: navigator.userAgent };
|
|
8
8
|
}
|
|
9
9
|
async fetchApi({
|
|
10
10
|
endpoint: e,
|
|
11
11
|
method: t = "POST",
|
|
12
|
-
body:
|
|
13
|
-
customHeaders:
|
|
12
|
+
body: i,
|
|
13
|
+
customHeaders: a = {}
|
|
14
14
|
}) {
|
|
15
15
|
const r = {
|
|
16
16
|
Authorization: `Bearer ${this.apiKey}`,
|
|
17
17
|
"Content-Type": "application/json",
|
|
18
|
-
...
|
|
18
|
+
...a
|
|
19
19
|
};
|
|
20
20
|
try {
|
|
21
21
|
const s = await fetch(`${this.baseUrl}${e}`, {
|
|
22
22
|
method: t,
|
|
23
23
|
headers: r,
|
|
24
|
-
body:
|
|
24
|
+
body: i ? JSON.stringify(i) : void 0
|
|
25
25
|
});
|
|
26
26
|
if (!s.ok) {
|
|
27
27
|
let n;
|
|
@@ -51,26 +51,26 @@ class H {
|
|
|
51
51
|
async authorizePayment({
|
|
52
52
|
paymentId: e,
|
|
53
53
|
checkoutKey: t,
|
|
54
|
-
formData:
|
|
55
|
-
token:
|
|
54
|
+
formData: i,
|
|
55
|
+
token: a,
|
|
56
56
|
returnUrl: r
|
|
57
57
|
}) {
|
|
58
58
|
let s = {};
|
|
59
|
-
if (
|
|
60
|
-
const n =
|
|
59
|
+
if (a && i) {
|
|
60
|
+
const n = i.cardExpiry.replace(/\s+/g, "").split("/"), l = n[0], c = n[1];
|
|
61
61
|
s = {
|
|
62
62
|
paymentMethodData: {
|
|
63
63
|
type: "card",
|
|
64
64
|
card: {
|
|
65
|
-
token:
|
|
65
|
+
token: a,
|
|
66
66
|
expMonth: l,
|
|
67
67
|
expYear: `20${c}`,
|
|
68
|
-
cardholderName:
|
|
68
|
+
cardholderName: i.name
|
|
69
69
|
}
|
|
70
70
|
},
|
|
71
71
|
customerData: {
|
|
72
|
-
email:
|
|
73
|
-
name:
|
|
72
|
+
email: i.email,
|
|
73
|
+
name: i.name
|
|
74
74
|
},
|
|
75
75
|
context: {
|
|
76
76
|
returnUrl: r,
|
|
@@ -102,16 +102,16 @@ const O = async ({
|
|
|
102
102
|
apiKey: e,
|
|
103
103
|
environment: t
|
|
104
104
|
}) => {
|
|
105
|
-
const
|
|
105
|
+
const i = N(t), a = await fetch(`${i}/checkout-profiles/${o}`, {
|
|
106
106
|
method: "GET",
|
|
107
107
|
headers: {
|
|
108
108
|
"Content-Type": "application/json",
|
|
109
109
|
Authorization: `Bearer ${e}`
|
|
110
110
|
}
|
|
111
111
|
});
|
|
112
|
-
if (!
|
|
113
|
-
throw new Error(`HTTP error! Status: ${
|
|
114
|
-
return await
|
|
112
|
+
if (!a.ok)
|
|
113
|
+
throw new Error(`HTTP error! Status: ${a.status}`);
|
|
114
|
+
return await a.json();
|
|
115
115
|
};
|
|
116
116
|
class K {
|
|
117
117
|
events = /* @__PURE__ */ new Map();
|
|
@@ -123,8 +123,8 @@ class K {
|
|
|
123
123
|
*/
|
|
124
124
|
subscribe(e, t) {
|
|
125
125
|
return this.events.has(e) || this.events.set(e, /* @__PURE__ */ new Set()), this.events.get(e)?.add(t), () => {
|
|
126
|
-
const
|
|
127
|
-
|
|
126
|
+
const i = this.events.get(e);
|
|
127
|
+
i && (i.delete(t), i.size === 0 && this.events.delete(e));
|
|
128
128
|
};
|
|
129
129
|
}
|
|
130
130
|
/**
|
|
@@ -133,8 +133,8 @@ class K {
|
|
|
133
133
|
* @param data - The data to pass to subscribers
|
|
134
134
|
*/
|
|
135
135
|
publish(e, t) {
|
|
136
|
-
const
|
|
137
|
-
|
|
136
|
+
const i = this.events.get(e);
|
|
137
|
+
i && i.forEach((a) => a(t));
|
|
138
138
|
}
|
|
139
139
|
/**
|
|
140
140
|
* Clear all event subscriptions
|
|
@@ -151,13 +151,13 @@ class K {
|
|
|
151
151
|
return this.events.get(e)?.size || 0;
|
|
152
152
|
}
|
|
153
153
|
}
|
|
154
|
-
const
|
|
155
|
-
class
|
|
154
|
+
const j = new K();
|
|
155
|
+
class q {
|
|
156
156
|
state;
|
|
157
157
|
initialState;
|
|
158
158
|
eventBus;
|
|
159
159
|
stateChangedEvent = "state-changed";
|
|
160
|
-
constructor(e, t =
|
|
160
|
+
constructor(e, t = j) {
|
|
161
161
|
this.initialState = { ...e }, this.state = { ...e }, this.eventBus = t;
|
|
162
162
|
}
|
|
163
163
|
/**
|
|
@@ -198,41 +198,41 @@ class j {
|
|
|
198
198
|
}
|
|
199
199
|
}
|
|
200
200
|
function T(o) {
|
|
201
|
-
return new
|
|
201
|
+
return new q(o);
|
|
202
202
|
}
|
|
203
203
|
function U({
|
|
204
204
|
apiKey: o,
|
|
205
205
|
profileId: e,
|
|
206
206
|
environment: t
|
|
207
207
|
}) {
|
|
208
|
-
const
|
|
208
|
+
const i = T({
|
|
209
209
|
checkoutProfile: void 0,
|
|
210
210
|
isLoading: !0,
|
|
211
211
|
error: null
|
|
212
|
-
}),
|
|
212
|
+
}), a = async () => {
|
|
213
213
|
try {
|
|
214
|
-
|
|
214
|
+
i.setState({ isLoading: !0 });
|
|
215
215
|
const r = await O({
|
|
216
216
|
apiKey: o,
|
|
217
217
|
id: e,
|
|
218
218
|
environment: t
|
|
219
219
|
});
|
|
220
|
-
r &&
|
|
220
|
+
r && i.setState({
|
|
221
221
|
checkoutProfile: r,
|
|
222
222
|
isLoading: !1,
|
|
223
223
|
error: null
|
|
224
224
|
});
|
|
225
225
|
} catch (r) {
|
|
226
|
-
|
|
226
|
+
i.setState({
|
|
227
227
|
error: "Failed to load checkout profile",
|
|
228
228
|
isLoading: !1
|
|
229
229
|
}), console.error(r);
|
|
230
230
|
}
|
|
231
231
|
};
|
|
232
|
-
return
|
|
233
|
-
getState:
|
|
234
|
-
subscribe:
|
|
235
|
-
reload:
|
|
232
|
+
return a(), {
|
|
233
|
+
getState: i.getState.bind(i),
|
|
234
|
+
subscribe: i.subscribe.bind(i),
|
|
235
|
+
reload: a
|
|
236
236
|
};
|
|
237
237
|
}
|
|
238
238
|
const D = {
|
|
@@ -321,58 +321,58 @@ const D = {
|
|
|
321
321
|
if (o === "companycok" && t === "co")
|
|
322
322
|
return "company.co";
|
|
323
323
|
if (o.endsWith(t) && !o.includes(".")) {
|
|
324
|
-
const
|
|
325
|
-
return `${o.substring(0,
|
|
324
|
+
const i = o.length - t.length;
|
|
325
|
+
return `${o.substring(0, i)}.${t}`;
|
|
326
326
|
}
|
|
327
327
|
}
|
|
328
328
|
return null;
|
|
329
329
|
}, G = (o, e) => {
|
|
330
330
|
if (o.length === 0) return e.length;
|
|
331
331
|
if (e.length === 0) return o.length;
|
|
332
|
-
const t = e.length + 1,
|
|
332
|
+
const t = e.length + 1, i = o.length + 1, a = Array.from(
|
|
333
333
|
{ length: t },
|
|
334
|
-
(r, s) => Array.from({ length:
|
|
334
|
+
(r, s) => Array.from({ length: i }, (n, l) => s === 0 ? l : l === 0 ? s : 0)
|
|
335
335
|
);
|
|
336
336
|
for (let r = 1; r < t; r++)
|
|
337
|
-
for (let s = 1; s <
|
|
337
|
+
for (let s = 1; s < i; s++) {
|
|
338
338
|
const n = o[s - 1] === e[r - 1] ? 0 : 1;
|
|
339
|
-
|
|
340
|
-
|
|
339
|
+
a[r][s] = Math.min(
|
|
340
|
+
a[r - 1][s] + 1,
|
|
341
341
|
// deletion
|
|
342
|
-
|
|
342
|
+
a[r][s - 1] + 1,
|
|
343
343
|
// insertion
|
|
344
|
-
|
|
344
|
+
a[r - 1][s - 1] + n
|
|
345
345
|
// substitution
|
|
346
346
|
);
|
|
347
347
|
}
|
|
348
|
-
return
|
|
348
|
+
return a[e.length][o.length];
|
|
349
349
|
}, Y = (o) => {
|
|
350
|
-
let t = null,
|
|
351
|
-
const
|
|
350
|
+
let t = null, i = 3;
|
|
351
|
+
const a = o.toLowerCase();
|
|
352
352
|
for (const r of Object.keys($)) {
|
|
353
|
-
const s = G(
|
|
354
|
-
s <= 2 && s <
|
|
353
|
+
const s = G(a, r);
|
|
354
|
+
s <= 2 && s < i && (i = s, t = r);
|
|
355
355
|
}
|
|
356
356
|
return t;
|
|
357
357
|
}, Z = () => {
|
|
358
|
-
const { t: o } =
|
|
358
|
+
const { t: o } = z();
|
|
359
359
|
return {
|
|
360
360
|
validateEmail: (t) => {
|
|
361
|
-
const
|
|
361
|
+
const i = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
|
362
362
|
if (!t)
|
|
363
363
|
return {
|
|
364
364
|
isValid: !1,
|
|
365
365
|
message: o("validation.emailInvalid"),
|
|
366
366
|
suggestion: null
|
|
367
367
|
};
|
|
368
|
-
const
|
|
369
|
-
if (
|
|
368
|
+
const a = t.indexOf("@");
|
|
369
|
+
if (a === -1)
|
|
370
370
|
return {
|
|
371
371
|
isValid: !1,
|
|
372
372
|
message: o("validation.emailInvalid"),
|
|
373
373
|
suggestion: null
|
|
374
374
|
};
|
|
375
|
-
const r = t.substring(0,
|
|
375
|
+
const r = t.substring(0, a), s = t.substring(a + 1);
|
|
376
376
|
if (!s.includes(".")) {
|
|
377
377
|
const l = _(s);
|
|
378
378
|
if (l)
|
|
@@ -393,7 +393,7 @@ const D = {
|
|
|
393
393
|
suggestion: `${r}@${c}`
|
|
394
394
|
};
|
|
395
395
|
}
|
|
396
|
-
if (!
|
|
396
|
+
if (!i.test(t))
|
|
397
397
|
return {
|
|
398
398
|
isValid: !1,
|
|
399
399
|
message: o("validation.emailInvalid"),
|
|
@@ -416,21 +416,21 @@ const D = {
|
|
|
416
416
|
}
|
|
417
417
|
};
|
|
418
418
|
}, J = () => {
|
|
419
|
-
const { t: o } =
|
|
419
|
+
const { t: o } = z(), { validateEmail: e } = Z();
|
|
420
420
|
return {
|
|
421
421
|
email: (t) => {
|
|
422
|
-
const
|
|
423
|
-
return
|
|
422
|
+
const i = e(t);
|
|
423
|
+
return i.isValid ? void 0 : i.message;
|
|
424
424
|
},
|
|
425
425
|
name: (t) => {
|
|
426
426
|
if (!t.trim())
|
|
427
427
|
return o("validation.nameRequired");
|
|
428
428
|
},
|
|
429
429
|
cardExpiry: (t) => {
|
|
430
|
-
const
|
|
431
|
-
if (!
|
|
430
|
+
const i = t.replace(/\s/g, ""), [a, r] = i.split("/").map((p) => p.trim());
|
|
431
|
+
if (!a || !r || a.length !== 2 || r.length !== 2)
|
|
432
432
|
return o("validation.cardExpiryFormat");
|
|
433
|
-
const s = /* @__PURE__ */ new Date(), n = s.getFullYear() % 100, l = s.getMonth() + 1, c = parseInt(
|
|
433
|
+
const s = /* @__PURE__ */ new Date(), n = s.getFullYear() % 100, l = s.getMonth() + 1, c = parseInt(a, 10), d = parseInt(r, 10);
|
|
434
434
|
if (c < 1 || c > 12)
|
|
435
435
|
return o("validation.cardExpiryFormat");
|
|
436
436
|
if (d < n || d === n && c < l)
|
|
@@ -454,14 +454,14 @@ const D = {
|
|
|
454
454
|
}), t = (l, c) => {
|
|
455
455
|
const d = o[l];
|
|
456
456
|
return d?.(c);
|
|
457
|
-
},
|
|
457
|
+
}, i = (l) => {
|
|
458
458
|
const c = {};
|
|
459
459
|
return Object.keys(l).forEach((d) => {
|
|
460
460
|
const p = t(d, l[d]);
|
|
461
461
|
p && (c[d] = p);
|
|
462
462
|
}), c;
|
|
463
|
-
},
|
|
464
|
-
const c =
|
|
463
|
+
}, a = (l) => {
|
|
464
|
+
const c = i(l);
|
|
465
465
|
return Object.keys(c).length === 0;
|
|
466
466
|
}, r = (l, c) => {
|
|
467
467
|
const d = e.getState();
|
|
@@ -478,7 +478,7 @@ const D = {
|
|
|
478
478
|
e.setState({
|
|
479
479
|
formData: g,
|
|
480
480
|
errors: y,
|
|
481
|
-
isValid:
|
|
481
|
+
isValid: a(g)
|
|
482
482
|
});
|
|
483
483
|
}, s = (l, c) => {
|
|
484
484
|
const d = e.getState(), p = {
|
|
@@ -496,7 +496,7 @@ const D = {
|
|
|
496
496
|
};
|
|
497
497
|
e.setState({
|
|
498
498
|
formData: d,
|
|
499
|
-
isValid:
|
|
499
|
+
isValid: a(d)
|
|
500
500
|
});
|
|
501
501
|
};
|
|
502
502
|
return {
|
|
@@ -512,7 +512,7 @@ const D = {
|
|
|
512
512
|
apiKey: e,
|
|
513
513
|
environment: t
|
|
514
514
|
}) => {
|
|
515
|
-
const
|
|
515
|
+
const i = N(t), a = await fetch(`${i}/checkout/init`, {
|
|
516
516
|
method: "POST",
|
|
517
517
|
headers: {
|
|
518
518
|
"Content-Type": "application/json",
|
|
@@ -520,16 +520,16 @@ const D = {
|
|
|
520
520
|
},
|
|
521
521
|
body: JSON.stringify(o)
|
|
522
522
|
});
|
|
523
|
-
if (!
|
|
524
|
-
throw new Error(`HTTP error! Status: ${
|
|
525
|
-
return await
|
|
523
|
+
if (!a.ok)
|
|
524
|
+
throw new Error(`HTTP error! Status: ${a.status}`);
|
|
525
|
+
return await a.json();
|
|
526
526
|
};
|
|
527
527
|
function Q({
|
|
528
528
|
apiKey: o,
|
|
529
529
|
checkoutProfile: e,
|
|
530
530
|
inputStyles: t,
|
|
531
|
-
setFormData:
|
|
532
|
-
environment:
|
|
531
|
+
setFormData: i,
|
|
532
|
+
environment: a,
|
|
533
533
|
paymentId: r
|
|
534
534
|
}) {
|
|
535
535
|
const s = T({
|
|
@@ -549,7 +549,7 @@ function Q({
|
|
|
549
549
|
payment: r
|
|
550
550
|
},
|
|
551
551
|
apiKey: o,
|
|
552
|
-
environment:
|
|
552
|
+
environment: a
|
|
553
553
|
});
|
|
554
554
|
u && (s.setState({
|
|
555
555
|
iframeConfig: {
|
|
@@ -558,7 +558,7 @@ function Q({
|
|
|
558
558
|
}
|
|
559
559
|
}), d());
|
|
560
560
|
} catch (u) {
|
|
561
|
-
console.error("Failed to generate iframe config:", u);
|
|
561
|
+
throw console.error("Failed to generate iframe config:", u), u;
|
|
562
562
|
}
|
|
563
563
|
}, c = () => {
|
|
564
564
|
const u = s.getState();
|
|
@@ -599,7 +599,7 @@ function Q({
|
|
|
599
599
|
s.setState({ loadingIframe: !1 });
|
|
600
600
|
}), n.on("autoCompleteValues", function(v) {
|
|
601
601
|
const { nameOnCard: w, cardExp: S } = v;
|
|
602
|
-
|
|
602
|
+
i({
|
|
603
603
|
name: w,
|
|
604
604
|
cardExpiry: S
|
|
605
605
|
});
|
|
@@ -672,17 +672,17 @@ function Q({
|
|
|
672
672
|
focusCvv: I
|
|
673
673
|
};
|
|
674
674
|
}
|
|
675
|
-
const ee = "E-Mail", te = "Name des/der Karteninhaber/in",
|
|
675
|
+
const ee = "E-Mail", te = "Name des/der Karteninhaber/in", ie = "Kartendaten", ae = "Vollständiger Name", re = "MM / JJ", se = "Das Fenster nicht schließen", ne = { pay: "ZAHLEN", submit: "ABSENDEN", getPlan: "MEINEN PLAN ERHALTEN", donate: "spenden", book: "jetzt buchen", order: "jetzt bestellen" }, oe = { emailSuggestion: "Meinten Sie {{email}}?", emailInvalid: "Ihre E-Mail-Adresse ist nicht korrekt", cardExpiryInvalid: "Das Ablaufdatum Ihrer Karte liegt in der Vergangenheit", cardExpiryFormat: "Das Ablaufdatum Ihrer Karte ist unvollständig", cardSecurityFormat: "Der Sicherheitscode Ihrer Karte ist unvollständig", nameRequired: "Gib deinen Namen genau so ein, wie er auf deiner Karte steht", cardNumberInvalid: "Die Kartennummer ist unvollständig", "invalid-checkout": "Checkout konnte nicht initialisiert werden" }, le = {
|
|
676
676
|
email: ee,
|
|
677
677
|
cardholderNameLabel: te,
|
|
678
|
-
cardInformation:
|
|
679
|
-
cardholderNamePlaceholder:
|
|
678
|
+
cardInformation: ie,
|
|
679
|
+
cardholderNamePlaceholder: ae,
|
|
680
680
|
cardExpiry: re,
|
|
681
681
|
loading: se,
|
|
682
682
|
"pay-with-card": "oder mit Karte bezahlen",
|
|
683
683
|
buttonTexts: ne,
|
|
684
684
|
validation: oe
|
|
685
|
-
}, ce = "Email", de = "Cardholder name", he = "Card information", me = "Full name on card", ue = "MM / YY", pe = "Do not close the window", fe = { pay: "PAY", submit: "SUBMIT", getPlan: "GET MY PLAN", donate: "DONATE", book: "BOOK NOW", order: "ORDER NOW" }, ge = { emailSuggestion: "Did you mean {{email}}?", emailInvalid: "Your email is not correct", cardExpiryInvalid: "Your card's expiration date is in the past", cardExpiryFormat: "Your card’s expiration date is incomplete", cardSecurityFormat: "Your card’s security code is incomplete", nameRequired: "Please enter the name as it appears on your card", cardNumberInvalid: "Your card number is invalid" }, ye = {
|
|
685
|
+
}, ce = "Email", de = "Cardholder name", he = "Card information", me = "Full name on card", ue = "MM / YY", pe = "Do not close the window", fe = { pay: "PAY", submit: "SUBMIT", getPlan: "GET MY PLAN", donate: "DONATE", book: "BOOK NOW", order: "ORDER NOW" }, ge = { emailSuggestion: "Did you mean {{email}}?", emailInvalid: "Your email is not correct", cardExpiryInvalid: "Your card's expiration date is in the past", cardExpiryFormat: "Your card’s expiration date is incomplete", cardSecurityFormat: "Your card’s security code is incomplete", nameRequired: "Please enter the name as it appears on your card", cardNumberInvalid: "Your card number is invalid", "invalid-checkout": "Failed to initialize checkout" }, ye = {
|
|
686
686
|
email: ce,
|
|
687
687
|
cardholderNameLabel: de,
|
|
688
688
|
cardInformation: he,
|
|
@@ -692,7 +692,7 @@ const ee = "E-Mail", te = "Name des/der Karteninhaber/in", ae = "Kartendaten", i
|
|
|
692
692
|
"pay-with-card": "or pay with card",
|
|
693
693
|
buttonTexts: fe,
|
|
694
694
|
validation: ge
|
|
695
|
-
}, ve = "Correo electrónico", Ee = "Nombre del titular de la tarjeta", Ce = "Información de la tarjeta", be = "Nombre completo en la tarjeta", Se = "MM / AA", xe = "Por favor, no cierre esta ventana", Fe = { pay: "PAGAR", submit: "ENVIAR", getPlan: "OBTENER MI PLAN", donate: "DONAR", book: "RESERVAR AHORA", order: "ORDENAR AHORA" }, ke = { emailSuggestion: "¿Quisiste decir {{email}}?", emailInvalid: "Su correo electrónico no es válido", cardExpiryInvalid: "La fecha de vencimiento de la tarjeta ya pasó", cardExpiryFormat: "La fecha de vencimiento de su tarjeta está incompleta", cardSecurityFormat: "El código de seguridad de su tarjeta está incompleto", nameRequired: "Por favor, ingrese el nombre tal como aparece en su tarjeta", cardNumberInvalid: "Su número de tarjeta no es válido" }, we = {
|
|
695
|
+
}, ve = "Correo electrónico", Ee = "Nombre del titular de la tarjeta", Ce = "Información de la tarjeta", be = "Nombre completo en la tarjeta", Se = "MM / AA", xe = "Por favor, no cierre esta ventana", Fe = { pay: "PAGAR", submit: "ENVIAR", getPlan: "OBTENER MI PLAN", donate: "DONAR", book: "RESERVAR AHORA", order: "ORDENAR AHORA" }, ke = { emailSuggestion: "¿Quisiste decir {{email}}?", emailInvalid: "Su correo electrónico no es válido", cardExpiryInvalid: "La fecha de vencimiento de la tarjeta ya pasó", cardExpiryFormat: "La fecha de vencimiento de su tarjeta está incompleta", cardSecurityFormat: "El código de seguridad de su tarjeta está incompleto", nameRequired: "Por favor, ingrese el nombre tal como aparece en su tarjeta", cardNumberInvalid: "Su número de tarjeta no es válido", "invalid-checkout": "No se pudo inicializar el checkout" }, we = {
|
|
696
696
|
email: ve,
|
|
697
697
|
cardholderNameLabel: Ee,
|
|
698
698
|
cardInformation: Ce,
|
|
@@ -702,17 +702,17 @@ const ee = "E-Mail", te = "Name des/der Karteninhaber/in", ae = "Kartendaten", i
|
|
|
702
702
|
"pay-with-card": "o paga con tarjeta",
|
|
703
703
|
buttonTexts: Fe,
|
|
704
704
|
validation: ke
|
|
705
|
-
}, Me = "E-mail", Le = "Nom du titulaire de la carte", Te = "Informations de la carte", Ie = "Nom complet figurant sur la carte", Ne = "MM / AA",
|
|
705
|
+
}, Me = "E-mail", Le = "Nom du titulaire de la carte", Te = "Informations de la carte", Ie = "Nom complet figurant sur la carte", Ne = "MM / AA", ze = "Veuillez ne pas fermer cette fenêtre", Pe = { pay: "PAYER", submit: "ENVOYER", getPlan: "OBTENIR MON PLAN", donate: "FAIRE UN DON", book: "RÉSERVER MAINTENANT", order: "COMMANDER MAINTENANT" }, De = { emailSuggestion: "Vouliez-vous dire {{email}}?", emailInvalid: "Votre adresse e-mail n’est pas valide", cardExpiryInvalid: "La date d'expiration de votre carte est dans le passé", cardExpiryFormat: "La date d’expiration de votre carte est incomplète", cardSecurityFormat: "Le code de sécurité de votre carte est incomplet", nameRequired: "Veuillez saisir le nom tel qu’il figure sur votre carte", cardNumberInvalid: "Votre numéro de carte est invalide", "invalid-checkout": "Échec de l'initialisation du checkout" }, Ve = {
|
|
706
706
|
email: Me,
|
|
707
707
|
cardholderNameLabel: Le,
|
|
708
708
|
cardInformation: Te,
|
|
709
709
|
cardholderNamePlaceholder: Ie,
|
|
710
710
|
cardExpiry: Ne,
|
|
711
|
-
loading:
|
|
711
|
+
loading: ze,
|
|
712
712
|
"pay-with-card": "ou payez avec une carte",
|
|
713
|
-
buttonTexts:
|
|
713
|
+
buttonTexts: Pe,
|
|
714
714
|
validation: De
|
|
715
|
-
}, Ae = "Email", $e = "Nome del titolare della carta", Re = "Informazioni sulla carta", Be = "Nome completo sulla carta", He = "MM / AA", Oe = "Non chiudere la finestra", Ke = { pay: "PAGA", submit: "INVIA", getPlan: "OTTIENI IL MIO PIANO", donate: "DONARE", book: "PRENOTA ORA", order: "ORDINA ORA" },
|
|
715
|
+
}, Ae = "Email", $e = "Nome del titolare della carta", Re = "Informazioni sulla carta", Be = "Nome completo sulla carta", He = "MM / AA", Oe = "Non chiudere la finestra", Ke = { pay: "PAGA", submit: "INVIA", getPlan: "OTTIENI IL MIO PIANO", donate: "DONARE", book: "PRENOTA ORA", order: "ORDINA ORA" }, je = { emailSuggestion: "Intendevi {{email}}?", emailInvalid: "La tua email non è corretta", cardExpiryInvalid: "La data di scadenza della tua carta è nel passato", cardExpiryFormat: "La data di scadenza della tua carta è incompleta", cardSecurityFormat: "Il codice di sicurezza della tua carta è incompleto", nameRequired: "Inserisci il nome come appare sulla tua carta", cardNumberInvalid: "Il numero della tua carta non è valido", "invalid-checkout": "Impossibile inizializzare il checkout" }, qe = {
|
|
716
716
|
email: Ae,
|
|
717
717
|
cardholderNameLabel: $e,
|
|
718
718
|
cardInformation: Re,
|
|
@@ -721,8 +721,8 @@ const ee = "E-Mail", te = "Name des/der Karteninhaber/in", ae = "Kartendaten", i
|
|
|
721
721
|
loading: Oe,
|
|
722
722
|
"pay-with-card": "o paga con carta",
|
|
723
723
|
buttonTexts: Ke,
|
|
724
|
-
validation:
|
|
725
|
-
}, Ue = "Adres e-mail", _e = "Imię i nazwisko posiadacza karty", Ge = "Informacje o karcie", Ye = "Imię i nazwisko na karcie", Ze = "MM / RR", Je = "Proszę nie zamykać tego okna", We = { pay: "ZAPŁAĆ", submit: "WYŚLIJ", getPlan: "POBIERZ MÓJ PLAN", donate: "PRZEKAŻ DAROWIZNĘ", book: "ZAREZERWUJ TERAZ", order: "ZAMÓW TERAZ" }, Xe = { emailSuggestion: "Czy chodziło Ci o {{email}}?", emailInvalid: "Państwa adres e-mail jest nieprawidłowy", cardExpiryInvalid: "Data ważności Państwa karty jest w przeszłości", cardExpiryFormat: "Data ważności Państwa karty jest niekompletna", cardSecurityFormat: "Kod zabezpieczający Państwa karty jest niekompletny", nameRequired: "Proszę wpisać imię i nazwisko tak, jak widnieje na karcie", cardNumberInvalid: "Numer Państwa karty jest nieprawidłowy" }, Qe = {
|
|
724
|
+
validation: je
|
|
725
|
+
}, Ue = "Adres e-mail", _e = "Imię i nazwisko posiadacza karty", Ge = "Informacje o karcie", Ye = "Imię i nazwisko na karcie", Ze = "MM / RR", Je = "Proszę nie zamykać tego okna", We = { pay: "ZAPŁAĆ", submit: "WYŚLIJ", getPlan: "POBIERZ MÓJ PLAN", donate: "PRZEKAŻ DAROWIZNĘ", book: "ZAREZERWUJ TERAZ", order: "ZAMÓW TERAZ" }, Xe = { emailSuggestion: "Czy chodziło Ci o {{email}}?", emailInvalid: "Państwa adres e-mail jest nieprawidłowy", cardExpiryInvalid: "Data ważności Państwa karty jest w przeszłości", cardExpiryFormat: "Data ważności Państwa karty jest niekompletna", cardSecurityFormat: "Kod zabezpieczający Państwa karty jest niekompletny", nameRequired: "Proszę wpisać imię i nazwisko tak, jak widnieje na karcie", cardNumberInvalid: "Numer Państwa karty jest nieprawidłowy", "invalid-checkout": "Nie udało się zainicjować procesu płatności" }, Qe = {
|
|
726
726
|
email: Ue,
|
|
727
727
|
cardholderNameLabel: _e,
|
|
728
728
|
cardInformation: Ge,
|
|
@@ -732,17 +732,17 @@ const ee = "E-Mail", te = "Name des/der Karteninhaber/in", ae = "Kartendaten", i
|
|
|
732
732
|
"pay-with-card": "albo zapłać kartą",
|
|
733
733
|
buttonTexts: We,
|
|
734
734
|
validation: Xe
|
|
735
|
-
}, et = "E-mail", tt = "Nome do titular do cartão",
|
|
735
|
+
}, et = "E-mail", tt = "Nome do titular do cartão", it = "Informações do cartão", at = "Nome completo no cartão", rt = "MM / AA", st = "Por favor, não feche esta janela", nt = { pay: "PAGAR", submit: "ENVIAR", getPlan: "OBTER MEU PLANO", donate: "DOAR", book: "RESERVAR AGORA", order: "FAZER PEDIDO" }, ot = { emailSuggestion: "Você quis dizer {{email}}?", emailInvalid: "O seu endereço de e-mail não é válido", cardExpiryInvalid: "A data de validade do seu cartão está no passado", cardExpiryFormat: "A data de validade do seu cartão está incompleta", cardSecurityFormat: "O código de segurança do seu cartão está incompleto", nameRequired: "Por favor, insira o nome conforme aparece no cartão", cardNumberInvalid: "O número do seu cartão é inválido", "invalid-checkout": "Falha ao inicializar o checkout" }, lt = {
|
|
736
736
|
email: et,
|
|
737
737
|
cardholderNameLabel: tt,
|
|
738
|
-
cardInformation:
|
|
739
|
-
cardholderNamePlaceholder:
|
|
738
|
+
cardInformation: it,
|
|
739
|
+
cardholderNamePlaceholder: at,
|
|
740
740
|
cardExpiry: rt,
|
|
741
741
|
loading: st,
|
|
742
742
|
"pay-with-card": "ou pagar com cartão",
|
|
743
743
|
buttonTexts: nt,
|
|
744
744
|
validation: ot
|
|
745
|
-
}, ct = "E-posta", dt = "Kart sahibinin adı", ht = "Kart bilgileri", mt = "Kart üzerindeki tam ad", ut = "AA / YY", pt = "Lütfen pencereyi kapatmayın", ft = { pay: "ÖDE", submit: "GÖNDER", getPlan: "PLANIMI AL", donate: "BAĞIŞ YAP", book: "ŞİMDİ REZERVASYON YAP", order: "ŞİMDİ SİPARİŞ VER" }, gt = { emailSuggestion: "{{email}} demek mi istediniz?", emailInvalid: "E-posta adresiniz geçerli değil", cardExpiryInvalid: "Kartınızın son kullanma tarihi geçmiş", cardExpiryFormat: "Kartınızın son kullanma tarihi eksik", cardSecurityFormat: "Kartınızın güvenlik kodu eksik", nameRequired: "Lütfen kart üzerindeki ismi girin", cardNumberInvalid: "Kart numaranız geçersiz" }, yt = {
|
|
745
|
+
}, ct = "E-posta", dt = "Kart sahibinin adı", ht = "Kart bilgileri", mt = "Kart üzerindeki tam ad", ut = "AA / YY", pt = "Lütfen pencereyi kapatmayın", ft = { pay: "ÖDE", submit: "GÖNDER", getPlan: "PLANIMI AL", donate: "BAĞIŞ YAP", book: "ŞİMDİ REZERVASYON YAP", order: "ŞİMDİ SİPARİŞ VER" }, gt = { emailSuggestion: "{{email}} demek mi istediniz?", emailInvalid: "E-posta adresiniz geçerli değil", cardExpiryInvalid: "Kartınızın son kullanma tarihi geçmiş", cardExpiryFormat: "Kartınızın son kullanma tarihi eksik", cardSecurityFormat: "Kartınızın güvenlik kodu eksik", nameRequired: "Lütfen kart üzerindeki ismi girin", cardNumberInvalid: "Kart numaranız geçersiz", "invalid-checkout": "Checkout başlatılamadı" }, yt = {
|
|
746
746
|
email: ct,
|
|
747
747
|
cardholderNameLabel: dt,
|
|
748
748
|
cardInformation: ht,
|
|
@@ -760,7 +760,7 @@ const ee = "E-Mail", te = "Name des/der Karteninhaber/in", ae = "Kartendaten", i
|
|
|
760
760
|
pl: Qe,
|
|
761
761
|
pt: lt,
|
|
762
762
|
tr: yt,
|
|
763
|
-
it:
|
|
763
|
+
it: qe
|
|
764
764
|
// Add other locales here
|
|
765
765
|
};
|
|
766
766
|
class vt {
|
|
@@ -776,28 +776,28 @@ class vt {
|
|
|
776
776
|
return this.locale;
|
|
777
777
|
}
|
|
778
778
|
translate(e, t) {
|
|
779
|
-
const
|
|
780
|
-
return !t ||
|
|
779
|
+
const i = this.getNestedTranslation(e);
|
|
780
|
+
return !t || i === e ? i : this.interpolate(i, t);
|
|
781
781
|
}
|
|
782
782
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
783
783
|
getNestedTranslation(e) {
|
|
784
|
-
const t = this.locale in V ? V[this.locale] : {},
|
|
785
|
-
return
|
|
784
|
+
const t = this.locale in V ? V[this.locale] : {}, i = this.findNestedValue(t, e);
|
|
785
|
+
return i === void 0 ? e : i;
|
|
786
786
|
}
|
|
787
787
|
findNestedValue(e, t) {
|
|
788
|
-
const
|
|
789
|
-
let
|
|
790
|
-
for (const r of
|
|
791
|
-
if (
|
|
788
|
+
const i = t.split(".");
|
|
789
|
+
let a = e;
|
|
790
|
+
for (const r of i) {
|
|
791
|
+
if (a == null || !Object.prototype.hasOwnProperty.call(a, r))
|
|
792
792
|
return;
|
|
793
|
-
|
|
793
|
+
a = a[r];
|
|
794
794
|
}
|
|
795
|
-
return typeof
|
|
795
|
+
return typeof a == "string" ? a : void 0;
|
|
796
796
|
}
|
|
797
797
|
interpolate(e, t) {
|
|
798
|
-
return e.replace(/{{(\w+)}}/g, (
|
|
799
|
-
const r = t[
|
|
800
|
-
return r === void 0 ?
|
|
798
|
+
return e.replace(/{{(\w+)}}/g, (i, a) => {
|
|
799
|
+
const r = t[a];
|
|
800
|
+
return r === void 0 ? i : String(r);
|
|
801
801
|
});
|
|
802
802
|
}
|
|
803
803
|
}
|
|
@@ -812,56 +812,56 @@ const A = [
|
|
|
812
812
|
"tr"
|
|
813
813
|
], Et = "en";
|
|
814
814
|
function Ct(o) {
|
|
815
|
-
const e = new vt(),
|
|
815
|
+
const e = new vt(), i = (() => {
|
|
816
816
|
const n = navigator?.language?.split("-")[0]?.toLowerCase();
|
|
817
817
|
return A.includes(n) ? n : Et;
|
|
818
818
|
})();
|
|
819
|
-
e.setLocale(
|
|
820
|
-
const
|
|
821
|
-
locale:
|
|
819
|
+
e.setLocale(i);
|
|
820
|
+
const a = T({
|
|
821
|
+
locale: i,
|
|
822
822
|
translationService: e
|
|
823
823
|
});
|
|
824
824
|
return {
|
|
825
|
-
store:
|
|
826
|
-
translate: (n, l) =>
|
|
825
|
+
store: a,
|
|
826
|
+
translate: (n, l) => a.getState().translationService.translate(n, l),
|
|
827
827
|
setLocale: (n) => {
|
|
828
|
-
A.includes(n) && (
|
|
828
|
+
A.includes(n) && (a.getState().translationService.setLocale(n), a.setState({ locale: n }));
|
|
829
829
|
},
|
|
830
|
-
getLocale: () =>
|
|
831
|
-
subscribe:
|
|
830
|
+
getLocale: () => a.getValue("locale"),
|
|
831
|
+
subscribe: a.subscribe.bind(a)
|
|
832
832
|
};
|
|
833
833
|
}
|
|
834
|
-
const bt = Ct(),
|
|
835
|
-
const { translate: o, getLocale: e, setLocale: t, subscribe:
|
|
834
|
+
const bt = Ct(), z = () => {
|
|
835
|
+
const { translate: o, getLocale: e, setLocale: t, subscribe: i } = bt;
|
|
836
836
|
return {
|
|
837
837
|
t: o,
|
|
838
838
|
translate: o,
|
|
839
839
|
locale: e(),
|
|
840
840
|
setLocale: t,
|
|
841
|
-
subscribe:
|
|
841
|
+
subscribe: i
|
|
842
842
|
};
|
|
843
843
|
}, St = ({ fontFamily: o }) => {
|
|
844
844
|
if (!o)
|
|
845
845
|
return { cleanup: () => {
|
|
846
846
|
} };
|
|
847
|
-
const e = o.replace(/\s+/g, "+"), t = `https://fonts.googleapis.com/css2?family=${e}:wght@400;700&display=swap`,
|
|
847
|
+
const e = o.replace(/\s+/g, "+"), t = `https://fonts.googleapis.com/css2?family=${e}:wght@400;700&display=swap`, i = [...document.head.querySelectorAll("link")].filter(
|
|
848
848
|
(n) => n.href.includes("fonts.googleapis.com/css2") && n.rel === "stylesheet"
|
|
849
|
-
),
|
|
850
|
-
|
|
851
|
-
const r =
|
|
849
|
+
), a = document.createElement("link");
|
|
850
|
+
a.rel = "stylesheet", a.href = t;
|
|
851
|
+
const r = i.find(
|
|
852
852
|
(n) => n.href.includes(`family=${e}`)
|
|
853
853
|
);
|
|
854
854
|
if (r)
|
|
855
855
|
r.href = t;
|
|
856
|
-
else if (
|
|
857
|
-
const n =
|
|
856
|
+
else if (i.length > 0) {
|
|
857
|
+
const n = i.at(
|
|
858
858
|
-1
|
|
859
859
|
);
|
|
860
|
-
n?.nextSibling ? document.head.insertBefore(
|
|
860
|
+
n?.nextSibling ? document.head.insertBefore(a, n.nextSibling) : document.head.appendChild(a);
|
|
861
861
|
} else
|
|
862
|
-
document.head.appendChild(
|
|
862
|
+
document.head.appendChild(a);
|
|
863
863
|
return { cleanup: () => {
|
|
864
|
-
document.head.contains(
|
|
864
|
+
document.head.contains(a) && document.head.removeChild(a);
|
|
865
865
|
} };
|
|
866
866
|
}, xt = ({
|
|
867
867
|
scriptSrc: o,
|
|
@@ -881,18 +881,18 @@ const bt = Ct(), P = () => {
|
|
|
881
881
|
},
|
|
882
882
|
isLoaded: Promise.resolve(!0)
|
|
883
883
|
};
|
|
884
|
-
const
|
|
885
|
-
|
|
886
|
-
const
|
|
887
|
-
|
|
884
|
+
const i = document.createElement("script");
|
|
885
|
+
i.src = o, i.async = e;
|
|
886
|
+
const a = new Promise((s, n) => {
|
|
887
|
+
i.onload = () => s(!0), i.onerror = () => {
|
|
888
888
|
console.error(`Failed to load script: ${o}`), n(new Error(`Failed to load script: ${o}`));
|
|
889
889
|
};
|
|
890
890
|
});
|
|
891
|
-
return document.head.appendChild(
|
|
891
|
+
return document.head.appendChild(i), {
|
|
892
892
|
cleanup: () => {
|
|
893
|
-
document.head.contains(
|
|
893
|
+
document.head.contains(i) && document.head.removeChild(i);
|
|
894
894
|
},
|
|
895
|
-
isLoaded:
|
|
895
|
+
isLoaded: a
|
|
896
896
|
};
|
|
897
897
|
};
|
|
898
898
|
class Ft {
|
|
@@ -940,24 +940,24 @@ class Ft {
|
|
|
940
940
|
*/
|
|
941
941
|
handleFieldFocus(e) {
|
|
942
942
|
const t = this.focusSequence.findIndex(
|
|
943
|
-
(
|
|
943
|
+
(i) => i === e
|
|
944
944
|
);
|
|
945
945
|
t >= 0 && (this.currentFocusIndex = t);
|
|
946
946
|
}
|
|
947
947
|
/**
|
|
948
948
|
* Update the validation state of fields based on form and iframe state
|
|
949
949
|
*/
|
|
950
|
-
handleStateUpdate(e, t,
|
|
950
|
+
handleStateUpdate(e, t, i, a) {
|
|
951
951
|
Object.assign(this.previousFieldValidState, this.fieldValidState);
|
|
952
|
-
const r = !!e.email && !t.email && !!
|
|
952
|
+
const r = !!e.email && !t.email && !!i.email;
|
|
953
953
|
this.fieldValidState.email = r;
|
|
954
|
-
const s = !!
|
|
954
|
+
const s = !!a.isCcValid;
|
|
955
955
|
this.fieldValidState.cardNumber = s;
|
|
956
|
-
const n = !!e.cardExpiry && !t.cardExpiry && !!
|
|
956
|
+
const n = !!e.cardExpiry && !t.cardExpiry && !!i.cardExpiry;
|
|
957
957
|
this.fieldValidState.cardExpiry = n;
|
|
958
|
-
const l = !!
|
|
958
|
+
const l = !!a.isCvvValid;
|
|
959
959
|
this.fieldValidState.cardCvv = l;
|
|
960
|
-
const c = !!e.name && !t.name && !!
|
|
960
|
+
const c = !!e.name && !t.name && !!i.name;
|
|
961
961
|
this.fieldValidState.name = c, this.checkForValidTransitions();
|
|
962
962
|
}
|
|
963
963
|
/**
|
|
@@ -1000,8 +1000,8 @@ class Ft {
|
|
|
1000
1000
|
}
|
|
1001
1001
|
}
|
|
1002
1002
|
const L = (o) => Object.entries(o).map(([e, t]) => {
|
|
1003
|
-
const
|
|
1004
|
-
return `${
|
|
1003
|
+
const i = e.replace(/([A-Z])/g, "-$1").toLowerCase(), a = typeof t == "number" ? `${t}px` : t;
|
|
1004
|
+
return `${i}: ${a}`;
|
|
1005
1005
|
}).join("; ");
|
|
1006
1006
|
function kt(o) {
|
|
1007
1007
|
if (!o)
|
|
@@ -1035,24 +1035,24 @@ function kt(o) {
|
|
|
1035
1035
|
color: "#717173",
|
|
1036
1036
|
opacity: "0.3",
|
|
1037
1037
|
fontFamily: `${o.styles.fontFamily}, sans-serif`
|
|
1038
|
-
}, a = {
|
|
1039
|
-
color: "#dc2727"
|
|
1040
1038
|
}, i = {
|
|
1039
|
+
color: "#dc2727"
|
|
1040
|
+
}, a = {
|
|
1041
1041
|
outline: "none"
|
|
1042
1042
|
}, r = {
|
|
1043
1043
|
fontFamily: `${o.styles.fontFamily}, sans-serif`
|
|
1044
1044
|
}, s = {
|
|
1045
1045
|
base: L(e),
|
|
1046
|
-
error: L(
|
|
1047
|
-
focus: L(
|
|
1046
|
+
error: L(i),
|
|
1047
|
+
focus: L(a),
|
|
1048
1048
|
placeholder: L(t)
|
|
1049
1049
|
};
|
|
1050
1050
|
return {
|
|
1051
1051
|
formContainerStyle: r,
|
|
1052
1052
|
baseStyles: e,
|
|
1053
1053
|
placeholderStyles: t,
|
|
1054
|
-
errorStyles:
|
|
1055
|
-
focusStyles:
|
|
1054
|
+
errorStyles: i,
|
|
1055
|
+
focusStyles: a,
|
|
1056
1056
|
inputStyles: s
|
|
1057
1057
|
};
|
|
1058
1058
|
}
|
|
@@ -1066,9 +1066,9 @@ class h {
|
|
|
1066
1066
|
* @param classNames Optional CSS class names to add
|
|
1067
1067
|
* @param attributes Optional attributes to set on the element
|
|
1068
1068
|
*/
|
|
1069
|
-
constructor(e, t = [],
|
|
1070
|
-
this.element = document.createElement(e), t.length > 0 && this.addClass(...t), Object.entries(
|
|
1071
|
-
this.setAttribute(
|
|
1069
|
+
constructor(e, t = [], i = {}) {
|
|
1070
|
+
this.element = document.createElement(e), t.length > 0 && this.addClass(...t), Object.entries(i).forEach(([a, r]) => {
|
|
1071
|
+
this.setAttribute(a, r);
|
|
1072
1072
|
});
|
|
1073
1073
|
}
|
|
1074
1074
|
/**
|
|
@@ -1123,14 +1123,14 @@ class h {
|
|
|
1123
1123
|
/**
|
|
1124
1124
|
* Add an event listener to the element
|
|
1125
1125
|
*/
|
|
1126
|
-
addEventListener(e, t,
|
|
1127
|
-
return this.element.addEventListener(e, t,
|
|
1126
|
+
addEventListener(e, t, i) {
|
|
1127
|
+
return this.element.addEventListener(e, t, i), this.eventListeners.push({ type: e, listener: t }), this;
|
|
1128
1128
|
}
|
|
1129
1129
|
/**
|
|
1130
1130
|
* Remove an event listener from the element
|
|
1131
1131
|
*/
|
|
1132
|
-
removeEventListener(e, t,
|
|
1133
|
-
return this.element.removeEventListener(e, t,
|
|
1132
|
+
removeEventListener(e, t, i) {
|
|
1133
|
+
return this.element.removeEventListener(e, t, i), this;
|
|
1134
1134
|
}
|
|
1135
1135
|
/**
|
|
1136
1136
|
* Hide this component
|
|
@@ -1169,27 +1169,27 @@ class m {
|
|
|
1169
1169
|
/**
|
|
1170
1170
|
* Create a button element
|
|
1171
1171
|
*/
|
|
1172
|
-
static createButton(e, t = [],
|
|
1173
|
-
const
|
|
1174
|
-
return
|
|
1172
|
+
static createButton(e, t = [], i = {}) {
|
|
1173
|
+
const a = new h("button", t, i);
|
|
1174
|
+
return a.setText(e), a;
|
|
1175
1175
|
}
|
|
1176
1176
|
/**
|
|
1177
1177
|
* Create an input element
|
|
1178
1178
|
*/
|
|
1179
|
-
static createInput(e, t = [],
|
|
1180
|
-
const
|
|
1181
|
-
return new h("input", t,
|
|
1179
|
+
static createInput(e, t = [], i = {}) {
|
|
1180
|
+
const a = { type: e, ...i };
|
|
1181
|
+
return new h("input", t, a);
|
|
1182
1182
|
}
|
|
1183
1183
|
/**
|
|
1184
1184
|
* Create a text input
|
|
1185
1185
|
*/
|
|
1186
|
-
static createTextInput(e = "", t = [],
|
|
1187
|
-
const
|
|
1186
|
+
static createTextInput(e = "", t = [], i = {}) {
|
|
1187
|
+
const a = {
|
|
1188
1188
|
type: "text",
|
|
1189
1189
|
placeholder: e,
|
|
1190
|
-
...
|
|
1190
|
+
...i
|
|
1191
1191
|
};
|
|
1192
|
-
return new h("input", t,
|
|
1192
|
+
return new h("input", t, a);
|
|
1193
1193
|
}
|
|
1194
1194
|
/**
|
|
1195
1195
|
* Create a form element
|
|
@@ -1200,26 +1200,26 @@ class m {
|
|
|
1200
1200
|
/**
|
|
1201
1201
|
* Create a label element
|
|
1202
1202
|
*/
|
|
1203
|
-
static createLabel(e, t = "",
|
|
1204
|
-
const r = t ? { for: t, ...
|
|
1203
|
+
static createLabel(e, t = "", i = [], a = {}) {
|
|
1204
|
+
const r = t ? { for: t, ...a } : a, s = new h("label", i, r);
|
|
1205
1205
|
return s.setText(e), s;
|
|
1206
1206
|
}
|
|
1207
1207
|
/**
|
|
1208
1208
|
* Create a select element
|
|
1209
1209
|
*/
|
|
1210
|
-
static createSelect(e, t = [],
|
|
1211
|
-
const
|
|
1210
|
+
static createSelect(e, t = [], i = {}) {
|
|
1211
|
+
const a = new h("select", t, i);
|
|
1212
1212
|
return e.forEach((r) => {
|
|
1213
1213
|
const s = document.createElement("option");
|
|
1214
|
-
s.value = r.value, s.textContent = r.text, r.selected && (s.selected = !0),
|
|
1215
|
-
}),
|
|
1214
|
+
s.value = r.value, s.textContent = r.text, r.selected && (s.selected = !0), a.getElement().appendChild(s);
|
|
1215
|
+
}), a;
|
|
1216
1216
|
}
|
|
1217
1217
|
/**
|
|
1218
1218
|
* Create an image element
|
|
1219
1219
|
*/
|
|
1220
|
-
static createImage(e, t = "",
|
|
1221
|
-
const r = { src: e, alt: t, ...
|
|
1222
|
-
return new h("img",
|
|
1220
|
+
static createImage(e, t = "", i = [], a = {}) {
|
|
1221
|
+
const r = { src: e, alt: t, ...a };
|
|
1222
|
+
return new h("img", i, r);
|
|
1223
1223
|
}
|
|
1224
1224
|
}
|
|
1225
1225
|
class wt extends h {
|
|
@@ -1229,10 +1229,10 @@ class wt extends h {
|
|
|
1229
1229
|
const t = m.createDiv(["error-alert"], {
|
|
1230
1230
|
role: "alert",
|
|
1231
1231
|
"aria-live": "polite"
|
|
1232
|
-
}),
|
|
1232
|
+
}), i = m.createDiv(["error-alert-content"]), a = m.createDiv([
|
|
1233
1233
|
"error-alert-icon-container"
|
|
1234
1234
|
]);
|
|
1235
|
-
|
|
1235
|
+
a.getElement().innerHTML = this.createAlertCircleSVG();
|
|
1236
1236
|
const r = m.createDiv([
|
|
1237
1237
|
"error-alert-text-container"
|
|
1238
1238
|
]), s = new h("h4", [
|
|
@@ -1240,7 +1240,7 @@ class wt extends h {
|
|
|
1240
1240
|
]);
|
|
1241
1241
|
s.setText("Checkout Error"), this.messageComponent = new h("p", [
|
|
1242
1242
|
"error-alert-message"
|
|
1243
|
-
]), this.messageComponent.setText(e.message || "Bad request"), r.appendChild(s), r.appendChild(this.messageComponent),
|
|
1243
|
+
]), this.messageComponent.setText(e.message || "Bad request"), r.appendChild(s), r.appendChild(this.messageComponent), i.appendChild(a), i.appendChild(r), t.appendChild(i), this.appendChild(t);
|
|
1244
1244
|
}
|
|
1245
1245
|
createAlertCircleSVG() {
|
|
1246
1246
|
return `
|
|
@@ -1282,27 +1282,27 @@ class Mt extends h {
|
|
|
1282
1282
|
createPaymentSeparatorSkeleton() {
|
|
1283
1283
|
const e = m.createDiv([
|
|
1284
1284
|
"payment-separator_container"
|
|
1285
|
-
]), t = m.createDiv(["payment-separator__line"]),
|
|
1285
|
+
]), t = m.createDiv(["payment-separator__line"]), i = m.createDiv([
|
|
1286
1286
|
"skeleton",
|
|
1287
1287
|
"skeleton-separator-text"
|
|
1288
|
-
]),
|
|
1289
|
-
return e.appendChild(t), e.appendChild(
|
|
1288
|
+
]), a = m.createDiv(["payment-separator__line"]);
|
|
1289
|
+
return e.appendChild(t), e.appendChild(i), e.appendChild(a), e;
|
|
1290
1290
|
}
|
|
1291
1291
|
createFieldSkeleton() {
|
|
1292
1292
|
const e = m.createDiv(["skeleton-field"]), t = m.createDiv(["skeleton", "skeleton-label"]);
|
|
1293
1293
|
e.appendChild(t);
|
|
1294
|
-
const
|
|
1295
|
-
return e.appendChild(
|
|
1294
|
+
const i = m.createDiv(["skeleton", "skeleton-input"]);
|
|
1295
|
+
return e.appendChild(i), e;
|
|
1296
1296
|
}
|
|
1297
1297
|
createCardRowSkeleton() {
|
|
1298
|
-
const e = m.createDiv(["skeleton-card-row"]), t = m.createDiv(["skeleton-field"]),
|
|
1298
|
+
const e = m.createDiv(["skeleton-card-row"]), t = m.createDiv(["skeleton-field"]), i = m.createDiv([
|
|
1299
1299
|
"skeleton",
|
|
1300
1300
|
"skeleton-label"
|
|
1301
|
-
]),
|
|
1301
|
+
]), a = m.createDiv([
|
|
1302
1302
|
"skeleton",
|
|
1303
1303
|
"skeleton-input"
|
|
1304
1304
|
]);
|
|
1305
|
-
t.appendChild(
|
|
1305
|
+
t.appendChild(i), t.appendChild(a);
|
|
1306
1306
|
const r = m.createDiv(["skeleton-field"]), s = m.createDiv(["skeleton", "skeleton-label"]), n = m.createDiv(["skeleton", "skeleton-input"]);
|
|
1307
1307
|
return r.appendChild(s), r.appendChild(n), e.appendChild(t), e.appendChild(r), e;
|
|
1308
1308
|
}
|
|
@@ -1351,12 +1351,12 @@ class Tt extends h {
|
|
|
1351
1351
|
t.style.fontFamily = "inherit", t.style.color = e.styles.color, t.style.fontSize = `${e.styles.fontSize}px`;
|
|
1352
1352
|
}
|
|
1353
1353
|
}
|
|
1354
|
-
class
|
|
1354
|
+
class P extends h {
|
|
1355
1355
|
inputElement;
|
|
1356
1356
|
helperText = null;
|
|
1357
1357
|
constructor(e) {
|
|
1358
1358
|
if (super("div", ["input-wrapper"]), e.label && e.styles) {
|
|
1359
|
-
const
|
|
1359
|
+
const i = new Tt({
|
|
1360
1360
|
styles: {
|
|
1361
1361
|
color: e.styles.color,
|
|
1362
1362
|
fontSize: e.styles.fontSize
|
|
@@ -1364,7 +1364,7 @@ class z extends h {
|
|
|
1364
1364
|
label: e.label,
|
|
1365
1365
|
id: e.name
|
|
1366
1366
|
});
|
|
1367
|
-
this.appendChild(
|
|
1367
|
+
this.appendChild(i);
|
|
1368
1368
|
}
|
|
1369
1369
|
const t = {
|
|
1370
1370
|
id: e.name,
|
|
@@ -1376,8 +1376,8 @@ class z extends h {
|
|
|
1376
1376
|
[],
|
|
1377
1377
|
t
|
|
1378
1378
|
), e.styles) {
|
|
1379
|
-
const
|
|
1380
|
-
|
|
1379
|
+
const i = this.inputElement.getElement();
|
|
1380
|
+
i.style.fontFamily = `"${e.styles.fontFamily}", sans-serif`, i.style.color = e.styles.color, i.style.fontSize = `${e.styles.fontSize}px`, i.style.borderRadius = e.styles.borderRadius;
|
|
1381
1381
|
}
|
|
1382
1382
|
e.onChange && this.inputElement.getElement().addEventListener("input", e.onChange), this.getElement().appendChild(this.inputElement.getElement()), e.error ? (this.helperText = new C({
|
|
1383
1383
|
text: e.errorMsg,
|
|
@@ -1391,11 +1391,11 @@ class z extends h {
|
|
|
1391
1391
|
return this.inputElement.getElement().value = e, this;
|
|
1392
1392
|
}
|
|
1393
1393
|
setError(e, t) {
|
|
1394
|
-
const
|
|
1395
|
-
return e ? (
|
|
1394
|
+
const i = this.inputElement.getElement();
|
|
1395
|
+
return e ? (i.classList.add("form-input-error"), !this.helperText && t ? (this.helperText = new C({ text: t }), this.appendChild(this.helperText)) : this.helperText && t ? this.helperText.setText(t).toggleVisibility(!0) : this.helperText && this.helperText.toggleVisibility(!0)) : (i.classList.remove("form-input-error"), this.helperText && this.helperText.toggleVisibility(!1)), this;
|
|
1396
1396
|
}
|
|
1397
|
-
addEventListener(e, t,
|
|
1398
|
-
return this.inputElement.getElement().addEventListener(e, t,
|
|
1397
|
+
addEventListener(e, t, i) {
|
|
1398
|
+
return this.inputElement.getElement().addEventListener(e, t, i), this;
|
|
1399
1399
|
}
|
|
1400
1400
|
/**
|
|
1401
1401
|
* Focus the input element
|
|
@@ -1409,15 +1409,15 @@ class It {
|
|
|
1409
1409
|
constructor(e) {
|
|
1410
1410
|
const {
|
|
1411
1411
|
value: t,
|
|
1412
|
-
onChange:
|
|
1413
|
-
onBlur:
|
|
1412
|
+
onChange: i,
|
|
1413
|
+
onBlur: a,
|
|
1414
1414
|
error: r,
|
|
1415
1415
|
errorMsg: s,
|
|
1416
1416
|
checkoutProfile: n,
|
|
1417
1417
|
translationFunc: l,
|
|
1418
1418
|
autocomplete: c = "cc-name"
|
|
1419
1419
|
} = e;
|
|
1420
|
-
this.input = new
|
|
1420
|
+
this.input = new P({
|
|
1421
1421
|
name: "name",
|
|
1422
1422
|
label: l("cardholderNameLabel"),
|
|
1423
1423
|
// Always hide error initially - we'll show it only on blur if needed
|
|
@@ -1433,10 +1433,10 @@ class It {
|
|
|
1433
1433
|
value: t,
|
|
1434
1434
|
autocomplete: c,
|
|
1435
1435
|
onChange: (d) => {
|
|
1436
|
-
this.input.setError(!1), this.trim(),
|
|
1436
|
+
this.input.setError(!1), this.trim(), i(d);
|
|
1437
1437
|
}
|
|
1438
1438
|
}), this.input.addEventListener("blur", (d) => {
|
|
1439
|
-
r && this.input.setError(r, s),
|
|
1439
|
+
r && this.input.setError(r, s), a(d);
|
|
1440
1440
|
});
|
|
1441
1441
|
}
|
|
1442
1442
|
getValue() {
|
|
@@ -1467,8 +1467,8 @@ class Nt extends h {
|
|
|
1467
1467
|
super("div", []);
|
|
1468
1468
|
const t = document.createElement("div");
|
|
1469
1469
|
t.className = e.isLoading ? "loading" : "", t.style.borderRadius = `0px 0px ${e.styles.borderRadius}px 0px`;
|
|
1470
|
-
const
|
|
1471
|
-
|
|
1470
|
+
const i = document.createElement("div");
|
|
1471
|
+
i.id = "card-cvv-element", i.className = `card-element ${e.isFocused ? "card-element-focus" : ""}`, i.style.zIndex = e.isFocused ? "2" : "0", t.appendChild(i), this.getElement().appendChild(t);
|
|
1472
1472
|
}
|
|
1473
1473
|
setFocused(e) {
|
|
1474
1474
|
const t = this.getElement().querySelector("#card-cvv-element");
|
|
@@ -1479,7 +1479,7 @@ class Nt extends h {
|
|
|
1479
1479
|
return t && (e ? t.classList.add("loading") : t.classList.remove("loading")), this;
|
|
1480
1480
|
}
|
|
1481
1481
|
}
|
|
1482
|
-
const Pt = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='iso-8859-1'?%3e%3c!--%20Uploaded%20to:%20SVG%20Repo,%20www.svgrepo.com,%20Generator:%20SVG%20Repo%20Mixer%20Tools%20--%3e%3csvg%20height='30px'%20width='30px'%20version='1.1'%20id='Capa_1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20viewBox='0%200%20512%20512'%20xml:space='preserve'%3e%3cpath%20style='fill:%23306FC5;'%20d='M512,402.281c0,16.716-13.55,30.267-30.265,30.267H30.265C13.55,432.549,0,418.997,0,402.281V109.717%20c0-16.715,13.55-30.266,30.265-30.266h451.47c16.716,0,30.265,13.551,30.265,30.266V402.281L512,402.281z'/%3e%3cpath%20style='opacity:0.15;fill:%23202121;enable-background:new%20;'%20d='M21.517,402.281V109.717%20c0-16.715,13.552-30.266,30.267-30.266h-21.52C13.55,79.451,0,93.001,0,109.717v292.565c0,16.716,13.55,30.267,30.265,30.267h21.52%20C35.07,432.549,21.517,418.997,21.517,402.281z'/%3e%3cg%3e%3cpolygon%20style='fill:%23FFFFFF;'%20points='74.59,220.748%2089.888,220.748%2082.241,201.278%20'/%3e%3cpolygon%20style='fill:%23FFFFFF;'%20points='155.946,286.107%20155.946,295.148%20181.675,295.148%20181.675,304.885%20155.946,304.885%20155.946,315.318%20184.455,315.318%20197.666,300.712%20185.151,286.107%20'/%3e%3cpolygon%20style='fill:%23FFFFFF;'%20points='356.898,201.278%20348.553,220.748%20364.548,220.748%20'/%3e%3cpolygon%20style='fill:%23FFFFFF;'%20points='230.348,320.875%20230.348,281.241%20212.268,300.712%20'/%3e%3cpath%20style='fill:%23FFFFFF;'%20d='M264.42,292.368c-0.696-4.172-3.48-6.261-7.654-6.261h-14.599v12.516h15.299%20C261.637,298.624,264.42,296.539,264.42,292.368z'/%3e%3cpath%20style='fill:%23FFFFFF;'%20d='M313.09,297.236c1.391-0.697,2.089-2.785,2.089-4.867c0.696-2.779-0.698-4.172-2.089-4.868%20c-1.387-0.696-3.476-0.696-5.559-0.696h-13.91v11.127h13.909C309.613,297.932,311.702,297.932,313.09,297.236z'/%3e%3cpath%20style='fill:%23FFFFFF;'%20d='M413.217,183.198v8.344l-4.169-8.344H376.37v8.344l-4.174-8.344h-44.502%20c-7.648,0-13.909,1.392-19.469,4.173v-4.173h-31.289v0.696v3.477c-3.476-2.78-7.648-4.173-13.211-4.173h-111.95l-7.652,17.384%20l-7.647-17.384h-25.031h-10.431v8.344l-3.477-8.344h-0.696H66.942l-13.909,32.68L37.042,251.34l-0.294,0.697h0.294h35.463h0.444%20l0.252-0.697l4.174-10.428h9.039l4.172,11.125h40.326v-0.697v-7.647l3.479,8.343h20.163l3.475-8.343v7.647v0.697h15.993h79.965%20h0.696v-18.08h1.394c1.389,0,1.389,0,1.389,2.087v15.297h50.065v-4.172c4.172,2.089,10.426,4.172,18.771,4.172h20.863l4.172-11.123%20h9.732l4.172,11.123h40.328v-6.952v-3.476l6.261,10.428h1.387h0.698h30.595v-68.143h-31.291l0,0H413.217z%20M177.501,241.609h-6.955%20h-4.171v-4.169v-34.076l-0.696,1.595v-0.019l-16.176,36.669h-0.512h-3.719h-6.017l-16.687-38.245v38.245h-23.64l-4.867-10.43%20H70.417l-4.868,10.43H53.326l20.57-48.675h17.382l19.469,46.587v-46.587h4.171h14.251l0.328,0.697h0.024l8.773,19.094l6.3,14.306%20l0.223-0.721l13.906-33.375H177.5v48.674H177.501L177.501,241.609z%20M225.481,203.364h-27.119v9.039h26.423v9.734h-26.423v9.738%20h27.119v10.427h-38.939v-49.367h38.939V203.364L225.481,203.364z%20M275.076,221.294c0.018,0.016,0.041,0.027,0.063,0.042%20c0.263,0.278,0.488,0.557,0.68,0.824c1.332,1.746,2.409,4.343,2.463,8.151c0.004,0.066,0.007,0.131,0.011,0.197%20c0,0.038,0.007,0.071,0.007,0.11c0,0.022-0.002,0.039-0.002,0.06c0.016,0.383,0.026,0.774,0.026,1.197v9.735h-10.428v-5.565%20c0-2.781,0-6.954-2.089-9.735c-0.657-0.657-1.322-1.09-2.046-1.398c-1.042-0.675-3.017-0.686-6.295-0.686h-12.52v17.384h-11.818%20v-48.675h26.425c6.254,0,10.428,0,13.906,2.086c3.407,2.046,5.465,5.439,5.543,10.812c-0.161,7.4-4.911,11.46-8.326,12.829%20C270.676,218.662,272.996,219.129,275.076,221.294z%20M298.491,241.609h-11.822v-48.675h11.822V241.609z%20M434.083,241.609h-15.3%20l-22.25-36.855v30.595l-0.073-0.072v6.362h-11.747v-0.029h-11.822l-4.172-10.43H344.38l-4.172,11.123h-13.211%20c-5.559,0-12.517-1.389-16.687-5.561c-4.172-4.172-6.256-9.735-6.256-18.773c0-6.953,1.389-13.911,6.256-19.472%20c3.474-4.175,9.735-5.562,17.382-5.562h11.128v10.429h-11.128c-4.172,0-6.254,0.693-9.041,2.783%20c-2.082,2.085-3.474,6.256-3.474,11.123c0,5.564,0.696,9.04,3.474,11.821c2.091,2.089,4.87,2.785,8.346,2.785h4.867l15.991-38.243%20h6.957h10.428l19.472,46.587v-2.376v-15.705v-1.389v-27.116h17.382l20.161,34.07v-34.07h11.826v47.977h0.002L434.083,241.609%20L434.083,241.609z'/%3e%3cpath%20style='fill:%23FFFFFF;'%20d='M265.161,213.207c0.203-0.217,0.387-0.463,0.543-0.745c0.63-0.997,1.352-2.793,0.963-5.244%20c-0.016-0.225-0.057-0.433-0.105-0.634c-0.013-0.056-0.011-0.105-0.026-0.161l-0.007,0.001c-0.346-1.191-1.229-1.923-2.11-2.367%20c-1.394-0.693-3.48-0.693-5.565-0.693h-13.909v11.127h13.909c2.085,0,4.172,0,5.565-0.697c0.209-0.106,0.395-0.25,0.574-0.413%20l0.002,0.009C264.996,213.389,265.067,213.315,265.161,213.207z'/%3e%3cpath%20style='fill:%23FFFFFF;'%20d='M475.105,311.144c0-4.867-1.389-9.736-3.474-13.212v-31.289h-0.032v-2.089c0,0-29.145,0-33.483,0%20c-4.336,0-9.598,4.171-9.598,4.171v-4.171h-31.984c-4.87,0-11.124,1.392-13.909,4.171v-4.171h-57.016v2.089v2.081%20c-4.169-3.474-11.824-4.171-15.298-4.171h-37.549v2.089v2.081c-3.476-3.474-11.824-4.171-15.998-4.171H215.05l-9.737,10.431%20l-9.04-10.431h-2.911h-4.737h-54.93v2.089v5.493v62.651h61.19l10.054-10.057l8.715,10.057h0.698h35.258h1.598h0.696h0.692v-6.953%20v-9.039h3.479c4.863,0,11.124,0,15.991-2.089v17.382v1.394h31.291v-1.394V317.4h1.387c2.089,0,2.089,0,2.089,2.086v14.6v1.394%20h94.563c6.263,0,12.517-1.394,15.993-4.175v2.781v1.394h29.902c6.254,0,12.517-0.695,16.689-3.478%20c6.402-3.841,10.437-10.64,11.037-18.749c0.028-0.24,0.063-0.48,0.085-0.721l-0.041-0.039%20C475.087,312.043,475.105,311.598,475.105,311.144z%20M256.076,306.973h-13.91v2.081v4.174v4.173v7.649h-22.855l-13.302-15.299%20l-0.046,0.051l-0.65-0.748l-15.297,15.996h-44.501v-48.673h45.197l12.348,13.525l2.596,2.832l0.352-0.365l14.604-15.991h36.852%20c7.152,0,15.161,1.765,18.196,9.042c0.365,1.441,0.577,3.043,0.577,4.863C276.237,304.189,266.502,306.973,256.076,306.973z%20M325.609,306.276c1.389,2.081,2.085,4.867,2.085,9.041v9.732h-11.819v-6.256c0-2.786,0-7.65-2.089-9.739%20c-1.387-2.081-4.172-2.081-8.341-2.081H292.93v18.077h-11.82v-49.369h26.421c5.559,0,10.426,0,13.909,2.084%20c3.474,2.088,6.254,5.565,6.254,11.128c0,7.647-4.865,11.819-8.343,13.212C322.829,303.49,324.914,304.885,325.609,306.276z%20M373.589,286.107h-27.122v9.04h26.424v9.737h-26.424v9.736h27.122v10.429H334.65V275.68h38.939V286.107z%20M402.791,325.05h-22.252%20v-10.429h22.252c2.082,0,3.476,0,4.87-1.392c0.696-0.697,1.387-2.085,1.387-3.477c0-1.394-0.691-2.778-1.387-3.475%20c-0.698-0.695-2.091-1.391-4.176-1.391c-11.126-0.696-24.337,0-24.337-15.296c0-6.954,4.172-14.604,16.689-14.604h22.945v11.819%20h-21.554c-2.085,0-3.478,0-4.87,0.696c-1.387,0.697-1.387,2.089-1.387,3.478c0,2.087,1.387,2.783,2.778,3.473%20c1.394,0.697,2.783,0.697,4.172,0.697h6.259c6.259,0,10.43,1.391,13.211,4.173c2.087,2.087,3.478,5.564,3.478,10.43%20C420.869,320.179,414.611,325.05,402.791,325.05z%20M462.59,320.179c-2.778,2.785-7.648,4.871-14.604,4.871H425.74v-10.429h22.245%20c2.087,0,3.481,0,4.87-1.392c0.693-0.697,1.391-2.085,1.391-3.477c0-1.394-0.698-2.778-1.391-3.475%20c-0.696-0.695-2.085-1.391-4.172-1.391c-11.122-0.696-24.337,0-24.337-15.295c0-6.609,3.781-12.579,13.106-14.352%20c1.115-0.154,2.293-0.253,3.583-0.253h22.948v11.819h-15.3h-5.561h-0.696c-2.087,0-3.476,0-4.865,0.696%20c-0.7,0.697-1.396,2.089-1.396,3.478c0,2.087,0.696,2.783,2.785,3.473c1.389,0.697,2.78,0.697,4.172,0.697h0.691h5.565%20c3.039,0,5.337,0.375,7.44,1.114c1.926,0.697,8.302,3.549,9.728,10.994c0.124,0.78,0.215,1.594,0.215,2.495%20C466.761,313.925,465.37,317.401,462.59,320.179z'/%3e%3c/g%3e%3c/svg%3e", zt = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='iso-8859-1'?%3e%3c!--%20Uploaded%20to:%20SVG%20Repo,%20www.svgrepo.com,%20Generator:%20SVG%20Repo%20Mixer%20Tools%20--%3e%3csvg%20height='30px'%20width='30px'%20version='1.1'%20id='Capa_1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20viewBox='0%200%20512%20512'%20xml:space='preserve'%3e%3cpath%20style='fill:%2334495E;'%20d='M512,402.282c0,16.716-13.55,30.267-30.265,30.267H30.265C13.55,432.549,0,418.996,0,402.282V109.717%20c0-16.716,13.55-30.266,30.265-30.266h451.469c16.716,0,30.265,13.551,30.265,30.266L512,402.282L512,402.282z'/%3e%3cpath%20style='opacity:0.15;fill:%23202121;enable-background:new%20;'%20d='M21.517,402.282V109.717%20c0-16.716,13.552-30.266,30.267-30.266h-21.52C13.55,79.451,0,93.003,0,109.717v292.565c0,16.716,13.55,30.267,30.265,30.267h21.52%20C35.07,432.549,21.517,418.996,21.517,402.282z'/%3e%3cpath%20style='fill:%23F26E21;'%20d='M309.389,255.801c0.041-9.636-3.572-19.286-10.843-26.558c-7.287-7.287-16.961-10.897-26.617-10.839%20c-0.046,0-0.091-0.003-0.139-0.003c-20.968,0-37.6,16.628-37.6,37.602c0,20.767,16.837,37.599,37.6,37.599%20c20.974,0,37.604-16.631,37.604-37.599C309.394,255.934,309.389,255.869,309.389,255.801z'/%3e%3cg%3e%3cpath%20style='fill:%23E7E8E3;'%20d='M227.198,271.909c-5.62,5.626-10.807,7.824-16.394,7.943c-13.611-0.122-23.618-10.202-23.618-24.573%20c0-7.234,2.739-13.163,7.078-18.228l0,0c4.069-3.863,9.311-6.359,15.339-6.359c6.507,0,11.571,2.169,17.352,7.954v-16.631%20c-5.78-2.891-10.846-4.338-17.352-4.338c-9.192,0.657-17.859,4.371-24.507,10.203l0,0c-1.916,1.724-3.752,3.627-5.309,5.805%20c-4.856,6.294-7.791,14.001-7.791,22.32c0,20.967,16.637,36.875,37.606,36.875c0.102,0,0.203-0.009,0.302-0.01%20c0.141,0.002,0.28,0.01,0.42,0.01c5.784,0,10.85-1.443,17.357-4.336L227.198,271.909c-0.244,0.244,0.242,0.471,0,0.702V271.909z'/%3e%3cpolygon%20style='fill:%23E7E8E3;'%20points='356.863,228.033%20356.863,228.033%20340.487,268.295%20321.685,220.566%20306.502,220.566%20336.148,293.601%20344.102,293.601%20375.196,220.566%20360.013,220.566%20'/%3e%3cpolygon%20style='fill:%23E7E8E3;'%20points='380.983,252.384%20380.983,291.435%20420.033,291.435%20420.753,291.435%20420.753,279.861%20408.461,279.861%20395.445,279.861%20395.445,266.848%20395.445,260.342%20420.033,260.342%20420.033,248.045%20395.445,248.045%20395.445,232.861%20420.753,232.861%20420.753,220.566%20380.983,220.566%20'/%3e%3cpath%20style='fill:%23E7E8E3;'%20d='M54.135,220.566H33.884v70.869h20.25c10.845,0,18.798-2.895,25.306-7.957%20c7.953-6.508,13.017-16.629,13.017-27.474C92.458,235.028,77.27,220.566,54.135,220.566z%20M70.765,274.08%20c-4.339,3.614-10.124,5.781-18.802,5.781h-4.339V232.86h3.615c8.678,0,14.463,1.446,18.803,5.783%20c5.061,4.336,7.955,10.848,7.955,17.358C78.72,262.509,75.828,269.737,70.765,274.08z'/%3e%3crect%20x='98.97'%20y='220.56'%20style='fill:%23E7E8E3;'%20width='13.739'%20height='70.867'/%3e%3cpath%20style='fill:%23E7E8E3;'%20d='M147.415,248.045c-8.676-2.892-10.848-5.063-10.848-8.677c0-4.339,4.339-7.954,10.124-7.954%20c4.339,0,7.954,1.447,11.57,5.786l7.233-9.4c-5.787-5.064-13.015-7.953-20.97-7.953c-12.296,0-22.42,8.678-22.42,20.244%20c0,10.126,4.343,14.464,17.357,19.526c5.785,2.166,7.955,2.892,9.404,4.338c2.887,1.444,4.336,4.339,4.336,7.228%20c0,5.786-4.336,10.126-10.848,10.126c-6.514,0-12.294-3.615-15.187-9.401l-8.678,8.678c6.511,9.4,14.465,13.738,24.589,13.738%20c14.461,0,24.58-9.4,24.58-23.141C167.659,258.893,163.324,253.831,147.415,248.045z'/%3e%3cpath%20style='fill:%23E7E8E3;'%20d='M459.804,261.783c10.843-2.166,16.63-9.4,16.63-20.244c0-13.014-9.402-20.973-25.308-20.973h-20.972%20v70.869h13.739V263.23h2.172l19.519,28.205h16.634L459.804,261.783z%20M448.23,253.105h-4.336v-21.691h4.336%20c8.678,0,13.742,3.614,13.742,10.85C461.972,249.492,456.909,253.105,448.23,253.105z'/%3e%3c/g%3e%3c/svg%3e", Dt = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='iso-8859-1'?%3e%3c!--%20Uploaded%20to:%20SVG%20Repo,%20www.svgrepo.com,%20Generator:%20SVG%20Repo%20Mixer%20Tools%20--%3e%3csvg%20height='800px'%20width='800px'%20version='1.1'%20id='Layer_1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20viewBox='0%200%20291.791%20291.791'%20xml:space='preserve'%3e%3cg%3e%3cpath%20style='fill:%23E2574C;'%20d='M182.298,145.895c0,50.366-40.801,91.176-91.149,91.176S0,196.252,0,145.895%20s40.811-91.176,91.149-91.176S182.298,95.538,182.298,145.895z'/%3e%3cpath%20style='fill:%23F4B459;'%20d='M200.616,54.719c-20.442,0-39.261,6.811-54.469,18.181l0.073,0.009%20c2.991,2.89,6.291,4.924,8.835,8.251l-18.965,0.301c-2.972,3-5.68,6.264-8.233,9.656H161.3c2.544,3.054,4.896,5.708,7.03,9.081%20h-46.536c-1.705,2.936-3.282,5.954-4.659,9.09h56.493c1.477,3.127,2.799,5.489,3.921,8.799h-63.76%20c-1.012,3.146-1.878,6.364-2.535,9.646h68.966c0.675,3.155,1.194,6.072,1.55,9.045h-71.884c-0.301,3-0.456,6.045-0.456,9.118%20h72.859c0,3.228-0.228,6.218-0.556,9.118h-71.847c0.31,3.091,0.766,6.127,1.368,9.118h68.856c-0.711,2.954-1.532,5.926-2.562,9.008%20h-63.969c0.966,3.118,2.143,6.145,3.428,9.099h56.621c-1.568,3.319-3.346,5.972-5.306,9.081h-46.691%20c1.842,3.191,3.875,6.236,6.081,9.154l33.589,0.501c-2.863,3.437-6.537,5.507-9.884,8.516c0.182,0.146-5.352-0.018-16.248-0.191%20c16.576,17.105,39.744,27.772,65.446,27.772c50.357,0,91.176-40.82,91.176-91.176S250.981,54.719,200.616,54.719z'/%3e%3c/g%3e%3c/svg%3e", Vt = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='utf-8'?%3e%3c!--%20Uploaded%20to:%20SVG%20Repo,%20www.svgrepo.com,%20Generator:%20SVG%20Repo%20Mixer%20Tools%20--%3e%3csvg%20width='800px'%20height='800px'%20viewBox='0%20-140%20780%20780'%20enable-background='new%200%200%20780%20500'%20version='1.1'%20xml:space='preserve'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M40,0h700c22.092,0,40,17.909,40,40v420c0,22.092-17.908,40-40,40H40c-22.091,0-40-17.908-40-40V40%20C0,17.909,17.909,0,40,0z'%20fill='%230E4595'/%3e%3cpath%20d='m293.2%20348.73l33.361-195.76h53.36l-33.385%20195.76h-53.336zm246.11-191.54c-10.57-3.966-27.137-8.222-47.822-8.222-52.725%200-89.865%2026.55-90.18%2064.603-0.299%2028.13%2026.514%2043.822%2046.752%2053.186%2020.771%209.595%2027.752%2015.714%2027.654%2024.283-0.131%2013.121-16.586%2019.116-31.922%2019.116-21.357%200-32.703-2.967-50.227-10.276l-6.876-3.11-7.489%2043.823c12.463%205.464%2035.51%2010.198%2059.438%2010.443%2056.09%200%2092.5-26.246%2092.916-66.882%200.199-22.269-14.016-39.216-44.801-53.188-18.65-9.055-30.072-15.099-29.951-24.268%200-8.137%209.668-16.839%2030.557-16.839%2017.449-0.27%2030.09%203.535%2039.938%207.5l4.781%202.26%207.232-42.429m137.31-4.223h-41.232c-12.773%200-22.332%203.487-27.941%2016.234l-79.244%20179.4h56.031s9.16-24.123%2011.232-29.418c6.125%200%2060.555%200.084%2068.338%200.084%201.596%206.853%206.49%2029.334%206.49%2029.334h49.514l-43.188-195.64zm-65.418%20126.41c4.412-11.279%2021.26-54.723%2021.26-54.723-0.316%200.522%204.379-11.334%207.074-18.684l3.605%2016.879s10.219%2046.729%2012.354%2056.528h-44.293zm-363.3-126.41l-52.24%20133.5-5.567-27.13c-9.725-31.273-40.025-65.155-73.898-82.118l47.766%20171.2%2056.456-0.064%2084.004-195.39h-56.521'%20fill='%23ffffff'/%3e%3cpath%20d='m146.92%20152.96h-86.041l-0.681%204.073c66.938%2016.204%20111.23%2055.363%20129.62%20102.41l-18.71-89.96c-3.23-12.395-12.597-16.094-24.186-16.527'%20fill='%23F2AE14'/%3e%3c/svg%3e", M = [
|
|
1482
|
+
const zt = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='iso-8859-1'?%3e%3c!--%20Uploaded%20to:%20SVG%20Repo,%20www.svgrepo.com,%20Generator:%20SVG%20Repo%20Mixer%20Tools%20--%3e%3csvg%20height='30px'%20width='30px'%20version='1.1'%20id='Capa_1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20viewBox='0%200%20512%20512'%20xml:space='preserve'%3e%3cpath%20style='fill:%23306FC5;'%20d='M512,402.281c0,16.716-13.55,30.267-30.265,30.267H30.265C13.55,432.549,0,418.997,0,402.281V109.717%20c0-16.715,13.55-30.266,30.265-30.266h451.47c16.716,0,30.265,13.551,30.265,30.266V402.281L512,402.281z'/%3e%3cpath%20style='opacity:0.15;fill:%23202121;enable-background:new%20;'%20d='M21.517,402.281V109.717%20c0-16.715,13.552-30.266,30.267-30.266h-21.52C13.55,79.451,0,93.001,0,109.717v292.565c0,16.716,13.55,30.267,30.265,30.267h21.52%20C35.07,432.549,21.517,418.997,21.517,402.281z'/%3e%3cg%3e%3cpolygon%20style='fill:%23FFFFFF;'%20points='74.59,220.748%2089.888,220.748%2082.241,201.278%20'/%3e%3cpolygon%20style='fill:%23FFFFFF;'%20points='155.946,286.107%20155.946,295.148%20181.675,295.148%20181.675,304.885%20155.946,304.885%20155.946,315.318%20184.455,315.318%20197.666,300.712%20185.151,286.107%20'/%3e%3cpolygon%20style='fill:%23FFFFFF;'%20points='356.898,201.278%20348.553,220.748%20364.548,220.748%20'/%3e%3cpolygon%20style='fill:%23FFFFFF;'%20points='230.348,320.875%20230.348,281.241%20212.268,300.712%20'/%3e%3cpath%20style='fill:%23FFFFFF;'%20d='M264.42,292.368c-0.696-4.172-3.48-6.261-7.654-6.261h-14.599v12.516h15.299%20C261.637,298.624,264.42,296.539,264.42,292.368z'/%3e%3cpath%20style='fill:%23FFFFFF;'%20d='M313.09,297.236c1.391-0.697,2.089-2.785,2.089-4.867c0.696-2.779-0.698-4.172-2.089-4.868%20c-1.387-0.696-3.476-0.696-5.559-0.696h-13.91v11.127h13.909C309.613,297.932,311.702,297.932,313.09,297.236z'/%3e%3cpath%20style='fill:%23FFFFFF;'%20d='M413.217,183.198v8.344l-4.169-8.344H376.37v8.344l-4.174-8.344h-44.502%20c-7.648,0-13.909,1.392-19.469,4.173v-4.173h-31.289v0.696v3.477c-3.476-2.78-7.648-4.173-13.211-4.173h-111.95l-7.652,17.384%20l-7.647-17.384h-25.031h-10.431v8.344l-3.477-8.344h-0.696H66.942l-13.909,32.68L37.042,251.34l-0.294,0.697h0.294h35.463h0.444%20l0.252-0.697l4.174-10.428h9.039l4.172,11.125h40.326v-0.697v-7.647l3.479,8.343h20.163l3.475-8.343v7.647v0.697h15.993h79.965%20h0.696v-18.08h1.394c1.389,0,1.389,0,1.389,2.087v15.297h50.065v-4.172c4.172,2.089,10.426,4.172,18.771,4.172h20.863l4.172-11.123%20h9.732l4.172,11.123h40.328v-6.952v-3.476l6.261,10.428h1.387h0.698h30.595v-68.143h-31.291l0,0H413.217z%20M177.501,241.609h-6.955%20h-4.171v-4.169v-34.076l-0.696,1.595v-0.019l-16.176,36.669h-0.512h-3.719h-6.017l-16.687-38.245v38.245h-23.64l-4.867-10.43%20H70.417l-4.868,10.43H53.326l20.57-48.675h17.382l19.469,46.587v-46.587h4.171h14.251l0.328,0.697h0.024l8.773,19.094l6.3,14.306%20l0.223-0.721l13.906-33.375H177.5v48.674H177.501L177.501,241.609z%20M225.481,203.364h-27.119v9.039h26.423v9.734h-26.423v9.738%20h27.119v10.427h-38.939v-49.367h38.939V203.364L225.481,203.364z%20M275.076,221.294c0.018,0.016,0.041,0.027,0.063,0.042%20c0.263,0.278,0.488,0.557,0.68,0.824c1.332,1.746,2.409,4.343,2.463,8.151c0.004,0.066,0.007,0.131,0.011,0.197%20c0,0.038,0.007,0.071,0.007,0.11c0,0.022-0.002,0.039-0.002,0.06c0.016,0.383,0.026,0.774,0.026,1.197v9.735h-10.428v-5.565%20c0-2.781,0-6.954-2.089-9.735c-0.657-0.657-1.322-1.09-2.046-1.398c-1.042-0.675-3.017-0.686-6.295-0.686h-12.52v17.384h-11.818%20v-48.675h26.425c6.254,0,10.428,0,13.906,2.086c3.407,2.046,5.465,5.439,5.543,10.812c-0.161,7.4-4.911,11.46-8.326,12.829%20C270.676,218.662,272.996,219.129,275.076,221.294z%20M298.491,241.609h-11.822v-48.675h11.822V241.609z%20M434.083,241.609h-15.3%20l-22.25-36.855v30.595l-0.073-0.072v6.362h-11.747v-0.029h-11.822l-4.172-10.43H344.38l-4.172,11.123h-13.211%20c-5.559,0-12.517-1.389-16.687-5.561c-4.172-4.172-6.256-9.735-6.256-18.773c0-6.953,1.389-13.911,6.256-19.472%20c3.474-4.175,9.735-5.562,17.382-5.562h11.128v10.429h-11.128c-4.172,0-6.254,0.693-9.041,2.783%20c-2.082,2.085-3.474,6.256-3.474,11.123c0,5.564,0.696,9.04,3.474,11.821c2.091,2.089,4.87,2.785,8.346,2.785h4.867l15.991-38.243%20h6.957h10.428l19.472,46.587v-2.376v-15.705v-1.389v-27.116h17.382l20.161,34.07v-34.07h11.826v47.977h0.002L434.083,241.609%20L434.083,241.609z'/%3e%3cpath%20style='fill:%23FFFFFF;'%20d='M265.161,213.207c0.203-0.217,0.387-0.463,0.543-0.745c0.63-0.997,1.352-2.793,0.963-5.244%20c-0.016-0.225-0.057-0.433-0.105-0.634c-0.013-0.056-0.011-0.105-0.026-0.161l-0.007,0.001c-0.346-1.191-1.229-1.923-2.11-2.367%20c-1.394-0.693-3.48-0.693-5.565-0.693h-13.909v11.127h13.909c2.085,0,4.172,0,5.565-0.697c0.209-0.106,0.395-0.25,0.574-0.413%20l0.002,0.009C264.996,213.389,265.067,213.315,265.161,213.207z'/%3e%3cpath%20style='fill:%23FFFFFF;'%20d='M475.105,311.144c0-4.867-1.389-9.736-3.474-13.212v-31.289h-0.032v-2.089c0,0-29.145,0-33.483,0%20c-4.336,0-9.598,4.171-9.598,4.171v-4.171h-31.984c-4.87,0-11.124,1.392-13.909,4.171v-4.171h-57.016v2.089v2.081%20c-4.169-3.474-11.824-4.171-15.298-4.171h-37.549v2.089v2.081c-3.476-3.474-11.824-4.171-15.998-4.171H215.05l-9.737,10.431%20l-9.04-10.431h-2.911h-4.737h-54.93v2.089v5.493v62.651h61.19l10.054-10.057l8.715,10.057h0.698h35.258h1.598h0.696h0.692v-6.953%20v-9.039h3.479c4.863,0,11.124,0,15.991-2.089v17.382v1.394h31.291v-1.394V317.4h1.387c2.089,0,2.089,0,2.089,2.086v14.6v1.394%20h94.563c6.263,0,12.517-1.394,15.993-4.175v2.781v1.394h29.902c6.254,0,12.517-0.695,16.689-3.478%20c6.402-3.841,10.437-10.64,11.037-18.749c0.028-0.24,0.063-0.48,0.085-0.721l-0.041-0.039%20C475.087,312.043,475.105,311.598,475.105,311.144z%20M256.076,306.973h-13.91v2.081v4.174v4.173v7.649h-22.855l-13.302-15.299%20l-0.046,0.051l-0.65-0.748l-15.297,15.996h-44.501v-48.673h45.197l12.348,13.525l2.596,2.832l0.352-0.365l14.604-15.991h36.852%20c7.152,0,15.161,1.765,18.196,9.042c0.365,1.441,0.577,3.043,0.577,4.863C276.237,304.189,266.502,306.973,256.076,306.973z%20M325.609,306.276c1.389,2.081,2.085,4.867,2.085,9.041v9.732h-11.819v-6.256c0-2.786,0-7.65-2.089-9.739%20c-1.387-2.081-4.172-2.081-8.341-2.081H292.93v18.077h-11.82v-49.369h26.421c5.559,0,10.426,0,13.909,2.084%20c3.474,2.088,6.254,5.565,6.254,11.128c0,7.647-4.865,11.819-8.343,13.212C322.829,303.49,324.914,304.885,325.609,306.276z%20M373.589,286.107h-27.122v9.04h26.424v9.737h-26.424v9.736h27.122v10.429H334.65V275.68h38.939V286.107z%20M402.791,325.05h-22.252%20v-10.429h22.252c2.082,0,3.476,0,4.87-1.392c0.696-0.697,1.387-2.085,1.387-3.477c0-1.394-0.691-2.778-1.387-3.475%20c-0.698-0.695-2.091-1.391-4.176-1.391c-11.126-0.696-24.337,0-24.337-15.296c0-6.954,4.172-14.604,16.689-14.604h22.945v11.819%20h-21.554c-2.085,0-3.478,0-4.87,0.696c-1.387,0.697-1.387,2.089-1.387,3.478c0,2.087,1.387,2.783,2.778,3.473%20c1.394,0.697,2.783,0.697,4.172,0.697h6.259c6.259,0,10.43,1.391,13.211,4.173c2.087,2.087,3.478,5.564,3.478,10.43%20C420.869,320.179,414.611,325.05,402.791,325.05z%20M462.59,320.179c-2.778,2.785-7.648,4.871-14.604,4.871H425.74v-10.429h22.245%20c2.087,0,3.481,0,4.87-1.392c0.693-0.697,1.391-2.085,1.391-3.477c0-1.394-0.698-2.778-1.391-3.475%20c-0.696-0.695-2.085-1.391-4.172-1.391c-11.122-0.696-24.337,0-24.337-15.295c0-6.609,3.781-12.579,13.106-14.352%20c1.115-0.154,2.293-0.253,3.583-0.253h22.948v11.819h-15.3h-5.561h-0.696c-2.087,0-3.476,0-4.865,0.696%20c-0.7,0.697-1.396,2.089-1.396,3.478c0,2.087,0.696,2.783,2.785,3.473c1.389,0.697,2.78,0.697,4.172,0.697h0.691h5.565%20c3.039,0,5.337,0.375,7.44,1.114c1.926,0.697,8.302,3.549,9.728,10.994c0.124,0.78,0.215,1.594,0.215,2.495%20C466.761,313.925,465.37,317.401,462.59,320.179z'/%3e%3c/g%3e%3c/svg%3e", Pt = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='iso-8859-1'?%3e%3c!--%20Uploaded%20to:%20SVG%20Repo,%20www.svgrepo.com,%20Generator:%20SVG%20Repo%20Mixer%20Tools%20--%3e%3csvg%20height='30px'%20width='30px'%20version='1.1'%20id='Capa_1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20viewBox='0%200%20512%20512'%20xml:space='preserve'%3e%3cpath%20style='fill:%2334495E;'%20d='M512,402.282c0,16.716-13.55,30.267-30.265,30.267H30.265C13.55,432.549,0,418.996,0,402.282V109.717%20c0-16.716,13.55-30.266,30.265-30.266h451.469c16.716,0,30.265,13.551,30.265,30.266L512,402.282L512,402.282z'/%3e%3cpath%20style='opacity:0.15;fill:%23202121;enable-background:new%20;'%20d='M21.517,402.282V109.717%20c0-16.716,13.552-30.266,30.267-30.266h-21.52C13.55,79.451,0,93.003,0,109.717v292.565c0,16.716,13.55,30.267,30.265,30.267h21.52%20C35.07,432.549,21.517,418.996,21.517,402.282z'/%3e%3cpath%20style='fill:%23F26E21;'%20d='M309.389,255.801c0.041-9.636-3.572-19.286-10.843-26.558c-7.287-7.287-16.961-10.897-26.617-10.839%20c-0.046,0-0.091-0.003-0.139-0.003c-20.968,0-37.6,16.628-37.6,37.602c0,20.767,16.837,37.599,37.6,37.599%20c20.974,0,37.604-16.631,37.604-37.599C309.394,255.934,309.389,255.869,309.389,255.801z'/%3e%3cg%3e%3cpath%20style='fill:%23E7E8E3;'%20d='M227.198,271.909c-5.62,5.626-10.807,7.824-16.394,7.943c-13.611-0.122-23.618-10.202-23.618-24.573%20c0-7.234,2.739-13.163,7.078-18.228l0,0c4.069-3.863,9.311-6.359,15.339-6.359c6.507,0,11.571,2.169,17.352,7.954v-16.631%20c-5.78-2.891-10.846-4.338-17.352-4.338c-9.192,0.657-17.859,4.371-24.507,10.203l0,0c-1.916,1.724-3.752,3.627-5.309,5.805%20c-4.856,6.294-7.791,14.001-7.791,22.32c0,20.967,16.637,36.875,37.606,36.875c0.102,0,0.203-0.009,0.302-0.01%20c0.141,0.002,0.28,0.01,0.42,0.01c5.784,0,10.85-1.443,17.357-4.336L227.198,271.909c-0.244,0.244,0.242,0.471,0,0.702V271.909z'/%3e%3cpolygon%20style='fill:%23E7E8E3;'%20points='356.863,228.033%20356.863,228.033%20340.487,268.295%20321.685,220.566%20306.502,220.566%20336.148,293.601%20344.102,293.601%20375.196,220.566%20360.013,220.566%20'/%3e%3cpolygon%20style='fill:%23E7E8E3;'%20points='380.983,252.384%20380.983,291.435%20420.033,291.435%20420.753,291.435%20420.753,279.861%20408.461,279.861%20395.445,279.861%20395.445,266.848%20395.445,260.342%20420.033,260.342%20420.033,248.045%20395.445,248.045%20395.445,232.861%20420.753,232.861%20420.753,220.566%20380.983,220.566%20'/%3e%3cpath%20style='fill:%23E7E8E3;'%20d='M54.135,220.566H33.884v70.869h20.25c10.845,0,18.798-2.895,25.306-7.957%20c7.953-6.508,13.017-16.629,13.017-27.474C92.458,235.028,77.27,220.566,54.135,220.566z%20M70.765,274.08%20c-4.339,3.614-10.124,5.781-18.802,5.781h-4.339V232.86h3.615c8.678,0,14.463,1.446,18.803,5.783%20c5.061,4.336,7.955,10.848,7.955,17.358C78.72,262.509,75.828,269.737,70.765,274.08z'/%3e%3crect%20x='98.97'%20y='220.56'%20style='fill:%23E7E8E3;'%20width='13.739'%20height='70.867'/%3e%3cpath%20style='fill:%23E7E8E3;'%20d='M147.415,248.045c-8.676-2.892-10.848-5.063-10.848-8.677c0-4.339,4.339-7.954,10.124-7.954%20c4.339,0,7.954,1.447,11.57,5.786l7.233-9.4c-5.787-5.064-13.015-7.953-20.97-7.953c-12.296,0-22.42,8.678-22.42,20.244%20c0,10.126,4.343,14.464,17.357,19.526c5.785,2.166,7.955,2.892,9.404,4.338c2.887,1.444,4.336,4.339,4.336,7.228%20c0,5.786-4.336,10.126-10.848,10.126c-6.514,0-12.294-3.615-15.187-9.401l-8.678,8.678c6.511,9.4,14.465,13.738,24.589,13.738%20c14.461,0,24.58-9.4,24.58-23.141C167.659,258.893,163.324,253.831,147.415,248.045z'/%3e%3cpath%20style='fill:%23E7E8E3;'%20d='M459.804,261.783c10.843-2.166,16.63-9.4,16.63-20.244c0-13.014-9.402-20.973-25.308-20.973h-20.972%20v70.869h13.739V263.23h2.172l19.519,28.205h16.634L459.804,261.783z%20M448.23,253.105h-4.336v-21.691h4.336%20c8.678,0,13.742,3.614,13.742,10.85C461.972,249.492,456.909,253.105,448.23,253.105z'/%3e%3c/g%3e%3c/svg%3e", Dt = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='iso-8859-1'?%3e%3c!--%20Uploaded%20to:%20SVG%20Repo,%20www.svgrepo.com,%20Generator:%20SVG%20Repo%20Mixer%20Tools%20--%3e%3csvg%20height='800px'%20width='800px'%20version='1.1'%20id='Layer_1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20viewBox='0%200%20291.791%20291.791'%20xml:space='preserve'%3e%3cg%3e%3cpath%20style='fill:%23E2574C;'%20d='M182.298,145.895c0,50.366-40.801,91.176-91.149,91.176S0,196.252,0,145.895%20s40.811-91.176,91.149-91.176S182.298,95.538,182.298,145.895z'/%3e%3cpath%20style='fill:%23F4B459;'%20d='M200.616,54.719c-20.442,0-39.261,6.811-54.469,18.181l0.073,0.009%20c2.991,2.89,6.291,4.924,8.835,8.251l-18.965,0.301c-2.972,3-5.68,6.264-8.233,9.656H161.3c2.544,3.054,4.896,5.708,7.03,9.081%20h-46.536c-1.705,2.936-3.282,5.954-4.659,9.09h56.493c1.477,3.127,2.799,5.489,3.921,8.799h-63.76%20c-1.012,3.146-1.878,6.364-2.535,9.646h68.966c0.675,3.155,1.194,6.072,1.55,9.045h-71.884c-0.301,3-0.456,6.045-0.456,9.118%20h72.859c0,3.228-0.228,6.218-0.556,9.118h-71.847c0.31,3.091,0.766,6.127,1.368,9.118h68.856c-0.711,2.954-1.532,5.926-2.562,9.008%20h-63.969c0.966,3.118,2.143,6.145,3.428,9.099h56.621c-1.568,3.319-3.346,5.972-5.306,9.081h-46.691%20c1.842,3.191,3.875,6.236,6.081,9.154l33.589,0.501c-2.863,3.437-6.537,5.507-9.884,8.516c0.182,0.146-5.352-0.018-16.248-0.191%20c16.576,17.105,39.744,27.772,65.446,27.772c50.357,0,91.176-40.82,91.176-91.176S250.981,54.719,200.616,54.719z'/%3e%3c/g%3e%3c/svg%3e", Vt = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='utf-8'?%3e%3c!--%20Uploaded%20to:%20SVG%20Repo,%20www.svgrepo.com,%20Generator:%20SVG%20Repo%20Mixer%20Tools%20--%3e%3csvg%20width='800px'%20height='800px'%20viewBox='0%20-140%20780%20780'%20enable-background='new%200%200%20780%20500'%20version='1.1'%20xml:space='preserve'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M40,0h700c22.092,0,40,17.909,40,40v420c0,22.092-17.908,40-40,40H40c-22.091,0-40-17.908-40-40V40%20C0,17.909,17.909,0,40,0z'%20fill='%230E4595'/%3e%3cpath%20d='m293.2%20348.73l33.361-195.76h53.36l-33.385%20195.76h-53.336zm246.11-191.54c-10.57-3.966-27.137-8.222-47.822-8.222-52.725%200-89.865%2026.55-90.18%2064.603-0.299%2028.13%2026.514%2043.822%2046.752%2053.186%2020.771%209.595%2027.752%2015.714%2027.654%2024.283-0.131%2013.121-16.586%2019.116-31.922%2019.116-21.357%200-32.703-2.967-50.227-10.276l-6.876-3.11-7.489%2043.823c12.463%205.464%2035.51%2010.198%2059.438%2010.443%2056.09%200%2092.5-26.246%2092.916-66.882%200.199-22.269-14.016-39.216-44.801-53.188-18.65-9.055-30.072-15.099-29.951-24.268%200-8.137%209.668-16.839%2030.557-16.839%2017.449-0.27%2030.09%203.535%2039.938%207.5l4.781%202.26%207.232-42.429m137.31-4.223h-41.232c-12.773%200-22.332%203.487-27.941%2016.234l-79.244%20179.4h56.031s9.16-24.123%2011.232-29.418c6.125%200%2060.555%200.084%2068.338%200.084%201.596%206.853%206.49%2029.334%206.49%2029.334h49.514l-43.188-195.64zm-65.418%20126.41c4.412-11.279%2021.26-54.723%2021.26-54.723-0.316%200.522%204.379-11.334%207.074-18.684l3.605%2016.879s10.219%2046.729%2012.354%2056.528h-44.293zm-363.3-126.41l-52.24%20133.5-5.567-27.13c-9.725-31.273-40.025-65.155-73.898-82.118l47.766%20171.2%2056.456-0.064%2084.004-195.39h-56.521'%20fill='%23ffffff'/%3e%3cpath%20d='m146.92%20152.96h-86.041l-0.681%204.073c66.938%2016.204%20111.23%2055.363%20129.62%20102.41l-18.71-89.96c-3.23-12.395-12.597-16.094-24.186-16.527'%20fill='%23F2AE14'/%3e%3c/svg%3e", M = [
|
|
1483
1483
|
{
|
|
1484
1484
|
type: "visa",
|
|
1485
1485
|
imgSrc: Vt
|
|
@@ -1490,11 +1490,11 @@ const Pt = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='iso-8859-1'?%
|
|
|
1490
1490
|
},
|
|
1491
1491
|
{
|
|
1492
1492
|
type: "americanExpress",
|
|
1493
|
-
imgSrc:
|
|
1493
|
+
imgSrc: zt
|
|
1494
1494
|
},
|
|
1495
1495
|
{
|
|
1496
1496
|
type: "discover",
|
|
1497
|
-
imgSrc:
|
|
1497
|
+
imgSrc: Pt
|
|
1498
1498
|
}
|
|
1499
1499
|
];
|
|
1500
1500
|
class At extends h {
|
|
@@ -1503,10 +1503,10 @@ class At extends h {
|
|
|
1503
1503
|
super("div", []), this.cardType = e.cardType;
|
|
1504
1504
|
const t = document.createElement("label");
|
|
1505
1505
|
t.setAttribute("for", "cardNumber"), t.textContent = e.label, t.style.color = e.styles.color, t.style.fontSize = `${e.styles.fontSize}px`, t.style.display = "block", t.style.marginBottom = "6px", this.getElement().appendChild(t);
|
|
1506
|
-
const a = document.createElement("div");
|
|
1507
|
-
a.className = e.isLoading ? "loading" : "", a.style.borderRadius = `${e.styles.borderRadius}px ${e.styles.borderRadius}px 0px 0px`;
|
|
1508
1506
|
const i = document.createElement("div");
|
|
1509
|
-
i.
|
|
1507
|
+
i.className = e.isLoading ? "loading" : "", i.style.borderRadius = `${e.styles.borderRadius}px ${e.styles.borderRadius}px 0px 0px`;
|
|
1508
|
+
const a = document.createElement("div");
|
|
1509
|
+
a.id = "card-element", a.className = `card-element ${e.isFocused ? "card-element-focus" : ""}`, a.style.zIndex = e.isFocused ? "2" : "0";
|
|
1510
1510
|
const r = document.createElement("div");
|
|
1511
1511
|
if (r.className = "cards-position", e.cardType === "unknown")
|
|
1512
1512
|
M.forEach((s) => {
|
|
@@ -1516,13 +1516,13 @@ class At extends h {
|
|
|
1516
1516
|
const s = M.find((n) => n.type === e.cardType);
|
|
1517
1517
|
s && r.appendChild(this.createCardIcon(s));
|
|
1518
1518
|
}
|
|
1519
|
-
|
|
1519
|
+
a.appendChild(r), i.appendChild(a), this.getElement().appendChild(i);
|
|
1520
1520
|
}
|
|
1521
1521
|
createCardIcon(e) {
|
|
1522
1522
|
const t = document.createElement("div");
|
|
1523
1523
|
t.className = "card-icon";
|
|
1524
|
-
const
|
|
1525
|
-
return
|
|
1524
|
+
const i = document.createElement("img");
|
|
1525
|
+
return i.src = e.imgSrc, t.appendChild(i), t;
|
|
1526
1526
|
}
|
|
1527
1527
|
setFocused(e) {
|
|
1528
1528
|
const t = this.getElement().querySelector(
|
|
@@ -1541,16 +1541,16 @@ class At extends h {
|
|
|
1541
1541
|
if (this.cardType === t)
|
|
1542
1542
|
return this;
|
|
1543
1543
|
this.cardType = t;
|
|
1544
|
-
const
|
|
1545
|
-
if (
|
|
1546
|
-
if (
|
|
1547
|
-
M.forEach((
|
|
1548
|
-
|
|
1544
|
+
const i = this.getElement().querySelector(".cards-position");
|
|
1545
|
+
if (i)
|
|
1546
|
+
if (i.innerHTML = "", this.cardType === "unknown")
|
|
1547
|
+
M.forEach((a) => {
|
|
1548
|
+
i.appendChild(this.createCardIcon(a));
|
|
1549
1549
|
});
|
|
1550
1550
|
else {
|
|
1551
|
-
const
|
|
1552
|
-
|
|
1553
|
-
|
|
1551
|
+
const a = M.find((r) => r.type === this.cardType);
|
|
1552
|
+
a ? i.appendChild(this.createCardIcon(a)) : M.forEach((r) => {
|
|
1553
|
+
i.appendChild(this.createCardIcon(r));
|
|
1554
1554
|
});
|
|
1555
1555
|
}
|
|
1556
1556
|
return this;
|
|
@@ -1565,8 +1565,8 @@ class $t extends h {
|
|
|
1565
1565
|
super("div", []);
|
|
1566
1566
|
const {
|
|
1567
1567
|
checkoutProfile: t,
|
|
1568
|
-
isLoading:
|
|
1569
|
-
isFocused:
|
|
1568
|
+
isLoading: i,
|
|
1569
|
+
isFocused: a,
|
|
1570
1570
|
isCvvFocused: r,
|
|
1571
1571
|
isCcValid: s,
|
|
1572
1572
|
isCvvValid: n,
|
|
@@ -1588,12 +1588,12 @@ class $t extends h {
|
|
|
1588
1588
|
borderRadius: t.styles.borderRadius
|
|
1589
1589
|
},
|
|
1590
1590
|
label: u("cardInformation"),
|
|
1591
|
-
isLoading:
|
|
1592
|
-
isFocused:
|
|
1591
|
+
isLoading: i,
|
|
1592
|
+
isFocused: a,
|
|
1593
1593
|
cardType: d
|
|
1594
1594
|
}), k.appendChild(this.cardNumber.getElement());
|
|
1595
1595
|
const v = document.createElement("div");
|
|
1596
|
-
v.className = "card-details", this.cardExpiry = new
|
|
1596
|
+
v.className = "card-details", this.cardExpiry = new P({
|
|
1597
1597
|
name: "cardExpiry",
|
|
1598
1598
|
type: "tel",
|
|
1599
1599
|
placeholder: u("cardExpiry"),
|
|
@@ -1632,11 +1632,11 @@ class $t extends h {
|
|
|
1632
1632
|
styles: {
|
|
1633
1633
|
borderRadius: typeof t.styles.borderRadius == "number" ? t.styles.borderRadius : 0
|
|
1634
1634
|
},
|
|
1635
|
-
isLoading:
|
|
1635
|
+
isLoading: i,
|
|
1636
1636
|
isFocused: r
|
|
1637
1637
|
}), S.appendChild(this.cardCvv.getElement()), v.appendChild(this.cardExpiry.getElement()), v.appendChild(S), k.appendChild(v);
|
|
1638
1638
|
const E = document.createElement("div");
|
|
1639
|
-
if (E.className = "error-messages-container", E.style.width = "100%", E.style.transition = "height 0.3s ease-in-out, opacity 0.3s ease-in-out", E.style.overflow = "hidden", E.style.height = "0px", E.style.opacity = "0", this.getElement().appendChild(k), this.getElement().appendChild(E), (
|
|
1639
|
+
if (E.className = "error-messages-container", E.style.width = "100%", E.style.transition = "height 0.3s ease-in-out, opacity 0.3s ease-in-out", E.style.overflow = "hidden", E.style.height = "0px", E.style.opacity = "0", this.getElement().appendChild(k), this.getElement().appendChild(E), (a || l) && !s) {
|
|
1640
1640
|
const f = new C({
|
|
1641
1641
|
text: u("validation.cardNumberInvalid")
|
|
1642
1642
|
});
|
|
@@ -1659,19 +1659,19 @@ class $t extends h {
|
|
|
1659
1659
|
updateCardType(e) {
|
|
1660
1660
|
return this.cardNumber.updateCardType(e), this;
|
|
1661
1661
|
}
|
|
1662
|
-
updateCardExpiry(e, t,
|
|
1662
|
+
updateCardExpiry(e, t, i) {
|
|
1663
1663
|
this.cardExpiry.setValue(e);
|
|
1664
|
-
const
|
|
1664
|
+
const a = this.getElement().querySelector(
|
|
1665
1665
|
".error-messages-container"
|
|
1666
1666
|
), r = this.cardExpiry.getElement().querySelector("input"), s = document.activeElement === r;
|
|
1667
|
-
if (t &&
|
|
1667
|
+
if (t && i && !s)
|
|
1668
1668
|
if (this.cardExpiry.setError(!1), this.validationMessages.has("cardExpiry"))
|
|
1669
1669
|
this.validationMessages.get("cardExpiry")?.setText(t);
|
|
1670
1670
|
else {
|
|
1671
1671
|
const l = new C({
|
|
1672
1672
|
text: t
|
|
1673
1673
|
});
|
|
1674
|
-
this.validationMessages.set("cardExpiry", l),
|
|
1674
|
+
this.validationMessages.set("cardExpiry", l), a.appendChild(l.getElement()), setTimeout(() => this.updateErrorContainerHeight(), 0);
|
|
1675
1675
|
}
|
|
1676
1676
|
else if (this.cardExpiry.setError(!1), s) {
|
|
1677
1677
|
const l = this.validationMessages.get("cardExpiry");
|
|
@@ -1689,7 +1689,7 @@ class $t extends h {
|
|
|
1689
1689
|
const e = this.getCardExpiryValue().trim();
|
|
1690
1690
|
return this.cardExpiry.setValue(e), this;
|
|
1691
1691
|
}
|
|
1692
|
-
updateCardNumberValidation(e, t,
|
|
1692
|
+
updateCardNumberValidation(e, t, i, a = !1) {
|
|
1693
1693
|
this.cardNumber.setFocused(e);
|
|
1694
1694
|
const r = this.getElement().querySelector(
|
|
1695
1695
|
".error-messages-container"
|
|
@@ -1698,10 +1698,10 @@ class $t extends h {
|
|
|
1698
1698
|
const n = this.validationMessages.get("cardNumber");
|
|
1699
1699
|
return n && (n.getElement().remove(), this.validationMessages.delete("cardNumber"), this.updateErrorContainerHeight()), this;
|
|
1700
1700
|
}
|
|
1701
|
-
if (!e &&
|
|
1701
|
+
if (!e && a && !s) {
|
|
1702
1702
|
if (!this.validationMessages.has("cardNumber")) {
|
|
1703
1703
|
const n = new C({
|
|
1704
|
-
text:
|
|
1704
|
+
text: i("validation.cardNumberInvalid")
|
|
1705
1705
|
});
|
|
1706
1706
|
this.validationMessages.set("cardNumber", n), r.appendChild(n.getElement()), setTimeout(() => this.updateErrorContainerHeight(), 0);
|
|
1707
1707
|
}
|
|
@@ -1711,15 +1711,15 @@ class $t extends h {
|
|
|
1711
1711
|
}
|
|
1712
1712
|
return this;
|
|
1713
1713
|
}
|
|
1714
|
-
updateCardCvvValidation(e, t,
|
|
1714
|
+
updateCardCvvValidation(e, t, i, a = !1) {
|
|
1715
1715
|
this.cardCvv.setFocused(e);
|
|
1716
1716
|
const r = this.getElement().querySelector(
|
|
1717
1717
|
".error-messages-container"
|
|
1718
1718
|
);
|
|
1719
|
-
if (!e &&
|
|
1719
|
+
if (!e && a && !(t !== !1)) {
|
|
1720
1720
|
if (!this.validationMessages.has("cardCvv")) {
|
|
1721
1721
|
const n = new C({
|
|
1722
|
-
text:
|
|
1722
|
+
text: i("validation.cardSecurityFormat")
|
|
1723
1723
|
});
|
|
1724
1724
|
this.validationMessages.set("cardCvv", n), r.appendChild(n.getElement()), setTimeout(() => this.updateErrorContainerHeight(), 0);
|
|
1725
1725
|
}
|
|
@@ -1744,10 +1744,10 @@ class $t extends h {
|
|
|
1744
1744
|
if (this.validationMessages.size === 0)
|
|
1745
1745
|
e.style.height = "0px", e.style.opacity = "0";
|
|
1746
1746
|
else {
|
|
1747
|
-
const t = e.style.height,
|
|
1747
|
+
const t = e.style.height, i = e.style.overflow;
|
|
1748
1748
|
e.style.height = "auto", e.style.overflow = "visible";
|
|
1749
|
-
const
|
|
1750
|
-
e.style.overflow =
|
|
1749
|
+
const a = e.scrollHeight;
|
|
1750
|
+
e.style.overflow = i, e.style.height = t, e.offsetHeight, e.style.height = a + 4 + "px", e.style.opacity = "1";
|
|
1751
1751
|
}
|
|
1752
1752
|
}
|
|
1753
1753
|
/**
|
|
@@ -1774,15 +1774,15 @@ class Rt {
|
|
|
1774
1774
|
constructor(e) {
|
|
1775
1775
|
const {
|
|
1776
1776
|
value: t,
|
|
1777
|
-
onChange:
|
|
1778
|
-
onBlur:
|
|
1777
|
+
onChange: i,
|
|
1778
|
+
onBlur: a,
|
|
1779
1779
|
error: r,
|
|
1780
1780
|
errorMsg: s,
|
|
1781
1781
|
checkoutProfile: n,
|
|
1782
1782
|
translationFunc: l,
|
|
1783
1783
|
autocomplete: c = "email"
|
|
1784
1784
|
} = e;
|
|
1785
|
-
this.input = new
|
|
1785
|
+
this.input = new P({
|
|
1786
1786
|
name: "email",
|
|
1787
1787
|
label: l("email"),
|
|
1788
1788
|
// Always hide error initially - we'll show it only on blur if needed
|
|
@@ -1800,10 +1800,10 @@ class Rt {
|
|
|
1800
1800
|
autocomplete: c,
|
|
1801
1801
|
// Wrap the original onChange to apply trim and hide errors during typing
|
|
1802
1802
|
onChange: (d) => {
|
|
1803
|
-
this.input.setError(!1), this.trim(),
|
|
1803
|
+
this.input.setError(!1), this.trim(), i(d);
|
|
1804
1804
|
}
|
|
1805
1805
|
}), this.input.addEventListener("blur", (d) => {
|
|
1806
|
-
r && this.input.setError(r, s),
|
|
1806
|
+
r && this.input.setError(r, s), a(d);
|
|
1807
1807
|
});
|
|
1808
1808
|
}
|
|
1809
1809
|
getValue() {
|
|
@@ -1836,12 +1836,12 @@ class Ht extends h {
|
|
|
1836
1836
|
isSubmitting = !1;
|
|
1837
1837
|
constructor(e) {
|
|
1838
1838
|
super("div", ["paypal"]);
|
|
1839
|
-
const { formData: t, onSubmit:
|
|
1840
|
-
this.formData = t, this.onSubmit =
|
|
1841
|
-
const
|
|
1842
|
-
|
|
1839
|
+
const { formData: t, onSubmit: i } = e;
|
|
1840
|
+
this.formData = t, this.onSubmit = i, this.getElement().style.cursor = i ? "pointer" : "default", this.getElement().style.opacity = "1";
|
|
1841
|
+
const a = document.createElement("div");
|
|
1842
|
+
a.className = "paypal-icon-container";
|
|
1843
1843
|
const r = document.createElement("img");
|
|
1844
|
-
r.src = Bt, r.style.width = "69px", r.style.height = "22px", r.style.maxWidth = "100%", r.style.display = "block", r.style.height = "auto",
|
|
1844
|
+
r.src = Bt, r.style.width = "69px", r.style.height = "22px", r.style.maxWidth = "100%", r.style.display = "block", r.style.height = "auto", a.appendChild(r), this.getElement().appendChild(a), i && this.getElement().addEventListener("click", () => this.handleSubmit());
|
|
1845
1845
|
}
|
|
1846
1846
|
async handleSubmit() {
|
|
1847
1847
|
if (!(!this.onSubmit || this.isSubmitting)) {
|
|
@@ -1864,14 +1864,14 @@ class Ht extends h {
|
|
|
1864
1864
|
}
|
|
1865
1865
|
class Ot extends h {
|
|
1866
1866
|
constructor(e) {
|
|
1867
|
-
const { translationFunc: t, checkoutProfile:
|
|
1867
|
+
const { translationFunc: t, checkoutProfile: i } = e;
|
|
1868
1868
|
super("div", ["payment-separator"]);
|
|
1869
|
-
const
|
|
1869
|
+
const a = this.getElement(), r = document.createElement("span");
|
|
1870
1870
|
r.className = "payment-separator__line";
|
|
1871
1871
|
const s = document.createElement("p");
|
|
1872
|
-
s.textContent = t("pay-with-card"), s.className = "payment-separator__text", s.style.fontFamily = `${
|
|
1872
|
+
s.textContent = t("pay-with-card"), s.className = "payment-separator__text", s.style.fontFamily = `${i.styles.fontFamily}, sans-serif`;
|
|
1873
1873
|
const n = document.createElement("span");
|
|
1874
|
-
n.className = "payment-separator__line",
|
|
1874
|
+
n.className = "payment-separator__line", a.appendChild(r), a.appendChild(s), a.appendChild(n);
|
|
1875
1875
|
}
|
|
1876
1876
|
}
|
|
1877
1877
|
class Kt extends h {
|
|
@@ -1880,8 +1880,8 @@ class Kt extends h {
|
|
|
1880
1880
|
constructor(e) {
|
|
1881
1881
|
const {
|
|
1882
1882
|
checkoutProfile: t,
|
|
1883
|
-
formData:
|
|
1884
|
-
onPaypalSubmit:
|
|
1883
|
+
formData: i,
|
|
1884
|
+
onPaypalSubmit: a,
|
|
1885
1885
|
supportedPaymentMethods: r,
|
|
1886
1886
|
translationFunc: s
|
|
1887
1887
|
} = e;
|
|
@@ -1906,11 +1906,11 @@ class Kt extends h {
|
|
|
1906
1906
|
for (const [l] of n)
|
|
1907
1907
|
switch (l) {
|
|
1908
1908
|
case "paypal": {
|
|
1909
|
-
if (
|
|
1909
|
+
if (a) {
|
|
1910
1910
|
const c = new Ht({
|
|
1911
1911
|
checkoutProfile: t,
|
|
1912
|
-
formData:
|
|
1913
|
-
onSubmit:
|
|
1912
|
+
formData: i,
|
|
1913
|
+
onSubmit: a
|
|
1914
1914
|
});
|
|
1915
1915
|
this.paymentMethods.set("paypal", c), c.appendTo(this.getElement());
|
|
1916
1916
|
}
|
|
@@ -1946,8 +1946,8 @@ class Kt extends h {
|
|
|
1946
1946
|
return this.paymentMethods.size > 0 && this.getElement().style.display !== "none";
|
|
1947
1947
|
}
|
|
1948
1948
|
}
|
|
1949
|
-
const
|
|
1950
|
-
class
|
|
1949
|
+
const jt = 17;
|
|
1950
|
+
class qt extends h {
|
|
1951
1951
|
styles;
|
|
1952
1952
|
isHovered = !1;
|
|
1953
1953
|
constructor(e) {
|
|
@@ -1958,7 +1958,7 @@ class jt extends h {
|
|
|
1958
1958
|
}
|
|
1959
1959
|
applyStyles() {
|
|
1960
1960
|
const e = this.getElement();
|
|
1961
|
-
e.style.backgroundColor = this.isHovered ? `color-mix(in srgb, ${this.styles.backgroundColor} 80%, transparent)` : this.styles.backgroundColor, e.disabled ? (e.style.color = "rgb(150, 150, 150)", e.style.backgroundColor = "rgb(200, 200, 200)") : e.style.color = this.styles.color, e.style.borderRadius = this.styles.borderRadius ===
|
|
1961
|
+
e.style.backgroundColor = this.isHovered ? `color-mix(in srgb, ${this.styles.backgroundColor} 80%, transparent)` : this.styles.backgroundColor, e.disabled ? (e.style.color = "rgb(150, 150, 150)", e.style.backgroundColor = "rgb(200, 200, 200)") : e.style.color = this.styles.color, e.style.borderRadius = this.styles.borderRadius === jt ? "100vmax" : `${this.styles.borderRadius}px`, e.style.fontSize = `${this.styles.fontSize}px`, e.style.fontFamily = `${this.styles.fontFamily}, sans-serif`;
|
|
1962
1962
|
}
|
|
1963
1963
|
handleMouseEnter() {
|
|
1964
1964
|
this.isHovered = !0, this.applyStyles();
|
|
@@ -1973,17 +1973,17 @@ class jt extends h {
|
|
|
1973
1973
|
class Ut {
|
|
1974
1974
|
button;
|
|
1975
1975
|
constructor(e) {
|
|
1976
|
-
const { disabled: t, checkoutProfile:
|
|
1977
|
-
this.button = new
|
|
1978
|
-
text:
|
|
1979
|
-
`buttonTexts.${
|
|
1976
|
+
const { disabled: t, checkoutProfile: i, translationFunc: a } = e;
|
|
1977
|
+
this.button = new qt({
|
|
1978
|
+
text: a(
|
|
1979
|
+
`buttonTexts.${i?.layout.actionButton.translationKey}`
|
|
1980
1980
|
),
|
|
1981
1981
|
styles: {
|
|
1982
|
-
backgroundColor:
|
|
1983
|
-
color:
|
|
1984
|
-
fontFamily:
|
|
1985
|
-
borderRadius:
|
|
1986
|
-
fontSize:
|
|
1982
|
+
backgroundColor: i.styles.buttonColor,
|
|
1983
|
+
color: i.styles.buttonTextColor,
|
|
1984
|
+
fontFamily: i.styles.fontFamily,
|
|
1985
|
+
borderRadius: i.styles.borderRadius,
|
|
1986
|
+
fontSize: i.styles.buttonFontSize
|
|
1987
1987
|
},
|
|
1988
1988
|
disabled: t
|
|
1989
1989
|
});
|
|
@@ -1994,8 +1994,8 @@ class Ut {
|
|
|
1994
1994
|
setDisabled(e) {
|
|
1995
1995
|
return this.button.setDisabled(e), this;
|
|
1996
1996
|
}
|
|
1997
|
-
addEventListener(e, t,
|
|
1998
|
-
return this.button.addEventListener(e, t,
|
|
1997
|
+
addEventListener(e, t, i) {
|
|
1998
|
+
return this.button.addEventListener(e, t, i), this;
|
|
1999
1999
|
}
|
|
2000
2000
|
appendTo(e) {
|
|
2001
2001
|
return this.button.appendTo(e), this;
|
|
@@ -2026,7 +2026,7 @@ class Yt extends h {
|
|
|
2026
2026
|
// factories
|
|
2027
2027
|
formManager = W();
|
|
2028
2028
|
checkoutProfile;
|
|
2029
|
-
translation =
|
|
2029
|
+
translation = z();
|
|
2030
2030
|
iframeHook;
|
|
2031
2031
|
constructor(e) {
|
|
2032
2032
|
super("form", ["form-container"]), this.options = e, this.checkoutProfile = U({
|
|
@@ -2048,10 +2048,10 @@ class Yt extends h {
|
|
|
2048
2048
|
};
|
|
2049
2049
|
}
|
|
2050
2050
|
handleFormStateChange = () => {
|
|
2051
|
-
const { formData: e, errors: t, touched:
|
|
2052
|
-
Object.keys(
|
|
2053
|
-
|
|
2054
|
-
}), this.focusManager.handleStateUpdate(e, t,
|
|
2051
|
+
const { formData: e, errors: t, touched: i } = this.formManager.getFormState(), a = this.iframeHook?.getState() || {};
|
|
2052
|
+
Object.keys(i).forEach((r) => {
|
|
2053
|
+
i[r] && this.localTouchedFields.add(r);
|
|
2054
|
+
}), this.focusManager.handleStateUpdate(e, t, i, a), this.updateFormUI();
|
|
2055
2055
|
};
|
|
2056
2056
|
handleProfileStateChange = (e) => {
|
|
2057
2057
|
if (!e.isLoading)
|
|
@@ -2067,12 +2067,14 @@ class Yt extends h {
|
|
|
2067
2067
|
console.error("Error loading Google Font:", t);
|
|
2068
2068
|
}
|
|
2069
2069
|
this.renderFormComponents(), this.initializeTokenExIframe().catch((t) => {
|
|
2070
|
-
console.error("Error initializing TokenEx iframe:", t)
|
|
2070
|
+
console.error("Error initializing TokenEx iframe:", t), this.hideAllFormComponents(), this.setErrorMessage(
|
|
2071
|
+
this.translation.t("validation.invalid-checkout")
|
|
2072
|
+
);
|
|
2071
2073
|
});
|
|
2072
2074
|
} catch (t) {
|
|
2073
2075
|
console.error("Error in profile state change:", t);
|
|
2074
|
-
const
|
|
2075
|
-
this.setErrorMessage(
|
|
2076
|
+
const i = e.error || "Failed to load checkout profile data";
|
|
2077
|
+
this.setErrorMessage(i);
|
|
2076
2078
|
}
|
|
2077
2079
|
else e.error && (console.error("NO profile found", e.error), this.setErrorMessage(e.error), this.setLoadingState(!1));
|
|
2078
2080
|
};
|
|
@@ -2093,12 +2095,12 @@ class Yt extends h {
|
|
|
2093
2095
|
);
|
|
2094
2096
|
return;
|
|
2095
2097
|
}
|
|
2096
|
-
const { inputStyles: t, formContainerStyle:
|
|
2098
|
+
const { inputStyles: t, formContainerStyle: i } = kt(
|
|
2097
2099
|
e.checkoutProfile
|
|
2098
2100
|
);
|
|
2099
|
-
this.applyFormContainerStyles(
|
|
2100
|
-
const
|
|
2101
|
-
if (!
|
|
2101
|
+
this.applyFormContainerStyles(i);
|
|
2102
|
+
const a = document.getElementById("card-element"), r = document.getElementById("card-cvv-element");
|
|
2103
|
+
if (!a || !r) {
|
|
2102
2104
|
console.error(
|
|
2103
2105
|
"[Form] Card elements not found, cannot initialize TokenEx iframe."
|
|
2104
2106
|
);
|
|
@@ -2137,13 +2139,13 @@ class Yt extends h {
|
|
|
2137
2139
|
this.translation.t,
|
|
2138
2140
|
this.isCvvTouched
|
|
2139
2141
|
), this.cardSection.updateCardType(e.possibleCardType), this.cardSection.setLoading(e.loadingIframe)), e.loadingIframe || this.setLoadingState(!1), this.submitButton && this.submitButton.setDisabled(this.isFormDisabled());
|
|
2140
|
-
const { formData: t, errors:
|
|
2141
|
-
this.focusManager.handleStateUpdate(t,
|
|
2142
|
+
const { formData: t, errors: i, touched: a } = this.formManager.getFormState();
|
|
2143
|
+
this.focusManager.handleStateUpdate(t, i, a, e);
|
|
2142
2144
|
};
|
|
2143
2145
|
createCardSection = (e) => {
|
|
2144
2146
|
if (!this.cardSection)
|
|
2145
2147
|
try {
|
|
2146
|
-
const { formData: t, errors:
|
|
2148
|
+
const { formData: t, errors: i, touched: a } = this._getFormStateData();
|
|
2147
2149
|
let r = {
|
|
2148
2150
|
loadingIframe: !0,
|
|
2149
2151
|
isFocused: !1,
|
|
@@ -2165,8 +2167,8 @@ class Yt extends h {
|
|
|
2165
2167
|
// Initially not touched
|
|
2166
2168
|
cardType: r.possibleCardType,
|
|
2167
2169
|
cardExpiry: t.cardExpiry,
|
|
2168
|
-
cardExpiryError:
|
|
2169
|
-
cardExpiryTouched: !!
|
|
2170
|
+
cardExpiryError: i.cardExpiry,
|
|
2171
|
+
cardExpiryTouched: !!a.cardExpiry,
|
|
2170
2172
|
onChange: this.handleChange,
|
|
2171
2173
|
onBlur: this.handleBlur,
|
|
2172
2174
|
translationFunc: this.translation.t
|
|
@@ -2188,10 +2190,10 @@ class Yt extends h {
|
|
|
2188
2190
|
};
|
|
2189
2191
|
initializeForm() {
|
|
2190
2192
|
this.setLoadingState(!0), this.options.errorMsg && this.setErrorMessage(this.options.errorMsg);
|
|
2191
|
-
const e = this.options.environment === "test" ? _t : Gt, { cleanup: t, isLoaded:
|
|
2193
|
+
const e = this.options.environment === "test" ? _t : Gt, { cleanup: t, isLoaded: i } = xt({
|
|
2192
2194
|
scriptSrc: e
|
|
2193
2195
|
});
|
|
2194
|
-
this.scriptCleanup = t, this.tokenExScriptPromise =
|
|
2196
|
+
this.scriptCleanup = t, this.tokenExScriptPromise = i, i.then(() => {
|
|
2195
2197
|
}).catch(() => {
|
|
2196
2198
|
this.setLoadingState(!1), this.setErrorMessage(
|
|
2197
2199
|
"Failed to load payment system. Please try again later."
|
|
@@ -2236,11 +2238,11 @@ class Yt extends h {
|
|
|
2236
2238
|
try {
|
|
2237
2239
|
if (!e?.additionalPaymentMethods)
|
|
2238
2240
|
return;
|
|
2239
|
-
const
|
|
2241
|
+
const i = this.iframeHook?.getState().iframeConfig?.supportedPaymentMethods, { formData: a } = this._getFormStateData();
|
|
2240
2242
|
this.paymentMethods = new Kt({
|
|
2241
2243
|
checkoutProfile: e,
|
|
2242
|
-
formData:
|
|
2243
|
-
supportedPaymentMethods:
|
|
2244
|
+
formData: a,
|
|
2245
|
+
supportedPaymentMethods: i,
|
|
2244
2246
|
translationFunc: this.translation.t,
|
|
2245
2247
|
onPaypalSubmit: async () => {
|
|
2246
2248
|
await this.handlePaypalSubmit();
|
|
@@ -2249,19 +2251,19 @@ class Yt extends h {
|
|
|
2249
2251
|
this.paymentMethods.getElement(),
|
|
2250
2252
|
this.element.firstChild
|
|
2251
2253
|
) : this.element.appendChild(this.paymentMethods.getElement());
|
|
2252
|
-
} catch (
|
|
2253
|
-
throw console.error("Error creating payment methods:",
|
|
2254
|
+
} catch (i) {
|
|
2255
|
+
throw console.error("Error creating payment methods:", i), i;
|
|
2254
2256
|
}
|
|
2255
2257
|
}
|
|
2256
2258
|
createEmailField(e) {
|
|
2257
2259
|
try {
|
|
2258
|
-
const { formData: t, errors:
|
|
2260
|
+
const { formData: t, errors: i, touched: a } = this._getFormStateData();
|
|
2259
2261
|
this.emailField = new Rt({
|
|
2260
2262
|
value: t.email,
|
|
2261
2263
|
onChange: this.handleChange,
|
|
2262
2264
|
onBlur: this.handleBlur,
|
|
2263
|
-
error: !!(
|
|
2264
|
-
errorMsg:
|
|
2265
|
+
error: !!(i.email && a.email),
|
|
2266
|
+
errorMsg: i.email,
|
|
2265
2267
|
checkoutProfile: e,
|
|
2266
2268
|
translationFunc: this.translation.t
|
|
2267
2269
|
}), this.emailFocusHandler = () => this.handleFieldFocus("email"), this.emailField.getElement().addEventListener("focus", this.emailFocusHandler, !0), this.focusManager.registerField("email", this.emailField), this.element.appendChild(this.emailField.getElement());
|
|
@@ -2271,13 +2273,13 @@ class Yt extends h {
|
|
|
2271
2273
|
}
|
|
2272
2274
|
createCardholderSection(e) {
|
|
2273
2275
|
try {
|
|
2274
|
-
const { formData: t, errors:
|
|
2276
|
+
const { formData: t, errors: i, touched: a } = this._getFormStateData();
|
|
2275
2277
|
this.cardholderSection = new It({
|
|
2276
2278
|
value: t.name,
|
|
2277
2279
|
onChange: this.handleChange,
|
|
2278
2280
|
onBlur: this.handleBlur,
|
|
2279
|
-
error: !!(
|
|
2280
|
-
errorMsg:
|
|
2281
|
+
error: !!(i.name && a.name),
|
|
2282
|
+
errorMsg: i.name,
|
|
2281
2283
|
checkoutProfile: e,
|
|
2282
2284
|
translationFunc: this.translation.t
|
|
2283
2285
|
});
|
|
@@ -2301,14 +2303,14 @@ class Yt extends h {
|
|
|
2301
2303
|
// Track locally touched fields to avoid redundant state checks
|
|
2302
2304
|
localTouchedFields = /* @__PURE__ */ new Set();
|
|
2303
2305
|
handleChange = (e) => {
|
|
2304
|
-
const t = e.target, { name:
|
|
2305
|
-
this.formManager.handleChange(r,
|
|
2306
|
+
const t = e.target, { name: i, value: a } = t, r = i;
|
|
2307
|
+
this.formManager.handleChange(r, a), this.localTouchedFields.has(r) || (this.localTouchedFields.add(r), this.formManager.handleBlur(r, a));
|
|
2306
2308
|
const { formData: s, errors: n, touched: l } = this.formManager.getFormState(), c = this.iframeHook?.getState() || {};
|
|
2307
2309
|
this.focusManager.handleStateUpdate(s, n, l, c);
|
|
2308
2310
|
};
|
|
2309
2311
|
handleBlur = (e) => {
|
|
2310
|
-
const t = e.target, { name:
|
|
2311
|
-
this.localTouchedFields.add(r), this.formManager.handleBlur(r,
|
|
2312
|
+
const t = e.target, { name: i, value: a } = t, r = i;
|
|
2313
|
+
this.localTouchedFields.add(r), this.formManager.handleBlur(r, a);
|
|
2312
2314
|
const { formData: s, errors: n, touched: l } = this.formManager.getFormState(), c = this.iframeHook?.getState() || {};
|
|
2313
2315
|
l[r] || this.focusManager.handleStateUpdate(
|
|
2314
2316
|
s,
|
|
@@ -2338,12 +2340,12 @@ class Yt extends h {
|
|
|
2338
2340
|
isCvvValid: !1
|
|
2339
2341
|
};
|
|
2340
2342
|
this.iframeHook && (t = this.iframeHook.getState());
|
|
2341
|
-
const
|
|
2343
|
+
const i = Object.keys(e.errors).length > 0, a = (
|
|
2342
2344
|
// Only require card validation if CardSection exists
|
|
2343
2345
|
(!this.cardSection || t.isCcValid && t.isCvvValid) && !!e.formData.email && !!e.formData.name && // Only require card expiry if CardSection exists
|
|
2344
2346
|
(!this.cardSection || !!e.formData.cardExpiry)
|
|
2345
2347
|
);
|
|
2346
|
-
return
|
|
2348
|
+
return i || !a || this.isSubmitting;
|
|
2347
2349
|
}
|
|
2348
2350
|
setLoadingState(e) {
|
|
2349
2351
|
if (this.options.onLoadingStateChange) {
|
|
@@ -2361,6 +2363,9 @@ class Yt extends h {
|
|
|
2361
2363
|
hideSkeleton() {
|
|
2362
2364
|
this.formSkeleton && (this.formSkeleton.getElement().remove(), this.formSkeleton = void 0);
|
|
2363
2365
|
}
|
|
2366
|
+
hideAllFormComponents() {
|
|
2367
|
+
this.hideSpinner(), this.hideSkeleton(), this.emailField && (this.emailField.getElement().style.display = "none"), this.cardSection && (this.cardSection.getElement().style.display = "none"), this.cardholderSection && (this.cardholderSection.getElement().style.display = "none"), this.submitButton && (this.submitButton.getElement().style.display = "none"), this.paymentMethods && (this.paymentMethods.getElement().style.display = "none");
|
|
2368
|
+
}
|
|
2364
2369
|
handleSubmit = async (e) => {
|
|
2365
2370
|
if (e.preventDefault(), !this.isFormDisabled())
|
|
2366
2371
|
try {
|
|
@@ -2543,11 +2548,11 @@ class Xt {
|
|
|
2543
2548
|
const t = document.querySelector(e);
|
|
2544
2549
|
if (!t)
|
|
2545
2550
|
throw new Error(`Container ${e} not found`);
|
|
2546
|
-
const
|
|
2547
|
-
return t.appendChild(
|
|
2548
|
-
form:
|
|
2551
|
+
const i = document.createElement("div");
|
|
2552
|
+
return t.appendChild(i), this.stateManager.updateState({
|
|
2553
|
+
form: i,
|
|
2549
2554
|
mounted: !0
|
|
2550
|
-
}), this.formManager.mount(
|
|
2555
|
+
}), this.formManager.mount(i), this;
|
|
2551
2556
|
}
|
|
2552
2557
|
unmount() {
|
|
2553
2558
|
const { mounted: e } = this.stateManager.getState();
|
|
@@ -2565,16 +2570,16 @@ class Xt {
|
|
|
2565
2570
|
formData: t
|
|
2566
2571
|
}) {
|
|
2567
2572
|
try {
|
|
2568
|
-
const
|
|
2573
|
+
const i = await this.apiService.authorizePayment({
|
|
2569
2574
|
checkoutKey: this.config.checkoutKey,
|
|
2570
2575
|
formData: t || null,
|
|
2571
2576
|
token: e?.token || null,
|
|
2572
2577
|
paymentId: this.config.paymentId,
|
|
2573
2578
|
returnUrl: this.config.returnUrl
|
|
2574
2579
|
});
|
|
2575
|
-
this.handlePaymentResponse(
|
|
2576
|
-
} catch (
|
|
2577
|
-
this.handleAuthorizationError(
|
|
2580
|
+
this.handlePaymentResponse(i);
|
|
2581
|
+
} catch (i) {
|
|
2582
|
+
this.handleAuthorizationError(i);
|
|
2578
2583
|
}
|
|
2579
2584
|
}
|
|
2580
2585
|
handlePaymentResponse(e) {
|
|
@@ -2598,7 +2603,7 @@ export {
|
|
|
2598
2603
|
ye as enLocale,
|
|
2599
2604
|
we as esLocale,
|
|
2600
2605
|
Ve as frLocale,
|
|
2601
|
-
|
|
2606
|
+
qe as itLocale,
|
|
2602
2607
|
Qe as plLocale,
|
|
2603
2608
|
lt as ptLocale,
|
|
2604
2609
|
yt as trLocale
|