@nowramp/form 0.2.0-beta.22 → 0.2.0-beta.24
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/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +441 -431
- package/dist/index.js.map +1 -1
- package/dist/nowramp-form.iife.js +1 -1
- package/dist/nowramp-form.iife.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -13,8 +13,8 @@ import ke, { useState as w, useRef as I, useCallback as O, useEffect as B, useMe
|
|
|
13
13
|
import { RampApi as gt } from "@nowramp/sdk";
|
|
14
14
|
import { createPortal as oa } from "react-dom";
|
|
15
15
|
function nn(t, a, n) {
|
|
16
|
-
const [r, o] = w(null), [
|
|
17
|
-
(!
|
|
16
|
+
const [r, o] = w(null), [c, u] = w(!0), [l, d] = w(null), s = I(null);
|
|
17
|
+
(!s.current || s.current !== t) && (s.current = new gt({ apiKey: "", ...t }));
|
|
18
18
|
const h = O(async () => {
|
|
19
19
|
if (!t.projectId) {
|
|
20
20
|
d(new Error("projectId is required")), u(!1);
|
|
@@ -24,7 +24,7 @@ function nn(t, a, n) {
|
|
|
24
24
|
try {
|
|
25
25
|
const p = {};
|
|
26
26
|
a && (p.orderType = a), n && (p.country = n);
|
|
27
|
-
const f = await
|
|
27
|
+
const f = await s.current.getSupported(p);
|
|
28
28
|
o(f);
|
|
29
29
|
} catch (p) {
|
|
30
30
|
d(p instanceof Error ? p : new Error("Failed to fetch config"));
|
|
@@ -34,45 +34,45 @@ function nn(t, a, n) {
|
|
|
34
34
|
}, [t.projectId, a, n]);
|
|
35
35
|
return B(() => {
|
|
36
36
|
h();
|
|
37
|
-
}, [h]), { config: r, loading:
|
|
37
|
+
}, [h]), { config: r, loading: c, error: l, refetch: h };
|
|
38
38
|
}
|
|
39
39
|
function rn(t, a) {
|
|
40
|
-
const [n, r] = w(null), [o,
|
|
41
|
-
(!d.current ||
|
|
40
|
+
const [n, r] = w(null), [o, c] = w(!1), [u, l] = w(null), d = I(null), s = I(""), h = `${t.apiUrl}|${t.projectId}`;
|
|
41
|
+
(!d.current || s.current !== h) && (d.current = new gt({ apiKey: "", ...t }), s.current = h);
|
|
42
42
|
const p = I(0);
|
|
43
43
|
B(() => {
|
|
44
44
|
const g = ++p.current;
|
|
45
45
|
if (!a || !t.projectId) {
|
|
46
|
-
r(null),
|
|
46
|
+
r(null), c(!1);
|
|
47
47
|
return;
|
|
48
48
|
}
|
|
49
|
-
|
|
49
|
+
c(!0), l(null), d.current.getQuotes(a).then(
|
|
50
50
|
(k) => {
|
|
51
|
-
p.current === g && (r(k),
|
|
51
|
+
p.current === g && (r(k), c(!1));
|
|
52
52
|
},
|
|
53
53
|
(k) => {
|
|
54
|
-
p.current === g && (l(k instanceof Error ? k : new Error("Failed to fetch quotes")), r(null),
|
|
54
|
+
p.current === g && (l(k instanceof Error ? k : new Error("Failed to fetch quotes")), r(null), c(!1));
|
|
55
55
|
}
|
|
56
56
|
);
|
|
57
57
|
}, [t.projectId, a == null ? void 0 : a.fiatCurrency, a == null ? void 0 : a.fiatAmount, a == null ? void 0 : a.cryptoAmount, a == null ? void 0 : a.cryptoCurrency, a == null ? void 0 : a.network, a == null ? void 0 : a.paymentMethodId, a == null ? void 0 : a.country, a == null ? void 0 : a.orderType]);
|
|
58
58
|
const f = O(async () => {
|
|
59
59
|
if (!(!a || !t.projectId)) {
|
|
60
|
-
|
|
60
|
+
c(!0), l(null);
|
|
61
61
|
try {
|
|
62
62
|
const g = await d.current.getQuotes(a);
|
|
63
63
|
r(g);
|
|
64
64
|
} catch (g) {
|
|
65
65
|
l(g instanceof Error ? g : new Error("Failed to fetch quotes"));
|
|
66
66
|
} finally {
|
|
67
|
-
|
|
67
|
+
c(!1);
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
}, [t.projectId, a]);
|
|
71
71
|
return { quotes: n, loading: o, error: u, refetch: f };
|
|
72
72
|
}
|
|
73
73
|
function on(t) {
|
|
74
|
-
const [a, n] = w(null), [r, o] = w(!1), [
|
|
75
|
-
(!l.current || d.current !==
|
|
74
|
+
const [a, n] = w(null), [r, o] = w(!1), [c, u] = w(null), l = I(null), d = I(""), s = `${t.apiUrl}|${t.projectId}`;
|
|
75
|
+
(!l.current || d.current !== s) && (l.current = new gt({ apiKey: "", ...t }), d.current = s);
|
|
76
76
|
const h = O(async (f) => {
|
|
77
77
|
o(!0), u(null);
|
|
78
78
|
try {
|
|
@@ -87,16 +87,16 @@ function on(t) {
|
|
|
87
87
|
}, []), p = O(() => {
|
|
88
88
|
n(null), u(null);
|
|
89
89
|
}, []);
|
|
90
|
-
return { order: a, loading: r, error:
|
|
90
|
+
return { order: a, loading: r, error: c, createOrder: h, reset: p };
|
|
91
91
|
}
|
|
92
92
|
function ln(t, a, n) {
|
|
93
|
-
const [r, o] = w(null), [
|
|
94
|
-
|
|
93
|
+
const [r, o] = w(null), [c, u] = w(!1), [l, d] = w(null), s = I(null);
|
|
94
|
+
s.current || (s.current = new gt({ apiKey: "", projectId: "", ...t }));
|
|
95
95
|
const h = O(async () => {
|
|
96
96
|
if (a) {
|
|
97
97
|
u(!0), d(null);
|
|
98
98
|
try {
|
|
99
|
-
const p = await
|
|
99
|
+
const p = await s.current.getTransaction(a);
|
|
100
100
|
o(p);
|
|
101
101
|
} catch (p) {
|
|
102
102
|
d(p instanceof Error ? p : new Error("Failed to fetch status"));
|
|
@@ -118,7 +118,7 @@ function ln(t, a, n) {
|
|
|
118
118
|
return;
|
|
119
119
|
const f = setInterval(h, n.pollInterval);
|
|
120
120
|
return () => clearInterval(f);
|
|
121
|
-
}, [a, n == null ? void 0 : n.pollInterval, r == null ? void 0 : r.status, h]), { status: r, loading:
|
|
121
|
+
}, [a, n == null ? void 0 : n.pollInterval, r == null ? void 0 : r.status, h]), { status: r, loading: c, error: l, refetch: h };
|
|
122
122
|
}
|
|
123
123
|
const ft = [
|
|
124
124
|
{ code: "ad", name: "Andorra", defaultFiat: "EUR" },
|
|
@@ -315,7 +315,7 @@ const ft = [
|
|
|
315
315
|
], Ot = Object.fromEntries(
|
|
316
316
|
ft.map((t) => [t.code, t])
|
|
317
317
|
);
|
|
318
|
-
function
|
|
318
|
+
function Mt(t, a) {
|
|
319
319
|
if (!t) return "USD";
|
|
320
320
|
const n = Ot[t.toLowerCase()], r = (n == null ? void 0 : n.defaultFiat) || "USD";
|
|
321
321
|
return !a || a.length === 0 || a.includes(r) ? r : a.includes("USD") ? "USD" : a[0] || "USD";
|
|
@@ -330,11 +330,11 @@ function cn(t, a, n = xt) {
|
|
|
330
330
|
function sn(t, a, n = xt) {
|
|
331
331
|
const r = [];
|
|
332
332
|
for (const o of t) {
|
|
333
|
-
const
|
|
333
|
+
const c = o.networks.filter(
|
|
334
334
|
(u) => Kt(u.providers, a, n)
|
|
335
335
|
);
|
|
336
|
-
|
|
337
|
-
|
|
336
|
+
c.length > 0 && r.push(
|
|
337
|
+
c.length === o.networks.length ? o : { ...o, networks: c }
|
|
338
338
|
);
|
|
339
339
|
}
|
|
340
340
|
return r;
|
|
@@ -351,15 +351,15 @@ function un(t, a, n) {
|
|
|
351
351
|
if (!(t.cryptoCurrency && a.availableCryptos.some(
|
|
352
352
|
(l) => l.code === t.cryptoCurrency && l.networks.some((d) => d.id === t.network)
|
|
353
353
|
)) && a.availableCryptos.length > 0) {
|
|
354
|
-
const d = a.availableCryptos.find((h) => h.code === "BTC") || a.availableCryptos[0],
|
|
355
|
-
d.code !== t.cryptoCurrency && (r.cryptoCurrency = d.code, o = !0),
|
|
354
|
+
const d = a.availableCryptos.find((h) => h.code === "BTC") || a.availableCryptos[0], s = d.networks.find((h) => h.isDefault) || d.networks[0];
|
|
355
|
+
d.code !== t.cryptoCurrency && (r.cryptoCurrency = d.code, o = !0), s && s.id !== t.network && (r.network = s.id, o = !0);
|
|
356
356
|
}
|
|
357
357
|
} else if (!n.cryptoLocked && n.networkLocked) {
|
|
358
358
|
if (!(t.cryptoCurrency && a.availableCryptos.some(
|
|
359
359
|
(l) => l.code === t.cryptoCurrency && l.networks.some((d) => d.id === t.network)
|
|
360
360
|
))) {
|
|
361
361
|
const l = a.availableCryptos.find(
|
|
362
|
-
(d) => d.networks.some((
|
|
362
|
+
(d) => d.networks.some((s) => s.id === t.network)
|
|
363
363
|
);
|
|
364
364
|
l && l.code !== t.cryptoCurrency && (r.cryptoCurrency = l.code, o = !0);
|
|
365
365
|
}
|
|
@@ -370,12 +370,12 @@ function un(t, a, n) {
|
|
|
370
370
|
if (u && !u.networks.some(
|
|
371
371
|
(d) => d.id === t.network
|
|
372
372
|
) && u.networks.length > 0) {
|
|
373
|
-
const d = u.networks.find((
|
|
373
|
+
const d = u.networks.find((s) => s.isDefault) || u.networks[0];
|
|
374
374
|
d.id !== t.network && (r.network = d.id, o = !0);
|
|
375
375
|
}
|
|
376
376
|
}
|
|
377
377
|
if (!n.fiatLocked && !(t.fiatCurrency && a.availableFiats.some((l) => l.code === t.fiatCurrency)) && a.availableFiats.length > 0) {
|
|
378
|
-
const d = a.availableFiats.find((
|
|
378
|
+
const d = a.availableFiats.find((s) => s.code === "USD") || a.availableFiats[0];
|
|
379
379
|
d.code !== t.fiatCurrency && (r.fiatCurrency = d.code, o = !0);
|
|
380
380
|
}
|
|
381
381
|
if (!(t.paymentMethodId && a.availablePaymentMethods.some(
|
|
@@ -389,18 +389,18 @@ function un(t, a, n) {
|
|
|
389
389
|
return o ? r : null;
|
|
390
390
|
}
|
|
391
391
|
function mn(t, a, n, r) {
|
|
392
|
-
var o,
|
|
392
|
+
var o, c, u;
|
|
393
393
|
if (n.cryptoLocked) {
|
|
394
394
|
const l = (o = t.cryptos) == null ? void 0 : o.find(
|
|
395
|
-
(
|
|
395
|
+
(s) => s.code === a.cryptoCurrency
|
|
396
396
|
);
|
|
397
397
|
if (!l) return !0;
|
|
398
|
-
const d = (
|
|
398
|
+
const d = (c = l.networks) == null ? void 0 : c.find((s) => s.id === a.network);
|
|
399
399
|
if (!d || d.providers !== void 0 && d.providers.length === 0 || d.providers !== void 0 && (r.availableFiats.length === 0 || r.availablePaymentMethods.length === 0))
|
|
400
400
|
return !0;
|
|
401
401
|
}
|
|
402
402
|
if (n.networkLocked && !n.cryptoLocked && !r.availableCryptos.some(
|
|
403
|
-
(d) => d.networks.some((
|
|
403
|
+
(d) => d.networks.some((s) => s.id === a.network)
|
|
404
404
|
))
|
|
405
405
|
return !0;
|
|
406
406
|
if (n.fiatLocked) {
|
|
@@ -453,7 +453,7 @@ const yn = ["completed", "failed", "cancelled", "expired", "refunded"], va = {
|
|
|
453
453
|
errorMessage: null
|
|
454
454
|
};
|
|
455
455
|
function gn(t, a) {
|
|
456
|
-
var n, r, o,
|
|
456
|
+
var n, r, o, c, u, l, d, s;
|
|
457
457
|
switch (a.type) {
|
|
458
458
|
case "SET_STEP":
|
|
459
459
|
return { ...t, step: a.step, errorMessage: null };
|
|
@@ -464,8 +464,8 @@ function gn(t, a) {
|
|
|
464
464
|
fiatAmount: "",
|
|
465
465
|
cryptoAmount: "",
|
|
466
466
|
fiatCurrency: (r = (n = a.fieldLocks) == null ? void 0 : n.sourceCurrency) != null && r.locked ? t.fiatCurrency : "",
|
|
467
|
-
cryptoCurrency: (
|
|
468
|
-
network: (l = (u = a.fieldLocks) == null ? void 0 : u.network) != null && l.locked || (
|
|
467
|
+
cryptoCurrency: (c = (o = a.fieldLocks) == null ? void 0 : o.destinationCurrency) != null && c.locked ? t.cryptoCurrency : "",
|
|
468
|
+
network: (l = (u = a.fieldLocks) == null ? void 0 : u.network) != null && l.locked || (s = (d = a.fieldLocks) == null ? void 0 : d.destinationCurrency) != null && s.locked ? t.network : "",
|
|
469
469
|
paymentMethodId: "",
|
|
470
470
|
selectedQuote: null,
|
|
471
471
|
selectedProvider: null,
|
|
@@ -519,81 +519,81 @@ function xn(t) {
|
|
|
519
519
|
projectId: n,
|
|
520
520
|
apiUrl: r = "https://api.nowramp.com",
|
|
521
521
|
assetBaseUrl: o = "",
|
|
522
|
-
flowType:
|
|
522
|
+
flowType: c = "buy",
|
|
523
523
|
customerId: u = "",
|
|
524
524
|
brandId: l,
|
|
525
525
|
defaultFiatCurrency: d = "USD",
|
|
526
|
-
defaultCryptoCurrency:
|
|
526
|
+
defaultCryptoCurrency: s = "BTC",
|
|
527
527
|
defaultNetwork: h = "",
|
|
528
528
|
defaultFiatAmount: p = "",
|
|
529
529
|
defaultCryptoAmount: f = "",
|
|
530
530
|
defaultWalletAddress: g = "",
|
|
531
531
|
defaultGateway: k,
|
|
532
|
-
defaultCountry:
|
|
532
|
+
defaultCountry: R,
|
|
533
533
|
fieldLocks: y,
|
|
534
|
-
partnerMetadata:
|
|
534
|
+
partnerMetadata: E,
|
|
535
535
|
statusPollInterval: K = 5e3,
|
|
536
536
|
onComplete: ee,
|
|
537
537
|
onError: z,
|
|
538
538
|
children: ie
|
|
539
|
-
} = t, J = W(() => ({ apiUrl: r, projectId: n }), [r, n]), q = h || (
|
|
539
|
+
} = t, J = W(() => ({ apiUrl: r, projectId: n }), [r, n]), q = h || (s === "BTC" ? "bitcoin" : s ? s.toLowerCase() : ""), Ce = c === "sell", te = Ce ? !!f : !!p, C = (Ce ? !!(te && s && q) : !!(te && s && q && g)) && k ? "confirm" : "amount", F = p || (c === "buy" ? "250" : ""), [m, M] = an(gn, {
|
|
540
540
|
...va,
|
|
541
541
|
step: C,
|
|
542
|
-
flowType:
|
|
542
|
+
flowType: c,
|
|
543
543
|
fiatCurrency: d,
|
|
544
|
-
cryptoCurrency:
|
|
544
|
+
cryptoCurrency: s,
|
|
545
545
|
network: q,
|
|
546
546
|
fiatAmount: ia(F, 2),
|
|
547
547
|
cryptoAmount: ia(f, 6),
|
|
548
548
|
walletAddress: g,
|
|
549
549
|
customerId: u,
|
|
550
550
|
// If defaultCountry is provided, set it immediately with 'manual' source to skip auto-detection
|
|
551
|
-
...
|
|
551
|
+
...R ? { country: R.toLowerCase(), countrySource: "manual" } : {}
|
|
552
552
|
}), N = m.flowType === "sell", {
|
|
553
553
|
config: S,
|
|
554
554
|
loading: ae,
|
|
555
555
|
error: pe
|
|
556
556
|
} = nn(J, m.flowType, m.country || void 0), be = I(!1);
|
|
557
557
|
ke.useEffect(() => {
|
|
558
|
-
var
|
|
558
|
+
var D, U;
|
|
559
559
|
if (be.current || !(S != null && S.detectedCountry) || m.country) return;
|
|
560
560
|
be.current = !0;
|
|
561
561
|
const v = S.detectedCountry.toLowerCase();
|
|
562
|
-
|
|
563
|
-
const A = (
|
|
564
|
-
L !== m.fiatCurrency && !((U = y == null ? void 0 : y.sourceCurrency) != null && U.locked) && !a.current &&
|
|
562
|
+
M({ type: "SET_COUNTRY_AUTO", country: v });
|
|
563
|
+
const A = (D = S.fiats) == null ? void 0 : D.map((_) => _.code), L = Mt(v, A);
|
|
564
|
+
L !== m.fiatCurrency && !((U = y == null ? void 0 : y.sourceCurrency) != null && U.locked) && !a.current && M({ type: "SET_FIAT_CURRENCY", currency: L });
|
|
565
565
|
}, [S, m.country, m.fiatCurrency, y]);
|
|
566
566
|
const Te = I(!1);
|
|
567
567
|
ke.useEffect(() => {
|
|
568
|
-
var L,
|
|
569
|
-
if (Te.current || !
|
|
568
|
+
var L, D;
|
|
569
|
+
if (Te.current || !R || !((L = S == null ? void 0 : S.fiats) != null && L.length)) return;
|
|
570
570
|
Te.current = !0;
|
|
571
|
-
const v = S.fiats.map((U) => U.code), A =
|
|
572
|
-
A !== m.fiatCurrency && !((
|
|
573
|
-
}, [
|
|
571
|
+
const v = S.fiats.map((U) => U.code), A = Mt(R, v);
|
|
572
|
+
A !== m.fiatCurrency && !((D = y == null ? void 0 : y.sourceCurrency) != null && D.locked) && !a.current && M({ type: "SET_FIAT_CURRENCY", currency: A });
|
|
573
|
+
}, [R, S, m.fiatCurrency, y]);
|
|
574
574
|
const he = I(m.country);
|
|
575
575
|
ke.useEffect(() => {
|
|
576
|
-
var L,
|
|
576
|
+
var L, D;
|
|
577
577
|
if (m.country === he.current || (he.current = m.country, m.countrySource === "manual" && (_e.current = !1), m.countrySource !== "manual") || !((L = S == null ? void 0 : S.fiats) != null && L.length)) return;
|
|
578
|
-
const v = S.fiats.map((U) => U.code), A =
|
|
579
|
-
A !== m.fiatCurrency && !((
|
|
578
|
+
const v = S.fiats.map((U) => U.code), A = Mt(m.country, v);
|
|
579
|
+
A !== m.fiatCurrency && !((D = y == null ? void 0 : y.sourceCurrency) != null && D.locked) && M({ type: "SET_FIAT_CURRENCY", currency: A });
|
|
580
580
|
}, [m.country, m.countrySource, S, m.fiatCurrency, y]);
|
|
581
581
|
const le = I(m.fiatCurrency);
|
|
582
582
|
ke.useEffect(() => {
|
|
583
|
-
var
|
|
584
|
-
if (m.fiatCurrency === le.current || (le.current = m.fiatCurrency, N || !((
|
|
583
|
+
var D;
|
|
584
|
+
if (m.fiatCurrency === le.current || (le.current = m.fiatCurrency, N || !((D = S == null ? void 0 : S.fiats) != null && D.length) || !m.fiatAmount)) return;
|
|
585
585
|
const v = S.fiats.find((U) => U.code === m.fiatCurrency);
|
|
586
586
|
if (!(v != null && v.minAmount)) return;
|
|
587
587
|
const A = parseFloat(m.fiatAmount), L = parseFloat(v.minAmount);
|
|
588
|
-
!isNaN(A) && !isNaN(L) && A < L &&
|
|
588
|
+
!isNaN(A) && !isNaN(L) && A < L && M({ type: "SET_FIAT_AMOUNT", amount: String(Math.ceil(L)) });
|
|
589
589
|
}, [m.fiatCurrency, m.fiatAmount, S, N]);
|
|
590
590
|
const { availableFiats: ce, availableCryptos: X, availablePaymentMethods: fe } = W(() => {
|
|
591
|
-
var L,
|
|
591
|
+
var L, D, U;
|
|
592
592
|
if (!S)
|
|
593
593
|
return { availableFiats: [], availableCryptos: [], availablePaymentMethods: [] };
|
|
594
594
|
let v;
|
|
595
595
|
if (m.cryptoCurrency && m.network) {
|
|
596
|
-
const _ = (L = S.cryptos) == null ? void 0 : L.find((Se) => Se.code === m.cryptoCurrency), ue = (
|
|
596
|
+
const _ = (L = S.cryptos) == null ? void 0 : L.find((Se) => Se.code === m.cryptoCurrency), ue = (D = _ == null ? void 0 : _.networks) == null ? void 0 : D.find((Se) => Se.id === m.network);
|
|
597
597
|
!_ || !ue ? v = [] : v = ue.providers;
|
|
598
598
|
}
|
|
599
599
|
let A;
|
|
@@ -634,7 +634,7 @@ function xn(t) {
|
|
|
634
634
|
fe
|
|
635
635
|
]);
|
|
636
636
|
ke.useEffect(() => {
|
|
637
|
-
var A, L,
|
|
637
|
+
var A, L, D;
|
|
638
638
|
if (ae || ce.length === 0 && X.length === 0) return;
|
|
639
639
|
const v = un(
|
|
640
640
|
{
|
|
@@ -647,10 +647,10 @@ function xn(t) {
|
|
|
647
647
|
{
|
|
648
648
|
cryptoLocked: !!((A = y == null ? void 0 : y.destinationCurrency) != null && A.locked),
|
|
649
649
|
networkLocked: !!((L = y == null ? void 0 : y.network) != null && L.locked),
|
|
650
|
-
fiatLocked: !!((
|
|
650
|
+
fiatLocked: !!((D = y == null ? void 0 : y.sourceCurrency) != null && D.locked)
|
|
651
651
|
}
|
|
652
652
|
);
|
|
653
|
-
v && (v.cryptoCurrency !== void 0 &&
|
|
653
|
+
v && (v.cryptoCurrency !== void 0 && M({ type: "SET_CRYPTO_CURRENCY", currency: v.cryptoCurrency }), v.network !== void 0 && M({ type: "SET_NETWORK", network: v.network }), v.fiatCurrency !== void 0 && M({ type: "SET_FIAT_CURRENCY", currency: v.fiatCurrency }), v.paymentMethodId !== void 0 && M({ type: "SET_PAYMENT_METHOD", methodId: v.paymentMethodId }));
|
|
654
654
|
}, [
|
|
655
655
|
ae,
|
|
656
656
|
ce,
|
|
@@ -661,7 +661,7 @@ function xn(t) {
|
|
|
661
661
|
m.fiatCurrency,
|
|
662
662
|
m.paymentMethodId,
|
|
663
663
|
y,
|
|
664
|
-
|
|
664
|
+
M
|
|
665
665
|
]);
|
|
666
666
|
const re = W(() => {
|
|
667
667
|
if (N) {
|
|
@@ -674,11 +674,11 @@ function xn(t) {
|
|
|
674
674
|
if (isNaN(v)) return null;
|
|
675
675
|
const A = S.fiats.find((U) => U.code === m.fiatCurrency);
|
|
676
676
|
if (!A) return null;
|
|
677
|
-
const L = parseFloat(A.minAmount),
|
|
678
|
-
return !isNaN(L) && v < L ? `Minimum amount is ${A.minAmount} ${m.fiatCurrency}` : !isNaN(
|
|
677
|
+
const L = parseFloat(A.minAmount), D = parseFloat(A.maxAmount);
|
|
678
|
+
return !isNaN(L) && v < L ? `Minimum amount is ${A.minAmount} ${m.fiatCurrency}` : !isNaN(D) && v > D ? `Maximum amount is ${A.maxAmount} ${m.fiatCurrency}` : null;
|
|
679
679
|
}, [S, m.fiatAmount, m.fiatCurrency, m.cryptoAmount, N]), ye = W(() => {
|
|
680
680
|
const v = N ? !!m.cryptoAmount : !!m.fiatAmount;
|
|
681
|
-
return !S || !v || !m.fiatCurrency || !m.cryptoCurrency || !m.network || re || S.detectedCountry && m.countrySource === "" && !
|
|
681
|
+
return !S || !v || !m.fiatCurrency || !m.cryptoCurrency || !m.network || re || S.detectedCountry && m.countrySource === "" && !R ? null : {
|
|
682
682
|
fiatCurrency: m.fiatCurrency,
|
|
683
683
|
...N ? { cryptoAmount: m.cryptoAmount } : { fiatAmount: m.fiatAmount },
|
|
684
684
|
cryptoCurrency: m.cryptoCurrency,
|
|
@@ -687,7 +687,7 @@ function xn(t) {
|
|
|
687
687
|
country: m.country || void 0,
|
|
688
688
|
orderType: m.flowType
|
|
689
689
|
};
|
|
690
|
-
}, [S, m.fiatCurrency, m.fiatAmount, m.cryptoAmount, m.cryptoCurrency, m.network, m.paymentMethodId, m.country, m.countrySource, re, N, m.flowType,
|
|
690
|
+
}, [S, m.fiatCurrency, m.fiatAmount, m.cryptoAmount, m.cryptoCurrency, m.network, m.paymentMethodId, m.country, m.countrySource, re, N, m.flowType, R]), {
|
|
691
691
|
quotes: G,
|
|
692
692
|
loading: Ke,
|
|
693
693
|
error: ze,
|
|
@@ -695,7 +695,7 @@ function xn(t) {
|
|
|
695
695
|
} = rn(J, ye), se = pn(Ke, G, ye), _e = I(!1);
|
|
696
696
|
ke.useEffect(() => {
|
|
697
697
|
var v;
|
|
698
|
-
_e.current || m.countrySource === "auto" && ((v = y == null ? void 0 : y.sourceCurrency) != null && v.locked || a.current || Ke || !ye || ze || !G || G.bestQuote || m.fiatCurrency !== "USD" && (_e.current = !0,
|
|
698
|
+
_e.current || m.countrySource === "auto" && ((v = y == null ? void 0 : y.sourceCurrency) != null && v.locked || a.current || Ke || !ye || ze || !G || G.bestQuote || m.fiatCurrency !== "USD" && (_e.current = !0, M({ type: "SET_FIAT_CURRENCY", currency: "USD" }), M({ type: "SET_FIAT_AMOUNT", amount: "250" })));
|
|
699
699
|
}, [G, Ke, ze, ye, m.countrySource, m.fiatCurrency]);
|
|
700
700
|
const {
|
|
701
701
|
order: Le,
|
|
@@ -727,11 +727,11 @@ function xn(t) {
|
|
|
727
727
|
const et = I(l);
|
|
728
728
|
et.current = l;
|
|
729
729
|
const Ue = O(async () => {
|
|
730
|
-
var A, L,
|
|
731
|
-
const v = ((A = m.selectedQuote) == null ? void 0 : A.gatewayId) || ((
|
|
730
|
+
var A, L, D;
|
|
731
|
+
const v = ((A = m.selectedQuote) == null ? void 0 : A.gatewayId) || ((D = (L = qe.current) == null ? void 0 : L.bestQuote) == null ? void 0 : D.gatewayId) || je.current;
|
|
732
732
|
if (!v || !m.walletAddress) {
|
|
733
733
|
const U = [!v && "gateway", !m.walletAddress && "walletAddress"].filter(Boolean).join(", ");
|
|
734
|
-
|
|
734
|
+
M({ type: "SET_ERROR", message: `Missing required fields: ${U}` });
|
|
735
735
|
return;
|
|
736
736
|
}
|
|
737
737
|
try {
|
|
@@ -747,17 +747,17 @@ function xn(t) {
|
|
|
747
747
|
email: m.email || void 0,
|
|
748
748
|
orderType: m.flowType,
|
|
749
749
|
...et.current ? { metadata: { brand: et.current } } : {},
|
|
750
|
-
...
|
|
751
|
-
}),
|
|
750
|
+
...E && Object.keys(E).length > 0 ? { partnerMetadata: E } : {}
|
|
751
|
+
}), M({ type: "SET_STEP", step: "checkout" });
|
|
752
752
|
} catch (U) {
|
|
753
753
|
const _ = U instanceof Error ? U.message : "Failed to create order";
|
|
754
|
-
/wallet|address/i.test(_) ?
|
|
754
|
+
/wallet|address/i.test(_) ? M({ type: "SET_WALLET_ERROR", message: _.replace(/^Failed to create checkout intent:\s*/i, "") }) : M({ type: "SET_ERROR", message: _ });
|
|
755
755
|
}
|
|
756
|
-
}, [m, j, N,
|
|
757
|
-
|
|
756
|
+
}, [m, j, N, E]), tt = O((v) => {
|
|
757
|
+
M({ type: "SET_STEP", step: v });
|
|
758
758
|
}, []), St = O(() => {
|
|
759
759
|
const v = ["confirm", "amount", "quotes", "wallet", "checkout", "processing", "complete"], A = v.indexOf(m.step);
|
|
760
|
-
A > 0 &&
|
|
760
|
+
A > 0 && M({ type: "SET_STEP", step: v[A - 1] });
|
|
761
761
|
}, [m.step, N]), wt = W(() => {
|
|
762
762
|
const v = N ? !!m.cryptoAmount : !!m.fiatAmount;
|
|
763
763
|
switch (m.step) {
|
|
@@ -779,7 +779,7 @@ function xn(t) {
|
|
|
779
779
|
configLoading: ae,
|
|
780
780
|
configError: pe,
|
|
781
781
|
state: m,
|
|
782
|
-
dispatch:
|
|
782
|
+
dispatch: M,
|
|
783
783
|
quotes: G,
|
|
784
784
|
quotesLoading: Ke,
|
|
785
785
|
quotesError: ze,
|
|
@@ -1099,29 +1099,29 @@ function vn({
|
|
|
1099
1099
|
defaultLocale: t = "en",
|
|
1100
1100
|
children: a
|
|
1101
1101
|
}) {
|
|
1102
|
-
const [n, r] = w(t), [o,
|
|
1102
|
+
const [n, r] = w(t), [o, c] = w(Be[t] || it);
|
|
1103
1103
|
B(() => {
|
|
1104
1104
|
if (r(t), Be[t])
|
|
1105
|
-
|
|
1105
|
+
c(Be[t]);
|
|
1106
1106
|
else {
|
|
1107
|
-
const
|
|
1108
|
-
|
|
1109
|
-
Be[t] = h.default,
|
|
1107
|
+
const s = la[t];
|
|
1108
|
+
s && s().then((h) => {
|
|
1109
|
+
Be[t] = h.default, c(h.default);
|
|
1110
1110
|
});
|
|
1111
1111
|
}
|
|
1112
1112
|
}, [t]);
|
|
1113
|
-
const u = O((
|
|
1114
|
-
if (r(
|
|
1115
|
-
|
|
1113
|
+
const u = O((s) => {
|
|
1114
|
+
if (r(s), Be[s]) {
|
|
1115
|
+
c(Be[s]);
|
|
1116
1116
|
return;
|
|
1117
1117
|
}
|
|
1118
|
-
const h = la[
|
|
1118
|
+
const h = la[s];
|
|
1119
1119
|
h && h().then((p) => {
|
|
1120
|
-
Be[
|
|
1120
|
+
Be[s] = p.default, c(p.default);
|
|
1121
1121
|
});
|
|
1122
1122
|
}, []), l = O(
|
|
1123
|
-
(
|
|
1124
|
-
const p = o[
|
|
1123
|
+
(s, h) => {
|
|
1124
|
+
const p = o[s] || it[s] || s;
|
|
1125
1125
|
return Sa(p, h);
|
|
1126
1126
|
},
|
|
1127
1127
|
[o]
|
|
@@ -1238,22 +1238,22 @@ function bn({
|
|
|
1238
1238
|
redirectDelay: n = 3e3
|
|
1239
1239
|
}) {
|
|
1240
1240
|
var g;
|
|
1241
|
-
const { order: r, orderStatus: o, goToStep:
|
|
1241
|
+
const { order: r, orderStatus: o, goToStep: c, goBack: u } = Xe(), l = P(), [d, s] = w(!1), [h, p] = w(null), f = r != null && r.checkout.expiresAt ? Date.now() > r.checkout.expiresAt : !1;
|
|
1242
1242
|
if (B(() => {
|
|
1243
1243
|
if ((r == null ? void 0 : r.checkout.method) === "redirect" && a && !f) {
|
|
1244
1244
|
p(Math.ceil(n / 1e3));
|
|
1245
1245
|
const k = setTimeout(() => {
|
|
1246
1246
|
window.location.href = r.checkout.url;
|
|
1247
|
-
}, n),
|
|
1247
|
+
}, n), R = setInterval(() => {
|
|
1248
1248
|
p((y) => y && y > 1 ? y - 1 : null);
|
|
1249
1249
|
}, 1e3);
|
|
1250
1250
|
return () => {
|
|
1251
|
-
clearTimeout(k), clearInterval(
|
|
1251
|
+
clearTimeout(k), clearInterval(R);
|
|
1252
1252
|
};
|
|
1253
1253
|
}
|
|
1254
1254
|
}, [r, a, n, f]), B(() => {
|
|
1255
|
-
o && (o.status === "completed" ?
|
|
1256
|
-
}, [o == null ? void 0 : o.status,
|
|
1255
|
+
o && (o.status === "completed" ? c("complete") : ["failed", "cancelled", "expired"].includes(o.status) && c("error"));
|
|
1256
|
+
}, [o == null ? void 0 : o.status, c]), !r)
|
|
1257
1257
|
return /* @__PURE__ */ i(
|
|
1258
1258
|
"div",
|
|
1259
1259
|
{
|
|
@@ -1307,7 +1307,7 @@ function bn({
|
|
|
1307
1307
|
}
|
|
1308
1308
|
);
|
|
1309
1309
|
if (r.checkout.method === "iframe") {
|
|
1310
|
-
const k = r.checkout.url,
|
|
1310
|
+
const k = r.checkout.url, R = ((g = r.checkout.allowedFeatures) == null ? void 0 : g.join("; ")) || "payment; camera; microphone; geolocation; clipboard-read; clipboard-write; accelerometer; gyroscope; magnetometer; fullscreen; autoplay; encrypted-media; web-share";
|
|
1311
1311
|
return oa(
|
|
1312
1312
|
/* @__PURE__ */ i(
|
|
1313
1313
|
"div",
|
|
@@ -1386,8 +1386,8 @@ function bn({
|
|
|
1386
1386
|
height: "100%",
|
|
1387
1387
|
border: "none"
|
|
1388
1388
|
},
|
|
1389
|
-
allow:
|
|
1390
|
-
onLoad: () =>
|
|
1389
|
+
allow: R,
|
|
1390
|
+
onLoad: () => s(!0),
|
|
1391
1391
|
title: l("checkout.iframeTitle")
|
|
1392
1392
|
}
|
|
1393
1393
|
)
|
|
@@ -1489,7 +1489,7 @@ function bn({
|
|
|
1489
1489
|
border: "none"
|
|
1490
1490
|
},
|
|
1491
1491
|
allow: "payment; camera; microphone; geolocation; clipboard-read; clipboard-write; accelerometer; gyroscope; magnetometer; fullscreen; autoplay; encrypted-media; web-share",
|
|
1492
|
-
onLoad: () =>
|
|
1492
|
+
onLoad: () => s(!0),
|
|
1493
1493
|
title: l("checkout.widgetTitle")
|
|
1494
1494
|
}
|
|
1495
1495
|
)
|
|
@@ -1538,7 +1538,7 @@ function wn({ className: t = "" }) {
|
|
|
1538
1538
|
B(() => {
|
|
1539
1539
|
a && (a.status === "completed" ? r("complete") : ["failed", "cancelled", "expired", "refunded"].includes(a.status) && r("error"));
|
|
1540
1540
|
}, [a == null ? void 0 : a.status, r]);
|
|
1541
|
-
const
|
|
1541
|
+
const c = () => {
|
|
1542
1542
|
if (!a) return o("processing.default");
|
|
1543
1543
|
switch (a.status) {
|
|
1544
1544
|
case "pending":
|
|
@@ -1551,7 +1551,7 @@ function wn({ className: t = "" }) {
|
|
|
1551
1551
|
};
|
|
1552
1552
|
return /* @__PURE__ */ i("div", { className: `flex flex-col items-center justify-center px-8 py-12 text-center ${t}`, children: [
|
|
1553
1553
|
/* @__PURE__ */ e("div", { className: "mb-6", style: { animation: "processingPulse 1500ms ease-in-out infinite" }, children: /* @__PURE__ */ e(Ee, { size: 64 }) }),
|
|
1554
|
-
/* @__PURE__ */ e("h2", { className: "text-[20px] font-semibold mb-3", style: { color: "var(--t-text)" }, children:
|
|
1554
|
+
/* @__PURE__ */ e("h2", { className: "text-[20px] font-semibold mb-3", style: { color: "var(--t-text)" }, children: c() }),
|
|
1555
1555
|
n && /* @__PURE__ */ e("p", { className: "text-[13px] mb-4", style: { color: "var(--t-text-muted)" }, children: o("processing.checkingStatus") }),
|
|
1556
1556
|
a && /* @__PURE__ */ i("div", { className: "w-full mt-6 text-left", style: { background: "var(--t-surface)", borderRadius: "var(--t-card-radius, 20px)", padding: 16 }, children: [
|
|
1557
1557
|
/* @__PURE__ */ e($e, { label: o("processing.orderId"), value: a.orderId, mono: !0 }),
|
|
@@ -1612,7 +1612,7 @@ function kn({
|
|
|
1612
1612
|
onDone: n,
|
|
1613
1613
|
doneButtonText: r
|
|
1614
1614
|
}) {
|
|
1615
|
-
const { orderStatus: o, state:
|
|
1615
|
+
const { orderStatus: o, state: c, dispatch: u } = Xe(), l = P(), d = c.flowType === "sell", s = () => {
|
|
1616
1616
|
if (!(o != null && o.transactionHash)) return null;
|
|
1617
1617
|
if (!a) {
|
|
1618
1618
|
const f = {
|
|
@@ -1626,12 +1626,12 @@ function kn({
|
|
|
1626
1626
|
avalanche: "https://snowtrace.io/tx/{txHash}",
|
|
1627
1627
|
fantom: "https://ftmscan.com/tx/{txHash}"
|
|
1628
1628
|
};
|
|
1629
|
-
return (f[
|
|
1629
|
+
return (f[c.network] || f.ethereum).replace("{txHash}", o.transactionHash);
|
|
1630
1630
|
}
|
|
1631
1631
|
return a.replace("{txHash}", o.transactionHash);
|
|
1632
1632
|
}, h = () => {
|
|
1633
1633
|
n ? n() : u({ type: "RESET" });
|
|
1634
|
-
}, p =
|
|
1634
|
+
}, p = s();
|
|
1635
1635
|
return /* @__PURE__ */ i("div", { className: `flex flex-col items-center px-8 py-12 text-center ${t}`, children: [
|
|
1636
1636
|
/* @__PURE__ */ e(
|
|
1637
1637
|
"div",
|
|
@@ -1650,7 +1650,7 @@ function kn({
|
|
|
1650
1650
|
}
|
|
1651
1651
|
),
|
|
1652
1652
|
/* @__PURE__ */ e("h2", { className: "text-[20px] font-semibold mb-2", style: { color: "var(--t-text)" }, children: l(d ? "complete.sellTitle" : "complete.buyTitle") }),
|
|
1653
|
-
/* @__PURE__ */ e("p", { className: "text-[14px] mb-6", style: { color: "var(--t-text-secondary)" }, children: d ? l("complete.sellDesc", { fiat: (o == null ? void 0 : o.fiatCurrency) ||
|
|
1653
|
+
/* @__PURE__ */ e("p", { className: "text-[14px] mb-6", style: { color: "var(--t-text-secondary)" }, children: d ? l("complete.sellDesc", { fiat: (o == null ? void 0 : o.fiatCurrency) || c.fiatCurrency }) : l("complete.buyDesc", { crypto: (o == null ? void 0 : o.cryptoCurrency) || c.cryptoCurrency }) }),
|
|
1654
1654
|
o && /* @__PURE__ */ i("div", { className: "w-full text-left mb-6", style: { background: "var(--t-surface)", borderRadius: "var(--t-card-radius, 20px)", padding: 16 }, children: [
|
|
1655
1655
|
/* @__PURE__ */ e(
|
|
1656
1656
|
Ne,
|
|
@@ -1745,37 +1745,37 @@ function Nn({
|
|
|
1745
1745
|
doneButtonText: r,
|
|
1746
1746
|
supportEmail: o = "support@nowramp.com"
|
|
1747
1747
|
}) {
|
|
1748
|
-
const { state:
|
|
1748
|
+
const { state: c, orderStatus: u, dispatch: l, goToStep: d } = Xe(), s = P(), h = c.flowType === "sell", p = () => {
|
|
1749
1749
|
if (u)
|
|
1750
1750
|
switch (u.status) {
|
|
1751
1751
|
case "failed":
|
|
1752
|
-
return
|
|
1752
|
+
return s("errorStep.failed");
|
|
1753
1753
|
case "cancelled":
|
|
1754
|
-
return
|
|
1754
|
+
return s("errorStep.cancelled");
|
|
1755
1755
|
case "expired":
|
|
1756
|
-
return
|
|
1756
|
+
return s("errorStep.expired");
|
|
1757
1757
|
case "refunded":
|
|
1758
|
-
return
|
|
1758
|
+
return s("errorStep.refunded");
|
|
1759
1759
|
default:
|
|
1760
|
-
return
|
|
1760
|
+
return s("errorStep.unknown");
|
|
1761
1761
|
}
|
|
1762
|
-
return
|
|
1762
|
+
return s("errorStep.unknown");
|
|
1763
1763
|
}, f = () => {
|
|
1764
|
-
if (
|
|
1764
|
+
if (c.errorMessage) return c.errorMessage;
|
|
1765
1765
|
if (u)
|
|
1766
1766
|
switch (u.status) {
|
|
1767
1767
|
case "failed":
|
|
1768
|
-
return
|
|
1768
|
+
return s(h ? "errorStep.failedSell" : "errorStep.failedBuy");
|
|
1769
1769
|
case "cancelled":
|
|
1770
|
-
return
|
|
1770
|
+
return s(h ? "errorStep.cancelledSell" : "errorStep.cancelledBuy");
|
|
1771
1771
|
case "expired":
|
|
1772
|
-
return
|
|
1772
|
+
return s(h ? "errorStep.expiredSell" : "errorStep.expiredBuy");
|
|
1773
1773
|
case "refunded":
|
|
1774
|
-
return
|
|
1774
|
+
return s(h ? "errorStep.refundedSell" : "errorStep.refundedBuy");
|
|
1775
1775
|
default:
|
|
1776
|
-
return
|
|
1776
|
+
return s("errorStep.genericDesc");
|
|
1777
1777
|
}
|
|
1778
|
-
return
|
|
1778
|
+
return s("errorStep.genericDesc");
|
|
1779
1779
|
}, g = () => {
|
|
1780
1780
|
l({ type: "CLEAR_ERROR" }), a ? a() : (l({ type: "RESET" }), d("amount"));
|
|
1781
1781
|
}, k = () => {
|
|
@@ -1793,7 +1793,7 @@ function Nn({
|
|
|
1793
1793
|
/* @__PURE__ */ e("h2", { className: "text-[20px] font-semibold mb-2", style: { color: "var(--t-text)" }, children: p() }),
|
|
1794
1794
|
/* @__PURE__ */ e("p", { className: "text-[14px] mb-6", style: { color: "var(--t-text-secondary)" }, children: f() }),
|
|
1795
1795
|
u && /* @__PURE__ */ e("div", { className: "w-full text-left mb-6", style: { background: "var(--t-surface)", borderRadius: "var(--t-card-radius, 20px)", padding: 16 }, children: /* @__PURE__ */ i("div", { className: "flex justify-between items-center py-2", children: [
|
|
1796
|
-
/* @__PURE__ */ e("span", { className: "text-[13px]", style: { color: "var(--t-text-secondary)" }, children:
|
|
1796
|
+
/* @__PURE__ */ e("span", { className: "text-[13px]", style: { color: "var(--t-text-secondary)" }, children: s("errorStep.orderId") }),
|
|
1797
1797
|
/* @__PURE__ */ e("span", { className: "text-[13px] font-medium font-mono", style: { color: "var(--t-text)" }, children: u.orderId })
|
|
1798
1798
|
] }) }),
|
|
1799
1799
|
/* @__PURE__ */ i("div", { className: "w-full flex flex-col gap-2", children: [
|
|
@@ -1803,7 +1803,7 @@ function Nn({
|
|
|
1803
1803
|
className: "w-full font-semibold text-[16px] transition-all",
|
|
1804
1804
|
style: { height: 60, borderRadius: "var(--t-cta-radius, 100px)", background: "var(--t-cta-bg)", color: "var(--t-cta-text)" },
|
|
1805
1805
|
onClick: g,
|
|
1806
|
-
children:
|
|
1806
|
+
children: s("errorStep.tryAgain")
|
|
1807
1807
|
}
|
|
1808
1808
|
),
|
|
1809
1809
|
/* @__PURE__ */ e(
|
|
@@ -1812,7 +1812,7 @@ function Nn({
|
|
|
1812
1812
|
className: "w-full font-semibold text-[14px] transition-all",
|
|
1813
1813
|
style: { height: 48, borderRadius: "var(--t-cta-radius, 100px)", background: "var(--t-surface)", color: "var(--t-text)" },
|
|
1814
1814
|
onClick: k,
|
|
1815
|
-
children:
|
|
1815
|
+
children: s("errorStep.startOver")
|
|
1816
1816
|
}
|
|
1817
1817
|
),
|
|
1818
1818
|
n && /* @__PURE__ */ e(
|
|
@@ -1827,14 +1827,14 @@ function Nn({
|
|
|
1827
1827
|
border: "1px solid var(--t-divider)"
|
|
1828
1828
|
},
|
|
1829
1829
|
onClick: n,
|
|
1830
|
-
"aria-label": r ||
|
|
1831
|
-
children: r ||
|
|
1830
|
+
"aria-label": r || s("errorStep.returnToMerchant"),
|
|
1831
|
+
children: r || s("errorStep.return")
|
|
1832
1832
|
}
|
|
1833
1833
|
)
|
|
1834
1834
|
] }),
|
|
1835
1835
|
/* @__PURE__ */ i("div", { className: "mt-6", children: [
|
|
1836
1836
|
/* @__PURE__ */ i("p", { className: "text-[13px]", style: { color: "var(--t-text-secondary)" }, children: [
|
|
1837
|
-
|
|
1837
|
+
s("errorStep.needHelp"),
|
|
1838
1838
|
" ",
|
|
1839
1839
|
/* @__PURE__ */ e(
|
|
1840
1840
|
"a",
|
|
@@ -1846,7 +1846,7 @@ function Nn({
|
|
|
1846
1846
|
}
|
|
1847
1847
|
)
|
|
1848
1848
|
] }),
|
|
1849
|
-
u && /* @__PURE__ */ e("p", { className: "text-[12px] mt-1", style: { color: "var(--t-text-muted)" }, children:
|
|
1849
|
+
u && /* @__PURE__ */ e("p", { className: "text-[12px] mt-1", style: { color: "var(--t-text-muted)" }, children: s("errorStep.reference", { orderId: u.orderId }) })
|
|
1850
1850
|
] })
|
|
1851
1851
|
] });
|
|
1852
1852
|
}
|
|
@@ -2255,7 +2255,7 @@ function yt(t) {
|
|
|
2255
2255
|
function Na(t, a = "") {
|
|
2256
2256
|
return `${a}/provider-icons/${t.toLowerCase()}.svg`;
|
|
2257
2257
|
}
|
|
2258
|
-
function
|
|
2258
|
+
function Dt(t, a = "") {
|
|
2259
2259
|
const n = yt(t);
|
|
2260
2260
|
return n ? `${a}/crypto-icons/${n.icon}.svg` : `${a}/crypto-icons/${t.toLowerCase()}.svg`;
|
|
2261
2261
|
}
|
|
@@ -2318,7 +2318,7 @@ const ca = [
|
|
|
2318
2318
|
function Ea(t) {
|
|
2319
2319
|
return Tn.has(t.toUpperCase());
|
|
2320
2320
|
}
|
|
2321
|
-
function
|
|
2321
|
+
function Ir(t, a) {
|
|
2322
2322
|
var n, r;
|
|
2323
2323
|
return ((n = da[t]) == null ? void 0 : n[a]) ?? ((r = da.USDC) == null ? void 0 : r[a]) ?? 1;
|
|
2324
2324
|
}
|
|
@@ -2348,16 +2348,16 @@ function Un({ className: t = "", stablecoinParity: a, partnerName: n }) {
|
|
|
2348
2348
|
const {
|
|
2349
2349
|
config: r,
|
|
2350
2350
|
configLoading: o,
|
|
2351
|
-
state:
|
|
2351
|
+
state: c,
|
|
2352
2352
|
defaultGateway: u,
|
|
2353
2353
|
quotes: l,
|
|
2354
2354
|
fetchQuotes: d,
|
|
2355
|
-
createOrder:
|
|
2355
|
+
createOrder: s,
|
|
2356
2356
|
orderLoading: h
|
|
2357
|
-
} = Xe(), p = P(), f =
|
|
2357
|
+
} = Xe(), p = P(), f = c.flowType === "sell", [g, k] = w(null), R = r == null ? void 0 : r.gateways.find((q) => q.id === u), y = (J = l == null ? void 0 : l.bestQuote) != null && J.exchangeRate ? parseFloat(l.bestQuote.exchangeRate) : null, E = parseFloat(c.fiatAmount) || 0, K = !!(a && n && !f && Ea(c.cryptoCurrency) && y), ee = K && c.cryptoCurrency.toUpperCase().includes(c.fiatCurrency.toUpperCase()), z = K && E > 0 ? Bt(ee ? E : E / y) : null, ie = async () => {
|
|
2358
2358
|
k(null);
|
|
2359
2359
|
try {
|
|
2360
|
-
d(), await
|
|
2360
|
+
d(), await s();
|
|
2361
2361
|
} catch (q) {
|
|
2362
2362
|
const Ce = q instanceof Error ? q.message : p("error.createOrderFailed");
|
|
2363
2363
|
k(Ce);
|
|
@@ -2369,30 +2369,30 @@ function Un({ className: t = "", stablecoinParity: a, partnerName: n }) {
|
|
|
2369
2369
|
] }) : /* @__PURE__ */ i("div", { className: `flex flex-col items-center px-8 py-12 ${t}`, children: [
|
|
2370
2370
|
/* @__PURE__ */ e("h2", { className: "text-[20px] font-semibold mb-6", style: { color: "var(--t-text)" }, children: p(f ? "confirm.sellTitle" : "confirm.buyTitle") }),
|
|
2371
2371
|
/* @__PURE__ */ i("div", { className: "w-full text-left mb-6", style: { background: "var(--t-surface)", borderRadius: "var(--t-card-radius, 20px)", padding: 16 }, children: [
|
|
2372
|
-
|
|
2372
|
+
R && /* @__PURE__ */ i("div", { className: "flex justify-between items-center py-2", style: { borderBottom: "1px solid var(--t-divider)" }, children: [
|
|
2373
2373
|
/* @__PURE__ */ e("span", { className: "text-[13px]", style: { color: "var(--t-text-secondary)" }, children: p("confirm.provider") }),
|
|
2374
2374
|
/* @__PURE__ */ i("span", { className: "flex items-center gap-2", children: [
|
|
2375
|
-
|
|
2376
|
-
/* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: "var(--t-text)" }, children:
|
|
2375
|
+
R.logo && /* @__PURE__ */ e("img", { src: R.logo, alt: R.name, width: 20, height: 20, style: { borderRadius: 4 } }),
|
|
2376
|
+
/* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: "var(--t-text)" }, children: R.name })
|
|
2377
2377
|
] })
|
|
2378
2378
|
] }),
|
|
2379
2379
|
f ? /* @__PURE__ */ i(Z, { children: [
|
|
2380
|
-
/* @__PURE__ */ e(He, { label: p("confirm.youSell"), value: `${
|
|
2381
|
-
/* @__PURE__ */ e(He, { label: p("confirm.youReceive"), value: p("confirm.payout", { currency:
|
|
2380
|
+
/* @__PURE__ */ e(He, { label: p("confirm.youSell"), value: `${c.cryptoAmount} ${c.cryptoCurrency}`, highlight: !0 }),
|
|
2381
|
+
/* @__PURE__ */ e(He, { label: p("confirm.youReceive"), value: p("confirm.payout", { currency: c.fiatCurrency }) })
|
|
2382
2382
|
] }) : /* @__PURE__ */ i(Z, { children: [
|
|
2383
|
-
/* @__PURE__ */ e(He, { label: p("confirm.youPay"), value: `${
|
|
2383
|
+
/* @__PURE__ */ e(He, { label: p("confirm.youPay"), value: `${c.fiatAmount} ${c.fiatCurrency}`, highlight: !0 }),
|
|
2384
2384
|
/* @__PURE__ */ e(
|
|
2385
2385
|
He,
|
|
2386
2386
|
{
|
|
2387
2387
|
label: p("confirm.youReceive"),
|
|
2388
|
-
value: z ? `${z} ${
|
|
2388
|
+
value: z ? `${z} ${c.cryptoCurrency}` : p("confirm.cryptoOnNetwork", { crypto: c.cryptoCurrency, network: c.network })
|
|
2389
2389
|
}
|
|
2390
2390
|
),
|
|
2391
|
-
/* @__PURE__ */ e(He, { label: p("confirm.wallet"), value: pa(
|
|
2392
|
-
K && z && /* @__PURE__ */ e("div", { className: "py-2 text-[11px]", style: { color: "var(--t-text-muted)", lineHeight: "15px" }, children: p("confirm.parityNote", { amount: z, crypto:
|
|
2391
|
+
/* @__PURE__ */ e(He, { label: p("confirm.wallet"), value: pa(c.walletAddress), mono: !0 }),
|
|
2392
|
+
K && z && /* @__PURE__ */ e("div", { className: "py-2 text-[11px]", style: { color: "var(--t-text-muted)", lineHeight: "15px" }, children: p("confirm.parityNote", { amount: z, crypto: c.cryptoCurrency, partner: n }) })
|
|
2393
2393
|
] }),
|
|
2394
|
-
/* @__PURE__ */ e(He, { label: p("confirm.network"), value:
|
|
2395
|
-
f &&
|
|
2394
|
+
/* @__PURE__ */ e(He, { label: p("confirm.network"), value: c.network }),
|
|
2395
|
+
f && c.walletAddress && /* @__PURE__ */ e(He, { label: p("confirm.refundAddress"), value: pa(c.walletAddress), mono: !0 })
|
|
2396
2396
|
] }),
|
|
2397
2397
|
g && /* @__PURE__ */ e("p", { className: "text-[12px] mb-4", style: { color: "#EF4444" }, children: g }),
|
|
2398
2398
|
/* @__PURE__ */ e(
|
|
@@ -2429,13 +2429,13 @@ function Pe({
|
|
|
2429
2429
|
children: n,
|
|
2430
2430
|
variant: r = "bottom"
|
|
2431
2431
|
}) {
|
|
2432
|
-
const [o,
|
|
2432
|
+
const [o, c] = w(!1), [u, l] = w(!1);
|
|
2433
2433
|
B(() => {
|
|
2434
2434
|
if (t)
|
|
2435
|
-
|
|
2435
|
+
c(!0), requestAnimationFrame(() => requestAnimationFrame(() => l(!0)));
|
|
2436
2436
|
else if (o) {
|
|
2437
2437
|
l(!1);
|
|
2438
|
-
const p = setTimeout(() =>
|
|
2438
|
+
const p = setTimeout(() => c(!1), 250);
|
|
2439
2439
|
return () => clearTimeout(p);
|
|
2440
2440
|
}
|
|
2441
2441
|
}, [t]);
|
|
@@ -2508,8 +2508,8 @@ function Ra({
|
|
|
2508
2508
|
className: r = "",
|
|
2509
2509
|
background: o
|
|
2510
2510
|
}) {
|
|
2511
|
-
const [
|
|
2512
|
-
|
|
2511
|
+
const [c, u] = w(!1), [l, d] = w(!1), s = I(t);
|
|
2512
|
+
s.current !== t && (s.current = t, u(!1), d(!1));
|
|
2513
2513
|
const h = O(() => u(!0), []), p = O(() => d(!0), []);
|
|
2514
2514
|
return /* @__PURE__ */ i(
|
|
2515
2515
|
"div",
|
|
@@ -2517,7 +2517,7 @@ function Ra({
|
|
|
2517
2517
|
className: `relative rounded-full shrink-0 ${r}`,
|
|
2518
2518
|
style: { width: n, height: n, background: o },
|
|
2519
2519
|
children: [
|
|
2520
|
-
!
|
|
2520
|
+
!c && !l && /* @__PURE__ */ e(
|
|
2521
2521
|
"div",
|
|
2522
2522
|
{
|
|
2523
2523
|
className: "absolute inset-0 rounded-full animate-pulse",
|
|
@@ -2544,7 +2544,7 @@ function Ra({
|
|
|
2544
2544
|
height: n,
|
|
2545
2545
|
onLoad: h,
|
|
2546
2546
|
onError: p,
|
|
2547
|
-
className: `rounded-full ${
|
|
2547
|
+
className: `rounded-full ${c ? "opacity-100" : "opacity-0"}`,
|
|
2548
2548
|
style: { width: n, height: n, transition: "opacity 0.15s ease-in" }
|
|
2549
2549
|
}
|
|
2550
2550
|
)
|
|
@@ -2579,7 +2579,7 @@ function Ta({ size: t = 32, color: a = "#888" }) {
|
|
|
2579
2579
|
/* @__PURE__ */ e("circle", { cx: "16", cy: "16", r: "8", stroke: "white", strokeWidth: "1.5", fill: "none" })
|
|
2580
2580
|
] });
|
|
2581
2581
|
}
|
|
2582
|
-
function
|
|
2582
|
+
function Mr({ size: t = 24 }) {
|
|
2583
2583
|
return /* @__PURE__ */ e(
|
|
2584
2584
|
"div",
|
|
2585
2585
|
{
|
|
@@ -2596,7 +2596,7 @@ function Ir({ size: t = 24 }) {
|
|
|
2596
2596
|
}
|
|
2597
2597
|
);
|
|
2598
2598
|
}
|
|
2599
|
-
function
|
|
2599
|
+
function Mn({ size: t = 32 }) {
|
|
2600
2600
|
return /* @__PURE__ */ e(
|
|
2601
2601
|
"div",
|
|
2602
2602
|
{
|
|
@@ -2622,7 +2622,7 @@ function Dr({ size: t = 32 }) {
|
|
|
2622
2622
|
}
|
|
2623
2623
|
);
|
|
2624
2624
|
}
|
|
2625
|
-
function
|
|
2625
|
+
function Br({ size: t = 32 }) {
|
|
2626
2626
|
return /* @__PURE__ */ e(
|
|
2627
2627
|
"div",
|
|
2628
2628
|
{
|
|
@@ -2637,7 +2637,7 @@ function Mr({ size: t = 32 }) {
|
|
|
2637
2637
|
}
|
|
2638
2638
|
);
|
|
2639
2639
|
}
|
|
2640
|
-
function
|
|
2640
|
+
function Dn({ size: t = 32 }) {
|
|
2641
2641
|
return /* @__PURE__ */ e(
|
|
2642
2642
|
"div",
|
|
2643
2643
|
{
|
|
@@ -2678,7 +2678,7 @@ function Hn({ size: t = 32 }) {
|
|
|
2678
2678
|
}
|
|
2679
2679
|
);
|
|
2680
2680
|
}
|
|
2681
|
-
function
|
|
2681
|
+
function Hr({ size: t = 32 }) {
|
|
2682
2682
|
const a = t * 0.56, n = a * 0.65, r = Math.max(2, a * 0.1), o = a * 0.2;
|
|
2683
2683
|
return /* @__PURE__ */ i("div", { className: "flex items-center justify-center shrink-0", style: { width: t, height: t }, children: [
|
|
2684
2684
|
/* @__PURE__ */ e(
|
|
@@ -2729,7 +2729,7 @@ function Br({ size: t = 32 }) {
|
|
|
2729
2729
|
)
|
|
2730
2730
|
] });
|
|
2731
2731
|
}
|
|
2732
|
-
function
|
|
2732
|
+
function Pr({ size: t = 18 }) {
|
|
2733
2733
|
return /* @__PURE__ */ e(
|
|
2734
2734
|
"div",
|
|
2735
2735
|
{
|
|
@@ -2745,7 +2745,7 @@ function Re() {
|
|
|
2745
2745
|
function Pn() {
|
|
2746
2746
|
return /* @__PURE__ */ e("svg", { width: "8", height: "14", viewBox: "0 0 8 14", fill: "none", children: /* @__PURE__ */ e("path", { d: "M1 1L7 7L1 13", stroke: "var(--t-icon-stroke)", strokeWidth: "1.2", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
2747
2747
|
}
|
|
2748
|
-
function
|
|
2748
|
+
function Or({ onClick: t }) {
|
|
2749
2749
|
return /* @__PURE__ */ e("button", { onClick: t, className: "hover:opacity-70 transition-opacity", children: /* @__PURE__ */ e("svg", { width: "24", height: "16", viewBox: "0 0 24 16", fill: "none", children: /* @__PURE__ */ e(
|
|
2750
2750
|
"path",
|
|
2751
2751
|
{
|
|
@@ -2754,7 +2754,7 @@ function Pr({ onClick: t }) {
|
|
|
2754
2754
|
}
|
|
2755
2755
|
) }) });
|
|
2756
2756
|
}
|
|
2757
|
-
function
|
|
2757
|
+
function Kr({ size: t = 40 }) {
|
|
2758
2758
|
return /* @__PURE__ */ e(
|
|
2759
2759
|
"div",
|
|
2760
2760
|
{
|
|
@@ -2828,7 +2828,7 @@ function jn({ size: t = 20 }) {
|
|
|
2828
2828
|
}
|
|
2829
2829
|
);
|
|
2830
2830
|
}
|
|
2831
|
-
function
|
|
2831
|
+
function _r({ size: t = 24 }) {
|
|
2832
2832
|
const a = t * 1.15;
|
|
2833
2833
|
return /* @__PURE__ */ i("svg", { width: a, height: t, viewBox: "0 0 48 32", fill: "none", preserveAspectRatio: "xMidYMid meet", children: [
|
|
2834
2834
|
/* @__PURE__ */ e("path", { d: "M0 0H5.76C11.0619 0 15.36 4.47715 15.36 10V32H0V0Z", fill: "var(--t-text)" }),
|
|
@@ -2877,13 +2877,13 @@ function Vn({ onClick: t }) {
|
|
|
2877
2877
|
}
|
|
2878
2878
|
);
|
|
2879
2879
|
}
|
|
2880
|
-
function
|
|
2880
|
+
function jr({ size: t = 16 }) {
|
|
2881
2881
|
return /* @__PURE__ */ i("svg", { width: t, height: t, viewBox: "0 0 16 16", fill: "none", children: [
|
|
2882
2882
|
/* @__PURE__ */ e("circle", { cx: "7", cy: "7", r: "5.25", stroke: "var(--t-text-secondary)", strokeWidth: "1.2" }),
|
|
2883
2883
|
/* @__PURE__ */ e("path", { d: "M11 11l3.5 3.5", stroke: "var(--t-text-secondary)", strokeWidth: "1.2", strokeLinecap: "round" })
|
|
2884
2884
|
] });
|
|
2885
2885
|
}
|
|
2886
|
-
function
|
|
2886
|
+
function Vr({ size: t = 12 }) {
|
|
2887
2887
|
return /* @__PURE__ */ e("svg", { width: t, height: t, viewBox: "0 0 12 12", fill: "none", children: /* @__PURE__ */ e("path", { d: "M6 10V2M6 2L2.5 5.5M6 2l3.5 3.5", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
2888
2888
|
}
|
|
2889
2889
|
function Wn({ size: t = 14 }) {
|
|
@@ -2903,9 +2903,9 @@ function Gn(t, a = 32, n) {
|
|
|
2903
2903
|
case "googlepay":
|
|
2904
2904
|
return /* @__PURE__ */ e(jn, { size: a });
|
|
2905
2905
|
case "revolut":
|
|
2906
|
-
return /* @__PURE__ */ e(Dn, { size: a });
|
|
2907
|
-
case "paypal":
|
|
2908
2906
|
return /* @__PURE__ */ e(Mn, { size: a });
|
|
2907
|
+
case "paypal":
|
|
2908
|
+
return /* @__PURE__ */ e(Dn, { size: a });
|
|
2909
2909
|
case "visa":
|
|
2910
2910
|
return /* @__PURE__ */ e(Bn, { size: a });
|
|
2911
2911
|
case "mastercard":
|
|
@@ -2915,7 +2915,7 @@ function Gn(t, a = 32, n) {
|
|
|
2915
2915
|
}
|
|
2916
2916
|
}
|
|
2917
2917
|
function $n({ type: t, title: a, description: n, visible: r, onDismiss: o }) {
|
|
2918
|
-
const [
|
|
2918
|
+
const [c, u] = w(!1), [l, d] = w(!1), s = O(() => {
|
|
2919
2919
|
d(!0), setTimeout(() => {
|
|
2920
2920
|
u(!1), d(!1), o();
|
|
2921
2921
|
}, 200);
|
|
@@ -2923,10 +2923,10 @@ function $n({ type: t, title: a, description: n, visible: r, onDismiss: o }) {
|
|
|
2923
2923
|
return B(() => {
|
|
2924
2924
|
r && (u(!0), d(!1));
|
|
2925
2925
|
}, [r]), B(() => {
|
|
2926
|
-
if (!r || !
|
|
2927
|
-
const p = setTimeout(
|
|
2926
|
+
if (!r || !c) return;
|
|
2927
|
+
const p = setTimeout(s, 5e3);
|
|
2928
2928
|
return () => clearTimeout(p);
|
|
2929
|
-
}, [r,
|
|
2929
|
+
}, [r, c, s]), c ? /* @__PURE__ */ e(
|
|
2930
2930
|
"div",
|
|
2931
2931
|
{
|
|
2932
2932
|
className: "absolute top-0 left-0 right-0 z-[25] px-3 pt-3",
|
|
@@ -2945,7 +2945,7 @@ function $n({ type: t, title: a, description: n, visible: r, onDismiss: o }) {
|
|
|
2945
2945
|
/* @__PURE__ */ e(
|
|
2946
2946
|
"button",
|
|
2947
2947
|
{
|
|
2948
|
-
onClick:
|
|
2948
|
+
onClick: s,
|
|
2949
2949
|
className: "shrink-0 opacity-80 hover:opacity-100 transition-opacity mt-0.5",
|
|
2950
2950
|
children: /* @__PURE__ */ e(Pt, { size: 10 })
|
|
2951
2951
|
}
|
|
@@ -3083,14 +3083,14 @@ function Qn({
|
|
|
3083
3083
|
assetBaseUrl: r = "",
|
|
3084
3084
|
selectedCode: o
|
|
3085
3085
|
}) {
|
|
3086
|
-
const
|
|
3086
|
+
const c = P(), [u, l] = w(""), d = W(() => {
|
|
3087
3087
|
if (!n || n.length === 0) return ca;
|
|
3088
3088
|
const h = new Map(ca.map((p) => [p.code, p.name]));
|
|
3089
3089
|
return n.map((p) => ({
|
|
3090
3090
|
code: p.code,
|
|
3091
3091
|
name: p.name || h.get(p.code) || p.code
|
|
3092
3092
|
}));
|
|
3093
|
-
}, [n]),
|
|
3093
|
+
}, [n]), s = W(() => {
|
|
3094
3094
|
const h = u.trim().toLowerCase();
|
|
3095
3095
|
if (!h) {
|
|
3096
3096
|
if (o) {
|
|
@@ -3109,12 +3109,12 @@ function Qn({
|
|
|
3109
3109
|
return /* @__PURE__ */ i(Z, { children: [
|
|
3110
3110
|
/* @__PURE__ */ i("div", { className: "relative shrink-0", style: { height: 128, background: "var(--t-header-bg)", backdropFilter: "blur(var(--t-header-blur))", WebkitBackdropFilter: "blur(var(--t-header-blur))" }, children: [
|
|
3111
3111
|
/* @__PURE__ */ e("div", { className: "absolute", style: { left: 12, top: 20 }, children: /* @__PURE__ */ e(Ae, { width: 46 }) }),
|
|
3112
|
-
/* @__PURE__ */ e("p", { className: "absolute text-[16px] text-center truncate", style: { top: 28, left: 64, right: 64, color: "var(--t-text)", lineHeight: "24px" }, children:
|
|
3112
|
+
/* @__PURE__ */ e("p", { className: "absolute text-[16px] text-center truncate", style: { top: 28, left: 64, right: 64, color: "var(--t-text)", lineHeight: "24px" }, children: c("modal.selectFiat") }),
|
|
3113
3113
|
/* @__PURE__ */ e("div", { className: "absolute", style: { right: 12, top: 20 }, children: /* @__PURE__ */ e(Oe, { onClick: t }) }),
|
|
3114
3114
|
/* @__PURE__ */ e("div", { className: "absolute", style: { bottom: 8, left: 12, right: 12 }, children: /* @__PURE__ */ e(Ye, { value: u, onChange: l, inline: !0 }) })
|
|
3115
3115
|
] }),
|
|
3116
3116
|
/* @__PURE__ */ i("div", { className: "flex-1 overflow-y-auto custom-scroll px-3", children: [
|
|
3117
|
-
|
|
3117
|
+
s.map((h, p) => {
|
|
3118
3118
|
const f = o === h.code;
|
|
3119
3119
|
return /* @__PURE__ */ i(
|
|
3120
3120
|
"button",
|
|
@@ -3126,7 +3126,7 @@ function Qn({
|
|
|
3126
3126
|
/* @__PURE__ */ e(jt, { currencyCode: h.code, size: 32, baseUrl: r }),
|
|
3127
3127
|
/* @__PURE__ */ i("div", { className: "flex-1 flex items-center", style: { borderBottom: "1px solid var(--t-card-border)", paddingTop: 20, paddingBottom: 20, gap: 10 }, children: [
|
|
3128
3128
|
/* @__PURE__ */ e("span", { className: "flex-1 text-[18px] text-left", style: { color: "var(--t-text)", lineHeight: "20px" }, children: h.code }),
|
|
3129
|
-
Yn.includes(h.code) && /* @__PURE__ */ e("span", { className: "text-[11px] font-medium", style: { border: "1.5px solid var(--t-card-border)", borderRadius: 100, paddingLeft: 8, paddingRight: 8, color: "var(--t-text-secondary)", lineHeight: "20px", letterSpacing: "0.22px" }, children:
|
|
3129
|
+
Yn.includes(h.code) && /* @__PURE__ */ e("span", { className: "text-[11px] font-medium", style: { border: "1.5px solid var(--t-card-border)", borderRadius: 100, paddingLeft: 8, paddingRight: 8, color: "var(--t-text-secondary)", lineHeight: "20px", letterSpacing: "0.22px" }, children: c("modal.popular") }),
|
|
3130
3130
|
f && /* @__PURE__ */ e("div", { style: { width: 40, height: 20, display: "flex", alignItems: "center", justifyContent: "center" }, children: /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
|
|
3131
3131
|
"path",
|
|
3132
3132
|
{
|
|
@@ -3143,17 +3143,17 @@ function Qn({
|
|
|
3143
3143
|
h.code
|
|
3144
3144
|
);
|
|
3145
3145
|
}),
|
|
3146
|
-
|
|
3146
|
+
s.length === 0 && /* @__PURE__ */ e("div", { className: "text-center py-10 text-[14px]", style: { color: "var(--t-text-muted)" }, children: c("modal.noCurrencies") })
|
|
3147
3147
|
] })
|
|
3148
3148
|
] });
|
|
3149
3149
|
}
|
|
3150
3150
|
const ha = ["BTC", "ETH", "SOL"];
|
|
3151
3151
|
function fa({ src: t, alt: a, size: n, className: r, style: o }) {
|
|
3152
|
-
const [
|
|
3153
|
-
|
|
3152
|
+
const [c, u] = w(!1), [l, d] = w(!1), s = I(t);
|
|
3153
|
+
s.current !== t && (s.current = t, u(!1), d(!1));
|
|
3154
3154
|
const h = O(() => u(!0), []), p = O(() => d(!0), []);
|
|
3155
3155
|
return /* @__PURE__ */ i("div", { className: r, style: { ...o, width: n, height: n, position: "relative" }, children: [
|
|
3156
|
-
!
|
|
3156
|
+
!c && !l && /* @__PURE__ */ e(
|
|
3157
3157
|
"div",
|
|
3158
3158
|
{
|
|
3159
3159
|
className: "absolute inset-0 rounded-full animate-pulse",
|
|
@@ -3176,55 +3176,55 @@ function fa({ src: t, alt: a, size: n, className: r, style: o }) {
|
|
|
3176
3176
|
height: n,
|
|
3177
3177
|
onLoad: h,
|
|
3178
3178
|
onError: p,
|
|
3179
|
-
className: `rounded-full ${
|
|
3179
|
+
className: `rounded-full ${c ? "opacity-100" : "opacity-0"}`,
|
|
3180
3180
|
style: { width: n, height: n, transition: "opacity 0.15s ease-in" }
|
|
3181
3181
|
}
|
|
3182
3182
|
)
|
|
3183
3183
|
] });
|
|
3184
3184
|
}
|
|
3185
|
-
function zn({ onClose: t, onSelect: a, cryptos: n, assetBaseUrl: r = "", selectedCode: o, selectedChain:
|
|
3186
|
-
const u = P(), [l, d] = w(""),
|
|
3185
|
+
function zn({ onClose: t, onSelect: a, cryptos: n, assetBaseUrl: r = "", selectedCode: o, selectedChain: c }) {
|
|
3186
|
+
const u = P(), [l, d] = w(""), s = W(() => {
|
|
3187
3187
|
if (!n || n.length === 0) return Fn;
|
|
3188
3188
|
const f = [];
|
|
3189
3189
|
for (const g of n) {
|
|
3190
|
-
const k = g.networks || [],
|
|
3190
|
+
const k = g.networks || [], R = g.name || En[g.code] || g.code;
|
|
3191
3191
|
if (k.length === 0)
|
|
3192
|
-
f.push({ code: g.code, name:
|
|
3192
|
+
f.push({ code: g.code, name: R, chain: g.code, popular: ha.includes(g.code) });
|
|
3193
3193
|
else
|
|
3194
3194
|
for (const y of k) {
|
|
3195
|
-
const
|
|
3195
|
+
const E = y.code || y.id || y.name || g.code;
|
|
3196
3196
|
f.push({
|
|
3197
3197
|
code: g.code,
|
|
3198
|
-
name:
|
|
3199
|
-
chain:
|
|
3198
|
+
name: R,
|
|
3199
|
+
chain: E,
|
|
3200
3200
|
chainName: y.name,
|
|
3201
3201
|
popular: ha.includes(g.code)
|
|
3202
3202
|
});
|
|
3203
3203
|
}
|
|
3204
3204
|
}
|
|
3205
3205
|
return f;
|
|
3206
|
-
}, [n]), h = O((f, g) => o === f &&
|
|
3207
|
-
var
|
|
3206
|
+
}, [n]), h = O((f, g) => o === f && c === g, [o, c]), p = W(() => {
|
|
3207
|
+
var R;
|
|
3208
3208
|
const f = l.trim().toLowerCase();
|
|
3209
3209
|
if (!f) {
|
|
3210
|
-
if (o &&
|
|
3211
|
-
const y =
|
|
3210
|
+
if (o && c) {
|
|
3211
|
+
const y = s.find((E) => E.code === o && E.chain === c);
|
|
3212
3212
|
if (y) {
|
|
3213
|
-
const
|
|
3214
|
-
return [y, ...
|
|
3213
|
+
const E = s.filter((K) => !(K.code === o && K.chain === c));
|
|
3214
|
+
return [y, ...E];
|
|
3215
3215
|
}
|
|
3216
3216
|
}
|
|
3217
|
-
return
|
|
3217
|
+
return s;
|
|
3218
3218
|
}
|
|
3219
3219
|
const g = f.split(/\s+/), k = [];
|
|
3220
|
-
for (const y of
|
|
3221
|
-
const
|
|
3220
|
+
for (const y of s) {
|
|
3221
|
+
const E = yt(y.chain), K = E ? E.name.toLowerCase() : "", ee = ((R = E == null ? void 0 : E.shortName) == null ? void 0 : R.toLowerCase()) || "", z = y.chain.toLowerCase(), ie = y.code.toLowerCase(), J = y.name.toLowerCase(), q = [ie, J, K, ee, z];
|
|
3222
3222
|
if (!g.every((T) => q.some((C) => C.includes(T)))) continue;
|
|
3223
3223
|
let te = 0;
|
|
3224
3224
|
ie === f ? te += 100 : ie.startsWith(g[0]) && (te += 50), y.popular && (te += 10), g.length > 1 && (K.includes(g[1]) || ee.includes(g[1]) || z.includes(g[1])) && (te += 25), k.push({ item: y, score: te });
|
|
3225
3225
|
}
|
|
3226
|
-
return k.sort((y,
|
|
3227
|
-
}, [
|
|
3226
|
+
return k.sort((y, E) => E.score - y.score), k.map((y) => y.item);
|
|
3227
|
+
}, [s, l, o, c]);
|
|
3228
3228
|
return /* @__PURE__ */ i(Z, { children: [
|
|
3229
3229
|
/* @__PURE__ */ i("div", { className: "relative shrink-0", style: { height: 128, background: "var(--t-header-bg)", backdropFilter: "blur(var(--t-header-blur))", WebkitBackdropFilter: "blur(var(--t-header-blur))" }, children: [
|
|
3230
3230
|
/* @__PURE__ */ e("div", { className: "absolute", style: { left: 12, top: 20 }, children: /* @__PURE__ */ e(Ae, { width: 46 }) }),
|
|
@@ -3234,7 +3234,7 @@ function zn({ onClose: t, onSelect: a, cryptos: n, assetBaseUrl: r = "", selecte
|
|
|
3234
3234
|
] }),
|
|
3235
3235
|
/* @__PURE__ */ i("div", { className: "flex-1 overflow-y-auto custom-scroll px-3", children: [
|
|
3236
3236
|
p.map((f, g) => {
|
|
3237
|
-
const k = yt(f.chain),
|
|
3237
|
+
const k = yt(f.chain), R = (k == null ? void 0 : k.name) || f.chainName || f.chain, y = h(f.code, f.chain);
|
|
3238
3238
|
return /* @__PURE__ */ i(
|
|
3239
3239
|
"button",
|
|
3240
3240
|
{
|
|
@@ -3272,7 +3272,7 @@ function zn({ onClose: t, onSelect: a, cryptos: n, assetBaseUrl: r = "", selecte
|
|
|
3272
3272
|
children: /* @__PURE__ */ e(
|
|
3273
3273
|
fa,
|
|
3274
3274
|
{
|
|
3275
|
-
src:
|
|
3275
|
+
src: Dt(f.chain, r),
|
|
3276
3276
|
alt: f.chain,
|
|
3277
3277
|
size: 16
|
|
3278
3278
|
}
|
|
@@ -3282,7 +3282,7 @@ function zn({ onClose: t, onSelect: a, cryptos: n, assetBaseUrl: r = "", selecte
|
|
|
3282
3282
|
] }),
|
|
3283
3283
|
/* @__PURE__ */ i("div", { className: "flex-1 flex items-center", style: { borderBottom: "1px solid var(--t-card-border)", paddingTop: 20, paddingBottom: 20, gap: 10 }, children: [
|
|
3284
3284
|
/* @__PURE__ */ e("span", { className: "flex-1 text-[18px] text-left", style: { color: "var(--t-text)", lineHeight: "20px" }, children: f.code }),
|
|
3285
|
-
/* @__PURE__ */ e("span", { className: "text-[15px]", style: { color: "var(--t-text-secondary)" }, children:
|
|
3285
|
+
/* @__PURE__ */ e("span", { className: "text-[15px]", style: { color: "var(--t-text-secondary)" }, children: R }),
|
|
3286
3286
|
f.popular && /* @__PURE__ */ e("span", { className: "text-[11px] font-medium", style: { border: "1.5px solid var(--t-card-border)", borderRadius: 100, paddingLeft: 8, paddingRight: 8, color: "var(--t-text-secondary)", lineHeight: "20px", letterSpacing: "0.22px" }, children: u("modal.popular") }),
|
|
3287
3287
|
y && /* @__PURE__ */ e("div", { style: { width: 40, height: 20, display: "flex", alignItems: "center", justifyContent: "center" }, children: /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
|
|
3288
3288
|
"path",
|
|
@@ -3325,12 +3325,21 @@ const Jn = {
|
|
|
3325
3325
|
"payid-bank-transfer": "PayID",
|
|
3326
3326
|
paypal: "PayPal",
|
|
3327
3327
|
revolut: "Revolut"
|
|
3328
|
+
}, tr = {
|
|
3329
|
+
"sepa-bank-transfer": "SEPA",
|
|
3330
|
+
sepa: "SEPA",
|
|
3331
|
+
"bank-transfer": "Bank",
|
|
3332
|
+
"ach-bank-transfer": "ACH"
|
|
3328
3333
|
};
|
|
3329
|
-
function Vt(t, a, n) {
|
|
3330
|
-
|
|
3331
|
-
|
|
3332
|
-
|
|
3333
|
-
|
|
3334
|
+
function Vt(t, a, n, r = !1) {
|
|
3335
|
+
if (r) {
|
|
3336
|
+
const u = tr[t];
|
|
3337
|
+
if (u) return u;
|
|
3338
|
+
}
|
|
3339
|
+
const o = er[t];
|
|
3340
|
+
if (o) return o;
|
|
3341
|
+
const c = qn[t];
|
|
3342
|
+
return c && n ? n(c) : c && {
|
|
3334
3343
|
"debit-credit-card": "Card",
|
|
3335
3344
|
"bank-transfer": "Bank Transfer",
|
|
3336
3345
|
"ach-bank-transfer": "ACH"
|
|
@@ -3340,17 +3349,17 @@ function Wt(t, a, n = 24) {
|
|
|
3340
3349
|
const r = Jn[t];
|
|
3341
3350
|
return r ? Gn(r, n) : a ? /* @__PURE__ */ e("img", { src: a, alt: "", width: n, height: n, style: { borderRadius: "50%" } }) : /* @__PURE__ */ e(Ta, { size: n });
|
|
3342
3351
|
}
|
|
3343
|
-
function
|
|
3352
|
+
function Wr({
|
|
3344
3353
|
methods: t,
|
|
3345
3354
|
selectedId: a,
|
|
3346
3355
|
onOpenModal: n,
|
|
3347
3356
|
fiatCurrency: r
|
|
3348
3357
|
}) {
|
|
3349
|
-
const o = P(),
|
|
3358
|
+
const o = P(), c = W(
|
|
3350
3359
|
() => t.filter((l) => l.supportedFiats.includes(r)),
|
|
3351
3360
|
[t, r]
|
|
3352
|
-
), u =
|
|
3353
|
-
return
|
|
3361
|
+
), u = c.find((l) => l.id === a) || c[0];
|
|
3362
|
+
return c.length === 0 ? /* @__PURE__ */ e(
|
|
3354
3363
|
"div",
|
|
3355
3364
|
{
|
|
3356
3365
|
className: "flex items-center justify-between px-[18px] pt-[12px] pb-[14px]",
|
|
@@ -3389,15 +3398,15 @@ function Vr({
|
|
|
3389
3398
|
}
|
|
3390
3399
|
) });
|
|
3391
3400
|
}
|
|
3392
|
-
function
|
|
3401
|
+
function ar({
|
|
3393
3402
|
methods: t,
|
|
3394
3403
|
selectedId: a,
|
|
3395
3404
|
onSelect: n,
|
|
3396
3405
|
onClose: r
|
|
3397
3406
|
}) {
|
|
3398
|
-
const o = P(), [
|
|
3399
|
-
const
|
|
3400
|
-
if (!
|
|
3407
|
+
const o = P(), [c, u] = w(""), l = t.length > 0 ? t[0].id : "", d = W(() => {
|
|
3408
|
+
const s = c.trim().toLowerCase();
|
|
3409
|
+
if (!s) {
|
|
3401
3410
|
if (a) {
|
|
3402
3411
|
const h = t.find((p) => p.id === a);
|
|
3403
3412
|
if (h) {
|
|
@@ -3408,23 +3417,23 @@ function tr({
|
|
|
3408
3417
|
return t;
|
|
3409
3418
|
}
|
|
3410
3419
|
return t.filter(
|
|
3411
|
-
(h) => h.id.toLowerCase().includes(
|
|
3420
|
+
(h) => h.id.toLowerCase().includes(s) || h.name.toLowerCase().includes(s) || h.description && h.description.toLowerCase().includes(s)
|
|
3412
3421
|
);
|
|
3413
|
-
}, [t,
|
|
3422
|
+
}, [t, c, a]);
|
|
3414
3423
|
return /* @__PURE__ */ i(Z, { children: [
|
|
3415
3424
|
/* @__PURE__ */ i("div", { className: "relative shrink-0", style: { height: 128, background: "var(--t-header-bg)", backdropFilter: "blur(var(--t-header-blur))", WebkitBackdropFilter: "blur(var(--t-header-blur))" }, children: [
|
|
3416
3425
|
/* @__PURE__ */ e("div", { className: "absolute", style: { left: 12, top: 20 }, children: /* @__PURE__ */ e(Ae, { width: 46 }) }),
|
|
3417
3426
|
/* @__PURE__ */ e("p", { className: "absolute text-[16px] text-center truncate", style: { top: 28, left: 64, right: 64, color: "var(--t-text)", lineHeight: "24px" }, children: o("modal.choosePayment") }),
|
|
3418
3427
|
/* @__PURE__ */ e("div", { className: "absolute", style: { right: 12, top: 20 }, children: /* @__PURE__ */ e(Oe, { onClick: r }) }),
|
|
3419
|
-
/* @__PURE__ */ e("div", { className: "absolute", style: { bottom: 8, left: 12, right: 12 }, children: /* @__PURE__ */ e(Ye, { value:
|
|
3428
|
+
/* @__PURE__ */ e("div", { className: "absolute", style: { bottom: 8, left: 12, right: 12 }, children: /* @__PURE__ */ e(Ye, { value: c, onChange: u, inline: !0 }) })
|
|
3420
3429
|
] }),
|
|
3421
3430
|
/* @__PURE__ */ i("div", { className: "flex-1 overflow-y-auto custom-scroll px-3", children: [
|
|
3422
|
-
d.map((
|
|
3423
|
-
const p =
|
|
3431
|
+
d.map((s, h) => {
|
|
3432
|
+
const p = s.id === a, f = Vt(s.id, s.name, o);
|
|
3424
3433
|
return /* @__PURE__ */ i(
|
|
3425
3434
|
"button",
|
|
3426
3435
|
{
|
|
3427
|
-
onClick: () => n(
|
|
3436
|
+
onClick: () => n(s.id),
|
|
3428
3437
|
className: "flex items-center w-full card-press hover-item modal-item-in",
|
|
3429
3438
|
style: { gap: 16, animationDelay: `${Math.min(h * 45, 350)}ms` },
|
|
3430
3439
|
children: [
|
|
@@ -3433,12 +3442,12 @@ function tr({
|
|
|
3433
3442
|
{
|
|
3434
3443
|
className: "flex items-center justify-center shrink-0",
|
|
3435
3444
|
style: { width: 32, height: 32 },
|
|
3436
|
-
children: Wt(
|
|
3445
|
+
children: Wt(s.id, s.icon, 32)
|
|
3437
3446
|
}
|
|
3438
3447
|
),
|
|
3439
3448
|
/* @__PURE__ */ i("div", { className: "flex-1 flex items-center", style: { borderBottom: "1px solid var(--t-card-border)", paddingTop: 20, paddingBottom: 20, gap: 10 }, children: [
|
|
3440
3449
|
/* @__PURE__ */ e("span", { className: "flex-1 text-[18px] text-left", style: { color: "var(--t-text)", lineHeight: "20px" }, children: f }),
|
|
3441
|
-
|
|
3450
|
+
s.id === l && /* @__PURE__ */ e("span", { className: "text-[11px] font-medium", style: { border: "1.5px solid var(--t-card-border)", borderRadius: 100, paddingLeft: 8, paddingRight: 8, color: "var(--t-text-secondary)", lineHeight: "20px", letterSpacing: "0.22px" }, children: o("modal.recommended") }),
|
|
3442
3451
|
p && /* @__PURE__ */ e("div", { style: { width: 40, height: 20, display: "flex", alignItems: "center", justifyContent: "center" }, children: /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
|
|
3443
3452
|
"path",
|
|
3444
3453
|
{
|
|
@@ -3452,14 +3461,14 @@ function tr({
|
|
|
3452
3461
|
] })
|
|
3453
3462
|
]
|
|
3454
3463
|
},
|
|
3455
|
-
|
|
3464
|
+
s.id
|
|
3456
3465
|
);
|
|
3457
3466
|
}),
|
|
3458
3467
|
d.length === 0 && /* @__PURE__ */ e("div", { className: "text-center py-10 text-[14px]", style: { color: "var(--t-text-muted)" }, children: o("modal.noPaymentMethods") })
|
|
3459
3468
|
] })
|
|
3460
3469
|
] });
|
|
3461
3470
|
}
|
|
3462
|
-
function
|
|
3471
|
+
function nr({
|
|
3463
3472
|
checked: t,
|
|
3464
3473
|
onChange: a,
|
|
3465
3474
|
accentColor: n
|
|
@@ -3491,28 +3500,28 @@ function ar({
|
|
|
3491
3500
|
}
|
|
3492
3501
|
);
|
|
3493
3502
|
}
|
|
3494
|
-
const
|
|
3503
|
+
const rr = [
|
|
3495
3504
|
{ key: "settings.privacy", href: "https://nowramp.com/privacy-policy" },
|
|
3496
3505
|
{ key: "settings.terms", href: "https://nowramp.com/terms-and-conditions" }
|
|
3497
3506
|
], ht = {
|
|
3498
3507
|
background: "var(--t-surface)",
|
|
3499
3508
|
borderRadius: "var(--t-card-radius)"
|
|
3500
3509
|
};
|
|
3501
|
-
function
|
|
3510
|
+
function or({
|
|
3502
3511
|
onClose: t,
|
|
3503
3512
|
darkMode: a,
|
|
3504
3513
|
onToggleDarkMode: n,
|
|
3505
3514
|
skinId: r,
|
|
3506
3515
|
onSelectSkin: o,
|
|
3507
|
-
showThemeToggle:
|
|
3516
|
+
showThemeToggle: c = !0,
|
|
3508
3517
|
country: u,
|
|
3509
3518
|
countryName: l,
|
|
3510
3519
|
onLocationPress: d,
|
|
3511
|
-
onLanguagePress:
|
|
3520
|
+
onLanguagePress: s,
|
|
3512
3521
|
assetBaseUrl: h = ""
|
|
3513
3522
|
}) {
|
|
3514
3523
|
var y;
|
|
3515
|
-
const { t: p, locale: f, languages: g } = _t(), [k,
|
|
3524
|
+
const { t: p, locale: f, languages: g } = _t(), [k, R] = w(!1);
|
|
3516
3525
|
return /* @__PURE__ */ i(Z, { children: [
|
|
3517
3526
|
/* @__PURE__ */ i("div", { className: "relative shrink-0", style: { height: 80, background: "var(--t-header-bg)", backdropFilter: "blur(var(--t-header-blur))", WebkitBackdropFilter: "blur(var(--t-header-blur))" }, children: [
|
|
3518
3527
|
/* @__PURE__ */ e("div", { className: "absolute", style: { left: 12, top: 20 }, children: /* @__PURE__ */ e(Ae, { width: 46 }) }),
|
|
@@ -3537,9 +3546,9 @@ function rr({
|
|
|
3537
3546
|
width: 28,
|
|
3538
3547
|
height: 28,
|
|
3539
3548
|
style: { width: 28, height: 28, borderRadius: "50%", objectFit: "cover" },
|
|
3540
|
-
onError: () =>
|
|
3549
|
+
onError: () => R(!0)
|
|
3541
3550
|
}
|
|
3542
|
-
) : /* @__PURE__ */ e(
|
|
3551
|
+
) : /* @__PURE__ */ e(ir, { size: 28 }),
|
|
3543
3552
|
/* @__PURE__ */ e("span", { className: "text-[15px] font-medium", style: { color: "var(--t-text)" }, children: l || u })
|
|
3544
3553
|
] }),
|
|
3545
3554
|
/* @__PURE__ */ e(Re, {})
|
|
@@ -3547,48 +3556,48 @@ function rr({
|
|
|
3547
3556
|
]
|
|
3548
3557
|
}
|
|
3549
3558
|
),
|
|
3550
|
-
|
|
3559
|
+
c && /* @__PURE__ */ i(
|
|
3551
3560
|
"div",
|
|
3552
3561
|
{
|
|
3553
3562
|
className: "flex items-center justify-between w-full px-4 modal-item-in",
|
|
3554
3563
|
style: { ...ht, paddingTop: 14, paddingBottom: 14, animationDelay: "60ms" },
|
|
3555
3564
|
children: [
|
|
3556
3565
|
/* @__PURE__ */ e("span", { className: "font-medium text-[15px]", style: { color: "var(--t-text)" }, children: p("settings.darkMode") }),
|
|
3557
|
-
/* @__PURE__ */ e(
|
|
3566
|
+
/* @__PURE__ */ e(nr, { checked: a, onChange: n })
|
|
3558
3567
|
]
|
|
3559
3568
|
}
|
|
3560
3569
|
),
|
|
3561
|
-
|
|
3570
|
+
s && /* @__PURE__ */ i(
|
|
3562
3571
|
"button",
|
|
3563
3572
|
{
|
|
3564
|
-
onClick:
|
|
3573
|
+
onClick: s,
|
|
3565
3574
|
className: "flex items-center justify-between w-full transition-colors card-press modal-item-in",
|
|
3566
3575
|
style: { ...ht, backgroundColor: "var(--t-surface)", color: "inherit", border: "none", cursor: "pointer", padding: "14px 16px", margin: 0, textAlign: "left", animationDelay: "120ms" },
|
|
3567
3576
|
children: [
|
|
3568
3577
|
/* @__PURE__ */ e("span", { className: "font-medium text-[15px]", style: { color: "var(--t-text)" }, children: p("settings.language") }),
|
|
3569
|
-
/* @__PURE__ */ e("span", { className: "text-[13px]", style: { color: "var(--t-text-secondary)" }, children: ((y = g.find((
|
|
3578
|
+
/* @__PURE__ */ e("span", { className: "text-[13px]", style: { color: "var(--t-text-secondary)" }, children: ((y = g.find((E) => E.code === f)) == null ? void 0 : y.name) || f })
|
|
3570
3579
|
]
|
|
3571
3580
|
}
|
|
3572
3581
|
),
|
|
3573
|
-
|
|
3582
|
+
rr.map((E, K) => /* @__PURE__ */ i(
|
|
3574
3583
|
"a",
|
|
3575
3584
|
{
|
|
3576
|
-
href:
|
|
3585
|
+
href: E.href,
|
|
3577
3586
|
target: "_blank",
|
|
3578
3587
|
rel: "noopener noreferrer",
|
|
3579
3588
|
className: "flex items-center justify-between w-full px-4 transition-colors card-press modal-item-in",
|
|
3580
3589
|
style: { ...ht, textDecoration: "none", color: "inherit", paddingTop: 14, paddingBottom: 14, animationDelay: `${180 + K * 60}ms` },
|
|
3581
3590
|
children: [
|
|
3582
|
-
/* @__PURE__ */ e("span", { className: "font-medium text-[15px]", style: { color: "var(--t-text)" }, children: p(
|
|
3591
|
+
/* @__PURE__ */ e("span", { className: "font-medium text-[15px]", style: { color: "var(--t-text)" }, children: p(E.key) }),
|
|
3583
3592
|
/* @__PURE__ */ e(Pn, {})
|
|
3584
3593
|
]
|
|
3585
3594
|
},
|
|
3586
|
-
|
|
3595
|
+
E.key
|
|
3587
3596
|
))
|
|
3588
3597
|
] })
|
|
3589
3598
|
] });
|
|
3590
3599
|
}
|
|
3591
|
-
function
|
|
3600
|
+
function ir({ size: t = 28 }) {
|
|
3592
3601
|
return /* @__PURE__ */ i("svg", { width: t, height: t, viewBox: "0 0 40 40", fill: "none", children: [
|
|
3593
3602
|
/* @__PURE__ */ e("circle", { cx: "20", cy: "20", r: "18", stroke: "var(--t-text-secondary)", strokeWidth: "1.5", fill: "none" }),
|
|
3594
3603
|
/* @__PURE__ */ e("ellipse", { cx: "20", cy: "20", rx: "9", ry: "18", stroke: "var(--t-text-secondary)", strokeWidth: "1.5", fill: "none" }),
|
|
@@ -3596,46 +3605,46 @@ function or({ size: t = 28 }) {
|
|
|
3596
3605
|
/* @__PURE__ */ e("path", { d: "M5 12h30M5 28h30", stroke: "var(--t-text-secondary)", strokeWidth: "1.2" })
|
|
3597
3606
|
] });
|
|
3598
3607
|
}
|
|
3599
|
-
function
|
|
3608
|
+
function lr({
|
|
3600
3609
|
onClose: t,
|
|
3601
3610
|
onSelect: a,
|
|
3602
3611
|
assetBaseUrl: n = "",
|
|
3603
3612
|
selectedCode: r
|
|
3604
3613
|
}) {
|
|
3605
|
-
const o = P(), [
|
|
3606
|
-
const d =
|
|
3614
|
+
const o = P(), [c, u] = w(""), l = W(() => {
|
|
3615
|
+
const d = c.trim().toLowerCase();
|
|
3607
3616
|
if (!d) {
|
|
3608
3617
|
if (r) {
|
|
3609
|
-
const
|
|
3618
|
+
const s = r.toLowerCase(), h = Ot[s];
|
|
3610
3619
|
if (h) {
|
|
3611
|
-
const p = ft.filter((f) => f.code !==
|
|
3620
|
+
const p = ft.filter((f) => f.code !== s);
|
|
3612
3621
|
return [h, ...p];
|
|
3613
3622
|
}
|
|
3614
3623
|
}
|
|
3615
3624
|
return ft;
|
|
3616
3625
|
}
|
|
3617
3626
|
return ft.filter(
|
|
3618
|
-
(
|
|
3627
|
+
(s) => s.name.toLowerCase().includes(d) || s.code.includes(d) || s.defaultFiat.toLowerCase().includes(d)
|
|
3619
3628
|
);
|
|
3620
|
-
}, [
|
|
3629
|
+
}, [c, r]);
|
|
3621
3630
|
return /* @__PURE__ */ i(Z, { children: [
|
|
3622
3631
|
/* @__PURE__ */ i("div", { className: "relative shrink-0", style: { height: 128, background: "var(--t-header-bg)", backdropFilter: "blur(var(--t-header-blur))", WebkitBackdropFilter: "blur(var(--t-header-blur))" }, children: [
|
|
3623
3632
|
/* @__PURE__ */ e("div", { className: "absolute", style: { left: 12, top: 20 }, children: /* @__PURE__ */ e(Ae, { width: 46 }) }),
|
|
3624
3633
|
/* @__PURE__ */ e("p", { className: "absolute text-[16px] text-center truncate", style: { top: 28, left: 64, right: 64, color: "var(--t-text)", lineHeight: "24px" }, children: o("modal.selectCountry") }),
|
|
3625
3634
|
/* @__PURE__ */ e("div", { className: "absolute", style: { right: 12, top: 20 }, children: /* @__PURE__ */ e(Oe, { onClick: t }) }),
|
|
3626
|
-
/* @__PURE__ */ e("div", { className: "absolute", style: { bottom: 8, left: 12, right: 12 }, children: /* @__PURE__ */ e(Ye, { value:
|
|
3635
|
+
/* @__PURE__ */ e("div", { className: "absolute", style: { bottom: 8, left: 12, right: 12 }, children: /* @__PURE__ */ e(Ye, { value: c, onChange: u, inline: !0 }) })
|
|
3627
3636
|
] }),
|
|
3628
3637
|
/* @__PURE__ */ i("div", { className: "flex-1 overflow-y-auto custom-scroll px-3", children: [
|
|
3629
|
-
l.map((d,
|
|
3638
|
+
l.map((d, s) => {
|
|
3630
3639
|
const h = (r == null ? void 0 : r.toLowerCase()) === d.code;
|
|
3631
3640
|
return /* @__PURE__ */ i(
|
|
3632
3641
|
"button",
|
|
3633
3642
|
{
|
|
3634
3643
|
onClick: () => a(d.code),
|
|
3635
3644
|
className: "flex items-center w-full card-press hover-item modal-item-in",
|
|
3636
|
-
style: { gap: 16, animationDelay: `${Math.min(
|
|
3645
|
+
style: { gap: 16, animationDelay: `${Math.min(s * 45, 350)}ms` },
|
|
3637
3646
|
children: [
|
|
3638
|
-
/* @__PURE__ */ e(
|
|
3647
|
+
/* @__PURE__ */ e(cr, { code: d.code, size: 32, baseUrl: n }),
|
|
3639
3648
|
/* @__PURE__ */ i("div", { className: "flex-1 flex items-center", style: { borderBottom: "1px solid var(--t-card-border)", paddingTop: 20, paddingBottom: 20, gap: 10 }, children: [
|
|
3640
3649
|
/* @__PURE__ */ e("span", { className: "flex-1 text-[18px] text-left", style: { color: "var(--t-text)", lineHeight: "20px" }, children: d.name }),
|
|
3641
3650
|
h && /* @__PURE__ */ e("div", { style: { width: 40, height: 20, display: "flex", alignItems: "center", justifyContent: "center" }, children: /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
|
|
@@ -3658,7 +3667,7 @@ function ir({
|
|
|
3658
3667
|
] })
|
|
3659
3668
|
] });
|
|
3660
3669
|
}
|
|
3661
|
-
function
|
|
3670
|
+
function cr({ code: t, size: a = 32, baseUrl: n = "" }) {
|
|
3662
3671
|
const [r, o] = w(!1);
|
|
3663
3672
|
return r ? /* @__PURE__ */ e(
|
|
3664
3673
|
"div",
|
|
@@ -3688,19 +3697,19 @@ function lr({ code: t, size: a = 32, baseUrl: n = "" }) {
|
|
|
3688
3697
|
}
|
|
3689
3698
|
);
|
|
3690
3699
|
}
|
|
3691
|
-
function
|
|
3700
|
+
function sr({
|
|
3692
3701
|
onClose: t,
|
|
3693
3702
|
onSelect: a,
|
|
3694
3703
|
selectedCode: n
|
|
3695
3704
|
}) {
|
|
3696
|
-
const r = P(), [o,
|
|
3705
|
+
const r = P(), [o, c] = w(""), u = W(() => {
|
|
3697
3706
|
const l = o.trim().toLowerCase();
|
|
3698
3707
|
if (!l) {
|
|
3699
3708
|
if (n) {
|
|
3700
|
-
const d = Ze.find((
|
|
3709
|
+
const d = Ze.find((s) => s.code === n);
|
|
3701
3710
|
if (d) {
|
|
3702
|
-
const
|
|
3703
|
-
return [d, ...
|
|
3711
|
+
const s = Ze.filter((h) => h.code !== n);
|
|
3712
|
+
return [d, ...s];
|
|
3704
3713
|
}
|
|
3705
3714
|
}
|
|
3706
3715
|
return Ze;
|
|
@@ -3714,11 +3723,11 @@ function cr({
|
|
|
3714
3723
|
/* @__PURE__ */ e("div", { className: "absolute", style: { left: 12, top: 20 }, children: /* @__PURE__ */ e(Ae, { width: 46 }) }),
|
|
3715
3724
|
/* @__PURE__ */ e("p", { className: "absolute text-[16px] text-center truncate", style: { top: 28, left: 64, right: 64, color: "var(--t-text)", lineHeight: "24px" }, children: r("modal.selectLanguage") }),
|
|
3716
3725
|
/* @__PURE__ */ e("div", { className: "absolute", style: { right: 12, top: 20 }, children: /* @__PURE__ */ e(Oe, { onClick: t }) }),
|
|
3717
|
-
/* @__PURE__ */ e("div", { className: "absolute", style: { bottom: 8, left: 12, right: 12 }, children: /* @__PURE__ */ e(Ye, { value: o, onChange:
|
|
3726
|
+
/* @__PURE__ */ e("div", { className: "absolute", style: { bottom: 8, left: 12, right: 12 }, children: /* @__PURE__ */ e(Ye, { value: o, onChange: c, inline: !0 }) })
|
|
3718
3727
|
] }),
|
|
3719
3728
|
/* @__PURE__ */ i("div", { className: "flex-1 overflow-y-auto custom-scroll px-3", children: [
|
|
3720
3729
|
u.map((l, d) => {
|
|
3721
|
-
const
|
|
3730
|
+
const s = n === l.code;
|
|
3722
3731
|
return /* @__PURE__ */ e(
|
|
3723
3732
|
"button",
|
|
3724
3733
|
{
|
|
@@ -3728,7 +3737,7 @@ function cr({
|
|
|
3728
3737
|
children: /* @__PURE__ */ i("div", { className: "flex-1 flex items-center", style: { borderBottom: "1px solid var(--t-card-border)", paddingTop: 20, paddingBottom: 20, paddingLeft: 4, gap: 10 }, children: [
|
|
3729
3738
|
/* @__PURE__ */ e("span", { className: "flex-1 text-[18px] text-left", style: { color: "var(--t-text)", lineHeight: "20px" }, children: l.name }),
|
|
3730
3739
|
/* @__PURE__ */ e("span", { className: "text-[13px]", style: { color: "var(--t-text-muted)" }, children: l.english }),
|
|
3731
|
-
|
|
3740
|
+
s && /* @__PURE__ */ e("div", { style: { width: 40, height: 20, display: "flex", alignItems: "center", justifyContent: "center" }, children: /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
|
|
3732
3741
|
"path",
|
|
3733
3742
|
{
|
|
3734
3743
|
d: "M13.5 4.5L6 12L2.5 8.5",
|
|
@@ -3747,14 +3756,14 @@ function cr({
|
|
|
3747
3756
|
] })
|
|
3748
3757
|
] });
|
|
3749
3758
|
}
|
|
3750
|
-
function
|
|
3759
|
+
function dr({
|
|
3751
3760
|
tab: t,
|
|
3752
3761
|
onTabSwitch: a,
|
|
3753
3762
|
showFlowToggle: n,
|
|
3754
3763
|
showSettings: r,
|
|
3755
3764
|
onOpenSettings: o
|
|
3756
3765
|
}) {
|
|
3757
|
-
const
|
|
3766
|
+
const c = P();
|
|
3758
3767
|
return /* @__PURE__ */ i(
|
|
3759
3768
|
"div",
|
|
3760
3769
|
{
|
|
@@ -3808,7 +3817,7 @@ function sr({
|
|
|
3808
3817
|
borderRadius: "var(--t-pill-radius)",
|
|
3809
3818
|
color: t === "buy" ? "var(--t-tab-active-text)" : "var(--t-tab-inactive-text)"
|
|
3810
3819
|
},
|
|
3811
|
-
children:
|
|
3820
|
+
children: c("header.buy")
|
|
3812
3821
|
}
|
|
3813
3822
|
),
|
|
3814
3823
|
/* @__PURE__ */ e(
|
|
@@ -3824,7 +3833,7 @@ function sr({
|
|
|
3824
3833
|
borderRadius: "var(--t-pill-radius)",
|
|
3825
3834
|
color: t === "sell" ? "var(--t-tab-active-text)" : "var(--t-tab-inactive-text)"
|
|
3826
3835
|
},
|
|
3827
|
-
children:
|
|
3836
|
+
children: c("header.sell")
|
|
3828
3837
|
}
|
|
3829
3838
|
)
|
|
3830
3839
|
]
|
|
@@ -3835,25 +3844,25 @@ function sr({
|
|
|
3835
3844
|
}
|
|
3836
3845
|
);
|
|
3837
3846
|
}
|
|
3838
|
-
function
|
|
3847
|
+
function ur({
|
|
3839
3848
|
amount: t,
|
|
3840
3849
|
onAmountChange: a,
|
|
3841
3850
|
currencyCode: n,
|
|
3842
3851
|
isBuy: r,
|
|
3843
3852
|
onOpenModal: o,
|
|
3844
|
-
assetBaseUrl:
|
|
3853
|
+
assetBaseUrl: c,
|
|
3845
3854
|
error: u,
|
|
3846
3855
|
fieldLocks: l,
|
|
3847
3856
|
onBlur: d,
|
|
3848
|
-
inputRef:
|
|
3857
|
+
inputRef: s,
|
|
3849
3858
|
chainCode: h,
|
|
3850
3859
|
chainDisplay: p,
|
|
3851
3860
|
getChainIconUrl: f,
|
|
3852
3861
|
shaking: g,
|
|
3853
3862
|
onFocus: k
|
|
3854
3863
|
}) {
|
|
3855
|
-
var y,
|
|
3856
|
-
const
|
|
3864
|
+
var y, E, K;
|
|
3865
|
+
const R = P();
|
|
3857
3866
|
return /* @__PURE__ */ i(Z, { children: [
|
|
3858
3867
|
/* @__PURE__ */ i(
|
|
3859
3868
|
"div",
|
|
@@ -3865,18 +3874,18 @@ function dr({
|
|
|
3865
3874
|
...u ? { border: "1px solid var(--t-error)" } : {}
|
|
3866
3875
|
},
|
|
3867
3876
|
children: [
|
|
3868
|
-
/* @__PURE__ */ e("div", { className: "text-[16px]", style: { color: "var(--t-text-secondary)", lineHeight: "16px" }, children:
|
|
3877
|
+
/* @__PURE__ */ e("div", { className: "text-[16px]", style: { color: "var(--t-text-secondary)", lineHeight: "16px" }, children: R("spend.label") }),
|
|
3869
3878
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between", children: [
|
|
3870
3879
|
/* @__PURE__ */ e(
|
|
3871
3880
|
"input",
|
|
3872
3881
|
{
|
|
3873
|
-
ref:
|
|
3882
|
+
ref: s,
|
|
3874
3883
|
type: "text",
|
|
3875
3884
|
value: t,
|
|
3876
3885
|
onChange: a,
|
|
3877
3886
|
onFocus: k,
|
|
3878
3887
|
onBlur: d,
|
|
3879
|
-
placeholder:
|
|
3888
|
+
placeholder: R(r ? "spend.placeholderFiat" : "spend.placeholderCrypto"),
|
|
3880
3889
|
className: "bg-transparent outline-none w-0 flex-1 mr-3",
|
|
3881
3890
|
style: {
|
|
3882
3891
|
color: "var(--t-text)",
|
|
@@ -3910,9 +3919,9 @@ function dr({
|
|
|
3910
3919
|
backdropFilter: "blur(4px)",
|
|
3911
3920
|
WebkitBackdropFilter: "blur(4px)"
|
|
3912
3921
|
},
|
|
3913
|
-
disabled: !!((
|
|
3922
|
+
disabled: !!((E = l == null ? void 0 : l.sourceCurrency) != null && E.locked),
|
|
3914
3923
|
children: [
|
|
3915
|
-
/* @__PURE__ */ e(jt, { currencyCode: n, size: 24, baseUrl:
|
|
3924
|
+
/* @__PURE__ */ e(jt, { currencyCode: n, size: 24, baseUrl: c }),
|
|
3916
3925
|
/* @__PURE__ */ e("span", { className: "text-[14px] font-semibold", style: { color: "var(--t-text)", letterSpacing: "0.14px", lineHeight: "24px" }, children: n }),
|
|
3917
3926
|
/* @__PURE__ */ e(Re, {})
|
|
3918
3927
|
]
|
|
@@ -3936,7 +3945,7 @@ function dr({
|
|
|
3936
3945
|
},
|
|
3937
3946
|
disabled: !!((K = l == null ? void 0 : l.destinationCurrency) != null && K.locked),
|
|
3938
3947
|
children: [
|
|
3939
|
-
/* @__PURE__ */ e(Aa, { ticker: n, size: 24, baseUrl:
|
|
3948
|
+
/* @__PURE__ */ e(Aa, { ticker: n, size: 24, baseUrl: c }),
|
|
3940
3949
|
/* @__PURE__ */ e("span", { className: "text-[14px] font-semibold", style: { color: "var(--t-text)", letterSpacing: "0.14px", lineHeight: "24px" }, children: n }),
|
|
3941
3950
|
/* @__PURE__ */ e(Re, {})
|
|
3942
3951
|
]
|
|
@@ -3946,7 +3955,7 @@ function dr({
|
|
|
3946
3955
|
/* @__PURE__ */ e("div", { className: "rounded-full", style: { width: 14, height: 14, background: "#ffffff" }, children: /* @__PURE__ */ e(
|
|
3947
3956
|
"img",
|
|
3948
3957
|
{
|
|
3949
|
-
src: f(h,
|
|
3958
|
+
src: f(h, c),
|
|
3950
3959
|
alt: h,
|
|
3951
3960
|
width: 14,
|
|
3952
3961
|
height: 14,
|
|
@@ -3964,37 +3973,37 @@ function dr({
|
|
|
3964
3973
|
u && /* @__PURE__ */ e("div", { className: "text-[12px] mt-1.5 text-center", style: { color: "var(--t-error)" }, children: u })
|
|
3965
3974
|
] });
|
|
3966
3975
|
}
|
|
3967
|
-
function
|
|
3976
|
+
function mr({ char: t, height: a = 38 }) {
|
|
3968
3977
|
const n = "0123456789", r = n.indexOf(t);
|
|
3969
3978
|
return r === -1 ? /* @__PURE__ */ e("span", { style: { display: "inline-block", textAlign: "center" }, children: t }) : /* @__PURE__ */ e("span", { className: "digit-slot", style: { height: a, lineHeight: `${a}px`, textAlign: "center" }, children: /* @__PURE__ */ e("span", { className: "digit-slot-inner block", style: { transform: `translateY(-${r * a}px)` }, children: n.split("").map((o) => /* @__PURE__ */ e("span", { className: "block", style: { height: a, lineHeight: `${a}px` }, children: o }, o)) }) });
|
|
3970
3979
|
}
|
|
3971
|
-
function
|
|
3980
|
+
function pr({
|
|
3972
3981
|
value: t,
|
|
3973
3982
|
height: a = 38,
|
|
3974
3983
|
className: n = "",
|
|
3975
3984
|
style: r = {}
|
|
3976
3985
|
}) {
|
|
3977
|
-
return /* @__PURE__ */ e("span", { className: n, style: { display: "inline-flex", fontVariantNumeric: "tabular-nums", ...r }, children: t.split("").map((o,
|
|
3986
|
+
return /* @__PURE__ */ e("span", { className: n, style: { display: "inline-flex", fontVariantNumeric: "tabular-nums", ...r }, children: t.split("").map((o, c) => /* @__PURE__ */ e(mr, { char: o, height: a }, c)) });
|
|
3978
3987
|
}
|
|
3979
|
-
function
|
|
3988
|
+
function hr({
|
|
3980
3989
|
amount: t,
|
|
3981
3990
|
currencyCode: a,
|
|
3982
3991
|
chainCode: n,
|
|
3983
3992
|
chainDisplay: r,
|
|
3984
3993
|
isBuy: o,
|
|
3985
|
-
onOpenModal:
|
|
3994
|
+
onOpenModal: c,
|
|
3986
3995
|
displayRate: u,
|
|
3987
3996
|
assetBaseUrl: l,
|
|
3988
3997
|
quotesLoading: d,
|
|
3989
|
-
onOpenRateBreakdown:
|
|
3998
|
+
onOpenRateBreakdown: s,
|
|
3990
3999
|
fieldLocks: h,
|
|
3991
4000
|
spendNumeric: p,
|
|
3992
4001
|
getChainIconUrl: f,
|
|
3993
4002
|
autoSelectPending: g,
|
|
3994
4003
|
rateFlash: k
|
|
3995
4004
|
}) {
|
|
3996
|
-
var y,
|
|
3997
|
-
const
|
|
4005
|
+
var y, E;
|
|
4006
|
+
const R = P();
|
|
3998
4007
|
return /* @__PURE__ */ e(
|
|
3999
4008
|
"div",
|
|
4000
4009
|
{
|
|
@@ -4005,11 +4014,11 @@ function pr({
|
|
|
4005
4014
|
background: "transparent"
|
|
4006
4015
|
},
|
|
4007
4016
|
children: /* @__PURE__ */ i("div", { className: "flex flex-col gap-[20px]", children: [
|
|
4008
|
-
/* @__PURE__ */ e("div", { className: "text-[16px]", style: { color: "var(--t-text-secondary)", lineHeight: "16px" }, children:
|
|
4017
|
+
/* @__PURE__ */ e("div", { className: "text-[16px]", style: { color: "var(--t-text-secondary)", lineHeight: "16px" }, children: R("receive.label") }),
|
|
4009
4018
|
/* @__PURE__ */ i("div", { className: "flex flex-col gap-[8px]", children: [
|
|
4010
4019
|
/* @__PURE__ */ i("div", { className: "flex items-start justify-between", children: [
|
|
4011
4020
|
/* @__PURE__ */ e("div", { className: k ? "rate-flash" : "", children: /* @__PURE__ */ e(
|
|
4012
|
-
|
|
4021
|
+
pr,
|
|
4013
4022
|
{
|
|
4014
4023
|
value: p > 0 ? t : "0",
|
|
4015
4024
|
height: 32,
|
|
@@ -4023,7 +4032,7 @@ function pr({
|
|
|
4023
4032
|
o ? /* @__PURE__ */ e("div", { className: "flex flex-col items-end shrink-0", children: /* @__PURE__ */ i(
|
|
4024
4033
|
"button",
|
|
4025
4034
|
{
|
|
4026
|
-
onClick:
|
|
4035
|
+
onClick: c,
|
|
4027
4036
|
className: "flex items-center gap-[4px] transition-colors",
|
|
4028
4037
|
style: {
|
|
4029
4038
|
background: "var(--t-pill-solid-bg)",
|
|
@@ -4046,7 +4055,7 @@ function pr({
|
|
|
4046
4055
|
) }) : /* @__PURE__ */ i(
|
|
4047
4056
|
"button",
|
|
4048
4057
|
{
|
|
4049
|
-
onClick:
|
|
4058
|
+
onClick: c,
|
|
4050
4059
|
className: "flex items-center gap-[4px] shrink-0 transition-colors",
|
|
4051
4060
|
style: {
|
|
4052
4061
|
background: "var(--t-pill-solid-bg)",
|
|
@@ -4059,7 +4068,7 @@ function pr({
|
|
|
4059
4068
|
backdropFilter: "blur(4px)",
|
|
4060
4069
|
WebkitBackdropFilter: "blur(4px)"
|
|
4061
4070
|
},
|
|
4062
|
-
disabled: !!((
|
|
4071
|
+
disabled: !!((E = h == null ? void 0 : h.sourceCurrency) != null && E.locked),
|
|
4063
4072
|
children: [
|
|
4064
4073
|
/* @__PURE__ */ e(jt, { currencyCode: a, size: 24, baseUrl: l }),
|
|
4065
4074
|
/* @__PURE__ */ e("span", { className: "text-[14px] font-semibold", style: { color: "var(--t-text)", letterSpacing: "0.14px", lineHeight: "24px" }, children: a }),
|
|
@@ -4071,13 +4080,13 @@ function pr({
|
|
|
4071
4080
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between", children: [
|
|
4072
4081
|
/* @__PURE__ */ e("div", { className: "flex items-center gap-[4px]", children: d && !g ? /* @__PURE__ */ i(Z, { children: [
|
|
4073
4082
|
/* @__PURE__ */ e(Ee, { size: 12 }),
|
|
4074
|
-
/* @__PURE__ */ e("span", { className: "text-[11px] font-medium", style: { color: "var(--t-text-muted)", letterSpacing: "0.22px", lineHeight: "12px" }, children:
|
|
4083
|
+
/* @__PURE__ */ e("span", { className: "text-[11px] font-medium", style: { color: "var(--t-text-muted)", letterSpacing: "0.22px", lineHeight: "12px" }, children: R("receive.fetchingRate") })
|
|
4075
4084
|
] }) : /* @__PURE__ */ i(Z, { children: [
|
|
4076
4085
|
/* @__PURE__ */ e("span", { className: "text-[11px] font-medium", style: { color: "var(--t-text-muted)", letterSpacing: "0.22px", lineHeight: "12px" }, children: u || " " }),
|
|
4077
4086
|
u && /* @__PURE__ */ e(
|
|
4078
4087
|
"button",
|
|
4079
4088
|
{
|
|
4080
|
-
onClick:
|
|
4089
|
+
onClick: s,
|
|
4081
4090
|
className: "flex items-center justify-center opacity-60 hover:opacity-100 transition-opacity",
|
|
4082
4091
|
children: /* @__PURE__ */ e(Ht, { size: 12 })
|
|
4083
4092
|
}
|
|
@@ -4103,7 +4112,7 @@ function pr({
|
|
|
4103
4112
|
}
|
|
4104
4113
|
);
|
|
4105
4114
|
}
|
|
4106
|
-
function
|
|
4115
|
+
function fr({
|
|
4107
4116
|
selectedMethod: t,
|
|
4108
4117
|
onOpenModal: a,
|
|
4109
4118
|
getMethodIcon: n,
|
|
@@ -4116,8 +4125,8 @@ function hr({
|
|
|
4116
4125
|
role: "button",
|
|
4117
4126
|
tabIndex: 0,
|
|
4118
4127
|
onClick: a,
|
|
4119
|
-
onKeyDown: (
|
|
4120
|
-
(
|
|
4128
|
+
onKeyDown: (c) => {
|
|
4129
|
+
(c.key === "Enter" || c.key === " ") && a();
|
|
4121
4130
|
},
|
|
4122
4131
|
className: "flex items-center gap-[4px] p-4 transition-colors cursor-pointer card-press card-hover",
|
|
4123
4132
|
style: {
|
|
@@ -4138,7 +4147,7 @@ function hr({
|
|
|
4138
4147
|
}
|
|
4139
4148
|
);
|
|
4140
4149
|
}
|
|
4141
|
-
function
|
|
4150
|
+
function yr({
|
|
4142
4151
|
selectedQuote: t,
|
|
4143
4152
|
quotesLoading: a,
|
|
4144
4153
|
onOpenModal: n,
|
|
@@ -4151,8 +4160,8 @@ function fr({
|
|
|
4151
4160
|
role: "button",
|
|
4152
4161
|
tabIndex: 0,
|
|
4153
4162
|
onClick: n,
|
|
4154
|
-
onKeyDown: (
|
|
4155
|
-
(
|
|
4163
|
+
onKeyDown: (c) => {
|
|
4164
|
+
(c.key === "Enter" || c.key === " ") && n();
|
|
4156
4165
|
},
|
|
4157
4166
|
className: "flex items-center gap-[4px] p-4 transition-colors cursor-pointer card-press card-hover",
|
|
4158
4167
|
style: {
|
|
@@ -4174,8 +4183,8 @@ function fr({
|
|
|
4174
4183
|
height: 20,
|
|
4175
4184
|
className: "rounded-full",
|
|
4176
4185
|
style: { width: 20, height: 20, objectFit: "cover" },
|
|
4177
|
-
onError: (
|
|
4178
|
-
t.gatewayLogo &&
|
|
4186
|
+
onError: (c) => {
|
|
4187
|
+
t.gatewayLogo && c.target.src !== t.gatewayLogo && (c.target.src = t.gatewayLogo);
|
|
4179
4188
|
}
|
|
4180
4189
|
}
|
|
4181
4190
|
) }),
|
|
@@ -4187,22 +4196,22 @@ function fr({
|
|
|
4187
4196
|
}
|
|
4188
4197
|
);
|
|
4189
4198
|
}
|
|
4190
|
-
function
|
|
4199
|
+
function gr() {
|
|
4191
4200
|
return /* @__PURE__ */ e("svg", { width: "12", height: "12", viewBox: "0 0 16 16", fill: "none", style: { flexShrink: 0 }, children: /* @__PURE__ */ e("path", { d: "M8 1l2.12 4.3 4.74.69-3.43 3.34.81 4.72L8 11.77l-4.24 2.28.81-4.72L1.14 5.99l4.74-.69L8 1z", fill: "var(--t-success)" }) });
|
|
4192
4201
|
}
|
|
4193
|
-
function
|
|
4202
|
+
function xr() {
|
|
4194
4203
|
return /* @__PURE__ */ i("svg", { width: "12", height: "12", viewBox: "0 0 16 16", fill: "none", style: { flexShrink: 0 }, children: [
|
|
4195
4204
|
/* @__PURE__ */ e("path", { d: "M14 7.5a6 6 0 11-12 0 6 6 0 0112 0z", stroke: "var(--t-accent)", strokeWidth: "1.5" }),
|
|
4196
4205
|
/* @__PURE__ */ e("path", { d: "M5.5 8l2 2 3.5-4", stroke: "var(--t-accent)", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round" })
|
|
4197
4206
|
] });
|
|
4198
4207
|
}
|
|
4199
|
-
function
|
|
4208
|
+
function vr({ quote: t }) {
|
|
4200
4209
|
const a = P();
|
|
4201
4210
|
return t.isBestRate ? /* @__PURE__ */ i("div", { className: "flex items-center gap-1", children: [
|
|
4202
|
-
/* @__PURE__ */ e(
|
|
4211
|
+
/* @__PURE__ */ e(gr, {}),
|
|
4203
4212
|
/* @__PURE__ */ e("span", { className: "text-[11px] font-medium", style: { color: "var(--t-success)" }, children: a("modal.bestPrice") })
|
|
4204
4213
|
] }) : t.isRecommended ? /* @__PURE__ */ i("div", { className: "flex items-center gap-1", children: [
|
|
4205
|
-
/* @__PURE__ */ e(
|
|
4214
|
+
/* @__PURE__ */ e(xr, {}),
|
|
4206
4215
|
/* @__PURE__ */ e("span", { className: "text-[11px] font-medium", style: { color: "var(--t-accent)" }, children: a("modal.recommended") })
|
|
4207
4216
|
] }) : t.rank && t.rank <= 3 ? /* @__PURE__ */ i("div", { className: "text-[11px]", style: { color: "var(--t-text-muted)" }, children: [
|
|
4208
4217
|
"#",
|
|
@@ -4226,7 +4235,7 @@ function ya({ gatewayId: t, gatewayLogo: a, assetBaseUrl: n = "" }) {
|
|
|
4226
4235
|
}
|
|
4227
4236
|
) });
|
|
4228
4237
|
}
|
|
4229
|
-
function
|
|
4238
|
+
function Cr({ pct: t }) {
|
|
4230
4239
|
if (t === 0) return null;
|
|
4231
4240
|
const a = t > 0 ? "var(--t-success)" : "var(--t-error)", n = t > 0 ? "+" : "";
|
|
4232
4241
|
return /* @__PURE__ */ i("span", { className: "text-[11px] font-medium", style: { color: a }, children: [
|
|
@@ -4235,7 +4244,7 @@ function vr({ pct: t }) {
|
|
|
4235
4244
|
"%"
|
|
4236
4245
|
] });
|
|
4237
4246
|
}
|
|
4238
|
-
function
|
|
4247
|
+
function br() {
|
|
4239
4248
|
return /* @__PURE__ */ e("div", { className: "space-y-2", children: [0, 1, 2].map((t) => /* @__PURE__ */ i(
|
|
4240
4249
|
"div",
|
|
4241
4250
|
{
|
|
@@ -4263,16 +4272,16 @@ function Cr() {
|
|
|
4263
4272
|
t
|
|
4264
4273
|
)) });
|
|
4265
4274
|
}
|
|
4266
|
-
function
|
|
4275
|
+
function Sr({
|
|
4267
4276
|
onClose: t,
|
|
4268
4277
|
onSelect: a,
|
|
4269
4278
|
quotes: n,
|
|
4270
4279
|
quotesLoading: r,
|
|
4271
4280
|
cryptoCurrency: o,
|
|
4272
|
-
selectedGatewayId:
|
|
4281
|
+
selectedGatewayId: c,
|
|
4273
4282
|
assetBaseUrl: u = ""
|
|
4274
4283
|
}) {
|
|
4275
|
-
const l = P(), [d,
|
|
4284
|
+
const l = P(), [d, s] = w(""), h = W(() => {
|
|
4276
4285
|
if (!(n != null && n.quotes)) return [];
|
|
4277
4286
|
const f = d.trim().toLowerCase();
|
|
4278
4287
|
return f ? n.quotes.filter((g) => g.gatewayName.toLowerCase().includes(f)) : n.quotes;
|
|
@@ -4287,10 +4296,10 @@ function br({
|
|
|
4287
4296
|
children: l("modal.chooseRamp")
|
|
4288
4297
|
}
|
|
4289
4298
|
),
|
|
4290
|
-
/* @__PURE__ */ e(Ye, { value: d, onChange:
|
|
4299
|
+
/* @__PURE__ */ e(Ye, { value: d, onChange: s }),
|
|
4291
4300
|
/* @__PURE__ */ i("div", { className: "flex-1 overflow-y-auto custom-scroll px-5 space-y-2", children: [
|
|
4292
|
-
r ? /* @__PURE__ */ e(
|
|
4293
|
-
const k = g === 0,
|
|
4301
|
+
r ? /* @__PURE__ */ e(br, {}) : h.length === 0 ? /* @__PURE__ */ e("div", { className: "text-center py-10 text-[14px]", style: { color: "var(--t-text-muted)" }, children: n && n.quotes.length === 0 ? l("modal.noQuotes") : l("modal.noProvidersFound") }) : h.map((f, g) => {
|
|
4302
|
+
const k = g === 0, R = c === f.gatewayId, y = parseFloat(f.cryptoAmount), E = y >= 1 ? y.toFixed(4) : y.toPrecision(6), K = !k && p > 0 ? (y - p) / p * 100 : 0;
|
|
4294
4303
|
return /* @__PURE__ */ i(
|
|
4295
4304
|
"button",
|
|
4296
4305
|
{
|
|
@@ -4299,22 +4308,22 @@ function br({
|
|
|
4299
4308
|
style: {
|
|
4300
4309
|
borderRadius: "var(--t-card-radius)",
|
|
4301
4310
|
padding: "12px 16px",
|
|
4302
|
-
border:
|
|
4303
|
-
background:
|
|
4311
|
+
border: R ? "1.5px solid var(--t-accent)" : "1.5px solid transparent",
|
|
4312
|
+
background: "var(--t-surface)",
|
|
4304
4313
|
animationDelay: `${Math.min(g * 45, 350)}ms`
|
|
4305
4314
|
},
|
|
4306
4315
|
children: [
|
|
4307
4316
|
/* @__PURE__ */ e(ya, { gatewayId: f.gatewayId, gatewayLogo: f.gatewayLogo, assetBaseUrl: u }),
|
|
4308
4317
|
/* @__PURE__ */ i("div", { className: "text-left flex-1 min-w-0", children: [
|
|
4309
4318
|
/* @__PURE__ */ e("div", { className: "font-medium text-[14px] leading-[18px]", style: { color: "var(--t-text)" }, children: f.gatewayName }),
|
|
4310
|
-
/* @__PURE__ */ e(
|
|
4319
|
+
/* @__PURE__ */ e(vr, { quote: f })
|
|
4311
4320
|
] }),
|
|
4312
4321
|
/* @__PURE__ */ i("div", { className: "text-right shrink-0", children: [
|
|
4313
|
-
/* @__PURE__ */ e("div", { className: "text-[11px] leading-[14px]", style: { color: "var(--t-text-secondary)" }, children: k ? l("receive.label") : /* @__PURE__ */ e(
|
|
4322
|
+
/* @__PURE__ */ e("div", { className: "text-[11px] leading-[14px]", style: { color: "var(--t-text-secondary)" }, children: k ? l("receive.label") : /* @__PURE__ */ e(Cr, { pct: K }) }),
|
|
4314
4323
|
/* @__PURE__ */ i("div", { className: "font-medium text-[13px] leading-[18px]", style: { color: "var(--t-text)" }, children: [
|
|
4315
4324
|
/* @__PURE__ */ e("span", { className: "text-[10px] font-normal", style: { color: "var(--t-text-secondary)" }, children: o }),
|
|
4316
4325
|
" ",
|
|
4317
|
-
|
|
4326
|
+
E
|
|
4318
4327
|
] })
|
|
4319
4328
|
] })
|
|
4320
4329
|
]
|
|
@@ -4329,6 +4338,7 @@ function br({
|
|
|
4329
4338
|
style: {
|
|
4330
4339
|
borderRadius: "var(--t-card-radius)",
|
|
4331
4340
|
padding: "10px 16px",
|
|
4341
|
+
background: "var(--t-surface)",
|
|
4332
4342
|
opacity: 0.45,
|
|
4333
4343
|
animationDelay: `${Math.min((h.length + g) * 45, 500)}ms`
|
|
4334
4344
|
},
|
|
@@ -4343,18 +4353,18 @@ function br({
|
|
|
4343
4353
|
] })
|
|
4344
4354
|
] });
|
|
4345
4355
|
}
|
|
4346
|
-
function
|
|
4356
|
+
function wr({
|
|
4347
4357
|
address: t,
|
|
4348
4358
|
onChange: a,
|
|
4349
4359
|
placeholder: n,
|
|
4350
4360
|
error: r,
|
|
4351
4361
|
validating: o,
|
|
4352
|
-
disabled:
|
|
4362
|
+
disabled: c,
|
|
4353
4363
|
onFocus: u,
|
|
4354
4364
|
onBlur: l,
|
|
4355
4365
|
focused: d
|
|
4356
4366
|
}) {
|
|
4357
|
-
const
|
|
4367
|
+
const s = P(), h = o && t.trim().length >= 10, [p, f] = w(!1), g = I(r);
|
|
4358
4368
|
return B(() => {
|
|
4359
4369
|
if (r && !g.current) {
|
|
4360
4370
|
f(!0);
|
|
@@ -4372,7 +4382,7 @@ function Sr({
|
|
|
4372
4382
|
borderRadius: "var(--t-card-radius)"
|
|
4373
4383
|
},
|
|
4374
4384
|
children: [
|
|
4375
|
-
/* @__PURE__ */ e("div", { className: "text-[13px]", style: { color: "var(--t-text-secondary)", letterSpacing: "0.13px", lineHeight: "20px" }, children:
|
|
4385
|
+
/* @__PURE__ */ e("div", { className: "text-[13px]", style: { color: "var(--t-text-secondary)", letterSpacing: "0.13px", lineHeight: "20px" }, children: s("wallet.label") }),
|
|
4376
4386
|
/* @__PURE__ */ i("div", { className: "relative flex items-center", children: [
|
|
4377
4387
|
/* @__PURE__ */ e(
|
|
4378
4388
|
"input",
|
|
@@ -4396,11 +4406,11 @@ function Sr({
|
|
|
4396
4406
|
letterSpacing: "0.13px",
|
|
4397
4407
|
backgroundColor: "transparent"
|
|
4398
4408
|
},
|
|
4399
|
-
disabled:
|
|
4409
|
+
disabled: c
|
|
4400
4410
|
}
|
|
4401
4411
|
),
|
|
4402
4412
|
h && /* @__PURE__ */ e("div", { className: "absolute right-0 top-0 bottom-0 flex items-center", children: /* @__PURE__ */ e(Ee, { size: 14 }) }),
|
|
4403
|
-
!t && d && !
|
|
4413
|
+
!t && d && !c && /* @__PURE__ */ e(
|
|
4404
4414
|
"div",
|
|
4405
4415
|
{
|
|
4406
4416
|
className: "absolute left-0 top-0 bottom-0 flex items-center",
|
|
@@ -4425,7 +4435,7 @@ function Sr({
|
|
|
4425
4435
|
r && /* @__PURE__ */ e("div", { className: "text-[12px] mt-1.5 text-center", style: { color: "var(--t-error)" }, children: r })
|
|
4426
4436
|
] });
|
|
4427
4437
|
}
|
|
4428
|
-
function
|
|
4438
|
+
function kr({ label: t, disabled: a, loading: n, onClick: r }) {
|
|
4429
4439
|
return /* @__PURE__ */ e(
|
|
4430
4440
|
"button",
|
|
4431
4441
|
{
|
|
@@ -4456,22 +4466,22 @@ function wr({ label: t, disabled: a, loading: n, onClick: r }) {
|
|
|
4456
4466
|
}
|
|
4457
4467
|
);
|
|
4458
4468
|
}
|
|
4459
|
-
function
|
|
4469
|
+
function Nr() {
|
|
4460
4470
|
const t = P();
|
|
4461
4471
|
return /* @__PURE__ */ i("div", { className: "text-center py-3", style: { height: 16, lineHeight: "16px" }, children: [
|
|
4462
4472
|
/* @__PURE__ */ e("span", { style: { fontSize: 9, opacity: 0.5, color: "var(--t-text)", letterSpacing: "0.27px" }, children: t("footer.poweredBy") }),
|
|
4463
4473
|
/* @__PURE__ */ e("span", { style: { fontSize: 9, opacity: 0.65, color: "var(--t-text)", letterSpacing: "0.27px" }, children: t("footer.brand") })
|
|
4464
4474
|
] });
|
|
4465
4475
|
}
|
|
4466
|
-
function
|
|
4476
|
+
function Er({
|
|
4467
4477
|
quote: t,
|
|
4468
4478
|
isOpen: a,
|
|
4469
4479
|
onClose: n,
|
|
4470
4480
|
countdown: r,
|
|
4471
4481
|
quotesLoading: o
|
|
4472
4482
|
}) {
|
|
4473
|
-
var
|
|
4474
|
-
const
|
|
4483
|
+
var s, h;
|
|
4484
|
+
const c = P();
|
|
4475
4485
|
if (!a) return null;
|
|
4476
4486
|
const u = (p) => String(p).padStart(2, "0"), l = (t == null ? void 0 : t.fiatCurrency) === "USD" ? "$" : (t == null ? void 0 : t.fiatCurrency) === "EUR" ? "€" : (t == null ? void 0 : t.fiatCurrency) === "GBP" ? "£" : t != null && t.fiatCurrency ? `${t.fiatCurrency} ` : "$", d = (p) => {
|
|
4477
4487
|
const f = typeof p == "string" ? parseFloat(p) : p;
|
|
@@ -4480,7 +4490,7 @@ function Nr({
|
|
|
4480
4490
|
return /* @__PURE__ */ i("div", { className: "px-5 py-5", children: [
|
|
4481
4491
|
/* @__PURE__ */ i("div", { className: "flex items-center justify-between mb-3", children: [
|
|
4482
4492
|
/* @__PURE__ */ e("div", { className: "flex items-center gap-2", children: o ? /* @__PURE__ */ e(Ee, { size: 16 }) : /* @__PURE__ */ i(Z, { children: [
|
|
4483
|
-
/* @__PURE__ */ e("span", { className: "text-[12px]", style: { color: "var(--t-text-muted)" }, children:
|
|
4493
|
+
/* @__PURE__ */ e("span", { className: "text-[12px]", style: { color: "var(--t-text-muted)" }, children: c("rate.updatesInLabel") }),
|
|
4484
4494
|
/* @__PURE__ */ i(
|
|
4485
4495
|
"span",
|
|
4486
4496
|
{
|
|
@@ -4497,7 +4507,7 @@ function Nr({
|
|
|
4497
4507
|
"div",
|
|
4498
4508
|
{
|
|
4499
4509
|
className: "flex items-center justify-center opacity-60 hover:opacity-100 transition-opacity cursor-help",
|
|
4500
|
-
"aria-label":
|
|
4510
|
+
"aria-label": c("rate.rateTooltip"),
|
|
4501
4511
|
children: /* @__PURE__ */ e(Ht, { size: 12 })
|
|
4502
4512
|
}
|
|
4503
4513
|
),
|
|
@@ -4506,7 +4516,7 @@ function Nr({
|
|
|
4506
4516
|
{
|
|
4507
4517
|
className: "info-tooltip pointer-events-none absolute left-1/2 z-50 w-[200px] px-3 py-2 rounded-xl text-[11px] leading-snug font-medium opacity-0 group-hover:opacity-100 transition-opacity duration-200",
|
|
4508
4518
|
style: { background: "var(--t-tooltip-bg)", color: "var(--t-tooltip-text)", top: "calc(100% + 8px)", transform: "translateX(-50%)" },
|
|
4509
|
-
children:
|
|
4519
|
+
children: c("rate.rateTooltip")
|
|
4510
4520
|
}
|
|
4511
4521
|
)
|
|
4512
4522
|
] })
|
|
@@ -4523,22 +4533,22 @@ function Nr({
|
|
|
4523
4533
|
] }),
|
|
4524
4534
|
t ? /* @__PURE__ */ i("div", { className: "flex flex-col gap-4", children: [
|
|
4525
4535
|
t.exchangeRate && /* @__PURE__ */ e("div", { className: "text-[28px] font-semibold", style: { color: "var(--t-text)" }, children: d(t.exchangeRate) }),
|
|
4526
|
-
((
|
|
4536
|
+
((s = t.fees) == null ? void 0 : s.processingFee) && /* @__PURE__ */ i("div", { children: [
|
|
4527
4537
|
/* @__PURE__ */ i("span", { className: "text-[13px] block mb-0.5", style: { color: "var(--t-text-secondary)" }, children: [
|
|
4528
|
-
|
|
4529
|
-
t.fees.feePercentage ? ` ${
|
|
4538
|
+
c("rate.processingFee"),
|
|
4539
|
+
t.fees.feePercentage ? ` ${c("rate.feeIncluded", { percentage: Math.round(parseFloat(String(t.fees.feePercentage)) * 100) / 100 })}` : ""
|
|
4530
4540
|
] }),
|
|
4531
4541
|
/* @__PURE__ */ e("span", { className: "text-[15px] font-semibold", style: { color: "var(--t-text)" }, children: d(t.fees.processingFee) })
|
|
4532
4542
|
] }),
|
|
4533
4543
|
((h = t.fees) == null ? void 0 : h.networkFee) && /* @__PURE__ */ i("div", { children: [
|
|
4534
4544
|
/* @__PURE__ */ i("span", { className: "flex items-center gap-1 text-[13px] mb-0.5", style: { color: "var(--t-text-secondary)" }, children: [
|
|
4535
|
-
|
|
4545
|
+
c("rate.networkFeeIncl"),
|
|
4536
4546
|
/* @__PURE__ */ i("div", { className: "relative group", children: [
|
|
4537
4547
|
/* @__PURE__ */ e(
|
|
4538
4548
|
"div",
|
|
4539
4549
|
{
|
|
4540
4550
|
className: "flex items-center justify-center opacity-60 hover:opacity-100 transition-opacity cursor-help",
|
|
4541
|
-
"aria-label":
|
|
4551
|
+
"aria-label": c("rate.networkFeeTooltip"),
|
|
4542
4552
|
children: /* @__PURE__ */ e(Ht, { size: 12 })
|
|
4543
4553
|
}
|
|
4544
4554
|
),
|
|
@@ -4547,7 +4557,7 @@ function Nr({
|
|
|
4547
4557
|
{
|
|
4548
4558
|
className: "info-tooltip pointer-events-none absolute left-1/2 z-50 w-[220px] px-3 py-2 rounded-xl text-[11px] leading-snug font-medium opacity-0 group-hover:opacity-100 transition-opacity duration-200",
|
|
4549
4559
|
style: { background: "var(--t-tooltip-bg)", color: "var(--t-tooltip-text)", bottom: "calc(100% + 8px)", transform: "translateX(-50%)" },
|
|
4550
|
-
children:
|
|
4560
|
+
children: c("rate.networkFeeTooltip")
|
|
4551
4561
|
}
|
|
4552
4562
|
)
|
|
4553
4563
|
] })
|
|
@@ -4563,28 +4573,28 @@ function Nr({
|
|
|
4563
4573
|
] })
|
|
4564
4574
|
] })
|
|
4565
4575
|
] })
|
|
4566
|
-
] }) : /* @__PURE__ */ e("div", { className: "text-[13px] py-4 text-center", style: { color: "var(--t-text-muted)" }, children:
|
|
4576
|
+
] }) : /* @__PURE__ */ e("div", { className: "text-[13px] py-4 text-center", style: { color: "var(--t-text-muted)" }, children: c("rate.noQuote") })
|
|
4567
4577
|
] });
|
|
4568
4578
|
}
|
|
4569
|
-
function
|
|
4579
|
+
function Rr({
|
|
4570
4580
|
className: t = "",
|
|
4571
4581
|
theme: a = "dark",
|
|
4572
4582
|
skinId: n = "mono",
|
|
4573
4583
|
accentColor: r,
|
|
4574
4584
|
bgColor: o,
|
|
4575
|
-
bgImage:
|
|
4585
|
+
bgImage: c,
|
|
4576
4586
|
borderColor: u,
|
|
4577
4587
|
borderRadius: l,
|
|
4578
4588
|
surfaceColor: d,
|
|
4579
|
-
inputBgColor:
|
|
4589
|
+
inputBgColor: s,
|
|
4580
4590
|
textColor: h,
|
|
4581
4591
|
textSecondaryColor: p,
|
|
4582
4592
|
textMutedColor: f,
|
|
4583
4593
|
successColor: g,
|
|
4584
4594
|
showFlowToggle: k = !0,
|
|
4585
|
-
showSettings:
|
|
4595
|
+
showSettings: R = !0,
|
|
4586
4596
|
showThemeToggle: y = !0,
|
|
4587
|
-
autoRedirect:
|
|
4597
|
+
autoRedirect: E = !1,
|
|
4588
4598
|
explorerUrl: K,
|
|
4589
4599
|
doneButtonText: ee,
|
|
4590
4600
|
supportEmail: z,
|
|
@@ -4599,7 +4609,7 @@ function Er({
|
|
|
4599
4609
|
state: C,
|
|
4600
4610
|
dispatch: F,
|
|
4601
4611
|
config: m,
|
|
4602
|
-
configLoading:
|
|
4612
|
+
configLoading: M,
|
|
4603
4613
|
quotes: N,
|
|
4604
4614
|
quotesLoading: S,
|
|
4605
4615
|
quotesError: ae,
|
|
@@ -4616,17 +4626,17 @@ function Er({
|
|
|
4616
4626
|
selectionUnsupported: ye,
|
|
4617
4627
|
quotesEmpty: G,
|
|
4618
4628
|
bestUnavailableReason: Ke
|
|
4619
|
-
} = Xe(), { locale: ze, setLocale: vt } = _t(), [se, _e] = w(a === "dark"), [Le, Ct] = w(n), [de, j] = w(null), [lt, $] = w(!1), [bt, Je] = w(!1), [Fe, ct] = w(!1), [je, qe] = w(!1), [et, Ue] = w(null), [tt, St] = w(!0), [wt, st] = w(!1), [v, A] = w(!1), [L,
|
|
4629
|
+
} = Xe(), { locale: ze, setLocale: vt } = _t(), [se, _e] = w(a === "dark"), [Le, Ct] = w(n), [de, j] = w(null), [lt, $] = w(!1), [bt, Je] = w(!1), [Fe, ct] = w(!1), [je, qe] = w(!1), [et, Ue] = w(null), [tt, St] = w(!0), [wt, st] = w(!1), [v, A] = w(!1), [L, D] = w(!1), [U, _] = w(null), [ue, Se] = w(!1), [La, kt] = w(30), [Fa, Gt] = w(!1), [Ua, $t] = w(!1), Ia = I(null), Nt = I(), Et = I(C.flowType), Ma = q ?? 640, Zt = I(N);
|
|
4620
4630
|
B(() => {
|
|
4621
|
-
N && N !== Zt.current &&
|
|
4631
|
+
N && N !== Zt.current && D(!1), Zt.current = N;
|
|
4622
4632
|
}, [N]), B(() => {
|
|
4623
4633
|
L || v || N != null && N.bestQuote && F({ type: "SELECT_QUOTE", quote: N.bestQuote });
|
|
4624
4634
|
}, [N == null ? void 0 : N.bestQuote, L, v, F]), B(() => {
|
|
4625
4635
|
_e(a === "dark");
|
|
4626
4636
|
}, [a]), B(() => {
|
|
4627
|
-
const x = setTimeout(() => St(!1),
|
|
4637
|
+
const x = setTimeout(() => St(!1), M ? 0 : 800);
|
|
4628
4638
|
return () => clearTimeout(x);
|
|
4629
|
-
}, [
|
|
4639
|
+
}, [M]), B(() => {
|
|
4630
4640
|
if (Et.current !== C.flowType && !tt) {
|
|
4631
4641
|
Et.current = C.flowType, st(!0), $(!1), Je(!1);
|
|
4632
4642
|
const x = setTimeout(() => st(!1), 350);
|
|
@@ -4653,9 +4663,9 @@ function Er({
|
|
|
4653
4663
|
}
|
|
4654
4664
|
At.current = Ie;
|
|
4655
4665
|
}, [Ie]);
|
|
4656
|
-
const nt = !!(ie && J && H && Ea(ne) && we),
|
|
4657
|
-
var Y,
|
|
4658
|
-
const x = we || ((Y = at.current) == null ? void 0 : Y.rate), b = we ? ne : (
|
|
4666
|
+
const nt = !!(ie && J && H && Ea(ne) && we), Da = nt && ne.toUpperCase().includes(ge.toUpperCase()), Xt = nt && oe > 0 ? Bt(Da ? oe : oe / we) : null, Ba = nt && Xt ? Xt : Ie, Ha = W(() => {
|
|
4667
|
+
var Y, De, Ge;
|
|
4668
|
+
const x = we || ((Y = at.current) == null ? void 0 : Y.rate), b = we ? ne : (De = at.current) == null ? void 0 : De.crypto, V = we ? ge : (Ge = at.current) == null ? void 0 : Ge.fiat;
|
|
4659
4669
|
return !x || !b || !V ? "" : `1 ${b} ≈ ${x.toFixed(2)} ${V}`;
|
|
4660
4670
|
}, [ne, ge, we]);
|
|
4661
4671
|
B(() => {
|
|
@@ -4667,7 +4677,7 @@ function Er({
|
|
|
4667
4677
|
qe(!0), Ue(null);
|
|
4668
4678
|
const V = new AbortController();
|
|
4669
4679
|
return clearTimeout(Nt.current), Nt.current = setTimeout(async () => {
|
|
4670
|
-
var Y,
|
|
4680
|
+
var Y, De, Ge;
|
|
4671
4681
|
try {
|
|
4672
4682
|
const Ut = await (await fetch(`${ce.apiUrl}/public/validate/address`, {
|
|
4673
4683
|
method: "POST",
|
|
@@ -4679,7 +4689,7 @@ function Er({
|
|
|
4679
4689
|
Ue(!0), F({ type: "SET_WALLET_ERROR", message: "" });
|
|
4680
4690
|
else {
|
|
4681
4691
|
Ue(!1);
|
|
4682
|
-
const tn = ((
|
|
4692
|
+
const tn = ((De = It.errors) == null ? void 0 : De[0]) || ((Ge = It.details) == null ? void 0 : Ge.formatMessage) || T("wallet.invalidServer");
|
|
4683
4693
|
F({ type: "SET_WALLET_ERROR", message: tn });
|
|
4684
4694
|
}
|
|
4685
4695
|
} catch (Ft) {
|
|
@@ -4772,8 +4782,8 @@ function Er({
|
|
|
4772
4782
|
ue && Ve && !S && kt(30);
|
|
4773
4783
|
}, [S, ue, Ve]);
|
|
4774
4784
|
const Jt = se ? "theme-dark" : "theme-light", mt = sa.find((x) => x.id === Le) || sa[0], Qa = mt.accent === null, za = r ? ve(r) : !1, qt = (x) => {
|
|
4775
|
-
const b = x.replace("#", ""), V = parseInt(b.substring(0, 2), 16), Y = parseInt(b.substring(2, 4), 16),
|
|
4776
|
-
return (0.299 * V + 0.587 * Y + 0.114 *
|
|
4785
|
+
const b = x.replace("#", ""), V = parseInt(b.substring(0, 2), 16), Y = parseInt(b.substring(2, 4), 16), De = parseInt(b.substring(4, 6), 16);
|
|
4786
|
+
return (0.299 * V + 0.587 * Y + 0.114 * De) / 255 > 0.5 ? "#000000" : "#ffffff";
|
|
4777
4787
|
}, ea = za ? { "--t-accent": r, "--t-cta-bg": r, "--t-cta-text": qt(r) } : Qa ? {
|
|
4778
4788
|
"--t-accent": se ? "#ffffff" : "#111111",
|
|
4779
4789
|
"--t-cta-bg": se ? "#ffffff" : "#111111",
|
|
@@ -4783,21 +4793,21 @@ function Er({
|
|
|
4783
4793
|
"--t-cta-bg": mt.accent,
|
|
4784
4794
|
"--t-cta-text": qt(mt.accent)
|
|
4785
4795
|
}, me = {};
|
|
4786
|
-
d && ve(d) && (me["--t-surface"] = d, me["--t-modal-bg"] = d),
|
|
4787
|
-
const
|
|
4788
|
-
o && ve(o) ?
|
|
4796
|
+
d && ve(d) && (me["--t-surface"] = d, me["--t-modal-bg"] = d), s && ve(s) && (me["--t-pill-bg"] = s, me["--t-close-bg"] = s), h && ve(h) && (me["--t-text"] = h), p && ve(p) && (me["--t-text-secondary"] = p), f && ve(f) && (me["--t-text-muted"] = f, me["--t-text-tertiary"] = f), g && ve(g) && (me["--t-success"] = g);
|
|
4797
|
+
const Me = {};
|
|
4798
|
+
o && ve(o) ? Me.backgroundColor = o : Me.backgroundColor = "var(--t-bg)", c && (c.startsWith("https://") || c.startsWith("data:image/")) && (Me.backgroundImage = `url(${c})`, Me.backgroundSize = "cover", Me.backgroundPosition = "center");
|
|
4789
4799
|
const pt = {};
|
|
4790
4800
|
u && ve(u) && (pt.border = `1px solid ${u}`), l && (pt.borderRadius = l);
|
|
4791
|
-
const rt = C.network, We = rt ? yt(rt) : null, ta = (We == null ? void 0 : We.shortName) || (We == null ? void 0 : We.name) || rt, Ja = he || (lt && (Tt || ut) ? ut ? T("error.amountZero") : H ? T("error.minAmountFiat", { min: String(ua), currency: ge }) : T("error.minAmountCrypto", { min: String(ma), currency: ne }) : void 0), qa = C.walletError ? C.walletError : bt && !Yt && !je ? T("wallet.invalid") : void 0, Lt = re.filter((x) => x.supportedFiats.includes(C.fiatCurrency)), en = Lt.find((x) => x.id === C.paymentMethodId) || Lt[0], aa = C.step === "checkout" ? /* @__PURE__ */ e(bn, { autoRedirect:
|
|
4801
|
+
const rt = C.network, We = rt ? yt(rt) : null, ta = (We == null ? void 0 : We.shortName) || (We == null ? void 0 : We.name) || rt, Ja = he || (lt && (Tt || ut) ? ut ? T("error.amountZero") : H ? T("error.minAmountFiat", { min: String(ua), currency: ge }) : T("error.minAmountCrypto", { min: String(ma), currency: ne }) : void 0), qa = C.walletError ? C.walletError : bt && !Yt && !je ? T("wallet.invalid") : void 0, Lt = re.filter((x) => x.supportedFiats.includes(C.fiatCurrency)), en = Lt.find((x) => x.id === C.paymentMethodId) || Lt[0], aa = C.step === "checkout" ? /* @__PURE__ */ e(bn, { autoRedirect: E }) : C.step === "processing" ? /* @__PURE__ */ e(wn, {}) : C.step === "complete" ? /* @__PURE__ */ e(kn, { explorerUrl: K, doneButtonText: ee, onDone: te }) : C.step === "error" ? /* @__PURE__ */ e(Nn, { supportEmail: z, onDone: te, doneButtonText: ee }) : C.step === "confirm" ? /* @__PURE__ */ e(Un, { stablecoinParity: nt, partnerName: J }) : null;
|
|
4792
4802
|
return aa ? /* @__PURE__ */ e(
|
|
4793
4803
|
"div",
|
|
4794
4804
|
{
|
|
4795
4805
|
className: `${Jt} relative w-full max-w-[390px] overflow-hidden flex flex-col select-none transition-colors duration-[400ms] ${t}`,
|
|
4796
4806
|
style: {
|
|
4797
4807
|
fontFamily: "'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif",
|
|
4798
|
-
height:
|
|
4808
|
+
height: Ma,
|
|
4799
4809
|
borderRadius: "var(--t-container-radius)",
|
|
4800
|
-
...
|
|
4810
|
+
...Me,
|
|
4801
4811
|
...ea,
|
|
4802
4812
|
...me,
|
|
4803
4813
|
...pt
|
|
@@ -4812,26 +4822,26 @@ function Er({
|
|
|
4812
4822
|
fontFamily: "'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif",
|
|
4813
4823
|
minHeight: 640,
|
|
4814
4824
|
borderRadius: "var(--t-container-radius)",
|
|
4815
|
-
...
|
|
4825
|
+
...Me,
|
|
4816
4826
|
...ea,
|
|
4817
4827
|
...me,
|
|
4818
4828
|
...pt
|
|
4819
4829
|
},
|
|
4820
4830
|
children: [
|
|
4821
4831
|
/* @__PURE__ */ e(
|
|
4822
|
-
|
|
4832
|
+
dr,
|
|
4823
4833
|
{
|
|
4824
4834
|
tab: dt,
|
|
4825
4835
|
onTabSwitch: _a,
|
|
4826
4836
|
showFlowToggle: k,
|
|
4827
|
-
showSettings:
|
|
4837
|
+
showSettings: R,
|
|
4828
4838
|
onOpenSettings: () => j("settings"),
|
|
4829
4839
|
darkMode: se
|
|
4830
4840
|
}
|
|
4831
4841
|
),
|
|
4832
|
-
tt || wt ||
|
|
4842
|
+
tt || wt || M ? /* @__PURE__ */ e("div", { className: "pt-[88px] px-3 flex-1 flex flex-col", children: M ? /* @__PURE__ */ e(In, {}) : /* @__PURE__ */ e(Zn, {}) }) : /* @__PURE__ */ i("div", { className: "flex-1 overflow-hidden pt-[88px] px-3 flex flex-col gap-1 tab-fade-in", children: [
|
|
4833
4843
|
/* @__PURE__ */ e(
|
|
4834
|
-
|
|
4844
|
+
ur,
|
|
4835
4845
|
{
|
|
4836
4846
|
amount: Rt,
|
|
4837
4847
|
onAmountChange: Ka,
|
|
@@ -4845,12 +4855,12 @@ function Er({
|
|
|
4845
4855
|
inputRef: Ia,
|
|
4846
4856
|
chainCode: H ? void 0 : rt,
|
|
4847
4857
|
chainDisplay: H ? void 0 : ta,
|
|
4848
|
-
getChainIconUrl: H ? void 0 :
|
|
4858
|
+
getChainIconUrl: H ? void 0 : Dt,
|
|
4849
4859
|
shaking: Ua
|
|
4850
4860
|
}
|
|
4851
4861
|
),
|
|
4852
4862
|
/* @__PURE__ */ e(
|
|
4853
|
-
|
|
4863
|
+
hr,
|
|
4854
4864
|
{
|
|
4855
4865
|
amount: Ba,
|
|
4856
4866
|
currencyCode: H ? ne : ge,
|
|
@@ -4864,7 +4874,7 @@ function Er({
|
|
|
4864
4874
|
onOpenRateBreakdown: () => Se(!0),
|
|
4865
4875
|
fieldLocks: le,
|
|
4866
4876
|
spendNumeric: oe,
|
|
4867
|
-
getChainIconUrl: H ?
|
|
4877
|
+
getChainIconUrl: H ? Dt : void 0,
|
|
4868
4878
|
autoSelectPending: v,
|
|
4869
4879
|
rateFlash: Fa
|
|
4870
4880
|
}
|
|
@@ -4892,7 +4902,7 @@ function Er({
|
|
|
4892
4902
|
}
|
|
4893
4903
|
),
|
|
4894
4904
|
(N || S) && /* @__PURE__ */ e(
|
|
4895
|
-
|
|
4905
|
+
yr,
|
|
4896
4906
|
{
|
|
4897
4907
|
selectedQuote: C.selectedQuote,
|
|
4898
4908
|
quotesLoading: S,
|
|
@@ -4901,13 +4911,13 @@ function Er({
|
|
|
4901
4911
|
}
|
|
4902
4912
|
),
|
|
4903
4913
|
(re.length > 0 || (m == null ? void 0 : m.paymentMethods) && m.paymentMethods.length > 0) && (Lt.length > 0 ? /* @__PURE__ */ e(
|
|
4904
|
-
|
|
4914
|
+
fr,
|
|
4905
4915
|
{
|
|
4906
4916
|
selectedMethod: en,
|
|
4907
4917
|
onOpenModal: () => j("payment"),
|
|
4908
4918
|
darkMode: se,
|
|
4909
4919
|
getMethodIcon: Wt,
|
|
4910
|
-
getMethodDisplayName: (x, b) => Vt(x, b, T)
|
|
4920
|
+
getMethodDisplayName: (x, b) => Vt(x, b, T, !0)
|
|
4911
4921
|
}
|
|
4912
4922
|
) : /* @__PURE__ */ e(
|
|
4913
4923
|
"div",
|
|
@@ -4922,7 +4932,7 @@ function Er({
|
|
|
4922
4932
|
}
|
|
4923
4933
|
)),
|
|
4924
4934
|
H && /* @__PURE__ */ e(
|
|
4925
|
-
|
|
4935
|
+
wr,
|
|
4926
4936
|
{
|
|
4927
4937
|
address: C.walletAddress,
|
|
4928
4938
|
onChange: (x) => F({ type: "SET_WALLET_ADDRESS", address: x }),
|
|
@@ -4942,7 +4952,7 @@ function Er({
|
|
|
4942
4952
|
ye && /* @__PURE__ */ e("div", { className: "text-[12px] text-center mb-2", style: { color: "var(--t-error)" }, children: T(H ? "error.currencyUnavailableBuy" : "error.currencyUnavailableSell") }),
|
|
4943
4953
|
/* @__PURE__ */ i("div", { className: "flex flex-col gap-3 pb-3", children: [
|
|
4944
4954
|
/* @__PURE__ */ e(
|
|
4945
|
-
|
|
4955
|
+
kr,
|
|
4946
4956
|
{
|
|
4947
4957
|
label: H ? T("cta.buy", { crypto: ne }) : T("cta.sell", { crypto: ne }),
|
|
4948
4958
|
disabled: !Qt || Te || v || ye || G,
|
|
@@ -4950,7 +4960,7 @@ function Er({
|
|
|
4950
4960
|
onClick: Ya
|
|
4951
4961
|
}
|
|
4952
4962
|
),
|
|
4953
|
-
/* @__PURE__ */ e(
|
|
4963
|
+
/* @__PURE__ */ e(Nr, {})
|
|
4954
4964
|
] })
|
|
4955
4965
|
] }, dt),
|
|
4956
4966
|
U && /* @__PURE__ */ e(
|
|
@@ -4964,7 +4974,7 @@ function Er({
|
|
|
4964
4974
|
}
|
|
4965
4975
|
),
|
|
4966
4976
|
/* @__PURE__ */ e(Xn, { isOpen: ue, onClose: () => Se(!1), children: /* @__PURE__ */ e(
|
|
4967
|
-
|
|
4977
|
+
Er,
|
|
4968
4978
|
{
|
|
4969
4979
|
quote: xe,
|
|
4970
4980
|
isOpen: ue,
|
|
@@ -5006,7 +5016,7 @@ function Er({
|
|
|
5006
5016
|
}
|
|
5007
5017
|
) }),
|
|
5008
5018
|
/* @__PURE__ */ e(Pe, { isOpen: de === "payment", onClose: () => j(null), children: (x) => /* @__PURE__ */ e(
|
|
5009
|
-
|
|
5019
|
+
ar,
|
|
5010
5020
|
{
|
|
5011
5021
|
methods: re,
|
|
5012
5022
|
selectedId: C.paymentMethodId,
|
|
@@ -5017,7 +5027,7 @@ function Er({
|
|
|
5017
5027
|
}
|
|
5018
5028
|
) }),
|
|
5019
5029
|
/* @__PURE__ */ e(Pe, { isOpen: de === "provider", onClose: () => j(null), children: (x) => /* @__PURE__ */ e(
|
|
5020
|
-
|
|
5030
|
+
Sr,
|
|
5021
5031
|
{
|
|
5022
5032
|
quotes: N,
|
|
5023
5033
|
quotesLoading: S,
|
|
@@ -5025,13 +5035,13 @@ function Er({
|
|
|
5025
5035
|
selectedGatewayId: C.selectedProvider,
|
|
5026
5036
|
assetBaseUrl: X,
|
|
5027
5037
|
onSelect: (b) => {
|
|
5028
|
-
|
|
5038
|
+
D(!0), F({ type: "SELECT_QUOTE", quote: b }), x();
|
|
5029
5039
|
},
|
|
5030
5040
|
onClose: x
|
|
5031
5041
|
}
|
|
5032
5042
|
) }),
|
|
5033
5043
|
/* @__PURE__ */ e(Pe, { isOpen: de === "settings", onClose: () => j(null), variant: "right", children: (x) => /* @__PURE__ */ e(
|
|
5034
|
-
|
|
5044
|
+
or,
|
|
5035
5045
|
{
|
|
5036
5046
|
onClose: x,
|
|
5037
5047
|
darkMode: se,
|
|
@@ -5049,7 +5059,7 @@ function Er({
|
|
|
5049
5059
|
}
|
|
5050
5060
|
) }),
|
|
5051
5061
|
/* @__PURE__ */ e(Pe, { isOpen: de === "country", onClose: () => j(null), children: (x) => /* @__PURE__ */ e(
|
|
5052
|
-
|
|
5062
|
+
lr,
|
|
5053
5063
|
{
|
|
5054
5064
|
onClose: x,
|
|
5055
5065
|
onSelect: (b) => {
|
|
@@ -5060,7 +5070,7 @@ function Er({
|
|
|
5060
5070
|
}
|
|
5061
5071
|
) }),
|
|
5062
5072
|
/* @__PURE__ */ e(Pe, { isOpen: de === "language", onClose: () => j(null), children: (x) => /* @__PURE__ */ e(
|
|
5063
|
-
|
|
5073
|
+
sr,
|
|
5064
5074
|
{
|
|
5065
5075
|
onClose: x,
|
|
5066
5076
|
onSelect: (b) => {
|
|
@@ -5073,25 +5083,25 @@ function Er({
|
|
|
5073
5083
|
}
|
|
5074
5084
|
);
|
|
5075
5085
|
}
|
|
5076
|
-
function
|
|
5086
|
+
function Ar({
|
|
5077
5087
|
projectId: t,
|
|
5078
5088
|
apiUrl: a,
|
|
5079
5089
|
assetBaseUrl: n,
|
|
5080
5090
|
flowType: r,
|
|
5081
5091
|
customerId: o,
|
|
5082
|
-
brandId:
|
|
5092
|
+
brandId: c,
|
|
5083
5093
|
defaultFiatCurrency: u,
|
|
5084
5094
|
defaultCryptoCurrency: l,
|
|
5085
5095
|
defaultNetwork: d,
|
|
5086
|
-
defaultFiatAmount:
|
|
5096
|
+
defaultFiatAmount: s,
|
|
5087
5097
|
defaultCryptoAmount: h,
|
|
5088
5098
|
defaultWalletAddress: p,
|
|
5089
5099
|
defaultGateway: f,
|
|
5090
5100
|
defaultCountry: g,
|
|
5091
5101
|
fieldLocks: k,
|
|
5092
|
-
partnerMetadata:
|
|
5102
|
+
partnerMetadata: R,
|
|
5093
5103
|
statusPollInterval: y,
|
|
5094
|
-
onComplete:
|
|
5104
|
+
onComplete: E,
|
|
5095
5105
|
onError: K,
|
|
5096
5106
|
className: ee,
|
|
5097
5107
|
theme: z,
|
|
@@ -5104,7 +5114,7 @@ function Rr({
|
|
|
5104
5114
|
surfaceColor: C,
|
|
5105
5115
|
inputBgColor: F,
|
|
5106
5116
|
textColor: m,
|
|
5107
|
-
textSecondaryColor:
|
|
5117
|
+
textSecondaryColor: M,
|
|
5108
5118
|
textMutedColor: N,
|
|
5109
5119
|
successColor: S,
|
|
5110
5120
|
showFlowToggle: ae,
|
|
@@ -5128,22 +5138,22 @@ function Rr({
|
|
|
5128
5138
|
assetBaseUrl: n,
|
|
5129
5139
|
flowType: r,
|
|
5130
5140
|
customerId: o,
|
|
5131
|
-
brandId:
|
|
5141
|
+
brandId: c,
|
|
5132
5142
|
defaultFiatCurrency: u,
|
|
5133
5143
|
defaultCryptoCurrency: l,
|
|
5134
5144
|
defaultNetwork: d,
|
|
5135
|
-
defaultFiatAmount:
|
|
5145
|
+
defaultFiatAmount: s,
|
|
5136
5146
|
defaultCryptoAmount: h,
|
|
5137
5147
|
defaultWalletAddress: p,
|
|
5138
5148
|
defaultGateway: f,
|
|
5139
5149
|
defaultCountry: g,
|
|
5140
5150
|
fieldLocks: k,
|
|
5141
|
-
partnerMetadata:
|
|
5151
|
+
partnerMetadata: R,
|
|
5142
5152
|
statusPollInterval: y,
|
|
5143
|
-
onComplete:
|
|
5153
|
+
onComplete: E,
|
|
5144
5154
|
onError: K,
|
|
5145
5155
|
children: /* @__PURE__ */ e(vn, { defaultLocale: re || "en", children: /* @__PURE__ */ e(
|
|
5146
|
-
|
|
5156
|
+
Rr,
|
|
5147
5157
|
{
|
|
5148
5158
|
className: ee,
|
|
5149
5159
|
theme: z,
|
|
@@ -5156,7 +5166,7 @@ function Rr({
|
|
|
5156
5166
|
surfaceColor: C,
|
|
5157
5167
|
inputBgColor: F,
|
|
5158
5168
|
textColor: m,
|
|
5159
|
-
textSecondaryColor:
|
|
5169
|
+
textSecondaryColor: M,
|
|
5160
5170
|
textMutedColor: N,
|
|
5161
5171
|
successColor: S,
|
|
5162
5172
|
showFlowToggle: ae,
|
|
@@ -5175,21 +5185,21 @@ function Rr({
|
|
|
5175
5185
|
}
|
|
5176
5186
|
);
|
|
5177
5187
|
}
|
|
5178
|
-
function
|
|
5188
|
+
function Gr({
|
|
5179
5189
|
submitButtonText: t,
|
|
5180
5190
|
rateRefreshInterval: a,
|
|
5181
5191
|
...n
|
|
5182
5192
|
}) {
|
|
5183
|
-
return /* @__PURE__ */ e(
|
|
5193
|
+
return /* @__PURE__ */ e(Ar, { ...n });
|
|
5184
5194
|
}
|
|
5185
|
-
function
|
|
5195
|
+
function $r({
|
|
5186
5196
|
skin: t,
|
|
5187
5197
|
active: a,
|
|
5188
5198
|
onClick: n,
|
|
5189
5199
|
darkMode: r,
|
|
5190
5200
|
dimmed: o
|
|
5191
5201
|
}) {
|
|
5192
|
-
const
|
|
5202
|
+
const c = t.accent === null, u = 32;
|
|
5193
5203
|
return /* @__PURE__ */ i(
|
|
5194
5204
|
"button",
|
|
5195
5205
|
{
|
|
@@ -5197,7 +5207,7 @@ function Gr({
|
|
|
5197
5207
|
className: "relative shrink-0",
|
|
5198
5208
|
style: { width: u, height: u, opacity: o ? 0.4 : 1, transition: "opacity 0.2s" },
|
|
5199
5209
|
children: [
|
|
5200
|
-
|
|
5210
|
+
c ? /* @__PURE__ */ i("svg", { width: u, height: u, viewBox: "0 0 32 32", children: [
|
|
5201
5211
|
/* @__PURE__ */ e("clipPath", { id: "mono-left", children: /* @__PURE__ */ e("rect", { x: "0", y: "0", width: "16", height: "32" }) }),
|
|
5202
5212
|
/* @__PURE__ */ e("clipPath", { id: "mono-right", children: /* @__PURE__ */ e("rect", { x: "16", y: "0", width: "16", height: "32" }) }),
|
|
5203
5213
|
/* @__PURE__ */ e("circle", { cx: "16", cy: "16", r: "15", fill: "#111111", clipPath: "url(#mono-left)" }),
|
|
@@ -5216,85 +5226,85 @@ function Gr({
|
|
|
5216
5226
|
);
|
|
5217
5227
|
}
|
|
5218
5228
|
export {
|
|
5219
|
-
|
|
5220
|
-
|
|
5229
|
+
mr as AnimatedDigit,
|
|
5230
|
+
pr as AnimatedNumber,
|
|
5221
5231
|
Dr as ApplePayIcon,
|
|
5222
|
-
|
|
5232
|
+
Vr as ArrowUpIcon,
|
|
5223
5233
|
ot as BLOCKCHAINS,
|
|
5224
|
-
|
|
5234
|
+
Mr as BankIcon,
|
|
5225
5235
|
Xn as BottomSheet,
|
|
5226
5236
|
ft as COUNTRIES,
|
|
5227
5237
|
Ot as COUNTRY_MAP,
|
|
5228
5238
|
Fn as CRYPTO_CHAIN_COMBOS,
|
|
5229
5239
|
wa as CRYPTO_CURRENCIES,
|
|
5230
|
-
|
|
5240
|
+
Hr as CardIcon,
|
|
5231
5241
|
Wn as CheckmarkIcon,
|
|
5232
|
-
|
|
5242
|
+
Gr as CheckoutForm,
|
|
5233
5243
|
bn as CheckoutStep,
|
|
5234
5244
|
Re as ChevronDown,
|
|
5235
5245
|
Pn as ChevronRight,
|
|
5236
|
-
|
|
5246
|
+
Sr as ChooseRampModal,
|
|
5237
5247
|
Oe as CloseButton,
|
|
5238
|
-
|
|
5248
|
+
Pr as CoinifyIcon,
|
|
5239
5249
|
kn as CompleteStep,
|
|
5240
5250
|
Un as ConfirmStep,
|
|
5241
|
-
|
|
5251
|
+
lr as CountryPickerModal,
|
|
5242
5252
|
zn as CryptoCurrencyModal,
|
|
5243
5253
|
Aa as CryptoIcon,
|
|
5244
|
-
|
|
5245
|
-
|
|
5254
|
+
kr as CtaButton,
|
|
5255
|
+
Kr as DarkModeIcon,
|
|
5246
5256
|
Nn as ErrorStep,
|
|
5247
5257
|
ca as FIAT_CURRENCIES,
|
|
5248
5258
|
Rn as FIAT_TO_COUNTRY,
|
|
5249
5259
|
Qn as FiatCurrencyModal,
|
|
5250
5260
|
jt as FiatFlag,
|
|
5251
|
-
|
|
5261
|
+
Nr as Footer,
|
|
5252
5262
|
In as FormSkeleton,
|
|
5253
5263
|
Ta as GenericCoinIcon,
|
|
5254
|
-
|
|
5255
|
-
|
|
5264
|
+
Br as GooglePayIcon,
|
|
5265
|
+
dr as HeaderBar,
|
|
5256
5266
|
vn as I18nProvider,
|
|
5257
5267
|
Ht as InfoIcon,
|
|
5258
5268
|
Ze as LANGUAGES,
|
|
5259
5269
|
Zn as LoadingScreen,
|
|
5260
5270
|
da as MOCK_RATES,
|
|
5261
|
-
|
|
5271
|
+
Or as MenuIcon,
|
|
5262
5272
|
Pe as Modal,
|
|
5263
5273
|
Vn as MoreDotsIcon,
|
|
5264
5274
|
Ae as NRLogo,
|
|
5265
|
-
|
|
5266
|
-
|
|
5275
|
+
_r as NRLogoIcon,
|
|
5276
|
+
Dn as PayPalIcon,
|
|
5267
5277
|
_n as PaymentAppleIcon,
|
|
5268
5278
|
On as PaymentBankIcon,
|
|
5269
|
-
|
|
5279
|
+
fr as PaymentCard,
|
|
5270
5280
|
Kn as PaymentCardsIcon,
|
|
5271
5281
|
jn as PaymentGoogleIcon,
|
|
5272
|
-
|
|
5282
|
+
Wr as PaymentMethodSelector,
|
|
5273
5283
|
wn as ProcessingStep,
|
|
5274
|
-
|
|
5284
|
+
Ar as RampForm,
|
|
5275
5285
|
xn as RampProvider,
|
|
5276
|
-
|
|
5277
|
-
|
|
5286
|
+
Er as RateBreakdown,
|
|
5287
|
+
hr as ReceiveCard,
|
|
5278
5288
|
Cn as RedirectScreen,
|
|
5279
|
-
|
|
5289
|
+
Mn as RevolutIcon,
|
|
5280
5290
|
sa as SKINS,
|
|
5281
|
-
|
|
5291
|
+
jr as SearchIcon,
|
|
5282
5292
|
Ye as SearchInput,
|
|
5283
|
-
|
|
5293
|
+
or as SettingsScreen,
|
|
5284
5294
|
Q as Skeleton,
|
|
5285
|
-
|
|
5286
|
-
|
|
5295
|
+
$r as SkinSwatch,
|
|
5296
|
+
ur as SpendCard,
|
|
5287
5297
|
Ee as Spinner,
|
|
5288
5298
|
$n as Toast,
|
|
5289
|
-
|
|
5290
|
-
|
|
5299
|
+
nr as ToggleSwitch,
|
|
5300
|
+
wr as WalletCard,
|
|
5291
5301
|
Pt as XIcon,
|
|
5292
5302
|
Bt as formatOutput,
|
|
5293
|
-
|
|
5303
|
+
Dt as getChainIconUrl,
|
|
5294
5304
|
ka as getCryptoIconUrl,
|
|
5295
|
-
|
|
5305
|
+
Mt as getDefaultFiatForCountry,
|
|
5296
5306
|
An as getFiatFlagUrl,
|
|
5297
|
-
|
|
5307
|
+
Ir as getMockRate,
|
|
5298
5308
|
Gn as getPaymentIcon,
|
|
5299
5309
|
Ea as isStablecoin,
|
|
5300
5310
|
Ln as parseAmount,
|