@nowramp/form 0.1.64 → 0.1.65
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 +754 -748
- 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
|
@@ -8,24 +8,24 @@
|
|
|
8
8
|
}`;
|
|
9
9
|
document.head.appendChild(s);
|
|
10
10
|
})();
|
|
11
|
-
import { jsx as e, jsxs as r, Fragment as
|
|
12
|
-
import
|
|
13
|
-
import { RampApi as
|
|
14
|
-
import { createPortal as
|
|
15
|
-
function
|
|
16
|
-
const [a, o] =
|
|
17
|
-
(!d.current || d.current !== t) && (d.current = new
|
|
18
|
-
const p =
|
|
11
|
+
import { jsx as e, jsxs as r, Fragment as le } from "react/jsx-runtime";
|
|
12
|
+
import Xe, { useState as N, useRef as X, useCallback as O, useEffect as D, useMemo as G, useReducer as nn, useContext as an, createContext as rn } from "react";
|
|
13
|
+
import { RampApi as We } from "@nowramp/sdk";
|
|
14
|
+
import { createPortal as St } from "react-dom";
|
|
15
|
+
function on(t, n) {
|
|
16
|
+
const [a, o] = N(null), [l, i] = N(!0), [m, c] = N(null), d = X(null);
|
|
17
|
+
(!d.current || d.current !== t) && (d.current = new We({ apiKey: "", ...t }));
|
|
18
|
+
const p = O(async () => {
|
|
19
19
|
if (!t.projectId) {
|
|
20
|
-
|
|
20
|
+
c(new Error("projectId is required")), i(!1);
|
|
21
21
|
return;
|
|
22
22
|
}
|
|
23
|
-
i(!0),
|
|
23
|
+
i(!0), c(null);
|
|
24
24
|
try {
|
|
25
25
|
const h = await d.current.getSupported(n);
|
|
26
26
|
o(h);
|
|
27
27
|
} catch (h) {
|
|
28
|
-
|
|
28
|
+
c(h instanceof Error ? h : new Error("Failed to fetch config"));
|
|
29
29
|
} finally {
|
|
30
30
|
i(!1);
|
|
31
31
|
}
|
|
@@ -34,33 +34,33 @@ function en(t, n) {
|
|
|
34
34
|
p();
|
|
35
35
|
}, [p]), { config: a, loading: l, error: m, refetch: p };
|
|
36
36
|
}
|
|
37
|
-
function
|
|
38
|
-
const [a, o] =
|
|
39
|
-
(!d.current || p.current !== h) && (d.current = new
|
|
40
|
-
const u =
|
|
37
|
+
function ln(t, n) {
|
|
38
|
+
const [a, o] = N(null), [l, i] = N(!1), [m, c] = N(null), d = X(null), p = X(""), h = `${t.apiUrl}|${t.projectId}`;
|
|
39
|
+
(!d.current || p.current !== h) && (d.current = new We({ apiKey: "", ...t }), p.current = h);
|
|
40
|
+
const u = X(0);
|
|
41
41
|
D(() => {
|
|
42
|
-
const
|
|
42
|
+
const g = ++u.current;
|
|
43
43
|
if (!n || !t.projectId) {
|
|
44
44
|
o(null), i(!1);
|
|
45
45
|
return;
|
|
46
46
|
}
|
|
47
|
-
i(!0),
|
|
48
|
-
(
|
|
49
|
-
u.current ===
|
|
47
|
+
i(!0), c(null), d.current.getQuotes(n).then(
|
|
48
|
+
(w) => {
|
|
49
|
+
u.current === g && (o(w), i(!1));
|
|
50
50
|
},
|
|
51
|
-
(
|
|
52
|
-
u.current ===
|
|
51
|
+
(w) => {
|
|
52
|
+
u.current === g && (c(w instanceof Error ? w : new Error("Failed to fetch quotes")), o(null), i(!1));
|
|
53
53
|
}
|
|
54
54
|
);
|
|
55
55
|
}, [t.projectId, n == null ? void 0 : n.fiatCurrency, n == null ? void 0 : n.fiatAmount, n == null ? void 0 : n.cryptoAmount, n == null ? void 0 : n.cryptoCurrency, n == null ? void 0 : n.network, n == null ? void 0 : n.paymentMethodId, n == null ? void 0 : n.country, n == null ? void 0 : n.orderType]);
|
|
56
|
-
const f =
|
|
56
|
+
const f = O(async () => {
|
|
57
57
|
if (!(!n || !t.projectId)) {
|
|
58
|
-
i(!0),
|
|
58
|
+
i(!0), c(null);
|
|
59
59
|
try {
|
|
60
|
-
const
|
|
61
|
-
o(
|
|
62
|
-
} catch (
|
|
63
|
-
|
|
60
|
+
const g = await d.current.getQuotes(n);
|
|
61
|
+
o(g);
|
|
62
|
+
} catch (g) {
|
|
63
|
+
c(g instanceof Error ? g : new Error("Failed to fetch quotes"));
|
|
64
64
|
} finally {
|
|
65
65
|
i(!1);
|
|
66
66
|
}
|
|
@@ -68,29 +68,29 @@ function tn(t, n) {
|
|
|
68
68
|
}, [t.projectId, n]);
|
|
69
69
|
return { quotes: a, loading: l, error: m, refetch: f };
|
|
70
70
|
}
|
|
71
|
-
function
|
|
72
|
-
const [n, a] =
|
|
73
|
-
(!
|
|
74
|
-
const h =
|
|
71
|
+
function sn(t) {
|
|
72
|
+
const [n, a] = N(null), [o, l] = N(!1), [i, m] = N(null), c = X(null), d = X(""), p = `${t.apiUrl}|${t.projectId}`;
|
|
73
|
+
(!c.current || d.current !== p) && (c.current = new We({ apiKey: "", ...t }), d.current = p);
|
|
74
|
+
const h = O(async (f) => {
|
|
75
75
|
l(!0), m(null);
|
|
76
76
|
try {
|
|
77
|
-
const
|
|
78
|
-
return a(
|
|
79
|
-
} catch (
|
|
80
|
-
const
|
|
81
|
-
throw m(
|
|
77
|
+
const g = await c.current.createCheckoutIntent(f);
|
|
78
|
+
return a(g), g;
|
|
79
|
+
} catch (g) {
|
|
80
|
+
const w = g instanceof Error ? g : new Error("Failed to create checkout intent");
|
|
81
|
+
throw m(w), w;
|
|
82
82
|
} finally {
|
|
83
83
|
l(!1);
|
|
84
84
|
}
|
|
85
|
-
}, []), u =
|
|
85
|
+
}, []), u = O(() => {
|
|
86
86
|
a(null), m(null);
|
|
87
87
|
}, []);
|
|
88
88
|
return { order: n, loading: o, error: i, createOrder: h, reset: u };
|
|
89
89
|
}
|
|
90
|
-
function
|
|
91
|
-
const [o, l] =
|
|
92
|
-
p.current || (p.current = new
|
|
93
|
-
const h =
|
|
90
|
+
function cn(t, n, a) {
|
|
91
|
+
const [o, l] = N(null), [i, m] = N(!1), [c, d] = N(null), p = X(null);
|
|
92
|
+
p.current || (p.current = new We({ apiKey: "", projectId: "", ...t }));
|
|
93
|
+
const h = O(async () => {
|
|
94
94
|
if (n) {
|
|
95
95
|
m(!0), d(null);
|
|
96
96
|
try {
|
|
@@ -116,16 +116,16 @@ function an(t, n, a) {
|
|
|
116
116
|
return;
|
|
117
117
|
const f = setInterval(h, a.pollInterval);
|
|
118
118
|
return () => clearInterval(f);
|
|
119
|
-
}, [n, a == null ? void 0 : a.pollInterval, o == null ? void 0 : o.status, h]), { status: o, loading: i, error:
|
|
119
|
+
}, [n, a == null ? void 0 : a.pollInterval, o == null ? void 0 : o.status, h]), { status: o, loading: i, error: c, refetch: h };
|
|
120
120
|
}
|
|
121
|
-
function
|
|
121
|
+
function Rt(t, n) {
|
|
122
122
|
if (!t) return t;
|
|
123
123
|
const a = t.indexOf(".");
|
|
124
124
|
if (a === -1) return t;
|
|
125
125
|
let o = t;
|
|
126
126
|
return o.length - a - 1 > n && (o = o.slice(0, a + n + 1)), o = o.replace(/0+$/, "").replace(/\.$/, ""), o;
|
|
127
127
|
}
|
|
128
|
-
const
|
|
128
|
+
const Dt = {
|
|
129
129
|
step: "amount",
|
|
130
130
|
flowType: "buy",
|
|
131
131
|
fiatCurrency: "USD",
|
|
@@ -143,7 +143,7 @@ const Mt = {
|
|
|
143
143
|
country: "",
|
|
144
144
|
errorMessage: null
|
|
145
145
|
};
|
|
146
|
-
function
|
|
146
|
+
function dn(t, n) {
|
|
147
147
|
switch (n.type) {
|
|
148
148
|
case "SET_STEP":
|
|
149
149
|
return { ...t, step: n.step, errorMessage: null };
|
|
@@ -193,13 +193,13 @@ function rn(t, n) {
|
|
|
193
193
|
case "CLEAR_ERROR":
|
|
194
194
|
return { ...t, errorMessage: null };
|
|
195
195
|
case "RESET":
|
|
196
|
-
return
|
|
196
|
+
return Dt;
|
|
197
197
|
default:
|
|
198
198
|
return t;
|
|
199
199
|
}
|
|
200
200
|
}
|
|
201
|
-
const
|
|
202
|
-
function
|
|
201
|
+
const Pt = rn(null);
|
|
202
|
+
function un({
|
|
203
203
|
projectId: t,
|
|
204
204
|
apiUrl: n = "https://api.nowramp.com",
|
|
205
205
|
assetBaseUrl: a = "",
|
|
@@ -207,185 +207,185 @@ function on({
|
|
|
207
207
|
customerId: l = "",
|
|
208
208
|
brandId: i,
|
|
209
209
|
defaultFiatCurrency: m = "USD",
|
|
210
|
-
defaultCryptoCurrency:
|
|
210
|
+
defaultCryptoCurrency: c = "BTC",
|
|
211
211
|
defaultNetwork: d = "",
|
|
212
212
|
defaultFiatAmount: p = "",
|
|
213
213
|
defaultCryptoAmount: h = "",
|
|
214
214
|
defaultWalletAddress: u = "",
|
|
215
215
|
defaultGateway: f,
|
|
216
|
-
fieldLocks:
|
|
217
|
-
statusPollInterval:
|
|
218
|
-
onComplete:
|
|
216
|
+
fieldLocks: g,
|
|
217
|
+
statusPollInterval: w = 5e3,
|
|
218
|
+
onComplete: b,
|
|
219
219
|
onError: S,
|
|
220
220
|
children: P
|
|
221
221
|
}) {
|
|
222
|
-
const
|
|
223
|
-
...
|
|
224
|
-
step:
|
|
222
|
+
const $ = G(() => ({ apiUrl: n, projectId: t }), [n, t]), U = d || (c ? c.toLowerCase() : ""), Y = o === "sell", z = Y ? !!h : !!p, de = (Y ? !!(z && c && U) : !!(z && c && U && u)) && f ? "confirm" : "amount", y = p || (o === "buy" ? "250" : ""), [s, A] = nn(dn, {
|
|
223
|
+
...Dt,
|
|
224
|
+
step: de,
|
|
225
225
|
flowType: o,
|
|
226
226
|
fiatCurrency: m,
|
|
227
|
-
cryptoCurrency:
|
|
227
|
+
cryptoCurrency: c,
|
|
228
228
|
network: U,
|
|
229
|
-
fiatAmount:
|
|
230
|
-
cryptoAmount:
|
|
229
|
+
fiatAmount: Rt(y, 2),
|
|
230
|
+
cryptoAmount: Rt(h, 6),
|
|
231
231
|
walletAddress: u,
|
|
232
232
|
customerId: l
|
|
233
|
-
}),
|
|
234
|
-
config:
|
|
233
|
+
}), H = s.flowType === "sell", {
|
|
234
|
+
config: C,
|
|
235
235
|
loading: pe,
|
|
236
|
-
error:
|
|
237
|
-
} =
|
|
238
|
-
|
|
239
|
-
var
|
|
240
|
-
if (!
|
|
241
|
-
const
|
|
242
|
-
T != null && T.id &&
|
|
243
|
-
}, [
|
|
244
|
-
var
|
|
245
|
-
if (!((
|
|
246
|
-
const
|
|
247
|
-
if (
|
|
248
|
-
(
|
|
236
|
+
error: ie
|
|
237
|
+
} = on($, s.flowType);
|
|
238
|
+
Xe.useEffect(() => {
|
|
239
|
+
var J, K, L;
|
|
240
|
+
if (!C || !s.cryptoCurrency || s.network) return;
|
|
241
|
+
const v = (J = C.cryptos) == null ? void 0 : J.find((I) => I.code === s.cryptoCurrency), T = ((K = v == null ? void 0 : v.networks) == null ? void 0 : K.find((I) => I.isDefault)) || ((L = v == null ? void 0 : v.networks) == null ? void 0 : L[0]);
|
|
242
|
+
T != null && T.id && A({ type: "SET_NETWORK", network: T.id });
|
|
243
|
+
}, [C, s.cryptoCurrency, s.network]), Xe.useEffect(() => {
|
|
244
|
+
var L, I;
|
|
245
|
+
if (!((L = C == null ? void 0 : C.paymentMethods) != null && L.length)) return;
|
|
246
|
+
const v = s.fiatCurrency, T = C.paymentMethods;
|
|
247
|
+
if (s.paymentMethodId && T.some(
|
|
248
|
+
(De) => De.id === s.paymentMethodId && De.supportedFiats.includes(v)
|
|
249
249
|
))
|
|
250
250
|
return;
|
|
251
|
-
const
|
|
252
|
-
(
|
|
253
|
-
) || T.find((
|
|
254
|
-
|
|
255
|
-
}, [
|
|
256
|
-
const
|
|
257
|
-
if (
|
|
258
|
-
if (!
|
|
259
|
-
const
|
|
260
|
-
return isNaN(
|
|
251
|
+
const K = T.find(
|
|
252
|
+
(q) => q.supportedFiats.includes(v) && (q.id.includes("card") || q.id.includes("debit"))
|
|
253
|
+
) || T.find((q) => q.supportedFiats.includes(v));
|
|
254
|
+
A({ type: "SET_PAYMENT_METHOD", methodId: (K == null ? void 0 : K.id) || ((I = T[0]) == null ? void 0 : I.id) || "" });
|
|
255
|
+
}, [C, s.fiatCurrency, s.paymentMethodId]);
|
|
256
|
+
const ne = G(() => {
|
|
257
|
+
if (H) {
|
|
258
|
+
if (!s.cryptoAmount) return null;
|
|
259
|
+
const L = parseFloat(s.cryptoAmount);
|
|
260
|
+
return isNaN(L) || L <= 0 ? "Enter a valid amount" : null;
|
|
261
261
|
}
|
|
262
|
-
if (!
|
|
263
|
-
const
|
|
264
|
-
if (isNaN(
|
|
265
|
-
const T =
|
|
262
|
+
if (!C || !s.fiatAmount) return null;
|
|
263
|
+
const v = parseFloat(s.fiatAmount);
|
|
264
|
+
if (isNaN(v)) return null;
|
|
265
|
+
const T = C.fiats.find((L) => L.code === s.fiatCurrency);
|
|
266
266
|
if (!T) return null;
|
|
267
|
-
const
|
|
268
|
-
return !isNaN(
|
|
269
|
-
}, [
|
|
270
|
-
const
|
|
271
|
-
return !
|
|
272
|
-
fiatCurrency:
|
|
273
|
-
...
|
|
274
|
-
cryptoCurrency:
|
|
275
|
-
network:
|
|
276
|
-
paymentMethodId:
|
|
277
|
-
country:
|
|
278
|
-
orderType:
|
|
267
|
+
const J = parseFloat(T.minAmount), K = parseFloat(T.maxAmount);
|
|
268
|
+
return !isNaN(J) && v < J ? `Minimum amount is ${T.minAmount} ${s.fiatCurrency}` : !isNaN(K) && v > K ? `Maximum amount is ${T.maxAmount} ${s.fiatCurrency}` : null;
|
|
269
|
+
}, [C, s.fiatAmount, s.fiatCurrency, s.cryptoAmount, H]), ve = G(() => {
|
|
270
|
+
const v = H ? !!s.cryptoAmount : !!s.fiatAmount;
|
|
271
|
+
return !C || !v || !s.cryptoCurrency || !s.network || ne ? null : {
|
|
272
|
+
fiatCurrency: s.fiatCurrency,
|
|
273
|
+
...H ? { cryptoAmount: s.cryptoAmount } : { fiatAmount: s.fiatAmount },
|
|
274
|
+
cryptoCurrency: s.cryptoCurrency,
|
|
275
|
+
network: s.network,
|
|
276
|
+
paymentMethodId: s.paymentMethodId || void 0,
|
|
277
|
+
country: s.country || void 0,
|
|
278
|
+
orderType: s.flowType
|
|
279
279
|
};
|
|
280
|
-
}, [
|
|
281
|
-
quotes:
|
|
280
|
+
}, [C, s.fiatCurrency, s.fiatAmount, s.cryptoAmount, s.cryptoCurrency, s.network, s.paymentMethodId, s.country, ne, H, s.flowType]), {
|
|
281
|
+
quotes: ae,
|
|
282
282
|
loading: fe,
|
|
283
283
|
error: k,
|
|
284
|
-
refetch:
|
|
285
|
-
} =
|
|
284
|
+
refetch: be
|
|
285
|
+
} = ln($, ve), {
|
|
286
286
|
order: F,
|
|
287
|
-
loading:
|
|
288
|
-
error:
|
|
287
|
+
loading: re,
|
|
288
|
+
error: ue,
|
|
289
289
|
createOrder: ye
|
|
290
|
-
} =
|
|
291
|
-
status:
|
|
292
|
-
loading:
|
|
293
|
-
} =
|
|
290
|
+
} = sn($), Ye = 15e3, {
|
|
291
|
+
status: W,
|
|
292
|
+
loading: Z
|
|
293
|
+
} = cn(
|
|
294
294
|
{ apiUrl: n },
|
|
295
295
|
(F == null ? void 0 : F.orderId) ?? null,
|
|
296
|
-
{ pollInterval:
|
|
296
|
+
{ pollInterval: w, initialDelay: Ye }
|
|
297
297
|
);
|
|
298
|
-
|
|
299
|
-
(
|
|
300
|
-
}, [
|
|
301
|
-
const
|
|
302
|
-
|
|
303
|
-
}, [
|
|
304
|
-
const xe = f || (
|
|
305
|
-
|
|
306
|
-
const
|
|
307
|
-
|
|
308
|
-
const
|
|
309
|
-
|
|
310
|
-
const
|
|
311
|
-
var T,
|
|
312
|
-
const
|
|
313
|
-
if (!
|
|
314
|
-
const
|
|
315
|
-
|
|
298
|
+
Xe.useEffect(() => {
|
|
299
|
+
(W == null ? void 0 : W.status) === "completed" && b && b(W);
|
|
300
|
+
}, [W == null ? void 0 : W.status, b]), Xe.useEffect(() => {
|
|
301
|
+
const v = ie || ue;
|
|
302
|
+
v && S && S(v);
|
|
303
|
+
}, [ie, ue, S]);
|
|
304
|
+
const xe = f || (C == null ? void 0 : C.defaultGateway) || null, Re = X(xe);
|
|
305
|
+
Re.current = xe;
|
|
306
|
+
const Te = X(ae);
|
|
307
|
+
Te.current = ae;
|
|
308
|
+
const Ne = X(i);
|
|
309
|
+
Ne.current = i;
|
|
310
|
+
const Ze = O(async () => {
|
|
311
|
+
var T, J, K;
|
|
312
|
+
const v = ((T = s.selectedQuote) == null ? void 0 : T.gatewayId) || ((K = (J = Te.current) == null ? void 0 : J.bestQuote) == null ? void 0 : K.gatewayId) || Re.current;
|
|
313
|
+
if (!v || !s.walletAddress) {
|
|
314
|
+
const L = [!v && "gateway", !s.walletAddress && "walletAddress"].filter(Boolean).join(", ");
|
|
315
|
+
A({ type: "SET_ERROR", message: `Missing required fields: ${L}` });
|
|
316
316
|
return;
|
|
317
317
|
}
|
|
318
318
|
try {
|
|
319
319
|
await ye({
|
|
320
|
-
gateway:
|
|
321
|
-
customerId:
|
|
322
|
-
fiatCurrency:
|
|
323
|
-
...
|
|
324
|
-
cryptoCurrency:
|
|
325
|
-
network:
|
|
326
|
-
walletAddress:
|
|
327
|
-
paymentMethodId:
|
|
328
|
-
email:
|
|
329
|
-
orderType:
|
|
330
|
-
...
|
|
331
|
-
}),
|
|
332
|
-
} catch (
|
|
333
|
-
const
|
|
334
|
-
/wallet|address/i.test(
|
|
320
|
+
gateway: v,
|
|
321
|
+
customerId: s.customerId || void 0,
|
|
322
|
+
fiatCurrency: s.fiatCurrency,
|
|
323
|
+
...H ? { cryptoAmount: s.cryptoAmount } : { fiatAmount: s.fiatAmount },
|
|
324
|
+
cryptoCurrency: s.cryptoCurrency,
|
|
325
|
+
network: s.network,
|
|
326
|
+
walletAddress: s.walletAddress,
|
|
327
|
+
paymentMethodId: s.paymentMethodId || void 0,
|
|
328
|
+
email: s.email || void 0,
|
|
329
|
+
orderType: s.flowType,
|
|
330
|
+
...Ne.current ? { metadata: { brand: Ne.current } } : {}
|
|
331
|
+
}), A({ type: "SET_STEP", step: "checkout" });
|
|
332
|
+
} catch (L) {
|
|
333
|
+
const I = L instanceof Error ? L.message : "Failed to create order";
|
|
334
|
+
/wallet|address/i.test(I) ? A({ type: "SET_WALLET_ERROR", message: I.replace(/^Failed to create checkout intent:\s*/i, "") }) : A({ type: "SET_ERROR", message: I });
|
|
335
335
|
}
|
|
336
|
-
}, [
|
|
337
|
-
|
|
338
|
-
}, []),
|
|
339
|
-
const
|
|
340
|
-
T > 0 &&
|
|
341
|
-
}, [
|
|
342
|
-
const
|
|
343
|
-
switch (
|
|
336
|
+
}, [s, ye, H]), Oe = O((v) => {
|
|
337
|
+
A({ type: "SET_STEP", step: v });
|
|
338
|
+
}, []), ke = O(() => {
|
|
339
|
+
const v = ["confirm", "amount", "quotes", "wallet", "checkout", "processing", "complete"], T = v.indexOf(s.step);
|
|
340
|
+
T > 0 && A({ type: "SET_STEP", step: v[T - 1] });
|
|
341
|
+
}, [s.step, H]), He = G(() => {
|
|
342
|
+
const v = H ? !!s.cryptoAmount : !!s.fiatAmount;
|
|
343
|
+
switch (s.step) {
|
|
344
344
|
case "confirm":
|
|
345
|
-
return !!(
|
|
345
|
+
return !!(v && s.cryptoCurrency && s.network && s.walletAddress && !ne);
|
|
346
346
|
case "amount":
|
|
347
|
-
return !!(
|
|
347
|
+
return !!(v && s.cryptoCurrency && s.network && !ne);
|
|
348
348
|
case "quotes":
|
|
349
|
-
return !!
|
|
349
|
+
return !!s.selectedQuote;
|
|
350
350
|
case "wallet":
|
|
351
|
-
return !!
|
|
351
|
+
return !!s.walletAddress;
|
|
352
352
|
default:
|
|
353
353
|
return !1;
|
|
354
354
|
}
|
|
355
|
-
}, [
|
|
356
|
-
apiConfig:
|
|
355
|
+
}, [s, ne, H]), Qe = {
|
|
356
|
+
apiConfig: $,
|
|
357
357
|
assetBaseUrl: a,
|
|
358
|
-
config:
|
|
358
|
+
config: C,
|
|
359
359
|
configLoading: pe,
|
|
360
|
-
configError:
|
|
361
|
-
state:
|
|
362
|
-
dispatch:
|
|
363
|
-
quotes:
|
|
360
|
+
configError: ie,
|
|
361
|
+
state: s,
|
|
362
|
+
dispatch: A,
|
|
363
|
+
quotes: ae,
|
|
364
364
|
quotesLoading: fe,
|
|
365
365
|
quotesError: k,
|
|
366
|
-
fetchQuotes:
|
|
366
|
+
fetchQuotes: be,
|
|
367
367
|
order: F,
|
|
368
|
-
orderLoading:
|
|
369
|
-
orderError:
|
|
370
|
-
createOrder:
|
|
371
|
-
orderStatus:
|
|
372
|
-
orderStatusLoading:
|
|
373
|
-
fieldLocks:
|
|
368
|
+
orderLoading: re,
|
|
369
|
+
orderError: ue,
|
|
370
|
+
createOrder: Ze,
|
|
371
|
+
orderStatus: W,
|
|
372
|
+
orderStatusLoading: Z,
|
|
373
|
+
fieldLocks: g || null,
|
|
374
374
|
defaultGateway: xe,
|
|
375
|
-
amountError:
|
|
376
|
-
goToStep:
|
|
377
|
-
goBack:
|
|
378
|
-
canProceed:
|
|
375
|
+
amountError: ne,
|
|
376
|
+
goToStep: Oe,
|
|
377
|
+
goBack: ke,
|
|
378
|
+
canProceed: He
|
|
379
379
|
};
|
|
380
|
-
return /* @__PURE__ */ e(
|
|
380
|
+
return /* @__PURE__ */ e(Pt.Provider, { value: Qe, children: P });
|
|
381
381
|
}
|
|
382
|
-
function
|
|
383
|
-
const t =
|
|
382
|
+
function Se() {
|
|
383
|
+
const t = an(Pt);
|
|
384
384
|
if (!t)
|
|
385
385
|
throw new Error("useRamp must be used within a RampProvider");
|
|
386
386
|
return t;
|
|
387
387
|
}
|
|
388
|
-
const
|
|
388
|
+
const Ie = {
|
|
389
389
|
// Canonical IDs (returned by the API — lowercase full names)
|
|
390
390
|
// These cover cases where the canonical ID differs from the legacy uppercase key
|
|
391
391
|
ethereum: { name: "Ethereum (ERC20)", shortName: "Ethereum", icon: "eth" },
|
|
@@ -547,7 +547,7 @@ const Oe = {
|
|
|
547
547
|
OKC: { name: "OKX Chain", icon: "eth" },
|
|
548
548
|
UNI_CHAIN: { name: "UNI", icon: "uni" },
|
|
549
549
|
ZEC: { name: "ZCash", icon: "zec" }
|
|
550
|
-
},
|
|
550
|
+
}, Ut = [
|
|
551
551
|
// --- Popular / Top coins ---
|
|
552
552
|
{ code: "BTC", name: "Bitcoin", chains: ["BTC", "LN"], popular: !0 },
|
|
553
553
|
{ code: "ETH", name: "Ethereum", chains: ["ETH", "ARB", "BASE", "BSC", "OPTIMISM", "LINEA", "ZKSYNC", "LRC", "STARK", "APE", "ECLIPSE", "FUEL", "INK", "SOPHON", "UNICHAIN", "WLD"], popular: !0 },
|
|
@@ -740,9 +740,9 @@ const Oe = {
|
|
|
740
740
|
{ code: "ZCHF", name: "Frankencoin", chains: ["ETH"], popular: !1 },
|
|
741
741
|
{ code: "ZETA", name: "Zeta", chains: ["ETH", "ZETACHAIN"], popular: !1 },
|
|
742
742
|
{ code: "ZTG", name: "Zeitgeist", chains: ["ZTG"], popular: !1 }
|
|
743
|
-
],
|
|
744
|
-
|
|
745
|
-
),
|
|
743
|
+
], mn = Object.fromEntries(
|
|
744
|
+
Ut.map((t) => [t.code, t.name])
|
|
745
|
+
), hn = {
|
|
746
746
|
AED: "ae",
|
|
747
747
|
ALL: "al",
|
|
748
748
|
ARS: "ar",
|
|
@@ -777,21 +777,21 @@ const Oe = {
|
|
|
777
777
|
VND: "vn",
|
|
778
778
|
ZAR: "za"
|
|
779
779
|
};
|
|
780
|
-
function
|
|
780
|
+
function Ft(t, n = "") {
|
|
781
781
|
return `${n}/crypto-icons/${t.toLowerCase()}.svg`;
|
|
782
782
|
}
|
|
783
|
-
function
|
|
784
|
-
const a =
|
|
783
|
+
function pn(t, n = "") {
|
|
784
|
+
const a = hn[t] || "us";
|
|
785
785
|
return `${n}/flags/${a}.svg`;
|
|
786
786
|
}
|
|
787
|
-
function
|
|
788
|
-
return
|
|
787
|
+
function je(t) {
|
|
788
|
+
return Ie[t] || Ie[t.toLowerCase()] || Ie[t.toUpperCase()] || Ie[t.toUpperCase().replace(/-/g, "_")] || Ie[t.toLowerCase().replace(/-/g, "_")];
|
|
789
789
|
}
|
|
790
|
-
function
|
|
791
|
-
const a =
|
|
790
|
+
function at(t, n = "") {
|
|
791
|
+
const a = je(t);
|
|
792
792
|
return a ? `${n}/crypto-icons/${a.icon}.svg` : `${n}/crypto-icons/${t.toLowerCase()}.svg`;
|
|
793
793
|
}
|
|
794
|
-
const
|
|
794
|
+
const Tt = [
|
|
795
795
|
{ code: "ALL", name: "Albania Lek" },
|
|
796
796
|
{ code: "ARS", name: "Argentina Peso" },
|
|
797
797
|
{ code: "AUD", name: "Australian Dollar" },
|
|
@@ -804,14 +804,14 @@ const wt = [
|
|
|
804
804
|
{ code: "CHF", name: "Swiss Franc" },
|
|
805
805
|
{ code: "MXN", name: "Mexican Peso" },
|
|
806
806
|
{ code: "INR", name: "Indian Rupee" }
|
|
807
|
-
],
|
|
807
|
+
], kt = [
|
|
808
808
|
{ id: "blue", name: "Blue", accent: "#0077FF" },
|
|
809
809
|
{ id: "violet", name: "Violet", accent: "#7C3AED" },
|
|
810
810
|
{ id: "green", name: "Green", accent: "#10B981" },
|
|
811
811
|
{ id: "orange", name: "Orange", accent: "#F59E0B" },
|
|
812
812
|
{ id: "rose", name: "Rose", accent: "#F43F5E" },
|
|
813
813
|
{ id: "mono", name: "Mono", accent: null }
|
|
814
|
-
],
|
|
814
|
+
], Lt = {
|
|
815
815
|
USDC: { USD: 0.9962, EUR: 1.0814, GBP: 1.2573, JPY: 667e-5, CAD: 0.7198, AUD: 0.6384, BRL: 0.1726, CHF: 1.1306, MXN: 0.0487, INR: 0.01187, ARS: 855e-6, ALL: 0.01058 },
|
|
816
816
|
USDT: { USD: 0.9958, EUR: 1.081, GBP: 1.2568, JPY: 666e-5, CAD: 0.7194, AUD: 0.638, BRL: 0.1724, CHF: 1.1301, MXN: 0.0486, INR: 0.01186, ARS: 854e-6, ALL: 0.01057 },
|
|
817
817
|
BTC: { USD: 104e-7, EUR: 1129e-8, GBP: 1313e-8, JPY: 696e-10, CAD: 751e-8, AUD: 666e-8, BRL: 18e-7, CHF: 118e-7, MXN: 508e-9, INR: 124e-9, ARS: 892e-11, ALL: 11e-8 },
|
|
@@ -820,7 +820,7 @@ const wt = [
|
|
|
820
820
|
XRP: { USD: 0.4081, EUR: 0.4432, GBP: 0.5153, JPY: 273e-5, CAD: 0.2948, AUD: 0.2614, BRL: 0.0707, CHF: 0.463, MXN: 0.01992, INR: 486e-5, ARS: 35e-5, ALL: 433e-5 },
|
|
821
821
|
DOGE: { USD: 3.896, EUR: 4.232, GBP: 4.92, JPY: 0.02607, CAD: 2.815, AUD: 2.496, BRL: 0.675, CHF: 4.421, MXN: 0.1902, INR: 0.04641, ARS: 3345e-6, ALL: 0.04134 },
|
|
822
822
|
ADA: { USD: 1.333, EUR: 1.448, GBP: 1.683, JPY: 892e-5, CAD: 0.963, AUD: 0.854, BRL: 0.2309, CHF: 1.512, MXN: 0.0651, INR: 0.01588, ARS: 1145e-6, ALL: 0.01414 }
|
|
823
|
-
},
|
|
823
|
+
}, fn = /* @__PURE__ */ new Set([
|
|
824
824
|
"USDC",
|
|
825
825
|
"USDT",
|
|
826
826
|
"DAI",
|
|
@@ -847,17 +847,17 @@ const wt = [
|
|
|
847
847
|
"EURR",
|
|
848
848
|
"ZCHF"
|
|
849
849
|
]);
|
|
850
|
-
function
|
|
851
|
-
return
|
|
850
|
+
function Kt(t) {
|
|
851
|
+
return fn.has(t.toUpperCase());
|
|
852
852
|
}
|
|
853
|
-
function
|
|
853
|
+
function aa(t, n) {
|
|
854
854
|
var a, o;
|
|
855
|
-
return ((a =
|
|
855
|
+
return ((a = Lt[t]) == null ? void 0 : a[n]) ?? ((o = Lt.USDC) == null ? void 0 : o[n]) ?? 1;
|
|
856
856
|
}
|
|
857
|
-
function
|
|
857
|
+
function yn(t) {
|
|
858
858
|
return parseFloat(t.replace(/,/g, "")) || 0;
|
|
859
859
|
}
|
|
860
|
-
function
|
|
860
|
+
function rt(t) {
|
|
861
861
|
if (t === 0) return "0";
|
|
862
862
|
if (t >= 1e3) return t.toLocaleString("en-US", { maximumFractionDigits: 2 });
|
|
863
863
|
if (t >= 1) return t.toFixed(2);
|
|
@@ -865,39 +865,39 @@ function tt(t) {
|
|
|
865
865
|
const n = t.toPrecision(4);
|
|
866
866
|
return parseFloat(n).toString();
|
|
867
867
|
}
|
|
868
|
-
const ce = (t) => /^#([0-9A-Fa-f]{3}){1,2}$/.test(t),
|
|
868
|
+
const ce = (t) => /^#([0-9A-Fa-f]{3}){1,2}$/.test(t), It = 10, Mt = 1e-4, xn = (() => {
|
|
869
869
|
const t = [];
|
|
870
|
-
for (const n of
|
|
870
|
+
for (const n of Ut)
|
|
871
871
|
for (const a of n.chains)
|
|
872
872
|
t.push({ code: n.code, name: n.name, chain: a, popular: n.popular });
|
|
873
873
|
return t;
|
|
874
874
|
})();
|
|
875
|
-
function
|
|
875
|
+
function _t({
|
|
876
876
|
src: t,
|
|
877
877
|
alt: n,
|
|
878
878
|
size: a,
|
|
879
879
|
className: o = "",
|
|
880
880
|
background: l
|
|
881
881
|
}) {
|
|
882
|
-
const [i, m] =
|
|
882
|
+
const [i, m] = N(!1), [c, d] = N(!1);
|
|
883
883
|
D(() => {
|
|
884
884
|
m(!1), d(!1);
|
|
885
885
|
}, [t]);
|
|
886
|
-
const p =
|
|
886
|
+
const p = O(() => m(!0), []), h = O(() => d(!0), []);
|
|
887
887
|
return /* @__PURE__ */ r(
|
|
888
888
|
"div",
|
|
889
889
|
{
|
|
890
890
|
className: `relative rounded-full shrink-0 ${o}`,
|
|
891
891
|
style: { width: a, height: a, background: l },
|
|
892
892
|
children: [
|
|
893
|
-
!i && !
|
|
893
|
+
!i && !c && /* @__PURE__ */ e(
|
|
894
894
|
"div",
|
|
895
895
|
{
|
|
896
896
|
className: "absolute inset-0 rounded-full animate-pulse",
|
|
897
897
|
style: { background: "var(--t-pill-bg, #333)" }
|
|
898
898
|
}
|
|
899
899
|
),
|
|
900
|
-
|
|
900
|
+
c ? /* @__PURE__ */ e(
|
|
901
901
|
"div",
|
|
902
902
|
{
|
|
903
903
|
className: "absolute inset-0 rounded-full flex items-center justify-center font-bold",
|
|
@@ -926,34 +926,34 @@ function Pt({
|
|
|
926
926
|
}
|
|
927
927
|
);
|
|
928
928
|
}
|
|
929
|
-
function
|
|
929
|
+
function Bt({ ticker: t, size: n = 32, baseUrl: a = "" }) {
|
|
930
930
|
return /* @__PURE__ */ e(
|
|
931
|
-
|
|
931
|
+
_t,
|
|
932
932
|
{
|
|
933
|
-
src:
|
|
933
|
+
src: Ft(t, a),
|
|
934
934
|
alt: t,
|
|
935
935
|
size: n,
|
|
936
936
|
background: "#ffffff"
|
|
937
937
|
}
|
|
938
938
|
);
|
|
939
939
|
}
|
|
940
|
-
function
|
|
940
|
+
function ot({ currencyCode: t, size: n = 16, baseUrl: a = "" }) {
|
|
941
941
|
return /* @__PURE__ */ e(
|
|
942
|
-
|
|
942
|
+
_t,
|
|
943
943
|
{
|
|
944
|
-
src:
|
|
944
|
+
src: pn(t, a),
|
|
945
945
|
alt: t,
|
|
946
946
|
size: n
|
|
947
947
|
}
|
|
948
948
|
);
|
|
949
949
|
}
|
|
950
|
-
function
|
|
950
|
+
function lt({ size: t = 32, color: n = "#888" }) {
|
|
951
951
|
return /* @__PURE__ */ r("svg", { width: t, height: t, viewBox: "0 0 32 32", fill: "none", children: [
|
|
952
952
|
/* @__PURE__ */ e("circle", { cx: "16", cy: "16", r: "16", fill: n }),
|
|
953
953
|
/* @__PURE__ */ e("circle", { cx: "16", cy: "16", r: "8", stroke: "white", strokeWidth: "1.5", fill: "none" })
|
|
954
954
|
] });
|
|
955
955
|
}
|
|
956
|
-
function
|
|
956
|
+
function gn({ size: t = 24 }) {
|
|
957
957
|
return /* @__PURE__ */ e(
|
|
958
958
|
"div",
|
|
959
959
|
{
|
|
@@ -970,7 +970,7 @@ function hn({ size: t = 24 }) {
|
|
|
970
970
|
}
|
|
971
971
|
);
|
|
972
972
|
}
|
|
973
|
-
function
|
|
973
|
+
function Cn({ size: t = 32 }) {
|
|
974
974
|
return /* @__PURE__ */ e(
|
|
975
975
|
"div",
|
|
976
976
|
{
|
|
@@ -980,7 +980,7 @@ function pn({ size: t = 32 }) {
|
|
|
980
980
|
}
|
|
981
981
|
);
|
|
982
982
|
}
|
|
983
|
-
function
|
|
983
|
+
function vn({ size: t = 32 }) {
|
|
984
984
|
return /* @__PURE__ */ e(
|
|
985
985
|
"div",
|
|
986
986
|
{
|
|
@@ -996,7 +996,7 @@ function fn({ size: t = 32 }) {
|
|
|
996
996
|
}
|
|
997
997
|
);
|
|
998
998
|
}
|
|
999
|
-
function
|
|
999
|
+
function bn({ size: t = 32 }) {
|
|
1000
1000
|
return /* @__PURE__ */ e(
|
|
1001
1001
|
"div",
|
|
1002
1002
|
{
|
|
@@ -1011,7 +1011,7 @@ function yn({ size: t = 32 }) {
|
|
|
1011
1011
|
}
|
|
1012
1012
|
);
|
|
1013
1013
|
}
|
|
1014
|
-
function
|
|
1014
|
+
function Nn({ size: t = 32 }) {
|
|
1015
1015
|
return /* @__PURE__ */ e(
|
|
1016
1016
|
"div",
|
|
1017
1017
|
{
|
|
@@ -1021,7 +1021,7 @@ function xn({ size: t = 32 }) {
|
|
|
1021
1021
|
}
|
|
1022
1022
|
);
|
|
1023
1023
|
}
|
|
1024
|
-
function
|
|
1024
|
+
function En({ size: t = 32 }) {
|
|
1025
1025
|
return /* @__PURE__ */ e(
|
|
1026
1026
|
"div",
|
|
1027
1027
|
{
|
|
@@ -1037,7 +1037,7 @@ function Cn({ size: t = 32 }) {
|
|
|
1037
1037
|
}
|
|
1038
1038
|
);
|
|
1039
1039
|
}
|
|
1040
|
-
function
|
|
1040
|
+
function wn({ size: t = 32 }) {
|
|
1041
1041
|
const n = t * 0.8;
|
|
1042
1042
|
return /* @__PURE__ */ e(
|
|
1043
1043
|
"div",
|
|
@@ -1052,7 +1052,7 @@ function gn({ size: t = 32 }) {
|
|
|
1052
1052
|
}
|
|
1053
1053
|
);
|
|
1054
1054
|
}
|
|
1055
|
-
function
|
|
1055
|
+
function An({ size: t = 32 }) {
|
|
1056
1056
|
const n = t * 0.56, a = n * 0.65, o = Math.max(2, n * 0.1), l = n * 0.2;
|
|
1057
1057
|
return /* @__PURE__ */ r("div", { className: "flex items-center justify-center shrink-0", style: { width: t, height: t }, children: [
|
|
1058
1058
|
/* @__PURE__ */ e(
|
|
@@ -1103,7 +1103,7 @@ function vn({ size: t = 32 }) {
|
|
|
1103
1103
|
)
|
|
1104
1104
|
] });
|
|
1105
1105
|
}
|
|
1106
|
-
function
|
|
1106
|
+
function ra({ size: t = 18 }) {
|
|
1107
1107
|
return /* @__PURE__ */ e(
|
|
1108
1108
|
"div",
|
|
1109
1109
|
{
|
|
@@ -1113,13 +1113,13 @@ function ea({ size: t = 18 }) {
|
|
|
1113
1113
|
}
|
|
1114
1114
|
);
|
|
1115
1115
|
}
|
|
1116
|
-
function
|
|
1116
|
+
function Me() {
|
|
1117
1117
|
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" }) });
|
|
1118
1118
|
}
|
|
1119
|
-
function
|
|
1119
|
+
function Sn() {
|
|
1120
1120
|
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" }) });
|
|
1121
1121
|
}
|
|
1122
|
-
function
|
|
1122
|
+
function Rn({ onClick: t }) {
|
|
1123
1123
|
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(
|
|
1124
1124
|
"path",
|
|
1125
1125
|
{
|
|
@@ -1128,7 +1128,7 @@ function Nn({ onClick: t }) {
|
|
|
1128
1128
|
}
|
|
1129
1129
|
) }) });
|
|
1130
1130
|
}
|
|
1131
|
-
function
|
|
1131
|
+
function Tn({ size: t = 40 }) {
|
|
1132
1132
|
return /* @__PURE__ */ e(
|
|
1133
1133
|
"div",
|
|
1134
1134
|
{
|
|
@@ -1141,29 +1141,29 @@ function En({ size: t = 40 }) {
|
|
|
1141
1141
|
}
|
|
1142
1142
|
);
|
|
1143
1143
|
}
|
|
1144
|
-
function
|
|
1144
|
+
function kn(t, n = 32) {
|
|
1145
1145
|
switch (t) {
|
|
1146
1146
|
case "revolut":
|
|
1147
|
-
return /* @__PURE__ */ e(
|
|
1147
|
+
return /* @__PURE__ */ e(Cn, { size: n });
|
|
1148
1148
|
case "applepay":
|
|
1149
|
-
return /* @__PURE__ */ e(fn, { size: n });
|
|
1150
|
-
case "card":
|
|
1151
1149
|
return /* @__PURE__ */ e(vn, { size: n });
|
|
1150
|
+
case "card":
|
|
1151
|
+
return /* @__PURE__ */ e(An, { size: n });
|
|
1152
1152
|
case "googlepay":
|
|
1153
|
-
return /* @__PURE__ */ e(
|
|
1153
|
+
return /* @__PURE__ */ e(bn, { size: n });
|
|
1154
1154
|
case "paypal":
|
|
1155
|
-
return /* @__PURE__ */ e(
|
|
1155
|
+
return /* @__PURE__ */ e(Nn, { size: n });
|
|
1156
1156
|
case "bank":
|
|
1157
|
-
return /* @__PURE__ */ e(
|
|
1157
|
+
return /* @__PURE__ */ e(gn, { size: n });
|
|
1158
1158
|
case "visa":
|
|
1159
|
-
return /* @__PURE__ */ e(
|
|
1159
|
+
return /* @__PURE__ */ e(En, { size: n });
|
|
1160
1160
|
case "mastercard":
|
|
1161
|
-
return /* @__PURE__ */ e(
|
|
1161
|
+
return /* @__PURE__ */ e(wn, { size: n });
|
|
1162
1162
|
default:
|
|
1163
|
-
return /* @__PURE__ */ e(
|
|
1163
|
+
return /* @__PURE__ */ e(lt, { size: n });
|
|
1164
1164
|
}
|
|
1165
1165
|
}
|
|
1166
|
-
const
|
|
1166
|
+
const Ln = {
|
|
1167
1167
|
"debit-credit-card": "card",
|
|
1168
1168
|
"bank-transfer": "bank",
|
|
1169
1169
|
"ach-bank-transfer": "bank",
|
|
@@ -1174,7 +1174,7 @@ const An = {
|
|
|
1174
1174
|
"google-pay": "googlepay",
|
|
1175
1175
|
paypal: "paypal",
|
|
1176
1176
|
revolut: "revolut"
|
|
1177
|
-
},
|
|
1177
|
+
}, In = {
|
|
1178
1178
|
"debit-credit-card": "Card",
|
|
1179
1179
|
"bank-transfer": "Bank Transfer",
|
|
1180
1180
|
"ach-bank-transfer": "ACH",
|
|
@@ -1184,20 +1184,20 @@ const An = {
|
|
|
1184
1184
|
paypal: "PayPal",
|
|
1185
1185
|
revolut: "Revolut"
|
|
1186
1186
|
};
|
|
1187
|
-
function
|
|
1188
|
-
return
|
|
1187
|
+
function Vt(t, n) {
|
|
1188
|
+
return In[t] || n;
|
|
1189
1189
|
}
|
|
1190
|
-
function
|
|
1191
|
-
const o =
|
|
1192
|
-
return o ?
|
|
1190
|
+
function Xt(t, n, a = 24) {
|
|
1191
|
+
const o = Ln[t];
|
|
1192
|
+
return o ? kn(o, a) : n ? /* @__PURE__ */ e("img", { src: n, alt: "", width: a, height: a, style: { borderRadius: "50%" } }) : /* @__PURE__ */ e(lt, { size: a });
|
|
1193
1193
|
}
|
|
1194
|
-
function
|
|
1194
|
+
function Mn({
|
|
1195
1195
|
methods: t,
|
|
1196
1196
|
selectedId: n,
|
|
1197
1197
|
onOpenModal: a,
|
|
1198
1198
|
fiatCurrency: o
|
|
1199
1199
|
}) {
|
|
1200
|
-
const l =
|
|
1200
|
+
const l = G(
|
|
1201
1201
|
() => t.filter((m) => m.supportedFiats.includes(o)),
|
|
1202
1202
|
[t, o]
|
|
1203
1203
|
), i = l.find((m) => m.id === n) || l[0];
|
|
@@ -1215,7 +1215,7 @@ function Rn({
|
|
|
1215
1215
|
o
|
|
1216
1216
|
] })
|
|
1217
1217
|
}
|
|
1218
|
-
) : /* @__PURE__ */ e(
|
|
1218
|
+
) : /* @__PURE__ */ e(le, { children: /* @__PURE__ */ r(
|
|
1219
1219
|
"div",
|
|
1220
1220
|
{
|
|
1221
1221
|
role: "button",
|
|
@@ -1235,31 +1235,31 @@ function Rn({
|
|
|
1235
1235
|
children: [
|
|
1236
1236
|
/* @__PURE__ */ e("span", { className: "text-[12px]", style: { color: "var(--t-text-secondary)" }, children: "Payment method" }),
|
|
1237
1237
|
/* @__PURE__ */ r("span", { className: "flex items-center gap-2", children: [
|
|
1238
|
-
/* @__PURE__ */ e("span", { className: "flex items-center justify-center", style: { width: 20, height: 20 }, children: i &&
|
|
1239
|
-
/* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: "var(--t-text)" }, children: i ?
|
|
1240
|
-
/* @__PURE__ */ e(
|
|
1238
|
+
/* @__PURE__ */ e("span", { className: "flex items-center justify-center", style: { width: 20, height: 20 }, children: i && Xt(i.id, i.icon, 20) }),
|
|
1239
|
+
/* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: "var(--t-text)" }, children: i ? Vt(i.id, i.name) : "Select" }),
|
|
1240
|
+
/* @__PURE__ */ e(Me, {})
|
|
1241
1241
|
] })
|
|
1242
1242
|
]
|
|
1243
1243
|
}
|
|
1244
1244
|
) });
|
|
1245
1245
|
}
|
|
1246
|
-
function
|
|
1246
|
+
function Bn({
|
|
1247
1247
|
className: t = "",
|
|
1248
1248
|
autoRedirect: n = !1,
|
|
1249
1249
|
redirectDelay: a = 3e3
|
|
1250
1250
|
}) {
|
|
1251
1251
|
var f;
|
|
1252
|
-
const { order: o, orderStatus: l, goToStep: i, goBack: m } =
|
|
1252
|
+
const { order: o, orderStatus: l, goToStep: i, goBack: m } = Se(), [c, d] = N(!1), [p, h] = N(null), u = o != null && o.checkout.expiresAt ? Date.now() > o.checkout.expiresAt : !1;
|
|
1253
1253
|
if (D(() => {
|
|
1254
1254
|
if ((o == null ? void 0 : o.checkout.method) === "redirect" && n && !u) {
|
|
1255
1255
|
h(Math.ceil(a / 1e3));
|
|
1256
|
-
const
|
|
1256
|
+
const g = setTimeout(() => {
|
|
1257
1257
|
window.location.href = o.checkout.url;
|
|
1258
|
-
}, a),
|
|
1259
|
-
h((
|
|
1258
|
+
}, a), w = setInterval(() => {
|
|
1259
|
+
h((b) => b && b > 1 ? b - 1 : null);
|
|
1260
1260
|
}, 1e3);
|
|
1261
1261
|
return () => {
|
|
1262
|
-
clearTimeout(
|
|
1262
|
+
clearTimeout(g), clearInterval(w);
|
|
1263
1263
|
};
|
|
1264
1264
|
}
|
|
1265
1265
|
}, [o, n, a, u]), D(() => {
|
|
@@ -1318,8 +1318,8 @@ function Tn({
|
|
|
1318
1318
|
}
|
|
1319
1319
|
);
|
|
1320
1320
|
if (o.checkout.method === "iframe") {
|
|
1321
|
-
const
|
|
1322
|
-
return
|
|
1321
|
+
const g = o.checkout.url, w = ((f = o.checkout.allowedFeatures) == null ? void 0 : f.join("; ")) || "payment; camera; microphone; geolocation; clipboard-read; clipboard-write; accelerometer; gyroscope; magnetometer; fullscreen; autoplay; encrypted-media; web-share";
|
|
1322
|
+
return St(
|
|
1323
1323
|
/* @__PURE__ */ r(
|
|
1324
1324
|
"div",
|
|
1325
1325
|
{
|
|
@@ -1370,7 +1370,7 @@ function Tn({
|
|
|
1370
1370
|
}
|
|
1371
1371
|
),
|
|
1372
1372
|
/* @__PURE__ */ r("div", { style: { flex: 1, position: "relative", overflow: "hidden" }, children: [
|
|
1373
|
-
!
|
|
1373
|
+
!c && /* @__PURE__ */ r(
|
|
1374
1374
|
"div",
|
|
1375
1375
|
{
|
|
1376
1376
|
style: {
|
|
@@ -1390,14 +1390,14 @@ function Tn({
|
|
|
1390
1390
|
/* @__PURE__ */ e(
|
|
1391
1391
|
"iframe",
|
|
1392
1392
|
{
|
|
1393
|
-
src:
|
|
1393
|
+
src: g,
|
|
1394
1394
|
style: {
|
|
1395
|
-
display:
|
|
1395
|
+
display: c ? "block" : "none",
|
|
1396
1396
|
width: "100%",
|
|
1397
1397
|
height: "100%",
|
|
1398
1398
|
border: "none"
|
|
1399
1399
|
},
|
|
1400
|
-
allow:
|
|
1400
|
+
allow: w,
|
|
1401
1401
|
onLoad: () => d(!0),
|
|
1402
1402
|
title: "Provider Checkout"
|
|
1403
1403
|
}
|
|
@@ -1466,8 +1466,8 @@ function Tn({
|
|
|
1466
1466
|
}
|
|
1467
1467
|
);
|
|
1468
1468
|
if (o.checkout.method === "widget" && o.widgetConfig) {
|
|
1469
|
-
const
|
|
1470
|
-
return
|
|
1469
|
+
const g = On(o.checkout.url, o.widgetConfig);
|
|
1470
|
+
return St(
|
|
1471
1471
|
/* @__PURE__ */ r(
|
|
1472
1472
|
"div",
|
|
1473
1473
|
{
|
|
@@ -1518,7 +1518,7 @@ function Tn({
|
|
|
1518
1518
|
}
|
|
1519
1519
|
),
|
|
1520
1520
|
/* @__PURE__ */ r("div", { style: { flex: 1, position: "relative", overflow: "hidden" }, children: [
|
|
1521
|
-
!
|
|
1521
|
+
!c && /* @__PURE__ */ r(
|
|
1522
1522
|
"div",
|
|
1523
1523
|
{
|
|
1524
1524
|
style: {
|
|
@@ -1538,9 +1538,9 @@ function Tn({
|
|
|
1538
1538
|
/* @__PURE__ */ e(
|
|
1539
1539
|
"iframe",
|
|
1540
1540
|
{
|
|
1541
|
-
src:
|
|
1541
|
+
src: g,
|
|
1542
1542
|
style: {
|
|
1543
|
-
display:
|
|
1543
|
+
display: c ? "block" : "none",
|
|
1544
1544
|
width: "100%",
|
|
1545
1545
|
height: "100%",
|
|
1546
1546
|
border: "none"
|
|
@@ -1584,14 +1584,14 @@ function Tn({
|
|
|
1584
1584
|
}
|
|
1585
1585
|
);
|
|
1586
1586
|
}
|
|
1587
|
-
function
|
|
1587
|
+
function On(t, n) {
|
|
1588
1588
|
const a = new URL("/en/partner/widget", t);
|
|
1589
1589
|
for (const [o, l] of Object.entries(n))
|
|
1590
1590
|
l != null && l !== "" && a.searchParams.set(o, String(l));
|
|
1591
1591
|
return a.toString();
|
|
1592
1592
|
}
|
|
1593
|
-
function
|
|
1594
|
-
const { orderStatus: n, orderStatusLoading: a, goToStep: o } =
|
|
1593
|
+
function Hn({ className: t = "" }) {
|
|
1594
|
+
const { orderStatus: n, orderStatusLoading: a, goToStep: o } = Se();
|
|
1595
1595
|
D(() => {
|
|
1596
1596
|
n && (n.status === "completed" ? o("complete") : ["failed", "cancelled", "expired", "refunded"].includes(n.status) && o("error"));
|
|
1597
1597
|
}, [n == null ? void 0 : n.status, o]);
|
|
@@ -1611,25 +1611,25 @@ function Ln({ className: t = "" }) {
|
|
|
1611
1611
|
/* @__PURE__ */ e("h2", { className: "text-[20px] font-semibold mb-3", style: { color: "var(--t-text)" }, children: l() }),
|
|
1612
1612
|
a && /* @__PURE__ */ e("p", { className: "text-[13px] mb-4", style: { color: "var(--t-text-muted)" }, children: "Checking status..." }),
|
|
1613
1613
|
n && /* @__PURE__ */ r("div", { className: "w-full mt-6 text-left", style: { background: "var(--t-surface)", borderRadius: 5, padding: 16 }, children: [
|
|
1614
|
-
/* @__PURE__ */ e(
|
|
1615
|
-
/* @__PURE__ */ e(
|
|
1614
|
+
/* @__PURE__ */ e(Ae, { label: "Order ID", value: n.orderId, mono: !0 }),
|
|
1615
|
+
/* @__PURE__ */ e(Ae, { label: "Provider", value: n.gateway }),
|
|
1616
1616
|
/* @__PURE__ */ e(
|
|
1617
|
-
|
|
1617
|
+
Ae,
|
|
1618
1618
|
{
|
|
1619
1619
|
label: "Amount",
|
|
1620
1620
|
value: `${n.fiatAmount} ${n.fiatCurrency}`
|
|
1621
1621
|
}
|
|
1622
1622
|
),
|
|
1623
1623
|
/* @__PURE__ */ e(
|
|
1624
|
-
|
|
1624
|
+
Ae,
|
|
1625
1625
|
{
|
|
1626
1626
|
label: "Receiving",
|
|
1627
1627
|
value: `${n.cryptoAmount || "..."} ${n.cryptoCurrency}`
|
|
1628
1628
|
}
|
|
1629
1629
|
),
|
|
1630
|
-
/* @__PURE__ */ e(
|
|
1630
|
+
/* @__PURE__ */ e(Ae, { label: "Network", value: n.network }),
|
|
1631
1631
|
/* @__PURE__ */ e(
|
|
1632
|
-
|
|
1632
|
+
Ae,
|
|
1633
1633
|
{
|
|
1634
1634
|
label: "To Address",
|
|
1635
1635
|
value: `${n.walletAddress.slice(0, 10)}...${n.walletAddress.slice(-8)}`,
|
|
@@ -1643,7 +1643,7 @@ function Ln({ className: t = "" }) {
|
|
|
1643
1643
|
] })
|
|
1644
1644
|
] });
|
|
1645
1645
|
}
|
|
1646
|
-
function
|
|
1646
|
+
function Ae({ label: t, value: n, mono: a }) {
|
|
1647
1647
|
return /* @__PURE__ */ r(
|
|
1648
1648
|
"div",
|
|
1649
1649
|
{
|
|
@@ -1663,13 +1663,13 @@ function Re({ label: t, value: n, mono: a }) {
|
|
|
1663
1663
|
}
|
|
1664
1664
|
);
|
|
1665
1665
|
}
|
|
1666
|
-
function
|
|
1666
|
+
function Dn({
|
|
1667
1667
|
className: t = "",
|
|
1668
1668
|
explorerUrl: n,
|
|
1669
1669
|
onDone: a,
|
|
1670
1670
|
doneButtonText: o = "Done"
|
|
1671
1671
|
}) {
|
|
1672
|
-
const { orderStatus: l, state: i, dispatch: m } =
|
|
1672
|
+
const { orderStatus: l, state: i, dispatch: m } = Se(), c = i.flowType === "sell", d = () => {
|
|
1673
1673
|
if (!(l != null && l.transactionHash)) return null;
|
|
1674
1674
|
if (!n) {
|
|
1675
1675
|
const u = {
|
|
@@ -1698,13 +1698,13 @@ function In({
|
|
|
1698
1698
|
children: /* @__PURE__ */ e("svg", { viewBox: "0 0 24 24", width: "32", height: "32", fill: "white", children: /* @__PURE__ */ e("path", { d: "M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41L9 16.17z" }) })
|
|
1699
1699
|
}
|
|
1700
1700
|
),
|
|
1701
|
-
/* @__PURE__ */ e("h2", { className: "text-[20px] font-semibold mb-2", style: { color: "var(--t-text)" }, children:
|
|
1702
|
-
/* @__PURE__ */ e("p", { className: "text-[14px] mb-6", style: { color: "var(--t-text-secondary)" }, children:
|
|
1701
|
+
/* @__PURE__ */ e("h2", { className: "text-[20px] font-semibold mb-2", style: { color: "var(--t-text)" }, children: c ? "Sale Complete!" : "Purchase Complete!" }),
|
|
1702
|
+
/* @__PURE__ */ e("p", { className: "text-[14px] mb-6", style: { color: "var(--t-text-secondary)" }, children: c ? `Your ${(l == null ? void 0 : l.fiatCurrency) || i.fiatCurrency} payout is being processed.` : `Your ${(l == null ? void 0 : l.cryptoCurrency) || i.cryptoCurrency} has been sent to your wallet.` }),
|
|
1703
1703
|
l && /* @__PURE__ */ r("div", { className: "w-full text-left mb-6", style: { background: "var(--t-surface)", borderRadius: 5, padding: 16 }, children: [
|
|
1704
1704
|
/* @__PURE__ */ e(
|
|
1705
1705
|
he,
|
|
1706
1706
|
{
|
|
1707
|
-
label:
|
|
1707
|
+
label: c ? "Amount Sold" : "Amount Received",
|
|
1708
1708
|
value: `${l.cryptoAmount} ${l.cryptoCurrency}`,
|
|
1709
1709
|
highlight: !0
|
|
1710
1710
|
}
|
|
@@ -1712,7 +1712,7 @@ function In({
|
|
|
1712
1712
|
/* @__PURE__ */ e(
|
|
1713
1713
|
he,
|
|
1714
1714
|
{
|
|
1715
|
-
label:
|
|
1715
|
+
label: c ? "Payout Amount" : "Amount Paid",
|
|
1716
1716
|
value: `${l.fiatAmount} ${l.fiatCurrency}`
|
|
1717
1717
|
}
|
|
1718
1718
|
),
|
|
@@ -1787,12 +1787,12 @@ function he({ label: t, value: n, mono: a, highlight: o }) {
|
|
|
1787
1787
|
}
|
|
1788
1788
|
);
|
|
1789
1789
|
}
|
|
1790
|
-
function
|
|
1790
|
+
function Pn({
|
|
1791
1791
|
className: t = "",
|
|
1792
1792
|
onRetry: n,
|
|
1793
1793
|
supportEmail: a = "support@nowramp.com"
|
|
1794
1794
|
}) {
|
|
1795
|
-
const { state: o, orderStatus: l, dispatch: i, goToStep: m } =
|
|
1795
|
+
const { state: o, orderStatus: l, dispatch: i, goToStep: m } = Se(), c = o.flowType === "sell", d = () => {
|
|
1796
1796
|
if (l)
|
|
1797
1797
|
switch (l.status) {
|
|
1798
1798
|
case "failed":
|
|
@@ -1812,13 +1812,13 @@ function Mn({
|
|
|
1812
1812
|
if (l)
|
|
1813
1813
|
switch (l.status) {
|
|
1814
1814
|
case "failed":
|
|
1815
|
-
return
|
|
1815
|
+
return c ? "Your sale could not be processed. Please try again." : "Your payment could not be processed. Please try again or use a different payment method.";
|
|
1816
1816
|
case "cancelled":
|
|
1817
|
-
return
|
|
1817
|
+
return c ? "Your sale was cancelled. No crypto was transferred." : "Your order was cancelled. No payment was processed.";
|
|
1818
1818
|
case "expired":
|
|
1819
|
-
return
|
|
1819
|
+
return c ? "Your order has expired. Please start a new sale." : "Your order has expired. Please start a new purchase.";
|
|
1820
1820
|
case "refunded":
|
|
1821
|
-
return
|
|
1821
|
+
return c ? "Your crypto has been returned. The funds should appear in your wallet shortly." : "Your payment has been refunded. The funds should appear in your account within 5-10 business days.";
|
|
1822
1822
|
default:
|
|
1823
1823
|
return "An unexpected error occurred. Please try again.";
|
|
1824
1824
|
}
|
|
@@ -1884,27 +1884,27 @@ function Mn({
|
|
|
1884
1884
|
] })
|
|
1885
1885
|
] });
|
|
1886
1886
|
}
|
|
1887
|
-
function
|
|
1887
|
+
function Ot(t) {
|
|
1888
1888
|
return t.length <= 12 ? t : `${t.slice(0, 6)}...${t.slice(-6)}`;
|
|
1889
1889
|
}
|
|
1890
|
-
function
|
|
1891
|
-
var
|
|
1890
|
+
function Un({ className: t = "", stablecoinParity: n, partnerName: a }) {
|
|
1891
|
+
var z;
|
|
1892
1892
|
const {
|
|
1893
1893
|
config: o,
|
|
1894
1894
|
configLoading: l,
|
|
1895
1895
|
state: i,
|
|
1896
1896
|
defaultGateway: m,
|
|
1897
|
-
quotes:
|
|
1897
|
+
quotes: c,
|
|
1898
1898
|
fetchQuotes: d,
|
|
1899
1899
|
createOrder: p,
|
|
1900
1900
|
orderLoading: h
|
|
1901
|
-
} =
|
|
1902
|
-
|
|
1901
|
+
} = Se(), u = i.flowType === "sell", [f, g] = N(null), w = o == null ? void 0 : o.gateways.find((j) => j.id === m), b = (z = c == null ? void 0 : c.bestQuote) != null && z.exchangeRate ? parseFloat(c.bestQuote.exchangeRate) : null, S = parseFloat(i.fiatAmount) || 0, P = !!(n && a && !u && Kt(i.cryptoCurrency) && b), $ = P && i.cryptoCurrency.toUpperCase().includes(i.fiatCurrency.toUpperCase()), U = P && S > 0 ? rt($ ? S : S / b) : null, Y = async () => {
|
|
1902
|
+
g(null);
|
|
1903
1903
|
try {
|
|
1904
1904
|
d(), await p();
|
|
1905
|
-
} catch (
|
|
1906
|
-
const
|
|
1907
|
-
|
|
1905
|
+
} catch (j) {
|
|
1906
|
+
const de = j instanceof Error ? j.message : "Failed to create order";
|
|
1907
|
+
g(de);
|
|
1908
1908
|
}
|
|
1909
1909
|
};
|
|
1910
1910
|
return l ? /* @__PURE__ */ r("div", { className: `flex flex-col items-center justify-center p-12 ${t}`, children: [
|
|
@@ -1913,26 +1913,26 @@ function Bn({ className: t = "", stablecoinParity: n, partnerName: a }) {
|
|
|
1913
1913
|
] }) : /* @__PURE__ */ r("div", { className: `flex flex-col items-center px-8 py-12 ${t}`, children: [
|
|
1914
1914
|
/* @__PURE__ */ e("h2", { className: "text-[20px] font-semibold mb-6", style: { color: "var(--t-text)" }, children: u ? "Confirm Sale" : "Confirm Purchase" }),
|
|
1915
1915
|
/* @__PURE__ */ r("div", { className: "w-full text-left mb-6", style: { background: "var(--t-surface)", borderRadius: 5, padding: 16 }, children: [
|
|
1916
|
-
|
|
1916
|
+
w && /* @__PURE__ */ r("div", { className: "flex justify-between items-center py-2", style: { borderBottom: "1px solid var(--t-divider)" }, children: [
|
|
1917
1917
|
/* @__PURE__ */ e("span", { className: "text-[13px]", style: { color: "var(--t-text-secondary)" }, children: "Provider" }),
|
|
1918
1918
|
/* @__PURE__ */ r("span", { className: "flex items-center gap-2", children: [
|
|
1919
|
-
|
|
1920
|
-
/* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: "var(--t-text)" }, children:
|
|
1919
|
+
w.logo && /* @__PURE__ */ e("img", { src: w.logo, alt: w.name, width: 20, height: 20, style: { borderRadius: 4 } }),
|
|
1920
|
+
/* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: "var(--t-text)" }, children: w.name })
|
|
1921
1921
|
] })
|
|
1922
1922
|
] }),
|
|
1923
|
-
u ? /* @__PURE__ */ r(
|
|
1924
|
-
/* @__PURE__ */ e(
|
|
1925
|
-
/* @__PURE__ */ e(
|
|
1926
|
-
] }) : /* @__PURE__ */ r(
|
|
1927
|
-
/* @__PURE__ */ e(
|
|
1923
|
+
u ? /* @__PURE__ */ r(le, { children: [
|
|
1924
|
+
/* @__PURE__ */ e(Ce, { label: "You sell", value: `${i.cryptoAmount} ${i.cryptoCurrency}`, highlight: !0 }),
|
|
1925
|
+
/* @__PURE__ */ e(Ce, { label: "You receive", value: `${i.fiatCurrency} payout` })
|
|
1926
|
+
] }) : /* @__PURE__ */ r(le, { children: [
|
|
1927
|
+
/* @__PURE__ */ e(Ce, { label: "You pay", value: `${i.fiatAmount} ${i.fiatCurrency}`, highlight: !0 }),
|
|
1928
1928
|
/* @__PURE__ */ e(
|
|
1929
|
-
|
|
1929
|
+
Ce,
|
|
1930
1930
|
{
|
|
1931
1931
|
label: "You receive",
|
|
1932
1932
|
value: U ? `${U} ${i.cryptoCurrency}` : `${i.cryptoCurrency} on ${i.network}`
|
|
1933
1933
|
}
|
|
1934
1934
|
),
|
|
1935
|
-
/* @__PURE__ */ e(
|
|
1935
|
+
/* @__PURE__ */ e(Ce, { label: "Wallet", value: Ot(i.walletAddress), mono: !0 }),
|
|
1936
1936
|
P && U && /* @__PURE__ */ r("div", { className: "py-2 text-[11px]", style: { color: "var(--t-text-muted)", lineHeight: "15px" }, children: [
|
|
1937
1937
|
"Charged amount from provider may differ. The rest up to ",
|
|
1938
1938
|
U,
|
|
@@ -1943,8 +1943,8 @@ function Bn({ className: t = "", stablecoinParity: n, partnerName: a }) {
|
|
|
1943
1943
|
" account."
|
|
1944
1944
|
] })
|
|
1945
1945
|
] }),
|
|
1946
|
-
/* @__PURE__ */ e(
|
|
1947
|
-
u && i.walletAddress && /* @__PURE__ */ e(
|
|
1946
|
+
/* @__PURE__ */ e(Ce, { label: "Network", value: i.network }),
|
|
1947
|
+
u && i.walletAddress && /* @__PURE__ */ e(Ce, { label: "Refund address", value: Ot(i.walletAddress), mono: !0 })
|
|
1948
1948
|
] }),
|
|
1949
1949
|
f && /* @__PURE__ */ e("p", { className: "text-[12px] mb-4", style: { color: "#EF4444" }, children: f }),
|
|
1950
1950
|
/* @__PURE__ */ e(
|
|
@@ -1953,8 +1953,8 @@ function Bn({ className: t = "", stablecoinParity: n, partnerName: a }) {
|
|
|
1953
1953
|
className: "w-full font-semibold text-[16px] transition-all flex items-center justify-center gap-2",
|
|
1954
1954
|
style: { height: 60, borderRadius: 5, background: "var(--t-cta-bg)", color: "var(--t-cta-text)", opacity: h ? 0.7 : 1 },
|
|
1955
1955
|
disabled: h,
|
|
1956
|
-
onClick:
|
|
1957
|
-
children: h ? /* @__PURE__ */ r(
|
|
1956
|
+
onClick: Y,
|
|
1957
|
+
children: h ? /* @__PURE__ */ r(le, { children: [
|
|
1958
1958
|
/* @__PURE__ */ e("span", { className: "nramp-spinner-inline" }),
|
|
1959
1959
|
"Processing..."
|
|
1960
1960
|
] }) : u ? "Confirm & Sell" : "Confirm & Pay"
|
|
@@ -1962,7 +1962,7 @@ function Bn({ className: t = "", stablecoinParity: n, partnerName: a }) {
|
|
|
1962
1962
|
)
|
|
1963
1963
|
] });
|
|
1964
1964
|
}
|
|
1965
|
-
function
|
|
1965
|
+
function Ce({ label: t, value: n, mono: a, highlight: o }) {
|
|
1966
1966
|
return /* @__PURE__ */ r("div", { className: "flex justify-between items-center py-2", style: { borderBottom: "1px solid var(--t-divider)" }, children: [
|
|
1967
1967
|
/* @__PURE__ */ e("span", { className: "text-[13px]", style: { color: "var(--t-text-secondary)" }, children: t }),
|
|
1968
1968
|
/* @__PURE__ */ e(
|
|
@@ -1975,12 +1975,12 @@ function ve({ label: t, value: n, mono: a, highlight: o }) {
|
|
|
1975
1975
|
)
|
|
1976
1976
|
] });
|
|
1977
1977
|
}
|
|
1978
|
-
function
|
|
1978
|
+
function $e({
|
|
1979
1979
|
isOpen: t,
|
|
1980
1980
|
onClose: n,
|
|
1981
1981
|
children: a
|
|
1982
1982
|
}) {
|
|
1983
|
-
const [o, l] =
|
|
1983
|
+
const [o, l] = N(!1), [i, m] = N(!1);
|
|
1984
1984
|
D(() => {
|
|
1985
1985
|
if (t)
|
|
1986
1986
|
l(!0), requestAnimationFrame(() => requestAnimationFrame(() => m(!0)));
|
|
@@ -1990,16 +1990,16 @@ function Ve({
|
|
|
1990
1990
|
return () => clearTimeout(d);
|
|
1991
1991
|
}
|
|
1992
1992
|
}, [t]);
|
|
1993
|
-
const
|
|
1993
|
+
const c = O(() => {
|
|
1994
1994
|
m(!1), setTimeout(() => n(), 250);
|
|
1995
1995
|
}, [n]);
|
|
1996
1996
|
return D(() => {
|
|
1997
1997
|
if (!t) return;
|
|
1998
1998
|
const d = (p) => {
|
|
1999
|
-
p.key === "Escape" &&
|
|
1999
|
+
p.key === "Escape" && c();
|
|
2000
2000
|
};
|
|
2001
2001
|
return window.addEventListener("keydown", d), () => window.removeEventListener("keydown", d);
|
|
2002
|
-
}, [t,
|
|
2002
|
+
}, [t, c]), o ? /* @__PURE__ */ e(
|
|
2003
2003
|
"div",
|
|
2004
2004
|
{
|
|
2005
2005
|
className: "absolute inset-0 z-20 transition-opacity duration-250",
|
|
@@ -2009,61 +2009,61 @@ function Ve({
|
|
|
2009
2009
|
{
|
|
2010
2010
|
className: "absolute inset-0 flex flex-col transition-transform duration-250 ease-out",
|
|
2011
2011
|
style: { background: "var(--t-modal-bg)", transform: i ? "translateY(0)" : "translateY(24px)" },
|
|
2012
|
-
children: typeof a == "function" ? a(
|
|
2012
|
+
children: typeof a == "function" ? a(c) : a
|
|
2013
2013
|
}
|
|
2014
2014
|
)
|
|
2015
2015
|
}
|
|
2016
2016
|
) : null;
|
|
2017
2017
|
}
|
|
2018
|
-
function
|
|
2018
|
+
function Fn({ char: t, height: n = 38 }) {
|
|
2019
2019
|
const a = "0123456789", o = a.indexOf(t);
|
|
2020
2020
|
return o === -1 ? /* @__PURE__ */ e("span", { children: t }) : /* @__PURE__ */ e("span", { className: "digit-slot", style: { height: n, lineHeight: `${n}px` }, children: /* @__PURE__ */ e("span", { className: "digit-slot-inner block", style: { transform: `translateY(-${o * n}px)` }, children: a.split("").map((l) => /* @__PURE__ */ e("span", { className: "block", style: { height: n, lineHeight: `${n}px` }, children: l }, l)) }) });
|
|
2021
2021
|
}
|
|
2022
|
-
function
|
|
2022
|
+
function Kn({
|
|
2023
2023
|
value: t,
|
|
2024
2024
|
height: n = 38,
|
|
2025
2025
|
className: a = "",
|
|
2026
2026
|
style: o = {}
|
|
2027
2027
|
}) {
|
|
2028
|
-
return /* @__PURE__ */ e("span", { className: a, style: { display: "inline-flex", ...o }, children: t.split("").map((l, i) => /* @__PURE__ */ e(
|
|
2028
|
+
return /* @__PURE__ */ e("span", { className: a, style: { display: "inline-flex", ...o }, children: t.split("").map((l, i) => /* @__PURE__ */ e(Fn, { char: l, height: n }, i)) });
|
|
2029
2029
|
}
|
|
2030
|
-
function
|
|
2030
|
+
function B({
|
|
2031
2031
|
w: t,
|
|
2032
2032
|
h: n,
|
|
2033
2033
|
className: a = ""
|
|
2034
2034
|
}) {
|
|
2035
2035
|
return /* @__PURE__ */ e("div", { className: `skeleton ${a}`, style: { width: t, height: n } });
|
|
2036
2036
|
}
|
|
2037
|
-
function
|
|
2037
|
+
function _n() {
|
|
2038
2038
|
return /* @__PURE__ */ r("div", { className: "flex-1 px-5 flex flex-col", children: [
|
|
2039
2039
|
/* @__PURE__ */ r("div", { className: "px-[18px] pt-[14px] pb-[18px]", style: { background: "var(--t-surface)", borderRadius: 5 }, children: [
|
|
2040
|
-
/* @__PURE__ */ e(
|
|
2040
|
+
/* @__PURE__ */ e(B, { w: 70, h: 14, className: "mb-3" }),
|
|
2041
2041
|
/* @__PURE__ */ r("div", { className: "flex justify-between items-center", children: [
|
|
2042
|
-
/* @__PURE__ */ e(
|
|
2043
|
-
/* @__PURE__ */ e(
|
|
2042
|
+
/* @__PURE__ */ e(B, { w: 120, h: 32 }),
|
|
2043
|
+
/* @__PURE__ */ e(B, { w: 75, h: 32 })
|
|
2044
2044
|
] })
|
|
2045
2045
|
] }),
|
|
2046
2046
|
/* @__PURE__ */ r("div", { className: "px-[18px] pt-[12px] pb-[18px]", style: { background: "var(--t-surface)", borderRadius: 5, marginTop: 4 }, children: [
|
|
2047
|
-
/* @__PURE__ */ e(
|
|
2047
|
+
/* @__PURE__ */ e(B, { w: 50, h: 14, className: "mb-3" }),
|
|
2048
2048
|
/* @__PURE__ */ r("div", { className: "flex justify-between items-center", children: [
|
|
2049
|
-
/* @__PURE__ */ e(
|
|
2050
|
-
/* @__PURE__ */ e(
|
|
2049
|
+
/* @__PURE__ */ e(B, { w: 180, h: 32 }),
|
|
2050
|
+
/* @__PURE__ */ e(B, { w: 85, h: 32 })
|
|
2051
2051
|
] })
|
|
2052
2052
|
] }),
|
|
2053
2053
|
/* @__PURE__ */ r("div", { className: "flex justify-between mt-3 px-[2px]", children: [
|
|
2054
|
-
/* @__PURE__ */ e(
|
|
2055
|
-
/* @__PURE__ */ e(
|
|
2054
|
+
/* @__PURE__ */ e(B, { w: 140, h: 12 }),
|
|
2055
|
+
/* @__PURE__ */ e(B, { w: 90, h: 12 })
|
|
2056
2056
|
] }),
|
|
2057
2057
|
/* @__PURE__ */ r("div", { className: "mt-8", children: [
|
|
2058
|
-
/* @__PURE__ */ e(
|
|
2059
|
-
/* @__PURE__ */ e(
|
|
2058
|
+
/* @__PURE__ */ e(B, { w: 65, h: 14, className: "mb-2.5" }),
|
|
2059
|
+
/* @__PURE__ */ e(B, { w: "100%", h: 47 })
|
|
2060
2060
|
] }),
|
|
2061
2061
|
/* @__PURE__ */ e("div", { className: "flex-1" }),
|
|
2062
|
-
/* @__PURE__ */ e(
|
|
2062
|
+
/* @__PURE__ */ e(B, { w: "100%", h: 60, className: "mb-2" }),
|
|
2063
2063
|
/* @__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" }) })
|
|
2064
2064
|
] });
|
|
2065
2065
|
}
|
|
2066
|
-
function
|
|
2066
|
+
function Be({ onClick: t }) {
|
|
2067
2067
|
return /* @__PURE__ */ e(
|
|
2068
2068
|
"button",
|
|
2069
2069
|
{
|
|
@@ -2076,7 +2076,7 @@ function De({ onClick: t }) {
|
|
|
2076
2076
|
}
|
|
2077
2077
|
);
|
|
2078
2078
|
}
|
|
2079
|
-
function
|
|
2079
|
+
function Ge({
|
|
2080
2080
|
value: t,
|
|
2081
2081
|
onChange: n,
|
|
2082
2082
|
placeholder: a = ""
|
|
@@ -2104,38 +2104,38 @@ function je({
|
|
|
2104
2104
|
)
|
|
2105
2105
|
] });
|
|
2106
2106
|
}
|
|
2107
|
-
function
|
|
2107
|
+
function Vn({
|
|
2108
2108
|
onClose: t,
|
|
2109
2109
|
onSelect: n,
|
|
2110
2110
|
currencies: a,
|
|
2111
2111
|
assetBaseUrl: o = "",
|
|
2112
2112
|
selectedCode: l
|
|
2113
2113
|
}) {
|
|
2114
|
-
const [i, m] =
|
|
2115
|
-
if (!a || a.length === 0) return
|
|
2116
|
-
const p = new Map(
|
|
2114
|
+
const [i, m] = N(""), c = G(() => {
|
|
2115
|
+
if (!a || a.length === 0) return Tt;
|
|
2116
|
+
const p = new Map(Tt.map((h) => [h.code, h.name]));
|
|
2117
2117
|
return a.map((h) => ({
|
|
2118
2118
|
code: h.code,
|
|
2119
2119
|
name: h.name || p.get(h.code) || h.code
|
|
2120
2120
|
}));
|
|
2121
|
-
}, [a]), d =
|
|
2121
|
+
}, [a]), d = G(() => {
|
|
2122
2122
|
const p = i.trim().toLowerCase();
|
|
2123
2123
|
if (!p) {
|
|
2124
2124
|
if (l) {
|
|
2125
|
-
const h =
|
|
2125
|
+
const h = c.find((u) => u.code === l);
|
|
2126
2126
|
if (h) {
|
|
2127
|
-
const u =
|
|
2127
|
+
const u = c.filter((f) => f.code !== l);
|
|
2128
2128
|
return [h, ...u];
|
|
2129
2129
|
}
|
|
2130
2130
|
}
|
|
2131
|
-
return
|
|
2131
|
+
return c;
|
|
2132
2132
|
}
|
|
2133
|
-
return
|
|
2133
|
+
return c.filter(
|
|
2134
2134
|
(h) => h.code.toLowerCase().includes(p) || h.name.toLowerCase().includes(p)
|
|
2135
2135
|
);
|
|
2136
|
-
}, [
|
|
2137
|
-
return /* @__PURE__ */ r(
|
|
2138
|
-
/* @__PURE__ */ e("div", { className: "flex justify-end px-5 pt-5", children: /* @__PURE__ */ e(
|
|
2136
|
+
}, [c, i, l]);
|
|
2137
|
+
return /* @__PURE__ */ r(le, { children: [
|
|
2138
|
+
/* @__PURE__ */ e("div", { className: "flex justify-end px-5 pt-5", children: /* @__PURE__ */ e(Be, { onClick: t }) }),
|
|
2139
2139
|
/* @__PURE__ */ e(
|
|
2140
2140
|
"h2",
|
|
2141
2141
|
{
|
|
@@ -2150,7 +2150,7 @@ function Pn({
|
|
|
2150
2150
|
children: "Select fiat currency"
|
|
2151
2151
|
}
|
|
2152
2152
|
),
|
|
2153
|
-
/* @__PURE__ */ e(
|
|
2153
|
+
/* @__PURE__ */ e(Ge, { value: i, onChange: m }),
|
|
2154
2154
|
/* @__PURE__ */ r("div", { className: "flex-1 overflow-y-auto custom-scroll px-5", children: [
|
|
2155
2155
|
d.map((p, h) => {
|
|
2156
2156
|
const u = p.name !== p.code ? p.name : "", f = l === p.code;
|
|
@@ -2162,7 +2162,7 @@ function Pn({
|
|
|
2162
2162
|
className: "flex items-center w-full transition-colors rounded-lg hover-item",
|
|
2163
2163
|
style: { color: "var(--t-text)", gap: 14, padding: "18px 8px", margin: "0 -8px" },
|
|
2164
2164
|
children: [
|
|
2165
|
-
/* @__PURE__ */ e(
|
|
2165
|
+
/* @__PURE__ */ e(ot, { currencyCode: p.code, size: 32, baseUrl: o }),
|
|
2166
2166
|
/* @__PURE__ */ r("div", { className: "text-left flex-1 flex items-center gap-2", children: [
|
|
2167
2167
|
/* @__PURE__ */ e("span", { className: "font-semibold text-[15px]", children: p.code }),
|
|
2168
2168
|
u && /* @__PURE__ */ e("span", { className: "text-[13px]", style: { color: "var(--t-text-secondary)" }, children: u })
|
|
@@ -2192,21 +2192,21 @@ function Pn({
|
|
|
2192
2192
|
] })
|
|
2193
2193
|
] });
|
|
2194
2194
|
}
|
|
2195
|
-
function
|
|
2196
|
-
const [i, m] =
|
|
2195
|
+
function Ht({ src: t, alt: n, size: a, className: o, style: l }) {
|
|
2196
|
+
const [i, m] = N(!1), [c, d] = N(!1);
|
|
2197
2197
|
D(() => {
|
|
2198
2198
|
m(!1), d(!1);
|
|
2199
2199
|
}, [t]);
|
|
2200
|
-
const p =
|
|
2200
|
+
const p = O(() => m(!0), []), h = O(() => d(!0), []);
|
|
2201
2201
|
return /* @__PURE__ */ r("div", { className: o, style: { ...l, width: a, height: a, position: "relative" }, children: [
|
|
2202
|
-
!i && !
|
|
2202
|
+
!i && !c && /* @__PURE__ */ e(
|
|
2203
2203
|
"div",
|
|
2204
2204
|
{
|
|
2205
2205
|
className: "absolute inset-0 rounded-full animate-pulse",
|
|
2206
2206
|
style: { background: "var(--t-pill-bg, #333)" }
|
|
2207
2207
|
}
|
|
2208
2208
|
),
|
|
2209
|
-
|
|
2209
|
+
c ? /* @__PURE__ */ e(
|
|
2210
2210
|
"div",
|
|
2211
2211
|
{
|
|
2212
2212
|
className: "absolute inset-0 rounded-full flex items-center justify-center text-[10px] font-bold",
|
|
@@ -2229,51 +2229,51 @@ function It({ src: t, alt: n, size: a, className: o, style: l }) {
|
|
|
2229
2229
|
)
|
|
2230
2230
|
] });
|
|
2231
2231
|
}
|
|
2232
|
-
function
|
|
2233
|
-
const [m,
|
|
2234
|
-
if (!a || a.length === 0) return
|
|
2232
|
+
function Xn({ onClose: t, onSelect: n, cryptos: a, assetBaseUrl: o = "", selectedCode: l, selectedChain: i }) {
|
|
2233
|
+
const [m, c] = N(""), d = G(() => {
|
|
2234
|
+
if (!a || a.length === 0) return xn;
|
|
2235
2235
|
const u = [];
|
|
2236
2236
|
for (const f of a) {
|
|
2237
|
-
const
|
|
2238
|
-
if (
|
|
2239
|
-
u.push({ code: f.code, name:
|
|
2237
|
+
const g = f.networks || [], w = f.name || mn[f.code] || f.code;
|
|
2238
|
+
if (g.length === 0)
|
|
2239
|
+
u.push({ code: f.code, name: w, chain: f.code, popular: !1 });
|
|
2240
2240
|
else
|
|
2241
|
-
for (const
|
|
2242
|
-
const S =
|
|
2241
|
+
for (const b of g) {
|
|
2242
|
+
const S = b.code || b.id || b.name || f.code;
|
|
2243
2243
|
u.push({
|
|
2244
2244
|
code: f.code,
|
|
2245
|
-
name:
|
|
2245
|
+
name: w,
|
|
2246
2246
|
chain: S,
|
|
2247
|
-
chainName:
|
|
2247
|
+
chainName: b.name,
|
|
2248
2248
|
popular: !1
|
|
2249
2249
|
});
|
|
2250
2250
|
}
|
|
2251
2251
|
}
|
|
2252
2252
|
return u;
|
|
2253
|
-
}, [a]), p =
|
|
2254
|
-
var
|
|
2253
|
+
}, [a]), p = O((u, f) => l === u && i === f, [l, i]), h = G(() => {
|
|
2254
|
+
var w;
|
|
2255
2255
|
const u = m.trim().toLowerCase();
|
|
2256
2256
|
if (!u) {
|
|
2257
2257
|
if (l && i) {
|
|
2258
|
-
const
|
|
2259
|
-
if (
|
|
2258
|
+
const b = d.find((S) => S.code === l && S.chain === i);
|
|
2259
|
+
if (b) {
|
|
2260
2260
|
const S = d.filter((P) => !(P.code === l && P.chain === i));
|
|
2261
|
-
return [
|
|
2261
|
+
return [b, ...S];
|
|
2262
2262
|
}
|
|
2263
2263
|
}
|
|
2264
2264
|
return d;
|
|
2265
2265
|
}
|
|
2266
|
-
const f = u.split(/\s+/),
|
|
2267
|
-
for (const
|
|
2268
|
-
const S =
|
|
2269
|
-
if (!f.every((
|
|
2266
|
+
const f = u.split(/\s+/), g = [];
|
|
2267
|
+
for (const b of d) {
|
|
2268
|
+
const S = je(b.chain), P = S ? S.name.toLowerCase() : "", $ = ((w = S == null ? void 0 : S.shortName) == null ? void 0 : w.toLowerCase()) || "", U = b.chain.toLowerCase(), Y = b.code.toLowerCase(), z = b.name.toLowerCase(), j = [Y, z, P, $, U];
|
|
2269
|
+
if (!f.every((s) => j.some((A) => A.includes(s)))) continue;
|
|
2270
2270
|
let y = 0;
|
|
2271
|
-
|
|
2271
|
+
Y === u ? y += 100 : Y.startsWith(f[0]) && (y += 50), b.popular && (y += 10), f.length > 1 && (P.includes(f[1]) || $.includes(f[1]) || U.includes(f[1])) && (y += 25), g.push({ item: b, score: y });
|
|
2272
2272
|
}
|
|
2273
|
-
return
|
|
2273
|
+
return g.sort((b, S) => S.score - b.score), g.map((b) => b.item);
|
|
2274
2274
|
}, [d, m, l, i]);
|
|
2275
|
-
return /* @__PURE__ */ r(
|
|
2276
|
-
/* @__PURE__ */ e("div", { className: "flex justify-end px-5 pt-5", children: /* @__PURE__ */ e(
|
|
2275
|
+
return /* @__PURE__ */ r(le, { children: [
|
|
2276
|
+
/* @__PURE__ */ e("div", { className: "flex justify-end px-5 pt-5", children: /* @__PURE__ */ e(Be, { onClick: t }) }),
|
|
2277
2277
|
/* @__PURE__ */ e(
|
|
2278
2278
|
"h2",
|
|
2279
2279
|
{
|
|
@@ -2282,10 +2282,10 @@ function Un({ onClose: t, onSelect: n, cryptos: a, assetBaseUrl: o = "", selecte
|
|
|
2282
2282
|
children: "Select crypto currency"
|
|
2283
2283
|
}
|
|
2284
2284
|
),
|
|
2285
|
-
/* @__PURE__ */ e(
|
|
2285
|
+
/* @__PURE__ */ e(Ge, { value: m, onChange: c }),
|
|
2286
2286
|
/* @__PURE__ */ r("div", { className: "flex-1 overflow-y-auto custom-scroll px-5", children: [
|
|
2287
2287
|
h.map((u, f) => {
|
|
2288
|
-
const
|
|
2288
|
+
const g = je(u.chain), w = (g == null ? void 0 : g.name) || u.chainName || u.chain, b = u.name !== u.code ? u.name : "", S = p(u.code, u.chain);
|
|
2289
2289
|
return /* @__PURE__ */ r("div", { children: [
|
|
2290
2290
|
/* @__PURE__ */ r(
|
|
2291
2291
|
"button",
|
|
@@ -2301,9 +2301,9 @@ function Un({ onClose: t, onSelect: n, cryptos: a, assetBaseUrl: o = "", selecte
|
|
|
2301
2301
|
className: "absolute top-0 left-0",
|
|
2302
2302
|
style: { background: "#ffffff", borderRadius: "50%" },
|
|
2303
2303
|
children: /* @__PURE__ */ e(
|
|
2304
|
-
|
|
2304
|
+
Ht,
|
|
2305
2305
|
{
|
|
2306
|
-
src:
|
|
2306
|
+
src: Ft(u.code, o),
|
|
2307
2307
|
alt: u.code,
|
|
2308
2308
|
size: 32
|
|
2309
2309
|
}
|
|
@@ -2322,9 +2322,9 @@ function Un({ onClose: t, onSelect: n, cryptos: a, assetBaseUrl: o = "", selecte
|
|
|
2322
2322
|
background: "#ffffff"
|
|
2323
2323
|
},
|
|
2324
2324
|
children: /* @__PURE__ */ e(
|
|
2325
|
-
|
|
2325
|
+
Ht,
|
|
2326
2326
|
{
|
|
2327
|
-
src:
|
|
2327
|
+
src: at(u.chain, o),
|
|
2328
2328
|
alt: u.chain,
|
|
2329
2329
|
size: 16
|
|
2330
2330
|
}
|
|
@@ -2341,17 +2341,17 @@ function Un({ onClose: t, onSelect: n, cryptos: a, assetBaseUrl: o = "", selecte
|
|
|
2341
2341
|
children: u.code
|
|
2342
2342
|
}
|
|
2343
2343
|
),
|
|
2344
|
-
|
|
2344
|
+
b && /* @__PURE__ */ e(
|
|
2345
2345
|
"span",
|
|
2346
2346
|
{
|
|
2347
2347
|
className: "text-[13px]",
|
|
2348
2348
|
style: { color: "var(--t-text-secondary)" },
|
|
2349
|
-
children:
|
|
2349
|
+
children: b
|
|
2350
2350
|
}
|
|
2351
2351
|
)
|
|
2352
2352
|
] }) }),
|
|
2353
2353
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-2 shrink-0", children: [
|
|
2354
|
-
/* @__PURE__ */ e("span", { className: "text-[13px]", style: { color: "var(--t-text-secondary)" }, children:
|
|
2354
|
+
/* @__PURE__ */ e("span", { className: "text-[13px]", style: { color: "var(--t-text-secondary)" }, children: w }),
|
|
2355
2355
|
S && /* @__PURE__ */ e("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", children: /* @__PURE__ */ e(
|
|
2356
2356
|
"path",
|
|
2357
2357
|
{
|
|
@@ -2373,15 +2373,15 @@ function Un({ onClose: t, onSelect: n, cryptos: a, assetBaseUrl: o = "", selecte
|
|
|
2373
2373
|
] })
|
|
2374
2374
|
] });
|
|
2375
2375
|
}
|
|
2376
|
-
function
|
|
2376
|
+
function $n({
|
|
2377
2377
|
methods: t,
|
|
2378
2378
|
selectedId: n,
|
|
2379
2379
|
onSelect: a,
|
|
2380
2380
|
onClose: o
|
|
2381
2381
|
}) {
|
|
2382
|
-
const [l, i] =
|
|
2383
|
-
const
|
|
2384
|
-
if (!
|
|
2382
|
+
const [l, i] = N(""), m = G(() => {
|
|
2383
|
+
const c = l.trim().toLowerCase();
|
|
2384
|
+
if (!c) {
|
|
2385
2385
|
if (n) {
|
|
2386
2386
|
const d = t.find((p) => p.id === n);
|
|
2387
2387
|
if (d) {
|
|
@@ -2392,11 +2392,11 @@ function Fn({
|
|
|
2392
2392
|
return t;
|
|
2393
2393
|
}
|
|
2394
2394
|
return t.filter(
|
|
2395
|
-
(d) => d.id.toLowerCase().includes(
|
|
2395
|
+
(d) => d.id.toLowerCase().includes(c) || d.name.toLowerCase().includes(c) || d.description && d.description.toLowerCase().includes(c)
|
|
2396
2396
|
);
|
|
2397
2397
|
}, [t, l, n]);
|
|
2398
|
-
return /* @__PURE__ */ r(
|
|
2399
|
-
/* @__PURE__ */ e("div", { className: "flex justify-end px-5 pt-5", children: /* @__PURE__ */ e(
|
|
2398
|
+
return /* @__PURE__ */ r(le, { children: [
|
|
2399
|
+
/* @__PURE__ */ e("div", { className: "flex justify-end px-5 pt-5", children: /* @__PURE__ */ e(Be, { onClick: o }) }),
|
|
2400
2400
|
/* @__PURE__ */ e(
|
|
2401
2401
|
"h2",
|
|
2402
2402
|
{
|
|
@@ -2405,24 +2405,24 @@ function Fn({
|
|
|
2405
2405
|
children: "Choose payment method"
|
|
2406
2406
|
}
|
|
2407
2407
|
),
|
|
2408
|
-
/* @__PURE__ */ e(
|
|
2408
|
+
/* @__PURE__ */ e(Ge, { value: l, onChange: i }),
|
|
2409
2409
|
/* @__PURE__ */ r("div", { className: "flex-1 overflow-y-auto custom-scroll px-5", children: [
|
|
2410
|
-
m.map((
|
|
2411
|
-
const p =
|
|
2410
|
+
m.map((c, d) => {
|
|
2411
|
+
const p = c.id === n, h = Vt(c.id, c.name);
|
|
2412
2412
|
return /* @__PURE__ */ r("div", { children: [
|
|
2413
2413
|
/* @__PURE__ */ r(
|
|
2414
2414
|
"button",
|
|
2415
2415
|
{
|
|
2416
|
-
onClick: () => a(
|
|
2417
|
-
className: `flex w-full transition-colors rounded-lg hover-item ${
|
|
2416
|
+
onClick: () => a(c.id),
|
|
2417
|
+
className: `flex w-full transition-colors rounded-lg hover-item ${c.description ? "items-start" : "items-center"}`,
|
|
2418
2418
|
style: { color: "var(--t-text)", gap: 14, padding: "18px 8px", margin: "0 -8px" },
|
|
2419
2419
|
children: [
|
|
2420
2420
|
/* @__PURE__ */ e(
|
|
2421
2421
|
"span",
|
|
2422
2422
|
{
|
|
2423
|
-
className: `flex items-center justify-center shrink-0 ${
|
|
2423
|
+
className: `flex items-center justify-center shrink-0 ${c.description ? "mt-0.5" : ""}`,
|
|
2424
2424
|
style: { width: 32, height: 32 },
|
|
2425
|
-
children:
|
|
2425
|
+
children: Xt(c.id, c.icon, 32)
|
|
2426
2426
|
}
|
|
2427
2427
|
),
|
|
2428
2428
|
/* @__PURE__ */ r("div", { className: "text-left flex-1", children: [
|
|
@@ -2434,12 +2434,12 @@ function Fn({
|
|
|
2434
2434
|
children: h
|
|
2435
2435
|
}
|
|
2436
2436
|
),
|
|
2437
|
-
|
|
2437
|
+
c.description && /* @__PURE__ */ e(
|
|
2438
2438
|
"div",
|
|
2439
2439
|
{
|
|
2440
2440
|
className: "text-[13px] leading-snug mt-1",
|
|
2441
2441
|
style: { color: "var(--t-text-secondary)" },
|
|
2442
|
-
children:
|
|
2442
|
+
children: c.description
|
|
2443
2443
|
}
|
|
2444
2444
|
)
|
|
2445
2445
|
] }),
|
|
@@ -2457,13 +2457,13 @@ function Fn({
|
|
|
2457
2457
|
}
|
|
2458
2458
|
),
|
|
2459
2459
|
d < m.length - 1 && /* @__PURE__ */ e("div", { style: { height: 1, background: "var(--t-divider, rgba(255,255,255,0.08))" } })
|
|
2460
|
-
] },
|
|
2460
|
+
] }, c.id);
|
|
2461
2461
|
}),
|
|
2462
2462
|
m.length === 0 && /* @__PURE__ */ e("div", { className: "text-center py-10 text-[14px]", style: { color: "var(--t-text-muted)" }, children: "No payment methods found" })
|
|
2463
2463
|
] })
|
|
2464
2464
|
] });
|
|
2465
2465
|
}
|
|
2466
|
-
function
|
|
2466
|
+
function jn({
|
|
2467
2467
|
checked: t,
|
|
2468
2468
|
onChange: n,
|
|
2469
2469
|
accentColor: a = "var(--t-accent)"
|
|
@@ -2493,11 +2493,11 @@ function Kn({
|
|
|
2493
2493
|
}
|
|
2494
2494
|
);
|
|
2495
2495
|
}
|
|
2496
|
-
const
|
|
2496
|
+
const Wn = [
|
|
2497
2497
|
{ label: "Privacy policy", href: "https://nowramp.com/privacy-policy" },
|
|
2498
2498
|
{ label: "Terms of use", href: "https://nowramp.com/terms-and-conditions" }
|
|
2499
2499
|
];
|
|
2500
|
-
function
|
|
2500
|
+
function Gn({
|
|
2501
2501
|
onClose: t,
|
|
2502
2502
|
darkMode: n,
|
|
2503
2503
|
onToggleDarkMode: a,
|
|
@@ -2505,13 +2505,13 @@ function Vn({
|
|
|
2505
2505
|
onSelectSkin: l,
|
|
2506
2506
|
showThemeToggle: i = !0
|
|
2507
2507
|
}) {
|
|
2508
|
-
return /* @__PURE__ */ r(
|
|
2509
|
-
/* @__PURE__ */ e("div", { className: "flex justify-end items-center px-5 pt-5", children: /* @__PURE__ */ e(
|
|
2508
|
+
return /* @__PURE__ */ r(le, { children: [
|
|
2509
|
+
/* @__PURE__ */ e("div", { className: "flex justify-end items-center px-5 pt-5", children: /* @__PURE__ */ e(Be, { onClick: t }) }),
|
|
2510
2510
|
/* @__PURE__ */ r("div", { className: "px-5 flex-1 pt-6 overflow-y-auto custom-scroll", children: [
|
|
2511
|
-
i && /* @__PURE__ */ r(
|
|
2511
|
+
i && /* @__PURE__ */ r(le, { children: [
|
|
2512
2512
|
/* @__PURE__ */ e("div", { style: { borderTop: "1px solid var(--t-divider)" }, children: /* @__PURE__ */ r("div", { className: "flex items-center justify-between w-full py-5", children: [
|
|
2513
2513
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-3.5", children: [
|
|
2514
|
-
/* @__PURE__ */ e(
|
|
2514
|
+
/* @__PURE__ */ e(Tn, { size: 40 }),
|
|
2515
2515
|
/* @__PURE__ */ e(
|
|
2516
2516
|
"span",
|
|
2517
2517
|
{
|
|
@@ -2521,11 +2521,11 @@ function Vn({
|
|
|
2521
2521
|
}
|
|
2522
2522
|
)
|
|
2523
2523
|
] }),
|
|
2524
|
-
/* @__PURE__ */ e(
|
|
2524
|
+
/* @__PURE__ */ e(jn, { checked: n, onChange: a, accentColor: "#4CD964" })
|
|
2525
2525
|
] }) }),
|
|
2526
2526
|
/* @__PURE__ */ e("div", { style: { height: 1, background: "var(--t-divider)" } })
|
|
2527
2527
|
] }),
|
|
2528
|
-
|
|
2528
|
+
Wn.map((m) => /* @__PURE__ */ r("div", { children: [
|
|
2529
2529
|
/* @__PURE__ */ r(
|
|
2530
2530
|
"a",
|
|
2531
2531
|
{
|
|
@@ -2543,7 +2543,7 @@ function Vn({
|
|
|
2543
2543
|
children: m.label
|
|
2544
2544
|
}
|
|
2545
2545
|
),
|
|
2546
|
-
/* @__PURE__ */ e(
|
|
2546
|
+
/* @__PURE__ */ e(Sn, {})
|
|
2547
2547
|
]
|
|
2548
2548
|
}
|
|
2549
2549
|
),
|
|
@@ -2552,7 +2552,7 @@ function Vn({
|
|
|
2552
2552
|
] })
|
|
2553
2553
|
] });
|
|
2554
2554
|
}
|
|
2555
|
-
function
|
|
2555
|
+
function Yn({
|
|
2556
2556
|
className: t = "",
|
|
2557
2557
|
theme: n = "dark",
|
|
2558
2558
|
skinId: a = "mono",
|
|
@@ -2560,195 +2560,198 @@ function Xn({
|
|
|
2560
2560
|
bgColor: l,
|
|
2561
2561
|
bgImage: i,
|
|
2562
2562
|
borderColor: m,
|
|
2563
|
-
borderRadius:
|
|
2563
|
+
borderRadius: c,
|
|
2564
2564
|
surfaceColor: d,
|
|
2565
2565
|
inputBgColor: p,
|
|
2566
2566
|
textColor: h,
|
|
2567
2567
|
textSecondaryColor: u,
|
|
2568
2568
|
textMutedColor: f,
|
|
2569
|
-
successColor:
|
|
2570
|
-
showFlowToggle:
|
|
2571
|
-
showSettings:
|
|
2569
|
+
successColor: g,
|
|
2570
|
+
showFlowToggle: w = !0,
|
|
2571
|
+
showSettings: b = !0,
|
|
2572
2572
|
showThemeToggle: S = !0,
|
|
2573
2573
|
autoRedirect: P = !1,
|
|
2574
|
-
explorerUrl:
|
|
2574
|
+
explorerUrl: $,
|
|
2575
2575
|
doneButtonText: U = "Done",
|
|
2576
|
-
supportEmail:
|
|
2577
|
-
stablecoinParity:
|
|
2578
|
-
partnerName:
|
|
2579
|
-
onDone:
|
|
2576
|
+
supportEmail: Y,
|
|
2577
|
+
stablecoinParity: z,
|
|
2578
|
+
partnerName: j,
|
|
2579
|
+
onDone: de
|
|
2580
2580
|
}) {
|
|
2581
|
-
var
|
|
2581
|
+
var gt, Ct, vt, bt, Nt, Et, wt, At;
|
|
2582
2582
|
const {
|
|
2583
2583
|
state: y,
|
|
2584
|
-
dispatch:
|
|
2585
|
-
config:
|
|
2586
|
-
configLoading:
|
|
2587
|
-
quotes:
|
|
2584
|
+
dispatch: s,
|
|
2585
|
+
config: A,
|
|
2586
|
+
configLoading: H,
|
|
2587
|
+
quotes: C,
|
|
2588
2588
|
quotesLoading: pe,
|
|
2589
|
-
quotesError:
|
|
2590
|
-
fetchQuotes:
|
|
2591
|
-
createOrder:
|
|
2592
|
-
orderLoading:
|
|
2589
|
+
quotesError: ie,
|
|
2590
|
+
fetchQuotes: ne,
|
|
2591
|
+
createOrder: ve,
|
|
2592
|
+
orderLoading: ae,
|
|
2593
2593
|
amountError: fe,
|
|
2594
2594
|
fieldLocks: k,
|
|
2595
|
-
apiConfig:
|
|
2595
|
+
apiConfig: be,
|
|
2596
2596
|
assetBaseUrl: F
|
|
2597
|
-
} =
|
|
2597
|
+
} = Se(), [re, ue] = N(n === "dark"), [ye, Ye] = N(a), [W, Z] = N(null), [xe, Re] = N(!1), [Te, Ne] = N(!1), [Ze, Oe] = N(!1), [ke, He] = N(!1), [Qe, v] = N(null), [T, J] = N(!0), [K, L] = N(!1), [I, q] = N(!1), De = X(null), ze = X(), Je = X(y.flowType);
|
|
2598
2598
|
D(() => {
|
|
2599
|
-
|
|
2599
|
+
ue(n === "dark");
|
|
2600
2600
|
}, [n]), D(() => {
|
|
2601
|
-
const
|
|
2602
|
-
return () => clearTimeout(
|
|
2603
|
-
}, [
|
|
2604
|
-
if (
|
|
2605
|
-
|
|
2606
|
-
const
|
|
2607
|
-
return () => clearTimeout(
|
|
2601
|
+
const x = setTimeout(() => J(!1), H ? 0 : 800);
|
|
2602
|
+
return () => clearTimeout(x);
|
|
2603
|
+
}, [H]), D(() => {
|
|
2604
|
+
if (Je.current !== y.flowType && !T) {
|
|
2605
|
+
Je.current = y.flowType, L(!0), Re(!1), Ne(!1);
|
|
2606
|
+
const x = setTimeout(() => L(!1), 350);
|
|
2607
|
+
return () => clearTimeout(x);
|
|
2608
2608
|
}
|
|
2609
|
-
|
|
2610
|
-
}, [y.flowType,
|
|
2611
|
-
const
|
|
2612
|
-
|
|
2613
|
-
const
|
|
2614
|
-
if (
|
|
2615
|
-
const
|
|
2616
|
-
if (
|
|
2609
|
+
Je.current = y.flowType;
|
|
2610
|
+
}, [y.flowType, T]);
|
|
2611
|
+
const Ee = y.flowType, _ = Ee === "buy", V = y.cryptoCurrency || "BTC", ee = y.fiatCurrency || "USD", qe = _ ? y.fiatAmount : y.cryptoAmount, Q = yn(qe), me = (gt = C == null ? void 0 : C.bestQuote) != null && gt.exchangeRate ? parseFloat(C.bestQuote.exchangeRate) : null, Pe = X(null);
|
|
2612
|
+
me && V && ee && (Pe.current = { rate: me, crypto: V, fiat: ee });
|
|
2613
|
+
const it = G(() => {
|
|
2614
|
+
if (C != null && C.bestQuote) {
|
|
2615
|
+
const x = _ ? C.bestQuote.cryptoAmount : C.bestQuote.fiatAmount;
|
|
2616
|
+
if (x) return x;
|
|
2617
2617
|
}
|
|
2618
2618
|
return "0";
|
|
2619
|
-
}, [
|
|
2620
|
-
var
|
|
2621
|
-
const
|
|
2622
|
-
return !
|
|
2623
|
-
}, [
|
|
2619
|
+
}, [C, _]), Le = !!(z && j && _ && Kt(V) && me), $t = Le && V.toUpperCase().includes(ee.toUpperCase()), st = Le && Q > 0 ? rt($t ? Q : Q / me) : null, jt = Le && st ? st : it, Wt = G(() => {
|
|
2620
|
+
var M, oe, Ve;
|
|
2621
|
+
const x = me || ((M = Pe.current) == null ? void 0 : M.rate), E = me ? V : (oe = Pe.current) == null ? void 0 : oe.crypto, R = me ? ee : (Ve = Pe.current) == null ? void 0 : Ve.fiat;
|
|
2622
|
+
return !x || !E || !R ? "" : `1 ${E} ≈ ${x.toFixed(2)} ${R}`;
|
|
2623
|
+
}, [V, ee, me]);
|
|
2624
2624
|
D(() => {
|
|
2625
|
-
const
|
|
2626
|
-
if (!
|
|
2627
|
-
|
|
2625
|
+
const x = y.walletAddress.trim(), E = y.network;
|
|
2626
|
+
if (!x || x.length < 10) {
|
|
2627
|
+
v(null), s({ type: "SET_WALLET_ERROR", message: "" });
|
|
2628
2628
|
return;
|
|
2629
2629
|
}
|
|
2630
|
-
return
|
|
2631
|
-
var R,
|
|
2630
|
+
return He(!0), v(null), clearTimeout(ze.current), ze.current = setTimeout(async () => {
|
|
2631
|
+
var R, M, oe;
|
|
2632
2632
|
try {
|
|
2633
|
-
const
|
|
2633
|
+
const tt = await (await fetch(`${be.apiUrl}/public/validate/address`, {
|
|
2634
2634
|
method: "POST",
|
|
2635
2635
|
headers: { "Content-Type": "application/json" },
|
|
2636
|
-
body: JSON.stringify({ address:
|
|
2637
|
-
})).json(),
|
|
2638
|
-
if (
|
|
2639
|
-
|
|
2636
|
+
body: JSON.stringify({ address: x, ...E ? { network: E } : {} })
|
|
2637
|
+
})).json(), nt = ((R = tt.data) == null ? void 0 : R.attributes) || tt.data || tt;
|
|
2638
|
+
if (nt.isValid)
|
|
2639
|
+
v(!0), s({ type: "SET_WALLET_ERROR", message: "" });
|
|
2640
2640
|
else {
|
|
2641
|
-
|
|
2642
|
-
const
|
|
2643
|
-
|
|
2641
|
+
v(!1);
|
|
2642
|
+
const tn = ((M = nt.errors) == null ? void 0 : M[0]) || ((oe = nt.details) == null ? void 0 : oe.formatMessage) || "Invalid wallet address";
|
|
2643
|
+
s({ type: "SET_WALLET_ERROR", message: tn });
|
|
2644
2644
|
}
|
|
2645
2645
|
} catch {
|
|
2646
|
-
|
|
2646
|
+
v(null);
|
|
2647
2647
|
} finally {
|
|
2648
|
-
|
|
2648
|
+
He(!1);
|
|
2649
2649
|
}
|
|
2650
|
-
}, 500), () => clearTimeout(
|
|
2651
|
-
}, [y.walletAddress, y.network,
|
|
2652
|
-
const
|
|
2653
|
-
let
|
|
2654
|
-
const R =
|
|
2655
|
-
|
|
2656
|
-
},
|
|
2657
|
-
|
|
2658
|
-
},
|
|
2659
|
-
(
|
|
2660
|
-
|
|
2650
|
+
}, 500), () => clearTimeout(ze.current);
|
|
2651
|
+
}, [y.walletAddress, y.network, be.apiUrl]);
|
|
2652
|
+
const ct = !qe || Q === 0, dt = Q > 0 && (_ ? Q < It : Q < Mt), ut = !!fe || dt || xe && ct, Gt = Q > 0 && !fe && !dt, et = y.walletAddress.trim().length >= 10 && Qe !== !1 && !ke, Ue = Gt && et && !!y.cryptoCurrency && !!y.network, Yt = (x) => {
|
|
2653
|
+
let E = x.target.value.replace(/[^0-9.,]/g, "");
|
|
2654
|
+
const R = _ ? 2 : 6, M = E.indexOf(".");
|
|
2655
|
+
M !== -1 && E.length - M - 1 > R && (E = E.slice(0, M + R + 1)), s(_ ? { type: "SET_FIAT_AMOUNT", amount: E } : { type: "SET_CRYPTO_AMOUNT", amount: E });
|
|
2656
|
+
}, mt = (x) => {
|
|
2657
|
+
x !== Ee && s({ type: "SET_FLOW_TYPE", flowType: x });
|
|
2658
|
+
}, Zt = O(
|
|
2659
|
+
(x) => {
|
|
2660
|
+
s({ type: "SET_FIAT_CURRENCY", currency: x });
|
|
2661
2661
|
},
|
|
2662
|
-
[
|
|
2663
|
-
),
|
|
2664
|
-
(
|
|
2665
|
-
|
|
2662
|
+
[s]
|
|
2663
|
+
), Qt = O(
|
|
2664
|
+
(x, E) => {
|
|
2665
|
+
s({ type: "SET_CRYPTO_CURRENCY", currency: x }), s({ type: "SET_CRYPTO_CHAIN", chain: E });
|
|
2666
2666
|
},
|
|
2667
|
-
[
|
|
2668
|
-
),
|
|
2669
|
-
(
|
|
2670
|
-
|
|
2667
|
+
[s]
|
|
2668
|
+
), zt = O(
|
|
2669
|
+
(x) => {
|
|
2670
|
+
s({ type: "SET_PAYMENT_METHOD", methodId: x });
|
|
2671
2671
|
},
|
|
2672
|
-
[
|
|
2673
|
-
),
|
|
2674
|
-
|
|
2672
|
+
[s]
|
|
2673
|
+
), Jt = () => {
|
|
2674
|
+
Ue && (q(!0), ne());
|
|
2675
2675
|
};
|
|
2676
2676
|
D(() => {
|
|
2677
|
-
var
|
|
2678
|
-
if (!(!
|
|
2679
|
-
if (
|
|
2680
|
-
|
|
2677
|
+
var x;
|
|
2678
|
+
if (!(!I || pe)) {
|
|
2679
|
+
if (C != null && C.bestQuote)
|
|
2680
|
+
q(!1), s({ type: "SELECT_QUOTE", quote: C.bestQuote }), ve().catch(() => {
|
|
2681
2681
|
});
|
|
2682
|
-
else if (
|
|
2683
|
-
|
|
2684
|
-
else if (
|
|
2685
|
-
|
|
2686
|
-
const
|
|
2687
|
-
|
|
2682
|
+
else if (ie)
|
|
2683
|
+
q(!1), s({ type: "SET_ERROR", message: ie.message || "No quotes available" });
|
|
2684
|
+
else if (C && !C.bestQuote) {
|
|
2685
|
+
q(!1);
|
|
2686
|
+
const E = (x = C.unavailableGateways) == null ? void 0 : x.map((M) => M.reason).filter(Boolean), R = E != null && E.length ? `No providers available: ${E.join("; ")}` : "No providers available for this currency/network combination";
|
|
2687
|
+
s({ type: "SET_ERROR", message: R });
|
|
2688
2688
|
}
|
|
2689
2689
|
}
|
|
2690
|
-
}, [
|
|
2691
|
-
const
|
|
2692
|
-
|
|
2693
|
-
|
|
2694
|
-
|
|
2690
|
+
}, [I, C, pe, ie, s, ve]);
|
|
2691
|
+
const ht = re ? "theme-dark" : "theme-light", Fe = kt.find((x) => x.id === ye) || kt[0], qt = Fe.accent === null, en = o ? ce(o) : !1, pt = (x) => {
|
|
2692
|
+
const E = x.replace("#", ""), R = parseInt(E.substring(0, 2), 16), M = parseInt(E.substring(2, 4), 16), oe = parseInt(E.substring(4, 6), 16);
|
|
2693
|
+
return (0.299 * R + 0.587 * M + 0.114 * oe) / 255 > 0.5 ? "#000000" : "#ffffff";
|
|
2694
|
+
}, ft = en ? { "--t-accent": o, "--t-cta-bg": o, "--t-cta-text": pt(o) } : qt ? {
|
|
2695
|
+
"--t-accent": re ? "#ffffff" : "#111111",
|
|
2696
|
+
"--t-cta-bg": re ? "#ffffff" : "#111111",
|
|
2697
|
+
"--t-cta-text": re ? "#000000" : "#ffffff"
|
|
2695
2698
|
} : {
|
|
2696
|
-
"--t-accent":
|
|
2697
|
-
"--t-cta-bg":
|
|
2698
|
-
"--t-cta-text":
|
|
2699
|
-
},
|
|
2700
|
-
d && ce(d) && (
|
|
2699
|
+
"--t-accent": Fe.accent,
|
|
2700
|
+
"--t-cta-bg": Fe.accent,
|
|
2701
|
+
"--t-cta-text": pt(Fe.accent)
|
|
2702
|
+
}, te = {};
|
|
2703
|
+
d && ce(d) && (te["--t-surface"] = d, te["--t-modal-bg"] = d), p && ce(p) && (te["--t-pill-bg"] = p, te["--t-close-bg"] = p), h && ce(h) && (te["--t-text"] = h), u && ce(u) && (te["--t-text-secondary"] = u), f && ce(f) && (te["--t-text-muted"] = f, te["--t-text-tertiary"] = f), g && ce(g) && (te["--t-success"] = g);
|
|
2701
2704
|
const ge = {};
|
|
2702
2705
|
l && ce(l) ? ge.backgroundColor = l : ge.backgroundColor = "var(--t-bg)", i && (ge.backgroundImage = `url(${i})`, ge.backgroundSize = "cover", ge.backgroundPosition = "center");
|
|
2703
|
-
const Ke = {};
|
|
2704
|
-
m && ce(m) && (
|
|
2705
|
-
const
|
|
2706
|
-
if (
|
|
2706
|
+
const Ke = re ? "#ffffff" : "#111111", _e = {};
|
|
2707
|
+
m && ce(m) && (_e.border = `1px solid ${m}`), c && (_e.borderRadius = c);
|
|
2708
|
+
const yt = y.step === "checkout" ? /* @__PURE__ */ e(Bn, { autoRedirect: P }) : y.step === "processing" ? /* @__PURE__ */ e(Hn, {}) : y.step === "complete" ? /* @__PURE__ */ e(Dn, { explorerUrl: $, doneButtonText: U, onDone: de }) : y.step === "error" ? /* @__PURE__ */ e(Pn, { supportEmail: Y }) : y.step === "confirm" ? /* @__PURE__ */ e(Un, { stablecoinParity: Le, partnerName: j }) : null;
|
|
2709
|
+
if (yt)
|
|
2707
2710
|
return /* @__PURE__ */ e(
|
|
2708
2711
|
"div",
|
|
2709
2712
|
{
|
|
2710
|
-
className: `${
|
|
2713
|
+
className: `${ht} relative w-full max-w-[390px] h-[640px] overflow-hidden flex flex-col select-none transition-colors duration-300 ${t}`,
|
|
2711
2714
|
style: {
|
|
2712
2715
|
fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',
|
|
2713
2716
|
...ge,
|
|
2714
|
-
...
|
|
2715
|
-
...
|
|
2716
|
-
...
|
|
2717
|
+
...ft,
|
|
2718
|
+
...te,
|
|
2719
|
+
..._e
|
|
2717
2720
|
},
|
|
2718
|
-
children:
|
|
2721
|
+
children: yt
|
|
2719
2722
|
}
|
|
2720
2723
|
);
|
|
2721
|
-
const
|
|
2724
|
+
const se = y.network, we = se ? je(se) : null, xt = (we == null ? void 0 : we.shortName) || (we == null ? void 0 : we.name) || se;
|
|
2722
2725
|
return /* @__PURE__ */ r(
|
|
2723
2726
|
"div",
|
|
2724
2727
|
{
|
|
2725
|
-
className: `${
|
|
2728
|
+
className: `${ht} relative w-full max-w-[390px] min-h-[640px] overflow-hidden flex flex-col select-none transition-colors duration-300 ${t}`,
|
|
2726
2729
|
style: {
|
|
2727
2730
|
fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',
|
|
2728
2731
|
...ge,
|
|
2729
|
-
...
|
|
2730
|
-
...
|
|
2731
|
-
...
|
|
2732
|
+
...ft,
|
|
2733
|
+
...te,
|
|
2734
|
+
..._e
|
|
2732
2735
|
},
|
|
2733
2736
|
children: [
|
|
2734
|
-
|
|
2735
|
-
|
|
2737
|
+
b && /* @__PURE__ */ e("div", { className: `flex justify-end items-center px-5 pt-3 ${w ? "pb-1" : "pb-5"}`, children: /* @__PURE__ */ e(Rn, { onClick: () => Z("settings") }) }),
|
|
2738
|
+
w ? /* @__PURE__ */ r("div", { className: "flex flex-col items-center pt-3 pb-5", children: [
|
|
2736
2739
|
/* @__PURE__ */ r("div", { className: "flex", style: { width: 165 }, children: [
|
|
2737
2740
|
/* @__PURE__ */ e(
|
|
2738
2741
|
"button",
|
|
2739
2742
|
{
|
|
2740
|
-
onClick: () =>
|
|
2743
|
+
onClick: () => mt("buy"),
|
|
2741
2744
|
className: "flex-1 pb-2.5 text-[16px] font-medium text-center transition-colors duration-200",
|
|
2742
|
-
style: { color:
|
|
2745
|
+
style: { color: Ee === "buy" ? "var(--t-text)" : "var(--t-text-secondary)" },
|
|
2743
2746
|
children: "Buy"
|
|
2744
2747
|
}
|
|
2745
2748
|
),
|
|
2746
2749
|
/* @__PURE__ */ e(
|
|
2747
2750
|
"button",
|
|
2748
2751
|
{
|
|
2749
|
-
onClick: () =>
|
|
2752
|
+
onClick: () => mt("sell"),
|
|
2750
2753
|
className: "flex-1 pb-2.5 text-[16px] font-medium text-center transition-colors duration-200",
|
|
2751
|
-
style: { color:
|
|
2754
|
+
style: { color: Ee === "sell" ? "var(--t-text)" : "var(--t-text-secondary)" },
|
|
2752
2755
|
children: "Sell"
|
|
2753
2756
|
}
|
|
2754
2757
|
)
|
|
@@ -2761,14 +2764,14 @@ function Xn({
|
|
|
2761
2764
|
className: "absolute top-0 h-full transition-all duration-300 ease-in-out",
|
|
2762
2765
|
style: {
|
|
2763
2766
|
width: "50%",
|
|
2764
|
-
left:
|
|
2767
|
+
left: Ee === "buy" ? "0%" : "50%",
|
|
2765
2768
|
background: "var(--t-accent)"
|
|
2766
2769
|
}
|
|
2767
2770
|
}
|
|
2768
2771
|
)
|
|
2769
2772
|
] })
|
|
2770
2773
|
] }) : null,
|
|
2771
|
-
|
|
2774
|
+
T || K || H ? /* @__PURE__ */ e(_n, {}) : /* @__PURE__ */ r("div", { className: "flex-1 overflow-hidden px-5 flex flex-col tab-fade-in", children: [
|
|
2772
2775
|
/* @__PURE__ */ r(
|
|
2773
2776
|
"div",
|
|
2774
2777
|
{
|
|
@@ -2776,7 +2779,7 @@ function Xn({
|
|
|
2776
2779
|
style: {
|
|
2777
2780
|
background: "var(--t-surface)",
|
|
2778
2781
|
borderRadius: 5,
|
|
2779
|
-
border: xe &&
|
|
2782
|
+
border: xe && ut ? "1px solid #EF4444" : "1px solid transparent",
|
|
2780
2783
|
minHeight: 102
|
|
2781
2784
|
},
|
|
2782
2785
|
children: [
|
|
@@ -2785,22 +2788,22 @@ function Xn({
|
|
|
2785
2788
|
/* @__PURE__ */ e(
|
|
2786
2789
|
"input",
|
|
2787
2790
|
{
|
|
2788
|
-
ref:
|
|
2791
|
+
ref: De,
|
|
2789
2792
|
type: "text",
|
|
2790
|
-
value:
|
|
2791
|
-
onChange:
|
|
2792
|
-
onBlur: () =>
|
|
2793
|
-
placeholder:
|
|
2793
|
+
value: qe,
|
|
2794
|
+
onChange: Yt,
|
|
2795
|
+
onBlur: () => Re(!0),
|
|
2796
|
+
placeholder: _ ? "250" : "0.01",
|
|
2794
2797
|
className: "bg-transparent outline-none w-0 flex-1 mr-3",
|
|
2795
2798
|
style: { color: "var(--t-text)", fontSize: 24, fontWeight: 600, lineHeight: "32px", padding: 0, border: "none", borderRadius: 0, backgroundColor: "transparent", height: "auto", width: 0 },
|
|
2796
2799
|
inputMode: "decimal",
|
|
2797
|
-
disabled: !!((
|
|
2800
|
+
disabled: !!((Ct = k == null ? void 0 : k.sourceAmount) != null && Ct.locked)
|
|
2798
2801
|
}
|
|
2799
2802
|
),
|
|
2800
|
-
|
|
2803
|
+
_ ? /* @__PURE__ */ r(
|
|
2801
2804
|
"button",
|
|
2802
2805
|
{
|
|
2803
|
-
onClick: () =>
|
|
2806
|
+
onClick: () => Z("fiat"),
|
|
2804
2807
|
className: "flex items-center gap-1.5 shrink-0 transition-colors",
|
|
2805
2808
|
style: {
|
|
2806
2809
|
background: "var(--t-pill-bg)",
|
|
@@ -2809,18 +2812,18 @@ function Xn({
|
|
|
2809
2812
|
paddingLeft: 10,
|
|
2810
2813
|
paddingRight: 10
|
|
2811
2814
|
},
|
|
2812
|
-
disabled: !!((
|
|
2815
|
+
disabled: !!((vt = k == null ? void 0 : k.sourceCurrency) != null && vt.locked),
|
|
2813
2816
|
children: [
|
|
2814
|
-
/* @__PURE__ */ e(
|
|
2815
|
-
/* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color:
|
|
2816
|
-
/* @__PURE__ */ e(
|
|
2817
|
+
/* @__PURE__ */ e(ot, { currencyCode: ee, size: 16, baseUrl: F }),
|
|
2818
|
+
/* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: Ke }, children: ee }),
|
|
2819
|
+
/* @__PURE__ */ e(Me, {})
|
|
2817
2820
|
]
|
|
2818
2821
|
}
|
|
2819
2822
|
) : /* @__PURE__ */ r("div", { className: "flex flex-col items-end shrink-0", children: [
|
|
2820
2823
|
/* @__PURE__ */ r(
|
|
2821
2824
|
"button",
|
|
2822
2825
|
{
|
|
2823
|
-
onClick: () =>
|
|
2826
|
+
onClick: () => Z("crypto"),
|
|
2824
2827
|
className: "flex items-center gap-1.5 transition-colors",
|
|
2825
2828
|
style: {
|
|
2826
2829
|
background: "var(--t-pill-bg)",
|
|
@@ -2829,34 +2832,34 @@ function Xn({
|
|
|
2829
2832
|
paddingLeft: 10,
|
|
2830
2833
|
paddingRight: 10
|
|
2831
2834
|
},
|
|
2832
|
-
disabled: !!((
|
|
2835
|
+
disabled: !!((bt = k == null ? void 0 : k.destinationCurrency) != null && bt.locked),
|
|
2833
2836
|
children: [
|
|
2834
|
-
/* @__PURE__ */ e(
|
|
2835
|
-
/* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color:
|
|
2836
|
-
/* @__PURE__ */ e(
|
|
2837
|
+
/* @__PURE__ */ e(Bt, { ticker: V, size: 16, baseUrl: F }),
|
|
2838
|
+
/* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: Ke }, children: V }),
|
|
2839
|
+
/* @__PURE__ */ e(Me, {})
|
|
2837
2840
|
]
|
|
2838
2841
|
}
|
|
2839
2842
|
),
|
|
2840
|
-
|
|
2843
|
+
se && /* @__PURE__ */ r("div", { className: "flex items-center gap-1 mt-1.5 mr-0.5", children: [
|
|
2841
2844
|
/* @__PURE__ */ e("div", { className: "rounded-full", style: { width: 14, height: 14, background: "#ffffff" }, children: /* @__PURE__ */ e(
|
|
2842
2845
|
"img",
|
|
2843
2846
|
{
|
|
2844
|
-
src:
|
|
2845
|
-
alt:
|
|
2847
|
+
src: at(se, F),
|
|
2848
|
+
alt: se,
|
|
2846
2849
|
width: 14,
|
|
2847
2850
|
height: 14,
|
|
2848
2851
|
className: "rounded-full",
|
|
2849
2852
|
style: { width: 14, height: 14 }
|
|
2850
2853
|
}
|
|
2851
2854
|
) }),
|
|
2852
|
-
/* @__PURE__ */ e("span", { className: "text-[12px]", style: { color: "var(--t-text-muted)" }, children:
|
|
2855
|
+
/* @__PURE__ */ e("span", { className: "text-[12px]", style: { color: "var(--t-text-muted)" }, children: xt })
|
|
2853
2856
|
] })
|
|
2854
2857
|
] })
|
|
2855
2858
|
] })
|
|
2856
2859
|
]
|
|
2857
2860
|
}
|
|
2858
2861
|
),
|
|
2859
|
-
xe &&
|
|
2862
|
+
xe && ut && /* @__PURE__ */ e("div", { className: "text-[12px] mt-1.5 px-[2px]", style: { color: "#EF4444" }, children: fe || (ct ? "Amount should be more than 0" : _ ? `Minimum amount is ${It} ${ee}` : `Minimum amount is ${Mt} ${V}`) }),
|
|
2860
2863
|
/* @__PURE__ */ r(
|
|
2861
2864
|
"div",
|
|
2862
2865
|
{
|
|
@@ -2873,20 +2876,20 @@ function Xn({
|
|
|
2873
2876
|
children: [
|
|
2874
2877
|
/* @__PURE__ */ e("div", { className: "text-[13px] mb-2.5", style: { color: "var(--t-text-secondary)" }, children: "You get" }),
|
|
2875
2878
|
/* @__PURE__ */ r("div", { className: "flex items-start justify-between", children: [
|
|
2876
|
-
pe && !
|
|
2877
|
-
|
|
2879
|
+
pe && !I ? /* @__PURE__ */ e(B, { w: 180, h: 32 }) : /* @__PURE__ */ e(
|
|
2880
|
+
Kn,
|
|
2878
2881
|
{
|
|
2879
|
-
value:
|
|
2882
|
+
value: Q > 0 ? jt : "0",
|
|
2880
2883
|
height: 32,
|
|
2881
2884
|
className: "font-semibold",
|
|
2882
|
-
style: { color:
|
|
2885
|
+
style: { color: Q > 0 ? "var(--t-text)" : "var(--t-text-muted)", fontSize: 24 }
|
|
2883
2886
|
}
|
|
2884
2887
|
),
|
|
2885
|
-
|
|
2888
|
+
_ ? /* @__PURE__ */ r("div", { className: "flex flex-col items-end shrink-0", children: [
|
|
2886
2889
|
/* @__PURE__ */ r(
|
|
2887
2890
|
"button",
|
|
2888
2891
|
{
|
|
2889
|
-
onClick: () =>
|
|
2892
|
+
onClick: () => Z("crypto"),
|
|
2890
2893
|
className: "flex items-center gap-1.5 transition-colors",
|
|
2891
2894
|
style: {
|
|
2892
2895
|
background: "var(--t-pill-bg)",
|
|
@@ -2895,32 +2898,32 @@ function Xn({
|
|
|
2895
2898
|
paddingLeft: 10,
|
|
2896
2899
|
paddingRight: 10
|
|
2897
2900
|
},
|
|
2898
|
-
disabled: !!((
|
|
2901
|
+
disabled: !!((Nt = k == null ? void 0 : k.destinationCurrency) != null && Nt.locked),
|
|
2899
2902
|
children: [
|
|
2900
|
-
/* @__PURE__ */ e(
|
|
2901
|
-
/* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color:
|
|
2902
|
-
/* @__PURE__ */ e(
|
|
2903
|
+
/* @__PURE__ */ e(Bt, { ticker: V, size: 16, baseUrl: F }),
|
|
2904
|
+
/* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: Ke }, children: V }),
|
|
2905
|
+
/* @__PURE__ */ e(Me, {})
|
|
2903
2906
|
]
|
|
2904
2907
|
}
|
|
2905
2908
|
),
|
|
2906
|
-
|
|
2909
|
+
se && /* @__PURE__ */ r("div", { className: "flex items-center gap-1 mt-1.5 mr-0.5", children: [
|
|
2907
2910
|
/* @__PURE__ */ e("div", { className: "rounded-full", style: { width: 14, height: 14, background: "#ffffff" }, children: /* @__PURE__ */ e(
|
|
2908
2911
|
"img",
|
|
2909
2912
|
{
|
|
2910
|
-
src:
|
|
2911
|
-
alt:
|
|
2913
|
+
src: at(se, F),
|
|
2914
|
+
alt: se,
|
|
2912
2915
|
width: 14,
|
|
2913
2916
|
height: 14,
|
|
2914
2917
|
className: "rounded-full",
|
|
2915
2918
|
style: { width: 14, height: 14 }
|
|
2916
2919
|
}
|
|
2917
2920
|
) }),
|
|
2918
|
-
/* @__PURE__ */ e("span", { className: "text-[12px]", style: { color: "var(--t-text-muted)" }, children:
|
|
2921
|
+
/* @__PURE__ */ e("span", { className: "text-[12px]", style: { color: "var(--t-text-muted)" }, children: xt })
|
|
2919
2922
|
] })
|
|
2920
2923
|
] }) : /* @__PURE__ */ r(
|
|
2921
2924
|
"button",
|
|
2922
2925
|
{
|
|
2923
|
-
onClick: () =>
|
|
2926
|
+
onClick: () => Z("fiat"),
|
|
2924
2927
|
className: "flex items-center gap-1.5 shrink-0 transition-colors",
|
|
2925
2928
|
style: {
|
|
2926
2929
|
background: "var(--t-pill-bg)",
|
|
@@ -2929,11 +2932,11 @@ function Xn({
|
|
|
2929
2932
|
paddingLeft: 10,
|
|
2930
2933
|
paddingRight: 10
|
|
2931
2934
|
},
|
|
2932
|
-
disabled: !!((
|
|
2935
|
+
disabled: !!((Et = k == null ? void 0 : k.sourceCurrency) != null && Et.locked),
|
|
2933
2936
|
children: [
|
|
2934
|
-
/* @__PURE__ */ e(
|
|
2935
|
-
/* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color:
|
|
2936
|
-
/* @__PURE__ */ e(
|
|
2937
|
+
/* @__PURE__ */ e(ot, { currencyCode: ee, size: 16, baseUrl: F }),
|
|
2938
|
+
/* @__PURE__ */ e("span", { className: "text-[13px] font-medium", style: { color: Ke }, children: ee }),
|
|
2939
|
+
/* @__PURE__ */ e(Me, {})
|
|
2937
2940
|
]
|
|
2938
2941
|
}
|
|
2939
2942
|
)
|
|
@@ -2941,7 +2944,7 @@ function Xn({
|
|
|
2941
2944
|
]
|
|
2942
2945
|
}
|
|
2943
2946
|
),
|
|
2944
|
-
|
|
2947
|
+
Le && Q > 0 && (C == null ? void 0 : C.bestQuote) && /* @__PURE__ */ r(
|
|
2945
2948
|
"div",
|
|
2946
2949
|
{
|
|
2947
2950
|
className: "flex items-start gap-2 mt-[2px] px-[14px] py-[10px]",
|
|
@@ -2953,15 +2956,15 @@ function Xn({
|
|
|
2953
2956
|
] }),
|
|
2954
2957
|
/* @__PURE__ */ r("span", { children: [
|
|
2955
2958
|
"You will be charged for ",
|
|
2956
|
-
|
|
2959
|
+
it,
|
|
2957
2960
|
" ",
|
|
2958
|
-
|
|
2961
|
+
V,
|
|
2959
2962
|
", the rest up to ",
|
|
2960
|
-
|
|
2963
|
+
rt(Q),
|
|
2961
2964
|
" ",
|
|
2962
|
-
|
|
2965
|
+
ee,
|
|
2963
2966
|
" will be credited to your ",
|
|
2964
|
-
|
|
2967
|
+
j,
|
|
2965
2968
|
" account"
|
|
2966
2969
|
] })
|
|
2967
2970
|
]
|
|
@@ -2973,35 +2976,38 @@ function Xn({
|
|
|
2973
2976
|
className: "flex items-center justify-between mt-[2px] px-[18px] pt-[12px] pb-[14px]",
|
|
2974
2977
|
style: {
|
|
2975
2978
|
background: "var(--t-surface)",
|
|
2976
|
-
...(
|
|
2979
|
+
...(wt = A == null ? void 0 : A.paymentMethods) != null && wt.length ? {} : { borderBottomLeftRadius: 5, borderBottomRightRadius: 5 }
|
|
2977
2980
|
},
|
|
2978
|
-
children: /* @__PURE__ */ e("span", { className: "text-[12px]", style: { color:
|
|
2981
|
+
children: /* @__PURE__ */ e("span", { className: "text-[12px]", style: { color: g ? "var(--t-success)" : "var(--t-text-secondary)" }, children: Wt || " " })
|
|
2979
2982
|
}
|
|
2980
2983
|
),
|
|
2981
|
-
(
|
|
2982
|
-
|
|
2984
|
+
(A == null ? void 0 : A.paymentMethods) && A.paymentMethods.length > 0 && /* @__PURE__ */ e("div", { className: "mt-[2px]", children: /* @__PURE__ */ e(
|
|
2985
|
+
Mn,
|
|
2983
2986
|
{
|
|
2984
|
-
methods:
|
|
2987
|
+
methods: A.paymentMethods,
|
|
2985
2988
|
selectedId: y.paymentMethodId,
|
|
2986
|
-
onOpenModal: () =>
|
|
2989
|
+
onOpenModal: () => Z("payment"),
|
|
2987
2990
|
fiatCurrency: y.fiatCurrency
|
|
2988
2991
|
}
|
|
2989
2992
|
) }),
|
|
2990
2993
|
/* @__PURE__ */ r("div", { className: "mt-8", children: [
|
|
2991
|
-
/* @__PURE__ */ e("div", { className: "text-[13px] mb-2.5", style: { color: "var(--t-text-secondary)" }, children:
|
|
2994
|
+
/* @__PURE__ */ e("div", { className: "text-[13px] mb-2.5", style: { color: "var(--t-text-secondary)" }, children: _ ? "Receiving wallet address" : "Sending wallet address" }),
|
|
2992
2995
|
/* @__PURE__ */ e(
|
|
2993
2996
|
"input",
|
|
2994
2997
|
{
|
|
2995
2998
|
type: "text",
|
|
2996
2999
|
value: y.walletAddress,
|
|
2997
|
-
onChange: (
|
|
2998
|
-
|
|
2999
|
-
|
|
3000
|
+
onChange: (x) => s({ type: "SET_WALLET_ADDRESS", address: x.target.value }),
|
|
3001
|
+
onFocus: () => Oe(!0),
|
|
3002
|
+
onBlur: () => {
|
|
3003
|
+
Oe(!1), Ne(!0);
|
|
3004
|
+
},
|
|
3005
|
+
placeholder: _ ? "Enter your receiving address" : "Enter your sending address",
|
|
3000
3006
|
spellCheck: !1,
|
|
3001
3007
|
autoComplete: "off",
|
|
3002
3008
|
className: "w-full bg-transparent text-[13px] outline-none transition-colors",
|
|
3003
3009
|
style: {
|
|
3004
|
-
border: y.walletError ||
|
|
3010
|
+
border: y.walletError || Te && !et ? "1px solid #EF4444" : Ze ? "1px solid var(--t-border-focus)" : "1px solid var(--t-border)",
|
|
3005
3011
|
borderRadius: 3.5,
|
|
3006
3012
|
height: 47,
|
|
3007
3013
|
padding: "0 14px",
|
|
@@ -3009,61 +3015,61 @@ function Xn({
|
|
|
3009
3015
|
fontSize: 13,
|
|
3010
3016
|
backgroundColor: "transparent"
|
|
3011
3017
|
},
|
|
3012
|
-
disabled: !!((
|
|
3018
|
+
disabled: !!((At = k == null ? void 0 : k.destinationAddress) != null && At.locked)
|
|
3013
3019
|
}
|
|
3014
3020
|
),
|
|
3015
|
-
y.walletError ? /* @__PURE__ */ e("div", { className: "text-[12px] mt-1.5", style: { color: "#EF4444" }, children: y.walletError }) :
|
|
3021
|
+
y.walletError ? /* @__PURE__ */ e("div", { className: "text-[12px] mt-1.5", style: { color: "#EF4444" }, children: y.walletError }) : Te && !et && !ke ? /* @__PURE__ */ e("div", { className: "text-[12px] mt-1.5", style: { color: "#EF4444" }, children: "Enter a valid wallet address" }) : ke && y.walletAddress.trim().length >= 10 ? /* @__PURE__ */ e("div", { className: "text-[12px] mt-1.5", style: { color: "var(--t-text-muted)" }, children: "Validating address..." }) : null
|
|
3016
3022
|
] }),
|
|
3017
3023
|
/* @__PURE__ */ e("div", { className: "flex-1" }),
|
|
3018
3024
|
/* @__PURE__ */ e(
|
|
3019
3025
|
"button",
|
|
3020
3026
|
{
|
|
3021
|
-
disabled: !
|
|
3022
|
-
onClick:
|
|
3027
|
+
disabled: !Ue || ae || I,
|
|
3028
|
+
onClick: Jt,
|
|
3023
3029
|
className: "w-full font-semibold text-[16px] transition-all mt-4",
|
|
3024
3030
|
style: {
|
|
3025
3031
|
height: 60,
|
|
3026
3032
|
borderRadius: 5,
|
|
3027
3033
|
background: "var(--t-cta-bg)",
|
|
3028
3034
|
color: "var(--t-cta-text)",
|
|
3029
|
-
opacity:
|
|
3030
|
-
cursor:
|
|
3035
|
+
opacity: Ue && !ae && !I ? 1 : 0.4,
|
|
3036
|
+
cursor: Ue && !ae && !I ? "pointer" : "not-allowed"
|
|
3031
3037
|
},
|
|
3032
|
-
children:
|
|
3038
|
+
children: I ? "Getting best price..." : ae ? "Processing..." : _ ? `Buy ${V}` : `Sell ${V}`
|
|
3033
3039
|
}
|
|
3034
3040
|
),
|
|
3035
3041
|
/* @__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" }) })
|
|
3036
|
-
] },
|
|
3037
|
-
/* @__PURE__ */ e(
|
|
3038
|
-
var
|
|
3042
|
+
] }, Ee),
|
|
3043
|
+
/* @__PURE__ */ e($e, { isOpen: W === "fiat", onClose: () => Z(null), children: (x) => {
|
|
3044
|
+
var E;
|
|
3039
3045
|
return /* @__PURE__ */ e(
|
|
3040
|
-
|
|
3046
|
+
Vn,
|
|
3041
3047
|
{
|
|
3042
|
-
onClose:
|
|
3048
|
+
onClose: x,
|
|
3043
3049
|
onSelect: (R) => {
|
|
3044
|
-
|
|
3050
|
+
Zt(R), x();
|
|
3045
3051
|
},
|
|
3046
|
-
currencies: (
|
|
3052
|
+
currencies: (E = A == null ? void 0 : A.fiats) == null ? void 0 : E.map((R) => ({ code: R.code, name: R.code })),
|
|
3047
3053
|
assetBaseUrl: F,
|
|
3048
3054
|
selectedCode: y.fiatCurrency
|
|
3049
3055
|
}
|
|
3050
3056
|
);
|
|
3051
3057
|
} }),
|
|
3052
|
-
/* @__PURE__ */ e(
|
|
3053
|
-
var
|
|
3058
|
+
/* @__PURE__ */ e($e, { isOpen: W === "crypto", onClose: () => Z(null), children: (x) => {
|
|
3059
|
+
var E;
|
|
3054
3060
|
return /* @__PURE__ */ e(
|
|
3055
|
-
|
|
3061
|
+
Xn,
|
|
3056
3062
|
{
|
|
3057
|
-
onClose:
|
|
3058
|
-
onSelect: (R,
|
|
3059
|
-
|
|
3063
|
+
onClose: x,
|
|
3064
|
+
onSelect: (R, M) => {
|
|
3065
|
+
Qt(R, M), x();
|
|
3060
3066
|
},
|
|
3061
|
-
cryptos: (
|
|
3062
|
-
var
|
|
3067
|
+
cryptos: (E = A == null ? void 0 : A.cryptos) == null ? void 0 : E.map((R) => {
|
|
3068
|
+
var M;
|
|
3063
3069
|
return {
|
|
3064
3070
|
code: R.code,
|
|
3065
3071
|
name: R.code,
|
|
3066
|
-
networks: (
|
|
3072
|
+
networks: (M = R.networks) == null ? void 0 : M.map((oe) => ({ code: oe.id, name: oe.name }))
|
|
3067
3073
|
};
|
|
3068
3074
|
}),
|
|
3069
3075
|
assetBaseUrl: F,
|
|
@@ -3072,29 +3078,29 @@ function Xn({
|
|
|
3072
3078
|
}
|
|
3073
3079
|
);
|
|
3074
3080
|
} }),
|
|
3075
|
-
/* @__PURE__ */ e(
|
|
3076
|
-
var
|
|
3081
|
+
/* @__PURE__ */ e($e, { isOpen: W === "payment", onClose: () => Z(null), children: (x) => {
|
|
3082
|
+
var E;
|
|
3077
3083
|
return /* @__PURE__ */ e(
|
|
3078
|
-
|
|
3084
|
+
$n,
|
|
3079
3085
|
{
|
|
3080
|
-
methods: ((
|
|
3086
|
+
methods: ((E = A == null ? void 0 : A.paymentMethods) == null ? void 0 : E.filter((R) => R.supportedFiats.includes(y.fiatCurrency))) || [],
|
|
3081
3087
|
selectedId: y.paymentMethodId,
|
|
3082
3088
|
onSelect: (R) => {
|
|
3083
|
-
|
|
3089
|
+
zt(R), x();
|
|
3084
3090
|
},
|
|
3085
|
-
onClose:
|
|
3091
|
+
onClose: x
|
|
3086
3092
|
}
|
|
3087
3093
|
);
|
|
3088
3094
|
} }),
|
|
3089
|
-
/* @__PURE__ */ e(
|
|
3090
|
-
|
|
3095
|
+
/* @__PURE__ */ e($e, { isOpen: W === "settings", onClose: () => Z(null), children: (x) => /* @__PURE__ */ e(
|
|
3096
|
+
Gn,
|
|
3091
3097
|
{
|
|
3092
|
-
onClose:
|
|
3093
|
-
darkMode:
|
|
3094
|
-
onToggleDarkMode:
|
|
3098
|
+
onClose: x,
|
|
3099
|
+
darkMode: re,
|
|
3100
|
+
onToggleDarkMode: ue,
|
|
3095
3101
|
skinId: ye,
|
|
3096
|
-
onSelectSkin: (
|
|
3097
|
-
|
|
3102
|
+
onSelectSkin: (E) => {
|
|
3103
|
+
Ye(E);
|
|
3098
3104
|
},
|
|
3099
3105
|
showThemeToggle: S
|
|
3100
3106
|
}
|
|
@@ -3103,7 +3109,7 @@ function Xn({
|
|
|
3103
3109
|
}
|
|
3104
3110
|
);
|
|
3105
3111
|
}
|
|
3106
|
-
function
|
|
3112
|
+
function Zn({
|
|
3107
3113
|
projectId: t,
|
|
3108
3114
|
apiUrl: n,
|
|
3109
3115
|
assetBaseUrl: a,
|
|
@@ -3111,43 +3117,43 @@ function $n({
|
|
|
3111
3117
|
customerId: l,
|
|
3112
3118
|
brandId: i,
|
|
3113
3119
|
defaultFiatCurrency: m,
|
|
3114
|
-
defaultCryptoCurrency:
|
|
3120
|
+
defaultCryptoCurrency: c,
|
|
3115
3121
|
defaultNetwork: d,
|
|
3116
3122
|
defaultFiatAmount: p,
|
|
3117
3123
|
defaultCryptoAmount: h,
|
|
3118
3124
|
defaultWalletAddress: u,
|
|
3119
3125
|
defaultGateway: f,
|
|
3120
|
-
fieldLocks:
|
|
3121
|
-
statusPollInterval:
|
|
3122
|
-
onComplete:
|
|
3126
|
+
fieldLocks: g,
|
|
3127
|
+
statusPollInterval: w,
|
|
3128
|
+
onComplete: b,
|
|
3123
3129
|
onError: S,
|
|
3124
3130
|
className: P,
|
|
3125
|
-
theme:
|
|
3131
|
+
theme: $,
|
|
3126
3132
|
skinId: U,
|
|
3127
|
-
accentColor:
|
|
3128
|
-
bgColor:
|
|
3129
|
-
bgImage:
|
|
3130
|
-
borderColor:
|
|
3133
|
+
accentColor: Y,
|
|
3134
|
+
bgColor: z,
|
|
3135
|
+
bgImage: j,
|
|
3136
|
+
borderColor: de,
|
|
3131
3137
|
borderRadius: y,
|
|
3132
|
-
surfaceColor:
|
|
3133
|
-
inputBgColor:
|
|
3134
|
-
textColor:
|
|
3135
|
-
textSecondaryColor:
|
|
3138
|
+
surfaceColor: s,
|
|
3139
|
+
inputBgColor: A,
|
|
3140
|
+
textColor: H,
|
|
3141
|
+
textSecondaryColor: C,
|
|
3136
3142
|
textMutedColor: pe,
|
|
3137
|
-
successColor:
|
|
3138
|
-
showFlowToggle:
|
|
3139
|
-
showSettings:
|
|
3140
|
-
showThemeToggle:
|
|
3143
|
+
successColor: ie,
|
|
3144
|
+
showFlowToggle: ne,
|
|
3145
|
+
showSettings: ve,
|
|
3146
|
+
showThemeToggle: ae,
|
|
3141
3147
|
autoRedirect: fe,
|
|
3142
3148
|
explorerUrl: k,
|
|
3143
|
-
doneButtonText:
|
|
3149
|
+
doneButtonText: be,
|
|
3144
3150
|
supportEmail: F,
|
|
3145
|
-
stablecoinParity:
|
|
3146
|
-
partnerName:
|
|
3151
|
+
stablecoinParity: re,
|
|
3152
|
+
partnerName: ue,
|
|
3147
3153
|
onDone: ye
|
|
3148
3154
|
}) {
|
|
3149
3155
|
return /* @__PURE__ */ e(
|
|
3150
|
-
|
|
3156
|
+
un,
|
|
3151
3157
|
{
|
|
3152
3158
|
projectId: t,
|
|
3153
3159
|
apiUrl: n,
|
|
@@ -3156,56 +3162,56 @@ function $n({
|
|
|
3156
3162
|
customerId: l,
|
|
3157
3163
|
brandId: i,
|
|
3158
3164
|
defaultFiatCurrency: m,
|
|
3159
|
-
defaultCryptoCurrency:
|
|
3165
|
+
defaultCryptoCurrency: c,
|
|
3160
3166
|
defaultNetwork: d,
|
|
3161
3167
|
defaultFiatAmount: p,
|
|
3162
3168
|
defaultCryptoAmount: h,
|
|
3163
3169
|
defaultWalletAddress: u,
|
|
3164
3170
|
defaultGateway: f,
|
|
3165
|
-
fieldLocks:
|
|
3166
|
-
statusPollInterval:
|
|
3167
|
-
onComplete:
|
|
3171
|
+
fieldLocks: g,
|
|
3172
|
+
statusPollInterval: w,
|
|
3173
|
+
onComplete: b,
|
|
3168
3174
|
onError: S,
|
|
3169
3175
|
children: /* @__PURE__ */ e(
|
|
3170
|
-
|
|
3176
|
+
Yn,
|
|
3171
3177
|
{
|
|
3172
3178
|
className: P,
|
|
3173
|
-
theme:
|
|
3179
|
+
theme: $,
|
|
3174
3180
|
skinId: U,
|
|
3175
|
-
accentColor:
|
|
3176
|
-
bgColor:
|
|
3177
|
-
bgImage:
|
|
3178
|
-
borderColor:
|
|
3181
|
+
accentColor: Y,
|
|
3182
|
+
bgColor: z,
|
|
3183
|
+
bgImage: j,
|
|
3184
|
+
borderColor: de,
|
|
3179
3185
|
borderRadius: y,
|
|
3180
|
-
surfaceColor:
|
|
3181
|
-
inputBgColor:
|
|
3182
|
-
textColor:
|
|
3183
|
-
textSecondaryColor:
|
|
3186
|
+
surfaceColor: s,
|
|
3187
|
+
inputBgColor: A,
|
|
3188
|
+
textColor: H,
|
|
3189
|
+
textSecondaryColor: C,
|
|
3184
3190
|
textMutedColor: pe,
|
|
3185
|
-
successColor:
|
|
3186
|
-
showFlowToggle:
|
|
3187
|
-
showSettings:
|
|
3188
|
-
showThemeToggle:
|
|
3191
|
+
successColor: ie,
|
|
3192
|
+
showFlowToggle: ne,
|
|
3193
|
+
showSettings: ve,
|
|
3194
|
+
showThemeToggle: ae,
|
|
3189
3195
|
autoRedirect: fe,
|
|
3190
3196
|
explorerUrl: k,
|
|
3191
|
-
doneButtonText:
|
|
3197
|
+
doneButtonText: be,
|
|
3192
3198
|
supportEmail: F,
|
|
3193
|
-
stablecoinParity:
|
|
3194
|
-
partnerName:
|
|
3199
|
+
stablecoinParity: re,
|
|
3200
|
+
partnerName: ue,
|
|
3195
3201
|
onDone: ye
|
|
3196
3202
|
}
|
|
3197
3203
|
)
|
|
3198
3204
|
}
|
|
3199
3205
|
);
|
|
3200
3206
|
}
|
|
3201
|
-
function
|
|
3207
|
+
function oa({
|
|
3202
3208
|
submitButtonText: t,
|
|
3203
3209
|
rateRefreshInterval: n,
|
|
3204
3210
|
...a
|
|
3205
3211
|
}) {
|
|
3206
|
-
return /* @__PURE__ */ e(
|
|
3212
|
+
return /* @__PURE__ */ e(Zn, { ...a });
|
|
3207
3213
|
}
|
|
3208
|
-
function
|
|
3214
|
+
function la({
|
|
3209
3215
|
skin: t,
|
|
3210
3216
|
active: n,
|
|
3211
3217
|
onClick: a,
|
|
@@ -3238,13 +3244,13 @@ function na({
|
|
|
3238
3244
|
}
|
|
3239
3245
|
);
|
|
3240
3246
|
}
|
|
3241
|
-
function
|
|
3247
|
+
function Qn({ quote: t }) {
|
|
3242
3248
|
return t.isBestRate ? /* @__PURE__ */ e("div", { className: "text-[12px]", style: { color: "var(--t-text-secondary)" }, children: "Best price" }) : t.isRecommended ? /* @__PURE__ */ e("div", { className: "text-[12px]", style: { color: "var(--t-text-secondary)" }, children: "Recommended" }) : t.rank && t.rank <= 3 ? /* @__PURE__ */ r("div", { className: "text-[12px]", style: { color: "var(--t-text-secondary)" }, children: [
|
|
3243
3249
|
"#",
|
|
3244
3250
|
t.rank
|
|
3245
3251
|
] }) : null;
|
|
3246
3252
|
}
|
|
3247
|
-
function
|
|
3253
|
+
function zn({ quote: t }) {
|
|
3248
3254
|
return t.gatewayLogo ? /* @__PURE__ */ e(
|
|
3249
3255
|
"img",
|
|
3250
3256
|
{
|
|
@@ -3255,9 +3261,9 @@ function Wn({ quote: t }) {
|
|
|
3255
3261
|
className: "rounded-full shrink-0",
|
|
3256
3262
|
style: { width: 36, height: 36 }
|
|
3257
3263
|
}
|
|
3258
|
-
) : /* @__PURE__ */ e(
|
|
3264
|
+
) : /* @__PURE__ */ e(lt, { size: 36 });
|
|
3259
3265
|
}
|
|
3260
|
-
function
|
|
3266
|
+
function Jn() {
|
|
3261
3267
|
return /* @__PURE__ */ e("div", { className: "space-y-2", children: [0, 1, 2].map((t) => /* @__PURE__ */ r(
|
|
3262
3268
|
"div",
|
|
3263
3269
|
{
|
|
@@ -3270,34 +3276,34 @@ function Gn() {
|
|
|
3270
3276
|
background: "var(--t-surface)"
|
|
3271
3277
|
},
|
|
3272
3278
|
children: [
|
|
3273
|
-
/* @__PURE__ */ e(
|
|
3279
|
+
/* @__PURE__ */ e(B, { w: 36, h: 36, className: "rounded-full shrink-0" }),
|
|
3274
3280
|
/* @__PURE__ */ r("div", { className: "flex-1", children: [
|
|
3275
|
-
/* @__PURE__ */ e(
|
|
3276
|
-
/* @__PURE__ */ e(
|
|
3281
|
+
/* @__PURE__ */ e(B, { w: 90, h: 14, className: "mb-1.5" }),
|
|
3282
|
+
/* @__PURE__ */ e(B, { w: 60, h: 12 })
|
|
3277
3283
|
] }),
|
|
3278
3284
|
/* @__PURE__ */ r("div", { className: "text-right", children: [
|
|
3279
|
-
/* @__PURE__ */ e(
|
|
3280
|
-
/* @__PURE__ */ e(
|
|
3285
|
+
/* @__PURE__ */ e(B, { w: 40, h: 10, className: "mb-1.5" }),
|
|
3286
|
+
/* @__PURE__ */ e(B, { w: 80, h: 14 })
|
|
3281
3287
|
] })
|
|
3282
3288
|
]
|
|
3283
3289
|
},
|
|
3284
3290
|
t
|
|
3285
3291
|
)) });
|
|
3286
3292
|
}
|
|
3287
|
-
function
|
|
3293
|
+
function ia({
|
|
3288
3294
|
onClose: t,
|
|
3289
3295
|
onSelect: n,
|
|
3290
3296
|
quotes: a,
|
|
3291
3297
|
quotesLoading: o,
|
|
3292
3298
|
cryptoCurrency: l
|
|
3293
3299
|
}) {
|
|
3294
|
-
const [i, m] =
|
|
3300
|
+
const [i, m] = N(""), c = G(() => {
|
|
3295
3301
|
if (!(a != null && a.quotes)) return [];
|
|
3296
3302
|
const d = i.trim().toLowerCase();
|
|
3297
3303
|
return d ? a.quotes.filter((p) => p.gatewayName.toLowerCase().includes(d)) : a.quotes;
|
|
3298
3304
|
}, [a, i]);
|
|
3299
|
-
return /* @__PURE__ */ r(
|
|
3300
|
-
/* @__PURE__ */ e("div", { className: "flex justify-end px-5 pt-5", children: /* @__PURE__ */ e(
|
|
3305
|
+
return /* @__PURE__ */ r(le, { children: [
|
|
3306
|
+
/* @__PURE__ */ e("div", { className: "flex justify-end px-5 pt-5", children: /* @__PURE__ */ e(Be, { onClick: t }) }),
|
|
3301
3307
|
/* @__PURE__ */ e(
|
|
3302
3308
|
"h2",
|
|
3303
3309
|
{
|
|
@@ -3306,9 +3312,9 @@ function aa({
|
|
|
3306
3312
|
children: "Choose Ramp"
|
|
3307
3313
|
}
|
|
3308
3314
|
),
|
|
3309
|
-
/* @__PURE__ */ e(
|
|
3315
|
+
/* @__PURE__ */ e(Ge, { value: i, onChange: m }),
|
|
3310
3316
|
/* @__PURE__ */ r("div", { className: "flex-1 overflow-y-auto custom-scroll px-5 space-y-2", children: [
|
|
3311
|
-
o ? /* @__PURE__ */ e(
|
|
3317
|
+
o ? /* @__PURE__ */ e(Jn, {}) : c.length === 0 ? /* @__PURE__ */ e("div", { className: "text-center py-10 text-[14px]", style: { color: "var(--t-text-muted)" }, children: a && a.quotes.length === 0 ? "No quotes available for this request" : "No providers found" }) : c.map((d, p) => {
|
|
3312
3318
|
const h = p === 0, u = parseFloat(d.cryptoAmount), f = u >= 1 ? u.toFixed(4) : u.toPrecision(6);
|
|
3313
3319
|
return /* @__PURE__ */ r(
|
|
3314
3320
|
"button",
|
|
@@ -3324,10 +3330,10 @@ function aa({
|
|
|
3324
3330
|
background: h ? "transparent" : "var(--t-surface)"
|
|
3325
3331
|
},
|
|
3326
3332
|
children: [
|
|
3327
|
-
/* @__PURE__ */ e(
|
|
3333
|
+
/* @__PURE__ */ e(zn, { quote: d }),
|
|
3328
3334
|
/* @__PURE__ */ r("div", { className: "text-left flex-1 min-w-0", children: [
|
|
3329
3335
|
/* @__PURE__ */ e("div", { className: "font-medium text-[15px]", style: { color: "var(--t-text)" }, children: d.gatewayName }),
|
|
3330
|
-
/* @__PURE__ */ e(
|
|
3336
|
+
/* @__PURE__ */ e(Qn, { quote: d })
|
|
3331
3337
|
] }),
|
|
3332
3338
|
/* @__PURE__ */ r("div", { className: "text-right shrink-0", children: [
|
|
3333
3339
|
/* @__PURE__ */ e("div", { className: "text-[11px]", style: { color: "var(--t-text-secondary)" }, children: "You get" }),
|
|
@@ -3358,61 +3364,61 @@ function aa({
|
|
|
3358
3364
|
] });
|
|
3359
3365
|
}
|
|
3360
3366
|
export {
|
|
3361
|
-
|
|
3362
|
-
|
|
3363
|
-
|
|
3364
|
-
|
|
3365
|
-
|
|
3366
|
-
|
|
3367
|
-
|
|
3368
|
-
|
|
3369
|
-
|
|
3370
|
-
|
|
3371
|
-
|
|
3372
|
-
|
|
3373
|
-
|
|
3374
|
-
|
|
3375
|
-
|
|
3376
|
-
|
|
3377
|
-
|
|
3378
|
-
|
|
3379
|
-
|
|
3380
|
-
|
|
3381
|
-
|
|
3382
|
-
|
|
3383
|
-
|
|
3384
|
-
|
|
3385
|
-
|
|
3386
|
-
|
|
3387
|
-
|
|
3388
|
-
|
|
3389
|
-
|
|
3390
|
-
|
|
3391
|
-
|
|
3392
|
-
|
|
3393
|
-
|
|
3394
|
-
|
|
3395
|
-
|
|
3396
|
-
|
|
3397
|
-
|
|
3398
|
-
|
|
3399
|
-
|
|
3400
|
-
|
|
3401
|
-
|
|
3402
|
-
|
|
3403
|
-
|
|
3404
|
-
|
|
3405
|
-
|
|
3406
|
-
|
|
3407
|
-
|
|
3408
|
-
|
|
3409
|
-
|
|
3410
|
-
|
|
3411
|
-
|
|
3412
|
-
|
|
3413
|
-
|
|
3414
|
-
|
|
3415
|
-
|
|
3416
|
-
|
|
3367
|
+
Fn as AnimatedDigit,
|
|
3368
|
+
Kn as AnimatedNumber,
|
|
3369
|
+
vn as ApplePayIcon,
|
|
3370
|
+
Ie as BLOCKCHAINS,
|
|
3371
|
+
gn as BankIcon,
|
|
3372
|
+
xn as CRYPTO_CHAIN_COMBOS,
|
|
3373
|
+
Ut as CRYPTO_CURRENCIES,
|
|
3374
|
+
An as CardIcon,
|
|
3375
|
+
oa as CheckoutForm,
|
|
3376
|
+
Bn as CheckoutStep,
|
|
3377
|
+
Me as ChevronDown,
|
|
3378
|
+
Sn as ChevronRight,
|
|
3379
|
+
ia as ChooseRampModal,
|
|
3380
|
+
Be as CloseButton,
|
|
3381
|
+
ra as CoinifyIcon,
|
|
3382
|
+
Dn as CompleteStep,
|
|
3383
|
+
Un as ConfirmStep,
|
|
3384
|
+
Xn as CryptoCurrencyModal,
|
|
3385
|
+
Bt as CryptoIcon,
|
|
3386
|
+
Tn as DarkModeIcon,
|
|
3387
|
+
Pn as ErrorStep,
|
|
3388
|
+
Tt as FIAT_CURRENCIES,
|
|
3389
|
+
hn as FIAT_TO_COUNTRY,
|
|
3390
|
+
Vn as FiatCurrencyModal,
|
|
3391
|
+
ot as FiatFlag,
|
|
3392
|
+
_n as FormSkeleton,
|
|
3393
|
+
lt as GenericCoinIcon,
|
|
3394
|
+
bn as GooglePayIcon,
|
|
3395
|
+
Lt as MOCK_RATES,
|
|
3396
|
+
Rn as MenuIcon,
|
|
3397
|
+
$e as Modal,
|
|
3398
|
+
Nn as PayPalIcon,
|
|
3399
|
+
Mn as PaymentMethodSelector,
|
|
3400
|
+
Hn as ProcessingStep,
|
|
3401
|
+
Zn as RampForm,
|
|
3402
|
+
un as RampProvider,
|
|
3403
|
+
Cn as RevolutIcon,
|
|
3404
|
+
kt as SKINS,
|
|
3405
|
+
Ge as SearchInput,
|
|
3406
|
+
Gn as SettingsScreen,
|
|
3407
|
+
B as Skeleton,
|
|
3408
|
+
la as SkinSwatch,
|
|
3409
|
+
jn as ToggleSwitch,
|
|
3410
|
+
rt as formatOutput,
|
|
3411
|
+
at as getChainIconUrl,
|
|
3412
|
+
Ft as getCryptoIconUrl,
|
|
3413
|
+
pn as getFiatFlagUrl,
|
|
3414
|
+
aa as getMockRate,
|
|
3415
|
+
kn as getPaymentIcon,
|
|
3416
|
+
Kt as isStablecoin,
|
|
3417
|
+
yn as parseAmount,
|
|
3418
|
+
sn as useCheckoutIntent,
|
|
3419
|
+
ln as useQuotes,
|
|
3420
|
+
Se as useRamp,
|
|
3421
|
+
on as useRampConfig,
|
|
3422
|
+
cn as useTransaction
|
|
3417
3423
|
};
|
|
3418
3424
|
//# sourceMappingURL=index.js.map
|