@nowramp/form 0.1.74 → 0.1.77
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 +547 -543
- package/dist/index.js.map +1 -1
- package/dist/nowramp-form.iife.js +10 -10
- package/dist/nowramp-form.iife.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -9,13 +9,13 @@
|
|
|
9
9
|
document.head.appendChild(s);
|
|
10
10
|
})();
|
|
11
11
|
import { jsx as e, jsxs as o, Fragment as J } from "react/jsx-runtime";
|
|
12
|
-
import
|
|
13
|
-
import { RampApi as
|
|
12
|
+
import de, { useState as v, useRef as O, useCallback as P, useEffect as Y, useMemo as Z, useReducer as ua, useContext as ma, createContext as fa } from "react";
|
|
13
|
+
import { RampApi as ze } from "@nowramp/sdk";
|
|
14
14
|
import { createPortal as Ut } from "react-dom";
|
|
15
15
|
function ha(t, a, n) {
|
|
16
|
-
const [r, l] =
|
|
17
|
-
(!f.current || f.current !== t) && (f.current = new
|
|
18
|
-
const h =
|
|
16
|
+
const [r, l] = v(null), [c, m] = v(!0), [s, u] = v(null), f = O(null);
|
|
17
|
+
(!f.current || f.current !== t) && (f.current = new ze({ apiKey: "", ...t }));
|
|
18
|
+
const h = P(async () => {
|
|
19
19
|
if (!t.projectId) {
|
|
20
20
|
u(new Error("projectId is required")), m(!1);
|
|
21
21
|
return;
|
|
@@ -32,37 +32,37 @@ function ha(t, a, n) {
|
|
|
32
32
|
m(!1);
|
|
33
33
|
}
|
|
34
34
|
}, [t.projectId, a, n]);
|
|
35
|
-
return
|
|
35
|
+
return Y(() => {
|
|
36
36
|
h();
|
|
37
37
|
}, [h]), { config: r, loading: c, error: s, refetch: h };
|
|
38
38
|
}
|
|
39
39
|
function pa(t, a) {
|
|
40
|
-
const [n, r] =
|
|
41
|
-
(!u.current || f.current !== h) && (u.current = new
|
|
42
|
-
const d =
|
|
43
|
-
|
|
44
|
-
const
|
|
40
|
+
const [n, r] = v(null), [l, c] = v(!1), [m, s] = v(null), u = O(null), f = O(""), h = `${t.apiUrl}|${t.projectId}`;
|
|
41
|
+
(!u.current || f.current !== h) && (u.current = new ze({ apiKey: "", ...t }), f.current = h);
|
|
42
|
+
const d = O(0);
|
|
43
|
+
Y(() => {
|
|
44
|
+
const g = ++d.current;
|
|
45
45
|
if (!a || !t.projectId) {
|
|
46
46
|
r(null), c(!1);
|
|
47
47
|
return;
|
|
48
48
|
}
|
|
49
49
|
c(!0), s(null), u.current.getQuotes(a).then(
|
|
50
50
|
(A) => {
|
|
51
|
-
d.current ===
|
|
51
|
+
d.current === g && (r(A), c(!1));
|
|
52
52
|
},
|
|
53
53
|
(A) => {
|
|
54
|
-
d.current ===
|
|
54
|
+
d.current === g && (s(A instanceof Error ? A : 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
|
-
const p =
|
|
58
|
+
const p = P(async () => {
|
|
59
59
|
if (!(!a || !t.projectId)) {
|
|
60
60
|
c(!0), s(null);
|
|
61
61
|
try {
|
|
62
|
-
const
|
|
63
|
-
r(
|
|
64
|
-
} catch (
|
|
65
|
-
s(
|
|
62
|
+
const g = await u.current.getQuotes(a);
|
|
63
|
+
r(g);
|
|
64
|
+
} catch (g) {
|
|
65
|
+
s(g instanceof Error ? g : new Error("Failed to fetch quotes"));
|
|
66
66
|
} finally {
|
|
67
67
|
c(!1);
|
|
68
68
|
}
|
|
@@ -71,28 +71,28 @@ function pa(t, a) {
|
|
|
71
71
|
return { quotes: n, loading: l, error: m, refetch: p };
|
|
72
72
|
}
|
|
73
73
|
function ya(t) {
|
|
74
|
-
const [a, n] =
|
|
75
|
-
(!s.current || u.current !== f) && (s.current = new
|
|
76
|
-
const h =
|
|
74
|
+
const [a, n] = v(null), [r, l] = v(!1), [c, m] = v(null), s = O(null), u = O(""), f = `${t.apiUrl}|${t.projectId}`;
|
|
75
|
+
(!s.current || u.current !== f) && (s.current = new ze({ apiKey: "", ...t }), u.current = f);
|
|
76
|
+
const h = P(async (p) => {
|
|
77
77
|
l(!0), m(null);
|
|
78
78
|
try {
|
|
79
|
-
const
|
|
80
|
-
return n(
|
|
81
|
-
} catch (
|
|
82
|
-
const A =
|
|
79
|
+
const g = await s.current.createCheckoutIntent(p);
|
|
80
|
+
return n(g), g;
|
|
81
|
+
} catch (g) {
|
|
82
|
+
const A = g instanceof Error ? g : new Error("Failed to create checkout intent");
|
|
83
83
|
throw m(A), A;
|
|
84
84
|
} finally {
|
|
85
85
|
l(!1);
|
|
86
86
|
}
|
|
87
|
-
}, []), d =
|
|
87
|
+
}, []), d = P(() => {
|
|
88
88
|
n(null), m(null);
|
|
89
89
|
}, []);
|
|
90
90
|
return { order: a, loading: r, error: c, createOrder: h, reset: d };
|
|
91
91
|
}
|
|
92
92
|
function xa(t, a, n) {
|
|
93
|
-
const [r, l] =
|
|
94
|
-
f.current || (f.current = new
|
|
95
|
-
const h =
|
|
93
|
+
const [r, l] = v(null), [c, m] = v(!1), [s, u] = v(null), f = O(null);
|
|
94
|
+
f.current || (f.current = new ze({ apiKey: "", projectId: "", ...t }));
|
|
95
|
+
const h = P(async () => {
|
|
96
96
|
if (a) {
|
|
97
97
|
m(!0), u(null);
|
|
98
98
|
try {
|
|
@@ -105,7 +105,7 @@ function xa(t, a, n) {
|
|
|
105
105
|
}
|
|
106
106
|
}
|
|
107
107
|
}, [a]);
|
|
108
|
-
return
|
|
108
|
+
return Y(() => {
|
|
109
109
|
if (!a) return;
|
|
110
110
|
const d = (n == null ? void 0 : n.initialDelay) ?? 0;
|
|
111
111
|
if (d > 0) {
|
|
@@ -113,14 +113,14 @@ function xa(t, a, n) {
|
|
|
113
113
|
return () => clearTimeout(p);
|
|
114
114
|
}
|
|
115
115
|
h();
|
|
116
|
-
}, [h, a, n == null ? void 0 : n.initialDelay]),
|
|
116
|
+
}, [h, a, n == null ? void 0 : n.initialDelay]), Y(() => {
|
|
117
117
|
if (!a || !(n != null && n.pollInterval) || !r || ["completed", "failed", "cancelled", "expired", "refunded"].includes(r.status))
|
|
118
118
|
return;
|
|
119
119
|
const p = setInterval(h, n.pollInterval);
|
|
120
120
|
return () => clearInterval(p);
|
|
121
121
|
}, [a, n == null ? void 0 : n.pollInterval, r == null ? void 0 : r.status, h]), { status: r, loading: c, error: s, refetch: h };
|
|
122
122
|
}
|
|
123
|
-
const
|
|
123
|
+
const Ze = [
|
|
124
124
|
{ code: "ad", name: "Andorra", defaultFiat: "EUR" },
|
|
125
125
|
{ code: "ae", name: "United Arab Emirates", defaultFiat: "AED" },
|
|
126
126
|
{ code: "af", name: "Afghanistan", defaultFiat: "USD" },
|
|
@@ -313,7 +313,7 @@ const Ye = [
|
|
|
313
313
|
{ code: "zm", name: "Zambia", defaultFiat: "USD" },
|
|
314
314
|
{ code: "zw", name: "Zimbabwe", defaultFiat: "USD" }
|
|
315
315
|
], st = Object.fromEntries(
|
|
316
|
-
|
|
316
|
+
Ze.map((t) => [t.code, t])
|
|
317
317
|
);
|
|
318
318
|
function ot(t, a) {
|
|
319
319
|
if (!t) return "USD";
|
|
@@ -418,173 +418,177 @@ function Ca({
|
|
|
418
418
|
defaultCryptoAmount: h = "",
|
|
419
419
|
defaultWalletAddress: d = "",
|
|
420
420
|
defaultGateway: p,
|
|
421
|
-
defaultCountry:
|
|
421
|
+
defaultCountry: g,
|
|
422
422
|
fieldLocks: A,
|
|
423
|
-
statusPollInterval:
|
|
423
|
+
statusPollInterval: E = 5e3,
|
|
424
424
|
onComplete: R,
|
|
425
|
-
onError:
|
|
426
|
-
children:
|
|
425
|
+
onError: _,
|
|
426
|
+
children: ae
|
|
427
427
|
}) {
|
|
428
|
-
const j =
|
|
428
|
+
const j = Z(() => ({ apiUrl: a, projectId: t }), [a, t]), Q = u || (s ? s.toLowerCase() : ""), q = r === "sell", $ = q ? !!h : !!f, y = (q ? !!($ && s && Q) : !!($ && s && Q && d)) && p ? "confirm" : "amount", k = f || (r === "buy" ? "250" : ""), [i, I] = ua(ga, {
|
|
429
429
|
...Vt,
|
|
430
|
-
step:
|
|
430
|
+
step: y,
|
|
431
431
|
flowType: r,
|
|
432
432
|
fiatCurrency: m,
|
|
433
433
|
cryptoCurrency: s,
|
|
434
|
-
network:
|
|
434
|
+
network: Q,
|
|
435
435
|
fiatAmount: Dt(k, 2),
|
|
436
436
|
cryptoAmount: Dt(h, 6),
|
|
437
437
|
walletAddress: d,
|
|
438
438
|
customerId: l,
|
|
439
439
|
// If defaultCountry is provided, set it immediately with 'manual' source to skip auto-detection
|
|
440
|
-
...
|
|
441
|
-
}),
|
|
442
|
-
config:
|
|
443
|
-
loading:
|
|
444
|
-
error:
|
|
445
|
-
} = ha(j, i.flowType, i.country || void 0),
|
|
446
|
-
|
|
447
|
-
var L;
|
|
448
|
-
if (xe.current || !(v != null && v.detectedCountry) || i.country) return;
|
|
449
|
-
xe.current = !0;
|
|
450
|
-
const y = v.detectedCountry.toLowerCase();
|
|
451
|
-
I({ type: "SET_COUNTRY_AUTO", country: y });
|
|
452
|
-
const b = (L = v.fiats) == null ? void 0 : L.map((F) => F.code), U = ot(y, b);
|
|
453
|
-
U !== i.fiatCurrency && I({ type: "SET_FIAT_CURRENCY", currency: U });
|
|
454
|
-
}, [v, i.country, i.fiatCurrency]);
|
|
455
|
-
const le = B(!1);
|
|
456
|
-
me.useEffect(() => {
|
|
457
|
-
var U;
|
|
458
|
-
if (le.current || !C || !((U = v == null ? void 0 : v.fiats) != null && U.length)) return;
|
|
459
|
-
le.current = !0;
|
|
460
|
-
const y = v.fiats.map((L) => L.code), b = ot(C, y);
|
|
461
|
-
b !== i.fiatCurrency && I({ type: "SET_FIAT_CURRENCY", currency: b });
|
|
462
|
-
}, [C, v, i.fiatCurrency]);
|
|
463
|
-
const de = B(i.country);
|
|
464
|
-
me.useEffect(() => {
|
|
440
|
+
...g ? { country: g.toLowerCase(), countrySource: "manual" } : {}
|
|
441
|
+
}), b = i.flowType === "sell", {
|
|
442
|
+
config: S,
|
|
443
|
+
loading: ge,
|
|
444
|
+
error: Ce
|
|
445
|
+
} = ha(j, i.flowType, i.country || void 0), Se = O(!1);
|
|
446
|
+
de.useEffect(() => {
|
|
465
447
|
var U;
|
|
466
|
-
if (
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
448
|
+
if (Se.current || !(S != null && S.detectedCountry) || i.country) return;
|
|
449
|
+
Se.current = !0;
|
|
450
|
+
const C = S.detectedCountry.toLowerCase();
|
|
451
|
+
I({ type: "SET_COUNTRY_AUTO", country: C });
|
|
452
|
+
const w = (U = S.fiats) == null ? void 0 : U.map((D) => D.code), L = ot(C, w);
|
|
453
|
+
L !== i.fiatCurrency && I({ type: "SET_FIAT_CURRENCY", currency: L });
|
|
454
|
+
}, [S, i.country, i.fiatCurrency]);
|
|
455
|
+
const oe = O(!1);
|
|
456
|
+
de.useEffect(() => {
|
|
472
457
|
var L;
|
|
473
|
-
if (
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
458
|
+
if (oe.current || !g || !((L = S == null ? void 0 : S.fiats) != null && L.length)) return;
|
|
459
|
+
oe.current = !0;
|
|
460
|
+
const C = S.fiats.map((U) => U.code), w = ot(g, C);
|
|
461
|
+
w !== i.fiatCurrency && I({ type: "SET_FIAT_CURRENCY", currency: w });
|
|
462
|
+
}, [g, S, i.fiatCurrency]);
|
|
463
|
+
const me = O(i.country);
|
|
464
|
+
de.useEffect(() => {
|
|
465
|
+
var L;
|
|
466
|
+
if (i.country === me.current || (me.current = i.country, i.countrySource === "manual" && (ie.current = !1), i.countrySource !== "manual") || !((L = S == null ? void 0 : S.fiats) != null && L.length)) return;
|
|
467
|
+
const C = S.fiats.map((U) => U.code), w = ot(i.country, C);
|
|
468
|
+
w !== i.fiatCurrency && I({ type: "SET_FIAT_CURRENCY", currency: w });
|
|
469
|
+
}, [i.country, i.countrySource, S, i.fiatCurrency]);
|
|
470
|
+
const M = O(i.fiatCurrency);
|
|
471
|
+
de.useEffect(() => {
|
|
472
|
+
var U;
|
|
473
|
+
if (i.fiatCurrency === M.current || (M.current = i.fiatCurrency, b || !((U = S == null ? void 0 : S.fiats) != null && U.length) || !i.fiatAmount)) return;
|
|
474
|
+
const C = S.fiats.find((D) => D.code === i.fiatCurrency);
|
|
475
|
+
if (!(C != null && C.minAmount)) return;
|
|
476
|
+
const w = parseFloat(i.fiatAmount), L = parseFloat(C.minAmount);
|
|
477
|
+
!isNaN(w) && !isNaN(L) && w < L && I({ type: "SET_FIAT_AMOUNT", amount: String(Math.ceil(L)) });
|
|
478
|
+
}, [i.fiatCurrency, i.fiatAmount, S, b]), de.useEffect(() => {
|
|
479
|
+
var L, U, D;
|
|
480
|
+
if (!S || !i.cryptoCurrency || i.network) return;
|
|
481
|
+
const C = (L = S.cryptos) == null ? void 0 : L.find((F) => F.code === i.cryptoCurrency), w = ((U = C == null ? void 0 : C.networks) == null ? void 0 : U.find((F) => F.isDefault)) || ((D = C == null ? void 0 : C.networks) == null ? void 0 : D[0]);
|
|
482
|
+
w != null && w.id && I({ type: "SET_NETWORK", network: w.id });
|
|
483
|
+
}, [S, i.cryptoCurrency, i.network]), de.useEffect(() => {
|
|
484
|
+
var D, F;
|
|
485
|
+
if (!((D = S == null ? void 0 : S.paymentMethods) != null && D.length)) return;
|
|
486
|
+
const C = i.fiatCurrency, w = S.paymentMethods;
|
|
487
|
+
if (i.paymentMethodId && w.some(
|
|
488
|
+
(W) => W.id === i.paymentMethodId && W.supportedFiats.includes(C)
|
|
489
489
|
))
|
|
490
490
|
return;
|
|
491
|
-
const
|
|
492
|
-
(
|
|
493
|
-
) ||
|
|
494
|
-
I({ type: "SET_PAYMENT_METHOD", methodId: (
|
|
495
|
-
}, [
|
|
496
|
-
const ee =
|
|
497
|
-
if (
|
|
491
|
+
const U = w.find(
|
|
492
|
+
(B) => B.supportedFiats.includes(C) && (B.id.includes("card") || B.id.includes("debit"))
|
|
493
|
+
) || w.find((B) => B.supportedFiats.includes(C));
|
|
494
|
+
I({ type: "SET_PAYMENT_METHOD", methodId: (U == null ? void 0 : U.id) || ((F = w[0]) == null ? void 0 : F.id) || "" });
|
|
495
|
+
}, [S, i.fiatCurrency, i.paymentMethodId]);
|
|
496
|
+
const ee = Z(() => {
|
|
497
|
+
if (b) {
|
|
498
498
|
if (!i.cryptoAmount) return null;
|
|
499
|
-
const
|
|
500
|
-
return isNaN(
|
|
499
|
+
const D = parseFloat(i.cryptoAmount);
|
|
500
|
+
return isNaN(D) || D <= 0 ? "Enter a valid amount" : null;
|
|
501
501
|
}
|
|
502
|
-
if (!
|
|
503
|
-
const
|
|
504
|
-
if (isNaN(
|
|
505
|
-
const
|
|
506
|
-
if (!
|
|
507
|
-
const
|
|
508
|
-
return !isNaN(
|
|
509
|
-
}, [
|
|
510
|
-
const
|
|
511
|
-
return !
|
|
502
|
+
if (!S || !i.fiatAmount) return null;
|
|
503
|
+
const C = parseFloat(i.fiatAmount);
|
|
504
|
+
if (isNaN(C)) return null;
|
|
505
|
+
const w = S.fiats.find((D) => D.code === i.fiatCurrency);
|
|
506
|
+
if (!w) return null;
|
|
507
|
+
const L = parseFloat(w.minAmount), U = parseFloat(w.maxAmount);
|
|
508
|
+
return !isNaN(L) && C < L ? `Minimum amount is ${w.minAmount} ${i.fiatCurrency}` : !isNaN(U) && C > U ? `Maximum amount is ${w.maxAmount} ${i.fiatCurrency}` : null;
|
|
509
|
+
}, [S, i.fiatAmount, i.fiatCurrency, i.cryptoAmount, b]), G = Z(() => {
|
|
510
|
+
const C = b ? !!i.cryptoAmount : !!i.fiatAmount;
|
|
511
|
+
return !S || !C || !i.cryptoCurrency || !i.network || ee || S.detectedCountry && i.countrySource === "" && !g ? null : {
|
|
512
512
|
fiatCurrency: i.fiatCurrency,
|
|
513
|
-
...
|
|
513
|
+
...b ? { cryptoAmount: i.cryptoAmount } : { fiatAmount: i.fiatAmount },
|
|
514
514
|
cryptoCurrency: i.cryptoCurrency,
|
|
515
515
|
network: i.network,
|
|
516
516
|
paymentMethodId: i.paymentMethodId || void 0,
|
|
517
517
|
country: i.country || void 0,
|
|
518
518
|
orderType: i.flowType
|
|
519
519
|
};
|
|
520
|
-
}, [
|
|
521
|
-
quotes:
|
|
522
|
-
loading:
|
|
523
|
-
error:
|
|
524
|
-
refetch:
|
|
525
|
-
} = pa(j,
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
520
|
+
}, [S, i.fiatCurrency, i.fiatAmount, i.cryptoAmount, i.cryptoCurrency, i.network, i.paymentMethodId, i.country, i.countrySource, ee, b, i.flowType, g]), {
|
|
521
|
+
quotes: X,
|
|
522
|
+
loading: fe,
|
|
523
|
+
error: he,
|
|
524
|
+
refetch: Le
|
|
525
|
+
} = pa(j, G), ie = O(!1);
|
|
526
|
+
de.useEffect(() => {
|
|
527
|
+
ie.current || i.countrySource === "auto" && (fe || !G || he || !X || X.bestQuote || i.fiatCurrency !== "USD" && (ie.current = !0, I({ type: "SET_FIAT_CURRENCY", currency: "USD" }), I({ type: "SET_FIAT_AMOUNT", amount: "250" })));
|
|
528
|
+
}, [X, fe, he, G, i.countrySource, i.fiatCurrency]);
|
|
529
|
+
const {
|
|
530
|
+
order: H,
|
|
531
|
+
loading: Ue,
|
|
532
|
+
error: Ee,
|
|
529
533
|
createOrder: De
|
|
530
|
-
} = ya(j),
|
|
531
|
-
status:
|
|
532
|
-
loading:
|
|
534
|
+
} = ya(j), Ke = 15e3, {
|
|
535
|
+
status: ne,
|
|
536
|
+
loading: _e
|
|
533
537
|
} = xa(
|
|
534
538
|
{ apiUrl: a },
|
|
535
|
-
(
|
|
536
|
-
{ pollInterval:
|
|
539
|
+
(H == null ? void 0 : H.orderId) ?? null,
|
|
540
|
+
{ pollInterval: E, initialDelay: Ke }
|
|
537
541
|
);
|
|
538
|
-
|
|
539
|
-
(
|
|
540
|
-
}, [
|
|
541
|
-
const
|
|
542
|
-
|
|
543
|
-
}, [
|
|
544
|
-
const
|
|
545
|
-
|
|
546
|
-
const
|
|
547
|
-
|
|
548
|
-
const
|
|
549
|
-
|
|
550
|
-
const
|
|
551
|
-
var
|
|
552
|
-
const
|
|
553
|
-
if (!
|
|
554
|
-
const
|
|
555
|
-
I({ type: "SET_ERROR", message: `Missing required fields: ${
|
|
542
|
+
de.useEffect(() => {
|
|
543
|
+
(ne == null ? void 0 : ne.status) === "completed" && R && R(ne);
|
|
544
|
+
}, [ne == null ? void 0 : ne.status, R]), de.useEffect(() => {
|
|
545
|
+
const C = Ce || Ee;
|
|
546
|
+
C && _ && _(C);
|
|
547
|
+
}, [Ce, Ee, _]);
|
|
548
|
+
const ve = p || (S == null ? void 0 : S.defaultGateway) || null, Fe = O(ve);
|
|
549
|
+
Fe.current = ve;
|
|
550
|
+
const Ve = O(X);
|
|
551
|
+
Ve.current = X;
|
|
552
|
+
const le = O(c);
|
|
553
|
+
le.current = c;
|
|
554
|
+
const Me = P(async () => {
|
|
555
|
+
var w, L, U;
|
|
556
|
+
const C = ((w = i.selectedQuote) == null ? void 0 : w.gatewayId) || ((U = (L = Ve.current) == null ? void 0 : L.bestQuote) == null ? void 0 : U.gatewayId) || Fe.current;
|
|
557
|
+
if (!C || !i.walletAddress) {
|
|
558
|
+
const D = [!C && "gateway", !i.walletAddress && "walletAddress"].filter(Boolean).join(", ");
|
|
559
|
+
I({ type: "SET_ERROR", message: `Missing required fields: ${D}` });
|
|
556
560
|
return;
|
|
557
561
|
}
|
|
558
562
|
try {
|
|
559
563
|
await De({
|
|
560
|
-
gateway:
|
|
564
|
+
gateway: C,
|
|
561
565
|
customerId: i.customerId || void 0,
|
|
562
566
|
fiatCurrency: i.fiatCurrency,
|
|
563
|
-
...
|
|
567
|
+
...b ? { cryptoAmount: i.cryptoAmount } : { fiatAmount: i.fiatAmount },
|
|
564
568
|
cryptoCurrency: i.cryptoCurrency,
|
|
565
569
|
network: i.network,
|
|
566
570
|
walletAddress: i.walletAddress,
|
|
567
571
|
paymentMethodId: i.paymentMethodId || void 0,
|
|
568
572
|
email: i.email || void 0,
|
|
569
573
|
orderType: i.flowType,
|
|
570
|
-
...
|
|
574
|
+
...le.current ? { metadata: { brand: le.current } } : {}
|
|
571
575
|
}), I({ type: "SET_STEP", step: "checkout" });
|
|
572
|
-
} catch (
|
|
573
|
-
const
|
|
574
|
-
/wallet|address/i.test(
|
|
576
|
+
} catch (D) {
|
|
577
|
+
const F = D instanceof Error ? D.message : "Failed to create order";
|
|
578
|
+
/wallet|address/i.test(F) ? I({ type: "SET_WALLET_ERROR", message: F.replace(/^Failed to create checkout intent:\s*/i, "") }) : I({ type: "SET_ERROR", message: F });
|
|
575
579
|
}
|
|
576
|
-
}, [i, De,
|
|
577
|
-
I({ type: "SET_STEP", step:
|
|
578
|
-
}, []),
|
|
579
|
-
const
|
|
580
|
-
|
|
581
|
-
}, [i.step,
|
|
582
|
-
const
|
|
580
|
+
}, [i, De, b]), Je = P((C) => {
|
|
581
|
+
I({ type: "SET_STEP", step: C });
|
|
582
|
+
}, []), qe = P(() => {
|
|
583
|
+
const C = ["confirm", "amount", "quotes", "wallet", "checkout", "processing", "complete"], w = C.indexOf(i.step);
|
|
584
|
+
w > 0 && I({ type: "SET_STEP", step: C[w - 1] });
|
|
585
|
+
}, [i.step, b]), je = Z(() => {
|
|
586
|
+
const C = b ? !!i.cryptoAmount : !!i.fiatAmount;
|
|
583
587
|
switch (i.step) {
|
|
584
588
|
case "confirm":
|
|
585
|
-
return !!(
|
|
589
|
+
return !!(C && i.cryptoCurrency && i.network && i.walletAddress && !ee);
|
|
586
590
|
case "amount":
|
|
587
|
-
return !!(
|
|
591
|
+
return !!(C && i.cryptoCurrency && i.network && !ee);
|
|
588
592
|
case "quotes":
|
|
589
593
|
return !!i.selectedQuote;
|
|
590
594
|
case "wallet":
|
|
@@ -592,40 +596,40 @@ function Ca({
|
|
|
592
596
|
default:
|
|
593
597
|
return !1;
|
|
594
598
|
}
|
|
595
|
-
}, [i, ee,
|
|
599
|
+
}, [i, ee, b]), ce = {
|
|
596
600
|
apiConfig: j,
|
|
597
601
|
assetBaseUrl: n,
|
|
598
|
-
config:
|
|
599
|
-
configLoading:
|
|
600
|
-
configError:
|
|
602
|
+
config: S,
|
|
603
|
+
configLoading: ge,
|
|
604
|
+
configError: Ce,
|
|
601
605
|
state: i,
|
|
602
606
|
dispatch: I,
|
|
603
|
-
quotes:
|
|
604
|
-
quotesLoading:
|
|
605
|
-
quotesError:
|
|
606
|
-
fetchQuotes:
|
|
607
|
-
order:
|
|
608
|
-
orderLoading:
|
|
609
|
-
orderError:
|
|
610
|
-
createOrder:
|
|
611
|
-
orderStatus:
|
|
612
|
-
orderStatusLoading:
|
|
607
|
+
quotes: X,
|
|
608
|
+
quotesLoading: fe,
|
|
609
|
+
quotesError: he,
|
|
610
|
+
fetchQuotes: Le,
|
|
611
|
+
order: H,
|
|
612
|
+
orderLoading: Ue,
|
|
613
|
+
orderError: Ee,
|
|
614
|
+
createOrder: Me,
|
|
615
|
+
orderStatus: ne,
|
|
616
|
+
orderStatusLoading: _e,
|
|
613
617
|
fieldLocks: A || null,
|
|
614
|
-
defaultGateway:
|
|
618
|
+
defaultGateway: ve,
|
|
615
619
|
amountError: ee,
|
|
616
|
-
goToStep:
|
|
617
|
-
goBack:
|
|
618
|
-
canProceed:
|
|
620
|
+
goToStep: Je,
|
|
621
|
+
goBack: qe,
|
|
622
|
+
canProceed: je
|
|
619
623
|
};
|
|
620
|
-
return /* @__PURE__ */ e(jt.Provider, { value:
|
|
624
|
+
return /* @__PURE__ */ e(jt.Provider, { value: ce, children: ae });
|
|
621
625
|
}
|
|
622
|
-
function
|
|
626
|
+
function Te() {
|
|
623
627
|
const t = ma(jt);
|
|
624
628
|
if (!t)
|
|
625
629
|
throw new Error("useRamp must be used within a RampProvider");
|
|
626
630
|
return t;
|
|
627
631
|
}
|
|
628
|
-
const
|
|
632
|
+
const Be = {
|
|
629
633
|
// Canonical IDs (returned by the API — lowercase full names)
|
|
630
634
|
// These cover cases where the canonical ID differs from the legacy uppercase key
|
|
631
635
|
ethereum: { name: "Ethereum (ERC20)", shortName: "Ethereum", icon: "eth" },
|
|
@@ -980,9 +984,9 @@ const Oe = {
|
|
|
980
984
|
{ code: "ZCHF", name: "Frankencoin", chains: ["ETH"], popular: !1 },
|
|
981
985
|
{ code: "ZETA", name: "Zeta", chains: ["ETH", "ZETACHAIN"], popular: !1 },
|
|
982
986
|
{ code: "ZTG", name: "Zeitgeist", chains: ["ZTG"], popular: !1 }
|
|
983
|
-
],
|
|
987
|
+
], Sa = Object.fromEntries(
|
|
984
988
|
Gt.map((t) => [t.code, t.name])
|
|
985
|
-
),
|
|
989
|
+
), va = {
|
|
986
990
|
AED: "ae",
|
|
987
991
|
ALL: "al",
|
|
988
992
|
ARS: "ar",
|
|
@@ -1021,14 +1025,14 @@ function $t(t, a = "") {
|
|
|
1021
1025
|
return `${a}/crypto-icons/${t.toLowerCase()}.svg`;
|
|
1022
1026
|
}
|
|
1023
1027
|
function ba(t, a = "") {
|
|
1024
|
-
const n =
|
|
1028
|
+
const n = va[t] || "us";
|
|
1025
1029
|
return `${a}/flags/${n}.svg`;
|
|
1026
1030
|
}
|
|
1027
|
-
function
|
|
1028
|
-
return
|
|
1031
|
+
function Qe(t) {
|
|
1032
|
+
return Be[t] || Be[t.toLowerCase()] || Be[t.toUpperCase()] || Be[t.toUpperCase().replace(/-/g, "_")] || Be[t.toLowerCase().replace(/-/g, "_")];
|
|
1029
1033
|
}
|
|
1030
1034
|
function it(t, a = "") {
|
|
1031
|
-
const n =
|
|
1035
|
+
const n = Qe(t);
|
|
1032
1036
|
return n ? `${a}/crypto-icons/${n.icon}.svg` : `${a}/crypto-icons/${t.toLowerCase()}.svg`;
|
|
1033
1037
|
}
|
|
1034
1038
|
const Ft = [
|
|
@@ -1105,7 +1109,7 @@ function lt(t) {
|
|
|
1105
1109
|
const a = t.toPrecision(4);
|
|
1106
1110
|
return parseFloat(a).toString();
|
|
1107
1111
|
}
|
|
1108
|
-
const
|
|
1112
|
+
const ue = (t) => /^#([0-9A-Fa-f]{3}){1,2}$/.test(t), Bt = 10, Ot = 1e-4, wa = (() => {
|
|
1109
1113
|
const t = [];
|
|
1110
1114
|
for (const a of Gt)
|
|
1111
1115
|
for (const n of a.chains)
|
|
@@ -1119,9 +1123,9 @@ function Wt({
|
|
|
1119
1123
|
className: r = "",
|
|
1120
1124
|
background: l
|
|
1121
1125
|
}) {
|
|
1122
|
-
const [c, m] =
|
|
1126
|
+
const [c, m] = v(!1), [s, u] = v(!1), f = O(t);
|
|
1123
1127
|
f.current !== t && (f.current = t, m(!1), u(!1));
|
|
1124
|
-
const h =
|
|
1128
|
+
const h = P(() => m(!0), []), d = P(() => u(!0), []);
|
|
1125
1129
|
return /* @__PURE__ */ o(
|
|
1126
1130
|
"div",
|
|
1127
1131
|
{
|
|
@@ -1350,7 +1354,7 @@ function pn({ size: t = 18 }) {
|
|
|
1350
1354
|
}
|
|
1351
1355
|
);
|
|
1352
1356
|
}
|
|
1353
|
-
function
|
|
1357
|
+
function He() {
|
|
1354
1358
|
return /* @__PURE__ */ e("svg", { width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", children: /* @__PURE__ */ e("path", { d: "M3 4.5L6 7.5L9 4.5", stroke: "var(--t-text-secondary)", strokeWidth: "1.2", strokeLinecap: "round", strokeLinejoin: "round" }) });
|
|
1355
1359
|
}
|
|
1356
1360
|
function Pt() {
|
|
@@ -1434,7 +1438,7 @@ function Pa({
|
|
|
1434
1438
|
onOpenModal: n,
|
|
1435
1439
|
fiatCurrency: r
|
|
1436
1440
|
}) {
|
|
1437
|
-
const l =
|
|
1441
|
+
const l = Z(
|
|
1438
1442
|
() => t.filter((m) => m.supportedFiats.includes(r)),
|
|
1439
1443
|
[t, r]
|
|
1440
1444
|
), c = l.find((m) => m.id === a) || l[0];
|
|
@@ -1474,7 +1478,7 @@ function Pa({
|
|
|
1474
1478
|
/* @__PURE__ */ o("span", { className: "flex items-center gap-2", children: [
|
|
1475
1479
|
/* @__PURE__ */ e("span", { className: "flex items-center justify-center", style: { width: 20, height: 20 }, children: c && Zt(c.id, c.icon, 20) }),
|
|
1476
1480
|
/* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: "var(--t-text)" }, children: c ? Yt(c.id, c.name) : "Select" }),
|
|
1477
|
-
/* @__PURE__ */ e(
|
|
1481
|
+
/* @__PURE__ */ e(He, {})
|
|
1478
1482
|
] })
|
|
1479
1483
|
]
|
|
1480
1484
|
}
|
|
@@ -1486,20 +1490,20 @@ function Ka({
|
|
|
1486
1490
|
redirectDelay: n = 3e3
|
|
1487
1491
|
}) {
|
|
1488
1492
|
var p;
|
|
1489
|
-
const { order: r, orderStatus: l, goToStep: c, goBack: m } =
|
|
1490
|
-
if (
|
|
1493
|
+
const { order: r, orderStatus: l, goToStep: c, goBack: m } = Te(), [s, u] = v(!1), [f, h] = v(null), d = r != null && r.checkout.expiresAt ? Date.now() > r.checkout.expiresAt : !1;
|
|
1494
|
+
if (Y(() => {
|
|
1491
1495
|
if ((r == null ? void 0 : r.checkout.method) === "redirect" && a && !d) {
|
|
1492
1496
|
h(Math.ceil(n / 1e3));
|
|
1493
|
-
const
|
|
1497
|
+
const g = setTimeout(() => {
|
|
1494
1498
|
window.location.href = r.checkout.url;
|
|
1495
1499
|
}, n), A = setInterval(() => {
|
|
1496
|
-
h((
|
|
1500
|
+
h((E) => E && E > 1 ? E - 1 : null);
|
|
1497
1501
|
}, 1e3);
|
|
1498
1502
|
return () => {
|
|
1499
|
-
clearTimeout(
|
|
1503
|
+
clearTimeout(g), clearInterval(A);
|
|
1500
1504
|
};
|
|
1501
1505
|
}
|
|
1502
|
-
}, [r, a, n, d]),
|
|
1506
|
+
}, [r, a, n, d]), Y(() => {
|
|
1503
1507
|
l && (l.status === "completed" ? c("complete") : ["failed", "cancelled", "expired"].includes(l.status) && c("error"));
|
|
1504
1508
|
}, [l == null ? void 0 : l.status, c]), !r)
|
|
1505
1509
|
return /* @__PURE__ */ o(
|
|
@@ -1555,7 +1559,7 @@ function Ka({
|
|
|
1555
1559
|
}
|
|
1556
1560
|
);
|
|
1557
1561
|
if (r.checkout.method === "iframe") {
|
|
1558
|
-
const
|
|
1562
|
+
const g = r.checkout.url, A = ((p = r.checkout.allowedFeatures) == null ? void 0 : p.join("; ")) || "payment; camera; microphone; geolocation; clipboard-read; clipboard-write; accelerometer; gyroscope; magnetometer; fullscreen; autoplay; encrypted-media; web-share";
|
|
1559
1563
|
return Ut(
|
|
1560
1564
|
/* @__PURE__ */ o(
|
|
1561
1565
|
"div",
|
|
@@ -1627,7 +1631,7 @@ function Ka({
|
|
|
1627
1631
|
/* @__PURE__ */ e(
|
|
1628
1632
|
"iframe",
|
|
1629
1633
|
{
|
|
1630
|
-
src:
|
|
1634
|
+
src: g,
|
|
1631
1635
|
style: {
|
|
1632
1636
|
display: s ? "block" : "none",
|
|
1633
1637
|
width: "100%",
|
|
@@ -1703,7 +1707,7 @@ function Ka({
|
|
|
1703
1707
|
}
|
|
1704
1708
|
);
|
|
1705
1709
|
if (r.checkout.method === "widget" && r.widgetConfig) {
|
|
1706
|
-
const
|
|
1710
|
+
const g = _a(r.checkout.url, r.widgetConfig);
|
|
1707
1711
|
return Ut(
|
|
1708
1712
|
/* @__PURE__ */ o(
|
|
1709
1713
|
"div",
|
|
@@ -1775,7 +1779,7 @@ function Ka({
|
|
|
1775
1779
|
/* @__PURE__ */ e(
|
|
1776
1780
|
"iframe",
|
|
1777
1781
|
{
|
|
1778
|
-
src:
|
|
1782
|
+
src: g,
|
|
1779
1783
|
style: {
|
|
1780
1784
|
display: s ? "block" : "none",
|
|
1781
1785
|
width: "100%",
|
|
@@ -1828,8 +1832,8 @@ function _a(t, a) {
|
|
|
1828
1832
|
return n.toString();
|
|
1829
1833
|
}
|
|
1830
1834
|
function Va({ className: t = "" }) {
|
|
1831
|
-
const { orderStatus: a, orderStatusLoading: n, goToStep: r } =
|
|
1832
|
-
|
|
1835
|
+
const { orderStatus: a, orderStatusLoading: n, goToStep: r } = Te();
|
|
1836
|
+
Y(() => {
|
|
1833
1837
|
a && (a.status === "completed" ? r("complete") : ["failed", "cancelled", "expired", "refunded"].includes(a.status) && r("error"));
|
|
1834
1838
|
}, [a == null ? void 0 : a.status, r]);
|
|
1835
1839
|
const l = () => {
|
|
@@ -1848,25 +1852,25 @@ function Va({ className: t = "" }) {
|
|
|
1848
1852
|
/* @__PURE__ */ e("h2", { className: "text-[20px] font-semibold mb-3", style: { color: "var(--t-text)" }, children: l() }),
|
|
1849
1853
|
n && /* @__PURE__ */ e("p", { className: "text-[13px] mb-4", style: { color: "var(--t-text-muted)" }, children: "Checking status..." }),
|
|
1850
1854
|
a && /* @__PURE__ */ o("div", { className: "w-full mt-6 text-left", style: { background: "var(--t-surface)", borderRadius: 5, padding: 16 }, children: [
|
|
1851
|
-
/* @__PURE__ */ e(
|
|
1852
|
-
/* @__PURE__ */ e(
|
|
1855
|
+
/* @__PURE__ */ e(Re, { label: "Order ID", value: a.orderId, mono: !0 }),
|
|
1856
|
+
/* @__PURE__ */ e(Re, { label: "Provider", value: a.gateway }),
|
|
1853
1857
|
/* @__PURE__ */ e(
|
|
1854
|
-
|
|
1858
|
+
Re,
|
|
1855
1859
|
{
|
|
1856
1860
|
label: "Amount",
|
|
1857
1861
|
value: `${a.fiatAmount} ${a.fiatCurrency}`
|
|
1858
1862
|
}
|
|
1859
1863
|
),
|
|
1860
1864
|
/* @__PURE__ */ e(
|
|
1861
|
-
|
|
1865
|
+
Re,
|
|
1862
1866
|
{
|
|
1863
1867
|
label: "Receiving",
|
|
1864
1868
|
value: `${a.cryptoAmount || "..."} ${a.cryptoCurrency}`
|
|
1865
1869
|
}
|
|
1866
1870
|
),
|
|
1867
|
-
/* @__PURE__ */ e(
|
|
1871
|
+
/* @__PURE__ */ e(Re, { label: "Network", value: a.network }),
|
|
1868
1872
|
/* @__PURE__ */ e(
|
|
1869
|
-
|
|
1873
|
+
Re,
|
|
1870
1874
|
{
|
|
1871
1875
|
label: "To Address",
|
|
1872
1876
|
value: `${a.walletAddress.slice(0, 10)}...${a.walletAddress.slice(-8)}`,
|
|
@@ -1880,7 +1884,7 @@ function Va({ className: t = "" }) {
|
|
|
1880
1884
|
] })
|
|
1881
1885
|
] });
|
|
1882
1886
|
}
|
|
1883
|
-
function
|
|
1887
|
+
function Re({ label: t, value: a, mono: n }) {
|
|
1884
1888
|
return /* @__PURE__ */ o(
|
|
1885
1889
|
"div",
|
|
1886
1890
|
{
|
|
@@ -1906,7 +1910,7 @@ function ja({
|
|
|
1906
1910
|
onDone: n,
|
|
1907
1911
|
doneButtonText: r = "Done"
|
|
1908
1912
|
}) {
|
|
1909
|
-
const { orderStatus: l, state: c, dispatch: m } =
|
|
1913
|
+
const { orderStatus: l, state: c, dispatch: m } = Te(), s = c.flowType === "sell", u = () => {
|
|
1910
1914
|
if (!(l != null && l.transactionHash)) return null;
|
|
1911
1915
|
if (!a) {
|
|
1912
1916
|
const d = {
|
|
@@ -1939,7 +1943,7 @@ function ja({
|
|
|
1939
1943
|
/* @__PURE__ */ e("p", { className: "text-[14px] mb-6", style: { color: "var(--t-text-secondary)" }, children: s ? `Your ${(l == null ? void 0 : l.fiatCurrency) || c.fiatCurrency} payout is being processed.` : `Your ${(l == null ? void 0 : l.cryptoCurrency) || c.cryptoCurrency} has been sent to your wallet.` }),
|
|
1940
1944
|
l && /* @__PURE__ */ o("div", { className: "w-full text-left mb-6", style: { background: "var(--t-surface)", borderRadius: 5, padding: 16 }, children: [
|
|
1941
1945
|
/* @__PURE__ */ e(
|
|
1942
|
-
|
|
1946
|
+
ye,
|
|
1943
1947
|
{
|
|
1944
1948
|
label: s ? "Amount Sold" : "Amount Received",
|
|
1945
1949
|
value: `${l.cryptoAmount} ${l.cryptoCurrency}`,
|
|
@@ -1947,15 +1951,15 @@ function ja({
|
|
|
1947
1951
|
}
|
|
1948
1952
|
),
|
|
1949
1953
|
/* @__PURE__ */ e(
|
|
1950
|
-
|
|
1954
|
+
ye,
|
|
1951
1955
|
{
|
|
1952
1956
|
label: s ? "Payout Amount" : "Amount Paid",
|
|
1953
1957
|
value: `${l.fiatAmount} ${l.fiatCurrency}`
|
|
1954
1958
|
}
|
|
1955
1959
|
),
|
|
1956
|
-
/* @__PURE__ */ e(
|
|
1960
|
+
/* @__PURE__ */ e(ye, { label: "Network", value: l.network }),
|
|
1957
1961
|
/* @__PURE__ */ e(
|
|
1958
|
-
|
|
1962
|
+
ye,
|
|
1959
1963
|
{
|
|
1960
1964
|
label: "Wallet",
|
|
1961
1965
|
value: `${l.walletAddress.slice(0, 10)}...${l.walletAddress.slice(-8)}`,
|
|
@@ -1963,17 +1967,17 @@ function ja({
|
|
|
1963
1967
|
}
|
|
1964
1968
|
),
|
|
1965
1969
|
l.transactionHash && /* @__PURE__ */ e(
|
|
1966
|
-
|
|
1970
|
+
ye,
|
|
1967
1971
|
{
|
|
1968
1972
|
label: "Transaction",
|
|
1969
1973
|
value: `${l.transactionHash.slice(0, 10)}...${l.transactionHash.slice(-8)}`,
|
|
1970
1974
|
mono: !0
|
|
1971
1975
|
}
|
|
1972
1976
|
),
|
|
1973
|
-
/* @__PURE__ */ e(
|
|
1974
|
-
/* @__PURE__ */ e(
|
|
1977
|
+
/* @__PURE__ */ e(ye, { label: "Provider", value: l.gateway }),
|
|
1978
|
+
/* @__PURE__ */ e(ye, { label: "Order ID", value: l.orderId, mono: !0 }),
|
|
1975
1979
|
l.completedAt && /* @__PURE__ */ e(
|
|
1976
|
-
|
|
1980
|
+
ye,
|
|
1977
1981
|
{
|
|
1978
1982
|
label: "Completed",
|
|
1979
1983
|
value: new Date(l.completedAt).toLocaleString()
|
|
@@ -2004,7 +2008,7 @@ function ja({
|
|
|
2004
2008
|
] })
|
|
2005
2009
|
] });
|
|
2006
2010
|
}
|
|
2007
|
-
function
|
|
2011
|
+
function ye({ label: t, value: a, mono: n, highlight: r }) {
|
|
2008
2012
|
return /* @__PURE__ */ o(
|
|
2009
2013
|
"div",
|
|
2010
2014
|
{
|
|
@@ -2029,7 +2033,7 @@ function Ga({
|
|
|
2029
2033
|
onRetry: a,
|
|
2030
2034
|
supportEmail: n = "support@nowramp.com"
|
|
2031
2035
|
}) {
|
|
2032
|
-
const { state: r, orderStatus: l, dispatch: c, goToStep: m } =
|
|
2036
|
+
const { state: r, orderStatus: l, dispatch: c, goToStep: m } = Te(), s = r.flowType === "sell", u = () => {
|
|
2033
2037
|
if (l)
|
|
2034
2038
|
switch (l.status) {
|
|
2035
2039
|
case "failed":
|
|
@@ -2135,13 +2139,13 @@ function $a({ className: t = "", stablecoinParity: a, partnerName: n }) {
|
|
|
2135
2139
|
fetchQuotes: u,
|
|
2136
2140
|
createOrder: f,
|
|
2137
2141
|
orderLoading: h
|
|
2138
|
-
} =
|
|
2139
|
-
|
|
2142
|
+
} = Te(), d = c.flowType === "sell", [p, g] = v(null), A = r == null ? void 0 : r.gateways.find(($) => $.id === m), E = (q = s == null ? void 0 : s.bestQuote) != null && q.exchangeRate ? parseFloat(s.bestQuote.exchangeRate) : null, R = parseFloat(c.fiatAmount) || 0, _ = !!(a && n && !d && Xt(c.cryptoCurrency) && E), ae = _ && c.cryptoCurrency.toUpperCase().includes(c.fiatCurrency.toUpperCase()), j = _ && R > 0 ? lt(ae ? R : R / E) : null, Q = async () => {
|
|
2143
|
+
g(null);
|
|
2140
2144
|
try {
|
|
2141
2145
|
u(), await f();
|
|
2142
2146
|
} catch ($) {
|
|
2143
|
-
const
|
|
2144
|
-
|
|
2147
|
+
const xe = $ instanceof Error ? $.message : "Failed to create order";
|
|
2148
|
+
g(xe);
|
|
2145
2149
|
}
|
|
2146
2150
|
};
|
|
2147
2151
|
return l ? /* @__PURE__ */ o("div", { className: `flex flex-col items-center justify-center p-12 ${t}`, children: [
|
|
@@ -2158,19 +2162,19 @@ function $a({ className: t = "", stablecoinParity: a, partnerName: n }) {
|
|
|
2158
2162
|
] })
|
|
2159
2163
|
] }),
|
|
2160
2164
|
d ? /* @__PURE__ */ o(J, { children: [
|
|
2161
|
-
/* @__PURE__ */ e(
|
|
2162
|
-
/* @__PURE__ */ e(
|
|
2165
|
+
/* @__PURE__ */ e(Ne, { label: "You sell", value: `${c.cryptoAmount} ${c.cryptoCurrency}`, highlight: !0 }),
|
|
2166
|
+
/* @__PURE__ */ e(Ne, { label: "You receive", value: `${c.fiatCurrency} payout` })
|
|
2163
2167
|
] }) : /* @__PURE__ */ o(J, { children: [
|
|
2164
|
-
/* @__PURE__ */ e(
|
|
2168
|
+
/* @__PURE__ */ e(Ne, { label: "You pay", value: `${c.fiatAmount} ${c.fiatCurrency}`, highlight: !0 }),
|
|
2165
2169
|
/* @__PURE__ */ e(
|
|
2166
|
-
|
|
2170
|
+
Ne,
|
|
2167
2171
|
{
|
|
2168
2172
|
label: "You receive",
|
|
2169
2173
|
value: j ? `${j} ${c.cryptoCurrency}` : `${c.cryptoCurrency} on ${c.network}`
|
|
2170
2174
|
}
|
|
2171
2175
|
),
|
|
2172
|
-
/* @__PURE__ */ e(
|
|
2173
|
-
|
|
2176
|
+
/* @__PURE__ */ e(Ne, { label: "Wallet", value: Kt(c.walletAddress), mono: !0 }),
|
|
2177
|
+
_ && j && /* @__PURE__ */ o("div", { className: "py-2 text-[11px]", style: { color: "var(--t-text-muted)", lineHeight: "15px" }, children: [
|
|
2174
2178
|
"Charged amount from provider may differ. The rest up to ",
|
|
2175
2179
|
j,
|
|
2176
2180
|
" ",
|
|
@@ -2180,8 +2184,8 @@ function $a({ className: t = "", stablecoinParity: a, partnerName: n }) {
|
|
|
2180
2184
|
" account."
|
|
2181
2185
|
] })
|
|
2182
2186
|
] }),
|
|
2183
|
-
/* @__PURE__ */ e(
|
|
2184
|
-
d && c.walletAddress && /* @__PURE__ */ e(
|
|
2187
|
+
/* @__PURE__ */ e(Ne, { label: "Network", value: c.network }),
|
|
2188
|
+
d && c.walletAddress && /* @__PURE__ */ e(Ne, { label: "Refund address", value: Kt(c.walletAddress), mono: !0 })
|
|
2185
2189
|
] }),
|
|
2186
2190
|
p && /* @__PURE__ */ e("p", { className: "text-[12px] mb-4", style: { color: "#EF4444" }, children: p }),
|
|
2187
2191
|
/* @__PURE__ */ e(
|
|
@@ -2190,7 +2194,7 @@ function $a({ className: t = "", stablecoinParity: a, partnerName: n }) {
|
|
|
2190
2194
|
className: "w-full font-semibold text-[16px] transition-all flex items-center justify-center gap-2",
|
|
2191
2195
|
style: { height: 60, borderRadius: 5, background: "var(--t-cta-bg)", color: "var(--t-cta-text)", opacity: h ? 0.7 : 1 },
|
|
2192
2196
|
disabled: h,
|
|
2193
|
-
onClick:
|
|
2197
|
+
onClick: Q,
|
|
2194
2198
|
children: h ? /* @__PURE__ */ o(J, { children: [
|
|
2195
2199
|
/* @__PURE__ */ e("span", { className: "nramp-spinner-inline" }),
|
|
2196
2200
|
"Processing..."
|
|
@@ -2199,7 +2203,7 @@ function $a({ className: t = "", stablecoinParity: a, partnerName: n }) {
|
|
|
2199
2203
|
)
|
|
2200
2204
|
] });
|
|
2201
2205
|
}
|
|
2202
|
-
function
|
|
2206
|
+
function Ne({ label: t, value: a, mono: n, highlight: r }) {
|
|
2203
2207
|
return /* @__PURE__ */ o("div", { className: "flex justify-between items-center py-2", style: { borderBottom: "1px solid var(--t-divider)" }, children: [
|
|
2204
2208
|
/* @__PURE__ */ e("span", { className: "text-[13px]", style: { color: "var(--t-text-secondary)" }, children: t }),
|
|
2205
2209
|
/* @__PURE__ */ e(
|
|
@@ -2212,13 +2216,13 @@ function Se({ label: t, value: a, mono: n, highlight: r }) {
|
|
|
2212
2216
|
)
|
|
2213
2217
|
] });
|
|
2214
2218
|
}
|
|
2215
|
-
function
|
|
2219
|
+
function Oe({
|
|
2216
2220
|
isOpen: t,
|
|
2217
2221
|
onClose: a,
|
|
2218
2222
|
children: n
|
|
2219
2223
|
}) {
|
|
2220
|
-
const [r, l] =
|
|
2221
|
-
|
|
2224
|
+
const [r, l] = v(!1), [c, m] = v(!1);
|
|
2225
|
+
Y(() => {
|
|
2222
2226
|
if (t)
|
|
2223
2227
|
l(!0), requestAnimationFrame(() => requestAnimationFrame(() => m(!0)));
|
|
2224
2228
|
else if (r) {
|
|
@@ -2227,10 +2231,10 @@ function He({
|
|
|
2227
2231
|
return () => clearTimeout(u);
|
|
2228
2232
|
}
|
|
2229
2233
|
}, [t]);
|
|
2230
|
-
const s =
|
|
2234
|
+
const s = P(() => {
|
|
2231
2235
|
m(!1), setTimeout(() => a(), 250);
|
|
2232
2236
|
}, [a]);
|
|
2233
|
-
return
|
|
2237
|
+
return Y(() => {
|
|
2234
2238
|
if (!t) return;
|
|
2235
2239
|
const u = (f) => {
|
|
2236
2240
|
f.key === "Escape" && s();
|
|
@@ -2300,7 +2304,7 @@ function Ya() {
|
|
|
2300
2304
|
/* @__PURE__ */ e("div", { className: "text-center py-3", children: /* @__PURE__ */ e("span", { className: "text-[11px]", style: { color: "var(--t-text-tertiary)" }, children: "Powered by NowRamp" }) })
|
|
2301
2305
|
] });
|
|
2302
2306
|
}
|
|
2303
|
-
function
|
|
2307
|
+
function ke({ onClick: t }) {
|
|
2304
2308
|
return /* @__PURE__ */ e(
|
|
2305
2309
|
"button",
|
|
2306
2310
|
{
|
|
@@ -2313,12 +2317,12 @@ function Le({ onClick: t }) {
|
|
|
2313
2317
|
}
|
|
2314
2318
|
);
|
|
2315
2319
|
}
|
|
2316
|
-
function
|
|
2320
|
+
function Pe({
|
|
2317
2321
|
value: t,
|
|
2318
2322
|
onChange: a,
|
|
2319
2323
|
placeholder: n = ""
|
|
2320
2324
|
}) {
|
|
2321
|
-
const [r, l] =
|
|
2325
|
+
const [r, l] = v(!1);
|
|
2322
2326
|
return /* @__PURE__ */ o("div", { className: "relative mx-5 mb-5", children: [
|
|
2323
2327
|
/* @__PURE__ */ e(
|
|
2324
2328
|
"input",
|
|
@@ -2351,14 +2355,14 @@ function Za({
|
|
|
2351
2355
|
assetBaseUrl: r = "",
|
|
2352
2356
|
selectedCode: l
|
|
2353
2357
|
}) {
|
|
2354
|
-
const [c, m] =
|
|
2358
|
+
const [c, m] = v(""), s = Z(() => {
|
|
2355
2359
|
if (!n || n.length === 0) return Ft;
|
|
2356
2360
|
const f = new Map(Ft.map((h) => [h.code, h.name]));
|
|
2357
2361
|
return n.map((h) => ({
|
|
2358
2362
|
code: h.code,
|
|
2359
2363
|
name: h.name || f.get(h.code) || h.code
|
|
2360
2364
|
}));
|
|
2361
|
-
}, [n]), u =
|
|
2365
|
+
}, [n]), u = Z(() => {
|
|
2362
2366
|
const f = c.trim().toLowerCase();
|
|
2363
2367
|
if (!f) {
|
|
2364
2368
|
if (l) {
|
|
@@ -2375,7 +2379,7 @@ function Za({
|
|
|
2375
2379
|
);
|
|
2376
2380
|
}, [s, c, l]);
|
|
2377
2381
|
return /* @__PURE__ */ o(J, { children: [
|
|
2378
|
-
/* @__PURE__ */ e("div", { className: "flex justify-end px-5 pt-5", children: /* @__PURE__ */ e(
|
|
2382
|
+
/* @__PURE__ */ e("div", { className: "flex justify-end px-5 pt-5", children: /* @__PURE__ */ e(ke, { onClick: t }) }),
|
|
2379
2383
|
/* @__PURE__ */ e(
|
|
2380
2384
|
"h2",
|
|
2381
2385
|
{
|
|
@@ -2390,7 +2394,7 @@ function Za({
|
|
|
2390
2394
|
children: "Select fiat currency"
|
|
2391
2395
|
}
|
|
2392
2396
|
),
|
|
2393
|
-
/* @__PURE__ */ e(
|
|
2397
|
+
/* @__PURE__ */ e(Pe, { value: c, onChange: m }),
|
|
2394
2398
|
/* @__PURE__ */ o("div", { className: "flex-1 overflow-y-auto custom-scroll px-5", children: [
|
|
2395
2399
|
u.map((f, h) => {
|
|
2396
2400
|
const d = f.name !== f.code ? f.name : "", p = l === f.code;
|
|
@@ -2433,9 +2437,9 @@ function Za({
|
|
|
2433
2437
|
] });
|
|
2434
2438
|
}
|
|
2435
2439
|
function _t({ src: t, alt: a, size: n, className: r, style: l }) {
|
|
2436
|
-
const [c, m] =
|
|
2440
|
+
const [c, m] = v(!1), [s, u] = v(!1), f = O(t);
|
|
2437
2441
|
f.current !== t && (f.current = t, m(!1), u(!1));
|
|
2438
|
-
const h =
|
|
2442
|
+
const h = P(() => m(!0), []), d = P(() => u(!0), []);
|
|
2439
2443
|
return /* @__PURE__ */ o("div", { className: r, style: { ...l, width: n, height: n, position: "relative" }, children: [
|
|
2440
2444
|
!c && !s && /* @__PURE__ */ e(
|
|
2441
2445
|
"div",
|
|
@@ -2467,50 +2471,50 @@ function _t({ src: t, alt: a, size: n, className: r, style: l }) {
|
|
|
2467
2471
|
] });
|
|
2468
2472
|
}
|
|
2469
2473
|
function Qa({ onClose: t, onSelect: a, cryptos: n, assetBaseUrl: r = "", selectedCode: l, selectedChain: c }) {
|
|
2470
|
-
const [m, s] =
|
|
2474
|
+
const [m, s] = v(""), u = Z(() => {
|
|
2471
2475
|
if (!n || n.length === 0) return wa;
|
|
2472
2476
|
const d = [];
|
|
2473
2477
|
for (const p of n) {
|
|
2474
|
-
const
|
|
2475
|
-
if (
|
|
2478
|
+
const g = p.networks || [], A = p.name || Sa[p.code] || p.code;
|
|
2479
|
+
if (g.length === 0)
|
|
2476
2480
|
d.push({ code: p.code, name: A, chain: p.code, popular: !1 });
|
|
2477
2481
|
else
|
|
2478
|
-
for (const
|
|
2479
|
-
const R =
|
|
2482
|
+
for (const E of g) {
|
|
2483
|
+
const R = E.code || E.id || E.name || p.code;
|
|
2480
2484
|
d.push({
|
|
2481
2485
|
code: p.code,
|
|
2482
2486
|
name: A,
|
|
2483
2487
|
chain: R,
|
|
2484
|
-
chainName:
|
|
2488
|
+
chainName: E.name,
|
|
2485
2489
|
popular: !1
|
|
2486
2490
|
});
|
|
2487
2491
|
}
|
|
2488
2492
|
}
|
|
2489
2493
|
return d;
|
|
2490
|
-
}, [n]), f =
|
|
2494
|
+
}, [n]), f = P((d, p) => l === d && c === p, [l, c]), h = Z(() => {
|
|
2491
2495
|
var A;
|
|
2492
2496
|
const d = m.trim().toLowerCase();
|
|
2493
2497
|
if (!d) {
|
|
2494
2498
|
if (l && c) {
|
|
2495
|
-
const
|
|
2496
|
-
if (
|
|
2497
|
-
const R = u.filter((
|
|
2498
|
-
return [
|
|
2499
|
+
const E = u.find((R) => R.code === l && R.chain === c);
|
|
2500
|
+
if (E) {
|
|
2501
|
+
const R = u.filter((_) => !(_.code === l && _.chain === c));
|
|
2502
|
+
return [E, ...R];
|
|
2499
2503
|
}
|
|
2500
2504
|
}
|
|
2501
2505
|
return u;
|
|
2502
2506
|
}
|
|
2503
|
-
const p = d.split(/\s+/),
|
|
2504
|
-
for (const
|
|
2505
|
-
const R =
|
|
2507
|
+
const p = d.split(/\s+/), g = [];
|
|
2508
|
+
for (const E of u) {
|
|
2509
|
+
const R = Qe(E.chain), _ = R ? R.name.toLowerCase() : "", ae = ((A = R == null ? void 0 : R.shortName) == null ? void 0 : A.toLowerCase()) || "", j = E.chain.toLowerCase(), Q = E.code.toLowerCase(), q = E.name.toLowerCase(), $ = [Q, q, _, ae, j];
|
|
2506
2510
|
if (!p.every((k) => $.some((i) => i.includes(k)))) continue;
|
|
2507
|
-
let
|
|
2508
|
-
|
|
2511
|
+
let y = 0;
|
|
2512
|
+
Q === d ? y += 100 : Q.startsWith(p[0]) && (y += 50), E.popular && (y += 10), p.length > 1 && (_.includes(p[1]) || ae.includes(p[1]) || j.includes(p[1])) && (y += 25), g.push({ item: E, score: y });
|
|
2509
2513
|
}
|
|
2510
|
-
return
|
|
2514
|
+
return g.sort((E, R) => R.score - E.score), g.map((E) => E.item);
|
|
2511
2515
|
}, [u, m, l, c]);
|
|
2512
2516
|
return /* @__PURE__ */ o(J, { children: [
|
|
2513
|
-
/* @__PURE__ */ e("div", { className: "flex justify-end px-5 pt-5", children: /* @__PURE__ */ e(
|
|
2517
|
+
/* @__PURE__ */ e("div", { className: "flex justify-end px-5 pt-5", children: /* @__PURE__ */ e(ke, { onClick: t }) }),
|
|
2514
2518
|
/* @__PURE__ */ e(
|
|
2515
2519
|
"h2",
|
|
2516
2520
|
{
|
|
@@ -2519,10 +2523,10 @@ function Qa({ onClose: t, onSelect: a, cryptos: n, assetBaseUrl: r = "", selecte
|
|
|
2519
2523
|
children: "Select crypto currency"
|
|
2520
2524
|
}
|
|
2521
2525
|
),
|
|
2522
|
-
/* @__PURE__ */ e(
|
|
2526
|
+
/* @__PURE__ */ e(Pe, { value: m, onChange: s }),
|
|
2523
2527
|
/* @__PURE__ */ o("div", { className: "flex-1 overflow-y-auto custom-scroll px-5", children: [
|
|
2524
2528
|
h.map((d, p) => {
|
|
2525
|
-
const
|
|
2529
|
+
const g = Qe(d.chain), A = (g == null ? void 0 : g.name) || d.chainName || d.chain, E = d.name !== d.code ? d.name : "", R = f(d.code, d.chain);
|
|
2526
2530
|
return /* @__PURE__ */ o("div", { children: [
|
|
2527
2531
|
/* @__PURE__ */ o(
|
|
2528
2532
|
"button",
|
|
@@ -2578,12 +2582,12 @@ function Qa({ onClose: t, onSelect: a, cryptos: n, assetBaseUrl: r = "", selecte
|
|
|
2578
2582
|
children: d.code
|
|
2579
2583
|
}
|
|
2580
2584
|
),
|
|
2581
|
-
|
|
2585
|
+
E && /* @__PURE__ */ e(
|
|
2582
2586
|
"span",
|
|
2583
2587
|
{
|
|
2584
2588
|
className: "text-[13px]",
|
|
2585
2589
|
style: { color: "var(--t-text-secondary)" },
|
|
2586
|
-
children:
|
|
2590
|
+
children: E
|
|
2587
2591
|
}
|
|
2588
2592
|
)
|
|
2589
2593
|
] }) }),
|
|
@@ -2616,7 +2620,7 @@ function za({
|
|
|
2616
2620
|
onSelect: n,
|
|
2617
2621
|
onClose: r
|
|
2618
2622
|
}) {
|
|
2619
|
-
const [l, c] =
|
|
2623
|
+
const [l, c] = v(""), m = Z(() => {
|
|
2620
2624
|
const s = l.trim().toLowerCase();
|
|
2621
2625
|
if (!s) {
|
|
2622
2626
|
if (a) {
|
|
@@ -2633,7 +2637,7 @@ function za({
|
|
|
2633
2637
|
);
|
|
2634
2638
|
}, [t, l, a]);
|
|
2635
2639
|
return /* @__PURE__ */ o(J, { children: [
|
|
2636
|
-
/* @__PURE__ */ e("div", { className: "flex justify-end px-5 pt-5", children: /* @__PURE__ */ e(
|
|
2640
|
+
/* @__PURE__ */ e("div", { className: "flex justify-end px-5 pt-5", children: /* @__PURE__ */ e(ke, { onClick: r }) }),
|
|
2637
2641
|
/* @__PURE__ */ e(
|
|
2638
2642
|
"h2",
|
|
2639
2643
|
{
|
|
@@ -2642,7 +2646,7 @@ function za({
|
|
|
2642
2646
|
children: "Choose payment method"
|
|
2643
2647
|
}
|
|
2644
2648
|
),
|
|
2645
|
-
/* @__PURE__ */ e(
|
|
2649
|
+
/* @__PURE__ */ e(Pe, { value: l, onChange: c }),
|
|
2646
2650
|
/* @__PURE__ */ o("div", { className: "flex-1 overflow-y-auto custom-scroll px-5", children: [
|
|
2647
2651
|
m.map((s, u) => {
|
|
2648
2652
|
const f = s.id === a, h = Yt(s.id, s.name);
|
|
@@ -2746,9 +2750,9 @@ function en({
|
|
|
2746
2750
|
onLocationPress: u,
|
|
2747
2751
|
assetBaseUrl: f = ""
|
|
2748
2752
|
}) {
|
|
2749
|
-
const [h, d] =
|
|
2753
|
+
const [h, d] = v(!1);
|
|
2750
2754
|
return /* @__PURE__ */ o(J, { children: [
|
|
2751
|
-
/* @__PURE__ */ e("div", { className: "flex justify-end items-center px-5 pt-5", children: /* @__PURE__ */ e(
|
|
2755
|
+
/* @__PURE__ */ e("div", { className: "flex justify-end items-center px-5 pt-5", children: /* @__PURE__ */ e(ke, { onClick: t }) }),
|
|
2752
2756
|
/* @__PURE__ */ o("div", { className: "px-5 flex-1 pt-6 overflow-y-auto custom-scroll", children: [
|
|
2753
2757
|
u && /* @__PURE__ */ o(J, { children: [
|
|
2754
2758
|
/* @__PURE__ */ e("div", { style: { borderTop: "1px solid var(--t-divider)" }, children: /* @__PURE__ */ o(
|
|
@@ -2853,24 +2857,24 @@ function an({
|
|
|
2853
2857
|
assetBaseUrl: n = "",
|
|
2854
2858
|
selectedCode: r
|
|
2855
2859
|
}) {
|
|
2856
|
-
const [l, c] =
|
|
2860
|
+
const [l, c] = v(""), m = Z(() => {
|
|
2857
2861
|
const s = l.trim().toLowerCase();
|
|
2858
2862
|
if (!s) {
|
|
2859
2863
|
if (r) {
|
|
2860
2864
|
const u = r.toLowerCase(), f = st[u];
|
|
2861
2865
|
if (f) {
|
|
2862
|
-
const h =
|
|
2866
|
+
const h = Ze.filter((d) => d.code !== u);
|
|
2863
2867
|
return [f, ...h];
|
|
2864
2868
|
}
|
|
2865
2869
|
}
|
|
2866
|
-
return
|
|
2870
|
+
return Ze;
|
|
2867
2871
|
}
|
|
2868
|
-
return
|
|
2872
|
+
return Ze.filter(
|
|
2869
2873
|
(u) => u.name.toLowerCase().includes(s) || u.code.includes(s) || u.defaultFiat.toLowerCase().includes(s)
|
|
2870
2874
|
);
|
|
2871
2875
|
}, [l, r]);
|
|
2872
2876
|
return /* @__PURE__ */ o(J, { children: [
|
|
2873
|
-
/* @__PURE__ */ e("div", { className: "flex justify-end px-5 pt-5", children: /* @__PURE__ */ e(
|
|
2877
|
+
/* @__PURE__ */ e("div", { className: "flex justify-end px-5 pt-5", children: /* @__PURE__ */ e(ke, { onClick: t }) }),
|
|
2874
2878
|
/* @__PURE__ */ e(
|
|
2875
2879
|
"h2",
|
|
2876
2880
|
{
|
|
@@ -2885,7 +2889,7 @@ function an({
|
|
|
2885
2889
|
children: "Select your country"
|
|
2886
2890
|
}
|
|
2887
2891
|
),
|
|
2888
|
-
/* @__PURE__ */ e(
|
|
2892
|
+
/* @__PURE__ */ e(Pe, { value: l, onChange: c }),
|
|
2889
2893
|
/* @__PURE__ */ o("div", { className: "flex-1 overflow-y-auto custom-scroll px-5", children: [
|
|
2890
2894
|
m.map((s, u) => {
|
|
2891
2895
|
const f = (r == null ? void 0 : r.toLowerCase()) === s.code;
|
|
@@ -2928,7 +2932,7 @@ function an({
|
|
|
2928
2932
|
] });
|
|
2929
2933
|
}
|
|
2930
2934
|
function nn({ code: t, size: a = 32, baseUrl: n = "" }) {
|
|
2931
|
-
const [r, l] =
|
|
2935
|
+
const [r, l] = v(!1);
|
|
2932
2936
|
return r ? /* @__PURE__ */ e(
|
|
2933
2937
|
"div",
|
|
2934
2938
|
{
|
|
@@ -2971,188 +2975,188 @@ function rn({
|
|
|
2971
2975
|
textColor: h,
|
|
2972
2976
|
textSecondaryColor: d,
|
|
2973
2977
|
textMutedColor: p,
|
|
2974
|
-
successColor:
|
|
2978
|
+
successColor: g,
|
|
2975
2979
|
showFlowToggle: A = !0,
|
|
2976
|
-
showSettings:
|
|
2980
|
+
showSettings: E = !0,
|
|
2977
2981
|
showThemeToggle: R = !0,
|
|
2978
|
-
autoRedirect:
|
|
2979
|
-
explorerUrl:
|
|
2982
|
+
autoRedirect: _ = !1,
|
|
2983
|
+
explorerUrl: ae,
|
|
2980
2984
|
doneButtonText: j = "Done",
|
|
2981
|
-
supportEmail:
|
|
2985
|
+
supportEmail: Q,
|
|
2982
2986
|
stablecoinParity: q,
|
|
2983
2987
|
partnerName: $,
|
|
2984
|
-
onDone:
|
|
2988
|
+
onDone: xe
|
|
2985
2989
|
}) {
|
|
2986
2990
|
var bt, Nt, Et, wt, At, Rt, Tt, kt, Lt;
|
|
2987
2991
|
const {
|
|
2988
|
-
state:
|
|
2992
|
+
state: y,
|
|
2989
2993
|
dispatch: k,
|
|
2990
2994
|
config: i,
|
|
2991
2995
|
configLoading: I,
|
|
2992
|
-
quotes:
|
|
2993
|
-
quotesLoading:
|
|
2994
|
-
quotesError:
|
|
2995
|
-
fetchQuotes:
|
|
2996
|
-
createOrder:
|
|
2997
|
-
orderLoading:
|
|
2998
|
-
amountError:
|
|
2999
|
-
fieldLocks:
|
|
2996
|
+
quotes: b,
|
|
2997
|
+
quotesLoading: S,
|
|
2998
|
+
quotesError: ge,
|
|
2999
|
+
fetchQuotes: Ce,
|
|
3000
|
+
createOrder: Se,
|
|
3001
|
+
orderLoading: oe,
|
|
3002
|
+
amountError: me,
|
|
3003
|
+
fieldLocks: M,
|
|
3000
3004
|
apiConfig: ee,
|
|
3001
|
-
assetBaseUrl:
|
|
3002
|
-
} =
|
|
3003
|
-
|
|
3004
|
-
|
|
3005
|
-
}, [a]),
|
|
3006
|
-
const
|
|
3007
|
-
return () => clearTimeout(
|
|
3008
|
-
}, [I]),
|
|
3009
|
-
if (
|
|
3010
|
-
|
|
3011
|
-
const
|
|
3012
|
-
return () => clearTimeout(
|
|
3005
|
+
assetBaseUrl: G
|
|
3006
|
+
} = Te(), [X, fe] = v(a === "dark"), [he, Le] = v(n), [ie, H] = v(null), [Ue, Ee] = v(!1), [De, Ke] = v(!1), [ne, _e] = v(!1), [ve, Fe] = v(!1), [Ve, le] = v(null), [Me, Je] = v(!0), [qe, je] = v(!1), [ce, C] = v(!1), w = O(null), L = O(), U = O(y.flowType);
|
|
3007
|
+
Y(() => {
|
|
3008
|
+
fe(a === "dark");
|
|
3009
|
+
}, [a]), Y(() => {
|
|
3010
|
+
const x = setTimeout(() => Je(!1), I ? 0 : 800);
|
|
3011
|
+
return () => clearTimeout(x);
|
|
3012
|
+
}, [I]), Y(() => {
|
|
3013
|
+
if (U.current !== y.flowType && !Me) {
|
|
3014
|
+
U.current = y.flowType, je(!0), Ee(!1), Ke(!1);
|
|
3015
|
+
const x = setTimeout(() => je(!1), 350);
|
|
3016
|
+
return () => clearTimeout(x);
|
|
3013
3017
|
}
|
|
3014
|
-
|
|
3015
|
-
}, [
|
|
3016
|
-
const
|
|
3017
|
-
|
|
3018
|
-
const ut =
|
|
3019
|
-
if (
|
|
3020
|
-
const
|
|
3021
|
-
if (
|
|
3018
|
+
U.current = y.flowType;
|
|
3019
|
+
}, [y.flowType, Me]);
|
|
3020
|
+
const D = y.flowType, F = D === "buy", B = y.cryptoCurrency || "BTC", W = y.fiatCurrency || "USD", et = F ? y.fiatAmount : y.cryptoAmount, z = Ea(et), pe = (bt = b == null ? void 0 : b.bestQuote) != null && bt.exchangeRate ? parseFloat(b.bestQuote.exchangeRate) : null, Ge = O(null);
|
|
3021
|
+
pe && B && W && (Ge.current = { rate: pe, crypto: B, fiat: W });
|
|
3022
|
+
const ut = Z(() => {
|
|
3023
|
+
if (b != null && b.bestQuote) {
|
|
3024
|
+
const x = F ? b.bestQuote.cryptoAmount : b.bestQuote.fiatAmount;
|
|
3025
|
+
if (x) return x;
|
|
3022
3026
|
}
|
|
3023
3027
|
return "0";
|
|
3024
|
-
}, [
|
|
3025
|
-
var
|
|
3026
|
-
const
|
|
3027
|
-
return !
|
|
3028
|
-
}, [
|
|
3029
|
-
|
|
3030
|
-
const
|
|
3031
|
-
if (!
|
|
3032
|
-
|
|
3028
|
+
}, [b, F]), Ie = !!(q && $ && F && Xt(B) && pe), Qt = Ie && B.toUpperCase().includes(W.toUpperCase()), mt = Ie && z > 0 ? lt(Qt ? z : z / pe) : null, zt = Ie && mt ? mt : ut, Jt = Z(() => {
|
|
3029
|
+
var K, re, Ae;
|
|
3030
|
+
const x = pe || ((K = Ge.current) == null ? void 0 : K.rate), N = pe ? B : (re = Ge.current) == null ? void 0 : re.crypto, T = pe ? W : (Ae = Ge.current) == null ? void 0 : Ae.fiat;
|
|
3031
|
+
return !x || !N || !T ? "" : `1 ${N} ≈ ${x.toFixed(2)} ${T}`;
|
|
3032
|
+
}, [B, W, pe]);
|
|
3033
|
+
Y(() => {
|
|
3034
|
+
const x = y.walletAddress.trim(), N = y.network;
|
|
3035
|
+
if (!x || x.length < 10) {
|
|
3036
|
+
le(null), k({ type: "SET_WALLET_ERROR", message: "" });
|
|
3033
3037
|
return;
|
|
3034
3038
|
}
|
|
3035
|
-
Fe(!0),
|
|
3039
|
+
Fe(!0), le(null);
|
|
3036
3040
|
const T = new AbortController();
|
|
3037
3041
|
return clearTimeout(L.current), L.current = setTimeout(async () => {
|
|
3038
|
-
var
|
|
3042
|
+
var K, re, Ae;
|
|
3039
3043
|
try {
|
|
3040
3044
|
const nt = await (await fetch(`${ee.apiUrl}/public/validate/address`, {
|
|
3041
3045
|
method: "POST",
|
|
3042
3046
|
headers: { "Content-Type": "application/json" },
|
|
3043
|
-
body: JSON.stringify({ address:
|
|
3047
|
+
body: JSON.stringify({ address: x, ...N ? { network: N } : {} }),
|
|
3044
3048
|
signal: T.signal
|
|
3045
|
-
})).json(), rt = ((
|
|
3049
|
+
})).json(), rt = ((K = nt.data) == null ? void 0 : K.attributes) || nt.data || nt;
|
|
3046
3050
|
if (rt.isValid)
|
|
3047
|
-
|
|
3051
|
+
le(!0), k({ type: "SET_WALLET_ERROR", message: "" });
|
|
3048
3052
|
else {
|
|
3049
|
-
|
|
3050
|
-
const da = ((
|
|
3053
|
+
le(!1);
|
|
3054
|
+
const da = ((re = rt.errors) == null ? void 0 : re[0]) || ((Ae = rt.details) == null ? void 0 : Ae.formatMessage) || "Invalid wallet address";
|
|
3051
3055
|
k({ type: "SET_WALLET_ERROR", message: da });
|
|
3052
3056
|
}
|
|
3053
3057
|
} catch (at) {
|
|
3054
3058
|
if (at instanceof DOMException && at.name === "AbortError") return;
|
|
3055
|
-
|
|
3059
|
+
le(null);
|
|
3056
3060
|
} finally {
|
|
3057
3061
|
T.signal.aborted || Fe(!1);
|
|
3058
3062
|
}
|
|
3059
3063
|
}, 500), () => {
|
|
3060
3064
|
clearTimeout(L.current), T.abort();
|
|
3061
3065
|
};
|
|
3062
|
-
}, [
|
|
3063
|
-
const ft = !et || z === 0, ht = z > 0 && (
|
|
3064
|
-
let
|
|
3065
|
-
const T =
|
|
3066
|
-
|
|
3067
|
-
}, yt = (
|
|
3068
|
-
|
|
3069
|
-
}, ta =
|
|
3070
|
-
(
|
|
3071
|
-
k({ type: "SET_FIAT_CURRENCY", currency:
|
|
3066
|
+
}, [y.walletAddress, y.network, ee.apiUrl]);
|
|
3067
|
+
const ft = !et || z === 0, ht = z > 0 && (F ? z < Bt : z < Ot), pt = !!me || ht || Ue && ft, qt = z > 0 && !me && !ht, tt = y.walletAddress.trim().length >= 10 && Ve !== !1 && !ve, $e = qt && tt && !!y.cryptoCurrency && !!y.network, ea = (x) => {
|
|
3068
|
+
let N = x.target.value.replace(/[^0-9.,]/g, "");
|
|
3069
|
+
const T = F ? 2 : 6, K = N.indexOf(".");
|
|
3070
|
+
K !== -1 && N.length - K - 1 > T && (N = N.slice(0, K + T + 1)), k(F ? { type: "SET_FIAT_AMOUNT", amount: N } : { type: "SET_CRYPTO_AMOUNT", amount: N });
|
|
3071
|
+
}, yt = (x) => {
|
|
3072
|
+
x !== D && k({ type: "SET_FLOW_TYPE", flowType: x });
|
|
3073
|
+
}, ta = P(
|
|
3074
|
+
(x) => {
|
|
3075
|
+
k({ type: "SET_FIAT_CURRENCY", currency: x });
|
|
3072
3076
|
},
|
|
3073
3077
|
[k]
|
|
3074
|
-
), aa =
|
|
3075
|
-
(
|
|
3076
|
-
k({ type: "SET_CRYPTO_CURRENCY", currency:
|
|
3078
|
+
), aa = P(
|
|
3079
|
+
(x, N) => {
|
|
3080
|
+
k({ type: "SET_CRYPTO_CURRENCY", currency: x }), k({ type: "SET_CRYPTO_CHAIN", chain: N });
|
|
3077
3081
|
},
|
|
3078
3082
|
[k]
|
|
3079
|
-
), na =
|
|
3080
|
-
(
|
|
3081
|
-
k({ type: "SET_PAYMENT_METHOD", methodId:
|
|
3083
|
+
), na = P(
|
|
3084
|
+
(x) => {
|
|
3085
|
+
k({ type: "SET_PAYMENT_METHOD", methodId: x });
|
|
3082
3086
|
},
|
|
3083
3087
|
[k]
|
|
3084
|
-
), ra =
|
|
3085
|
-
(
|
|
3086
|
-
k({ type: "SET_COUNTRY", country:
|
|
3088
|
+
), ra = P(
|
|
3089
|
+
(x) => {
|
|
3090
|
+
k({ type: "SET_COUNTRY", country: x }), H(null);
|
|
3087
3091
|
},
|
|
3088
3092
|
[k]
|
|
3089
|
-
), oa =
|
|
3090
|
-
|
|
3091
|
-
}, []), ia =
|
|
3092
|
-
|
|
3093
|
+
), oa = P(() => {
|
|
3094
|
+
H(null), setTimeout(() => H("country"), 280);
|
|
3095
|
+
}, []), ia = y.country ? (Nt = st[y.country.toLowerCase()]) == null ? void 0 : Nt.name : void 0, la = () => {
|
|
3096
|
+
$e && (C(!0), Ce());
|
|
3093
3097
|
};
|
|
3094
|
-
|
|
3095
|
-
var
|
|
3096
|
-
if (!(!
|
|
3097
|
-
if (
|
|
3098
|
-
|
|
3098
|
+
Y(() => {
|
|
3099
|
+
var x;
|
|
3100
|
+
if (!(!ce || S)) {
|
|
3101
|
+
if (b != null && b.bestQuote)
|
|
3102
|
+
C(!1), k({ type: "SELECT_QUOTE", quote: b.bestQuote }), Se().catch(() => {
|
|
3099
3103
|
});
|
|
3100
|
-
else if (
|
|
3101
|
-
|
|
3102
|
-
else if (
|
|
3103
|
-
|
|
3104
|
-
const
|
|
3104
|
+
else if (ge)
|
|
3105
|
+
C(!1), k({ type: "SET_ERROR", message: ge.message || "No quotes available" });
|
|
3106
|
+
else if (b && !b.bestQuote) {
|
|
3107
|
+
C(!1);
|
|
3108
|
+
const N = (x = b.unavailableGateways) == null ? void 0 : x.map((K) => K.reason).filter(Boolean), T = N != null && N.length ? `No providers available: ${N.join("; ")}` : "No providers available for this currency/network combination";
|
|
3105
3109
|
k({ type: "SET_ERROR", message: T });
|
|
3106
3110
|
}
|
|
3107
3111
|
}
|
|
3108
|
-
}, [
|
|
3109
|
-
const xt =
|
|
3110
|
-
const
|
|
3111
|
-
return (0.299 * T + 0.587 *
|
|
3112
|
+
}, [ce, b, S, ge, k, Se]);
|
|
3113
|
+
const xt = X ? "theme-dark" : "theme-light", Xe = Mt.find((x) => x.id === he) || Mt[0], ca = Xe.accent === null, sa = r ? ue(r) : !1, gt = (x) => {
|
|
3114
|
+
const N = x.replace("#", ""), T = parseInt(N.substring(0, 2), 16), K = parseInt(N.substring(2, 4), 16), re = parseInt(N.substring(4, 6), 16);
|
|
3115
|
+
return (0.299 * T + 0.587 * K + 0.114 * re) / 255 > 0.5 ? "#000000" : "#ffffff";
|
|
3112
3116
|
}, Ct = sa ? { "--t-accent": r, "--t-cta-bg": r, "--t-cta-text": gt(r) } : ca ? {
|
|
3113
|
-
"--t-accent":
|
|
3114
|
-
"--t-cta-bg":
|
|
3115
|
-
"--t-cta-text":
|
|
3117
|
+
"--t-accent": X ? "#ffffff" : "#111111",
|
|
3118
|
+
"--t-cta-bg": X ? "#ffffff" : "#111111",
|
|
3119
|
+
"--t-cta-text": X ? "#000000" : "#ffffff"
|
|
3116
3120
|
} : {
|
|
3117
|
-
"--t-accent":
|
|
3118
|
-
"--t-cta-bg":
|
|
3119
|
-
"--t-cta-text": gt(
|
|
3120
|
-
},
|
|
3121
|
-
u &&
|
|
3122
|
-
const
|
|
3123
|
-
l &&
|
|
3124
|
-
const
|
|
3125
|
-
m &&
|
|
3126
|
-
const
|
|
3127
|
-
if (
|
|
3121
|
+
"--t-accent": Xe.accent,
|
|
3122
|
+
"--t-cta-bg": Xe.accent,
|
|
3123
|
+
"--t-cta-text": gt(Xe.accent)
|
|
3124
|
+
}, te = {};
|
|
3125
|
+
u && ue(u) && (te["--t-surface"] = u, te["--t-modal-bg"] = u), f && ue(f) && (te["--t-pill-bg"] = f, te["--t-close-bg"] = f), h && ue(h) && (te["--t-text"] = h), d && ue(d) && (te["--t-text-secondary"] = d), p && ue(p) && (te["--t-text-muted"] = p, te["--t-text-tertiary"] = p), g && ue(g) && (te["--t-success"] = g);
|
|
3126
|
+
const be = {};
|
|
3127
|
+
l && ue(l) ? be.backgroundColor = l : be.backgroundColor = "var(--t-bg)", c && (c.startsWith("https://") || c.startsWith("data:image/")) && (be.backgroundImage = `url(${c})`, be.backgroundSize = "cover", be.backgroundPosition = "center");
|
|
3128
|
+
const We = X ? "#ffffff" : "#111111", Ye = {};
|
|
3129
|
+
m && ue(m) && (Ye.border = `1px solid ${m}`), s && (Ye.borderRadius = s);
|
|
3130
|
+
const St = y.step === "checkout" ? /* @__PURE__ */ e(Ka, { autoRedirect: _ }) : y.step === "processing" ? /* @__PURE__ */ e(Va, {}) : y.step === "complete" ? /* @__PURE__ */ e(ja, { explorerUrl: ae, doneButtonText: j, onDone: xe }) : y.step === "error" ? /* @__PURE__ */ e(Ga, { supportEmail: Q }) : y.step === "confirm" ? /* @__PURE__ */ e($a, { stablecoinParity: Ie, partnerName: $ }) : null;
|
|
3131
|
+
if (St)
|
|
3128
3132
|
return /* @__PURE__ */ e(
|
|
3129
3133
|
"div",
|
|
3130
3134
|
{
|
|
3131
3135
|
className: `${xt} relative w-full max-w-[390px] h-[640px] overflow-hidden flex flex-col select-none transition-colors duration-300 ${t}`,
|
|
3132
3136
|
style: {
|
|
3133
3137
|
fontFamily: "'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif",
|
|
3134
|
-
...
|
|
3138
|
+
...be,
|
|
3135
3139
|
...Ct,
|
|
3136
|
-
...
|
|
3137
|
-
...
|
|
3140
|
+
...te,
|
|
3141
|
+
...Ye
|
|
3138
3142
|
},
|
|
3139
|
-
children:
|
|
3143
|
+
children: St
|
|
3140
3144
|
}
|
|
3141
3145
|
);
|
|
3142
|
-
const
|
|
3146
|
+
const se = y.network, we = se ? Qe(se) : null, vt = (we == null ? void 0 : we.shortName) || (we == null ? void 0 : we.name) || se;
|
|
3143
3147
|
return /* @__PURE__ */ o(
|
|
3144
3148
|
"div",
|
|
3145
3149
|
{
|
|
3146
3150
|
className: `${xt} relative w-full max-w-[390px] min-h-[640px] overflow-hidden flex flex-col select-none transition-colors duration-300 ${t}`,
|
|
3147
3151
|
style: {
|
|
3148
3152
|
fontFamily: "'Geist', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif",
|
|
3149
|
-
...
|
|
3153
|
+
...be,
|
|
3150
3154
|
...Ct,
|
|
3151
|
-
...
|
|
3152
|
-
...
|
|
3155
|
+
...te,
|
|
3156
|
+
...Ye
|
|
3153
3157
|
},
|
|
3154
3158
|
children: [
|
|
3155
|
-
|
|
3159
|
+
E && /* @__PURE__ */ e("div", { className: `flex justify-end items-center px-5 pt-3 ${A ? "pb-1" : "pb-5"}`, children: /* @__PURE__ */ e(Ma, { onClick: () => H("settings") }) }),
|
|
3156
3160
|
A ? /* @__PURE__ */ o("div", { className: "flex flex-col items-center pt-3 pb-5", children: [
|
|
3157
3161
|
/* @__PURE__ */ o("div", { className: "flex", style: { width: 165 }, children: [
|
|
3158
3162
|
/* @__PURE__ */ e(
|
|
@@ -3160,7 +3164,7 @@ function rn({
|
|
|
3160
3164
|
{
|
|
3161
3165
|
onClick: () => yt("buy"),
|
|
3162
3166
|
className: "flex-1 pb-2.5 text-[16px] font-medium text-center transition-colors duration-200",
|
|
3163
|
-
style: { color:
|
|
3167
|
+
style: { color: D === "buy" ? "var(--t-text)" : "var(--t-text-secondary)" },
|
|
3164
3168
|
children: "Buy"
|
|
3165
3169
|
}
|
|
3166
3170
|
),
|
|
@@ -3169,7 +3173,7 @@ function rn({
|
|
|
3169
3173
|
{
|
|
3170
3174
|
onClick: () => yt("sell"),
|
|
3171
3175
|
className: "flex-1 pb-2.5 text-[16px] font-medium text-center transition-colors duration-200",
|
|
3172
|
-
style: { color:
|
|
3176
|
+
style: { color: D === "sell" ? "var(--t-text)" : "var(--t-text-secondary)" },
|
|
3173
3177
|
children: "Sell"
|
|
3174
3178
|
}
|
|
3175
3179
|
)
|
|
@@ -3182,14 +3186,14 @@ function rn({
|
|
|
3182
3186
|
className: "absolute top-0 h-full transition-all duration-300 ease-in-out",
|
|
3183
3187
|
style: {
|
|
3184
3188
|
width: "50%",
|
|
3185
|
-
left:
|
|
3189
|
+
left: D === "buy" ? "0%" : "50%",
|
|
3186
3190
|
background: "var(--t-accent)"
|
|
3187
3191
|
}
|
|
3188
3192
|
}
|
|
3189
3193
|
)
|
|
3190
3194
|
] })
|
|
3191
3195
|
] }) : null,
|
|
3192
|
-
|
|
3196
|
+
Me || qe || I ? /* @__PURE__ */ e(Ya, {}) : /* @__PURE__ */ o("div", { className: "flex-1 overflow-hidden px-5 flex flex-col tab-fade-in", children: [
|
|
3193
3197
|
/* @__PURE__ */ o(
|
|
3194
3198
|
"div",
|
|
3195
3199
|
{
|
|
@@ -3197,7 +3201,7 @@ function rn({
|
|
|
3197
3201
|
style: {
|
|
3198
3202
|
background: "var(--t-surface)",
|
|
3199
3203
|
borderRadius: 5,
|
|
3200
|
-
border:
|
|
3204
|
+
border: Ue && pt ? "1px solid #EF4444" : "1px solid transparent",
|
|
3201
3205
|
minHeight: 102
|
|
3202
3206
|
},
|
|
3203
3207
|
children: [
|
|
@@ -3206,22 +3210,22 @@ function rn({
|
|
|
3206
3210
|
/* @__PURE__ */ e(
|
|
3207
3211
|
"input",
|
|
3208
3212
|
{
|
|
3209
|
-
ref:
|
|
3213
|
+
ref: w,
|
|
3210
3214
|
type: "text",
|
|
3211
3215
|
value: et,
|
|
3212
3216
|
onChange: ea,
|
|
3213
|
-
onBlur: () =>
|
|
3214
|
-
placeholder:
|
|
3217
|
+
onBlur: () => Ee(!0),
|
|
3218
|
+
placeholder: F ? "250" : "0.01",
|
|
3215
3219
|
className: "bg-transparent outline-none w-0 flex-1 mr-3",
|
|
3216
3220
|
style: { color: "var(--t-text)", fontSize: 24, fontWeight: 600, lineHeight: "32px", padding: 0, border: "none", borderRadius: 0, backgroundColor: "transparent", height: "auto", width: 0 },
|
|
3217
3221
|
inputMode: "decimal",
|
|
3218
|
-
disabled: !!((Et =
|
|
3222
|
+
disabled: !!((Et = M == null ? void 0 : M.sourceAmount) != null && Et.locked)
|
|
3219
3223
|
}
|
|
3220
3224
|
),
|
|
3221
|
-
|
|
3225
|
+
F ? /* @__PURE__ */ o(
|
|
3222
3226
|
"button",
|
|
3223
3227
|
{
|
|
3224
|
-
onClick: () =>
|
|
3228
|
+
onClick: () => H("fiat"),
|
|
3225
3229
|
className: "flex items-center gap-1.5 shrink-0 transition-colors",
|
|
3226
3230
|
style: {
|
|
3227
3231
|
background: "var(--t-pill-bg)",
|
|
@@ -3230,18 +3234,18 @@ function rn({
|
|
|
3230
3234
|
paddingLeft: 10,
|
|
3231
3235
|
paddingRight: 10
|
|
3232
3236
|
},
|
|
3233
|
-
disabled: !!((wt =
|
|
3237
|
+
disabled: !!((wt = M == null ? void 0 : M.sourceCurrency) != null && wt.locked),
|
|
3234
3238
|
children: [
|
|
3235
|
-
/* @__PURE__ */ e(ct, { currencyCode:
|
|
3236
|
-
/* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color:
|
|
3237
|
-
/* @__PURE__ */ e(
|
|
3239
|
+
/* @__PURE__ */ e(ct, { currencyCode: W, size: 16, baseUrl: G }),
|
|
3240
|
+
/* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: We }, children: W }),
|
|
3241
|
+
/* @__PURE__ */ e(He, {})
|
|
3238
3242
|
]
|
|
3239
3243
|
}
|
|
3240
3244
|
) : /* @__PURE__ */ o("div", { className: "flex flex-col items-end shrink-0", children: [
|
|
3241
3245
|
/* @__PURE__ */ o(
|
|
3242
3246
|
"button",
|
|
3243
3247
|
{
|
|
3244
|
-
onClick: () =>
|
|
3248
|
+
onClick: () => H("crypto"),
|
|
3245
3249
|
className: "flex items-center gap-1.5 transition-colors",
|
|
3246
3250
|
style: {
|
|
3247
3251
|
background: "var(--t-pill-bg)",
|
|
@@ -3250,34 +3254,34 @@ function rn({
|
|
|
3250
3254
|
paddingLeft: 10,
|
|
3251
3255
|
paddingRight: 10
|
|
3252
3256
|
},
|
|
3253
|
-
disabled: !!((At =
|
|
3257
|
+
disabled: !!((At = M == null ? void 0 : M.destinationCurrency) != null && At.locked),
|
|
3254
3258
|
children: [
|
|
3255
|
-
/* @__PURE__ */ e(Ht, { ticker:
|
|
3256
|
-
/* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color:
|
|
3257
|
-
/* @__PURE__ */ e(
|
|
3259
|
+
/* @__PURE__ */ e(Ht, { ticker: B, size: 16, baseUrl: G }),
|
|
3260
|
+
/* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: We }, children: B }),
|
|
3261
|
+
/* @__PURE__ */ e(He, {})
|
|
3258
3262
|
]
|
|
3259
3263
|
}
|
|
3260
3264
|
),
|
|
3261
|
-
|
|
3265
|
+
se && /* @__PURE__ */ o("div", { className: "flex items-center gap-1 mt-1.5 mr-0.5", children: [
|
|
3262
3266
|
/* @__PURE__ */ e("div", { className: "rounded-full", style: { width: 14, height: 14, background: "#ffffff" }, children: /* @__PURE__ */ e(
|
|
3263
3267
|
"img",
|
|
3264
3268
|
{
|
|
3265
|
-
src: it(
|
|
3266
|
-
alt:
|
|
3269
|
+
src: it(se, G),
|
|
3270
|
+
alt: se,
|
|
3267
3271
|
width: 14,
|
|
3268
3272
|
height: 14,
|
|
3269
3273
|
className: "rounded-full",
|
|
3270
3274
|
style: { width: 14, height: 14 }
|
|
3271
3275
|
}
|
|
3272
3276
|
) }),
|
|
3273
|
-
/* @__PURE__ */ e("span", { className: "text-[12px]", style: { color: "var(--t-text-secondary)" }, children:
|
|
3277
|
+
/* @__PURE__ */ e("span", { className: "text-[12px]", style: { color: "var(--t-text-secondary)" }, children: vt })
|
|
3274
3278
|
] })
|
|
3275
3279
|
] })
|
|
3276
3280
|
] })
|
|
3277
3281
|
]
|
|
3278
3282
|
}
|
|
3279
3283
|
),
|
|
3280
|
-
|
|
3284
|
+
Ue && pt && /* @__PURE__ */ e("div", { className: "text-[12px] mt-1.5 px-[2px]", style: { color: "#EF4444" }, children: me || (ft ? "Amount should be more than 0" : F ? `Minimum amount is ${Bt} ${W}` : `Minimum amount is ${Ot} ${B}`) }),
|
|
3281
3285
|
/* @__PURE__ */ o(
|
|
3282
3286
|
"div",
|
|
3283
3287
|
{
|
|
@@ -3294,7 +3298,7 @@ function rn({
|
|
|
3294
3298
|
children: [
|
|
3295
3299
|
/* @__PURE__ */ e("div", { className: "text-[13px] mb-2.5", style: { color: "var(--t-text-secondary)" }, children: "You get" }),
|
|
3296
3300
|
/* @__PURE__ */ o("div", { className: "flex items-start justify-between", children: [
|
|
3297
|
-
|
|
3301
|
+
S && !ce ? /* @__PURE__ */ e(V, { w: 180, h: 32 }) : /* @__PURE__ */ e(
|
|
3298
3302
|
Wa,
|
|
3299
3303
|
{
|
|
3300
3304
|
value: z > 0 ? zt : "0",
|
|
@@ -3303,11 +3307,11 @@ function rn({
|
|
|
3303
3307
|
style: { color: z > 0 ? "var(--t-text)" : "var(--t-text-muted)", fontSize: 24 }
|
|
3304
3308
|
}
|
|
3305
3309
|
),
|
|
3306
|
-
|
|
3310
|
+
F ? /* @__PURE__ */ o("div", { className: "flex flex-col items-end shrink-0", children: [
|
|
3307
3311
|
/* @__PURE__ */ o(
|
|
3308
3312
|
"button",
|
|
3309
3313
|
{
|
|
3310
|
-
onClick: () =>
|
|
3314
|
+
onClick: () => H("crypto"),
|
|
3311
3315
|
className: "flex items-center gap-1.5 transition-colors",
|
|
3312
3316
|
style: {
|
|
3313
3317
|
background: "var(--t-pill-bg)",
|
|
@@ -3316,32 +3320,32 @@ function rn({
|
|
|
3316
3320
|
paddingLeft: 10,
|
|
3317
3321
|
paddingRight: 10
|
|
3318
3322
|
},
|
|
3319
|
-
disabled: !!((Rt =
|
|
3323
|
+
disabled: !!((Rt = M == null ? void 0 : M.destinationCurrency) != null && Rt.locked),
|
|
3320
3324
|
children: [
|
|
3321
|
-
/* @__PURE__ */ e(Ht, { ticker:
|
|
3322
|
-
/* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color:
|
|
3323
|
-
/* @__PURE__ */ e(
|
|
3325
|
+
/* @__PURE__ */ e(Ht, { ticker: B, size: 16, baseUrl: G }),
|
|
3326
|
+
/* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: We }, children: B }),
|
|
3327
|
+
/* @__PURE__ */ e(He, {})
|
|
3324
3328
|
]
|
|
3325
3329
|
}
|
|
3326
3330
|
),
|
|
3327
|
-
|
|
3331
|
+
se && /* @__PURE__ */ o("div", { className: "flex items-center gap-1 mt-1.5 mr-0.5", children: [
|
|
3328
3332
|
/* @__PURE__ */ e("div", { className: "rounded-full", style: { width: 14, height: 14, background: "#ffffff" }, children: /* @__PURE__ */ e(
|
|
3329
3333
|
"img",
|
|
3330
3334
|
{
|
|
3331
|
-
src: it(
|
|
3332
|
-
alt:
|
|
3335
|
+
src: it(se, G),
|
|
3336
|
+
alt: se,
|
|
3333
3337
|
width: 14,
|
|
3334
3338
|
height: 14,
|
|
3335
3339
|
className: "rounded-full",
|
|
3336
3340
|
style: { width: 14, height: 14 }
|
|
3337
3341
|
}
|
|
3338
3342
|
) }),
|
|
3339
|
-
/* @__PURE__ */ e("span", { className: "text-[12px]", style: { color: "var(--t-text-secondary)" }, children:
|
|
3343
|
+
/* @__PURE__ */ e("span", { className: "text-[12px]", style: { color: "var(--t-text-secondary)" }, children: vt })
|
|
3340
3344
|
] })
|
|
3341
3345
|
] }) : /* @__PURE__ */ o(
|
|
3342
3346
|
"button",
|
|
3343
3347
|
{
|
|
3344
|
-
onClick: () =>
|
|
3348
|
+
onClick: () => H("fiat"),
|
|
3345
3349
|
className: "flex items-center gap-1.5 shrink-0 transition-colors",
|
|
3346
3350
|
style: {
|
|
3347
3351
|
background: "var(--t-pill-bg)",
|
|
@@ -3350,11 +3354,11 @@ function rn({
|
|
|
3350
3354
|
paddingLeft: 10,
|
|
3351
3355
|
paddingRight: 10
|
|
3352
3356
|
},
|
|
3353
|
-
disabled: !!((Tt =
|
|
3357
|
+
disabled: !!((Tt = M == null ? void 0 : M.sourceCurrency) != null && Tt.locked),
|
|
3354
3358
|
children: [
|
|
3355
|
-
/* @__PURE__ */ e(ct, { currencyCode:
|
|
3356
|
-
/* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color:
|
|
3357
|
-
/* @__PURE__ */ e(
|
|
3359
|
+
/* @__PURE__ */ e(ct, { currencyCode: W, size: 16, baseUrl: G }),
|
|
3360
|
+
/* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: We }, children: W }),
|
|
3361
|
+
/* @__PURE__ */ e(He, {})
|
|
3358
3362
|
]
|
|
3359
3363
|
}
|
|
3360
3364
|
)
|
|
@@ -3362,7 +3366,7 @@ function rn({
|
|
|
3362
3366
|
]
|
|
3363
3367
|
}
|
|
3364
3368
|
),
|
|
3365
|
-
|
|
3369
|
+
Ie && z > 0 && (b == null ? void 0 : b.bestQuote) && /* @__PURE__ */ o(
|
|
3366
3370
|
"div",
|
|
3367
3371
|
{
|
|
3368
3372
|
className: "flex items-start gap-2 mt-[2px] px-[14px] py-[10px]",
|
|
@@ -3376,11 +3380,11 @@ function rn({
|
|
|
3376
3380
|
"You will be charged for ",
|
|
3377
3381
|
ut,
|
|
3378
3382
|
" ",
|
|
3379
|
-
|
|
3383
|
+
B,
|
|
3380
3384
|
", the rest up to ",
|
|
3381
3385
|
lt(z),
|
|
3382
3386
|
" ",
|
|
3383
|
-
|
|
3387
|
+
W,
|
|
3384
3388
|
" will be credited to your ",
|
|
3385
3389
|
$,
|
|
3386
3390
|
" account"
|
|
@@ -3396,36 +3400,36 @@ function rn({
|
|
|
3396
3400
|
background: "var(--t-surface)",
|
|
3397
3401
|
...(kt = i == null ? void 0 : i.paymentMethods) != null && kt.length ? {} : { borderBottomLeftRadius: 5, borderBottomRightRadius: 5 }
|
|
3398
3402
|
},
|
|
3399
|
-
children: /* @__PURE__ */ e("span", { className: "text-[12px]", style: { color:
|
|
3403
|
+
children: /* @__PURE__ */ e("span", { className: "text-[12px]", style: { color: g ? "var(--t-success)" : "var(--t-text-secondary)" }, children: Jt || " " })
|
|
3400
3404
|
}
|
|
3401
3405
|
),
|
|
3402
3406
|
(i == null ? void 0 : i.paymentMethods) && i.paymentMethods.length > 0 && /* @__PURE__ */ e("div", { className: "mt-[2px]", children: /* @__PURE__ */ e(
|
|
3403
3407
|
Pa,
|
|
3404
3408
|
{
|
|
3405
3409
|
methods: i.paymentMethods,
|
|
3406
|
-
selectedId:
|
|
3407
|
-
onOpenModal: () =>
|
|
3408
|
-
fiatCurrency:
|
|
3410
|
+
selectedId: y.paymentMethodId,
|
|
3411
|
+
onOpenModal: () => H("payment"),
|
|
3412
|
+
fiatCurrency: y.fiatCurrency
|
|
3409
3413
|
}
|
|
3410
3414
|
) }),
|
|
3411
3415
|
/* @__PURE__ */ o("div", { className: "mt-8", children: [
|
|
3412
|
-
/* @__PURE__ */ e("div", { className: "text-[13px] mb-2.5", style: { color: "var(--t-text-secondary)" }, children:
|
|
3416
|
+
/* @__PURE__ */ e("div", { className: "text-[13px] mb-2.5", style: { color: "var(--t-text-secondary)" }, children: F ? "Receiving wallet address" : "Sending wallet address" }),
|
|
3413
3417
|
/* @__PURE__ */ e(
|
|
3414
3418
|
"input",
|
|
3415
3419
|
{
|
|
3416
3420
|
type: "text",
|
|
3417
|
-
value:
|
|
3418
|
-
onChange: (
|
|
3419
|
-
onFocus: () =>
|
|
3421
|
+
value: y.walletAddress,
|
|
3422
|
+
onChange: (x) => k({ type: "SET_WALLET_ADDRESS", address: x.target.value }),
|
|
3423
|
+
onFocus: () => _e(!0),
|
|
3420
3424
|
onBlur: () => {
|
|
3421
|
-
|
|
3425
|
+
_e(!1), Ke(!0);
|
|
3422
3426
|
},
|
|
3423
|
-
placeholder:
|
|
3427
|
+
placeholder: F ? "Enter your receiving address" : "Enter your sending address",
|
|
3424
3428
|
spellCheck: !1,
|
|
3425
3429
|
autoComplete: "off",
|
|
3426
3430
|
className: "w-full bg-transparent text-[13px] outline-none transition-colors",
|
|
3427
3431
|
style: {
|
|
3428
|
-
border:
|
|
3432
|
+
border: y.walletError || De && !tt ? "1px solid #EF4444" : ne ? "1px solid var(--t-border-focus)" : "1px solid var(--t-border)",
|
|
3429
3433
|
outline: "none",
|
|
3430
3434
|
boxShadow: "none",
|
|
3431
3435
|
borderRadius: 3.5,
|
|
@@ -3435,16 +3439,16 @@ function rn({
|
|
|
3435
3439
|
fontSize: 13,
|
|
3436
3440
|
backgroundColor: "transparent"
|
|
3437
3441
|
},
|
|
3438
|
-
disabled: !!((Lt =
|
|
3442
|
+
disabled: !!((Lt = M == null ? void 0 : M.destinationAddress) != null && Lt.locked)
|
|
3439
3443
|
}
|
|
3440
3444
|
),
|
|
3441
|
-
|
|
3445
|
+
y.walletError ? /* @__PURE__ */ e("div", { className: "text-[12px] mt-1.5", style: { color: "#EF4444" }, children: y.walletError }) : De && !tt && !ve ? /* @__PURE__ */ e("div", { className: "text-[12px] mt-1.5", style: { color: "#EF4444" }, children: "Enter a valid wallet address" }) : ve && y.walletAddress.trim().length >= 10 ? /* @__PURE__ */ e("div", { className: "text-[12px] mt-1.5", style: { color: "var(--t-text-muted)" }, children: "Validating address..." }) : null
|
|
3442
3446
|
] }),
|
|
3443
3447
|
/* @__PURE__ */ e("div", { className: "flex-1", style: { minHeight: 16 } }),
|
|
3444
3448
|
/* @__PURE__ */ e(
|
|
3445
3449
|
"button",
|
|
3446
3450
|
{
|
|
3447
|
-
disabled:
|
|
3451
|
+
disabled: !$e || oe || ce,
|
|
3448
3452
|
onClick: la,
|
|
3449
3453
|
className: "w-full font-semibold text-[16px] transition-all",
|
|
3450
3454
|
style: {
|
|
@@ -3452,92 +3456,92 @@ function rn({
|
|
|
3452
3456
|
borderRadius: 5,
|
|
3453
3457
|
background: "var(--t-cta-bg)",
|
|
3454
3458
|
color: "var(--t-cta-text)",
|
|
3455
|
-
opacity:
|
|
3456
|
-
cursor:
|
|
3459
|
+
opacity: $e && !oe && !ce ? 1 : 0.4,
|
|
3460
|
+
cursor: $e && !oe && !ce ? "pointer" : "not-allowed"
|
|
3457
3461
|
},
|
|
3458
|
-
children:
|
|
3462
|
+
children: ce ? "Getting best price..." : oe ? "Processing..." : F ? `Buy ${B}` : `Sell ${B}`
|
|
3459
3463
|
}
|
|
3460
3464
|
),
|
|
3461
3465
|
/* @__PURE__ */ e("div", { className: "text-center py-3", children: /* @__PURE__ */ e("span", { className: "text-[11px]", style: { color: "var(--t-text-tertiary)" }, children: "Powered by NowRamp" }) })
|
|
3462
|
-
] },
|
|
3463
|
-
/* @__PURE__ */ e(
|
|
3464
|
-
var
|
|
3466
|
+
] }, D),
|
|
3467
|
+
/* @__PURE__ */ e(Oe, { isOpen: ie === "fiat", onClose: () => H(null), children: (x) => {
|
|
3468
|
+
var N;
|
|
3465
3469
|
return /* @__PURE__ */ e(
|
|
3466
3470
|
Za,
|
|
3467
3471
|
{
|
|
3468
|
-
onClose:
|
|
3472
|
+
onClose: x,
|
|
3469
3473
|
onSelect: (T) => {
|
|
3470
|
-
ta(T),
|
|
3474
|
+
ta(T), x();
|
|
3471
3475
|
},
|
|
3472
|
-
currencies: (
|
|
3473
|
-
assetBaseUrl:
|
|
3474
|
-
selectedCode:
|
|
3476
|
+
currencies: (N = i == null ? void 0 : i.fiats) == null ? void 0 : N.map((T) => ({ code: T.code, name: T.code })),
|
|
3477
|
+
assetBaseUrl: G,
|
|
3478
|
+
selectedCode: y.fiatCurrency
|
|
3475
3479
|
}
|
|
3476
3480
|
);
|
|
3477
3481
|
} }),
|
|
3478
|
-
/* @__PURE__ */ e(
|
|
3479
|
-
var
|
|
3482
|
+
/* @__PURE__ */ e(Oe, { isOpen: ie === "crypto", onClose: () => H(null), children: (x) => {
|
|
3483
|
+
var N;
|
|
3480
3484
|
return /* @__PURE__ */ e(
|
|
3481
3485
|
Qa,
|
|
3482
3486
|
{
|
|
3483
|
-
onClose:
|
|
3484
|
-
onSelect: (T,
|
|
3485
|
-
aa(T,
|
|
3487
|
+
onClose: x,
|
|
3488
|
+
onSelect: (T, K) => {
|
|
3489
|
+
aa(T, K), x();
|
|
3486
3490
|
},
|
|
3487
|
-
cryptos: (
|
|
3488
|
-
var
|
|
3491
|
+
cryptos: (N = i == null ? void 0 : i.cryptos) == null ? void 0 : N.map((T) => {
|
|
3492
|
+
var K;
|
|
3489
3493
|
return {
|
|
3490
3494
|
code: T.code,
|
|
3491
3495
|
name: T.code,
|
|
3492
|
-
networks: (
|
|
3496
|
+
networks: (K = T.networks) == null ? void 0 : K.map((re) => ({ code: re.id, name: re.name }))
|
|
3493
3497
|
};
|
|
3494
3498
|
}),
|
|
3495
|
-
assetBaseUrl:
|
|
3496
|
-
selectedCode:
|
|
3497
|
-
selectedChain:
|
|
3499
|
+
assetBaseUrl: G,
|
|
3500
|
+
selectedCode: y.cryptoCurrency,
|
|
3501
|
+
selectedChain: y.network
|
|
3498
3502
|
}
|
|
3499
3503
|
);
|
|
3500
3504
|
} }),
|
|
3501
|
-
/* @__PURE__ */ e(
|
|
3502
|
-
var
|
|
3505
|
+
/* @__PURE__ */ e(Oe, { isOpen: ie === "payment", onClose: () => H(null), children: (x) => {
|
|
3506
|
+
var N;
|
|
3503
3507
|
return /* @__PURE__ */ e(
|
|
3504
3508
|
za,
|
|
3505
3509
|
{
|
|
3506
|
-
methods: ((
|
|
3507
|
-
selectedId:
|
|
3510
|
+
methods: ((N = i == null ? void 0 : i.paymentMethods) == null ? void 0 : N.filter((T) => T.supportedFiats.includes(y.fiatCurrency))) || [],
|
|
3511
|
+
selectedId: y.paymentMethodId,
|
|
3508
3512
|
onSelect: (T) => {
|
|
3509
|
-
na(T),
|
|
3513
|
+
na(T), x();
|
|
3510
3514
|
},
|
|
3511
|
-
onClose:
|
|
3515
|
+
onClose: x
|
|
3512
3516
|
}
|
|
3513
3517
|
);
|
|
3514
3518
|
} }),
|
|
3515
|
-
/* @__PURE__ */ e(
|
|
3519
|
+
/* @__PURE__ */ e(Oe, { isOpen: ie === "settings", onClose: () => H(null), children: (x) => /* @__PURE__ */ e(
|
|
3516
3520
|
en,
|
|
3517
3521
|
{
|
|
3518
|
-
onClose:
|
|
3519
|
-
darkMode:
|
|
3520
|
-
onToggleDarkMode:
|
|
3521
|
-
skinId:
|
|
3522
|
-
onSelectSkin: (
|
|
3523
|
-
|
|
3522
|
+
onClose: x,
|
|
3523
|
+
darkMode: X,
|
|
3524
|
+
onToggleDarkMode: fe,
|
|
3525
|
+
skinId: he,
|
|
3526
|
+
onSelectSkin: (N) => {
|
|
3527
|
+
Le(N);
|
|
3524
3528
|
},
|
|
3525
3529
|
showThemeToggle: R,
|
|
3526
|
-
country:
|
|
3530
|
+
country: y.country,
|
|
3527
3531
|
countryName: ia,
|
|
3528
3532
|
onLocationPress: oa,
|
|
3529
|
-
assetBaseUrl:
|
|
3533
|
+
assetBaseUrl: G
|
|
3530
3534
|
}
|
|
3531
3535
|
) }),
|
|
3532
|
-
/* @__PURE__ */ e(
|
|
3536
|
+
/* @__PURE__ */ e(Oe, { isOpen: ie === "country", onClose: () => H(null), children: (x) => /* @__PURE__ */ e(
|
|
3533
3537
|
an,
|
|
3534
3538
|
{
|
|
3535
|
-
onClose:
|
|
3536
|
-
onSelect: (
|
|
3537
|
-
ra(
|
|
3539
|
+
onClose: x,
|
|
3540
|
+
onSelect: (N) => {
|
|
3541
|
+
ra(N), x();
|
|
3538
3542
|
},
|
|
3539
|
-
assetBaseUrl:
|
|
3540
|
-
selectedCode:
|
|
3543
|
+
assetBaseUrl: G,
|
|
3544
|
+
selectedCode: y.country
|
|
3541
3545
|
}
|
|
3542
3546
|
) })
|
|
3543
3547
|
]
|
|
@@ -3558,35 +3562,35 @@ function on({
|
|
|
3558
3562
|
defaultCryptoAmount: h,
|
|
3559
3563
|
defaultWalletAddress: d,
|
|
3560
3564
|
defaultGateway: p,
|
|
3561
|
-
defaultCountry:
|
|
3565
|
+
defaultCountry: g,
|
|
3562
3566
|
fieldLocks: A,
|
|
3563
|
-
statusPollInterval:
|
|
3567
|
+
statusPollInterval: E,
|
|
3564
3568
|
onComplete: R,
|
|
3565
|
-
onError:
|
|
3566
|
-
className:
|
|
3569
|
+
onError: _,
|
|
3570
|
+
className: ae,
|
|
3567
3571
|
theme: j,
|
|
3568
|
-
skinId:
|
|
3572
|
+
skinId: Q,
|
|
3569
3573
|
accentColor: q,
|
|
3570
3574
|
bgColor: $,
|
|
3571
|
-
bgImage:
|
|
3572
|
-
borderColor:
|
|
3575
|
+
bgImage: xe,
|
|
3576
|
+
borderColor: y,
|
|
3573
3577
|
borderRadius: k,
|
|
3574
3578
|
surfaceColor: i,
|
|
3575
3579
|
inputBgColor: I,
|
|
3576
|
-
textColor:
|
|
3577
|
-
textSecondaryColor:
|
|
3578
|
-
textMutedColor:
|
|
3579
|
-
successColor:
|
|
3580
|
-
showFlowToggle:
|
|
3581
|
-
showSettings:
|
|
3582
|
-
showThemeToggle:
|
|
3583
|
-
autoRedirect:
|
|
3580
|
+
textColor: b,
|
|
3581
|
+
textSecondaryColor: S,
|
|
3582
|
+
textMutedColor: ge,
|
|
3583
|
+
successColor: Ce,
|
|
3584
|
+
showFlowToggle: Se,
|
|
3585
|
+
showSettings: oe,
|
|
3586
|
+
showThemeToggle: me,
|
|
3587
|
+
autoRedirect: M,
|
|
3584
3588
|
explorerUrl: ee,
|
|
3585
|
-
doneButtonText:
|
|
3586
|
-
supportEmail:
|
|
3587
|
-
stablecoinParity:
|
|
3588
|
-
partnerName:
|
|
3589
|
-
onDone:
|
|
3589
|
+
doneButtonText: G,
|
|
3590
|
+
supportEmail: X,
|
|
3591
|
+
stablecoinParity: fe,
|
|
3592
|
+
partnerName: he,
|
|
3593
|
+
onDone: Le
|
|
3590
3594
|
}) {
|
|
3591
3595
|
return /* @__PURE__ */ e(
|
|
3592
3596
|
Ca,
|
|
@@ -3604,38 +3608,38 @@ function on({
|
|
|
3604
3608
|
defaultCryptoAmount: h,
|
|
3605
3609
|
defaultWalletAddress: d,
|
|
3606
3610
|
defaultGateway: p,
|
|
3607
|
-
defaultCountry:
|
|
3611
|
+
defaultCountry: g,
|
|
3608
3612
|
fieldLocks: A,
|
|
3609
|
-
statusPollInterval:
|
|
3613
|
+
statusPollInterval: E,
|
|
3610
3614
|
onComplete: R,
|
|
3611
|
-
onError:
|
|
3615
|
+
onError: _,
|
|
3612
3616
|
children: /* @__PURE__ */ e(
|
|
3613
3617
|
rn,
|
|
3614
3618
|
{
|
|
3615
|
-
className:
|
|
3619
|
+
className: ae,
|
|
3616
3620
|
theme: j,
|
|
3617
|
-
skinId:
|
|
3621
|
+
skinId: Q,
|
|
3618
3622
|
accentColor: q,
|
|
3619
3623
|
bgColor: $,
|
|
3620
|
-
bgImage:
|
|
3621
|
-
borderColor:
|
|
3624
|
+
bgImage: xe,
|
|
3625
|
+
borderColor: y,
|
|
3622
3626
|
borderRadius: k,
|
|
3623
3627
|
surfaceColor: i,
|
|
3624
3628
|
inputBgColor: I,
|
|
3625
|
-
textColor:
|
|
3626
|
-
textSecondaryColor:
|
|
3627
|
-
textMutedColor:
|
|
3628
|
-
successColor:
|
|
3629
|
-
showFlowToggle:
|
|
3630
|
-
showSettings:
|
|
3631
|
-
showThemeToggle:
|
|
3632
|
-
autoRedirect:
|
|
3629
|
+
textColor: b,
|
|
3630
|
+
textSecondaryColor: S,
|
|
3631
|
+
textMutedColor: ge,
|
|
3632
|
+
successColor: Ce,
|
|
3633
|
+
showFlowToggle: Se,
|
|
3634
|
+
showSettings: oe,
|
|
3635
|
+
showThemeToggle: me,
|
|
3636
|
+
autoRedirect: M,
|
|
3633
3637
|
explorerUrl: ee,
|
|
3634
|
-
doneButtonText:
|
|
3635
|
-
supportEmail:
|
|
3636
|
-
stablecoinParity:
|
|
3637
|
-
partnerName:
|
|
3638
|
-
onDone:
|
|
3638
|
+
doneButtonText: G,
|
|
3639
|
+
supportEmail: X,
|
|
3640
|
+
stablecoinParity: fe,
|
|
3641
|
+
partnerName: he,
|
|
3642
|
+
onDone: Le
|
|
3639
3643
|
}
|
|
3640
3644
|
)
|
|
3641
3645
|
}
|
|
@@ -3734,13 +3738,13 @@ function gn({
|
|
|
3734
3738
|
quotesLoading: r,
|
|
3735
3739
|
cryptoCurrency: l
|
|
3736
3740
|
}) {
|
|
3737
|
-
const [c, m] =
|
|
3741
|
+
const [c, m] = v(""), s = Z(() => {
|
|
3738
3742
|
if (!(n != null && n.quotes)) return [];
|
|
3739
3743
|
const u = c.trim().toLowerCase();
|
|
3740
3744
|
return u ? n.quotes.filter((f) => f.gatewayName.toLowerCase().includes(u)) : n.quotes;
|
|
3741
3745
|
}, [n, c]);
|
|
3742
3746
|
return /* @__PURE__ */ o(J, { children: [
|
|
3743
|
-
/* @__PURE__ */ e("div", { className: "flex justify-end px-5 pt-5", children: /* @__PURE__ */ e(
|
|
3747
|
+
/* @__PURE__ */ e("div", { className: "flex justify-end px-5 pt-5", children: /* @__PURE__ */ e(ke, { onClick: t }) }),
|
|
3744
3748
|
/* @__PURE__ */ e(
|
|
3745
3749
|
"h2",
|
|
3746
3750
|
{
|
|
@@ -3749,7 +3753,7 @@ function gn({
|
|
|
3749
3753
|
children: "Choose Ramp"
|
|
3750
3754
|
}
|
|
3751
3755
|
),
|
|
3752
|
-
/* @__PURE__ */ e(
|
|
3756
|
+
/* @__PURE__ */ e(Pe, { value: c, onChange: m }),
|
|
3753
3757
|
/* @__PURE__ */ o("div", { className: "flex-1 overflow-y-auto custom-scroll px-5 space-y-2", children: [
|
|
3754
3758
|
r ? /* @__PURE__ */ e(sn, {}) : s.length === 0 ? /* @__PURE__ */ e("div", { className: "text-center py-10 text-[14px]", style: { color: "var(--t-text-muted)" }, children: n && n.quotes.length === 0 ? "No quotes available for this request" : "No providers found" }) : s.map((u, f) => {
|
|
3755
3759
|
const h = f === 0, d = parseFloat(u.cryptoAmount), p = d >= 1 ? d.toFixed(4) : d.toPrecision(6);
|
|
@@ -3804,19 +3808,19 @@ export {
|
|
|
3804
3808
|
Xa as AnimatedDigit,
|
|
3805
3809
|
Wa as AnimatedNumber,
|
|
3806
3810
|
Ta as ApplePayIcon,
|
|
3807
|
-
|
|
3811
|
+
Be as BLOCKCHAINS,
|
|
3808
3812
|
Aa as BankIcon,
|
|
3809
|
-
|
|
3813
|
+
Ze as COUNTRIES,
|
|
3810
3814
|
st as COUNTRY_MAP,
|
|
3811
3815
|
wa as CRYPTO_CHAIN_COMBOS,
|
|
3812
3816
|
Gt as CRYPTO_CURRENCIES,
|
|
3813
3817
|
Fa as CardIcon,
|
|
3814
3818
|
yn as CheckoutForm,
|
|
3815
3819
|
Ka as CheckoutStep,
|
|
3816
|
-
|
|
3820
|
+
He as ChevronDown,
|
|
3817
3821
|
Pt as ChevronRight,
|
|
3818
3822
|
gn as ChooseRampModal,
|
|
3819
|
-
|
|
3823
|
+
ke as CloseButton,
|
|
3820
3824
|
pn as CoinifyIcon,
|
|
3821
3825
|
ja as CompleteStep,
|
|
3822
3826
|
$a as ConfirmStep,
|
|
@@ -3826,7 +3830,7 @@ export {
|
|
|
3826
3830
|
Ia as DarkModeIcon,
|
|
3827
3831
|
Ga as ErrorStep,
|
|
3828
3832
|
Ft as FIAT_CURRENCIES,
|
|
3829
|
-
|
|
3833
|
+
va as FIAT_TO_COUNTRY,
|
|
3830
3834
|
Za as FiatCurrencyModal,
|
|
3831
3835
|
ct as FiatFlag,
|
|
3832
3836
|
Ya as FormSkeleton,
|
|
@@ -3834,7 +3838,7 @@ export {
|
|
|
3834
3838
|
ka as GooglePayIcon,
|
|
3835
3839
|
It as MOCK_RATES,
|
|
3836
3840
|
Ma as MenuIcon,
|
|
3837
|
-
|
|
3841
|
+
Oe as Modal,
|
|
3838
3842
|
La as PayPalIcon,
|
|
3839
3843
|
Pa as PaymentMethodSelector,
|
|
3840
3844
|
Va as ProcessingStep,
|
|
@@ -3842,7 +3846,7 @@ export {
|
|
|
3842
3846
|
Ca as RampProvider,
|
|
3843
3847
|
Ra as RevolutIcon,
|
|
3844
3848
|
Mt as SKINS,
|
|
3845
|
-
|
|
3849
|
+
Pe as SearchInput,
|
|
3846
3850
|
en as SettingsScreen,
|
|
3847
3851
|
V as Skeleton,
|
|
3848
3852
|
xn as SkinSwatch,
|
|
@@ -3858,7 +3862,7 @@ export {
|
|
|
3858
3862
|
Ea as parseAmount,
|
|
3859
3863
|
ya as useCheckoutIntent,
|
|
3860
3864
|
pa as useQuotes,
|
|
3861
|
-
|
|
3865
|
+
Te as useRamp,
|
|
3862
3866
|
ha as useRampConfig,
|
|
3863
3867
|
xa as useTransaction
|
|
3864
3868
|
};
|