@odus/checkout 0.5.6 → 0.5.8
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.es.js +272 -310
- package/dist/index.css +1 -1
- package/dist/package.json +1 -1
- package/package.json +1 -1
package/dist/checkout.es.js
CHANGED
|
@@ -10,17 +10,17 @@ class $ {
|
|
|
10
10
|
endpoint: e,
|
|
11
11
|
method: t = "POST",
|
|
12
12
|
body: a,
|
|
13
|
-
customHeaders:
|
|
13
|
+
customHeaders: r = {}
|
|
14
14
|
}) {
|
|
15
|
-
const
|
|
15
|
+
const i = {
|
|
16
16
|
Authorization: `Bearer ${this.apiKey}`,
|
|
17
17
|
"Content-Type": "application/json",
|
|
18
|
-
...
|
|
18
|
+
...r
|
|
19
19
|
};
|
|
20
20
|
try {
|
|
21
21
|
const n = await fetch(`${this.baseUrl}${e}`, {
|
|
22
22
|
method: t,
|
|
23
|
-
headers:
|
|
23
|
+
headers: i,
|
|
24
24
|
body: a ? JSON.stringify(a) : void 0
|
|
25
25
|
});
|
|
26
26
|
if (!n.ok) {
|
|
@@ -52,17 +52,17 @@ class $ {
|
|
|
52
52
|
paymentId: e,
|
|
53
53
|
checkoutKey: t,
|
|
54
54
|
formData: a,
|
|
55
|
-
token:
|
|
56
|
-
returnUrl:
|
|
55
|
+
token: r,
|
|
56
|
+
returnUrl: i
|
|
57
57
|
}) {
|
|
58
58
|
let n = {};
|
|
59
|
-
if (
|
|
59
|
+
if (r && a) {
|
|
60
60
|
const o = a.cardExpiry.replace(/\s+/g, "").split("/"), l = o[0], c = o[1];
|
|
61
61
|
n = {
|
|
62
62
|
paymentMethodData: {
|
|
63
63
|
type: "card",
|
|
64
64
|
card: {
|
|
65
|
-
token:
|
|
65
|
+
token: r,
|
|
66
66
|
expMonth: l,
|
|
67
67
|
expYear: `20${c}`,
|
|
68
68
|
cardholderName: a.name
|
|
@@ -73,7 +73,7 @@ class $ {
|
|
|
73
73
|
name: a.name
|
|
74
74
|
},
|
|
75
75
|
context: {
|
|
76
|
-
returnUrl:
|
|
76
|
+
returnUrl: i,
|
|
77
77
|
browserInfo: this.browserInfo
|
|
78
78
|
}
|
|
79
79
|
};
|
|
@@ -83,7 +83,7 @@ class $ {
|
|
|
83
83
|
type: "paypal"
|
|
84
84
|
},
|
|
85
85
|
context: {
|
|
86
|
-
returnUrl:
|
|
86
|
+
returnUrl: i,
|
|
87
87
|
browserInfo: this.browserInfo
|
|
88
88
|
}
|
|
89
89
|
};
|
|
@@ -101,16 +101,16 @@ const R = async ({
|
|
|
101
101
|
apiKey: e,
|
|
102
102
|
environment: t
|
|
103
103
|
}) => {
|
|
104
|
-
const a = k(t),
|
|
104
|
+
const a = k(t), r = await fetch(`${a}/checkout-profiles/${s}`, {
|
|
105
105
|
method: "GET",
|
|
106
106
|
headers: {
|
|
107
107
|
"Content-Type": "application/json",
|
|
108
108
|
Authorization: `Bearer ${e}`
|
|
109
109
|
}
|
|
110
110
|
});
|
|
111
|
-
if (!
|
|
112
|
-
throw new Error(`HTTP error! Status: ${
|
|
113
|
-
return await
|
|
111
|
+
if (!r.ok)
|
|
112
|
+
throw new Error(`HTTP error! Status: ${r.status}`);
|
|
113
|
+
return await r.json();
|
|
114
114
|
};
|
|
115
115
|
class V {
|
|
116
116
|
events = /* @__PURE__ */ new Map();
|
|
@@ -133,7 +133,7 @@ class V {
|
|
|
133
133
|
*/
|
|
134
134
|
publish(e, t) {
|
|
135
135
|
const a = this.events.get(e);
|
|
136
|
-
a && a.forEach((
|
|
136
|
+
a && a.forEach((r) => r(t));
|
|
137
137
|
}
|
|
138
138
|
/**
|
|
139
139
|
* Clear all event subscriptions
|
|
@@ -208,30 +208,30 @@ function H({
|
|
|
208
208
|
checkoutProfile: void 0,
|
|
209
209
|
isLoading: !0,
|
|
210
210
|
error: null
|
|
211
|
-
}),
|
|
211
|
+
}), r = async () => {
|
|
212
212
|
try {
|
|
213
213
|
a.setState({ isLoading: !0 });
|
|
214
|
-
const
|
|
214
|
+
const i = await R({
|
|
215
215
|
apiKey: s,
|
|
216
216
|
id: e,
|
|
217
217
|
environment: t
|
|
218
218
|
});
|
|
219
|
-
|
|
220
|
-
checkoutProfile:
|
|
219
|
+
i && a.setState({
|
|
220
|
+
checkoutProfile: i,
|
|
221
221
|
isLoading: !1,
|
|
222
222
|
error: null
|
|
223
223
|
});
|
|
224
|
-
} catch (
|
|
224
|
+
} catch (i) {
|
|
225
225
|
a.setState({
|
|
226
226
|
error: "Failed to load checkout profile",
|
|
227
227
|
isLoading: !1
|
|
228
|
-
}), console.error(
|
|
228
|
+
}), console.error(i);
|
|
229
229
|
}
|
|
230
230
|
};
|
|
231
|
-
return
|
|
231
|
+
return r(), {
|
|
232
232
|
getState: a.getState.bind(a),
|
|
233
233
|
subscribe: a.subscribe.bind(a),
|
|
234
|
-
reload:
|
|
234
|
+
reload: r
|
|
235
235
|
};
|
|
236
236
|
}
|
|
237
237
|
const z = {
|
|
@@ -328,29 +328,29 @@ const z = {
|
|
|
328
328
|
}, j = (s, e) => {
|
|
329
329
|
if (s.length === 0) return e.length;
|
|
330
330
|
if (e.length === 0) return s.length;
|
|
331
|
-
const t = e.length + 1, a = s.length + 1,
|
|
331
|
+
const t = e.length + 1, a = s.length + 1, r = Array.from(
|
|
332
332
|
{ length: t },
|
|
333
|
-
(
|
|
333
|
+
(i, n) => Array.from({ length: a }, (o, l) => n === 0 ? l : l === 0 ? n : 0)
|
|
334
334
|
);
|
|
335
|
-
for (let
|
|
335
|
+
for (let i = 1; i < t; i++)
|
|
336
336
|
for (let n = 1; n < a; n++) {
|
|
337
|
-
const o = s[n - 1] === e[
|
|
338
|
-
i
|
|
339
|
-
i
|
|
337
|
+
const o = s[n - 1] === e[i - 1] ? 0 : 1;
|
|
338
|
+
r[i][n] = Math.min(
|
|
339
|
+
r[i - 1][n] + 1,
|
|
340
340
|
// deletion
|
|
341
|
-
i
|
|
341
|
+
r[i][n - 1] + 1,
|
|
342
342
|
// insertion
|
|
343
|
-
i
|
|
343
|
+
r[i - 1][n - 1] + o
|
|
344
344
|
// substitution
|
|
345
345
|
);
|
|
346
346
|
}
|
|
347
|
-
return
|
|
347
|
+
return r[e.length][s.length];
|
|
348
348
|
}, U = (s) => {
|
|
349
349
|
let t = null, a = 3;
|
|
350
|
-
const
|
|
351
|
-
for (const
|
|
352
|
-
const n = j(
|
|
353
|
-
n <= 2 && n < a && (a = n, t =
|
|
350
|
+
const r = s.toLowerCase();
|
|
351
|
+
for (const i of Object.keys(D)) {
|
|
352
|
+
const n = j(r, i);
|
|
353
|
+
n <= 2 && n < a && (a = n, t = i);
|
|
354
354
|
}
|
|
355
355
|
return t;
|
|
356
356
|
}, _ = () => {
|
|
@@ -364,32 +364,32 @@ const z = {
|
|
|
364
364
|
message: s("validation.emailInvalid"),
|
|
365
365
|
suggestion: null
|
|
366
366
|
};
|
|
367
|
-
const
|
|
368
|
-
if (
|
|
367
|
+
const r = t.indexOf("@");
|
|
368
|
+
if (r === -1)
|
|
369
369
|
return {
|
|
370
370
|
isValid: !1,
|
|
371
371
|
message: s("validation.emailInvalid"),
|
|
372
372
|
suggestion: null
|
|
373
373
|
};
|
|
374
|
-
const
|
|
374
|
+
const i = t.substring(0, r), n = t.substring(r + 1);
|
|
375
375
|
if (!n.includes(".")) {
|
|
376
376
|
const l = K(n);
|
|
377
377
|
if (l)
|
|
378
378
|
return {
|
|
379
379
|
isValid: !1,
|
|
380
380
|
message: s("validation.emailSuggestion", {
|
|
381
|
-
email: `${
|
|
381
|
+
email: `${i}@${l}`
|
|
382
382
|
}),
|
|
383
|
-
suggestion: `${
|
|
383
|
+
suggestion: `${i}@${l}`
|
|
384
384
|
};
|
|
385
385
|
for (const c of Object.keys(D))
|
|
386
386
|
if (c.replace(/\./g, "") === n)
|
|
387
387
|
return {
|
|
388
388
|
isValid: !1,
|
|
389
389
|
message: s("validation.emailSuggestion", {
|
|
390
|
-
email: `${
|
|
390
|
+
email: `${i}@${c}`
|
|
391
391
|
}),
|
|
392
|
-
suggestion: `${
|
|
392
|
+
suggestion: `${i}@${c}`
|
|
393
393
|
};
|
|
394
394
|
}
|
|
395
395
|
if (!a.test(t))
|
|
@@ -400,7 +400,7 @@ const z = {
|
|
|
400
400
|
};
|
|
401
401
|
const o = U(n);
|
|
402
402
|
if (o && o !== n) {
|
|
403
|
-
const l = `${
|
|
403
|
+
const l = `${i}@${o}`;
|
|
404
404
|
return {
|
|
405
405
|
isValid: !1,
|
|
406
406
|
message: s("validation.emailSuggestion", { email: l }),
|
|
@@ -426,10 +426,10 @@ const z = {
|
|
|
426
426
|
return s("validation.nameRequired");
|
|
427
427
|
},
|
|
428
428
|
cardExpiry: (t) => {
|
|
429
|
-
const a = t.replace(/\s/g, ""), [
|
|
430
|
-
if (!
|
|
429
|
+
const a = t.replace(/\s/g, ""), [r, i] = a.split("/").map((u) => u.trim());
|
|
430
|
+
if (!r || !i || r.length !== 2 || i.length !== 2)
|
|
431
431
|
return s("validation.cardExpiryFormat");
|
|
432
|
-
const n = /* @__PURE__ */ new Date(), o = n.getFullYear() % 100, l = n.getMonth() + 1, c = parseInt(
|
|
432
|
+
const n = /* @__PURE__ */ new Date(), o = n.getFullYear() % 100, l = n.getMonth() + 1, c = parseInt(r, 10), d = parseInt(i, 10);
|
|
433
433
|
if (c < 1 || c > 12)
|
|
434
434
|
return s("validation.cardExpiryFormat");
|
|
435
435
|
if (d < o || d === o && c < l)
|
|
@@ -459,34 +459,34 @@ const z = {
|
|
|
459
459
|
const u = t(d, l[d]);
|
|
460
460
|
u && (c[d] = u);
|
|
461
461
|
}), c;
|
|
462
|
-
},
|
|
462
|
+
}, r = (l) => {
|
|
463
463
|
const c = a(l);
|
|
464
464
|
return Object.keys(c).length === 0;
|
|
465
|
-
},
|
|
465
|
+
}, i = (l, c) => {
|
|
466
466
|
const d = e.getState();
|
|
467
467
|
let u = c;
|
|
468
468
|
l in z && (u = z[l](c));
|
|
469
469
|
const E = {
|
|
470
470
|
...d.formData,
|
|
471
471
|
[l]: u
|
|
472
|
-
},
|
|
472
|
+
}, f = { ...d.errors };
|
|
473
473
|
if (d.touched[l]) {
|
|
474
474
|
const m = t(l, u);
|
|
475
|
-
m ?
|
|
475
|
+
m ? f[l] = m : delete f[l];
|
|
476
476
|
}
|
|
477
477
|
e.setState({
|
|
478
478
|
formData: E,
|
|
479
|
-
errors:
|
|
480
|
-
isValid:
|
|
479
|
+
errors: f,
|
|
480
|
+
isValid: r(E)
|
|
481
481
|
});
|
|
482
482
|
}, n = (l, c) => {
|
|
483
483
|
const d = e.getState(), u = {
|
|
484
484
|
...d.touched,
|
|
485
485
|
[l]: !0
|
|
486
|
-
}, E = t(l, c),
|
|
487
|
-
E ?
|
|
486
|
+
}, E = t(l, c), f = { ...d.errors };
|
|
487
|
+
E ? f[l] = E : delete f[l], e.setState({
|
|
488
488
|
touched: u,
|
|
489
|
-
errors:
|
|
489
|
+
errors: f
|
|
490
490
|
});
|
|
491
491
|
}, o = (l) => {
|
|
492
492
|
const d = {
|
|
@@ -495,13 +495,13 @@ const z = {
|
|
|
495
495
|
};
|
|
496
496
|
e.setState({
|
|
497
497
|
formData: d,
|
|
498
|
-
isValid:
|
|
498
|
+
isValid: r(d)
|
|
499
499
|
});
|
|
500
500
|
};
|
|
501
501
|
return {
|
|
502
502
|
getFormState: e.getState.bind(e),
|
|
503
503
|
subscribe: e.subscribe.bind(e),
|
|
504
|
-
handleChange:
|
|
504
|
+
handleChange: i,
|
|
505
505
|
handleBlur: n,
|
|
506
506
|
setFormData: o,
|
|
507
507
|
reset: e.resetState.bind(e)
|
|
@@ -511,7 +511,7 @@ const z = {
|
|
|
511
511
|
apiKey: e,
|
|
512
512
|
environment: t
|
|
513
513
|
}) => {
|
|
514
|
-
const a = k(t),
|
|
514
|
+
const a = k(t), r = await fetch(
|
|
515
515
|
`${a}/tokenization/generate-iframe-configuration`,
|
|
516
516
|
{
|
|
517
517
|
method: "POST",
|
|
@@ -522,9 +522,9 @@ const z = {
|
|
|
522
522
|
body: JSON.stringify(s)
|
|
523
523
|
}
|
|
524
524
|
);
|
|
525
|
-
if (!
|
|
526
|
-
throw new Error(`HTTP error! Status: ${
|
|
527
|
-
return await
|
|
525
|
+
if (!r.ok)
|
|
526
|
+
throw new Error(`HTTP error! Status: ${r.status}`);
|
|
527
|
+
return await r.json();
|
|
528
528
|
}, Z = 100, J = 2, W = 2e3, X = 5;
|
|
529
529
|
function Q({
|
|
530
530
|
apiKey: s,
|
|
@@ -532,9 +532,9 @@ function Q({
|
|
|
532
532
|
checkoutProfile: e,
|
|
533
533
|
inputStyles: t,
|
|
534
534
|
setFormData: a,
|
|
535
|
-
environment:
|
|
535
|
+
environment: r
|
|
536
536
|
}) {
|
|
537
|
-
const
|
|
537
|
+
const i = L({
|
|
538
538
|
iframeConfig: void 0,
|
|
539
539
|
loadingIframe: !0,
|
|
540
540
|
isCcValid: !1,
|
|
@@ -551,9 +551,9 @@ function Q({
|
|
|
551
551
|
allowedOrigins: [globalThis.location.origin]
|
|
552
552
|
},
|
|
553
553
|
apiKey: s,
|
|
554
|
-
environment:
|
|
554
|
+
environment: r
|
|
555
555
|
});
|
|
556
|
-
m && (
|
|
556
|
+
m && (i.setState({
|
|
557
557
|
iframeConfig: {
|
|
558
558
|
...m,
|
|
559
559
|
origin: globalThis.location.origin
|
|
@@ -563,17 +563,13 @@ function Q({
|
|
|
563
563
|
console.error("Failed to generate iframe config:", m);
|
|
564
564
|
}
|
|
565
565
|
}, l = () => {
|
|
566
|
-
const m =
|
|
566
|
+
const m = i.getState();
|
|
567
567
|
if (!m.iframeConfig || !e)
|
|
568
568
|
return;
|
|
569
|
-
const
|
|
570
|
-
if (!
|
|
569
|
+
const y = document.getElementById("card-element"), v = document.getElementById("card-cvv-element");
|
|
570
|
+
if (!y || !v)
|
|
571
571
|
throw new Error("Card elements not found in DOM");
|
|
572
|
-
|
|
573
|
-
cardElementId: g.id,
|
|
574
|
-
cvvElementId: f.id,
|
|
575
|
-
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
576
|
-
}), n = new globalThis.TokenEx.Iframe("card-element", {
|
|
572
|
+
n = new globalThis.TokenEx.Iframe("card-element", {
|
|
577
573
|
...m.iframeConfig,
|
|
578
574
|
placeholder: "1234 1234 1234 1234",
|
|
579
575
|
cvvPlaceholder: "CVC",
|
|
@@ -598,7 +594,7 @@ function Q({
|
|
|
598
594
|
}
|
|
599
595
|
}
|
|
600
596
|
}), n.on("load", () => {
|
|
601
|
-
|
|
597
|
+
i.setState({ loadingIframe: !1 });
|
|
602
598
|
}), n.on("autoCompleteValues", function(p) {
|
|
603
599
|
const { nameOnCard: C, cardExp: b } = p;
|
|
604
600
|
a({
|
|
@@ -607,32 +603,32 @@ function Q({
|
|
|
607
603
|
});
|
|
608
604
|
}), n.on("validate", function(p) {
|
|
609
605
|
const { isValid: C, isCvvValid: b } = p;
|
|
610
|
-
|
|
606
|
+
i.setState({
|
|
611
607
|
isCcValid: C,
|
|
612
608
|
isCvvValid: b
|
|
613
609
|
});
|
|
614
610
|
}), n.on("focus", function() {
|
|
615
|
-
|
|
611
|
+
i.setState({ isFocused: !0 });
|
|
616
612
|
}), n.on("blur", function() {
|
|
617
|
-
|
|
613
|
+
i.setState({ isFocused: !1 });
|
|
618
614
|
}), n.on("cvvFocus", function() {
|
|
619
|
-
|
|
615
|
+
i.setState({ isCvvFocused: !0 });
|
|
620
616
|
}), n.on("cvvBlur", function() {
|
|
621
|
-
|
|
617
|
+
i.setState({ isCvvFocused: !1 });
|
|
622
618
|
}), n.on(
|
|
623
619
|
"cardTypeChange",
|
|
624
620
|
function({ possibleCardType: p }) {
|
|
625
|
-
|
|
621
|
+
i.setState({ possibleCardType: p });
|
|
626
622
|
}
|
|
627
623
|
), n.load();
|
|
628
624
|
}, c = () => {
|
|
629
625
|
let m = 0;
|
|
630
|
-
const
|
|
626
|
+
const y = X;
|
|
631
627
|
console.warn(
|
|
632
628
|
"Card elements not found in DOM, retrying iframe initialization..."
|
|
633
629
|
);
|
|
634
|
-
const
|
|
635
|
-
if (m++, m >
|
|
630
|
+
const v = () => {
|
|
631
|
+
if (m++, m > y) {
|
|
636
632
|
console.error("Failed to find card elements after maximum retries");
|
|
637
633
|
return;
|
|
638
634
|
}
|
|
@@ -645,26 +641,22 @@ function Q({
|
|
|
645
641
|
if (C && b)
|
|
646
642
|
try {
|
|
647
643
|
l();
|
|
648
|
-
} catch (
|
|
649
|
-
console.error("Failed to create TokenEx iframe:",
|
|
644
|
+
} catch (g) {
|
|
645
|
+
console.error("Failed to create TokenEx iframe:", g);
|
|
650
646
|
}
|
|
651
|
-
else m <
|
|
647
|
+
else m < y && v();
|
|
652
648
|
}, p);
|
|
653
649
|
};
|
|
654
|
-
|
|
650
|
+
v();
|
|
655
651
|
}, d = () => {
|
|
656
|
-
if (!
|
|
652
|
+
if (!i.getState().iframeConfig || !e)
|
|
657
653
|
return;
|
|
658
654
|
if (!globalThis.TokenEx?.Iframe) {
|
|
659
655
|
console.error("TokenEx script not loaded correctly");
|
|
660
656
|
return;
|
|
661
657
|
}
|
|
662
|
-
const
|
|
663
|
-
if (
|
|
664
|
-
cardElementExists: !!g,
|
|
665
|
-
cvvElementExists: !!f,
|
|
666
|
-
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
667
|
-
}), !g || !f) {
|
|
658
|
+
const y = document.getElementById("card-element"), v = document.getElementById("card-cvv-element");
|
|
659
|
+
if (!y || !v) {
|
|
668
660
|
c();
|
|
669
661
|
return;
|
|
670
662
|
}
|
|
@@ -677,25 +669,25 @@ function Q({
|
|
|
677
669
|
s && await o();
|
|
678
670
|
}, E = () => {
|
|
679
671
|
n && (n.remove(), n = null);
|
|
680
|
-
},
|
|
681
|
-
n && (n.on("tokenize", async function(
|
|
682
|
-
await m(
|
|
672
|
+
}, f = async (m) => {
|
|
673
|
+
n && (n.on("tokenize", async function(y) {
|
|
674
|
+
await m(y);
|
|
683
675
|
}), n.tokenize());
|
|
684
676
|
};
|
|
685
677
|
return {
|
|
686
|
-
getState:
|
|
687
|
-
subscribe:
|
|
688
|
-
tokenize:
|
|
678
|
+
getState: i.getState.bind(i),
|
|
679
|
+
subscribe: i.subscribe.bind(i),
|
|
680
|
+
tokenize: f,
|
|
689
681
|
cleanup: E,
|
|
690
682
|
initialize: u
|
|
691
683
|
};
|
|
692
684
|
}
|
|
693
|
-
const ee = "E-Mail", te = "Name des/der Karteninhaber/in", ae = "Kartendaten",
|
|
685
|
+
const ee = "E-Mail", te = "Name des/der Karteninhaber/in", ae = "Kartendaten", re = "Vollständiger Name", ie = "MM / JJ", ne = "Das Fenster nicht schließen", se = { 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" }, le = {
|
|
694
686
|
email: ee,
|
|
695
687
|
cardholderNameLabel: te,
|
|
696
688
|
cardInformation: ae,
|
|
697
|
-
cardholderNamePlaceholder:
|
|
698
|
-
cardExpiry:
|
|
689
|
+
cardholderNamePlaceholder: re,
|
|
690
|
+
cardExpiry: ie,
|
|
699
691
|
loading: ne,
|
|
700
692
|
buttonTexts: se,
|
|
701
693
|
validation: oe
|
|
@@ -744,12 +736,12 @@ const ee = "E-Mail", te = "Name des/der Karteninhaber/in", ae = "Kartendaten", i
|
|
|
744
736
|
loading: Je,
|
|
745
737
|
buttonTexts: We,
|
|
746
738
|
validation: Xe
|
|
747
|
-
}, et = "E-mail", tt = "Nome do titular do cartão", at = "Informações do cartão",
|
|
739
|
+
}, et = "E-mail", tt = "Nome do titular do cartão", at = "Informações do cartão", rt = "Nome completo no cartão", it = "MM / AA", nt = "Por favor, não feche esta janela", st = { 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" }, lt = {
|
|
748
740
|
email: et,
|
|
749
741
|
cardholderNameLabel: tt,
|
|
750
742
|
cardInformation: at,
|
|
751
|
-
cardholderNamePlaceholder:
|
|
752
|
-
cardExpiry:
|
|
743
|
+
cardholderNamePlaceholder: rt,
|
|
744
|
+
cardExpiry: it,
|
|
753
745
|
loading: nt,
|
|
754
746
|
buttonTexts: st,
|
|
755
747
|
validation: ot
|
|
@@ -796,18 +788,18 @@ class vt {
|
|
|
796
788
|
}
|
|
797
789
|
findNestedValue(e, t) {
|
|
798
790
|
const a = t.split(".");
|
|
799
|
-
let
|
|
800
|
-
for (const
|
|
801
|
-
if (
|
|
791
|
+
let r = e;
|
|
792
|
+
for (const i of a) {
|
|
793
|
+
if (r == null || !Object.prototype.hasOwnProperty.call(r, i))
|
|
802
794
|
return;
|
|
803
|
-
|
|
795
|
+
r = r[i];
|
|
804
796
|
}
|
|
805
|
-
return typeof
|
|
797
|
+
return typeof r == "string" ? r : void 0;
|
|
806
798
|
}
|
|
807
799
|
interpolate(e, t) {
|
|
808
|
-
return e.replace(/{{(\w+)}}/g, (a,
|
|
809
|
-
const
|
|
810
|
-
return
|
|
800
|
+
return e.replace(/{{(\w+)}}/g, (a, r) => {
|
|
801
|
+
const i = t[r];
|
|
802
|
+
return i === void 0 ? a : String(i);
|
|
811
803
|
});
|
|
812
804
|
}
|
|
813
805
|
}
|
|
@@ -827,18 +819,18 @@ function bt(s) {
|
|
|
827
819
|
return A.includes(o) ? o : Et;
|
|
828
820
|
})();
|
|
829
821
|
e.setLocale(a);
|
|
830
|
-
const
|
|
822
|
+
const r = L({
|
|
831
823
|
locale: a,
|
|
832
824
|
translationService: e
|
|
833
825
|
});
|
|
834
826
|
return {
|
|
835
|
-
store:
|
|
836
|
-
translate: (o, l) =>
|
|
827
|
+
store: r,
|
|
828
|
+
translate: (o, l) => r.getState().translationService.translate(o, l),
|
|
837
829
|
setLocale: (o) => {
|
|
838
|
-
A.includes(o) && (
|
|
830
|
+
A.includes(o) && (r.getState().translationService.setLocale(o), r.setState({ locale: o }));
|
|
839
831
|
},
|
|
840
|
-
getLocale: () =>
|
|
841
|
-
subscribe:
|
|
832
|
+
getLocale: () => r.getValue("locale"),
|
|
833
|
+
subscribe: r.subscribe.bind(r)
|
|
842
834
|
};
|
|
843
835
|
}
|
|
844
836
|
const Ct = bt(), I = () => {
|
|
@@ -856,22 +848,22 @@ const Ct = bt(), I = () => {
|
|
|
856
848
|
} };
|
|
857
849
|
const e = s.replace(/\s+/g, "+"), t = `https://fonts.googleapis.com/css2?family=${e}:wght@400;700&display=swap`, a = [...document.head.querySelectorAll("link")].filter(
|
|
858
850
|
(o) => o.href.includes("fonts.googleapis.com/css2") && o.rel === "stylesheet"
|
|
859
|
-
),
|
|
860
|
-
|
|
861
|
-
const
|
|
851
|
+
), r = document.createElement("link");
|
|
852
|
+
r.rel = "stylesheet", r.href = t;
|
|
853
|
+
const i = a.find(
|
|
862
854
|
(o) => o.href.includes(`family=${e}`)
|
|
863
855
|
);
|
|
864
|
-
if (
|
|
865
|
-
|
|
856
|
+
if (i)
|
|
857
|
+
i.href = t;
|
|
866
858
|
else if (a.length > 0) {
|
|
867
859
|
const o = a.at(
|
|
868
860
|
-1
|
|
869
861
|
);
|
|
870
|
-
o?.nextSibling ? document.head.insertBefore(
|
|
862
|
+
o?.nextSibling ? document.head.insertBefore(r, o.nextSibling) : document.head.appendChild(r);
|
|
871
863
|
} else
|
|
872
|
-
document.head.appendChild(
|
|
864
|
+
document.head.appendChild(r);
|
|
873
865
|
return { cleanup: () => {
|
|
874
|
-
document.head.contains(
|
|
866
|
+
document.head.contains(r) && document.head.removeChild(r);
|
|
875
867
|
} };
|
|
876
868
|
}, xt = ({
|
|
877
869
|
scriptSrc: s,
|
|
@@ -893,7 +885,7 @@ const Ct = bt(), I = () => {
|
|
|
893
885
|
};
|
|
894
886
|
const a = document.createElement("script");
|
|
895
887
|
a.src = s, a.async = e;
|
|
896
|
-
const
|
|
888
|
+
const r = new Promise((n, o) => {
|
|
897
889
|
a.onload = () => n(!0), a.onerror = () => {
|
|
898
890
|
console.error(`Failed to load script: ${s}`), o(new Error(`Failed to load script: ${s}`));
|
|
899
891
|
};
|
|
@@ -902,11 +894,11 @@ const Ct = bt(), I = () => {
|
|
|
902
894
|
cleanup: () => {
|
|
903
895
|
document.head.contains(a) && document.head.removeChild(a);
|
|
904
896
|
},
|
|
905
|
-
isLoaded:
|
|
897
|
+
isLoaded: r
|
|
906
898
|
};
|
|
907
899
|
}, w = (s) => Object.entries(s).map(([e, t]) => {
|
|
908
|
-
const a = e.replace(/([A-Z])/g, "-$1").toLowerCase(),
|
|
909
|
-
return `${a}: ${
|
|
900
|
+
const a = e.replace(/([A-Z])/g, "-$1").toLowerCase(), r = typeof t == "number" ? `${t}px` : t;
|
|
901
|
+
return `${a}: ${r}`;
|
|
910
902
|
}).join("; ");
|
|
911
903
|
function Ft(s) {
|
|
912
904
|
if (!s)
|
|
@@ -941,22 +933,22 @@ function Ft(s) {
|
|
|
941
933
|
fontFamily: `${s.styles.fontFamily}, sans-serif`
|
|
942
934
|
}, a = {
|
|
943
935
|
color: "#dc2727"
|
|
944
|
-
}, i = {
|
|
945
|
-
outline: 0
|
|
946
936
|
}, r = {
|
|
937
|
+
outline: 0
|
|
938
|
+
}, i = {
|
|
947
939
|
fontFamily: `${s.styles.fontFamily}, sans-serif`
|
|
948
940
|
}, n = {
|
|
949
941
|
base: w(e),
|
|
950
942
|
error: w(a),
|
|
951
|
-
focus: w(
|
|
943
|
+
focus: w(r),
|
|
952
944
|
placeholder: w(t)
|
|
953
945
|
};
|
|
954
946
|
return {
|
|
955
|
-
formContainerStyle:
|
|
947
|
+
formContainerStyle: i,
|
|
956
948
|
baseStyles: e,
|
|
957
949
|
placeholderStyles: t,
|
|
958
950
|
errorStyles: a,
|
|
959
|
-
focusStyles:
|
|
951
|
+
focusStyles: r,
|
|
960
952
|
inputStyles: n
|
|
961
953
|
};
|
|
962
954
|
}
|
|
@@ -971,8 +963,8 @@ class h {
|
|
|
971
963
|
* @param attributes Optional attributes to set on the element
|
|
972
964
|
*/
|
|
973
965
|
constructor(e, t = [], a = {}) {
|
|
974
|
-
this.element = document.createElement(e), t.length > 0 && this.addClass(...t), Object.entries(a).forEach(([
|
|
975
|
-
this.setAttribute(
|
|
966
|
+
this.element = document.createElement(e), t.length > 0 && this.addClass(...t), Object.entries(a).forEach(([r, i]) => {
|
|
967
|
+
this.setAttribute(r, i);
|
|
976
968
|
});
|
|
977
969
|
}
|
|
978
970
|
/**
|
|
@@ -1074,26 +1066,26 @@ class S {
|
|
|
1074
1066
|
* Create a button element
|
|
1075
1067
|
*/
|
|
1076
1068
|
static createButton(e, t = [], a = {}) {
|
|
1077
|
-
const
|
|
1078
|
-
return
|
|
1069
|
+
const r = new h("button", t, a);
|
|
1070
|
+
return r.setText(e), r;
|
|
1079
1071
|
}
|
|
1080
1072
|
/**
|
|
1081
1073
|
* Create an input element
|
|
1082
1074
|
*/
|
|
1083
1075
|
static createInput(e, t = [], a = {}) {
|
|
1084
|
-
const
|
|
1085
|
-
return new h("input", t,
|
|
1076
|
+
const r = { type: e, ...a };
|
|
1077
|
+
return new h("input", t, r);
|
|
1086
1078
|
}
|
|
1087
1079
|
/**
|
|
1088
1080
|
* Create a text input
|
|
1089
1081
|
*/
|
|
1090
1082
|
static createTextInput(e = "", t = [], a = {}) {
|
|
1091
|
-
const
|
|
1083
|
+
const r = {
|
|
1092
1084
|
type: "text",
|
|
1093
1085
|
placeholder: e,
|
|
1094
1086
|
...a
|
|
1095
1087
|
};
|
|
1096
|
-
return new h("input", t,
|
|
1088
|
+
return new h("input", t, r);
|
|
1097
1089
|
}
|
|
1098
1090
|
/**
|
|
1099
1091
|
* Create a form element
|
|
@@ -1104,26 +1096,26 @@ class S {
|
|
|
1104
1096
|
/**
|
|
1105
1097
|
* Create a label element
|
|
1106
1098
|
*/
|
|
1107
|
-
static createLabel(e, t = "", a = [],
|
|
1108
|
-
const
|
|
1099
|
+
static createLabel(e, t = "", a = [], r = {}) {
|
|
1100
|
+
const i = t ? { for: t, ...r } : r, n = new h("label", a, i);
|
|
1109
1101
|
return n.setText(e), n;
|
|
1110
1102
|
}
|
|
1111
1103
|
/**
|
|
1112
1104
|
* Create a select element
|
|
1113
1105
|
*/
|
|
1114
1106
|
static createSelect(e, t = [], a = {}) {
|
|
1115
|
-
const
|
|
1116
|
-
return e.forEach((
|
|
1107
|
+
const r = new h("select", t, a);
|
|
1108
|
+
return e.forEach((i) => {
|
|
1117
1109
|
const n = document.createElement("option");
|
|
1118
|
-
n.value =
|
|
1119
|
-
}),
|
|
1110
|
+
n.value = i.value, n.textContent = i.text, i.selected && (n.selected = !0), r.getElement().appendChild(n);
|
|
1111
|
+
}), r;
|
|
1120
1112
|
}
|
|
1121
1113
|
/**
|
|
1122
1114
|
* Create an image element
|
|
1123
1115
|
*/
|
|
1124
|
-
static createImage(e, t = "", a = [],
|
|
1125
|
-
const
|
|
1126
|
-
return new h("img", a,
|
|
1116
|
+
static createImage(e, t = "", a = [], r = {}) {
|
|
1117
|
+
const i = { src: e, alt: t, ...r };
|
|
1118
|
+
return new h("img", a, i);
|
|
1127
1119
|
}
|
|
1128
1120
|
}
|
|
1129
1121
|
class wt extends h {
|
|
@@ -1133,18 +1125,18 @@ class wt extends h {
|
|
|
1133
1125
|
const t = S.createDiv(["error-alert"], {
|
|
1134
1126
|
role: "alert",
|
|
1135
1127
|
"aria-live": "polite"
|
|
1136
|
-
}), a = S.createDiv(["error-alert-content"]),
|
|
1128
|
+
}), a = S.createDiv(["error-alert-content"]), r = S.createDiv([
|
|
1137
1129
|
"error-alert-icon-container"
|
|
1138
1130
|
]);
|
|
1139
|
-
|
|
1140
|
-
const
|
|
1131
|
+
r.getElement().innerHTML = this.createAlertCircleSVG();
|
|
1132
|
+
const i = S.createDiv([
|
|
1141
1133
|
"error-alert-text-container"
|
|
1142
1134
|
]), n = new h("h4", [
|
|
1143
1135
|
"error-alert-title"
|
|
1144
1136
|
]);
|
|
1145
1137
|
n.setText("Checkout Error"), this.messageComponent = new h("p", [
|
|
1146
1138
|
"error-alert-message"
|
|
1147
|
-
]), this.messageComponent.setText(e.message || "Bad request"),
|
|
1139
|
+
]), this.messageComponent.setText(e.message || "Bad request"), i.appendChild(n), i.appendChild(this.messageComponent), a.appendChild(r), a.appendChild(i), t.appendChild(a), this.appendChild(t);
|
|
1148
1140
|
}
|
|
1149
1141
|
createAlertCircleSVG() {
|
|
1150
1142
|
return `
|
|
@@ -1250,8 +1242,8 @@ class Mt {
|
|
|
1250
1242
|
const {
|
|
1251
1243
|
value: t,
|
|
1252
1244
|
onChange: a,
|
|
1253
|
-
onBlur:
|
|
1254
|
-
error:
|
|
1245
|
+
onBlur: r,
|
|
1246
|
+
error: i,
|
|
1255
1247
|
errorMsg: n,
|
|
1256
1248
|
checkoutProfile: o,
|
|
1257
1249
|
translationFunc: l,
|
|
@@ -1260,7 +1252,7 @@ class Mt {
|
|
|
1260
1252
|
this.input = new T({
|
|
1261
1253
|
name: "name",
|
|
1262
1254
|
label: l("cardholderNameLabel"),
|
|
1263
|
-
error:
|
|
1255
|
+
error: i,
|
|
1264
1256
|
errorMsg: n,
|
|
1265
1257
|
styles: {
|
|
1266
1258
|
color: o.styles.textColor,
|
|
@@ -1275,7 +1267,7 @@ class Mt {
|
|
|
1275
1267
|
this.trim(), a(d);
|
|
1276
1268
|
}
|
|
1277
1269
|
}), this.input.addEventListener("blur", (d) => {
|
|
1278
|
-
|
|
1270
|
+
r(d);
|
|
1279
1271
|
});
|
|
1280
1272
|
}
|
|
1281
1273
|
getValue() {
|
|
@@ -1341,18 +1333,18 @@ class At extends h {
|
|
|
1341
1333
|
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);
|
|
1342
1334
|
const a = document.createElement("div");
|
|
1343
1335
|
a.className = e.isLoading ? "loading" : "", a.style.borderRadius = `${e.styles.borderRadius}px ${e.styles.borderRadius}px 0px 0px`;
|
|
1344
|
-
const i = document.createElement("div");
|
|
1345
|
-
i.id = "card-element", i.className = `card-element ${e.isFocused ? "card-element-focus" : ""}`, i.style.zIndex = e.isFocused ? "2" : "0";
|
|
1346
1336
|
const r = document.createElement("div");
|
|
1347
|
-
|
|
1337
|
+
r.id = "card-element", r.className = `card-element ${e.isFocused ? "card-element-focus" : ""}`, r.style.zIndex = e.isFocused ? "2" : "0";
|
|
1338
|
+
const i = document.createElement("div");
|
|
1339
|
+
if (i.className = "cards-position", e.cardType === "unknown")
|
|
1348
1340
|
F.forEach((n) => {
|
|
1349
|
-
|
|
1341
|
+
i.appendChild(this.createCardIcon(n));
|
|
1350
1342
|
});
|
|
1351
1343
|
else {
|
|
1352
1344
|
const n = F.find((o) => o.type === e.cardType);
|
|
1353
|
-
n &&
|
|
1345
|
+
n && i.appendChild(this.createCardIcon(n));
|
|
1354
1346
|
}
|
|
1355
|
-
|
|
1347
|
+
r.appendChild(i), a.appendChild(r), this.getElement().appendChild(a);
|
|
1356
1348
|
}
|
|
1357
1349
|
createCardIcon(e) {
|
|
1358
1350
|
const t = document.createElement("div");
|
|
@@ -1380,13 +1372,13 @@ class At extends h {
|
|
|
1380
1372
|
const a = this.getElement().querySelector(".cards-position");
|
|
1381
1373
|
if (a)
|
|
1382
1374
|
if (a.innerHTML = "", this.cardType === "unknown")
|
|
1383
|
-
F.forEach((
|
|
1384
|
-
a.appendChild(this.createCardIcon(
|
|
1375
|
+
F.forEach((r) => {
|
|
1376
|
+
a.appendChild(this.createCardIcon(r));
|
|
1385
1377
|
});
|
|
1386
1378
|
else {
|
|
1387
|
-
const
|
|
1388
|
-
|
|
1389
|
-
a.appendChild(this.createCardIcon(
|
|
1379
|
+
const r = F.find((i) => i.type === this.cardType);
|
|
1380
|
+
r ? a.appendChild(this.createCardIcon(r)) : F.forEach((i) => {
|
|
1381
|
+
a.appendChild(this.createCardIcon(i));
|
|
1390
1382
|
});
|
|
1391
1383
|
}
|
|
1392
1384
|
return this;
|
|
@@ -1402,8 +1394,8 @@ class Pt extends h {
|
|
|
1402
1394
|
const {
|
|
1403
1395
|
checkoutProfile: t,
|
|
1404
1396
|
isLoading: a,
|
|
1405
|
-
isFocused:
|
|
1406
|
-
isCvvFocused:
|
|
1397
|
+
isFocused: r,
|
|
1398
|
+
isCvvFocused: i,
|
|
1407
1399
|
isCcValid: n,
|
|
1408
1400
|
isCvvValid: o,
|
|
1409
1401
|
cardType: l,
|
|
@@ -1411,11 +1403,11 @@ class Pt extends h {
|
|
|
1411
1403
|
cardExpiryError: d,
|
|
1412
1404
|
cardExpiryTouched: u,
|
|
1413
1405
|
onChange: E,
|
|
1414
|
-
onBlur:
|
|
1406
|
+
onBlur: f,
|
|
1415
1407
|
translationFunc: m,
|
|
1416
|
-
cardExpiryAutocomplete:
|
|
1417
|
-
} = e,
|
|
1418
|
-
|
|
1408
|
+
cardExpiryAutocomplete: y = "cc-exp"
|
|
1409
|
+
} = e, v = document.createElement("div");
|
|
1410
|
+
this.cardNumber = new At({
|
|
1419
1411
|
styles: {
|
|
1420
1412
|
color: t.styles.textColor,
|
|
1421
1413
|
fontSize: t.styles.fontSize,
|
|
@@ -1423,9 +1415,9 @@ class Pt extends h {
|
|
|
1423
1415
|
},
|
|
1424
1416
|
label: m("cardInformation"),
|
|
1425
1417
|
isLoading: a,
|
|
1426
|
-
isFocused:
|
|
1418
|
+
isFocused: r,
|
|
1427
1419
|
cardType: l
|
|
1428
|
-
}),
|
|
1420
|
+
}), v.appendChild(this.cardNumber.getElement());
|
|
1429
1421
|
const p = document.createElement("div");
|
|
1430
1422
|
p.className = "card-details", this.cardExpiry = new T({
|
|
1431
1423
|
name: "cardExpiry",
|
|
@@ -1433,9 +1425,9 @@ class Pt extends h {
|
|
|
1433
1425
|
error: !!(d && u),
|
|
1434
1426
|
errorMsg: d,
|
|
1435
1427
|
value: c,
|
|
1436
|
-
autocomplete:
|
|
1437
|
-
onChange: (
|
|
1438
|
-
this.trimCardExpiry(), E(
|
|
1428
|
+
autocomplete: y,
|
|
1429
|
+
onChange: (g) => {
|
|
1430
|
+
this.trimCardExpiry(), E(g);
|
|
1439
1431
|
},
|
|
1440
1432
|
styles: {
|
|
1441
1433
|
color: t.styles.textColor,
|
|
@@ -1443,8 +1435,8 @@ class Pt extends h {
|
|
|
1443
1435
|
fontSize: t.styles.fontSize,
|
|
1444
1436
|
fontFamily: t.styles.fontFamily
|
|
1445
1437
|
}
|
|
1446
|
-
}), this.cardExpiry.addEventListener("blur",
|
|
1447
|
-
const M =
|
|
1438
|
+
}), this.cardExpiry.addEventListener("blur", f), this.cardExpiry.addEventListener("keydown", (g) => {
|
|
1439
|
+
const M = g;
|
|
1448
1440
|
![
|
|
1449
1441
|
"Backspace",
|
|
1450
1442
|
"Delete",
|
|
@@ -1461,18 +1453,18 @@ class Pt extends h {
|
|
|
1461
1453
|
borderRadius: typeof t.styles.borderRadius == "number" ? t.styles.borderRadius : 0
|
|
1462
1454
|
},
|
|
1463
1455
|
isLoading: a,
|
|
1464
|
-
isFocused:
|
|
1465
|
-
}), b.appendChild(this.cardCvv.getElement()), p.appendChild(this.cardExpiry.getElement()), p.appendChild(b),
|
|
1466
|
-
const
|
|
1456
|
+
isFocused: i
|
|
1457
|
+
}), b.appendChild(this.cardCvv.getElement()), p.appendChild(this.cardExpiry.getElement()), p.appendChild(b), v.appendChild(p), this.getElement().appendChild(v), r && !n) {
|
|
1458
|
+
const g = new x({
|
|
1467
1459
|
text: m("validation.cardNumberInvalid")
|
|
1468
1460
|
});
|
|
1469
|
-
this.validationMessages.set("cardNumber",
|
|
1461
|
+
this.validationMessages.set("cardNumber", g), this.appendChild(g);
|
|
1470
1462
|
}
|
|
1471
|
-
if (
|
|
1472
|
-
const
|
|
1463
|
+
if (i && !o) {
|
|
1464
|
+
const g = new x({
|
|
1473
1465
|
text: m("validation.cardSecurityFormat")
|
|
1474
1466
|
});
|
|
1475
|
-
this.validationMessages.set("cardCvv",
|
|
1467
|
+
this.validationMessages.set("cardCvv", g), this.appendChild(g);
|
|
1476
1468
|
}
|
|
1477
1469
|
}
|
|
1478
1470
|
updateCardType(e) {
|
|
@@ -1491,28 +1483,28 @@ class Pt extends h {
|
|
|
1491
1483
|
updateCardNumberValidation(e, t, a) {
|
|
1492
1484
|
if (this.cardNumber.setFocused(e), e && !t) {
|
|
1493
1485
|
if (!this.validationMessages.has("cardNumber")) {
|
|
1494
|
-
const
|
|
1486
|
+
const r = new x({
|
|
1495
1487
|
text: a("validation.cardNumberInvalid")
|
|
1496
1488
|
});
|
|
1497
|
-
this.validationMessages.set("cardNumber",
|
|
1489
|
+
this.validationMessages.set("cardNumber", r), this.appendChild(r);
|
|
1498
1490
|
}
|
|
1499
1491
|
} else {
|
|
1500
|
-
const
|
|
1501
|
-
|
|
1492
|
+
const r = this.validationMessages.get("cardNumber");
|
|
1493
|
+
r && (r.getElement().remove(), this.validationMessages.delete("cardNumber"));
|
|
1502
1494
|
}
|
|
1503
1495
|
return this;
|
|
1504
1496
|
}
|
|
1505
1497
|
updateCardCvvValidation(e, t, a) {
|
|
1506
1498
|
if (this.cardCvv.setFocused(e), e && !t) {
|
|
1507
1499
|
if (!this.validationMessages.has("cardCvv")) {
|
|
1508
|
-
const
|
|
1500
|
+
const r = new x({
|
|
1509
1501
|
text: a("validation.cardSecurityFormat")
|
|
1510
1502
|
});
|
|
1511
|
-
this.validationMessages.set("cardCvv",
|
|
1503
|
+
this.validationMessages.set("cardCvv", r), this.appendChild(r);
|
|
1512
1504
|
}
|
|
1513
1505
|
} else {
|
|
1514
|
-
const
|
|
1515
|
-
|
|
1506
|
+
const r = this.validationMessages.get("cardCvv");
|
|
1507
|
+
r && (r.getElement().remove(), this.validationMessages.delete("cardCvv"));
|
|
1516
1508
|
}
|
|
1517
1509
|
return this;
|
|
1518
1510
|
}
|
|
@@ -1526,8 +1518,8 @@ class Dt {
|
|
|
1526
1518
|
const {
|
|
1527
1519
|
value: t,
|
|
1528
1520
|
onChange: a,
|
|
1529
|
-
onBlur:
|
|
1530
|
-
error:
|
|
1521
|
+
onBlur: r,
|
|
1522
|
+
error: i,
|
|
1531
1523
|
errorMsg: n,
|
|
1532
1524
|
checkoutProfile: o,
|
|
1533
1525
|
translationFunc: l,
|
|
@@ -1536,7 +1528,7 @@ class Dt {
|
|
|
1536
1528
|
this.input = new T({
|
|
1537
1529
|
name: "email",
|
|
1538
1530
|
label: l("email"),
|
|
1539
|
-
error:
|
|
1531
|
+
error: i,
|
|
1540
1532
|
errorMsg: n,
|
|
1541
1533
|
styles: {
|
|
1542
1534
|
color: o.styles.textColor,
|
|
@@ -1552,7 +1544,7 @@ class Dt {
|
|
|
1552
1544
|
onChange: (d) => {
|
|
1553
1545
|
this.trim(), a(d);
|
|
1554
1546
|
}
|
|
1555
|
-
}), this.input.addEventListener("blur",
|
|
1547
|
+
}), this.input.addEventListener("blur", r);
|
|
1556
1548
|
}
|
|
1557
1549
|
getValue() {
|
|
1558
1550
|
return this.input.getValue();
|
|
@@ -1583,10 +1575,10 @@ class Rt extends h {
|
|
|
1583
1575
|
super("div", ["paypal"]);
|
|
1584
1576
|
const { formData: t, onSubmit: a } = e;
|
|
1585
1577
|
this.formData = t, this.onSubmit = a, this.getElement().style.cursor = a ? "pointer" : "default", this.getElement().style.opacity = "1";
|
|
1586
|
-
const
|
|
1587
|
-
|
|
1588
|
-
const
|
|
1589
|
-
|
|
1578
|
+
const r = document.createElement("div");
|
|
1579
|
+
r.className = "paypal-icon-container";
|
|
1580
|
+
const i = document.createElement("img");
|
|
1581
|
+
i.src = $t, i.style.width = "69px", i.style.height = "22px", i.style.maxWidth = "100%", i.style.display = "block", i.style.height = "auto", r.appendChild(i), this.getElement().appendChild(r), a && this.getElement().addEventListener("click", () => this.handleSubmit());
|
|
1590
1582
|
}
|
|
1591
1583
|
async handleSubmit() {
|
|
1592
1584
|
if (!(!this.onSubmit || this.isSubmitting)) {
|
|
@@ -1610,27 +1602,26 @@ class Rt extends h {
|
|
|
1610
1602
|
class Vt extends h {
|
|
1611
1603
|
paymentMethods;
|
|
1612
1604
|
constructor(e) {
|
|
1613
|
-
const { checkoutProfile: t, formData: a, onPaypalSubmit:
|
|
1614
|
-
if (!t?.additionalPaymentMethods) {
|
|
1615
|
-
|
|
1605
|
+
const { checkoutProfile: t, formData: a, onPaypalSubmit: r } = e;
|
|
1606
|
+
if (super("div", ["payment-methods"]), this.paymentMethods = /* @__PURE__ */ new Map(), !t?.additionalPaymentMethods) {
|
|
1607
|
+
this.getElement().style.display = "none";
|
|
1616
1608
|
return;
|
|
1617
1609
|
}
|
|
1618
|
-
const
|
|
1610
|
+
const i = Object.entries(
|
|
1619
1611
|
t.additionalPaymentMethods
|
|
1620
1612
|
).filter(([, n]) => n.enabled).sort((n, o) => n[1].order - o[1].order);
|
|
1621
|
-
if (
|
|
1622
|
-
|
|
1613
|
+
if (i.length === 0) {
|
|
1614
|
+
this.getElement().style.display = "none";
|
|
1623
1615
|
return;
|
|
1624
1616
|
}
|
|
1625
|
-
|
|
1626
|
-
for (const [n] of r)
|
|
1617
|
+
for (const [n] of i)
|
|
1627
1618
|
switch (n) {
|
|
1628
1619
|
case "paypal": {
|
|
1629
|
-
if (
|
|
1620
|
+
if (r) {
|
|
1630
1621
|
const o = new Rt({
|
|
1631
1622
|
checkoutProfile: t,
|
|
1632
1623
|
formData: a,
|
|
1633
|
-
onSubmit:
|
|
1624
|
+
onSubmit: r
|
|
1634
1625
|
});
|
|
1635
1626
|
this.paymentMethods.set("paypal", o), o.appendTo(this.getElement());
|
|
1636
1627
|
}
|
|
@@ -1673,9 +1664,9 @@ class Ot extends h {
|
|
|
1673
1664
|
class Ht {
|
|
1674
1665
|
button;
|
|
1675
1666
|
constructor(e) {
|
|
1676
|
-
const { disabled: t, checkoutProfile: a, translationFunc:
|
|
1667
|
+
const { disabled: t, checkoutProfile: a, translationFunc: r } = e;
|
|
1677
1668
|
this.button = new Ot({
|
|
1678
|
-
text:
|
|
1669
|
+
text: r(
|
|
1679
1670
|
`buttonTexts.${a?.layout.actionButton.translationKey}`
|
|
1680
1671
|
),
|
|
1681
1672
|
styles: {
|
|
@@ -1774,51 +1765,42 @@ class Ut extends h {
|
|
|
1774
1765
|
console.error("Cannot initialize iframe: No checkout profile available");
|
|
1775
1766
|
return;
|
|
1776
1767
|
}
|
|
1777
|
-
if (this.iframeHook)
|
|
1778
|
-
console.log("TokenEx iframe already initialized, skipping");
|
|
1779
|
-
return;
|
|
1780
|
-
}
|
|
1781
|
-
try {
|
|
1782
|
-
if (!("TokenEx" in globalThis))
|
|
1783
|
-
return console.log("TokenEx not available yet, retrying..."), new Promise((n) => {
|
|
1784
|
-
setTimeout(() => {
|
|
1785
|
-
this.initializeTokenExIframe().then(n);
|
|
1786
|
-
}, 500);
|
|
1787
|
-
});
|
|
1788
|
-
const { inputStyles: t, formContainerStyle: a } = Ft(
|
|
1789
|
-
e.checkoutProfile
|
|
1790
|
-
);
|
|
1791
|
-
this.applyFormContainerStyles(a);
|
|
1768
|
+
if (!this.iframeHook)
|
|
1792
1769
|
try {
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
const i = document.getElementById("card-element"), r = document.getElementById("card-cvv-element");
|
|
1802
|
-
if (!i || !r) {
|
|
1803
|
-
console.error(
|
|
1804
|
-
"Card elements not found, cannot initialize TokenEx iframe"
|
|
1770
|
+
if (!("TokenEx" in globalThis))
|
|
1771
|
+
return new Promise((n) => {
|
|
1772
|
+
setTimeout(() => {
|
|
1773
|
+
this.initializeTokenExIframe().then(n);
|
|
1774
|
+
}, 500);
|
|
1775
|
+
});
|
|
1776
|
+
const { inputStyles: t, formContainerStyle: a } = Ft(
|
|
1777
|
+
e.checkoutProfile
|
|
1805
1778
|
);
|
|
1806
|
-
|
|
1779
|
+
this.applyFormContainerStyles(a);
|
|
1780
|
+
try {
|
|
1781
|
+
this.cardSection || this.createCardSection(e.checkoutProfile);
|
|
1782
|
+
} catch (n) {
|
|
1783
|
+
console.error("Failed to create card section:", n);
|
|
1784
|
+
}
|
|
1785
|
+
const r = document.getElementById("card-element"), i = document.getElementById("card-cvv-element");
|
|
1786
|
+
if (!r || !i) {
|
|
1787
|
+
console.error(
|
|
1788
|
+
"Card elements not found, cannot initialize TokenEx iframe"
|
|
1789
|
+
);
|
|
1790
|
+
return;
|
|
1791
|
+
}
|
|
1792
|
+
this.iframeHook = Q({
|
|
1793
|
+
apiKey: this.options.apiKey,
|
|
1794
|
+
checkoutProfile: e.checkoutProfile,
|
|
1795
|
+
inputStyles: t,
|
|
1796
|
+
setFormData: (n) => {
|
|
1797
|
+
this.formManager.setFormData(n);
|
|
1798
|
+
},
|
|
1799
|
+
environment: this.options.environment
|
|
1800
|
+
}), this.iframeHook?.subscribe(this.handleIframeStateChange), await this.iframeHook?.initialize();
|
|
1801
|
+
} catch (t) {
|
|
1802
|
+
throw console.error("Failed to initialize payment form:", t), t;
|
|
1807
1803
|
}
|
|
1808
|
-
this.iframeHook = Q({
|
|
1809
|
-
apiKey: this.options.apiKey,
|
|
1810
|
-
checkoutProfile: e.checkoutProfile,
|
|
1811
|
-
inputStyles: t,
|
|
1812
|
-
setFormData: (n) => {
|
|
1813
|
-
this.formManager.setFormData(n);
|
|
1814
|
-
},
|
|
1815
|
-
environment: this.options.environment
|
|
1816
|
-
}), this.iframeHook?.subscribe(this.handleIframeStateChange), await this.iframeHook?.initialize(), console.log("✅ TokenEx iframe initialized successfully:", {
|
|
1817
|
-
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
1818
|
-
});
|
|
1819
|
-
} catch (t) {
|
|
1820
|
-
throw console.error("Failed to initialize payment form:", t), t;
|
|
1821
|
-
}
|
|
1822
1804
|
};
|
|
1823
1805
|
handleIframeStateChange = (e) => {
|
|
1824
1806
|
this.cardSection && (this.cardSection.updateCardNumberValidation(
|
|
@@ -1834,8 +1816,8 @@ class Ut extends h {
|
|
|
1834
1816
|
createCardSection = (e) => {
|
|
1835
1817
|
if (!this.cardSection)
|
|
1836
1818
|
try {
|
|
1837
|
-
const { formData: t, errors: a, touched:
|
|
1838
|
-
let
|
|
1819
|
+
const { formData: t, errors: a, touched: r } = this._getFormStateData();
|
|
1820
|
+
let i = {
|
|
1839
1821
|
loadingIframe: !0,
|
|
1840
1822
|
isFocused: !1,
|
|
1841
1823
|
isCvvFocused: !1,
|
|
@@ -1843,17 +1825,17 @@ class Ut extends h {
|
|
|
1843
1825
|
isCvvValid: !1,
|
|
1844
1826
|
possibleCardType: "unknown"
|
|
1845
1827
|
};
|
|
1846
|
-
if (this.iframeHook && (
|
|
1828
|
+
if (this.iframeHook && (i = this.iframeHook.getState()), this.cardSection = new Pt({
|
|
1847
1829
|
checkoutProfile: e,
|
|
1848
|
-
isLoading:
|
|
1849
|
-
isFocused:
|
|
1850
|
-
isCvvFocused:
|
|
1851
|
-
isCcValid:
|
|
1852
|
-
isCvvValid:
|
|
1853
|
-
cardType:
|
|
1830
|
+
isLoading: i.loadingIframe,
|
|
1831
|
+
isFocused: i.isFocused,
|
|
1832
|
+
isCvvFocused: i.isCvvFocused,
|
|
1833
|
+
isCcValid: i.isCcValid,
|
|
1834
|
+
isCvvValid: i.isCvvValid,
|
|
1835
|
+
cardType: i.possibleCardType,
|
|
1854
1836
|
cardExpiry: t.cardExpiry,
|
|
1855
1837
|
cardExpiryError: a.cardExpiry,
|
|
1856
|
-
cardExpiryTouched: !!
|
|
1838
|
+
cardExpiryTouched: !!r.cardExpiry,
|
|
1857
1839
|
onChange: this.handleChange,
|
|
1858
1840
|
onBlur: this.handleBlur,
|
|
1859
1841
|
translationFunc: this.translation.t
|
|
@@ -1892,9 +1874,6 @@ class Ut extends h {
|
|
|
1892
1874
|
renderFormComponents() {
|
|
1893
1875
|
if (this.emailField)
|
|
1894
1876
|
return;
|
|
1895
|
-
console.log("🏗️ Starting form components rendering:", {
|
|
1896
|
-
timestamp: (/* @__PURE__ */ new Date()).toISOString()
|
|
1897
|
-
});
|
|
1898
1877
|
const e = this.checkoutProfile.getState();
|
|
1899
1878
|
if (!e.checkoutProfile) {
|
|
1900
1879
|
this.setErrorMessage("Failed to load checkout configuration");
|
|
@@ -1920,30 +1899,13 @@ class Ut extends h {
|
|
|
1920
1899
|
} catch (t) {
|
|
1921
1900
|
console.error("Failed to create submit button:", t);
|
|
1922
1901
|
}
|
|
1923
|
-
console.log("✅ Form components rendered successfully:", {
|
|
1924
|
-
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1925
|
-
components: {
|
|
1926
|
-
paymentMethods: !!this.paymentMethods,
|
|
1927
|
-
emailField: !!this.emailField,
|
|
1928
|
-
cardholderSection: !!this.cardholderSection,
|
|
1929
|
-
submitButton: !!this.submitButton
|
|
1930
|
-
}
|
|
1931
|
-
});
|
|
1932
1902
|
}
|
|
1933
1903
|
createPaymentMethods(e) {
|
|
1934
1904
|
try {
|
|
1935
|
-
if (!e?.additionalPaymentMethods
|
|
1936
|
-
console.log(
|
|
1937
|
-
"No additional payment methods configured, skipping component"
|
|
1938
|
-
);
|
|
1939
|
-
return;
|
|
1940
|
-
}
|
|
1941
|
-
if (Object.entries(
|
|
1905
|
+
if (!e?.additionalPaymentMethods || Object.entries(
|
|
1942
1906
|
e.additionalPaymentMethods
|
|
1943
|
-
).filter(([,
|
|
1944
|
-
console.log("No enabled payment methods found, skipping component");
|
|
1907
|
+
).filter(([, r]) => r.enabled).length === 0)
|
|
1945
1908
|
return;
|
|
1946
|
-
}
|
|
1947
1909
|
const { formData: a } = this._getFormStateData();
|
|
1948
1910
|
this.paymentMethods = new Vt({
|
|
1949
1911
|
checkoutProfile: e,
|
|
@@ -1951,39 +1913,39 @@ class Ut extends h {
|
|
|
1951
1913
|
onPaypalSubmit: async () => {
|
|
1952
1914
|
await this.handlePaypalSubmit();
|
|
1953
1915
|
}
|
|
1954
|
-
}), this.element.appendChild(this.paymentMethods.getElement())
|
|
1916
|
+
}), this.element.appendChild(this.paymentMethods.getElement());
|
|
1955
1917
|
} catch (t) {
|
|
1956
1918
|
throw console.error("Error creating payment methods:", t), t;
|
|
1957
1919
|
}
|
|
1958
1920
|
}
|
|
1959
1921
|
createEmailField(e) {
|
|
1960
1922
|
try {
|
|
1961
|
-
const { formData: t, errors: a, touched:
|
|
1923
|
+
const { formData: t, errors: a, touched: r } = this._getFormStateData();
|
|
1962
1924
|
this.emailField = new Dt({
|
|
1963
1925
|
value: t.email,
|
|
1964
1926
|
onChange: this.handleChange,
|
|
1965
1927
|
onBlur: this.handleBlur,
|
|
1966
|
-
error: !!(a.email &&
|
|
1928
|
+
error: !!(a.email && r.email),
|
|
1967
1929
|
errorMsg: a.email,
|
|
1968
1930
|
checkoutProfile: e,
|
|
1969
1931
|
translationFunc: this.translation.t
|
|
1970
|
-
}), this.element.appendChild(this.emailField.getElement())
|
|
1932
|
+
}), this.element.appendChild(this.emailField.getElement());
|
|
1971
1933
|
} catch (t) {
|
|
1972
1934
|
throw console.error("Error creating email field:", t), t;
|
|
1973
1935
|
}
|
|
1974
1936
|
}
|
|
1975
1937
|
createCardholderSection(e) {
|
|
1976
1938
|
try {
|
|
1977
|
-
const { formData: t, errors: a, touched:
|
|
1939
|
+
const { formData: t, errors: a, touched: r } = this._getFormStateData();
|
|
1978
1940
|
this.cardholderSection = new Mt({
|
|
1979
1941
|
value: t.name,
|
|
1980
1942
|
onChange: this.handleChange,
|
|
1981
1943
|
onBlur: this.handleBlur,
|
|
1982
|
-
error: !!(a.name &&
|
|
1944
|
+
error: !!(a.name && r.name),
|
|
1983
1945
|
errorMsg: a.name,
|
|
1984
1946
|
checkoutProfile: e,
|
|
1985
1947
|
translationFunc: this.translation.t
|
|
1986
|
-
}), this.element.appendChild(this.cardholderSection.getElement())
|
|
1948
|
+
}), this.element.appendChild(this.cardholderSection.getElement());
|
|
1987
1949
|
} catch (t) {
|
|
1988
1950
|
throw console.error("Error creating cardholder section:", t), t;
|
|
1989
1951
|
}
|
|
@@ -1994,18 +1956,18 @@ class Ut extends h {
|
|
|
1994
1956
|
disabled: this.isFormDisabled(),
|
|
1995
1957
|
checkoutProfile: e,
|
|
1996
1958
|
translationFunc: this.translation.t
|
|
1997
|
-
}), this.element.appendChild(this.submitButton.getElement())
|
|
1959
|
+
}), this.element.appendChild(this.submitButton.getElement());
|
|
1998
1960
|
} catch (t) {
|
|
1999
1961
|
throw console.error("Error creating submit button:", t), t;
|
|
2000
1962
|
}
|
|
2001
1963
|
}
|
|
2002
1964
|
handleChange = (e) => {
|
|
2003
|
-
const t = e.target, { name: a, value:
|
|
2004
|
-
this.formManager.handleChange(a,
|
|
1965
|
+
const t = e.target, { name: a, value: r } = t;
|
|
1966
|
+
this.formManager.handleChange(a, r);
|
|
2005
1967
|
};
|
|
2006
1968
|
handleBlur = (e) => {
|
|
2007
|
-
const t = e.target, { name: a, value:
|
|
2008
|
-
this.formManager.handleBlur(a,
|
|
1969
|
+
const t = e.target, { name: a, value: r } = t;
|
|
1970
|
+
this.formManager.handleBlur(a, r);
|
|
2009
1971
|
};
|
|
2010
1972
|
updateFormUI() {
|
|
2011
1973
|
const e = this.formManager.getFormState();
|
|
@@ -2028,12 +1990,12 @@ class Ut extends h {
|
|
|
2028
1990
|
isCvvValid: !1
|
|
2029
1991
|
};
|
|
2030
1992
|
this.iframeHook && (t = this.iframeHook.getState());
|
|
2031
|
-
const a = Object.keys(e.errors).length > 0,
|
|
1993
|
+
const a = Object.keys(e.errors).length > 0, r = (
|
|
2032
1994
|
// Only require card validation if CardSection exists
|
|
2033
1995
|
(!this.cardSection || t.isCcValid && t.isCvvValid) && !!e.formData.email && !!e.formData.name && // Only require card expiry if CardSection exists
|
|
2034
1996
|
(!this.cardSection || !!e.formData.cardExpiry)
|
|
2035
1997
|
);
|
|
2036
|
-
return a || !
|
|
1998
|
+
return a || !r || this.isSubmitting;
|
|
2037
1999
|
}
|
|
2038
2000
|
setLoadingState(e) {
|
|
2039
2001
|
if (this.options.onLoadingStateChange) {
|
package/dist/index.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.form-container{display:grid;gap:24px;padding:4px;position:relative;min-height:400px;max-width:100%;text-align:left}.form-container>*{font-family:inherit}.card-
|
|
1
|
+
.form-container{display:grid;gap:24px;padding:4px;position:relative;min-height:400px;max-width:100%;text-align:left}.form-container>*{font-family:inherit}.card-details{display:flex}@keyframes slideIn{0%{opacity:0;transform:translateY(-10px)}to{opacity:1;transform:translateY(0)}}.error-alert{background-color:#fef2f2;border:1px solid #fecaca;border-radius:8px;padding:16px;box-shadow:0 1px 3px #0000001a,0 1px 2px #0000000f;animation:slideIn .3s ease-out}.error-alert-content{display:flex;align-items:flex-start;gap:12px}.error-alert-icon-container{flex-shrink:0;display:flex;align-items:center;justify-content:center;width:32px;height:32px;background-color:#fee2e2;border-radius:50%;color:#dc2626}.error-alert-icon{color:#dc2626}.error-alert-text-container{flex:1;min-width:0}.error-alert-title{margin:0 0 4px;font-size:14px;font-weight:600;color:#991b1b;line-height:1.4}.error-alert-message{margin:0;font-size:14px;color:#7f1d1d;line-height:1.5;word-break:break-word}.blur-bg{position:absolute;inset:0;height:100%;width:100%;background:transparent;display:flex;flex-direction:column;align-items:center;justify-content:center;backdrop-filter:blur(2px);-webkit-backdrop-filter:blur(3.5px);z-index:9999}.loader{width:64px;height:64px;border:6px solid transparent;border-top:6px solid #4f81ff;border-right:6px solid #36d1dc;border-radius:50%;animation:spin 1s ease-in-out infinite,glow 1.5s ease-in-out infinite alternate;box-shadow:0 0 #4f81ff00}@keyframes spin{to{transform:rotate(360deg)}}@keyframes glow{0%{box-shadow:0 0 #4f81ff00}to{box-shadow:0 0 20px #4f81ff99}}.title{margin-top:20px;font-size:18px;color:#4f4f4f;animation:fadeIn 1s ease-in-out}@keyframes fadeIn{0%{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}.input-wrapper{display:flex;flex-direction:column;width:100%;flex-grow:1}.form-input{opacity:1;font-weight:400;letter-spacing:.02em;transition:box-shadow .1s ease-in,border-radius .2s ease-in;box-shadow:0 0 0 1px #e0e0e0,0 2px 4px #00000012,0 1px 1.5px #0000000d;background:#fff;padding:8px 12px;border:none;outline:none;line-height:1.5;z-index:0;box-sizing:border-box}.form-input-error{color:#dc2727}.form-input::placeholder{color:#717173;opacity:.3}.form-input:focus{box-shadow:0 0 0 1px #3297d3b3,0 1px 1px #00000012,0 0 0 4px #3297d34d;z-index:2}.form-helper-text{color:#dc2727;font-size:12px;font-weight:500;margin-top:4px}.input-label{margin-bottom:6px}.card-element{position:relative;height:38.5px;transition:box-shadow .1s ease-in;box-shadow:0 0 0 1px #e0e0e0,0 2px 4px #00000012,0 1px 1.5px #0000000d;padding:0;border:none;background:#fff;border-radius:inherit;box-sizing:border-box}.card-element iframe{width:100%;min-width:0}.card-element-focus{box-shadow:0 0 0 1px #3297d3b3,0 1px 1px #00000012,0 0 0 4px #3297d34d}.card-icon{width:16px;transition:opacity .6s ease-in;opacity:1}.card-icon img{max-width:100%;display:block;height:auto}.cards-position{position:absolute;z-index:10;right:20px;top:8px;display:flex;align-items:center;gap:8px;pointer-events:none}.loading{position:relative}.loading:after{content:"";position:absolute;inset:0;height:100%;width:100%;backdrop-filter:blur(3px);border-radius:inherit}@media only screen and (min-width: 600px){.card-icon{width:20px}}.paypal{background-color:#ffc439;color:#253b80;font-weight:700;padding:8px 16px;box-shadow:0 2px 4px #0000001a;text-transform:none;cursor:pointer;border-radius:4px}.paypal:hover{background-color:#ffc439;filter:brightness(.95)}.paypal-icon-container{display:flex;align-items:center;justify-content:center}.paypal-icon-container img{width:69px;height:22px}.button{position:relative;display:inline-flex;align-items:center;justify-content:center;padding:8px 16px;font-size:14px;font-weight:500;line-height:1.5;text-align:center;cursor:pointer;transition:all .2s ease;font-weight:700;border:none;outline:none;white-space:nowrap;height:min-content;width:100%}.disabled{pointer-events:none}.valid{outline:none;overflow:hidden;transition:all .3s ease}.valid:before{content:"";position:absolute;top:0;left:-100%;width:100%;height:100%;background:linear-gradient(90deg,transparent,rgba(255,255,255,.4),transparent);transition:left .5s;animation:glowSlide 6s infinite}@keyframes glowSlide{0%{left:-100%}50%{left:100%}to{left:100%}}.valid:after{content:"";position:absolute;top:0;left:0;width:100%;height:100%;background:linear-gradient(90deg,transparent 0%,rgba(255,255,255,.1) 25%,rgba(255,255,255,.3) 50%,rgba(255,255,255,.1) 75%,transparent 100%);transform:translate(-100%);animation:smoothGlow 7s infinite}@keyframes smoothGlow{0%{transform:translate(-100%)}to{transform:translate(100%)}}
|
package/dist/package.json
CHANGED